mirror of
https://github.com/chev2/botw-toolset.git
synced 2025-10-30 08:12:17 +00:00
TSCB SARC change, logging
This commit is contained in:
parent
058f887c09
commit
1d8fdcbd1e
1 changed files with 18 additions and 10 deletions
|
|
@ -41,10 +41,10 @@ namespace BOTWToolset.Control
|
|||
{
|
||||
PixelView.Source = null;
|
||||
writeableBitmap = null;
|
||||
|
||||
GC.Collect(); // Garbage collect to free memory
|
||||
}
|
||||
|
||||
|
||||
private void PixelView_UpdateView(object sender, RoutedEventArgs e)
|
||||
{
|
||||
byte zoom = (byte)SliderZoomLevel.Value;
|
||||
|
|
@ -61,12 +61,12 @@ namespace BOTWToolset.Control
|
|||
{
|
||||
case "PixelViewMATE":
|
||||
{
|
||||
BOTWConsole.Log("Setting view to texture...");
|
||||
|
||||
string extension = ".mate.sstera";
|
||||
int img_size = (int)Math.Pow(2, 8 + zoom);
|
||||
int grid_size = 256;
|
||||
|
||||
BOTWConsole.LogStatus($"Setting TSCB view to texture ({img_size / grid_size}x{img_size / grid_size})...");
|
||||
|
||||
ClearBitmap();
|
||||
writeableBitmap = new WriteableBitmap(img_size, img_size, 16, 16, PixelFormats.Indexed8, GridColors.MaterialPalette);
|
||||
PixelView.Source = writeableBitmap;
|
||||
|
|
@ -90,16 +90,18 @@ namespace BOTWToolset.Control
|
|||
writeableBitmap.WritePixels(rect, color, writeableBitmap.BackBufferStride, 0);
|
||||
}
|
||||
});
|
||||
|
||||
BOTWConsole.LogStatus($"TSCB view set to texture ({img_size / grid_size}x{img_size / grid_size}).");
|
||||
}
|
||||
break;
|
||||
case "PixelViewHGHT":
|
||||
{
|
||||
BOTWConsole.Log("Setting view to heightmap...");
|
||||
|
||||
string extension = ".hght.sstera";
|
||||
int img_size = (int)Math.Pow(2, 8 + zoom);
|
||||
int grid_size = 256;
|
||||
|
||||
BOTWConsole.LogStatus($"Setting TSCB view to heightmap ({img_size / grid_size}x{img_size / grid_size})...");
|
||||
|
||||
ClearBitmap();
|
||||
writeableBitmap = new WriteableBitmap(img_size, img_size, 16, 16, PixelFormats.Gray8, null);
|
||||
PixelView.Source = writeableBitmap;
|
||||
|
|
@ -125,16 +127,18 @@ namespace BOTWToolset.Control
|
|||
writeableBitmap.WritePixels(rect, color, writeableBitmap.BackBufferStride, 0);
|
||||
}
|
||||
});
|
||||
|
||||
BOTWConsole.LogStatus($"TSCB view set to heightmap ({img_size / grid_size}x{img_size / grid_size}).");
|
||||
}
|
||||
break;
|
||||
case "PixelViewGrassEXTM":
|
||||
{
|
||||
BOTWConsole.Log("Setting view to grass...");
|
||||
|
||||
string extension = ".grass.extm.sstera";
|
||||
int img_size = (int)Math.Pow(2, 6 + zoom);
|
||||
int grid_size = 64;
|
||||
|
||||
BOTWConsole.LogStatus($"Setting TSCB view to grass ({img_size / grid_size}x{img_size / grid_size})...");
|
||||
|
||||
ClearBitmap();
|
||||
writeableBitmap = new WriteableBitmap(img_size, img_size, 16, 16, PixelFormats.Rgb24, null);
|
||||
PixelView.Source = writeableBitmap;
|
||||
|
|
@ -160,16 +164,18 @@ namespace BOTWToolset.Control
|
|||
writeableBitmap.WritePixels(rect, color, writeableBitmap.BackBufferStride, 0);
|
||||
}
|
||||
});
|
||||
|
||||
BOTWConsole.LogStatus($"TSCB view set to grass ({img_size / grid_size}x{img_size / grid_size}).");
|
||||
}
|
||||
break;
|
||||
case "PixelViewWaterEXTM":
|
||||
{
|
||||
BOTWConsole.Log("Setting view to water...");
|
||||
|
||||
string extension = ".water.extm.sstera";
|
||||
int img_size = (int)Math.Pow(2, 6 + zoom);
|
||||
int grid_size = 64;
|
||||
|
||||
BOTWConsole.LogStatus($"Setting TSCB view to water ({img_size / grid_size}x{img_size / grid_size})...");
|
||||
|
||||
ClearBitmap();
|
||||
writeableBitmap = new WriteableBitmap(img_size, img_size, 16, 16, PixelFormats.Indexed8, GridColors.WaterPalette);
|
||||
PixelView.Source = writeableBitmap;
|
||||
|
|
@ -193,6 +199,8 @@ namespace BOTWToolset.Control
|
|||
writeableBitmap.WritePixels(rect, color, writeableBitmap.BackBufferStride, 0);
|
||||
}
|
||||
});
|
||||
|
||||
BOTWConsole.LogStatus($"TSCB view set to water ({img_size / grid_size}x{img_size / grid_size}).");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -207,7 +215,7 @@ namespace BOTWToolset.Control
|
|||
{
|
||||
byte[] yaz0_bytes = File.ReadAllBytes(Path.Combine(folder, ext_file));
|
||||
byte[] yaz0_decomp = Yaz0.Decompress(yaz0_bytes);
|
||||
SARC s = SARC.FromBytes(new MemoryStream(yaz0_decomp));
|
||||
SARC s = SARC.FromBytes(yaz0_decomp);
|
||||
|
||||
for (int i = 0; i < s.Files.Length; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue