|
|
@@ -110,8 +110,6 @@ int main(int argc, char** argv)
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- printf("Debug: w = %d, h = %d, channels = %d\n", header.width, header.height, channels);
|
|
|
|
|
|
// Determine image type (compressed/uncompressed) and call proper function to load TGA
|
|
|
switch (header.image_type)
|
|
|
@@ -119,18 +117,16 @@ int main(int argc, char** argv)
|
|
|
case 0:
|
|
|
{
|
|
|
printf("Fatal: The resource does not contain image data. Aborting.");
|
|
|
- return -1;
|
|
|
+ exit(-1);
|
|
|
}
|
|
|
case 2:
|
|
|
{
|
|
|
- printf("Debug: loading uncompressed...\n");
|
|
|
load_uncompressed(image_data, src_file, header.width, header.height, channels);
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case 10:
|
|
|
{
|
|
|
- printf("Debug: loading compressed...\n");
|
|
|
load_compressed(image_data, src_file, header.width, header.height, channels);
|
|
|
break;
|
|
|
}
|
|
|
@@ -138,14 +134,9 @@ int main(int argc, char** argv)
|
|
|
default:
|
|
|
{
|
|
|
printf("Fatal: Image type not supported. Aborting.");
|
|
|
- return -1;
|
|
|
+ exit(-1);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // FIXME Fixed options for now until proper settings management implemented
|
|
|
- TextureMode mode = TM_MODULATE;
|
|
|
- TextureFilter filter = TF_BILINEAR;
|
|
|
- TextureWrap wrap = TW_REPEAT;
|
|
|
|
|
|
// Open output file
|
|
|
FileStream* dest_file = (FileStream*)fs_root.open(resource_out, SOM_WRITE);
|
|
|
@@ -154,8 +145,7 @@ int main(int argc, char** argv)
|
|
|
archive_entry.name = resource_basename_hash;
|
|
|
archive_entry.type = resource_extension_hash;
|
|
|
archive_entry.offset = sizeof(ArchiveEntry);
|
|
|
- archive_entry.size = image_size * channels + sizeof(PixelFormat) + sizeof(uint16_t) * 2 +
|
|
|
- sizeof(TextureMode) + sizeof(TextureFilter) + sizeof(TextureWrap);
|
|
|
+ archive_entry.size = image_size * channels + sizeof(PixelFormat) + sizeof(uint16_t) * 2;
|
|
|
|
|
|
// Write out the archive entry
|
|
|
dest_file->write(&archive_entry, sizeof(ArchiveEntry));
|
|
|
@@ -165,10 +155,6 @@ int main(int argc, char** argv)
|
|
|
dest_file->write(&header.width, sizeof(uint16_t));
|
|
|
dest_file->write(&header.height, sizeof(uint16_t));
|
|
|
|
|
|
- dest_file->write(&mode, sizeof(TextureMode));
|
|
|
- dest_file->write(&filter, sizeof(TextureFilter));
|
|
|
- dest_file->write(&wrap, sizeof(TextureWrap));
|
|
|
-
|
|
|
dest_file->write(image_data, image_size * channels);
|
|
|
|
|
|
// Done, free the resources and exit
|