Mail Archives: djgpp/1996/12/18/02:29:43
From: | "Chris" <dingfam AT imag DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Allegro packfile help
|
Date: | 18 Dec 1996 03:19:04 GMT
|
Organization: | DINGWALL+DINGWALL
|
Lines: | 36
|
Message-ID: | <01bbec92$7ac48360$50ddf4cc@express.ca.express.ca>
|
NNTP-Posting-Host: | lunacy.imag.net
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hi there!
I have a struct which looks like this:
#include "allegro.h"
struct sprite
{
int x,y;
int w,h;
int counter,
int num_frames;
int curr_frame,
RLE_SPRITE *frames[MAX_FRAMES]; // 10
} sprite;
(you can download the actual thing at
http://www.cybercity.hko.net/vancouver/cdingwall/coding/dirty.zip)
Anywazz..
now i want to save this sprite structure to a file (with Allegro's pack_*
routines).
e.g.
pack_mputw(s->x, fl);
pack_mputw(s->y, fl);
etc...
for(i=0; i< s->num_frames; i++) { // save the RLE images
pack_mputw(s->frames[i]->w, fl);
pack_mputw(s->frames[i]->h, fl);
pack_fwrite(s->frames[i]->dat, s->frames[i]->size, fl);
and then the opposite (s->x = pack_mgetw();) for the loading stuff
the code itself generates no compiler errors, but crashes evertime i use
it.
if anymore information is needed, please email.
Please help,
chris
- Raw text -