[SDL] Function to load a BMP from a porton of a file
pvl at uh.cz
Thu Oct 17 04:26:00 PDT 2002
On Thu, Oct 17, 2002 at 09:18:50AM +0100, Matthijs Hollemans wrote:
> > I need a function that load a bmp from a portion of a file,
> > i am programing a game and i have all the images files and
> > i am going to put them into a file... one file...
> I do something similar in my game, except that I still use more than
> one file. Basically I put related images together, such as all the
> frames from a certain sprite. Then my game simply loads that whole
> bitmap into one SDL_Surface, and passes the rectangle corresponding
> to the current frame to SDL_BlitSurface. The advantage of this is
> that I don't have to load (and manage) a gazillion different
> bitmaps. Also, related graphics share the same surface, which
> guarantees that they will either all be in videomem (HWSURFACE) or
> all system memory (SWSURFACE).
Wouldn't it make for faster blitting if the image data were stored in a
contiguous memory region?
More information about the SDL