Merge pull request #252 from GoldenTails/patch-1
Fixed MD2 models not loading correctly on Linux
This commit is contained in:
commit
3e9103bec2
|
@ -33,6 +33,7 @@
|
||||||
#include "hw_drv.h"
|
#include "hw_drv.h"
|
||||||
#include "hw_light.h"
|
#include "hw_light.h"
|
||||||
#include "hw_md2.h"
|
#include "hw_md2.h"
|
||||||
|
#include "../d_main.h"
|
||||||
#include "../r_bsp.h"
|
#include "../r_bsp.h"
|
||||||
#include "../r_main.h"
|
#include "../r_main.h"
|
||||||
#include "../m_misc.h"
|
#include "../m_misc.h"
|
||||||
|
@ -288,7 +289,8 @@ static md2_model_t *md2_readModel(const char *filename)
|
||||||
if (model == NULL)
|
if (model == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
file = fopen(filename, "rb");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
file = fopen(va("%s"PATHSEP"%s", srb2home, filename), "rb");
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
free(model);
|
free(model);
|
||||||
|
@ -477,7 +479,8 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
png_FILE_p png_FILE;
|
png_FILE_p png_FILE;
|
||||||
char *pngfilename = va("md2/%s", filename);
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
char *pngfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
|
||||||
|
|
||||||
FIL_ForceExtension(pngfilename, ".png");
|
FIL_ForceExtension(pngfilename, ".png");
|
||||||
png_FILE = fopen(pngfilename, "rb");
|
png_FILE = fopen(pngfilename, "rb");
|
||||||
|
@ -605,7 +608,8 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
|
||||||
size_t pw, ph, size, ptr = 0;
|
size_t pw, ph, size, ptr = 0;
|
||||||
INT32 ch, rep;
|
INT32 ch, rep;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
char *pcxfilename = va("md2/%s", filename);
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
char *pcxfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename);
|
||||||
|
|
||||||
FIL_ForceExtension(pcxfilename, ".pcx");
|
FIL_ForceExtension(pcxfilename, ".pcx");
|
||||||
file = fopen(pcxfilename, "rb");
|
file = fopen(pcxfilename, "rb");
|
||||||
|
@ -795,7 +799,8 @@ void HWR_InitMD2(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the md2.dat file
|
// read the md2.dat file
|
||||||
f = fopen("md2.dat", "rt");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
@ -861,7 +866,8 @@ 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 md2.dat file
|
||||||
f = fopen("md2.dat", "rt");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
@ -906,7 +912,8 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Read the md2.dat file
|
// Read the md2.dat file
|
||||||
f = fopen("md2.dat", "rt");
|
//Filename checking fixed ~Monster Iestyn and Golden
|
||||||
|
f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt");
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue