diff --git a/src/com/bytezone/diskbrowser/applefile/HiResImage.java b/src/com/bytezone/diskbrowser/applefile/HiResImage.java index cb28e1d..8919479 100644 --- a/src/com/bytezone/diskbrowser/applefile/HiResImage.java +++ b/src/com/bytezone/diskbrowser/applefile/HiResImage.java @@ -19,6 +19,7 @@ public abstract class HiResImage extends AbstractFile { "Paintworks Packed SHR Image", "Packed Super Hi-Res Image", "Super Hi-Res Image (Apple Preferred Format)", "Packed QuickDraw II PICT File", "Packed Super Hi-Res 3200 color image" }; + static final int COLOR_TABLE_SIZE = 32; // ---- ---- ------ -------------------------------------- ------------------------ // File Type Aux Name Description diff --git a/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java b/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java index 62096f4..5d8825d 100644 --- a/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java +++ b/src/com/bytezone/diskbrowser/applefile/SHRPictureFile2.java @@ -66,7 +66,7 @@ public class SHRPictureFile2 extends HiResImage colorTables = new ColorTable[16]; for (int i = 0; i < colorTables.length; i++) - colorTables[i] = new ColorTable (i, this.buffer, 32256 + i * 32); + colorTables[i] = new ColorTable (i, this.buffer, 32256 + i * COLOR_TABLE_SIZE); break; @@ -100,7 +100,7 @@ public class SHRPictureFile2 extends HiResImage colorTables = new ColorTable[200]; for (int i = 0; i < colorTables.length; i++) { - colorTables[i] = new ColorTable (i, this.buffer, 4 + i * 32); + colorTables[i] = new ColorTable (i, this.buffer, 4 + i * COLOR_TABLE_SIZE); colorTables[i].reverse (); } @@ -116,7 +116,7 @@ public class SHRPictureFile2 extends HiResImage colorTables = new ColorTable[16]; for (int i = 0; i < colorTables.length; i++) - colorTables[i] = new ColorTable (i, buffer, 32256 + i * 32); + colorTables[i] = new ColorTable (i, buffer, 32256 + i * COLOR_TABLE_SIZE); break; @@ -146,7 +146,7 @@ public class SHRPictureFile2 extends HiResImage colorTables = new ColorTable[16]; for (int i = 0; i < colorTables.length; i++) - colorTables[i] = new ColorTable (i, buffer, 32256 + i * 32); + colorTables[i] = new ColorTable (i, buffer, 32256 + i * COLOR_TABLE_SIZE); break; @@ -164,11 +164,11 @@ public class SHRPictureFile2 extends HiResImage failureReason = "Buffer should be 38,400 bytes"; return; } - int maxTables = (buffer.length - 3200) / 32; + int maxTables = (buffer.length - 3200) / COLOR_TABLE_SIZE; colorTables = new ColorTable[maxTables]; for (int i = 0; i < colorTables.length; i++) { - colorTables[i] = new ColorTable (i, buffer, 32000 + i * 32); + colorTables[i] = new ColorTable (i, buffer, 32000 + i * COLOR_TABLE_SIZE); colorTables[i].reverse (); } break;