Comment 1 for bug 243352

Revision history for this message
Thunor (thunor) wrote :

I hacked my copy of the source. This is what I did :-

Delete FN_COLOR_DEPTH from fn.h

In every function that uses FN_COLOR_DEPTH except main, place "int color_depth = SDL_GetVideoSurface()->format->BitsPerPixel;" at the top and change FN_COLOR_DEPTH to color_depth.

There is one problem: the tiles are loaded before the video mode is set, and fn_tile_load in fn_tile.c creates surfaces and it needs to know the screen bpp! The SDL docs state that SDL_CreateRBGSurface must be called after SDL_SetVideoMode, so you should set the video mode first and then load the tiles -> http://www.libsdl.org/cgi/docwiki.cgi/SDL_CreateRGBSurface

Also I noticed that you are not calling SDL_Quit(), or I can't find it. This is important -> http://www.libsdl.org/cgi/docwiki.cgi/SDL_Quit

Regards