On 09/07/2008, css <[EMAIL PROTECTED]> wrote:
>  Since the coredumps of SBCL are about 25 Megabytes anyway, I am
>  thinking of including the Images (which are not so big) and maybe
>  sounds for my program inside them directly, such, that one coredump
>  has all the images included, and I do not need to have multiple files.
>  A simple way would be to simply save the whole image in a
>  twodimensional Array - but this then needs too much Space, and I would
>  have to draw them at every load-time, which takes a long time.
>
>  Most of the images are PNG-Images. What I want to do is load them into
>  a byte-sequence (thats easy, simple read the files into a Sequence),
>  and then use sdl-image:load-image or something similar with the
>  image-code I have loaded into the byte-sequence (i.e. I want to read
>  the File myself, and then pass the Image-Code to some function).
>
>  Is this somehow possible? I dont actually understand the "RWOPS"-Stuff
>  related to it. I would appreciate any suggestion.
>

Hi Christoph

Sounds like a good idea.

http://gpwiki.org/index.php/SDL:Tutorials:Displaying_a_Bitmap_from_a_Custom_Resource_File_using_SDL_RWops

This web page shows you what you need to do in C. So what you'd need
to do is load the bmp or png as a binary file into an array of bytes.

When you load your image you need to allocate an array of unsigned
char, using cffi, and copy the lisp byte array into this one, as I
don't think SDL will like the binary format of the lisp array.

The you should be able to copy this roughly into lispbuilder-sdl calls...

SDL_RWops *rw = SDL_RWFromMem(buffer, filesize);
SDL_Surface *temp = SDL_LoadBMP_RW(rw, 1);

Something like this

(setf rw (sdl-cffi::sdl-rw-from-mem buffer size))
(setf temp (sdl-cffi::SDL-Load-BMP-RW rw 1))

Hope this helps,

Justin
_______________________________________________
application-builder mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to