diff options
| author | Jonas Ask | 2009-10-22 23:13:27 +0000 |
|---|---|---|
| committer | Jonas Ask | 2009-10-22 23:13:27 +0000 |
| commit | 4df1a11a96ca50d28bf6cf7a8013f3a49df744f9 (patch) | |
| tree | 9668e422c07971444293a5965f32949fda9b8ef2 /WorldSegment.cpp | |
| parent | 76db31294fdb8cc09fa788e5e120c160c4fc85d0 (diff) | |
| download | stonesense-4df1a11a96ca50d28bf6cf7a8013f3a49df744f9.tar.gz stonesense-4df1a11a96ca50d28bf6cf7a8013f3a49df744f9.tar.bz2 stonesense-4df1a11a96ca50d28bf6cf7a8013f3a49df744f9.tar.xz | |
Added a debug cursor to look at block details.
Fixed hiding borders on fortifications.
Added new fortification: Carved from stone.
Diffstat (limited to 'WorldSegment.cpp')
| -rw-r--r-- | WorldSegment.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/WorldSegment.cpp b/WorldSegment.cpp index 1b28786..615fa69 100644 --- a/WorldSegment.cpp +++ b/WorldSegment.cpp @@ -24,8 +24,16 @@ Block* WorldSegment::getBlock(uint32_t x, uint32_t y, uint32_t z){ uint32_t index = lx + (ly * this->sizex) + ((lz) * this->sizex * this->sizey);
return blocksAsPointerVolume[index];
+}
+Block* WorldSegment::getBlockLocal(uint32_t x, uint32_t y, uint32_t z){
+ if((int)x < 0 || x >= (uint32_t)this->sizex) return 0;
+ if((int)y < 0 || y >= (uint32_t)this->sizey) return 0;
+ if((int)z < 0 || z >= (uint32_t)this->sizez) return 0;
+ uint32_t index = x + (y * this->sizex) + ((z) * this->sizex * this->sizey);
+ return blocksAsPointerVolume[index];
}
+
Block* WorldSegment::getBlock(uint32_t index){
if(index<0 || index >= blocks.size() )
return 0;
|
