Add more complete implementation for custom new/delete, add panic

This commit is contained in:
2017-10-14 03:13:26 -05:00
parent dd4556e4e1
commit 70cee81406
15 changed files with 293 additions and 28 deletions
+26
View File
@@ -11,5 +11,31 @@
namespace nostalgia {
namespace world {
Zone::Zone() {
m_bounds.x = -1;
m_bounds.y = -1;
m_bounds.width = -1;
m_bounds.height = -1;
}
void Zone::draw(core::Context *ctx) {
}
size_t Zone::size() {
return sizeof(Zone) + m_bounds.width * m_bounds.height * sizeof(TileDef);
}
TileDef *Zone::tiles() {
return (TileDef*) (this + 1);
}
TileDef *Zone::tile(int row, int column) {
return &tiles()[row * m_bounds.width + column];
}
void Zone::setTile(int row, int column, TileDef *td) {
tiles()[row * m_bounds.width + column] = *td;
}
}
}