Skip to content

Commit

Permalink
Update OrthoSingle to make smaller "above" views
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyettinger committed Apr 4, 2017
1 parent 60bd89b commit 5fa252c
Show file tree
Hide file tree
Showing 5 changed files with 723 additions and 836 deletions.
138 changes: 11 additions & 127 deletions PixVoxelAssets/PixVoxelAssets/AboveFacesDithered.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,6 @@ public static void InitializeWPalette()
Directory.CreateDirectory(altFolder + ((p >= 208) ? "Alien/" : "") + colorNames[p % 8] + "/animation_frames/receiving/color" + p + "/Explosion");
if(p >= 38 * 8)
Directory.CreateDirectory(altFolder + "Divine/" + colorNames[p % 8] + "/animation_frames/receiving/color" + p + "/Explosion");
//Directory.CreateDirectory("frames/" + altFolder + "color" + p);
}
}
wrendered = storeColorCubesW();
Expand Down Expand Up @@ -1137,44 +1136,6 @@ public static void AlterPNGPalette(string input, string output, byte[][][] palet
if(!USE_PALETTE)
return;
}

/*
PngReader pngr = FileHelper.CreatePngReader(input);
ImageLines lines = pngr.ReadRowsByte(0, pngr.ImgInfo.Rows, 1);
ImageInfo imi = pngr.ImgInfo;

pngr.End();
int p = (addon == "Divine_") ? 38 * 8 : 0;
for(; p < 8 * (CURedux.wspecies.Length - 2 - (CURedux.ZOMBIES ? 0 : 1)); p++)
{
byte[][] palette = palettes[p];
PngWriter pngw = FileHelper.CreatePngWriter(altFolder + ((p >= 38 * 8) ? "Divine/" : ((p >= 37 * 8) ? "Zombie/" : ((p >= 208) ? "Alien/" : ""))) + colorNames[p % 8] + "/" + string.Format(output, p), imi, true);

if(pngw.GetChunksList().GetById1(PngChunkTRNS.ID) == null)
pngw.GetMetadata().CreateTRNSChunk().setIndexEntryAsTransparent(0);
else
pngw.GetMetadata().GetTRNS().setIndexEntryAsTransparent(0);

PngChunkPLTE pal;
if(pngw.GetChunksList().GetById1(PngChunkPLTE.ID) == null)
pal = pngw.GetMetadata().CreatePLTEChunk();
else
pal = pngw.GetMetadata().GetPLTE();

pal.SetNentries(256);
for(int i = 1; i < 255; i++)
{
pal.SetEntry(i, palette[i][0], palette[i][1], palette[i][2]);
}
pal.SetEntry(0, 0, 0, 0);
pal.SetEntry(255, 0, 0, 0);
pngw.WriteRowsByte(lines.ScanlinesB);
pngw.End();

if(!USE_PALETTE)
return;
}
*/
}
public static void AlterPNGPaletteZombie(string input, string output, byte[][][] palettes)
{
Expand Down Expand Up @@ -1227,100 +1188,24 @@ public static void AlterPNGPaletteZombie(string input, string output, byte[][][]

public static void AlterPNGPaletteLimited(string input, string output, byte[][][] palettes)
{
PngReader pngr = FileHelper.CreatePngReader(input);
ImageLines lines = pngr.ReadRowsByte(0, pngr.ImgInfo.Rows, 1);
ImageInfo imi = pngr.ImgInfo;

pngr.End();

byte[] bytes = File.ReadAllBytes(input);
//Console.WriteLine("{0:X} {1:X} {2:X} TO {3:X} {4:X} {5:X}", bytes[41], bytes[42], bytes[43], bytes[41 + 255 * 3], bytes[42 + 255 * 3], bytes[43 + 255 * 3]);
//int p = (addon == "Divine_") ? 38 * 8 : 0, limit = 8 * (CURedux.wspecies.Length - 2 - (CURedux.ZOMBIES ? 0 : 1));
for(int p = 0; p < 8; p++)
{
byte[][] palette = palettes[p];
PngWriter pngw = FileHelper.CreatePngWriter(altFolder + colorNames[p % 8] + "/" + string.Format(output, p), imi, true);

if(pngw.GetChunksList().GetById1(PngChunkTRNS.ID) == null)
pngw.GetMetadata().CreateTRNSChunk().setIndexEntryAsTransparent(0);
else
pngw.GetMetadata().GetTRNS().setIndexEntryAsTransparent(0);

PngChunkPLTE pal;
if(pngw.GetChunksList().GetById1(PngChunkPLTE.ID) == null)
pal = pngw.GetMetadata().CreatePLTEChunk();
else
pal = pngw.GetMetadata().GetPLTE();

pal.SetNentries(256);
for(int i = 1; i < 255; i++)
{
pal.SetEntry(i, palette[i][0], palette[i][1], palette[i][2]);
}
pal.SetEntry(0, 0, 0, 0);
pal.SetEntry(255, 0, 0, 0);
pngw.WriteRowsByte(lines.ScanlinesB);
pngw.End();
if(!USE_PALETTE)
return;
Array.Copy(exactpalettes[p], 0, bytes, 37, 776);
File.WriteAllBytes(
altFolder + colorNames[p] + "/" + string.Format(output, p),
bytes);
}
for(int p = 208; p < 8 * 37; p++)
{
byte[][] palette = palettes[p];
PngWriter pngw = FileHelper.CreatePngWriter(altFolder + "Alien/" + colorNames[p % 8] + "/" + string.Format(output, p), imi, true);

if(pngw.GetChunksList().GetById1(PngChunkTRNS.ID) == null)
pngw.GetMetadata().CreateTRNSChunk().setIndexEntryAsTransparent(0);
else
pngw.GetMetadata().GetTRNS().setIndexEntryAsTransparent(0);

PngChunkPLTE pal;
if(pngw.GetChunksList().GetById1(PngChunkPLTE.ID) == null)
pal = pngw.GetMetadata().CreatePLTEChunk();
else
pal = pngw.GetMetadata().GetPLTE();

pal.SetNentries(256);
for(int i = 1; i < 255; i++)
{
pal.SetEntry(i, palette[i][0], palette[i][1], palette[i][2]);
}
pal.SetEntry(0, 0, 0, 0);
pal.SetEntry(255, 0, 0, 0);
pngw.WriteRowsByte(lines.ScanlinesB);
pngw.End();

if(!USE_PALETTE)
return;
}
/*
for(int p = 38 * 8; p < (CURedux.wspecies.Length - 2); p++)
{
byte[][] palette = palettes[p];
PngWriter pngw = FileHelper.CreatePngWriter(altFolder + "Divine/" + colorNames[p % 8] + "/" + string.Format(output, p), imi, true);

if(pngw.GetChunksList().GetById1(PngChunkTRNS.ID) == null)
pngw.GetMetadata().CreateTRNSChunk().setIndexEntryAsTransparent(0);
else
pngw.GetMetadata().GetTRNS().setIndexEntryAsTransparent(0);

PngChunkPLTE pal;
if(pngw.GetChunksList().GetById1(PngChunkPLTE.ID) == null)
pal = pngw.GetMetadata().CreatePLTEChunk();
else
pal = pngw.GetMetadata().GetPLTE();

pal.SetNentries(256);
for(int i = 1; i < 255; i++)
{
pal.SetEntry(i, palette[i][0], palette[i][1], palette[i][2]);
}
pal.SetEntry(0, 0, 0, 0);
pal.SetEntry(255, 0, 0, 0);
pngw.WriteRowsByte(lines.ScanlinesB);
pngw.End();

if(!USE_PALETTE)
return;
Array.Copy(exactpalettes[p], 0, bytes, 37, 776);
File.WriteAllBytes(
altFolder + "Alien/" + colorNames[p % 8] + "/" + string.Format(output, p),
bytes);
}
*/
}

public static void WriteGIF(List<string> images, int delay, string output)
Expand All @@ -1338,7 +1223,6 @@ public static void WriteGIF(List<string> images, int delay, string output)
//settings.Colors = 256;
//collection.Quantize(settings);
//collection.Optimize();
// Save gif
collection.Write(output + ".gif");
}
}
Expand Down
24 changes: 12 additions & 12 deletions PixVoxelAssets/PixVoxelAssets/CURedux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -958,13 +958,13 @@ class CURedux
//1 tires, treads
new float[] {0.37F,0.35F,0.34F,1F},
//2 doors paint (dark) contrast
new float[] {0.18F,-0.02F,0.15F,1F},
new float[] {0.25F,0.03F,0.22F,1F},
//3 doors paint (dark)
new float[] {0.3F,0.05F,0.25F,1F},
new float[] {0.4F,0.1F,0.35F,1F},
//4 main paint (mid) contrast
new float[] {0.38F,0.01F,0.43F,1F},
new float[] {0.43F,0.05F,0.5F,1F},
//5 main paint (mid)
new float[] {0.5F,0.1F,0.55F,1F},
new float[] {0.58F,0.16F,0.65F,1F},
//6 hair contrast
new float[] {0.5F,0.2F,0.08F,1F},
//7 hair
Expand Down Expand Up @@ -1010,29 +1010,29 @@ class CURedux
//27 water
new float[] {0.4F,0.6F,0.9F,flat_alpha},
//28 cockpit paint (gray) contrast
new float[] {0.4F,0.25F,0.5F,1F},
new float[] {0.58F,0.4F,0.65F,1F},
//29 cockpit paint (gray)
new float[] {0.55F,0.33F,0.65F,1F},
new float[] {0.7F,0.53F,0.8F,1F},
//30 helmet paint (bold) contrast
new float[] {0.6F,0.12F,0.6F,1F},
new float[] {0.65F,0.1F,0.63F,1F},
//31 helmet paint (bold)
new float[] {0.73F,0.28F,0.73F,1F},
new float[] {0.8F,0.22F,0.78F,1F},
//32 alternate paint contrast
new float[] {0.3F,0.3F,0.3F,1F},
new float[] {0.4F,0.4F,0.4F,1F},
//33 alternate paint
new float[] {0.42F,0.42F,0.42F,1F},
new float[] {0.52F,0.52F,0.52F,1F},
//34 gore
new float[] {0.67F,0.05F,-0.1F,1F},
//35 glass
new float[] {0.45F,0.7F,0.7F,1F},
//36 rotor frame 0 contrast
new float[] {0.7F,0.8F,0.9F,spin_alpha_0},
//37 rotor frame 0
new float[] {0.65F,0.35F,0.65F,spin_alpha_0},
new float[] {0.75F,0.5F,0.75F,spin_alpha_0},
//38 rotor frame 1 contrast
new float[] {0.7F,0.8F,0.9F,spin_alpha_1},
//39 rotor frame 1
new float[] {0.65F,0.35F,0.65F,spin_alpha_1},
new float[] {0.75F,0.5F,0.75F,spin_alpha_1},
//40 grass
new float[] {0.24F,0.55F,0.02F,1F},
//41 always darker dust
Expand Down
Loading

0 comments on commit 5fa252c

Please sign in to comment.