From 280fe814f09164a07dce88a5b88e81f16c6070b0 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 4 Jan 2009 15:32:59 +0000 Subject: [PATCH] removed !ocull check from inner loop git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4111 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/protos.h | 1 + source/src/rendergl.cpp | 2 ++ source/src/worldocull.cpp | 10 +++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/source/src/protos.h b/source/src/protos.h index 5fdd01c9..18611c24 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -437,6 +437,7 @@ extern void render_world(float vx, float vy, float vh, float changelod, int yaw, extern int lod_factor(); // worldocull +extern void disableraytable(); extern void computeraytable(float vx, float vy, float fov); extern int isoccluded(float vx, float vy, float cx, float cy, float csize); diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index 2b58dd38..38fff069 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -741,6 +741,8 @@ void drawminimap(int w, int h) minimap = true; + disableraytable(); + physent *oldcam = camera1; physent minicam; camera1 = &minicam; diff --git a/source/src/worldocull.cpp b/source/src/worldocull.cpp index 643f2c5a..992aa7a4 100644 --- a/source/src/worldocull.cpp +++ b/source/src/worldocull.cpp @@ -16,9 +16,15 @@ COMMAND(toggleocull, ARG_NONE); // constructs occlusion map: cast rays in all directions on the 2d plane and record distance. // done exactly once per frame. +void disableraytable() +{ + odist = 1e16f; + loopi(NUMRAYS) rdist[i] = 1e16f; +} + void computeraytable(float vx, float vy, float fov) { - if(!ocull) return; + if(!ocull) { disableraytable(); return; } odist = getvar("fog")*1.5f; @@ -71,8 +77,6 @@ static inline float ma(float x, float y) { return x==0 ? (y>0 ? 2 : -2) : y/x; } int isoccluded(float vx, float vy, float cx, float cy, float csize) // v = viewer, c = cube to test { - if(!ocull || minimap) return 0; - float xdist = 0, ydist = 0; // distance from point on the border of the cube that is closest to v if(vxcx+csize) xdist = vx-(cx+csize);