[SDL] Appending resources to .exe

Martin Storsjö martin at martin.st
Thu Apr 5 03:39:22 PDT 2007


On Thu, 5 Apr 2007, Steaphan Greene wrote:

> If I remember correctly, this is because the MP3 loading code, and many
> others, do a SEEK_SET or SEEK_END style seek, meaning relative to the
> overall beginning or end of your stream, not relative to where you tell
> it to start.  This is due to the headers and organization of these
> filetypes.  It is totally possible to fix this with a custom replacement
> for the SDL_RWOps structure created by the RWOps open function with
> custom functions which artificially restrict this seeking and even
> reading/writing manually based on the ranges you give it.  I believe
> I've even done this, but can't seem to locate my code for it at the
> moment.

Yes, that's probable. I earlier posted code for doing exactly that, 
creating a SDL_RWops structure from a section of a file.

But since Andre said he's using on-the-fly decompression using bzip2, I 
assumed that he ends up with one memory block for each logical file, and 
creates one SDL_RWops structure for each of them, with the correct start 
and ending. If not, that's how it should be done.

// Martin


More information about the SDL mailing list