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

Mitchell Stokes mitchell at daboys4u.com
Sun Jan 18 02:38:23 CET 2009


This is in the tracker here:
http://projects.blender.org/tracker/index.php?func=detail&aid=18181&group_id=9&atid=306

>From the tracker post:

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.


More information about the Bf-committers mailing list