I am having a problem with the sprite routines for my PowerPak lib. I
was moving right along and hoped to finish all of the functions today,
but decided to stop and make an example and test what I had and had
The way I have it set up there is a structure called PD_Sprite.
PD_Sprite has in it an array of pointers to an SDL_Surface. The purpose
of this is so that all of the frames of the sprite are in the structure
and the lib will handle animation for the user.
The problem is my program doesn’t seem to like having an array of
pointers to SDL_Surface. Anytime I call a function that tries to access
one of these (except in some cases the first one, which would make sense
because that is the beginning of the memory, so it might be more likely
to work as opposed to memory the computer has to “find”, right?) the
program just exits. It doesn’t dump core but it exits prematurely, like
it would if it ran into an error handler, except all my error handlers
would tell me the problem and it doesn’t tell me anything.
If anybody knows anything about gdb here is what it says when I run a
function that uses a for statement and free Sprite->frame[i]:
0x401729eb in _SDL_FreeSurface ()
If I try to initialize one of the frames with imglib It gives me this,
Program received signal SIGSEGV, Segmentation fault.
0x0 in ?? ()
even when compiled with -g it gives me that. Why can’t it find the
If anybody can help me with the debugging process I would be very