[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SDL] Why using resources by file names? (fwd)
Chris, you might want to plug your "wad" loader here, if it's mature enough...
Just reply to me, and I'll forward the messages, if you're not already on the
SDL mailing list.
Forwarded message: -------------------
Date: Mon, 5 Oct 1998 07:18:06 -0700
From: Sam Lantinga <slouken@devolution.com>
Subject: Re: [SDL] Why using resources by file names?
> Well, I agree that SDL should be kept as light-weight as possible, but
> as Sam said, loading BMPs and WAVs helps people (like me) who don't
> want to muck around with writing their own loaders, and knowing the
> internals of the SDL media formats. Personally, I'd like to see
> something that can be dropped into SDL that will load arbitrary files
> from other files (Perhaps using a callback function to handle the
> nitty-gritty of file encryption/compression), but I don't have the
> talent to write it myself. It's a catch-22.
It is a catch-22, and this sort of thing is a perfect candidate for the
examples and demos archive. :)
PenguinPlay, http://sunsite.auc.dk/penguinplay/, is trying to be a general
game development platform, much more high level than SDL, but they are
trying to do things like create general file loading routines and so forth.
They are a work in progress, so as far as I know they don't have any usable
code yet, but I'll CC this to the PenguinPlay list and let them comment. :)
> >> If people really want fancy compressed formats, they could create a pipe
> >> and a thread to feed it. (or would this be too inefficient?)
> > That is a good idea, covering all needs. On the other hand, as far as
> > I know, it would not work on Windows. So your code would no longer be
> > portable.
> I really don't understand why it wouldn't work on Windows. I mean, WAV
> and BMP files are first and foremost data files, and should be readable
> by FREAD and such.
I think he was referring to the use of a thread as a general data source,
and yes, this can be done with any OS that has a decent level of thread
support. You could do this on all of Linux/Win32/BeOS, but you'd still
have the problem of not being able to seek within the datastream, unless
you send a "seek" message to the thread and let it sort out the details.
It would also allow you to do "asynchronous" I/O, in which you can ask it
to read large files from disk and continue, say, data structure initialization.
It's an interesting idea. :)
See ya!
-Sam Lantinga (slouken@devolution.com)
--
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/
--
------------------- end forwarded message.
See ya!
-Sam Lantinga (slouken@devolution.com)
--
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/
--