[nostalgia] Fix oxPanic parameter order

This commit is contained in:
Gary Talent 2020-02-16 02:06:05 -06:00
parent da3c9107db
commit 1269ee7fad
5 changed files with 11 additions and 9 deletions

View File

@ -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;
}
}

View File

@ -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
#endif

View File

@ -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'

View File

@ -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 {

View File

@ -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<int>(err);
}