Updated tools to use IMG instead of STA.
This commit is contained in:
parent
7b7dffad7a
commit
0be3ee69ba
6 changed files with 22 additions and 16 deletions
|
@ -27,21 +27,21 @@ void convertColor(char *filename, char *basename, bool showIt) {
|
|||
colors = image->format->palette->ncolors;
|
||||
c = image->format->palette->colors;
|
||||
|
||||
jlStaT *sta = NULL;
|
||||
jlStaCreate(sta);
|
||||
jlImgT *img = NULL;
|
||||
jlImgCreate(img);
|
||||
|
||||
for (int x=0; x<colors; x++) {
|
||||
sta->palette[x].r = c[x].r / 16;
|
||||
sta->palette[x].g = c[x].g / 16;
|
||||
sta->palette[x].b = c[x].b / 16;
|
||||
//printf("Palette %03d = R%03d G%03d B%03d\n", x, sta->palette[x].r, sta->palette[x].g, sta->palette[x].b);
|
||||
img->palette[x].r = c[x].r / 16;
|
||||
img->palette[x].g = c[x].g / 16;
|
||||
img->palette[x].b = c[x].b / 16;
|
||||
//printf("Palette %03d = R%03d G%03d B%03d\n", x, img->palette[x].r, img->palette[x].g, img->palette[x].b);
|
||||
}
|
||||
|
||||
if (colors < 16) {
|
||||
for (int x=colors; x<16; x++) {
|
||||
sta->palette[x].r = 0;
|
||||
sta->palette[x].g = 0;
|
||||
sta->palette[x].b = 0;
|
||||
img->palette[x].r = 0;
|
||||
img->palette[x].g = 0;
|
||||
img->palette[x].b = 0;
|
||||
//printf("Palette %03d = R000 G000 B000 (added)\n", x);
|
||||
}
|
||||
}
|
||||
|
@ -51,22 +51,22 @@ void convertColor(char *filename, char *basename, bool showIt) {
|
|||
for (int x=0; x<image->w; x+=2) {
|
||||
//printf("%02X %02X ", getPixel(image, x, y), getPixel(image, x + 1, y));
|
||||
// These are backwards - no idea why yet.
|
||||
sta->pixels[p].r = (unsigned char)getPixel(image, x, y);
|
||||
sta->pixels[p++].l = (unsigned char)getPixel(image, x + 1, y);
|
||||
img->pixels[p].r = (unsigned char)getPixel(image, x, y);
|
||||
img->pixels[p++].l = (unsigned char)getPixel(image, x + 1, y);
|
||||
}
|
||||
}
|
||||
|
||||
jlStaSave(sta, basename);
|
||||
jlImgSave(img, basename);
|
||||
|
||||
SDL_FreeSurface(image);
|
||||
|
||||
if (showIt) {
|
||||
jlStaDisplay(sta);
|
||||
jlImgDisplay(img);
|
||||
jlDisplayPresent();
|
||||
jlKeyWaitForAny();
|
||||
}
|
||||
|
||||
jlStaFree(sta);
|
||||
jlImgFree(img);
|
||||
}
|
||||
|
||||
|
||||
|
@ -193,7 +193,7 @@ int main(int argc, char *argv[]) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
jlUtilStartup("STA/STN Converter");
|
||||
jlUtilStartup("IMG/STN Converter");
|
||||
|
||||
int imageFlags = IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF;
|
||||
int imageResult = IMG_Init(imageFlags);
|
||||
|
|
Binary file not shown.
BIN
joeylib/src/font.xcf
(Stored with Git LFS)
Normal file
BIN
joeylib/src/font.xcf
(Stored with Git LFS)
Normal file
Binary file not shown.
Binary file not shown.
BIN
joeylib/src/kanga.xcf
(Stored with Git LFS)
Normal file
BIN
joeylib/src/kanga.xcf
(Stored with Git LFS)
Normal file
Binary file not shown.
|
@ -49,7 +49,7 @@ fi
|
|||
|
||||
# Call custom converter
|
||||
${JOEY}/utils/imgconvert "${FILENAME}-DoNtEvErDoThIs-1.png" "${FILENAME}-DoNtEvErDoThIs-2.png" "${NAME}"
|
||||
mv "data/${NAME}.sta" .
|
||||
mv "data/${NAME}.img" .
|
||||
|
||||
# Remove data folder if we created one
|
||||
if [[ "${HASDATA}" -eq "0" ]]; then
|
Loading…
Add table
Reference in a new issue