From e7fc03ed334a72f6dd0d62719c97398a6f0e98ae Mon Sep 17 00:00:00 2001 From: plagman Date: Sat, 20 Aug 2011 21:04:53 +0000 Subject: [PATCH] Polymer: Reorganize main displayrooms loop a bit. When walking the sectors, put more drawing work between queuing and reaping the occlusion queries to potentially make them more efficient. git-svn-id: https://svn.eduke32.com/eduke32@1976 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 5c406ba3d..4459921da 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -1535,10 +1535,6 @@ static void polymer_displayrooms(int16_t dacursectnum) i = sec->wallnum-1; do { - // this is a couple of fps faster for me... does it mess anything up? - if (wallvisible(globalposx, globalposy, sec->wallptr + i)) - polymer_drawwall(sectorqueue[front], sec->wallptr + i); - // if we have a level boundary somewhere in the sector, // consider these walls as visportals if (wall[sec->wallptr + i].nextsector < 0) @@ -1637,6 +1633,16 @@ static void polymer_displayrooms(int16_t dacursectnum) i--; } + // Cram as much CPU or GPU work as we can between queuing the + // occlusion queries and reaping them. + i = sec->wallnum-1; + do + { + if (wallvisible(globalposx, globalposy, sec->wallptr + i)) + polymer_drawwall(sectorqueue[front], sec->wallptr + i); + } + while (--i >= 0); + // queue ROR neighbors if ((sec->floorstat & 1024) && (bunchnum = yax_getbunch(sectorqueue[front], YAX_FLOOR)) >= 0) {