.conf /.cfg?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: .conf /.cfg?
Yes. We didn't think about it. Do you want to be able to use .cfg as well? Is this good for anything? Rude?
Now posting IN STEREO (where available)
Re: .conf /.cfg?
I might be wrong about this but typical configuration filenames in linux end with .conf and in windows they end with .cfg? Or is it just microsoft that uses .cfg for some office (or visual studio) files?
Anyways, personally i think it doesn't really matter.
Anyways, personally i think it doesn't really matter.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: .conf /.cfg?
I'm thinking
There's nothing against either, and it seems to be whatever the programmer thinks of first.
I mean conf and cfg are both used, and as u9_ says I guess Linux uses conf more.thoughts wrote:why not?
There's nothing against either, and it seems to be whatever the programmer thinks of first.
Re: .conf /.cfg?
This is an issue that comes up now and then: where do we stand on enforcing our way vs allowing for other ways of doing things. On one hand it would probably be good for the person who has used cfg files elsewhere, but would the increase in code, file size and processing time really be worth it to appease that one guy? It's such a small thing to be concerned about (wouldn't be much work either), but in the long run it would be counter-productive to always bend LÖVE to people's every whim as the end result would be a bloated piece of software that tries to please everyone.bartbes wrote:I'm thinkingthoughts wrote:why not?
I am still unsure about this so I will leave it to rude to decide it's fate. I could go either way...
Now posting IN STEREO (where available)
Re: .conf /.cfg?
So a bit of lua history: it was originally designed as a configuration language.
This is lua's strong suit, and the love infrastructure already provides the ability to do this in a simple manner: it's called the load function. If you have your configuration settings in a file called 'something.conf', this should work:
The only thing to remember is that the file that you load must conform to lua syntax, but this is an advantage since this is exactly the kind of the task lua syntax is optimized for.
This is lua's strong suit, and the love infrastructure already provides the ability to do this in a simple manner: it's called the load function. If you have your configuration settings in a file called 'something.conf', this should work:
Code: Select all
function load()
dofile 'something.conf' -- load in the settings
-- etc
end
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: .conf /.cfg?
I actually used the following code to create a (personal) hook program:
And it works as intended, only problem is that the window "opens" twice.
It appears, and quickly disappears, only to appear again (however, this takes 1 sec, and it might have to do something with the amount of code in front of that).
Code: Select all
love.filesystem.include("game.conf")
if not width then width = love.graphics.getWidth() end
if not height then height = love.graphics.getHeight() end
if not fullscreen then fullscreen = false end
if not vsync then vsync = false end
if not fsaa then fsaa = 0 end
love.graphics.setMode(width, height, fullscreen, vsync, fsaa)
love.graphics.setCaption(title)
It appears, and quickly disappears, only to appear again (however, this takes 1 sec, and it might have to do something with the amount of code in front of that).
Re: .conf /.cfg?
Use display_auto = false in the config file if you want the create the initial window yourself.
If you use love.system.restart(), you should also check whether a window is already created, like this:
About .conf vs .cfg: this is probably the first really pointless discussion here so far.
EDIT:
If you use love.system.restart(), you should also check whether a window is already created, like this:
Code: Select all
if not love.graphics.isCreated() then
love.graphics.setMode( ... )
end
EDIT:
Code: Select all
-- I would not do this:
if not width then width = love.graphics.getWidth() end
if not height then height = love.graphics.getHeight() end
-- This is more like it:
if not width then width = 800 end
if not height then height = 600 end
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: .conf /.cfg?
Looks like nothing is going to change
@rude:
Well it was just a personal thingy, not made for performance or whatever.
@rude:
Well it was just a personal thingy, not made for performance or whatever.
Re: .conf /.cfg?
ACTUALLY...
*.conf DOES use ONE WHOLE EXTRA BYTE of RESOURCES because of the extra letter (*.cfg has only three). So technically, it will take a few more CPU cycles to parse that string.
Also, I'm pretty sure it will use some more cycles looking the file up on the drive.
*.conf DOES use ONE WHOLE EXTRA BYTE of RESOURCES because of the extra letter (*.cfg has only three). So technically, it will take a few more CPU cycles to parse that string.
Also, I'm pretty sure it will use some more cycles looking the file up on the drive.
Who is online
Users browsing this forum: No registered users and 3 guests