// WuerfelAnimator *PROFESSIONAL*, // a totally useless tool, // by Felix Domke // // missing features: - delta-compression (dltrle) // - startframe // - palette optimization(!), not just a "cut-the-first-16-colors", a "search-16-irrelevant-colors-and-remove-them" would be better // features: - input format: pcx // - palette "optimization" // - output format: CPANIM 1.0, 2.0 // - rle-compressed // - strangeframeoptimization for small & slow anims // code needs some cleanup, but works quite perfect ;) #include #include #include #include //#include "ptypes.h" typedef uint8_t uint1; int LoadPCX(FILE *fp, uint1 *outpix, uint1 * pal, int* width, int* height); void OptimizePalette(char *picture, int bytes, char *srcpal, char *pal); int GetClosestColor(char *pal, int r, int g, int b); struct cpaniheaderstruct { char id[8]; // CPANI<1a><0><0> char junk[32]; short wuerfelframes; short wuerfelstframes; short flags; // rle=1, dlt=2, 2.0=4 short junk2; short codelenslen; short pallen; }; int main(int argc, char **argv) { printf("WuerfelAnimator *PROFESSIONAL* (c) 1998 by Felix Domke\n"); if(argc!=3) { printf("Usage: %s