Moved serialization globals

This commit is contained in:
Kayne Ruse
2014-08-25 00:07:17 +10:00
parent 4ed512e0e2
commit 6f4334f84d
9 changed files with 25 additions and 25 deletions
+1
View File
@@ -22,6 +22,7 @@
#include "region.hpp"
#include <stdexcept>
#include <cmath>
#include <cstring>
int snapToBase(int base, int x) {
-7
View File
@@ -23,16 +23,12 @@
#define REGION_HPP_
#include <bitset>
#include <cmath>
//the region's storage format
constexpr int REGION_WIDTH = 20;
constexpr int REGION_HEIGHT = 20;
constexpr int REGION_DEPTH = 3;
//the size of the solid map
constexpr int REGION_SOLID_FOOTPRINT = ceil(REGION_WIDTH * REGION_HEIGHT / 8.0);
//utility function
int snapToBase(int base, int x);
@@ -64,7 +60,4 @@ private:
std::bitset<REGION_WIDTH*REGION_HEIGHT> solid;
};
//the memory footprint of the tile and solid data; not including any metadata
constexpr int REGION_FOOTPRINT = REGION_WIDTH * REGION_HEIGHT * REGION_DEPTH * sizeof(Region::type_t) + REGION_SOLID_FOOTPRINT;
#endif
+2 -2
View File
@@ -71,12 +71,12 @@ Region* RegionPagerBase::PushRegion(Region* const ptr) {
}
Region* RegionPagerBase::LoadRegion(int x, int y) {
//TODO: load the region if possible
//EMPTY, intended for override
return nullptr;
}
Region* RegionPagerBase::SaveRegion(int x, int y) {
//TODO: find & save the region
//EMPTY, intended for override
return nullptr;
}
-2
View File
@@ -23,8 +23,6 @@
#include <stdexcept>
//TODO: Could I push the pager to the API functions too?
Region* RegionPagerLua::LoadRegion(int x, int y) {
//get the pager's function from the registry
lua_rawgeti(lua, LUA_REGISTRYINDEX, loadRef);