mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'mapload-refactor' into 'next'
Refactor map loading functions See merge request STJr/SRB2!594
This commit is contained in:
commit
6b53b883c5
6 changed files with 710 additions and 759 deletions
|
|
@ -2965,7 +2965,7 @@ void G_DoReborn(INT32 playernum)
|
||||||
}
|
}
|
||||||
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD))
|
||||||
{
|
{
|
||||||
P_LoadThingsOnly();
|
P_RespawnThings();
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ enum side_e {
|
||||||
side_toptexture,
|
side_toptexture,
|
||||||
side_bottomtexture,
|
side_bottomtexture,
|
||||||
side_midtexture,
|
side_midtexture,
|
||||||
|
side_line,
|
||||||
side_sector,
|
side_sector,
|
||||||
side_special,
|
side_special,
|
||||||
side_repeatcnt,
|
side_repeatcnt,
|
||||||
|
|
@ -869,6 +870,9 @@ static int side_get(lua_State *L)
|
||||||
case side_midtexture:
|
case side_midtexture:
|
||||||
lua_pushinteger(L, side->midtexture);
|
lua_pushinteger(L, side->midtexture);
|
||||||
return 1;
|
return 1;
|
||||||
|
case side_line:
|
||||||
|
LUA_PushUserdata(L, side->line, META_LINE);
|
||||||
|
return 1;
|
||||||
case side_sector:
|
case side_sector:
|
||||||
LUA_PushUserdata(L, side->sector, META_SECTOR);
|
LUA_PushUserdata(L, side->sector, META_SECTOR);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -902,6 +906,7 @@ static int side_set(lua_State *L)
|
||||||
switch(field)
|
switch(field)
|
||||||
{
|
{
|
||||||
case side_valid: // valid
|
case side_valid: // valid
|
||||||
|
case side_line:
|
||||||
case side_sector:
|
case side_sector:
|
||||||
case side_special:
|
case side_special:
|
||||||
case side_text:
|
case side_text:
|
||||||
|
|
|
||||||
1405
src/p_setup.c
1405
src/p_setup.c
File diff suppressed because it is too large
Load diff
|
|
@ -96,7 +96,7 @@ void P_SetupLevelSky(INT32 skynum, boolean global);
|
||||||
#ifdef SCANTHINGS
|
#ifdef SCANTHINGS
|
||||||
void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
|
void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
|
||||||
#endif
|
#endif
|
||||||
void P_LoadThingsOnly(void);
|
void P_RespawnThings(void);
|
||||||
boolean P_LoadLevel(boolean fromnetsave);
|
boolean P_LoadLevel(boolean fromnetsave);
|
||||||
boolean P_AddWadFile(const char *wadfilename);
|
boolean P_AddWadFile(const char *wadfilename);
|
||||||
boolean P_RunSOC(const char *socfilename);
|
boolean P_RunSOC(const char *socfilename);
|
||||||
|
|
|
||||||
36
src/p_spec.c
36
src/p_spec.c
|
|
@ -6433,7 +6433,6 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
INT32 j;
|
INT32 j;
|
||||||
thinkerlist_t *secthinkers;
|
thinkerlist_t *secthinkers;
|
||||||
thinker_t *th;
|
thinker_t *th;
|
||||||
virtres_t* virt = NULL;
|
|
||||||
// This used to be used, and *should* be used in the future,
|
// This used to be used, and *should* be used in the future,
|
||||||
// but currently isn't.
|
// but currently isn't.
|
||||||
(void)fromnetsave;
|
(void)fromnetsave;
|
||||||
|
|
@ -7179,38 +7178,14 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
EV_AddLaserThinker(§ors[s], §ors[sec], lines + i, secthinkers);
|
EV_AddLaserThinker(§ors[s], §ors[sec], lines + i, secthinkers);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 259: // Make-Your-Own FOF!
|
case 259: // Custom FOF
|
||||||
if (lines[i].sidenum[1] != 0xffff)
|
if (lines[i].sidenum[1] != 0xffff)
|
||||||
{
|
{
|
||||||
UINT8 *data;
|
ffloortype_e fofflags = sides[lines[i].sidenum[1]].toptexture;
|
||||||
UINT16 b;
|
P_AddFakeFloorsByLine(i, fofflags, secthinkers);
|
||||||
|
|
||||||
if (!virt)
|
|
||||||
virt = vres_GetMap(lastloadedmaplumpnum);
|
|
||||||
|
|
||||||
data = (UINT8*) vres_Find(virt, "SIDEDEFS")->data;
|
|
||||||
|
|
||||||
for (b = 0; b < (INT16)numsides; b++)
|
|
||||||
{
|
|
||||||
register mapsidedef_t *msd = (mapsidedef_t *)data + b;
|
|
||||||
|
|
||||||
if (b == lines[i].sidenum[1])
|
|
||||||
{
|
|
||||||
if ((msd->toptexture[0] >= '0' && msd->toptexture[0] <= '9')
|
|
||||||
|| (msd->toptexture[0] >= 'A' && msd->toptexture[0] <= 'F'))
|
|
||||||
{
|
|
||||||
ffloortype_e FOF_Flags = axtoi(msd->toptexture);
|
|
||||||
|
|
||||||
P_AddFakeFloorsByLine(i, FOF_Flags, secthinkers);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
I_Error("Make-Your-Own-FOF (tag %d) needs a value in the linedef's second side upper texture field.", lines[i].tag);
|
I_Error("Custom FOF (tag %d) found without a linedef back side!", lines[i].tag);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
I_Error("Make-Your-Own FOF (tag %d) found without a 2nd linedef side!", lines[i].tag);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 300: // Linedef executor (combines with sector special 974/975) and commands
|
case 300: // Linedef executor (combines with sector special 974/975) and commands
|
||||||
|
|
@ -7433,9 +7408,6 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virt)
|
|
||||||
vres_Free(virt);
|
|
||||||
|
|
||||||
// Allocate each list
|
// Allocate each list
|
||||||
for (i = 0; i < numsectors; i++)
|
for (i = 0; i < numsectors; i++)
|
||||||
if(secthinkers[i].thinkers)
|
if(secthinkers[i].thinkers)
|
||||||
|
|
|
||||||
13
src/r_defs.h
13
src/r_defs.h
|
|
@ -436,14 +436,10 @@ typedef struct line_s
|
||||||
polyobj_t *polyobj; // Belongs to a polyobject?
|
polyobj_t *polyobj; // Belongs to a polyobject?
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *text; // a concatination of all front and back texture names, for linedef specials that require a string.
|
char *text; // a concatenation of all front and back texture names, for linedef specials that require a string.
|
||||||
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
|
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
|
||||||
} line_t;
|
} line_t;
|
||||||
|
|
||||||
//
|
|
||||||
// The SideDef.
|
|
||||||
//
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
// add this to the calculated texture column
|
// add this to the calculated texture column
|
||||||
|
|
@ -456,13 +452,16 @@ typedef struct
|
||||||
// We do not maintain names here.
|
// We do not maintain names here.
|
||||||
INT32 toptexture, bottomtexture, midtexture;
|
INT32 toptexture, bottomtexture, midtexture;
|
||||||
|
|
||||||
// Sector the SideDef is facing.
|
// Linedef the sidedef belongs to
|
||||||
|
line_t *line;
|
||||||
|
|
||||||
|
// Sector the sidedef is facing.
|
||||||
sector_t *sector;
|
sector_t *sector;
|
||||||
|
|
||||||
INT16 special; // the special of the linedef this side belongs to
|
INT16 special; // the special of the linedef this side belongs to
|
||||||
INT16 repeatcnt; // # of times to repeat midtexture
|
INT16 repeatcnt; // # of times to repeat midtexture
|
||||||
|
|
||||||
char *text; // a concatination of all top, bottom, and mid texture names, for linedef specials that require a string.
|
char *text; // a concatenation of all top, bottom, and mid texture names, for linedef specials that require a string.
|
||||||
|
|
||||||
extracolormap_t *colormap_data; // storage for colormaps; not applied to sectors.
|
extracolormap_t *colormap_data; // storage for colormaps; not applied to sectors.
|
||||||
} side_t;
|
} side_t;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue