From 751da619528801680a9ecac7e130be072f19356d Mon Sep 17 00:00:00 2001
From: jonko0493
Date: Wed, 21 Jun 2023 22:27:45 -0700
Subject: [PATCH 1/3] Should mostly be working now
---
src/SerialLoops.Lib/Items/SystemTextureItem.cs | 16 +++++++++-------
src/SerialLoops.Lib/Project.cs | 16 ++++++++--------
.../Dialogs/BackgroundCropResizeDialog.cs | 3 ---
3 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/SerialLoops.Lib/Items/SystemTextureItem.cs b/src/SerialLoops.Lib/Items/SystemTextureItem.cs
index ba320df3..2febd46b 100644
--- a/src/SerialLoops.Lib/Items/SystemTextureItem.cs
+++ b/src/SerialLoops.Lib/Items/SystemTextureItem.cs
@@ -13,11 +13,10 @@ public class SystemTextureItem : Item
{
public SystemTexture SysTex { get; set; }
public GraphicsFile Grp { get; set; }
- public int TransparentIndex { get; set; }
public int Width { get; set; }
public int Height { get; set; }
- public SystemTextureItem(SystemTexture sysTex, Project project, string name, int transparentIndex, int width = -1, int height = -1) : base(name, ItemType.System_Texture)
+ public SystemTextureItem(SystemTexture sysTex, Project project, string name, int width = -1, int height = -1) : base(name, ItemType.System_Texture)
{
SysTex = sysTex;
Grp = project.Grp.Files.First(f => f.Index == sysTex.GrpIndex);
@@ -29,7 +28,6 @@ public SystemTextureItem(SystemTexture sysTex, Project project, string name, int
{
Grp.ImageForm = GraphicsFile.Form.TILE;
}
- TransparentIndex = transparentIndex;
Width = width < 0 ? Grp.Width : width;
Height = height < 0 ? Grp.Height : height;
}
@@ -42,12 +40,12 @@ public SKBitmap GetTexture()
{
if (SysTex.Screen == SysTexScreen.BOTTOM_SCREEN)
{
- return Grp.GetImage();
+ return Grp.GetImage(transparentIndex: 0);
}
else
{
SKBitmap tileBitmap = new(Width, Height);
- SKBitmap tiles = Grp.GetImage(width: SysTex.TileWidth);
+ SKBitmap tiles = Grp.GetImage(width: SysTex.TileWidth, transparentIndex: 0);
SKCanvas tileCanvas = new(tileBitmap);
int currentTile = 0;
for (int y = 0; y < tileBitmap.Height; y += SysTex.TileHeight)
@@ -68,9 +66,13 @@ public SKBitmap GetTexture()
public void SetTexture(SKBitmap bitmap, bool replacePalette)
{
+ if (replacePalette == false)
+ {
+ Grp.Palette[0] = SKColors.Transparent;
+ }
if (SysTex.Screen == SysTexScreen.BOTTOM_SCREEN)
{
- Grp.SetImage(bitmap, replacePalette, TransparentIndex);
+ Grp.SetImage(bitmap, replacePalette, transparentIndex: replacePalette ? 0 : -1);
}
else
{
@@ -90,7 +92,7 @@ public void SetTexture(SKBitmap bitmap, bool replacePalette)
}
tileCanvas.Flush();
- Grp.SetImage(tileBitmap, replacePalette, TransparentIndex);
+ Grp.SetImage(tileBitmap, replacePalette, transparentIndex: replacePalette ? 0 : -1);
}
}
diff --git a/src/SerialLoops.Lib/Project.cs b/src/SerialLoops.Lib/Project.cs
index c762da81..6f94d983 100644
--- a/src/SerialLoops.Lib/Project.cs
+++ b/src/SerialLoops.Lib/Project.cs
@@ -385,23 +385,23 @@ public LoadProjectResult LoadArchives(ILogger log, IProgressTracker tracker)
SystemTextureFile systemTextureFile = Dat.Files.First(f => f.Name == "SYSTEXS").CastTo();
tracker.Focus("System Textures",
5 + systemTextureFile.SystemTextures.Count(s => Grp.Files.Where(g => g.Name.StartsWith("XTR") || g.Name.StartsWith("SYS") && !g.Name.Contains("_SPC_") && g.Name != "SYS_CMN_B12DNX" && g.Name != "SYS_PPT_001DNX").Select(g => g.Index).Distinct().Contains(s.GrpIndex)));
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_SEGDNX").Index), this, "SYSTEX_SPLASH_SEGA", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_SEGDNX").Index), this, "SYSTEX_SPLASH_SEGA", height: 192));
tracker.Finished++;
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_AQIDNX").Index), this, "SYSTEX_SPLASH_AQI", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_AQIDNX").Index), this, "SYSTEX_SPLASH_AQI", height: 192));
tracker.Finished++;
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_ACTDNX").Index), this, "SYSTEX_SPLASH_MOBICLIP", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_ACTDNX").Index), this, "SYSTEX_SPLASH_MOBICLIP", height: 192));
tracker.Finished++;
string criLogoName = Grp.Files.Any(f => f.Name == "CREDITS") ? "SYSTEX_SPLASH_HAROOHIE" : "SYSTEX_SPLASH_CRIWARE";
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_CRIDNX").Index), this, criLogoName, 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_CRIDNX").Index), this, criLogoName, height: 192));
tracker.Finished++;
if (Grp.Files.Any(f => f.Name == "CREDITS"))
{
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "CREDITS").Index), this, "SYSTEX_SPLASH_CREDITS", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "CREDITS").Index), this, "SYSTEX_SPLASH_CREDITS", height: 192));
}
tracker.Finished++;
foreach (SystemTexture extraSysTex in systemTextureFile.SystemTextures.Where(s => Grp.Files.Where(g => g.Name.StartsWith("XTR")).Distinct().Select(g => g.Index).Contains(s.GrpIndex)))
{
- Items.Add(new SystemTextureItem(extraSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == extraSysTex.GrpIndex).Name[0..^3]}", -1));
+ Items.Add(new SystemTextureItem(extraSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == extraSysTex.GrpIndex).Name[0..^3]}"));
tracker.Finished++;
}
// Exclude B12 as that's the nameplates we replace in the character items and PPT_001 as that's the puzzle phase singularity we'll be replacing in the puzzle items
@@ -411,11 +411,11 @@ public LoadProjectResult LoadArchives(ILogger log, IProgressTracker tracker)
if (Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^4].EndsWith("T6"))
{
// special case the ep headers
- Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}", -1, height: 192));
+ Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}", height: 192));
}
else
{
- Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}", -1));
+ Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}"));
}
tracker.Finished++;
}
diff --git a/src/SerialLoops/Dialogs/BackgroundCropResizeDialog.cs b/src/SerialLoops/Dialogs/BackgroundCropResizeDialog.cs
index 991bbbaa..a454c1e2 100644
--- a/src/SerialLoops/Dialogs/BackgroundCropResizeDialog.cs
+++ b/src/SerialLoops/Dialogs/BackgroundCropResizeDialog.cs
@@ -317,10 +317,7 @@ private void OnMouseMove(object sender, MouseEventArgs e)
private void UpdateImage()
{
SKCanvas previewCanvas = new(_preview);
-
- // Draw background
previewCanvas.Clear();
- previewCanvas.DrawColor(SKColors.DarkGray);
// Draw image
previewCanvas.DrawBitmap(StartImage,
From c57b611b8afc29eb280004fa7c81c16878031bd5 Mon Sep 17 00:00:00 2001
From: jonko0493
Date: Wed, 21 Jun 2023 23:15:41 -0700
Subject: [PATCH 2/3] Throw in a README fixup
---
README.md | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 5a76d997..ec6afcef 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
-**Serial Loops** is a fully-fledged editor for the Nintendo DS game, _Suzumiya Haruhi no Chokuretsu_ (The Series of Haruhi Suzumiya).
+**Serial Loops** is a fully-fledged editor for the Nintendo DS game _Suzumiya Haruhi no Chokuretsu_ (The Series of Haruhi Suzumiya).
## Screenshots
@@ -25,6 +25,9 @@
+## Documentation
+Documentation for how to use Serial Loops can be found on [our website](https://haroohie.club/chokuretsu/serial-loops/).
+
## Installation
### Prerequisites
#### Installing devKitARM
@@ -34,7 +37,8 @@
* On macOS and Linux, run `sudo dkp-pacman -S nds-dev` from the terminal after installing the devkitPro pacman distribution.
#### Installing Make or Docker
-To assemble ASM hacks you want to apply, you will need to decide whether to use Make or Docker.
+To assemble ASM hacks you want to apply, you will need to decide whether to use Make or Docker. Make is automatically installed when using the Debian and RPM
+packages we distribute, so you don't need to worry about this step if you're using either of those.
Currently, the Docker path is **only supported on Windows** due to operating system and framework limitations. It is possible to get Docker running
just fine on Linux distros by running SerialLoops as root (e.g. `sudo SerialLoops`), but it's easier to just use Make. On macOS, there is no known
From f117aac011bee1f973fd40e3ef9b85e0c6632cdb Mon Sep 17 00:00:00 2001
From: jonko0493
Date: Thu, 22 Jun 2023 01:18:18 -0700
Subject: [PATCH 3/3] Fixup merge conflict frfr
---
src/SerialLoops.Lib/Project.cs | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/SerialLoops.Lib/Project.cs b/src/SerialLoops.Lib/Project.cs
index 65c89f7c..9843b017 100644
--- a/src/SerialLoops.Lib/Project.cs
+++ b/src/SerialLoops.Lib/Project.cs
@@ -586,23 +586,23 @@ public LoadProjectResult LoadArchives(ILogger log, IProgressTracker tracker)
SystemTextureFile systemTextureFile = Dat.Files.First(f => f.Name == "SYSTEXS").CastTo();
tracker.Focus("System Textures",
5 + systemTextureFile.SystemTextures.Count(s => Grp.Files.Where(g => g.Name.StartsWith("XTR") || g.Name.StartsWith("SYS") && !g.Name.Contains("_SPC_") && g.Name != "SYS_CMN_B12DNX" && g.Name != "SYS_PPT_001DNX").Select(g => g.Index).Distinct().Contains(s.GrpIndex)));
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_SEGDNX").Index), this, "SYSTEX_LOGO_SEGA", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_SEGDNX").Index), this, "SYSTEX_LOGO_SEGA", height: 192));
tracker.Finished++;
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_AQIDNX").Index), this, "SYSTEX_LOGO_AQI", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_CO_AQIDNX").Index), this, "SYSTEX_LOGO_AQI", height: 192));
tracker.Finished++;
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_ACTDNX").Index), this, "SYSTEX_LOGO_MOBICLIP", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_ACTDNX").Index), this, "SYSTEX_LOGO_MOBICLIP", height: 192));
tracker.Finished++;
string criLogoName = Grp.Files.Any(f => f.Name == "CREDITS") ? "SYSTEX_LOGO_HAROOHIE" : "SYSTEX_LOGO_CRIWARE";
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_CRIDNX").Index), this, criLogoName, 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "LOGO_MW_CRIDNX").Index), this, criLogoName, height: 192));
tracker.Finished++;
if (Grp.Files.Any(f => f.Name == "CREDITS"))
{
- Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "CREDITS").Index), this, "SYSTEX_LOGO_CREDITS", 0, height: 192));
+ Items.Add(new SystemTextureItem(systemTextureFile.SystemTextures.First(s => s.GrpIndex == Grp.Files.First(g => g.Name == "CREDITS").Index), this, "SYSTEX_LOGO_CREDITS", height: 192));
}
tracker.Finished++;
foreach (SystemTexture extraSysTex in systemTextureFile.SystemTextures.Where(s => Grp.Files.Where(g => g.Name.StartsWith("XTR")).Distinct().Select(g => g.Index).Contains(s.GrpIndex)))
{
- Items.Add(new SystemTextureItem(extraSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == extraSysTex.GrpIndex).Name[0..^3]}", -1));
+ Items.Add(new SystemTextureItem(extraSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == extraSysTex.GrpIndex).Name[0..^3]}"));
tracker.Finished++;
}
// Exclude B12 as that's the nameplates we replace in the character items and PPT_001 as that's the puzzle phase singularity we'll be replacing in the puzzle items
@@ -612,11 +612,11 @@ public LoadProjectResult LoadArchives(ILogger log, IProgressTracker tracker)
if (Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^4].EndsWith("T6"))
{
// special case the ep headers
- Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}", -1, height: 192));
+ Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}", height: 192));
}
else
{
- Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}", -1));
+ Items.Add(new SystemTextureItem(sysSysTex, this, $"SYSTEX_{Grp.Files.First(g => g.Index == sysSysTex.GrpIndex).Name[0..^3]}"));
}
tracker.Finished++;
}