[SDL] Creating tiles
Peter Mulholland
darkmatter at freeuk.com
Tue Dec 12 12:53:59 PST 2006
Hello Ochal,
Tuesday, December 12, 2006, 8:41:00 PM, you wrote:
> Hi all,
> I'm currently trying to write a routine to load tiles into an array of
> *surfaces from a png file, but BlitSurface fails to copy the parts of
> the image into the proper cells of the array.
> I'm hoping someone can tell me what i did wrong.
> Oh, the tiles are actually used to hold a fixed width font sized 10*10.
<snip>
1) Don't do this - you will be wasting RAM. Keep your font as one big
surface, and use appropriate rects to cut out the letters when you
render the text
2) Your tiles array will be full of NULL pointers, so
SDL_BlitSurface() fails as it doesn't create surfaces.
--
Best regards,
Peter mailto:darkmatter at freeuk.com
More information about the SDL
mailing list