Merge branch 'next' into music-credits
This commit is contained in:
commit
5b05eff41f
|
@ -300,8 +300,12 @@ static md2_model_t *md2_readModel(const char *filename)
|
||||||
file = fopen(va("%s"PATHSEP"%s", srb2home, filename), "rb");
|
file = fopen(va("%s"PATHSEP"%s", srb2home, filename), "rb");
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
free(model);
|
file = fopen(va("%s"PATHSEP"%s", srb2path, filename), "rb");
|
||||||
return 0;
|
if (!file)
|
||||||
|
{
|
||||||
|
free(model);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize model and read header
|
// initialize model and read header
|
||||||
|
@ -500,8 +504,12 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||||
png_FILE = fopen(pngfilename, "rb");
|
png_FILE = fopen(pngfilename, "rb");
|
||||||
if (!png_FILE)
|
if (!png_FILE)
|
||||||
{
|
{
|
||||||
|
pngfilename = va("%s"PATHSEP"md2"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);
|
//CONS_Debug(DBG_RENDER, "M_SavePNG: Error on opening %s for loading\n", filename);
|
||||||
return 0;
|
if (!png_FILE)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,
|
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,
|
||||||
|
@ -628,7 +636,13 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||||
FIL_ForceExtension(pcxfilename, ".pcx");
|
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||||
file = fopen(pcxfilename, "rb");
|
file = fopen(pcxfilename, "rb");
|
||||||
if (!file)
|
if (!file)
|
||||||
return 0;
|
{
|
||||||
|
pcxfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2path, filename);
|
||||||
|
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||||
|
file = fopen(pcxfilename, "rb");
|
||||||
|
if (!file)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (fread(&header, sizeof (PcxHeader), 1, file) != 1)
|
if (fread(&header, sizeof (PcxHeader), 1, file) != 1)
|
||||||
{
|
{
|
||||||
|
@ -818,9 +832,13 @@ void HWR_InitMD2(void)
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
f = fopen(va("%s"PATHSEP"%s", srb2path, "kmd2.dat"), "rt");
|
||||||
nomd2s = true;
|
if (!f)
|
||||||
return;
|
{
|
||||||
|
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
||||||
|
nomd2s = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||||
{
|
{
|
||||||
|
@ -885,9 +903,13 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
CONS_Printf("Error while loading kmd2.dat\n");
|
f = fopen(va("%s"PATHSEP"%s", srb2path, "kmd2.dat"), "rt");
|
||||||
nomd2s = true;
|
if (!f)
|
||||||
return;
|
{
|
||||||
|
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
||||||
|
nomd2s = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for any MD2s that match the names of player skins!
|
// Check for any MD2s that match the names of player skins!
|
||||||
|
@ -931,9 +953,13 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
CONS_Printf("Error while loading kmd2.dat\n");
|
f = fopen(va("%s"PATHSEP"%s", srb2path, "kmd2.dat"), "rt");
|
||||||
nomd2s = true;
|
if (!f)
|
||||||
return;
|
{
|
||||||
|
CONS_Printf("%s %s\n", M_GetText("Error while loading kmd2.dat:"), strerror(errno));
|
||||||
|
nomd2s = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for any MD2s that match the names of player skins!
|
// Check for any MD2s that match the names of player skins!
|
||||||
|
|
Loading…
Reference in a new issue