Ways of storing media?

BlitzMax Forums/BlitzMax Beginners Area/Ways of storing media?

Grisu(Posted 2004) [#1]
Hi!

1. I'm having problems with getting the INCBIN command working:
The following source compiles without error, but when I want to access the image the debugger states its a NULL object and terminates the program.
Any ideas what's causing this?

{Codebox}
Incbin "Data\panel_main.png"

Graphics 800,600,0

Global Panel_Main=LoadImage("incbin::Data\panel_main.png", Maskedimage)
{/Codebox}


2. Has anyone written some kind of datapacker for bmax yet?
I need to store a large amount of media files in one! external! file, that I can be used (extracted) by my program. No compressen or encryption needed!

Any hints are welcome. :(


Wiebo(Posted 2004) [#2]
Use forward slashes?


tonyg(Posted 2004) [#3]
Grisu,
Sorry for giving you the runaround but I didn't realise you were using a sub-directory.
You'll have to use data/panel_main.png (forward rather than back slash).


Grisu(Posted 2004) [#4]
yepp.. that was it for no. 1. Thanks!


Dreamora(Posted 2004) [#5]
2. BM has zlib support so you can use zip files for external packaging ( see pub.zlib )


Grisu(Posted 2004) [#6]
Sounds great!

As always the docs reference isn't that.... complete / understandable.

How would I uncompress a single file within a Zip so I can load it up in bmax?

uncompress( dest:Byte Ptr,dest_len Var,source:Byte Ptr,source_len )?!?


Hotcakes(Posted 2004) [#7]
Have a look for TommyBear's helper ZLib module. That will make things just that much easier...


Grisu(Posted 2004) [#8]
Yepp, found it: http://www.blitzbasic.com/Community/posts.php?topic=41626

Only one problem left:
How do I read extracted data stored in RAM?