Skip to content

Commit 4b8ea05

Browse files
committed
minor bugfixes
1 parent 32352f6 commit 4b8ea05

11 files changed

Lines changed: 55 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.10.2] - 2025-07-21
6+
7+
### Fixed
8+
- (Sprite Editor) Fixed Set Raster commands clearing when duplicated
9+
- Proper asset stack texture handling
10+
- Various minor bugfixes
11+
512
## [0.10.1] - 2025-04-01
613

714
### Fixed

app.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.10.1
1+
version=0.10.2

src/main/java/game/map/BoundingBox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public void renderDeferred(float r, float g, float b, float width)
307307

308308
public boolean overlaps(BoundingBox other)
309309
{
310-
return (min.getX() <= other.max.getX() && other.min.getX() <= max.getY() &&
310+
return (min.getX() <= other.max.getX() && other.min.getX() <= max.getX() &&
311311
min.getY() <= other.max.getY() && other.min.getY() <= max.getY() &&
312312
min.getZ() <= other.max.getZ() && other.min.getZ() <= max.getZ());
313313
}

src/main/java/game/map/shape/TransformMatrix.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,11 @@ public void rotate(double x, double y, double z, double angle)
328328
double sin = Math.sin(Math.toRadians(angle));
329329
double soc = 1.0 - cos;
330330

331-
//TODO off-diagonal correct?
332-
333331
TransformMatrix rot = TransformMatrix.identity();
334332

335333
rot.mat[0][0] = soc * nx * nx + cos;
336334
rot.mat[0][1] = soc * nx * ny - nz * sin;
337-
rot.mat[0][2] = soc * nx * ny + ny * sin;
335+
rot.mat[0][2] = soc * nx * nz + ny * sin;
338336

339337
rot.mat[1][0] = soc * nx * ny + nz * sin;
340338
rot.mat[1][1] = soc * ny * ny + cos;

src/main/java/game/message/StringConstants.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,18 @@ public static String getName(int id, boolean useStandard)
617617
characterMap.add((byte) sc.id, sc.name.charAt(0));
618618
}
619619

620+
// support for mapping macrons --> umlauts
621+
characterMap.add((byte) StandardCharacter.c7A.id, 'ā'); // ä
622+
characterMap.add((byte) StandardCharacter.c7F.id, 'ē'); // ë
623+
characterMap.add((byte) StandardCharacter.c83.id, 'ī'); // ï
624+
characterMap.add((byte) StandardCharacter.c88.id, 'ō'); // ö
625+
characterMap.add((byte) StandardCharacter.c8C.id, 'ū'); // ü
626+
characterMap.add((byte) StandardCharacter.c63.id, 'Ā'); // Ä
627+
characterMap.add((byte) StandardCharacter.c68.id, 'Ē'); // Ë
628+
characterMap.add((byte) StandardCharacter.c6C.id, 'Ī'); // Ï
629+
characterMap.add((byte) StandardCharacter.c71.id, 'Ō'); // Ö
630+
characterMap.add((byte) StandardCharacter.c75.id, 'Ū'); // Ü
631+
620632
creditsCharacterMap = new DualHashMap<>();
621633
creditsCharacterMap.add((byte) 0x00, 'A');
622634
creditsCharacterMap.add((byte) 0x01, 'B');

src/main/java/game/sprite/editor/animators/command/SetImage.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ public SetImage(CommandAnimator animator, short s0)
4949
// FFF is valid, so sign extend (implicit cast to int)
5050
int id = (s0 << 20) >> 20;
5151

52-
if (id < 0 || id >= sprite.rasters.size())
52+
if (id >= 0 && id < sprite.rasters.size()) {
5353
imgIndex = id;
54+
// immediate lookup for 'copy/paste' operations.
55+
// loading from XML will also assign this during updateReferences
56+
img = sprite.rasters.get(id);
57+
}
5458
}
5559

5660
public SetImage(CommandAnimator animator, SpriteRaster img)

src/main/java/game/sprite/editor/animators/command/SetPalette.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import app.SwingUtils;
1313
import common.commands.AbstractCommand;
14+
import game.sprite.Sprite;
1415
import game.sprite.SpritePalette;
1516
import game.sprite.editor.CommandComboBox;
1617
import game.sprite.editor.Editable;
@@ -40,9 +41,14 @@ public SetPalette(CommandAnimator animator, short s0)
4041
{
4142
super(animator);
4243

44+
Sprite sprite = animator.comp.parentAnimation.parentSprite;
45+
4346
// FFF is valid, so sign extend (implicit cast to int)
4447
int id = (s0 << 20) >> 20;
45-
pal = (id < 0) ? null : animator.comp.parentAnimation.parentSprite.palettes.get(id);
48+
49+
if (id >= 0 && id < sprite.palettes.size()) {
50+
pal = sprite.palettes.get(id);
51+
}
4652
}
4753

