So I am working on a project with irrlicht, and I am putting together a really basic binary for my mappers to run their maps in. Its basically just Tutorial 7 with some small changes. The change thats killing me is accepting 2 command line arguments to define the pk3 flie and the bsp within it. The idea is this:
maptest MyPak.pk3 MyMap.bsp
This would then cause irrlicht to load the pk3 file in a predefined directory, and then load the bsp specified.
So I altered the main() function declaration to:
Then inside the program I attempt to access the argv[1] and argv[2]. It compiles fine, but segmentation faults when it runs as soon as it hits an argv[] variable.
Code: Select all
char *mappackage;
sprintf (mappackage, "./maps/", "", argv[1]);
The code never gets past the argv, it just dumps. Don't hold me to the exact syntax, I hate C++, I am so a PHP programmer, its just really hard for me to drop back to C++ syntax, I am used to combing a string in php by just doing this:
Not to mention the strict variable type declarations kill me; don't even get me started on pointers.
So whens that PHP binding for irrlicht going to be done?