cleanup
This commit is contained in:
@@ -13,7 +13,6 @@ namespace SplashEdit.EditorCode
|
||||
private Texture2D quantizedTexture;
|
||||
private Texture2D vramTexture; // VRAM representation of the texture
|
||||
private List<VRAMPixel> clut; // Color Lookup Table (CLUT), stored as a 1D list
|
||||
private ushort[] indexedPixelData; // Indexed pixel data for VRAM storage
|
||||
private PSXBPP bpp = PSXBPP.TEX_4BIT;
|
||||
private readonly int previewSize = 256;
|
||||
|
||||
@@ -54,7 +53,7 @@ namespace SplashEdit.EditorCode
|
||||
{
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label("Original Texture", PSXEditorStyles.CardHeaderStyle);
|
||||
DrawTexturePreview(originalTexture, previewSize, false);
|
||||
DrawTexturePreview(originalTexture, previewSize);
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
|
||||
@@ -88,27 +87,6 @@ namespace SplashEdit.EditorCode
|
||||
|
||||
PSXEditorStyles.DrawSeparator(4, 4);
|
||||
|
||||
// Export indexed pixel data
|
||||
if (indexedPixelData != null)
|
||||
{
|
||||
if (GUILayout.Button("Export texture data", PSXEditorStyles.SecondaryButton, GUILayout.Height(24)))
|
||||
{
|
||||
string path = EditorUtility.SaveFilePanel("Save texture data", "", "pixel_data", "bin");
|
||||
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write))
|
||||
using (BinaryWriter writer = new BinaryWriter(fileStream))
|
||||
{
|
||||
foreach (ushort value in indexedPixelData)
|
||||
{
|
||||
writer.Write(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Export CLUT data
|
||||
if (clut != null)
|
||||
{
|
||||
@@ -146,7 +124,7 @@ namespace SplashEdit.EditorCode
|
||||
clut = psxTex.ColorPalette;
|
||||
}
|
||||
|
||||
private void DrawTexturePreview(Texture2D texture, int size, bool flipY = true)
|
||||
private void DrawTexturePreview(Texture2D texture, int size)
|
||||
{
|
||||
// Renders a texture preview within the editor window
|
||||
Rect rect = GUILayoutUtility.GetRect(size, size, GUILayout.ExpandWidth(false));
|
||||
|
||||
Reference in New Issue
Block a user