diff --git a/polymer/build/include/polymer.h b/polymer/build/include/polymer.h index a97eef3e0..0fa4f646f 100644 --- a/polymer/build/include/polymer.h +++ b/polymer/build/include/polymer.h @@ -44,7 +44,7 @@ // CVARS extern int pr_occlusionculling; extern int pr_fov; -extern int pr_showportals; +extern int pr_billboardingmode; extern int pr_verbosity; extern int pr_wireframe; diff --git a/polymer/build/src/polymer.c b/polymer/build/src/polymer.c index b3f692dba..a24614ea1 100644 --- a/polymer/build/src/polymer.c +++ b/polymer/build/src/polymer.c @@ -7,7 +7,7 @@ // CVARS int pr_occlusionculling = 1; int pr_fov = 426; // appears to be the classic setting. -int pr_showportals = 0; +int pr_billboardingmode = 0; int pr_verbosity = 1; // 0: silent, 1: errors and one-times, 2: multiple-times, 3: flood int pr_wireframe = 0; @@ -65,6 +65,8 @@ GLdouble tempvertice[3]; short cursky; +short viewangle; + // EXTERNAL FUNCTIONS int polymer_init(void) { @@ -206,6 +208,8 @@ void polymer_drawrooms(int daposx, int daposy, int daposz, short if (pr_verbosity >= 3) OSD_Printf("PR : Drawing rooms...\n"); + viewangle = daang; + ang = (float)(daang) / (2048.0f / 360.0f); horizang = (float)(100 - dahoriz) / (512.0f / 180.0f); tiltang = (gtang * 90.0f); @@ -545,6 +549,13 @@ void polymer_drawsprite(int snum) curspritedata = vertsprite; + if (pr_billboardingmode && !((tspr->cstat>>4) & 3)) + { + // do surgery on the face tspr to make it look like a wall sprite + tspr->cstat |= 16; + tspr->ang = (viewangle + 1024) & 2047; + } + switch ((tspr->cstat>>4) & 3) { case 0: diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 8dccf8804..327ad137f 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -697,7 +697,7 @@ cvar[] = // polymer cvars { "pr_occlusionculling", "pr_occlusionculling: insert description that noone will ever read", (void*)&pr_occlusionculling, CVAR_INT, 0, 0, 512 }, { "pr_fov", "pr_fov: sets the field of vision in build angle", (void*)&pr_fov, CVAR_INT, 0, 0, 1023}, - { "pr_showportals", "pr_showportals: toggles frustum culling (recommended)", (void*)&pr_showportals, CVAR_INT, 0, 0, 1 }, + { "pr_billboardingmode", "pr_billboardingmode: face sprite display method. 0: classic mode; 1: polymost mode", (void*)&pr_billboardingmode, CVAR_INT, 0, 0, 1 }, { "pr_verbosity", "pr_verbosity: verbosity level of the polymer renderer", (void*)&pr_verbosity, CVAR_INT, 0, 0, 3 }, { "pr_wireframe", "pr_wireframe: toggles wireframe mode", (void*)&pr_wireframe, CVAR_INT, 0, 0, 1 }, #endif