Looking for the bug
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
#config
|
||||
INCLUDES+=. ../debugging ../utilities
|
||||
INCLUDES+=. ../utilities
|
||||
LIBS+=
|
||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int snapToBase(int base, int x) {
|
||||
return floor((double)x / base) * base;
|
||||
}
|
||||
@@ -41,17 +39,6 @@ Region::Region(int argX, int argY): x(argX), y(argY) {
|
||||
Region::Region(Region const& rhs): x(rhs.x), y(rhs.y) {
|
||||
memcpy(tiles, rhs.tiles, REGION_WIDTH*REGION_HEIGHT*REGION_DEPTH*sizeof(type_t));
|
||||
solid = rhs.solid;
|
||||
|
||||
//debugging
|
||||
std::cout << "Copied: (" << x << ", " << y << "): " << int(***tiles) << ", " << int(***rhs.tiles) << std::endl;
|
||||
}
|
||||
|
||||
Region::Region(Region&& rhs): x(rhs.x), y(rhs.y) {
|
||||
memcpy(tiles, rhs.tiles, REGION_WIDTH*REGION_HEIGHT*REGION_DEPTH*sizeof(type_t));
|
||||
solid = rhs.solid;
|
||||
|
||||
//debugging
|
||||
std::cout << "Moved: (" << x << ", " << y << "): " << int(***tiles) << ", " << int(***rhs.tiles) << std::endl;
|
||||
}
|
||||
|
||||
Region::type_t Region::SetTile(int x, int y, int z, type_t v) {
|
||||
|
||||
@@ -39,7 +39,6 @@ public:
|
||||
Region() = delete;
|
||||
Region(int x, int y);
|
||||
Region(Region const&);
|
||||
Region(Region&&);
|
||||
~Region() = default;
|
||||
|
||||
type_t SetTile(int x, int y, int z, type_t v);
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
*/
|
||||
#include "region_pager_base.hpp"
|
||||
|
||||
#include "region_checksum.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -74,9 +72,9 @@ Region* RegionPagerBase::FindRegion(int x, int y) {
|
||||
Region* RegionPagerBase::PushRegion(Region* const ptr) {
|
||||
//BUG: Lists seem to not work properly
|
||||
regionList.push_front(*ptr);
|
||||
if (debugRegionSum(®ionList.front()) == 0) {
|
||||
throw(std::runtime_error("Checksum fail; RegionPagerBase::PushRegion()"));
|
||||
}
|
||||
// if (debugRegionSum(®ionList.front()) == 0) {
|
||||
// throw(std::runtime_error("Checksum fail; RegionPagerBase::PushRegion()"));
|
||||
// }
|
||||
return ®ionList.front();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user