summaryrefslogtreecommitdiff
path: root/WorldSegment.cpp
diff options
context:
space:
mode:
authorJonas Ask2009-11-10 01:12:05 +0000
committerJonas Ask2009-11-10 01:12:05 +0000
commitfee8c8d689abd4f5e37b72a3e8c6ca8e85a4034e (patch)
tree1540e7ffb837e6542d15a93fde07839d66f0fc92 /WorldSegment.cpp
parent038d045f19146776b886edbc23f88aa1f0c9e6a7 (diff)
downloadstonesense-fee8c8d689abd4f5e37b72a3e8c6ca8e85a4034e.tar.gz
stonesense-fee8c8d689abd4f5e37b72a3e8c6ca8e85a4034e.tar.bz2
stonesense-fee8c8d689abd4f5e37b72a3e8c6ca8e85a4034e.tar.xz
Early prototype rotation...
Diffstat (limited to 'WorldSegment.cpp')
-rw-r--r--WorldSegment.cpp56
1 files changed, 55 insertions, 1 deletions
diff --git a/WorldSegment.cpp b/WorldSegment.cpp
index f0869ef..05bf05b 100644
--- a/WorldSegment.cpp
+++ b/WorldSegment.cpp
@@ -81,6 +81,60 @@ void WorldSegment::drawAllBlocks(BITMAP* target){
int32_t vsymax = viewedSegment->y + viewedSegment->sizey;
int32_t vszmax = viewedSegment->z + viewedSegment->sizez;
for(int32_t vsz=viewedSegment->z; vsz < vszmax; vsz++){
+ switch (DisplayedRotation){
+ case 0:
+ for(int32_t vsx=viewedSegment->x; vsx < vsxmax; vsx++){
+ for(int32_t vsy=viewedSegment->y; vsy < vsymax; vsy++){
+ Block *b = getBlock(vsx,vsy,vsz);
+ if (b)
+ {
+ b->Draw(target);
+ }
+ }
+ }
+ break;
+ case 1:
+ for(int32_t vsx=viewedSegment->x; vsx < vsxmax; vsx++){
+ for(int32_t vsy=vsymax-1; vsy >= viewedSegment->y; vsy--){
+ Block *b = getBlock(vsx,vsy,vsz);
+ if (b)
+ {
+ b->Draw(target);
+ }
+ }
+ }
+ break;
+ case 2:
+ for(int32_t vsx=vsymax-1; vsx >= viewedSegment->x; vsx--){
+ for(int32_t vsy=vsymax-1; vsy >= viewedSegment->y; vsy--){
+ Block *b = getBlock(vsx,vsy,vsz);
+ if (b)
+ {
+ b->Draw(target);
+ }
+ }
+ }
+ break;
+ case 3:
+ for(int32_t vsx=vsymax-1; vsx >= viewedSegment->x; vsx--){
+ for(int32_t vsy=viewedSegment->y; vsy < vsymax; vsy++){
+ Block *b = getBlock(vsx,vsy,vsz);
+ if (b)
+ {
+ b->Draw(target);
+ }
+ }
+ }
+ break;
+ }
+ }
+}
+/*void WorldSegment::drawAllBlocks(BITMAP* target){
+ // x,y,z print pricess
+ int32_t vsxmax = viewedSegment->x + viewedSegment->sizex;
+ int32_t vsymax = viewedSegment->y + viewedSegment->sizey;
+ int32_t vszmax = viewedSegment->z + viewedSegment->sizez;
+ for(int32_t vsz=viewedSegment->z; vsz < vszmax; vsz++){
for(int32_t vsx=viewedSegment->x; vsx < vsxmax; vsx++){
for(int32_t vsy=viewedSegment->y; vsy < vsymax; vsy++){
Block *b = getBlock(vsx,vsy,vsz);
@@ -91,7 +145,7 @@ void WorldSegment::drawAllBlocks(BITMAP* target){
}
}
}
-}
+} */
bool WorldSegment::CoordinateInsideSegment(uint32_t x, uint32_t y, uint32_t z){