Add more complete implementation for custom new/delete, add panic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user