[SDL] libpng error: decompression error.
evilazrael at evilazrael.de
Mon Jul 19 23:54:40 PDT 2010
Am 20.07.2010 08:33, schrieb mike:
> Hi Donny
> yes you might be wright so maybe you could help me move SDL_Surface out of the
> function? This should be the way to go?
> Anyway i tried as below and still randomly the error occurrs with 2-3 out of 4
> png textures.
> /// Loads one texture
> int LoadGLTexture(char *pFileName, int TextureId)
> SDL_Surface* lotto[TextureId];
> SDL_RWops *rwop;
> rwop=SDL_RWFromFile(TextureFileName, "rb");
Using RWops here makes it more complicated but still not correct. When
you declare an array int xyz you have the elements xyz..xyz.
You are writing to xyz, so you are writing in space that is probably
not belonging to you and in every case is not in your array. Go fetch a
> int lotto;
Where is this declaration? It will still be shadowed by the local
declaration in the function.
More information about the SDL