From 24e538eeec0c966be264f47174b329f086ce51f2 Mon Sep 17 00:00:00 2001 From: Caldfir Date: Tue, 17 Apr 2012 18:58:09 -0700 Subject: Made a less-aggressive version of the occlusion cull (only attempts to cull hidden blocks). --- MapLoading.cpp | 4 +++- UserInput.cpp | 2 +- commonTypes.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MapLoading.cpp b/MapLoading.cpp index 0b60284..d1ea9ec 100644 --- a/MapLoading.cpp +++ b/MapLoading.cpp @@ -849,7 +849,9 @@ void beautify_Segment(WorldSegment * segment) for(uint32_t i=0; i < numblocks; i++){ Block* b = segment->getBlock(i); - if(config.occlusion) + if(config.occlusion == 1) + occlude_block(b); + else if(config.occlusion == 2 && b->designation.bits.hidden) occlude_block(b); if(!b->visible) diff --git a/UserInput.cpp b/UserInput.cpp index 96c31fb..55cb7ac 100644 --- a/UserInput.cpp +++ b/UserInput.cpp @@ -225,7 +225,7 @@ void doKeys(int Key) timeToReloadSegment = true; } if(Key == ALLEGRO_KEY_O){ - config.occlusion = !config.occlusion; + config.occlusion = (config.occlusion+1)%3; timeToReloadSegment = true; } if(Key == ALLEGRO_KEY_M){ diff --git a/commonTypes.h b/commonTypes.h index 40c7c7f..3af3a5c 100644 --- a/commonTypes.h +++ b/commonTypes.h @@ -196,7 +196,7 @@ typedef struct bool fog_of_war; - bool occlusion; + char occlusion; bool block_count; uint16_t bloodcutoff; -- cgit v1.2.1