diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index 5dac22da..cf27b560 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -101,7 +101,7 @@ ox::Error shutdownGfx() { case 3: return REG_BG3CNT; default: - oxPanic("Looking up non-existent register", OxError(1)); + oxPanic(OxError(1), "Looking up non-existent register"); return REG_BG0CNT; } } diff --git a/src/nostalgia/core/gba/mem.cpp b/src/nostalgia/core/gba/mem.cpp index 33206430..563d4b12 100644 --- a/src/nostalgia/core/gba/mem.cpp +++ b/src/nostalgia/core/gba/mem.cpp @@ -94,7 +94,7 @@ static HeapSegment *findSegmentFor(std::size_t sz) { return s; } } - oxPanic("malloc: could not find segment", OxError(1)); + oxPanic(OxError(1), "malloc: could not find segment"); return nullptr; } @@ -118,7 +118,7 @@ void free(void *ptr) { } else if (p.segment) { p.segment->inUse = false; } else { - oxPanic("Bad heap free", OxError(1)); + oxPanic(OxError(1), "Bad heap free"); } } @@ -160,4 +160,4 @@ void operator delete[](void *ptr, unsigned long int) { core::free(ptr); } -#endif \ No newline at end of file +#endif diff --git a/src/nostalgia/core/studio/Pixel.qml b/src/nostalgia/core/studio/Pixel.qml index b448ebfb..235c459f 100644 --- a/src/nostalgia/core/studio/Pixel.qml +++ b/src/nostalgia/core/studio/Pixel.qml @@ -11,7 +11,7 @@ import QtQuick 2.0 Rectangle { id: pixel; property int pixelNumber: index - color: sheetData.palette[pixelNumber < sheetData.pixels.length ? sheetData.pixels[pixelNumber] : 0] + color: sheetData ? sheetData.palette[pixelNumber < sheetData.pixels.length ? sheetData.pixels[pixelNumber] : 0] : 'black' width: parent.width / 8 height: parent.height / 8 border.color: '#717d7e' diff --git a/src/nostalgia/core/studio/TileSheetEditor.qml b/src/nostalgia/core/studio/TileSheetEditor.qml index de4f5964..58d24894 100644 --- a/src/nostalgia/core/studio/TileSheetEditor.qml +++ b/src/nostalgia/core/studio/TileSheetEditor.qml @@ -17,6 +17,7 @@ ScrollView { contentWidth: tileGrid.width contentHeight: tileGrid.height clip: true + focusPolicy: Qt.WheelFocus background: Rectangle { color: '#717d7e' @@ -24,7 +25,8 @@ ScrollView { MouseArea { id: mouseArea - anchors.fill: parent + width: tileSheetEditor.width + height: tileSheetEditor.height acceptedButtons: Qt.LeftButton onPressed: { @@ -76,8 +78,8 @@ ScrollView { height: tileGrid.rows * tileGrid.baseTileSize * tileGrid.scaleFactor //anchors.horizontalCenter: parent.horizontalCenter //anchors.verticalCenter: parent.verticalCenter - rows: sheetData.rows - columns: sheetData.columns + rows: sheetData ? sheetData.rows : 1 + columns: sheetData ? sheetData.columns : 1 Repeater { model: tileGrid.rows * tileGrid.columns Tile { diff --git a/src/nostalgia/tools/pack.cpp b/src/nostalgia/tools/pack.cpp index 707bf446..f2ab6e67 100644 --- a/src/nostalgia/tools/pack.cpp +++ b/src/nostalgia/tools/pack.cpp @@ -52,7 +52,7 @@ int main(int argc, const char **args) { try { run(ox::ClArgs(argc, args)); } catch (const ox::Error &err) { - oxPanic("pack failed", err); + oxPanic(err, "pack failed"); std::cerr << "pack failed...\n"; return static_cast(err); }