Thanks Steve, everything worked until I tried to set it up for how I wanted to handle it, so I could have multiple animations in one file. Now it crashes when it tries to play back from the file. a windows crash ie: "program name" has stopped working.
checking the animation file it looks packed correctly can you see anything off hand that I goofed on?
'*******$include: 'Zlib.bi'
$IF 32BIT THEN
DECLARE DYNAMIC LIBRARY ".\zlib1"
FUNCTION zlibVersion$ ()
FUNCTION zlibCompileFlags~& ()
FUNCTION compressBound& (BYVAL LEN AS LONG)
FUNCTION compress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
FUNCTION compress2& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG, BYVAL level AS LONG)
FUNCTION uncompress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
FUNCTION crc32~& (BYVAL PNGCRC AS LONG, BYVAL buf AS _OFFSET, BYVAL LEN AS LONG)
FUNCTION adler32~& (BYVAL adler AS LONG, BYVAL buf AS _OFFSET, BYVAL LEN AS LONG)
FUNCTION zError$ (BYVAL codenum AS INTEGER)
END DECLARE
$ELSE
DECLARE DYNAMIC LIBRARY ".\zlib"
FUNCTION zlibVersion$ ()
FUNCTION zlibCompileFlags~& ()
FUNCTION compressBound& (BYVAL LEN AS LONG)
FUNCTION compress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
FUNCTION compress2& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG, BYVAL level AS LONG)
FUNCTION uncompress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
FUNCTION crc32~& (BYVAL PNGCRC AS LONG, BYVAL buf AS _OFFSET, BYVAL LEN AS LONG)
FUNCTION adler32~& (BYVAL adler AS LONG, BYVAL buf AS _OFFSET, BYVAL LEN AS LONG)
FUNCTION zError$ (BYVAL codenum AS INTEGER)
END DECLARE
$END IF
SCREEN _NEWIMAGE(640, 400, 32)
P = _PIXELSIZE: IF P = 0 THEN P = 2 '0 is a designation for text screens, which use 2 bytes per character for memory storage
ScreenSize = _WIDTH * _HEIGHT * P
Frames = 48 'In our animation
UncompressedStringSize = Frames * ScreenSize 'the total size needed to store all the animation images, uncompressed (Should be about 48 MB)
UncompressedString$ = SPACE$(UncompressedStringSize) 'a placeholder for the whole animation, uncompressed.
SingleScreen$ = SPACE$(ScreenSize) 'a placeholder for a single screen worth of info
DIM Offs(48) AS LONG, Sizs(48) AS LONG
DIM m AS _MEM
m = _MEMIMAGE(0)
OPEN "Vortex.Ani" FOR BINARY AS #1
Elements% = 48 'number of frames
Offset& = 2 + 96 * 8 'begining offset of image data by 1 integer and 96 longs(48 for offsets, 48 for sizes)
FOR i = 0 TO 47 'Load images to store(vortex animation 0-47 images)
IF Temp& THEN _FREEIMAGE Temp&
f$ = "vortex " + LTRIM$(STR$(i)) + ".bmp"
Temp& = _LOADIMAGE(f$, 32)
_PUTIMAGE , Temp&, _DISPLAY
_MEMGET m, m.OFFSET, SingleScreen$ 'Get one screen of information
CompressedString$ = Deflate(SingleScreen$)
Image$ = Image$ + CompressedString$ 'place compressed image data in a temp string until we get them all done
Offs(i) = Offset&
Sizs(i) = LEN(CompressedString$)
Offset& = Offset& + Sizs(i)
_DELAY .05
NEXT
PUT #1, , Elements%
PUT #1, , Offs()
PUT #1, , Sizs()
PUT #1, , Image$
CLS
FOR i% = 0 TO 10
PRINT Offs(i%), Sizs(i%)
NEXT i%
SLEEP
CLS
DO
FOR i = 0 TO 47
temp$ = SPACE$(Sizs(i))
' temp$ = MID$(UncompressedString$, i * ScreenSize + 1, ScreenSize)
GET #1, Offs(i), temp$
PRINT "about to decompress!"
_DELAY 2.5
UncompressedString$ = Inflate(temp$)
PRINT "DECOMPRESSED!"
_DELAY 2.5
_MEMPUT m, m.OFFSET, UncompressedString$
_DELAY .1
NEXT
LOOP UNTIL INKEY$ = CHR$(27)
CLOSE #1
'*******$include:'Compress.bi'
FUNCTION Deflate$ (text$)
$CHECKING:OFF
DIM FileSize AS LONG, CompSize AS LONG
DIM m AS _MEM
FileSize = LEN(text$): CompSize = compressBound(FileSize)
m = _MEMNEW(FileSize)
_MEMPUT m, m.OFFSET, text$ 'set the variable length text into a memblock so it won't move in memory as we access it.
REDIM CompBuff(1 TO CompSize) AS _UNSIGNED _BYTE
Result = compress2(_OFFSET(CompBuff(1)), CompSize, m.OFFSET, FileSize, 9)
REDIM _PRESERVE CompBuff(1 TO CompSize) AS _UNSIGNED _BYTE
_MEMFREE m
m = _MEM(CompBuff())
Deflate$ = SPACE$(CompSize)
_MEMGET m, m.OFFSET, Deflate$
_MEMFREE m
Deflate$ = MKL$(FileSize) + Deflate$
$CHECKING:ON
END FUNCTION
FUNCTION Inflate$ (text$)
$CHECKING:OFF
DIM m AS _MEM, m1 AS _MEM
FileSize& = CVL(LEFT$(text$, 4))
text1$ = MID$(text$, 5): temp$ = SPACE$(FileSize&)
m = _MEMNEW(FileSize&): m1 = _MEMNEW(LEN(text1$))
_MEMPUT m1, m1.OFFSET, text1$
Result = uncompress(m.OFFSET, FileSize&, m1.OFFSET, LEN(text1$))
_MEMGET m, m.OFFSET, temp$
_MEMFREE m
_MEMFREE m1
Inflate$ = temp$
$CHECKING:ON
END FUNCTION
its crashing when it tries to INFLATE the data, that much I've isolated. you may have to put your "cheesy Animation" back in the code in place of the vortex images.