Hello everyone,
I am writing a game (duhh) but i got a strange problem. If i run this program in psplink it starts well. but after i started the menu about 7 times (starting tic tac toe) the background turns black and not all images are loaded anymore. It seems it crashed when i use "free(img->data)". When i run the program from my memorstick the whole background turns black and only two of the images are shown.
When it is unable to create the images every free() crashes.
Here are my complete sources. (My sound and image files are not included)
http://school.deparmey.nl/joris/TTTAOS.zip
The sources are in the src folder.
JDF/jdf.cpp is a file wchich contains code for my own Image file format (which contains RAW uncompressed data which i can copy direct to the ram.
GFX/jgfx.cpp contains the graphical part of my code.
The other files are obvious.
Can someone see what is the cause why it crashes?
and
Why does ik work (better) in PSPLINK?
PS. I know the loadingscreen is not verry useful at this time. But it is vissible for testing purposes to see if it is just working.
PSPS. I am also not quite sure what i have to use. delete of free().
Image allocating goes wrong.
Image allocating goes wrong.
Code: Select all
int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
}
On another forum i asked the sam question the said i screwed all the malloc/memset/free/delete up.Jim wrote:Almost perfect description of memory leak/heap corruption.
Jim
I fixed it now. It runs normal now
Code: Select all
int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
}