src/screenshot.cpp
changeset 9551 6f60dca6c566
parent 9543 a60fb4bacc66
child 10039 1f236afd6cd1
--- a/src/screenshot.cpp	Wed Jun 18 20:20:12 2008 +0000
+++ b/src/screenshot.cpp	Wed Jun 18 21:19:04 2008 +0000
@@ -428,20 +428,15 @@
 		return false;
 	}
 
-	if (sizeof(*palette) == 3) {
-		success = fwrite(palette, 256 * sizeof(*palette), 1, f) == 1;
-	} else {
-		/* If the palette is word-aligned, copy it to a temporary byte array */
-		byte tmp[256 * 3];
-		uint i;
+	/* Palette is word-aligned, copy it to a temporary byte array */
+	byte tmp[256 * 3];
 
-		for (i = 0; i < 256; i++) {
-			tmp[i * 3 + 0] = palette[i].r;
-			tmp[i * 3 + 1] = palette[i].g;
-			tmp[i * 3 + 2] = palette[i].b;
-		}
-		success = fwrite(tmp, sizeof(tmp), 1, f) == 1;
+	for (uint i = 0; i < 256; i++) {
+		tmp[i * 3 + 0] = palette[i].r;
+		tmp[i * 3 + 1] = palette[i].g;
+		tmp[i * 3 + 2] = palette[i].b;
 	}
+	success = fwrite(tmp, sizeof(tmp), 1, f) == 1;
 
 	fclose(f);