mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-14 13:51:31 +00:00
Generic model terminology
This commit is contained in:
parent
7911fa24d0
commit
052104999f
6 changed files with 29 additions and 29 deletions
|
@ -5261,14 +5261,14 @@ static void HWR_DrawSprites(void)
|
|||
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.
|
||||
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_grmdls.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)))
|
||||
HWR_DrawSprite(spr);
|
||||
else
|
||||
HWR_DrawMD2(spr);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!cv_grmd2.value || md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
|
||||
if (!cv_grmdls.value || md2_models[spr->mobj->sprite].notfound || md2_models[spr->mobj->sprite].scale < 0.0f)
|
||||
HWR_DrawSprite(spr);
|
||||
else
|
||||
HWR_DrawMD2(spr);
|
||||
|
@ -5435,7 +5435,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
tz = (tr_x * gr_viewcos) + (tr_y * gr_viewsin);
|
||||
|
||||
// thing is behind view plane?
|
||||
if (tz < ZCLIP_PLANE && !papersprite && (!cv_grmd2.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
||||
if (tz < ZCLIP_PLANE && !papersprite && (!cv_grmdls.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
||||
return;
|
||||
|
||||
// The above can stay as it works for cutting sprites that are too close
|
||||
|
|
|
@ -79,7 +79,7 @@ extern consvar_t cv_grstaticlighting;
|
|||
extern consvar_t cv_grcoronas;
|
||||
extern consvar_t cv_grcoronasize;
|
||||
#endif
|
||||
extern consvar_t cv_grmd2;
|
||||
extern consvar_t cv_grmdls;
|
||||
extern consvar_t cv_grfog;
|
||||
extern consvar_t cv_grfogcolor;
|
||||
extern consvar_t cv_grfogdensity;
|
||||
|
|
|
@ -164,13 +164,13 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
|||
#endif
|
||||
volatile png_FILE_p png_FILE;
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
char *pngfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
|
||||
char *pngfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2home, filename);
|
||||
|
||||
FIL_ForceExtension(pngfilename, ".png");
|
||||
png_FILE = fopen(pngfilename, "rb");
|
||||
if (!png_FILE)
|
||||
{
|
||||
pngfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2path, filename);
|
||||
pngfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2path, filename);
|
||||
FIL_ForceExtension(pngfilename, ".png");
|
||||
png_FILE = fopen(pngfilename, "rb");
|
||||
//CONS_Debug(DBG_RENDER, "M_SavePNG: Error on opening %s for loading\n", filename);
|
||||
|
@ -297,13 +297,13 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
|||
INT32 ch, rep;
|
||||
FILE *file;
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
char *pcxfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
|
||||
char *pcxfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2home, filename);
|
||||
|
||||
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||
file = fopen(pcxfilename, "rb");
|
||||
if (!file)
|
||||
{
|
||||
pcxfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2path, filename);
|
||||
pcxfilename = va("%s"PATHSEP"mdls"PATHSEP"%s", srb2path, filename);
|
||||
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||
file = fopen(pcxfilename, "rb");
|
||||
if (!file)
|
||||
|
@ -492,16 +492,16 @@ void HWR_InitMD2(void)
|
|||
md2_models[i].error = false;
|
||||
}
|
||||
|
||||
// read the md2.dat file
|
||||
// read the mdls.dat file
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "kmd2.dat"), "rt");
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "mdls.dat"), "rt");
|
||||
if (!f)
|
||||
{
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading mdls.dat:"), strerror(errno));
|
||||
nomd2s = true;
|
||||
return;
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ void HWR_InitMD2(void)
|
|||
{
|
||||
/*if (stricmp(name, "PLAY") == 0)
|
||||
{
|
||||
CONS_Printf("MD2 for sprite PLAY detected in kmd2.dat, use a player skin instead!\n");
|
||||
CONS_Printf("MD2 for sprite PLAY detected in mdls.dat, use a player skin instead!\n");
|
||||
continue;
|
||||
}*/
|
||||
// 8/1/19: Allow PLAY to load for default MD2.
|
||||
|
@ -545,7 +545,7 @@ void HWR_InitMD2(void)
|
|||
}
|
||||
}
|
||||
// no sprite/player skin name found?!?
|
||||
CONS_Printf("Unknown sprite/player skin %s detected in kmd2.dat\n", name);
|
||||
CONS_Printf("Unknown sprite/player skin %s detected in mdls.dat\n", name);
|
||||
md2found:
|
||||
// move on to next line...
|
||||
continue;
|
||||
|
@ -564,16 +564,16 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
|
|||
|
||||
CONS_Printf("AddPlayerMD2()...\n");
|
||||
|
||||
// read the md2.dat file
|
||||
// read the mdls.dat file
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "kmd2.dat"), "rt");
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "mdls.dat"), "rt");
|
||||
if (!f)
|
||||
{
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading mdls.dat:"), strerror(errno));
|
||||
nomd2s = true;
|
||||
return;
|
||||
}
|
||||
|
@ -603,7 +603,7 @@ playermd2found:
|
|||
void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startup
|
||||
{
|
||||
FILE *f;
|
||||
// name[18] is used to check for names in the kmd2.dat file that match with sprites or player skins
|
||||
// name[18] is used to check for names in the mdls.dat file that match with sprites or player skins
|
||||
// sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long
|
||||
char name[18], filename[32];
|
||||
float scale, offset;
|
||||
|
@ -616,14 +616,14 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
|
|||
|
||||
// Read the md2.dat file
|
||||
//Filename checking fixed ~Monster Iestyn and Golden
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "kmd2.dat"), "rt");
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||
|
||||
if (!f)
|
||||
{
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "kmd2.dat"), "rt");
|
||||
f = fopen(va("%s"PATHSEP"%s", srb2path, "mdls.dat"), "rt");
|
||||
if (!f)
|
||||
{
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
||||
CONS_Printf("%s %s\n", M_GetText("Error while loading mdls.dat:"), strerror(errno));
|
||||
nomd2s = true;
|
||||
return;
|
||||
}
|
||||
|
@ -867,7 +867,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||
md2_t *md2;
|
||||
UINT8 color[4];
|
||||
|
||||
if (!cv_grmd2.value)
|
||||
if (!cv_grmdls.value)
|
||||
return;
|
||||
|
||||
if (spr->precip)
|
||||
|
@ -951,8 +951,8 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||
return; // we already failed loading this before :(
|
||||
if (!md2->model)
|
||||
{
|
||||
CONS_Debug(DBG_RENDER, "Loading MD2... (%s, %s)", sprnames[spr->mobj->sprite], md2->filename);
|
||||
sprintf(filename, "md2/%s", md2->filename);
|
||||
CONS_Debug(DBG_RENDER, "Loading model... (%s, %s)", sprnames[spr->mobj->sprite], md2->filename);
|
||||
sprintf(filename, "mdls/%s", md2->filename);
|
||||
md2->model = md2_readModel(filename);
|
||||
|
||||
if (md2->model)
|
||||
|
@ -1034,7 +1034,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||
frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->meshes[0].numFrames;
|
||||
|
||||
#ifdef USE_MODEL_NEXTFRAME
|
||||
if (cv_grmd2.value == 1 && tics <= durs)
|
||||
if (cv_grmdls.value == 1 && tics <= durs)
|
||||
{
|
||||
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
||||
if (spr->mobj->frame & FF_ANIMATE)
|
||||
|
|
|
@ -1217,7 +1217,7 @@ static menuitem_t OP_VideoOptionsMenu[] =
|
|||
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 90},
|
||||
|
||||
#ifdef HWRENDER
|
||||
{IT_STRING | IT_CVAR, NULL, "3D models", &cv_grmd2, 105},
|
||||
{IT_STRING | IT_CVAR, NULL, "3D models", &cv_grmdls, 105},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 115},
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -1569,7 +1569,7 @@ void R_RegisterEngineStuff(void)
|
|||
CV_RegisterVar(&cv_grcoronas);
|
||||
CV_RegisterVar(&cv_grcoronasize);
|
||||
#endif
|
||||
CV_RegisterVar(&cv_grmd2);
|
||||
CV_RegisterVar(&cv_grmdls);
|
||||
#endif
|
||||
|
||||
#ifdef HWRENDER
|
||||
|
|
|
@ -79,7 +79,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}};
|
||||
// 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_grmdls = {"gr_mdls", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
const UINT8 gammatable[5][256] =
|
||||
|
|
Loading…
Reference in a new issue