mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-22 20:02:03 +00:00
Merge branch 'md3-vanillla-patch' into 'md3-vanilla'
Generic model terminology See merge request STJr/SRB2!487
This commit is contained in:
commit
2a5a788efe
5 changed files with 24 additions and 24 deletions
|
@ -5246,14 +5246,14 @@ static void HWR_DrawSprites(void)
|
||||||
#endif
|
#endif
|
||||||
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||||
{
|
{
|
||||||
if (!cv_grmd2.value || md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound || md2_playermodels[(skin_t*)spr->mobj->skin-skins].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)
|
||||||
HWR_DrawSprite(spr);
|
HWR_DrawSprite(spr);
|
||||||
else
|
else
|
||||||
HWR_DrawMD2(spr);
|
HWR_DrawMD2(spr);
|
||||||
}
|
}
|
||||||
else
|
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);
|
HWR_DrawSprite(spr);
|
||||||
else
|
else
|
||||||
HWR_DrawMD2(spr);
|
HWR_DrawMD2(spr);
|
||||||
|
@ -5377,7 +5377,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
tz = (tr_x * gr_viewcos) + (tr_y * gr_viewsin);
|
tz = (tr_x * gr_viewcos) + (tr_y * gr_viewsin);
|
||||||
|
|
||||||
// thing is behind view plane?
|
// thing is behind view plane?
|
||||||
if (tz < ZCLIP_PLANE && (!cv_grmd2.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
if (tz < ZCLIP_PLANE && (!cv_grmdls.value || md2_models[thing->sprite].notfound == true)) //Yellow: Only MD2's dont disappear
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// The above can stay as it works for cutting sprites that are too close
|
// The above can stay as it works for cutting sprites that are too close
|
||||||
|
|
|
@ -80,7 +80,7 @@ extern consvar_t cv_grcoronas;
|
||||||
extern consvar_t cv_grcoronasize;
|
extern consvar_t cv_grcoronasize;
|
||||||
#endif
|
#endif
|
||||||
extern consvar_t cv_grfov;
|
extern consvar_t cv_grfov;
|
||||||
extern consvar_t cv_grmd2;
|
extern consvar_t cv_grmdls;
|
||||||
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;
|
||||||
|
|
|
@ -159,7 +159,7 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||||
#endif
|
#endif
|
||||||
png_FILE_p png_FILE;
|
png_FILE_p png_FILE;
|
||||||
//Filename checking fixed ~Monster Iestyn and Golden
|
//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");
|
FIL_ForceExtension(pngfilename, ".png");
|
||||||
png_FILE = fopen(pngfilename, "rb");
|
png_FILE = fopen(pngfilename, "rb");
|
||||||
|
@ -288,7 +288,7 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||||
INT32 ch, rep;
|
INT32 ch, rep;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
//Filename checking fixed ~Monster Iestyn and Golden
|
//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");
|
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||||
file = fopen(pcxfilename, "rb");
|
file = fopen(pcxfilename, "rb");
|
||||||
|
@ -477,13 +477,13 @@ void HWR_InitMD2(void)
|
||||||
md2_models[i].error = false;
|
md2_models[i].error = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the md2.dat file
|
// read the mdls.dat file
|
||||||
//Filename checking fixed ~Monster Iestyn and Golden
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt");
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
CONS_Printf("%s %s\n", M_GetText("Error while loading md2.dat:"), strerror(errno));
|
CONS_Printf("%s %s\n", M_GetText("Error while loading mdls.dat:"), strerror(errno));
|
||||||
nomd2s = true;
|
nomd2s = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -491,7 +491,7 @@ void HWR_InitMD2(void)
|
||||||
{
|
{
|
||||||
if (stricmp(name, "PLAY") == 0)
|
if (stricmp(name, "PLAY") == 0)
|
||||||
{
|
{
|
||||||
CONS_Printf("MD2 for sprite PLAY detected in md2.dat, use a player skin instead!\n");
|
CONS_Printf("MD2 for sprite PLAY detected in mdls.dat, use a player skin instead!\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,7 +525,7 @@ void HWR_InitMD2(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// no sprite/player skin name found?!?
|
// no sprite/player skin name found?!?
|
||||||
CONS_Printf("Unknown sprite/player skin %s detected in md2.dat\n", name);
|
CONS_Printf("Unknown sprite/player skin %s detected in mdls.dat\n", name);
|
||||||
md2found:
|
md2found:
|
||||||
// move on to next line...
|
// move on to next line...
|
||||||
continue;
|
continue;
|
||||||
|
@ -544,13 +544,13 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
|
||||||
|
|
||||||
CONS_Printf("AddPlayerMD2()...\n");
|
CONS_Printf("AddPlayerMD2()...\n");
|
||||||
|
|
||||||
// read the md2.dat file
|
// read the mdls.dat file
|
||||||
//Filename checking fixed ~Monster Iestyn and Golden
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt");
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
CONS_Printf("Error while loading md2.dat\n");
|
CONS_Printf("Error while loading mdls.dat\n");
|
||||||
nomd2s = true;
|
nomd2s = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -579,7 +579,7 @@ playermd2found:
|
||||||
void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startup
|
void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startup
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
// name[18] is used to check for names in the md2.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
|
// 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];
|
char name[18], filename[32];
|
||||||
float scale, offset;
|
float scale, offset;
|
||||||
|
@ -590,13 +590,13 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
|
||||||
if (spritenum == SPR_PLAY) // Handled already NEWMD2: Per sprite, per-skin check
|
if (spritenum == SPR_PLAY) // Handled already NEWMD2: Per sprite, per-skin check
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Read the md2.dat file
|
// Read the mdls.dat file
|
||||||
//Filename checking fixed ~Monster Iestyn and Golden
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt");
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "mdls.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
CONS_Printf("Error while loading md2.dat\n");
|
CONS_Printf("Error while loading mdls.dat\n");
|
||||||
nomd2s = true;
|
nomd2s = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -895,7 +895,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
md2_t *md2;
|
md2_t *md2;
|
||||||
UINT8 color[4];
|
UINT8 color[4];
|
||||||
|
|
||||||
if (!cv_grmd2.value)
|
if (!cv_grmdls.value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (spr->precip)
|
if (spr->precip)
|
||||||
|
@ -974,8 +974,8 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
return; // we already failed loading this before :(
|
return; // we already failed loading this before :(
|
||||||
if (!md2->model)
|
if (!md2->model)
|
||||||
{
|
{
|
||||||
//CONS_Debug(DBG_RENDER, "Loading MD2... (%s)", sprnames[spr->mobj->sprite]);
|
//CONS_Debug(DBG_RENDER, "Loading model... (%s)", sprnames[spr->mobj->sprite]);
|
||||||
sprintf(filename, "md2/%s", md2->filename);
|
sprintf(filename, "mdls/%s", md2->filename);
|
||||||
md2->model = md2_readModel(filename);
|
md2->model = md2_readModel(filename);
|
||||||
|
|
||||||
if (md2->model)
|
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;
|
frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->meshes[0].numFrames;
|
||||||
|
|
||||||
#ifdef USE_MODEL_NEXTFRAME
|
#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
|
// frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation
|
||||||
if (spr->mobj->frame & FF_ANIMATE)
|
if (spr->mobj->frame & FF_ANIMATE)
|
||||||
|
|
|
@ -1405,7 +1405,7 @@ void R_RegisterEngineStuff(void)
|
||||||
CV_RegisterVar(&cv_grcoronas);
|
CV_RegisterVar(&cv_grcoronas);
|
||||||
CV_RegisterVar(&cv_grcoronasize);
|
CV_RegisterVar(&cv_grcoronasize);
|
||||||
#endif
|
#endif
|
||||||
CV_RegisterVar(&cv_grmd2);
|
CV_RegisterVar(&cv_grmdls);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#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}};
|
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", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grmdls = {"gr_mdls", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const UINT8 gammatable[5][256] =
|
const UINT8 gammatable[5][256] =
|
||||||
|
|
Loading…
Reference in a new issue