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
+48 -3
View File
@@ -10,13 +10,58 @@
#include <ox/std/types.hpp>
#include <nostalgia/common/common.hpp>
#include <nostalgia/core/core.hpp>
namespace nostalgia {
namespace world {
struct TileDef {
uint16_t bgTile;
};
template<typename T>
ox::Error ioOp(T *io, TileDef *obj) {
ox::Error err = 0;
io->setFields(1);
err |= io->op("bgTile", &obj->bgTile);
return err;
}
struct ZoneDef {
int width = 0;
int height = 0;
uint16_t tileMap;
int32_t width = 0;
int32_t height = 0;
};
class Zone {
private:
common::Bounds m_bounds;
public:
Zone();
void draw(core::Context *ctx);
size_t size();
TileDef *tiles();
TileDef *tile(int row, int column);
void setTile(int row, int column, TileDef *td);
};
class Region {
private:
Zone *m_zones;
public:
};
}