Passing values to SDL_LoadBMP strangeness

Apprentice
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).
Ninja
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 11,274 Feb 18, 2011 01:54 AM
Last Post: Holmes
  Changing Pixel Values using CG LIPH700 1 4,635 Nov 25, 2010 03:17 PM
Last Post: SethWillits
  glut polygon winding strangeness OptimisticMonkey 2 3,133 Sep 7, 2009 06:27 PM
Last Post: OptimisticMonkey
  Reading texture colors values Leroy 6 4,833 Jul 24, 2007 10:06 PM
Last Post: Leroy
  "Inconsistent set of values to create NSBitmapImageRep" Help! Joseph Duchesne 2 6,032 Sep 30, 2005 05:32 PM
Last Post: Joseph Duchesne