Welcome! Log In Create A New Profile

Advanced

Help with game bug

Posted by AmitR 
Help with game bug
September 15, 2009 09:07AM
Hello
I'm currently working on a homebrew game with a friend, and we have a bug that we can't figure out how to fix.
The game crashes when it tries to draw the players. The code dump points to the following line: (in file object.cpp)
GRRLIB_DrawImg(x, y, image, angle, scaleX, scaleY, 0xFFFFFFFF);

The full source code is here

I'd be very grateful if you could help me fixing this problem.
Amit



Edited 1 time(s). Last edit at 09/15/2009 04:24PM by AmitR.
Re: Help with game bug
September 15, 2009 08:38PM
Are you aware that you are trying to allocate memory twice in tbody_tex. Once in the Game constructor and another time just after in main.cpp:
        game = new Game();

        tbody_tex = GRRLIB_LoadTexture(tankpng);
Game::Game() {
        u8 i;
        
        tbody_tex = GRRLIB_LoadTexture(tankpng);
If you have any problem with GRRLIB, don't hesitate to visit the official forum at [grrlib.santo.fr]
Re: Help with game bug
September 15, 2009 11:11PM
That was part of some testing I did trying to fix the problem. Foolish of me for not removing them ^^
Anyway, I found the problem and fixed it. Thanks anyway :)
Sorry, only registered users may post in this forum.

Click here to login