4854
public SetPalette(CommandAnimator animator, SpritePalette pal)

src/main/java/game/texture/Texture.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
import org.apache.commons.io.FilenameUtils;
1111

1212
import app.input.InputFileException;
13+
import assets.AssetHandle;
14+
import assets.AssetManager;
15+
import assets.AssetSubdir;
1316
import game.texture.TextureArchive.JsonTexture;
1417

1518
public class Texture
@@ -246,7 +249,8 @@ public static Texture parseTexture(File archiveFile, String dir, String name, Li
246249
public static Texture parseTexture(File source, JsonTexture json) throws IOException
247250
{
248251
File dir = source.getParentFile();
249-
File subdir = new File(dir, FilenameUtils.getBaseName(source.getName()));
252+
String texName = FilenameUtils.getBaseName(source.getName());
253+
//File subdir = new File(dir, FilenameUtils.getBaseName(source.getName()));
250254

251255
Texture tx = new Texture(json.name);
252256
tx.hWrap = new int[2];
@@ -305,10 +309,14 @@ public static Texture parseTexture(File source, JsonTexture json) throws IOExcep
305309
throw new InputFileException(source, "(%s) Texture cannot have both mipmaps and aux.", json.name);
306310
}
307311

308-
tx.main = Tile.load(subdir + "/" + tx.name + ".png", imgFormat);
312+
AssetHandle mainAsset = AssetManager.get(AssetSubdir.MAP_TEX, texName + "/" + tx.name + ".png");
309313

310-
if (tx.hasAux)
311-
tx.aux = Tile.load(subdir + "/" + tx.name + "_AUX.png", auxFormat);
314+
tx.main = Tile.load(mainAsset, imgFormat);
315+
316+
if (tx.hasAux) {
317+
AssetHandle auxAsset = AssetManager.get(AssetSubdir.MAP_TEX, texName + "/" + tx.name + "_AUX.png");
318+
tx.aux = Tile.load(auxAsset, auxFormat);
319+
}
312320

313321
if (tx.hasMipmaps) {
314322
int divisor = 2;
@@ -321,7 +329,8 @@ public static Texture parseTexture(File source, JsonTexture json) throws IOExcep
321329
int mmWidth = tx.main.width / divisor;
322330

323331
String mmName = tx.name + "_MM" + (tx.mipmapList.size() + 1);
324-
Tile mipmap = Tile.load(subdir + "/" + mmName + ".png", imgFormat);
332+
AssetHandle mmAsset = AssetManager.get(AssetSubdir.MAP_TEX, texName + "/" + mmName + ".png");
333+
Tile mipmap = Tile.load(mmAsset, imgFormat);
325334

326335
if (mipmap.height != mmHeight)
327336
throw new InputFileException(source, "%s has incorrect height: %s instead of %s", mmName, mipmap.height, mmHeight);

src/main/java/game/texture/editor/ImageEditor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ private File promptChooseExportFile(File file)
891891
exportFileChooser.setCurrentDirectory(file.getParentFile());
892892
super.incrementDialogsOpen();
893893
if (exportFileChooser.prompt() == ChooseDialogResult.APPROVE)
894-
chosen = importFileChooser.getSelectedFile();
894+
chosen = exportFileChooser.getSelectedFile();
895895
super.decrementDialogsOpen();
896896

897897
return chosen;

src/main/java/renderer/buffers/BufferedMesh.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static org.lwjgl.opengl.GL15.*;
55
import static org.lwjgl.opengl.GL20.glEnableVertexAttribArray;
66
import static org.lwjgl.opengl.GL20.glVertexAttribPointer;
7+
import static org.lwjgl.opengl.GL30.glDeleteVertexArrays;
78
import static org.lwjgl.opengl.GL30.glGenVertexArrays;
89

910
import java.nio.FloatBuffer;
@@ -271,6 +272,10 @@ public void glDelete()
271272

272273
if (auxVBO != null)
273274
glDeleteBuffers(auxVBO.id);
275+
276+
glDeleteVertexArrays(vao);
277+
RenderState.setVAO(0);
278+
vao = -1;
274279
}
275280

276281
public void setVAO()

0 commit comments

Comments
 (0)