Added order field to maps. Fixed some loader bugs.

This commit is contained in:
Martin Haye 2017-01-29 09:23:58 -08:00
parent 32656bd6fc
commit 9d313d5176
6 changed files with 39 additions and 39 deletions

View File

@ -50,8 +50,6 @@ public abstract class MapEditorTabController {
@FXML // fx:id="mapEditorAnchorPane" @FXML // fx:id="mapEditorAnchorPane"
protected AnchorPane mapEditorAnchorPane; // Value injected by FXMLLoader protected AnchorPane mapEditorAnchorPane; // Value injected by FXMLLoader
@FXML // fx:id="mapHeightField"
protected TextField mapHeightField; // Value injected by FXMLLoader
@FXML // fx:id="mapNameField" @FXML // fx:id="mapNameField"
protected TextField mapNameField; // Value injected by FXMLLoader protected TextField mapNameField; // Value injected by FXMLLoader
@FXML // fx:id="mapScriptsList" @FXML // fx:id="mapScriptsList"
@ -60,10 +58,10 @@ public abstract class MapEditorTabController {
protected ComboBox<Map> mapSelect; // Value injected by FXMLLoader protected ComboBox<Map> mapSelect; // Value injected by FXMLLoader
@FXML @FXML
protected Menu mapSelectTile; protected Menu mapSelectTile;
@FXML // fx:id="mapWidthField" @FXML // fx:id="mapOrderField"
protected TextField mapWidthField; // Value injected by FXMLLoader protected TextField mapOrderField; // Value injected by FXMLLoader
@FXML // fx:id="mapWrapAround" @FXML // fx:id="mapDisplay3dField"
protected CheckBox mapWrapAround; // Value injected by FXMLLoader protected CheckBox mapDisplay3dField; // Value injected by FXMLLoader
@FXML @FXML
protected Button scriptEraseTool; protected Button scriptEraseTool;
@FXML @FXML
@ -151,14 +149,13 @@ public abstract class MapEditorTabController {
public void initalize() { public void initalize() {
assert mapEditorAnchorPane != null : "fx:id=\"mapEditorAnchorPane\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapEditorAnchorPane != null : "fx:id=\"mapEditorAnchorPane\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert mapHeightField != null : "fx:id=\"mapHeightField\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert mapNameField != null : "fx:id=\"mapNameField\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapNameField != null : "fx:id=\"mapNameField\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert mapScriptsList != null : "fx:id=\"mapScriptsList\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapScriptsList != null : "fx:id=\"mapScriptsList\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert mapSelect != null : "fx:id=\"mapSelect\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapSelect != null : "fx:id=\"mapSelect\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert mapSelectTile != null : "fx:id=\"mapSelectTile\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapSelectTile != null : "fx:id=\"mapSelectTile\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert mapWidthField != null : "fx:id=\"mapWidthField\" was not injected: check your FXML file 'mapEditorTab.fxml'."; assert mapOrderField != null : "fx:id=\"mapOrderField\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert mapWrapAround != null : "fx:id=\"mapWrapAround\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
assert cursorInfo != null : "fx:id=\"cursorInfo\" was not injected: check your FXML file 'imageEditorTab.fxml'."; assert cursorInfo != null : "fx:id=\"cursorInfo\" was not injected: check your FXML file 'imageEditorTab.fxml'.";
assert mapDisplay3dField != null : "fx:id=\"mapDisplay3dField\" was not injected: check your FXML file 'mapEditorTab.fxml'.";
} }
abstract public void rebuildTileSelectors(); abstract public void rebuildTileSelectors();

View File

@ -12,6 +12,8 @@ package org.badvision.outlaweditor.ui.impl;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ChangeListener; import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
@ -35,6 +37,7 @@ import org.badvision.outlaweditor.api.ApplicationState;
import org.badvision.outlaweditor.data.DataUtilities; import org.badvision.outlaweditor.data.DataUtilities;
import static org.badvision.outlaweditor.data.PropertyHelper.bind; import static org.badvision.outlaweditor.data.PropertyHelper.bind;
import static org.badvision.outlaweditor.data.PropertyHelper.stringProp; import static org.badvision.outlaweditor.data.PropertyHelper.stringProp;
import static org.badvision.outlaweditor.data.PropertyHelper.boolProp;
import org.badvision.outlaweditor.data.TileUtils; import org.badvision.outlaweditor.data.TileUtils;
import org.badvision.outlaweditor.data.xml.Map; import org.badvision.outlaweditor.data.xml.Map;
import org.badvision.outlaweditor.data.xml.Script; import org.badvision.outlaweditor.data.xml.Script;
@ -288,14 +291,12 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
getCurrentEditor().unregister(); getCurrentEditor().unregister();
} }
if (m == null) { if (m == null) {
bind(mapHeightField.textProperty(), null);
bind(mapNameField.textProperty(), null); bind(mapNameField.textProperty(), null);
bind(mapWidthField.textProperty(), null); bind(mapOrderField.textProperty(), null);
bind(mapWrapAround.selectedProperty(), null); bind(mapDisplay3dField.selectedProperty(), null);
mapHeightField.setDisable(true);
mapNameField.setDisable(true); mapNameField.setDisable(true);
mapWidthField.setDisable(true); mapOrderField.setDisable(true);
mapWrapAround.setDisable(true); mapDisplay3dField.setDisable(true);
setCurrentEditor(null); setCurrentEditor(null);
} else { } else {
if (m.getScripts() != null) { if (m.getScripts() != null) {
@ -311,15 +312,13 @@ public class MapEditorTabControllerImpl extends MapEditorTabController {
m.setName("Untitled"); m.setName("Untitled");
} }
try { try {
mapHeightField.setDisable(false);
mapNameField.setDisable(false); mapNameField.setDisable(false);
mapWidthField.setDisable(false); mapOrderField.setDisable(false);
mapWrapAround.setDisable(false); mapDisplay3dField.setDisable(false);
// bind(mapHeightField.textProperty(), intProp(m, "height"));
bind(mapNameField.textProperty(), stringProp(m, "name")); bind(mapNameField.textProperty(), stringProp(m, "name"));
// bind(mapWidthField.textProperty(), intProp(m, "width")); bind(mapOrderField.textProperty(), stringProp(m, "order"));
// bind(mapWrapAround.selectedProperty(),boolProp(m, "wrap")); // Currently broken due to code generation bug in jaxb:
//bind(mapDisplay3dField.selectedProperty(), boolProp(m, "display3d"));
} catch (NoSuchMethodException ex) { } catch (NoSuchMethodException ex) {
Logger.getLogger(ApplicationUIControllerImpl.class Logger.getLogger(ApplicationUIControllerImpl.class
.getName()).log(Level.SEVERE, null, ex); .getName()).log(Level.SEVERE, null, ex);

View File

@ -94,8 +94,10 @@
<xs:attribute name="name" type="xs:string"/> <xs:attribute name="name" type="xs:string"/>
<xs:attribute name="width" type="xs:int"/> <xs:attribute name="width" type="xs:int"/>
<xs:attribute name="height" type="xs:int"/> <xs:attribute name="height" type="xs:int"/>
<xs:attribute name="order" type="xs:string" default="1"/>
<xs:attribute name="category" type="xs:string"/> <xs:attribute name="category" type="xs:string"/>
<xs:attribute name="wrap" type="xs:boolean" default="false"/> <xs:attribute name="wrap" type="xs:boolean" default="false"/>
<xs:attribute name="display3d" type="xs:boolean"/>
<xs:attribute name="startX" type="xs:int" default="0"/> <xs:attribute name="startX" type="xs:int" default="0"/>
<xs:attribute name="startY" type="xs:int" default="0"/> <xs:attribute name="startY" type="xs:int" default="0"/>
</xs:extension> </xs:extension>

View File

@ -4,7 +4,7 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<AnchorPane id="mapsTab" minHeight="0.0" minWidth="0.0" prefHeight="480.0" prefWidth="677.0" stylesheets="@styles/applicationui.css" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.badvision.outlaweditor.ui.impl.MapEditorTabControllerImpl"> <AnchorPane id="mapsTab" minHeight="0.0" minWidth="0.0" prefHeight="480.0" prefWidth="677.0" stylesheets="@styles/applicationui.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.badvision.outlaweditor.ui.impl.MapEditorTabControllerImpl">
<children> <children>
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children> <children>
@ -42,14 +42,9 @@
<children> <children>
<Label text="Name" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="14.0" /> <Label text="Name" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="14.0" />
<TextField id="mapNameFiled" fx:id="mapNameField" layoutX="53.0" layoutY="11.0" prefWidth="147.0" /> <TextField id="mapNameFiled" fx:id="mapNameField" layoutX="53.0" layoutY="11.0" prefWidth="147.0" />
<TextField fx:id="mapWidthField" layoutX="53.0" layoutY="45.0" prefWidth="147.0" />
<Label layoutX="4.0" layoutY="50.0" prefHeight="16.0" prefWidth="42.0" text="Width" />
<TextField fx:id="mapHeightField" layoutX="53.0" layoutY="79.0" prefWidth="147.0" />
<Label layoutX="4.0" layoutY="84.0" prefHeight="16.0" prefWidth="42.0" text="Height" />
<CheckBox fx:id="mapWrapAround" contentDisplay="RIGHT" layoutX="25.0" layoutY="111.0" mnemonicParsing="false" text="Wrap at edges" />
<Separator layoutX="6.0" layoutY="140.0" prefWidth="189.0" /> <Separator layoutX="6.0" layoutY="140.0" prefWidth="189.0" />
<Label layoutX="4.0" layoutY="141.0" text="Scripts" /> <Label layoutX="4.0" layoutY="141.0" text="Scripts" />
<ScrollPane fitToHeight="true" fitToWidth="true" layoutY="171.0" prefHeight="133.0" prefWidth="201.0" AnchorPane.bottomAnchor="114.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="195.0"> <ScrollPane fitToHeight="true" fitToWidth="true" layoutY="171.0" prefHeight="133.0" prefWidth="201.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="195.0">
<content> <content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="95.0" prefWidth="198.0"> <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="95.0" prefWidth="198.0">
<children> <children>
@ -64,7 +59,11 @@
<Button mnemonicParsing="false" onAction="#onMapScriptDeletePressed" text="-" /> <Button mnemonicParsing="false" onAction="#onMapScriptDeletePressed" text="-" />
<Button mnemonicParsing="false" onAction="#onMapScriptClonePressed" text="Clone" /><Button fx:id="scriptEraseTool" mnemonicParsing="false" prefHeight="34.0" prefWidth="29.0" styleClass="eraseButton" text="E" /> <Button mnemonicParsing="false" onAction="#onMapScriptClonePressed" text="Clone" /><Button fx:id="scriptEraseTool" mnemonicParsing="false" prefHeight="34.0" prefWidth="29.0" styleClass="eraseButton" text="E" />
</items> </items>
</ToolBar><TextArea fx:id="scriptInfo" editable="false" layoutY="340.0" prefHeight="100.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" /> </ToolBar>
<Label layoutX="4.0" layoutY="49.0" text="Order" />
<TextField fx:id="mapOrderField" layoutX="53.0" layoutY="44.0" prefHeight="27.0" prefWidth="45.0" />
<Label layoutX="4.0" layoutY="83.0" text="Display" />
<CheckBox fx:id="mapDisplay3dField" layoutX="54.0" layoutY="83.0" mnemonicParsing="false" text="3D" />
</children> </children>
</AnchorPane> </AnchorPane>
<AnchorPane fx:id="mapEditorAnchorPane" prefHeight="389.0" prefWidth="477.0000999999975" HBox.hgrow="SOMETIMES"> <AnchorPane fx:id="mapEditorAnchorPane" prefHeight="389.0" prefWidth="477.0000999999975" HBox.hgrow="SOMETIMES">

View File

@ -1471,10 +1471,7 @@ class A2PackPartitions
runNestedvm(acme.Acme.class, "ACME assembler", args, inDir, null, null) runNestedvm(acme.Acme.class, "ACME assembler", args, inDir, null, null)
def uncompData = readBinary(inDir + "build/" + codeName + ".b") def uncompData = readBinary(inDir + "build/" + codeName + ".b")
// Don't compress the loader and the decompressor; compress everything else. addToCache("code", code, codeName, hash, compress(uncompData))
addToCache("code", code, codeName, hash,
(codeName ==~ /loader|decomp/) ? [data:uncompData, len:uncompData.length, compressed:false] :
compress(uncompData))
} }
def assembleCore(inDir) def assembleCore(inDir)
@ -1502,18 +1499,23 @@ class A2PackPartitions
println "Assembling ${name}.s" println "Assembling ${name}.s"
String[] args = ["acme", "-o", "build/$name", "${name}.s"] String[] args = ["acme", "-o", "build/$name", "${name}.s"]
runNestedvm(acme.Acme.class, "ACME assembler", args, inDir, null, null) runNestedvm(acme.Acme.class, "ACME assembler", args, inDir, null, null)
addToCache("sysCode", sysCode, name, hash, compress(readBinary(inDir + "build/$name"))) def uncompData = readBinary(inDir + "build/$name")
// Don't compress the loader and the decompressor; compress mem mgr.
addToCache("sysCode", sysCode, name, hash,
(name ==~ /loader|decomp/) ? [data:uncompData, len:uncompData.length, compressed:false]
: compress(uncompData))
} }
} }
def code = sysCode[name].buf def code = sysCode[name].buf
if (name != "loader") { if (name != "loader") {
assert code.compressed || name == "decomp"
// Uncompressed size first // Uncompressed size first
def uclen = code.isCompressed ? code.uncompressedLen : code.len def uclen = code.compressed ? code.uncompressedLen : code.len
outBuf.put((byte) (uclen & 0xFF)) outBuf.put((byte) (uclen & 0xFF))
outBuf.put((byte) (uclen >> 8)) outBuf.put((byte) (uclen >> 8))
// Then compressed size // Then compressed size
def clen = code.isCompressed ? code.compressedLen : code.len def clen = code.len
outBuf.put((byte) (clen & 0xFF)) outBuf.put((byte) (clen & 0xFF))
outBuf.put((byte) (clen >> 8)) outBuf.put((byte) (clen >> 8))
} }
@ -2733,8 +2735,8 @@ end
inst.createFloppyImages() inst.createFloppyImages()
} }
catch (Throwable t) { catch (Throwable t) {
reportWriter.println "Packing error: ${t.message}" reportWriter.println "Packing error:\n${t.message}"
reportWriter.println " detail: $t" reportWriter.println " detail:\n$t"
if (inst) { if (inst) {
reportWriter.println "\nContext:" reportWriter.println "\nContext:"
reportWriter.println " ${inst.getContextStr()}" reportWriter.println " ${inst.getContextStr()}"

View File

@ -43,6 +43,7 @@ init ; Put something interesting on the screen :)
jsr ROM_cout jsr ROM_cout
iny iny
bne - bne -
beq +
.welcomeText: !text "Welcome to LegendOS.",$8D,0 .welcomeText: !text "Welcome to LegendOS.",$8D,0
; Init pointer to blocks we're going to move/decompress ; Init pointer to blocks we're going to move/decompress
+ lda #<dataStart + lda #<dataStart