Add option to turn off the PLAY default md2

This commit is contained in:
Latapostrophe 2019-04-22 11:29:44 +02:00
parent b128f44986
commit 0f43546ada
5 changed files with 6 additions and 2 deletions

View file

@ -5261,7 +5261,7 @@ static void HWR_DrawSprites(void)
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY) if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
{ {
// 8/1/19: Only don't display player models if no default SPR_PLAY is found. // 8/1/19: Only don't display player models if no default SPR_PLAY is found.
if (!cv_grmd2.value || ((md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound || md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale < 0.0f) && (md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f))) if (!cv_grmd2.value || ((md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound || md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale < 0.0f) && ((!cv_grdefaultmd2.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)))
HWR_DrawSprite(spr); HWR_DrawSprite(spr);
else else
HWR_DrawMD2(spr); HWR_DrawMD2(spr);

View file

@ -81,6 +81,7 @@ extern consvar_t cv_grcoronas;
extern consvar_t cv_grcoronasize; extern consvar_t cv_grcoronasize;
#endif #endif
extern consvar_t cv_grmd2; extern consvar_t cv_grmd2;
extern consvar_t cv_grdefaultmd2;
extern consvar_t cv_grfog; extern consvar_t cv_grfog;
extern consvar_t cv_grfogcolor; extern consvar_t cv_grfogcolor;
extern consvar_t cv_grfogdensity; extern consvar_t cv_grfogdensity;

View file

@ -1218,7 +1218,8 @@ static menuitem_t OP_VideoOptionsMenu[] =
#ifdef HWRENDER #ifdef HWRENDER
{IT_STRING | IT_CVAR, NULL, "3D models", &cv_grmd2, 105}, {IT_STRING | IT_CVAR, NULL, "3D models", &cv_grmd2, 105},
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 115}, {IT_STRING | IT_CVAR, NULL, "Default 3D model", &cv_grdefaultmd2, 115},
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 125},
#endif #endif
}; };

View file

@ -1571,6 +1571,7 @@ void R_RegisterEngineStuff(void)
CV_RegisterVar(&cv_grcoronasize); CV_RegisterVar(&cv_grcoronasize);
#endif #endif
CV_RegisterVar(&cv_grmd2); CV_RegisterVar(&cv_grmd2);
CV_RegisterVar(&cv_grdefaultmd2);
#endif #endif
#ifdef HWRENDER #ifdef HWRENDER

View file

@ -81,6 +81,7 @@ consvar_t cv_grcoronasize = {"gr_coronasize", "1", CV_SAVE| CV_FLOAT, 0, NULL, 0
//static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}}; //static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}};
// console variables in development // console variables in development
consvar_t cv_grmd2 = {"gr_md2", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_grmd2 = {"gr_md2", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grdefaultmd2 = {"gr_defaultmd2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif #endif
const UINT8 gammatable[5][256] = const UINT8 gammatable[5][256] =