added a const

This commit is contained in:
Denis Molony 2019-11-22 18:33:59 +10:00
parent 42985fb8e7
commit 2e36653775
2 changed files with 7 additions and 6 deletions

View File

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

View File

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