mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Fix loading maps in Mapster32, introduced in r3911.
Also, get rid of the strange filename[len]=255 hack in loadboard() and make its file name arg const char* at last. git-svn-id: https://svn.eduke32.com/eduke32@3913 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
6a33c2eec1
commit
dea960d350
3 changed files with 6 additions and 10 deletions
|
@ -997,7 +997,7 @@ int32_t preinitengine(void); // a partial setup of the engine used for launch
|
||||||
int32_t initengine(void);
|
int32_t initengine(void);
|
||||||
void uninitengine(void);
|
void uninitengine(void);
|
||||||
void initspritelists(void);
|
void initspritelists(void);
|
||||||
int32_t loadboard(char *filename, char flags, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum);
|
int32_t loadboard(const char *filename, char flags, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum);
|
||||||
int32_t loadmaphack(const char *filename);
|
int32_t loadmaphack(const char *filename);
|
||||||
void delete_maphack_lights();
|
void delete_maphack_lights();
|
||||||
#ifdef HAVE_CLIPSHAPE_FEATURE
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
|
@ -1325,7 +1325,7 @@ int32_t loaddefinitionsfile(const char *fn);
|
||||||
|
|
||||||
// if loadboard() fails with -2 return, try loadoldboard(). if it fails with
|
// if loadboard() fails with -2 return, try loadoldboard(). if it fails with
|
||||||
// -2, board is dodgy
|
// -2, board is dodgy
|
||||||
int32_t loadoldboard(char *filename, char fromwhere, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum);
|
int32_t loadoldboard(const char *filename, char fromwhere, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum);
|
||||||
|
|
||||||
|
|
||||||
// Hash functions
|
// Hash functions
|
||||||
|
|
|
@ -8087,9 +8087,9 @@ int32_t LoadBoard(const char *filename, uint32_t flags)
|
||||||
editorzrange[1] = INT32_MAX;
|
editorzrange[1] = INT32_MAX;
|
||||||
|
|
||||||
ExtPreLoadMap();
|
ExtPreLoadMap();
|
||||||
i = loadboard(boardfilename, (flags&4)|loadingflags, &pos, &ang, &cursectnum);
|
i = loadboard(filename, (flags&4)|loadingflags, &pos, &ang, &cursectnum);
|
||||||
if (i == -2)
|
if (i == -2)
|
||||||
i = loadoldboard(boardfilename,loadingflags, &pos, &ang, &cursectnum);
|
i = loadoldboard(filename,loadingflags, &pos, &ang, &cursectnum);
|
||||||
|
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9870,7 +9870,7 @@ LUNATIC_CB int32_t (*loadboard_maptext)(int32_t fil, vec3_t *dapos, int16_t *daa
|
||||||
// -2: invalid version
|
// -2: invalid version
|
||||||
// -3: invalid number of sectors, walls or sprites
|
// -3: invalid number of sectors, walls or sprites
|
||||||
// <= -4: map-text error
|
// <= -4: map-text error
|
||||||
int32_t loadboard(char *filename, char flags, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum)
|
int32_t loadboard(const char *filename, char flags, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum)
|
||||||
{
|
{
|
||||||
int32_t fil, i;
|
int32_t fil, i;
|
||||||
int16_t numsprites;
|
int16_t numsprites;
|
||||||
|
@ -9878,8 +9878,6 @@ int32_t loadboard(char *filename, char flags, vec3_t *dapos, int16_t *daang, int
|
||||||
|
|
||||||
flags &= 3;
|
flags &= 3;
|
||||||
|
|
||||||
i = Bstrlen(filename)-1;
|
|
||||||
if (filename[i] == 255) { filename[i] = 0; flags = 1; } // JBF 20040119: "compatibility"
|
|
||||||
if ((fil = kopen4load(filename,flags)) == -1)
|
if ((fil = kopen4load(filename,flags)) == -1)
|
||||||
{ mapversion = 7; return -1; }
|
{ mapversion = 7; return -1; }
|
||||||
|
|
||||||
|
@ -10066,7 +10064,7 @@ skip_reading_mapbin:
|
||||||
|
|
||||||
// Powerslave uses v6
|
// Powerslave uses v6
|
||||||
// Witchaven 1 and TekWar and LameDuke use v5
|
// Witchaven 1 and TekWar and LameDuke use v5
|
||||||
int32_t loadoldboard(char *filename, char fromwhere, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum)
|
int32_t loadoldboard(const char *filename, char fromwhere, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum)
|
||||||
{
|
{
|
||||||
int32_t fil, i;
|
int32_t fil, i;
|
||||||
int16_t numsprites;
|
int16_t numsprites;
|
||||||
|
@ -10078,8 +10076,6 @@ int32_t loadoldboard(char *filename, char fromwhere, vec3_t *dapos, int16_t *daa
|
||||||
struct walltypev6 v6wall;
|
struct walltypev6 v6wall;
|
||||||
struct spritetypev6 v6spr;
|
struct spritetypev6 v6spr;
|
||||||
|
|
||||||
i = Bstrlen(filename)-1;
|
|
||||||
if (filename[i] == 255) { filename[i] = 0; fromwhere = 1; } // JBF 20040119: "compatibility"
|
|
||||||
if ((fil = kopen4load(filename,fromwhere)) == -1)
|
if ((fil = kopen4load(filename,fromwhere)) == -1)
|
||||||
{ mapversion = 5L; return(-1); }
|
{ mapversion = 5L; return(-1); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue