Passing values to SDL_LoadBMP strangeness

Posts: 17
Joined: 2005.08
Post: #1
Hi All,

I've been working on an issue that I've got at the moment. I've found a workaround, but am interested if anyone could offer a suggestion of why it behaves this way.

Im basically drawing a set of tiles to a surface. The tiles are defined as a class (containing an SDL_Surface* and other values). I have a tile cache, which is created by loading a whole heap of BMP's into an array of tiles. The Tile cache is a data member of a singleton class.

When it comes to loading up the tiles on the surface, I started to get Bus Error from SDL when I tried:

SDL_BlitSurface(tilecache[map[i][j]].img, &src, world, &dest)

If I did a straight replace of the tilecache with a fresh SDL_LoadBMP, I had no problem. I could also check the titlecache item and prove it wasnt null. So somehow SDL wasnt getting the image from the tilecache passed correctly Sad

Anyone else had anything similar?

(My work around basically involves merging the tilecache loading and tile blitting function together. Not as efficient (as it will load the same tile multiple times) but at least it doesnt crash the app with a Bus error).
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  passing values from vertex to fragment shader Sumaleth 6 14,315 Feb 18, 2011 01:54 AM
Last Post: Holmes
  Changing Pixel Values using CG LIPH700 1 5,438 Nov 25, 2010 03:17 PM
Last Post: SethWillits
  glut polygon winding strangeness OptimisticMonkey 2 4,067 Sep 7, 2009 06:27 PM
Last Post: OptimisticMonkey
  Reading texture colors values Leroy 6 5,750 Jul 24, 2007 10:06 PM
Last Post: Leroy
  "Inconsistent set of values to create NSBitmapImageRep" Help! Joseph Duchesne 2 7,258 Sep 30, 2005 05:32 PM
Last Post: Joseph Duchesne