Hello Ladies and Guys from SFML
i m developing my own Sonic game, and my poor hedgehog runs out of memory ... my PC has 2 GB RAM, and my application uses at most 150 MB ... here you can see the program, and how it crashes at Zone 3 Act 1 or 2
https://www.dropbox.com/s/9ikj1kbm53oqpp3/Sonic%20the%20Hedgehog%20by%20Pablito.rarReally i don t know if this has to do with SFML, or just with C# ... or perhaps with both
However it is, i would apreciate your help very much - if possible - ; otherwise, thanks the same, and sorry if this topic does nt concern to SFML
Respecting to the code that is always requested when posting, i don t know what files, classes, or methods to paste here, because (i understand) the program is an integrated system, then the error could be at any place, note that it is a runtime error, those are the most difficult to detect
i would have no problem to send or upload the entire code, or just the files (3 or 4) where it would be more probable the error is
Actually, the OutOfMemoryException is thrown ALWAYS by the Image() constructor at loading Zone3Act1.jpg, from where I suposse it could be a circumstance of the (SFML) Image class ... i mean, the Exception could have been thrown while assigning:
attribs = new byte[XLIM, YLIM]; // XLIM = 20000, YLIM = 2000
that occurs just before attempting to load the Image
The Images (2) fore and background, are loaded and splitted (as Laurent taught me) into 1000x1000 Texture[,] (local) and them, placed into (class members) Sprite[,] sprite, bksprite
If i should explain myself better, please let me know
Thanks for advance
Pablo