Page MenuHome

[bugfix][patch] Fixing some blenderplayer arguments ("-c", "-w", "-f")
Closed, ArchivedPublic

Description

I found out the other day that by using a bundled runtime the following would not work correctly "game -w 100 100 800 600". I would always get warnings that I didn't have enough arguments. However, "blenderplayer -w 100 100 800 600 game.blend" would work just fine. After messing around with things, I found out the same was true for -f. I found that in GPG_Ghost.cpp, there is an if statement that checks to see if there are enough arguments. Like, for -f it would be something like if ((i + 2) < argc && someotherstuff). So, "game -f 800 600" would be 3 arguments, but (i + 2) = 3, which is less than 3. It worked with blenderplayer since it had the extra argument for the .blend file. So, I changed it to <=.

Aside from fixing that, I made the position arguments for the -w argument optional.

And one last thing, I noticed that for Windows, there is a "-c" argument to UNhide the console. Well, the console isn't hidden by default so I looked into it. All of the stuff for the argument was still in place, except the one part that actually did the work, "::FreeConsole()" was commented out. I don't know why it was commented out (there was nothing about it in the commit logs), but now it works fine.

Event Timeline

I couldn't find an edit button, so I'll just post a comment. The line:

but (i + 2) = 3, which is less than 3

Should be:

but (i + 2) = 3, which is NOT less than 3

I made a few adjustments. Now, as it used to be, -w and -f don't require any parameters. If none are specified, the defaults are used. This way a user can just switched to windowed (or fullscreen) with out having to worry about the other settings. I also updated the usage text to reflect this.

Also, I ran more tests concerning the console. One possibility that came up was it may have been turned off to get screensavers working better. However, screensavers work just fine, in fact they work better, with the console hidden. Now when a user selects their screensaver, a console doesn't have to come up just to display the preview on the computer picture.

The updated patch is gpg_ghost2.patch and was made off of revision 18632.

patch commited.

Thanks for the good work.

Benoit Bolsee (ben2610) changed the task status from Unknown Status to Archived.Feb 28 2009, 10:44 PM