/***************************************************************************/ /* */ /* */ /* Raven 3D Engine */ /* Copyright (C) 1996 by Softdisk Publishing */ /* */ /* Original Design: */ /* John Carmack of id Software */ /* */ /* Enhancements by: */ /* Robert Morgan of Channel 7............................Main Engine Code */ /* Todd Lewis of Softdisk Publishing......Tools,Utilities,Special Effects */ /* John Bianca of Softdisk Publishing..............Low-level Optimization */ /* Carlos Hasan..........................................Music/Sound Code */ /* */ /* */ /***************************************************************************/ #include #include #include #include #include "d_global.h" #include "d_video.h" #include "r_public.h" #include "d_misc.h" #include "d_ints.h" #define getbyte() chunkbuf[bufptr++] #define getword() chunkbuf[bufptr] + (chunkbuf[bufptr+1]<<8); bufptr+=2 /**** TYPES ****/ typedef signed char shortint; /* FLI file header */ #pragma pack(1) typedef struct { longint size; word signature; word nframes; word width; word height; word depth; word flags; word speed; longint next; longint frit; byte padding[102]; } fliheader; /* individual frame header */ typedef struct { longint size; word signature; word nchunks; byte padding[8]; } frameheader; /* frame chunk type */ typedef struct { longint size; word type; } chunktype; /**** VARIABLES ****/ #pragma pack(4) static fliheader header; static int currentfliframe, bufptr; static byte *chunkbuf; static byte flipal[256][3]; /**** FUNCTIONS ****/ void fli_readcolors(void) /* read a color chunk */ { int i, j, total; word packets; byte change, skip; byte *k; packets=getword(); for (i=0;i