Added pr_billboarding mode to control whether face sprites look like classic (and clip into walls) or if they look like polymost (and suck cock).

git-svn-id: https://svn.eduke32.com/eduke32@692 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2008-04-04 08:07:11 +00:00
parent 405a5f878f
commit ec7c642585
3 changed files with 14 additions and 3 deletions

View file

@ -44,7 +44,7 @@
// CVARS // CVARS
extern int pr_occlusionculling; extern int pr_occlusionculling;
extern int pr_fov; extern int pr_fov;
extern int pr_showportals; extern int pr_billboardingmode;
extern int pr_verbosity; extern int pr_verbosity;
extern int pr_wireframe; extern int pr_wireframe;

View file

@ -7,7 +7,7 @@
// CVARS // CVARS
int pr_occlusionculling = 1; int pr_occlusionculling = 1;
int pr_fov = 426; // appears to be the classic setting. 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_verbosity = 1; // 0: silent, 1: errors and one-times, 2: multiple-times, 3: flood
int pr_wireframe = 0; int pr_wireframe = 0;
@ -65,6 +65,8 @@ GLdouble tempvertice[3];
short cursky; short cursky;
short viewangle;
// EXTERNAL FUNCTIONS // EXTERNAL FUNCTIONS
int polymer_init(void) 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"); if (pr_verbosity >= 3) OSD_Printf("PR : Drawing rooms...\n");
viewangle = daang;
ang = (float)(daang) / (2048.0f / 360.0f); ang = (float)(daang) / (2048.0f / 360.0f);
horizang = (float)(100 - dahoriz) / (512.0f / 180.0f); horizang = (float)(100 - dahoriz) / (512.0f / 180.0f);
tiltang = (gtang * 90.0f); tiltang = (gtang * 90.0f);
@ -545,6 +549,13 @@ void polymer_drawsprite(int snum)
curspritedata = vertsprite; 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) switch ((tspr->cstat>>4) & 3)
{ {
case 0: case 0:

View file

@ -697,7 +697,7 @@ cvar[] =
// polymer cvars // polymer cvars
{ "pr_occlusionculling", "pr_occlusionculling: insert description that noone will ever read", (void*)&pr_occlusionculling, CVAR_INT, 0, 0, 512 }, { "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_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_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 }, { "pr_wireframe", "pr_wireframe: toggles wireframe mode", (void*)&pr_wireframe, CVAR_INT, 0, 0, 1 },
#endif #endif