void* getEntryScript() { fseek(HE1_File, RoomResource->RMDA->ENCD - 4, SEEK_SET); uint32_t length; readU32LE(HE1_File, &length); length = SWAP_CONSTANT_32(length) - 8; void* data = malloc(length); readBytes(HE1_File, (uint8_t*)data, length); return data; }
Codec *createBitmapCodec(uint32 tag, int width, int height, int bitsPerPixel) { switch (tag) { case SWAP_CONSTANT_32(0): return new BitmapRawDecoder(width, height, bitsPerPixel); case SWAP_CONSTANT_32(1): return new MSRLEDecoder(width, height, bitsPerPixel); case SWAP_CONSTANT_32(2): return new MSRLE4Decoder(width, height, bitsPerPixel); case MKTAG('C','R','A','M'): case MKTAG('m','s','v','c'): case MKTAG('W','H','A','M'): return new MSVideo1Decoder(width, height, bitsPerPixel); case MKTAG('c','v','i','d'): return new CinepakDecoder(bitsPerPixel); case MKTAG('I','V','3','2'): return new Indeo3Decoder(width, height); case MKTAG('I', 'V', '4', '1'): case MKTAG('I', 'V', '4', '2'): return new Indeo4Decoder(width, height); case MKTAG('I', 'V', '5', '0'): return new Indeo5Decoder(width, height); #ifdef IMAGE_CODECS_TRUEMOTION1_H case MKTAG('D','U','C','K'): case MKTAG('d','u','c','k'): return new TrueMotion1Decoder(); #endif #ifdef USE_MPEG2 case MKTAG('m','p','g','2'): return new MPEGDecoder(); #endif case MKTAG('M','J','P','G'): case MKTAG('m','j','p','g'): return new MJPEGDecoder(); default: if (tag & 0x00FFFFFF) warning("Unknown BMP/AVI compression format \'%s\'", tag2str(tag)); else warning("Unknown BMP/AVI compression format %d", SWAP_BYTES_32(tag)); } return 0; }