|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include <stdio.h></stdio.h>
|
|
Toshihiro Shimizu |
890ddd |
#include <stdlib.h></stdlib.h>
|
|
Toshihiro Shimizu |
890ddd |
#include <string.h></string.h>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#define _TOONZ_PROTOTYPES_
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "file.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "version.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "security.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void main(int argc, char *argv[]) {
|
|
Shinya Kitaoka |
120a6e |
char outname[512], inname[512], *boh;
|
|
Shinya Kitaoka |
120a6e |
int len, i, j, total;
|
|
Shinya Kitaoka |
120a6e |
IMAGE *img = 0, *newimg = 0;
|
|
Shinya Kitaoka |
120a6e |
struct cmap_color *cmap;
|
|
Shinya Kitaoka |
120a6e |
struct gl_color *gl_buffer;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
toonz_init(DUMMY_KEY_SLOT, (int *)&argc, argv);
|
|
Shinya Kitaoka |
120a6e |
InibisciDongle();
|
|
Shinya Kitaoka |
120a6e |
unprotect_lib();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
if (argc < 3) {
|
|
Shinya Kitaoka |
120a6e |
printf(" %s error: missing argument\n", argv[0]);
|
|
Shinya Kitaoka |
120a6e |
printf(" usage: %s infile outfile\n", argv[0]);
|
|
Shinya Kitaoka |
120a6e |
exit(0);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
if (*argv[1] == '-') {
|
|
Shinya Kitaoka |
120a6e |
printf("bad filename <%s> \n", argv[1]);
|
|
Shinya Kitaoka |
120a6e |
exit(0);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
strcpy(inname, argv[1]);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
if (argc > 2)
|
|
Shinya Kitaoka |
120a6e |
strcpy(outname, argv[2]);
|
|
Shinya Kitaoka |
120a6e |
else
|
|
Shinya Kitaoka |
120a6e |
strcpy(outname, argv[1]);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
printf(">> Loading %s\n", inname);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
img = img_read(inname);
|
|
Shinya Kitaoka |
120a6e |
if (!img) {
|
|
Shinya Kitaoka |
120a6e |
printf("file %s not found\n", inname);
|
|
Shinya Kitaoka |
120a6e |
exit(0);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
printf(">> Writing %s\n", outname);
|
|
Shinya Kitaoka |
120a6e |
if (!img_write_plt(outname, img)) {
|
|
Shinya Kitaoka |
120a6e |
printf("non sono stato in grado di scrivere: %s\n", outname);
|
|
Shinya Kitaoka |
120a6e |
exit(0);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
newimg = img_read_plt(outname);
|
|
Shinya Kitaoka |
120a6e |
if (!newimg) {
|
|
Shinya Kitaoka |
120a6e |
printf("file %s not found\n", outname);
|
|
Shinya Kitaoka |
120a6e |
exit(0);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
boh = "MAMMA.cmap";
|
|
Shinya Kitaoka |
120a6e |
printf(">> Writing %s\n", boh);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
img_write_ciak(boh, newimg);
|
|
Shinya Kitaoka |
120a6e |
printf(">> Riprovami e non te ne pentirai!! <<\n");
|
|
Toshihiro Shimizu |
890ddd |
}
|