Refactored the map system (read more)

The region's width, height and depth are all defined by preprocessor
macros. The rest of the map system has been updated to match. The
programs proper need to be updated as well. It would be a good idea to
include the macros' values as part of the initial communication protocols,
so that the clients don't connect to a server that is using the wrong
sized regions.
This commit is contained in:
Kayne Ruse
2014-04-20 03:31:37 +10:00
parent ac27fb0ca7
commit c5a627004a
10 changed files with 60 additions and 159 deletions
+5 -19
View File
@@ -23,33 +23,19 @@
#include <stdexcept>
void DummyFormat::Load(Region** const ptr, int width, int height, int depth, int x, int y) {
void DummyFormat::Load(Region** const ptr, int x, int y) {
//EMPTY
}
void DummyFormat::Save(Region* const ptr) {
//EMPTY
}
/*
void VerboseFormat::Load(Region** const ptr, int x, int y) {
//TODO
}
void VerboseFormat::Save(Region* const ptr) {
//TODO
}
void CompactFormat::Load(Region** const ptr, int x, int y) {
//TODO
}
void CompactFormat::Save(Region* const ptr) {
//TODO
}
*/
void LuaFormat::Load(Region** const ptr, int width, int height, int depth, int x, int y) {
void LuaFormat::Load(Region** const ptr, int x, int y) {
//something to load into
(*ptr) = new Region(width, height, depth, x, y);
if (!ptr) {
(*ptr) = new Region(x, y);
}
//API hook
lua_getglobal(state, "Region");