Przeglądaj źródła

Strip debug printfs

Daniele Bartolini 13 lat temu
rodzic
commit
4635407bfc

+ 0 - 16
tools/resource-compilers/resource-linker.cpp

@@ -66,12 +66,6 @@ int main(int argc, char** argv)
 		// If the archive is well-formed, read the archive header
 		archive->read(&header, sizeof(ArchiveHeader));
 	}
-	
-	// Print debug informations about the archive
-	printf("Info: Archive successfully opened.\n");
-	printf("Info: Version  = %d\n", header.version);
-	printf("Info: Entries  = %d\n", header.entries_count);
-	printf("Info: Checksum = %d\n", header.checksum);
 
 	// In-Memory representation of the table of entries
 	ArchiveEntry* entries = NULL;
@@ -104,13 +98,6 @@ int main(int argc, char** argv)
 
 	// Read the resource entry
 	resource->read(&resource_entry, sizeof(ArchiveEntry));
-	
-	// Print debug informations about the resource
-	printf("Info: Resource successfully opened.\n");
-	printf("Info: Name   = %X\n", resource_entry.name);
-	printf("Info: Type   = %X\n", resource_entry.type);
-	printf("Info: Offset = %d\n", resource_entry.offset);
-	printf("Info: Size   = %d\n", resource_entry.size);
 
 	// In-Memory representation of the resource data
 	uint8_t* resource_data = NULL;
@@ -167,11 +154,9 @@ int main(int argc, char** argv)
 	
 	archive->seek(0);
 
-	printf("Debug: Writing header...\n");
 	// Write the new header
 	archive->write(&header, sizeof(ArchiveHeader));
 	
-	printf("Debug: Writing entries...\n");
 	// Write the previous entries only if they exist
 	if (entries_count > 0)
 	{
@@ -181,7 +166,6 @@ int main(int argc, char** argv)
 	// Write the new resource entry
 	archive->write(&resource_entry, sizeof(ArchiveEntry));
 	
-	printf("Debug: Writing data...\n");
 	// Write previous total resource data only if it exist
 	if (total_resource_data_size > 0)
 	{

+ 3 - 17
tools/resource-compilers/tga-compiler.cpp

@@ -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