Compare commits

...

3 commits

Author SHA1 Message Date
Anuken
d8106cb886 Tests fixed (fine I'll make the canvas support non-pot palettes) 2025-11-17 20:11:52 -05:00
Anuken
ef2736b3be Merge remote-tracking branch 'origin/master' 2025-11-17 14:00:23 -05:00
Anuken
6b2825954b Fixed #11373 2025-11-17 14:00:12 -05:00
3 changed files with 3 additions and 6 deletions

View file

@ -403,7 +403,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
infoDialog.show();
Core.app.post(() -> ui.showErrorMessage("@editor.save.noname"));
}else{
Map map = maps.all().find(m -> m.name().equals(name));
Map map = maps.all().find(m -> m.name().equalsIgnoreCase(name));
if(map != null && !map.custom && !map.workshop){
handleSaveBuiltin(map);
}else{

View file

@ -64,7 +64,7 @@ public class EditorMapsDialog extends MapListDialog{
return;
}
Map conflict = maps.all().find(m -> m.name().equals(name));
Map conflict = maps.all().find(m -> m.name().equalsIgnoreCase(name));
if(conflict != null && !conflict.custom){
ui.showInfo(Core.bundle.format("editor.import.exists", name));

View file

@ -68,8 +68,6 @@ public class CanvasBlock extends Block{
clipSize = Math.max(clipSize, size * 8 - padding);
previewPixmap = new Pixmap(canvasSize, canvasSize);
if(!Mathf.isPowerOfTwo(palette.length)) throw new RuntimeException("Non power-of-two palettes for canvas blocks are not supported.");
}
@Override
@ -122,7 +120,6 @@ public class CanvasBlock extends Block{
}
}
}
}else{
super.drawPlanRegion(plan, list);
}
@ -134,7 +131,7 @@ public class CanvasBlock extends Block{
for(int i = 0; i < pixels; i++){
int bitOffset = i * bpp;
int pal = getByte(data, bitOffset);
target.set(i % canvasSize, i / canvasSize, palette[pal]);
target.set(i % canvasSize, i / canvasSize, palette[Math.min(pal, palette.length)]);
}
return target;
}