Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72288e2bae | ||
|
|
0e7460009e | ||
|
|
521544f6ba | ||
|
|
efc0681e01 | ||
|
|
4c3fa7d826 | ||
|
|
ac87678708 | ||
|
|
a6e5edabd2 | ||
|
|
24e5b1d84b | ||
|
|
ade7db9004 | ||
|
|
819b171d90 | ||
|
|
882716e911 | ||
|
|
5644036d25 | ||
|
|
de74c9251f |
No files matched your search
@@ -257,6 +257,9 @@ set(SRB2_CONFIG_SATURNJOIN ON CACHE BOOL
|
||||
set(SRB2_CONFIG_SCREENFBO ON CACHE BOOL
|
||||
"Enable hardware renderer (OpenGL) FBO downsampling support")
|
||||
|
||||
set(SRB2_CONFIG_PHOBOS ON CACHE BOOL
|
||||
" Compile the Phobos client. Which contains things not compatible with vanilla, such as raised skinlimits, 32 player support, bugfixes, etc.")
|
||||
|
||||
if(${SRB2_CONFIG_DEDICATED})
|
||||
set(SRB2_CONFIG_HAVE_GME NO)
|
||||
set(SRB2_CONFIG_HAVE_OPENMPT NO)
|
||||
@@ -583,6 +586,10 @@ if(${SRB2_CONFIG_SATURNJOIN})
|
||||
add_definitions(-DDOSATURNJOIN)
|
||||
endif()
|
||||
|
||||
if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_SCREENFBO})
|
||||
add_definitions(-DPHOBOS_BUILD)
|
||||
endif()
|
||||
|
||||
# Targets
|
||||
|
||||
# Compatibility flag with later versions of GCC
|
||||
|
||||
@@ -65,6 +65,10 @@
|
||||
# DEBUGMODE=1 - Enable various debugging capabilities.
|
||||
# Also disables optimizations.
|
||||
#
|
||||
# PHOBOS_BUILD=1 - Compile the Phobos client.
|
||||
# Contains things not compatible with vanilla.
|
||||
# such as raised skinlimits, 32 player support, bugfixes, etc.
|
||||
#
|
||||
# Development flags:
|
||||
#
|
||||
# VALGRIND=1 - Enable Valgrind memory debugging support.
|
||||
|
||||
@@ -9,6 +9,7 @@ passthru_opts+=\
|
||||
HAVE_DISCORDRPC DEVELOP\
|
||||
NOHOLEPUNCH\
|
||||
HAVE_IPV6\
|
||||
PHOBOS_BUILD\
|
||||
|
||||
# build with debugging information
|
||||
ifdef DEBUGMODE
|
||||
|
||||
@@ -206,6 +206,15 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
|
||||
p += n; \
|
||||
} while (0)
|
||||
|
||||
|
||||
#ifdef PHOBOS_BUILD
|
||||
#define WRITESKIN(p,b) WRITEUINT16(p,b)
|
||||
#define READSKIN(p) READUINT16(p)
|
||||
#else
|
||||
#define WRITESKIN(p,b) WRITEUINT8(p,b)
|
||||
#define READSKIN(p) READUINT8(p)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
+18
-3
@@ -1125,7 +1125,7 @@ static cl_mode_t cl_mode = CL_SEARCHING;
|
||||
static UINT16 cl_lastcheckedfilecount = 0; // used for full file list
|
||||
|
||||
// Player name send/load
|
||||
|
||||
#ifndef PHOBOS_BUILD
|
||||
static void CV_SavePlayerNames(UINT8 **p)
|
||||
{
|
||||
INT32 i = 0;
|
||||
@@ -1161,6 +1161,7 @@ static void CV_LoadPlayerNames(UINT8 **p)
|
||||
memcpy(player_names[i], tmp_name, MAXPLAYERNAME+1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void CL_DrawAddonTypes(void)
|
||||
{
|
||||
@@ -1772,7 +1773,7 @@ static void SV_SendPlayerInfo(INT32 node)
|
||||
// doesent really matter what we put here lel
|
||||
netbuffer->u.playerinfo[0].score = LONG(42069);
|
||||
netbuffer->u.playerinfo[0].timeinserver = SHORT(42069);
|
||||
netbuffer->u.playerinfo[0].skin = (UINT8)1; // no clue wtf skin 1 is, tails maybe?
|
||||
netbuffer->u.playerinfo[0].skin = (skinnum_t)1; // no clue wtf skin 1 is, tails maybe?
|
||||
|
||||
netbuffer->u.playerinfo[0].data = 0;
|
||||
|
||||
@@ -1817,7 +1818,7 @@ static void SV_SendPlayerInfo(INT32 node)
|
||||
|
||||
netbuffer->u.playerinfo[i].score = LONG(players[i].score);
|
||||
netbuffer->u.playerinfo[i].timeinserver = SHORT((UINT16)(players[i].jointime / TICRATE));
|
||||
netbuffer->u.playerinfo[i].skin = (UINT8)players[i].skin;
|
||||
netbuffer->u.playerinfo[i].skin = (skinnum_t)players[i].skin;
|
||||
|
||||
// Extra data
|
||||
// Kart has extra skincolors, so we can't use this
|
||||
@@ -1927,8 +1928,10 @@ static void SV_SendMapIcon(INT32 node)
|
||||
*/
|
||||
static boolean SV_SendServerConfig(INT32 node)
|
||||
{
|
||||
#ifndef PHOBOS_BUILD
|
||||
INT32 i;
|
||||
UINT8 *p, *op;
|
||||
#endif
|
||||
boolean waspacketsent;
|
||||
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
@@ -1946,6 +1949,7 @@ static boolean SV_SendServerConfig(INT32 node)
|
||||
netbuffer->u.servercfg.gametype = (UINT8)gametype;
|
||||
netbuffer->u.servercfg.modifiedgame = (UINT8)modifiedgame;
|
||||
|
||||
#ifndef PHOBOS_BUILD
|
||||
// we fill these structs with FFs so that any players not in game get sent as 0xFFFF
|
||||
// which is nice and easy for us to detect
|
||||
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
||||
@@ -1961,6 +1965,7 @@ static boolean SV_SendServerConfig(INT32 node)
|
||||
netbuffer->u.servercfg.playerskins[i] = (UINT8)players[i].skin;
|
||||
netbuffer->u.servercfg.playercolor[i] = (UINT8)players[i].skincolor;
|
||||
}
|
||||
#endif
|
||||
|
||||
netbuffer->u.servercfg.maxplayer = (UINT8)(min((dedicated ? MAXPLAYERS-1 : MAXPLAYERS), cv_maxplayers.value));
|
||||
netbuffer->u.servercfg.allownewplayer = cv_allownewplayer.value;
|
||||
@@ -1968,12 +1973,16 @@ static boolean SV_SendServerConfig(INT32 node)
|
||||
|
||||
memcpy(netbuffer->u.servercfg.server_context, server_context, 8);
|
||||
|
||||
#ifdef PHOBOS_BUILD
|
||||
const size_t len = sizeof(serverconfig_pak);
|
||||
#else
|
||||
op = p = netbuffer->u.servercfg.varlengthinputs;
|
||||
|
||||
CV_SavePlayerNames(&p);
|
||||
CV_SaveNetVars(&p, false);
|
||||
|
||||
const size_t len = sizeof (serverconfig_pak) + (size_t)(p - op);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
if (debugfile)
|
||||
@@ -5414,8 +5423,10 @@ static void PT_ServerRefuse(SINT8 node)
|
||||
// Positive response of client join request
|
||||
static void PT_ServerCFG(SINT8 node)
|
||||
{
|
||||
#ifndef PHOBOS_BUILD
|
||||
INT32 j;
|
||||
UINT8 *scp;
|
||||
#endif
|
||||
|
||||
if (server && serverrunning && node != servernode)
|
||||
{ // but wait I thought I'm the server?
|
||||
@@ -5438,8 +5449,10 @@ static void PT_ServerCFG(SINT8 node)
|
||||
if ((gametype = netbuffer->u.servercfg.gametype) >= NUMGAMETYPES)
|
||||
I_Error("Bad gametype %d in cliserv!", gametype);
|
||||
modifiedgame = netbuffer->u.servercfg.modifiedgame;
|
||||
#ifndef PHOBOS_BUILD
|
||||
for (j = 0; j < MAXPLAYERS; j++)
|
||||
adminplayers[j] = netbuffer->u.servercfg.adminplayers[j];
|
||||
#endif
|
||||
memcpy(server_context, netbuffer->u.servercfg.server_context, 8);
|
||||
}
|
||||
|
||||
@@ -5465,6 +5478,7 @@ static void PT_ServerCFG(SINT8 node)
|
||||
SendSaturnInfo(node);
|
||||
#endif
|
||||
|
||||
#ifndef PHOBOS_BUILD
|
||||
memset(playeringame, 0, sizeof(playeringame));
|
||||
|
||||
for (j = 0; j < MAXPLAYERS; j++)
|
||||
@@ -5481,6 +5495,7 @@ static void PT_ServerCFG(SINT8 node)
|
||||
scp = netbuffer->u.servercfg.varlengthinputs;
|
||||
CV_LoadPlayerNames(&scp);
|
||||
scp += CV_LoadNetVars(scp);
|
||||
#endif
|
||||
|
||||
/// \note Wait. What if a Lua script uses some global custom variables synched with the NetVars hook?
|
||||
/// Shouldn't them be downloaded even at intermission time?
|
||||
|
||||
+8
-2
@@ -339,13 +339,17 @@ typedef struct
|
||||
UINT8 clientnode;
|
||||
UINT8 gamestate;
|
||||
|
||||
#ifndef PHOBOS_BUILD
|
||||
// 0xFF == not in game; else player skin num
|
||||
UINT8 playerskins[MAXPLAYERS];
|
||||
UINT8 playercolor[MAXPLAYERS];
|
||||
#endif
|
||||
|
||||
UINT8 gametype;
|
||||
UINT8 modifiedgame;
|
||||
#ifndef PHOBOS_BUILD
|
||||
SINT8 adminplayers[MAXPLAYERS]; // Needs to be signed
|
||||
#endif
|
||||
|
||||
char server_context[8]; // Unique context id, generated at server startup.
|
||||
|
||||
@@ -354,7 +358,9 @@ typedef struct
|
||||
boolean allownewplayer;
|
||||
boolean discordinvites;
|
||||
|
||||
#ifndef PHOBOS_BUILD
|
||||
UINT8 varlengthinputs[0]; // Playernames and netvars
|
||||
#endif
|
||||
} ATTRPACK serverconfig_pak;
|
||||
|
||||
typedef struct {
|
||||
@@ -444,7 +450,7 @@ typedef struct
|
||||
char name[MAXPLAYERNAME+1];
|
||||
UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH
|
||||
UINT8 team;
|
||||
UINT8 skin;
|
||||
skinnum_t skin;
|
||||
UINT8 data; // Color is first four bits, hasflag, isit and issuper have one bit each, the last is unused.
|
||||
UINT32 score;
|
||||
UINT16 timeinserver; // In seconds.
|
||||
@@ -454,7 +460,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
char name[MAXPLAYERNAME+1];
|
||||
UINT8 skin;
|
||||
skinnum_t skin;
|
||||
UINT8 color;
|
||||
UINT32 pflags;
|
||||
UINT32 score;
|
||||
|
||||
+13
-3
@@ -435,10 +435,18 @@ consvar_t cv_pointlimit = {"pointlimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, point
|
||||
static CV_PossibleValue_t timelimit_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_timelimit = {"timelimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, timelimit_cons_t,
|
||||
TimeLimit_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#ifdef PHOBOS_BUILD
|
||||
static CV_PossibleValue_t numlaps_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
||||
#else
|
||||
static CV_PossibleValue_t numlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, NULL}};
|
||||
#endif
|
||||
consvar_t cv_numlaps = {"numlaps", "3", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_cons_t,
|
||||
NumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#ifdef PHOBOS_BUILD
|
||||
static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, "Map default"}, {0, NULL}};
|
||||
#else
|
||||
static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}};
|
||||
#endif
|
||||
consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_forceskin = {"forceskin", "Off", CV_NETVAR|CV_CALL|CV_CHEAT, Forceskin_cons_t, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -1681,7 +1689,8 @@ static void SendNameAndColor(UINT8 splitplayer)
|
||||
// Finally write out the complete packet and send it off.
|
||||
WRITESTRINGN(p, playername->zstring, MAXPLAYERNAME);
|
||||
WRITEUINT8(p, (UINT8)playercolor->value);
|
||||
WRITEUINT8(p, (UINT8)playerskin->value);
|
||||
WRITESKIN(p, (skinnum_t)playerskin->value);
|
||||
|
||||
SendNetXCmdForPlayer(splitplayer, XD_NAMEANDCOLOR, buf, p - buf);
|
||||
}
|
||||
|
||||
@@ -1689,7 +1698,8 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
{
|
||||
player_t *player;
|
||||
char name[MAXPLAYERNAME+1] = {};
|
||||
UINT8 color, skin;
|
||||
UINT8 color;
|
||||
skinnum_t skin;
|
||||
|
||||
#ifdef PARANOIA
|
||||
if (playernum < 0 || playernum > MAXPLAYERS)
|
||||
@@ -1711,7 +1721,7 @@ static void Got_NameAndColor(const UINT8 **cp, INT32 playernum)
|
||||
|
||||
READSTRINGN(*cp, name, MAXPLAYERNAME);
|
||||
color = READUINT8(*cp);
|
||||
skin = READUINT8(*cp);
|
||||
skin = READSKIN(*cp);
|
||||
|
||||
// set name
|
||||
if (player_name_changes[playernum] < MAXNAMECHANGES)
|
||||
|
||||
+24
-14
@@ -130,8 +130,17 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v10"
|
||||
#define VERSIONSTRINGW L"Saturn v10"
|
||||
|
||||
#ifdef PHOBOS_BUILD
|
||||
#define CLIENTNAME "Phobos"
|
||||
#define CLIENTNAMEW L"Phobos"
|
||||
#else
|
||||
#define CLIENTNAME "Saturn"
|
||||
#define CLIENTNAMEW L"Saturn"
|
||||
#endif
|
||||
|
||||
#define VERSIONSTRING CLIENTNAME " v10"
|
||||
#define VERSIONSTRINGW CLIENTNAMEW L" v10"
|
||||
|
||||
#define SATURN_TESTING // comment out for saturn release builds!
|
||||
|
||||
@@ -602,11 +611,19 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
||||
// Compile them at your own risk!
|
||||
|
||||
// undefine to enable fixes and features that are not vanilla compatible
|
||||
#define COMPAT_VANILLA
|
||||
// if we build with 32 player (or more or less!) support we dont need to care about vanilla compat
|
||||
#if MAXPLAYERS != 16
|
||||
#undef COMPAT_VANILLA
|
||||
#ifdef PHOBOS_BUILD
|
||||
// we want 32 players yesss
|
||||
#undef MAXPLAYERS
|
||||
#define MAXPLAYERS 32
|
||||
|
||||
// raise skinlimit to 1024
|
||||
#undef MAXSKINS
|
||||
#define MAXSKINS 1024
|
||||
|
||||
// overwrite some of those
|
||||
// when not compiling in vanilla compat mode
|
||||
#define SATURNJOIN
|
||||
#define SATURNPAK
|
||||
#endif
|
||||
|
||||
//-- SATURN __
|
||||
@@ -673,13 +690,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||
#undef UPDATE_ALERT
|
||||
#endif
|
||||
|
||||
// overwrite some of those
|
||||
// when not compiling in vanilla compat mode
|
||||
#ifndef COMPAT_VANILLA
|
||||
#define SATURNJOIN
|
||||
#define SATURNPAK
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -42,6 +42,12 @@ extern "C" {
|
||||
#define INT64 int64_t
|
||||
#define UINT64 uint64_t
|
||||
|
||||
#ifdef PHOBOS_BUILD
|
||||
typedef uint16_t skinnum_t;
|
||||
#else
|
||||
typedef uint8_t skinnum_t;
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE_CC__
|
||||
#define DEBUG_LOG
|
||||
#define NOIPX
|
||||
|
||||
+3
-1
@@ -2335,7 +2335,7 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
|
||||
while (READUINT8(extrainfo_p) == DW_STANDING) // Assume standings are always first in the extrainfo
|
||||
{
|
||||
INT32 i;
|
||||
char temp[16];
|
||||
char temp[17];
|
||||
|
||||
pdemo->standings[count].ranking = READUINT8(extrainfo_p);
|
||||
|
||||
@@ -2345,6 +2345,7 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
|
||||
|
||||
// Skin
|
||||
memcpy(temp, extrainfo_p, 16);
|
||||
temp[16] = '\0';
|
||||
extrainfo_p += 16;
|
||||
pdemo->standings[count].skin = UINT8_MAX;
|
||||
|
||||
@@ -2359,6 +2360,7 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
|
||||
|
||||
// Color
|
||||
memcpy(temp, extrainfo_p, 16);
|
||||
temp[16] = '\0';
|
||||
extrainfo_p += 16;
|
||||
|
||||
for (i = 0; i < MAXSKINCOLORS; i++)
|
||||
|
||||
+2
-1
@@ -82,7 +82,8 @@ typedef struct menudemo_s {
|
||||
struct {
|
||||
UINT8 ranking;
|
||||
char name[17];
|
||||
UINT8 skin, color;
|
||||
skinnum_t skin;
|
||||
UINT8 color;
|
||||
UINT32 timeorscore;
|
||||
} standings[MAXPLAYERS];
|
||||
} menudemo_t;
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ gameaction_t gameaction = 0;
|
||||
gamestate_t gamestate = GS_NULL;
|
||||
|
||||
boolean botingame = false;
|
||||
UINT8 botskin = 0;
|
||||
skinnum_t botskin = 0;
|
||||
UINT8 botcolor = 0;
|
||||
|
||||
// SRB2kart
|
||||
|
||||
+2
-1
@@ -55,6 +55,7 @@ extern gamestate_t gamestate;
|
||||
extern gameaction_t gameaction;
|
||||
|
||||
extern boolean botingame;
|
||||
extern UINT8 botskin, botcolor;
|
||||
extern skinnum_t botskin;
|
||||
extern UINT8 botcolor;
|
||||
|
||||
#endif //__G_STATE__
|
||||
+18
-14
@@ -2662,11 +2662,13 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||
|
||||
polyobjsector = po_ptrs[i]->lines[0]->backsector; // the in-level polyobject sector
|
||||
|
||||
if (polyobjsector->floorheight <= gl_frontsector->ceilingheight
|
||||
&& polyobjsector->floorheight >= gl_frontsector->floorheight
|
||||
&& (viewz < polyobjsector->floorheight))
|
||||
if (polyobjsector->floorheight <= gl_frontsector->ceilingheight &&
|
||||
polyobjsector->floorheight >= gl_frontsector->floorheight &&
|
||||
(viewz < polyobjsector->floorheight))
|
||||
{
|
||||
light = R_GetPlaneLight(gl_frontsector, polyobjsector->floorheight, true);
|
||||
const INT16 llevel = (light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel);
|
||||
extracolormap_t *colmap = (light == -1 ? gl_frontsector->extra_colormap : gl_frontsector->lightlist[light].extra_colormap);
|
||||
|
||||
if (po_ptrs[i]->translucency > 0)
|
||||
{
|
||||
@@ -2674,22 +2676,24 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||
FBITFIELD blendmode;
|
||||
blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
||||
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->floorpic].lumpnum, po_ptrs[i], false, polyobjsector->floorheight,
|
||||
(light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel), Surf.PolyColor.s.alpha, polyobjsector, blendmode, (light == -1 ? gl_frontsector->extra_colormap : gl_frontsector->lightlist[light].extra_colormap));
|
||||
llevel, Surf.PolyColor.s.alpha, polyobjsector, blendmode, colmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
HWR_GetFlat(levelflats[polyobjsector->floorpic].lumpnum, R_NoEncore(polyobjsector, false));
|
||||
HWR_RenderPolyObjectPlane(po_ptrs[i], false, polyobjsector->floorheight, PF_Occlude,
|
||||
(light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel), levelflats[polyobjsector->floorpic].lumpnum,
|
||||
polyobjsector, 255, (light == -1 ? gl_frontsector->extra_colormap : gl_frontsector->lightlist[light].extra_colormap));
|
||||
llevel, levelflats[polyobjsector->floorpic].lumpnum,
|
||||
polyobjsector, 255, colmap);
|
||||
}
|
||||
}
|
||||
|
||||
if (polyobjsector->ceilingheight >= gl_frontsector->floorheight
|
||||
&& polyobjsector->ceilingheight <= gl_frontsector->ceilingheight
|
||||
&& (viewz > polyobjsector->ceilingheight))
|
||||
if (polyobjsector->ceilingheight >= gl_frontsector->floorheight &&
|
||||
polyobjsector->ceilingheight <= gl_frontsector->ceilingheight &&
|
||||
(viewz > polyobjsector->ceilingheight))
|
||||
{
|
||||
light = R_GetPlaneLight(gl_frontsector, polyobjsector->ceilingheight, true);
|
||||
const INT16 llevel = (light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel);
|
||||
extracolormap_t *colmap = (light == -1 ? gl_frontsector->extra_colormap : gl_frontsector->lightlist[light].extra_colormap);
|
||||
|
||||
if (po_ptrs[i]->translucency > 0)
|
||||
{
|
||||
@@ -2697,14 +2701,14 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||
FBITFIELD blendmode;
|
||||
blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
||||
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->ceilingpic].lumpnum, po_ptrs[i], true, polyobjsector->ceilingheight,
|
||||
(light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel), Surf.PolyColor.s.alpha, polyobjsector, blendmode, (light == -1 ? gl_frontsector->extra_colormap : gl_frontsector->lightlist[light].extra_colormap));
|
||||
llevel, Surf.PolyColor.s.alpha, polyobjsector, blendmode, colmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
HWR_GetFlat(levelflats[polyobjsector->ceilingpic].lumpnum, R_NoEncore(polyobjsector, true));
|
||||
HWR_RenderPolyObjectPlane(po_ptrs[i], true, polyobjsector->ceilingheight, PF_Occlude,
|
||||
(light == -1 ? gl_frontsector->lightlevel : *gl_frontsector->lightlist[light].lightlevel), levelflats[polyobjsector->ceilingpic].lumpnum,
|
||||
polyobjsector, 255, (light == -1 ? gl_frontsector->extra_colormap : gl_frontsector->lightlist[light].extra_colormap));
|
||||
llevel, levelflats[polyobjsector->ceilingpic].lumpnum,
|
||||
polyobjsector, 255, colmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3717,7 +3721,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
|
||||
Surf.PolyColor.s.alpha = alpha;
|
||||
|
||||
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false); // sprite shader
|
||||
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false);
|
||||
|
||||
top = bot;
|
||||
endtop = endbot;
|
||||
@@ -3744,7 +3748,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
|
||||
Surf.PolyColor.s.alpha = alpha;
|
||||
|
||||
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false); // sprite shader
|
||||
HWR_ProcessPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, shader, false);
|
||||
}
|
||||
|
||||
// -----------------+
|
||||
|
||||
+3
-3
@@ -452,10 +452,10 @@ void A_SpawnFreshCopy(void *actor);
|
||||
extern boolean actionsoverridden[NUMACTIONS];
|
||||
|
||||
// ratio of states to sprites to mobj types is roughly 6 : 1 : 1
|
||||
#ifdef COMPAT_VANILLA
|
||||
#define NUMMOBJFREESLOTS 1024
|
||||
#else
|
||||
#ifdef PHOBOS_BUILD
|
||||
#define NUMMOBJFREESLOTS 4096 // should be sufficient
|
||||
#else
|
||||
#define NUMMOBJFREESLOTS 1024
|
||||
#endif
|
||||
#define NUMSPRITEFREESLOTS NUMMOBJFREESLOTS
|
||||
#define NUMSTATEFREESLOTS (NUMMOBJFREESLOTS*8)
|
||||
|
||||
+19
-10
@@ -62,14 +62,6 @@ static lua_CFunction liblist[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
// Lua asks for memory using this.
|
||||
static void *LUA_Alloc(void *ud, void *ptr, size_t osize, size_t nsize)
|
||||
{
|
||||
(void)ud;
|
||||
(void)osize;
|
||||
return Z_Realloc(ptr, nsize, PU_LUA, NULL);
|
||||
}
|
||||
|
||||
// Panic function Lua calls when there's an unprotected error.
|
||||
// This function cannot return. Lua would kill the application anyway if it did.
|
||||
FUNCNORETURN static int LUA_Panic(lua_State *L)
|
||||
@@ -197,7 +189,7 @@ void LUA_ClearState(void)
|
||||
CONS_Printf(M_GetText("Pardon me while I initialize the Lua scripting interface...\n"));
|
||||
|
||||
// allocate state
|
||||
L = lua_newstate(LUA_Alloc, NULL);
|
||||
L = luaL_newstate();
|
||||
lua_atpanic(L, LUA_Panic);
|
||||
|
||||
// open base libraries
|
||||
@@ -373,7 +365,7 @@ void LUA_DumpFile(const char *filename)
|
||||
|
||||
static void createMathLibState(void)
|
||||
{
|
||||
mL = lua_newstate(LUA_Alloc, NULL);
|
||||
mL = luaL_newstate();
|
||||
lua_atpanic(mL, LUA_Panic);
|
||||
|
||||
// open only enum lib
|
||||
@@ -623,6 +615,10 @@ void LUA_InvalidateLevel(void)
|
||||
LUA_InvalidateUserdata(&slope->o);
|
||||
LUA_InvalidateUserdata(&slope->d);
|
||||
}
|
||||
|
||||
// We invalidated a lot of userdata objects, a lot of them probably ended up unreachable so they can be
|
||||
// GC'd right away
|
||||
lua_gc(gL, LUA_GCCOLLECT, 0);
|
||||
}
|
||||
|
||||
void LUA_InvalidateMapthings(void)
|
||||
@@ -1461,3 +1457,16 @@ int Lua_CreateFieldTable(lua_State *L, const char *const lst[])
|
||||
|
||||
return luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
}
|
||||
|
||||
size_t LUA_MemoryUsage(void)
|
||||
{
|
||||
size_t usage = 0;
|
||||
|
||||
if (gL)
|
||||
usage += lua_gc(gL, LUA_GCCOUNT, 0);
|
||||
|
||||
if (mL)
|
||||
usage += lua_gc(mL, LUA_GCCOUNT, 0);
|
||||
|
||||
return usage;
|
||||
}
|
||||
@@ -82,6 +82,9 @@ int Lua_optoption(lua_State *L, int narg, int def, int list_ref);
|
||||
int Lua_CreateFieldTable(lua_State *L, const char *const lst[]);
|
||||
void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save);
|
||||
|
||||
// Returns lua memory usage in kbytes
|
||||
size_t LUA_MemoryUsage(void);
|
||||
|
||||
// Console wrapper
|
||||
void COM_Lua_f(void);
|
||||
|
||||
|
||||
+15
-15
@@ -6451,7 +6451,7 @@ static void M_ChooseTimeAttack(INT32 choice)
|
||||
else
|
||||
G_RecordDemo(nameofdemo);
|
||||
|
||||
G_DeferedInitNew(false, mapname, (UINT8)(cv_chooseskin.value-1), 0, false);
|
||||
G_DeferedInitNew(false, mapname, (skinnum_t)(cv_chooseskin.value-1), 0, false);
|
||||
}
|
||||
|
||||
static void M_HandleStaffReplay(INT32 choice)
|
||||
@@ -7677,7 +7677,7 @@ static void M_DrawMPMainMenu(void)
|
||||
#define iconwidth 32
|
||||
#define spacingwidth 32
|
||||
#define incrwidth (iconwidth + spacingwidth)
|
||||
UINT8 i = 0, pskin, pcol;
|
||||
UINT16 i = 0, pskin, pcol;
|
||||
// player arrangement width, but there's also a chance i'm a furry, shhhhhh
|
||||
const INT32 paw = iconwidth + 3*incrwidth;
|
||||
INT32 trans = 0;
|
||||
@@ -7930,16 +7930,16 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
patch_t *patch;
|
||||
UINT8 frame;
|
||||
UINT8 speed;
|
||||
UINT8 weight;
|
||||
UINT8 i;
|
||||
UINT8 s, w;
|
||||
UINT16 frame;
|
||||
UINT16 speed;
|
||||
UINT16 weight;
|
||||
UINT16 i;
|
||||
UINT16 s, w;
|
||||
INT32 skinnum = 0;
|
||||
INT32 statx, staty;
|
||||
UINT32 speenframe;
|
||||
INT32 sltw, actw, hetw;
|
||||
UINT8 skintodisplay;
|
||||
skinnum_t skintodisplay;
|
||||
INT32 nameboxaddy = 0;
|
||||
|
||||
const UINT8 *flashcol = V_GetStringColormap(highlightflags);
|
||||
@@ -7996,7 +7996,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
break;
|
||||
case SKINMENUTYPE_2D:
|
||||
|
||||
skintodisplay = setupm_fakeskin;
|
||||
skintodisplay = (skinnum_t)setupm_fakeskin;
|
||||
if (setupm_skinlockedselect) //show the skin we are trying to select
|
||||
skintodisplay = skinstats[setupm_skinxpos][setupm_skinypos][setupm_skinselect];
|
||||
else if (skinstatscount[setupm_skinxpos][setupm_skinypos] && itemOn == 1)
|
||||
@@ -8376,7 +8376,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
colwidth = colwidth - 10;
|
||||
|
||||
INT32 j = -colwidth;
|
||||
INT16 col = setupm_fakecolor - colwidth;
|
||||
INT32 col = setupm_fakecolor - colwidth;
|
||||
INT32 x = mx;
|
||||
INT32 cw = indexwidth;
|
||||
UINT8 ch;
|
||||
@@ -8404,7 +8404,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
{
|
||||
const INT32 icons = 4;
|
||||
INT32 k = -icons;
|
||||
INT16 col = setupm_fakeskin - icons;
|
||||
INT32 col = setupm_fakeskin - icons;
|
||||
INT32 x = BASEVIDWIDTH/2 - ((icons+1)*24) - 4;
|
||||
fixed_t scale = FRACUNIT/2;
|
||||
INT32 offx = 8, offy = 8;
|
||||
@@ -8467,7 +8467,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
switch (cv_skinselectmenu.value)
|
||||
{
|
||||
case SKINMENUTYPE_2D:
|
||||
skintodisplay = (UINT8)setupm_fakeskin;
|
||||
skintodisplay = (skinnum_t)setupm_fakeskin;
|
||||
if (setupm_skinlockedselect) // show the skin we are trying to select
|
||||
skintodisplay = skinstats[setupm_skinxpos][setupm_skinypos][setupm_skinselect];
|
||||
else if (skinstatscount[setupm_skinxpos][setupm_skinypos] && itemOn == 1)
|
||||
@@ -8475,10 +8475,10 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
break;
|
||||
case SKINMENUTYPE_EXTENDED:
|
||||
case SKINMENUTYPE_GRID:
|
||||
skintodisplay = ((itemOn == 1 && (setupm_skinselect < numskins)) ? skinsorted[setupm_skinselect] : (UINT8)setupm_fakeskin);
|
||||
skintodisplay = ((itemOn == 1 && (setupm_skinselect < numskins)) ? skinsorted[setupm_skinselect] : (skinnum_t)setupm_fakeskin);
|
||||
break;
|
||||
default:
|
||||
skintodisplay = (UINT8)setupm_fakeskin;
|
||||
skintodisplay = (skinnum_t)setupm_fakeskin;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -10060,7 +10060,7 @@ static void M_DrawColorMenu(void)
|
||||
|
||||
for (max = currentMenu->numitems; max > 0; max--)
|
||||
{
|
||||
if (currentMenu->menuitems[max].status != IT_DISABLED && currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight))
|
||||
if (currentMenu->menuitems[max-1].status != IT_DISABLED && currentMenu->menuitems[max-1].alphaKey*2 + tempcentery <= (currentMenu->y + 2*scrollareaheight))
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -230,8 +230,8 @@ typedef struct
|
||||
char levelname[32];
|
||||
UINT8 actnum;
|
||||
UINT8 skincolor;
|
||||
UINT8 skinnum;
|
||||
UINT8 botskin;
|
||||
skinnum_t skinnum;
|
||||
skinnum_t botskin;
|
||||
UINT8 botcolor;
|
||||
UINT8 numemeralds;
|
||||
INT32 lives;
|
||||
|
||||
+2
-2
@@ -238,8 +238,8 @@ void M_TextInputClear(textinput_t *input)
|
||||
|
||||
void M_TextInputSetString(textinput_t *input, const char *c)
|
||||
{
|
||||
memset(input->buffer, 0, input->buffer_size);
|
||||
strncpy(input->buffer, c, input->buffer_size);
|
||||
strncpy(input->buffer, c, input->buffer_size-1);
|
||||
input->buffer[input->buffer_size-1] = '\0';
|
||||
input->cursor = input->select = input->length = strlen(input->buffer);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -295,10 +295,10 @@ FUNCINLINE static ATTRINLINE boolean P_MobjWasRemoved(const mobj_t *mobj)
|
||||
// so can only check if its not NULL in vanilla compat mode
|
||||
FUNCINLINE static ATTRINLINE boolean P_MobjWasRemovedCompat(const mobj_t *mobj)
|
||||
{
|
||||
#ifdef COMPAT_VANILLA
|
||||
return (!mobj);
|
||||
#else
|
||||
#ifdef PHOBOS_BUILD
|
||||
return P_MobjWasRemoved(mobj);
|
||||
#else
|
||||
return !mobj;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+31
-11
@@ -69,7 +69,7 @@ FUNCINLINE static ATTRINLINE void P_ArchivePlayer(savebuffer_t *save)
|
||||
pllives = 3; // has less than that.
|
||||
|
||||
WRITEUINT8(save->p, player->skincolor);
|
||||
WRITEUINT8(save->p, player->skin);
|
||||
WRITESKIN(save->p, player->skin);
|
||||
|
||||
WRITEUINT32(save->p, player->score);
|
||||
WRITEINT32(save->p, pllives);
|
||||
@@ -77,7 +77,7 @@ FUNCINLINE static ATTRINLINE void P_ArchivePlayer(savebuffer_t *save)
|
||||
|
||||
if (botskin)
|
||||
{
|
||||
WRITEUINT8(save->p, botskin);
|
||||
WRITESKIN(save->p, botskin);
|
||||
WRITEUINT8(save->p, botcolor);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ FUNCINLINE static ATTRINLINE void P_ArchivePlayer(savebuffer_t *save)
|
||||
FUNCINLINE static ATTRINLINE void P_UnArchivePlayer(savebuffer_t *save)
|
||||
{
|
||||
savedata.skincolor = READUINT8(save->p);
|
||||
savedata.skin = READUINT8(save->p);
|
||||
savedata.skin = READSKIN(save->p);
|
||||
|
||||
savedata.score = READINT32(save->p);
|
||||
savedata.lives = READINT32(save->p);
|
||||
@@ -96,9 +96,11 @@ FUNCINLINE static ATTRINLINE void P_UnArchivePlayer(savebuffer_t *save)
|
||||
|
||||
if (savedata.botcolor)
|
||||
{
|
||||
savedata.botskin = READUINT8(save->p);
|
||||
savedata.botskin = READSKIN(save->p);
|
||||
|
||||
if (savedata.botskin-1 >= numskins)
|
||||
savedata.botskin = 0;
|
||||
|
||||
savedata.botcolor = READUINT8(save->p);
|
||||
}
|
||||
else
|
||||
@@ -117,7 +119,9 @@ static void P_NetArchivePlayers(savebuffer_t *save, boolean resending)
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
#ifndef PHOBOS_BUILD
|
||||
if (resending)
|
||||
#endif
|
||||
WRITESINT8(save->p, (SINT8)adminplayers[i]);
|
||||
|
||||
if (!playeringame[i])
|
||||
@@ -127,7 +131,9 @@ static void P_NetArchivePlayers(savebuffer_t *save, boolean resending)
|
||||
|
||||
// no longer send ticcmds
|
||||
|
||||
#ifndef PHOBOS_BUILD
|
||||
if (resending)
|
||||
#endif
|
||||
WRITESTRINGN(save->p, player_names[i], MAXPLAYERNAME);
|
||||
|
||||
const player_t *player = &players[i];
|
||||
@@ -156,11 +162,16 @@ static void P_NetArchivePlayers(savebuffer_t *save, boolean resending)
|
||||
WRITEUINT16(save->p, player->flashpal);
|
||||
WRITEUINT16(save->p, player->flashcount);
|
||||
|
||||
#ifdef PHOBOS_BUILD
|
||||
WRITEUINT8(save->p, player->skincolor);
|
||||
WRITEINT32(save->p, player->skin);
|
||||
#else
|
||||
if (resending)
|
||||
{
|
||||
WRITEUINT8(save->p, player->skincolor);
|
||||
WRITEINT32(save->p, player->skin);
|
||||
}
|
||||
#endif
|
||||
|
||||
WRITEUINT32(save->p, player->score);
|
||||
WRITEFIXED(save->p, player->dashspeed);
|
||||
@@ -309,7 +320,9 @@ static void P_NetUnArchivePlayers(savebuffer_t *save, boolean reloading)
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
#ifndef PHOBOS_BUILD
|
||||
if (reloading)
|
||||
#endif
|
||||
adminplayers[i] = (INT32)READSINT8(save->p);
|
||||
|
||||
// Do NOT memset player struct to 0
|
||||
@@ -320,7 +333,9 @@ static void P_NetUnArchivePlayers(savebuffer_t *save, boolean reloading)
|
||||
|
||||
// NOTE: sending tics should (hopefully) no longer be necessary
|
||||
|
||||
#ifndef PHOBOS_BUILD
|
||||
if (reloading)
|
||||
#endif
|
||||
READSTRINGN(save->p, player_names[i], MAXPLAYERNAME);
|
||||
|
||||
player_t *player = &players[i];
|
||||
@@ -349,11 +364,16 @@ static void P_NetUnArchivePlayers(savebuffer_t *save, boolean reloading)
|
||||
player->flashpal = READUINT16(save->p);
|
||||
player->flashcount = READUINT16(save->p);
|
||||
|
||||
#ifdef PHOBOS_BUILD
|
||||
player->skincolor = READUINT8(save->p);
|
||||
player->skin = READINT32(save->p);
|
||||
#else
|
||||
if (reloading)
|
||||
{
|
||||
player->skincolor = READUINT8(save->p);
|
||||
player->skin = READINT32(save->p);
|
||||
}
|
||||
#endif
|
||||
|
||||
player->score = READUINT32(save->p);
|
||||
player->dashspeed = READFIXED(save->p); // dashing speed
|
||||
@@ -1108,10 +1128,10 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
|
||||
diff2 = 0;
|
||||
|
||||
// not the default but the most probable
|
||||
#ifdef COMPAT_VANILLA
|
||||
if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0)
|
||||
#else
|
||||
#ifdef PHOBOS_BUILD
|
||||
if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0 || mobj->pmomz !=0)
|
||||
#else
|
||||
if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0)
|
||||
#endif
|
||||
diff |= MD_MOM;
|
||||
if (mobj->radius != mobj->info->radius)
|
||||
@@ -1240,7 +1260,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
|
||||
WRITEFIXED(save->p, mobj->momx);
|
||||
WRITEFIXED(save->p, mobj->momy);
|
||||
WRITEFIXED(save->p, mobj->momz);
|
||||
#ifndef COMPAT_VANILLA
|
||||
#ifdef PHOBOS_BUILD
|
||||
WRITEFIXED(save->p, mobj->pmomz);
|
||||
#endif
|
||||
}
|
||||
@@ -1304,7 +1324,7 @@ static void SaveMobjThinker(savebuffer_t *save, const thinker_t *th, const UINT8
|
||||
if (diff2 & MD2_CVMEM)
|
||||
WRITEINT32(save->p, mobj->cvmem);
|
||||
if (diff2 & MD2_SKIN)
|
||||
WRITEUINT8(save->p, (UINT8)((skin_t *)mobj->skin - skins));
|
||||
WRITESKIN(save->p, (skinnum_t)((skin_t *)mobj->skin - skins));
|
||||
if (diff2 & MD2_COLOR)
|
||||
WRITEUINT8(save->p, mobj->color);
|
||||
if (diff2 & MD2_EXTVAL1)
|
||||
@@ -2062,7 +2082,7 @@ static void LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
mobj->momx = READFIXED(save->p);
|
||||
mobj->momy = READFIXED(save->p);
|
||||
mobj->momz = READFIXED(save->p);
|
||||
#ifndef COMPAT_VANILLA
|
||||
#ifdef PHOBOS_BUILD
|
||||
mobj->pmomz = READFIXED(save->p);
|
||||
#endif
|
||||
} // otherwise they're zero, and the memset took care of it
|
||||
@@ -2165,7 +2185,7 @@ static void LoadMobjThinker(savebuffer_t *save, actionf_p1 thinker)
|
||||
if (diff2 & MD2_CVMEM)
|
||||
mobj->cvmem = READINT32(save->p);
|
||||
if (diff2 & MD2_SKIN)
|
||||
mobj->skin = &skins[READUINT8(save->p)];
|
||||
mobj->skin = &skins[READSKIN(save->p)];
|
||||
if (diff2 & MD2_COLOR)
|
||||
mobj->color = READUINT8(save->p);
|
||||
if (diff2 & MD2_EXTVAL1)
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@
|
||||
typedef struct
|
||||
{
|
||||
UINT8 skincolor;
|
||||
UINT8 skin;
|
||||
UINT8 botskin;
|
||||
skinnum_t skin;
|
||||
skinnum_t botskin;
|
||||
UINT8 botcolor;
|
||||
INT32 score;
|
||||
INT32 lives;
|
||||
|
||||
+4
-4
@@ -2074,14 +2074,14 @@ static void P_LoadReject(UINT8 *data, size_t rejectsize)
|
||||
if (rejectsize < neededsize)
|
||||
{
|
||||
CorruptMapWarning(va("P_LoadReject: REJECT is %s byte%s too small. REJECT might be invalid!\n", sizeu1(neededsize - rejectsize), (neededsize - rejectsize) == 1 ? "" : "s"));
|
||||
#ifdef COMPAT_VANILLA
|
||||
#ifdef PHOBOS_BUILD
|
||||
rejectmatrix = NULL;
|
||||
return;
|
||||
#else
|
||||
// we can pad this and somewhat prevent desyncs
|
||||
// probs not cool if the reject is from a completely different map
|
||||
// but whatever
|
||||
allocsize = neededsize;
|
||||
#else
|
||||
rejectmatrix = NULL;
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -4604,7 +4604,7 @@ void P_UpdateSpecials(void)
|
||||
// POINT LIMIT
|
||||
P_CheckPointLimit();
|
||||
|
||||
#ifdef COMPAT_VANILLA
|
||||
#ifndef PHOBOS_BUILD
|
||||
// Dynamic slopeness
|
||||
// we run this here only when not joined midrace
|
||||
// for vanilla compat reasons :chaosleep:
|
||||
|
||||
+1
-1
@@ -651,7 +651,7 @@ void P_Ticker(boolean run)
|
||||
if (run)
|
||||
{
|
||||
// Dynamic slopeness
|
||||
#ifdef COMPAT_VANILLA
|
||||
#ifndef PHOBOS_BUILD
|
||||
if (midgamejoin) // only run here if we joined midgame to fix some desynchs
|
||||
#endif
|
||||
P_RunDynamicSlopes();
|
||||
|
||||
+6
-6
@@ -42,8 +42,8 @@ INT32 numallskins = 0;
|
||||
INT32 numlocalskins = 0;
|
||||
skin_t skins[MAXSKINS];
|
||||
|
||||
UINT8 skinstats[9][9][MAXSKINS];
|
||||
UINT8 skinstatscount[9][9] = {
|
||||
skinnum_t skinstats[9][9][MAXSKINS];
|
||||
skinnum_t skinstatscount[9][9] = {
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
@@ -55,7 +55,7 @@ UINT8 skinstatscount[9][9] = {
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
UINT8 skinsorted[MAXSKINS] = {};
|
||||
skinnum_t skinsorted[MAXSKINS] = {};
|
||||
skin_t localskins[MAXLOCALSKINS] = {};
|
||||
skin_t allskins[MAXSKINS+MAXLOCALSKINS] = {};
|
||||
|
||||
@@ -398,8 +398,8 @@ static UINT16 W_CheckForSkinMarkerInPwad(UINT16 wadid, UINT16 startlump)
|
||||
static int skinSortFunc(const void *a, const void *b) // tbh i have no clue what the naming conventions for local functions are
|
||||
{
|
||||
int diff = 0;
|
||||
const UINT8 val_a = *(const UINT8 *)a;
|
||||
const UINT8 val_b = *(const UINT8 *)b;
|
||||
const skinnum_t val_a = *(const skinnum_t *)a;
|
||||
const skinnum_t val_b = *(const skinnum_t *)b;
|
||||
const skin_t *in1 = &skins[val_a];
|
||||
const skin_t *in2 = &skins[val_b];
|
||||
|
||||
@@ -474,7 +474,7 @@ static int skinSortFunc(const void *a, const void *b) // tbh i have no clue what
|
||||
void sortSkinGrid(void)
|
||||
{
|
||||
//CONS_Printf("Sorting skin list (%d)...\n", cv_skinselectgridsort.value);
|
||||
qs22j(skinsorted, numskins, sizeof(UINT8), skinSortFunc);
|
||||
qs22j(skinsorted, numskins, sizeof(skinnum_t), skinSortFunc);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+3
-3
@@ -71,9 +71,9 @@ extern INT32 numskins;
|
||||
extern INT32 numlocalskins;
|
||||
extern INT32 numallskins;
|
||||
extern skin_t skins[MAXSKINS];
|
||||
extern UINT8 skinstats[9][9][MAXSKINS];
|
||||
extern UINT8 skinstatscount[9][9];
|
||||
extern UINT8 skinsorted[MAXSKINS];
|
||||
extern skinnum_t skinstats[9][9][MAXSKINS];
|
||||
extern skinnum_t skinstatscount[9][9];
|
||||
extern skinnum_t skinsorted[MAXSKINS];
|
||||
|
||||
extern skin_t localskins[MAXLOCALSKINS];
|
||||
extern skin_t allskins[MAXSKINS+MAXLOCALSKINS];
|
||||
|
||||
+26
-97
@@ -44,7 +44,6 @@
|
||||
#ifdef HAVE_VALGRIND
|
||||
#include "valgrind.h"
|
||||
static boolean Z_calloc = false;
|
||||
#include "memcheck.h"
|
||||
#endif
|
||||
|
||||
#define ZONEID 0xa441d13d
|
||||
@@ -180,7 +179,7 @@ void Z_Free(void *ptr)
|
||||
if (block->user != NULL)
|
||||
*block->user = NULL;
|
||||
|
||||
#ifdef VALGRIND_DESTROY_MEMPOOL
|
||||
#ifdef HAVE_VALGRIND
|
||||
VALGRIND_DESTROY_MEMPOOL(block);
|
||||
#endif
|
||||
block->prev->next = block->next;
|
||||
@@ -246,10 +245,6 @@ void *Z_Malloc(size_t size, INT32 tag, void *user)
|
||||
ptr = MEMORY(block);
|
||||
I_Assert((intptr_t)ptr % alignof (max_align_t) == 0);
|
||||
|
||||
#ifdef HAVE_VALGRIND
|
||||
Z_calloc = false;
|
||||
#endif
|
||||
|
||||
block->next = head.next;
|
||||
block->prev = &head;
|
||||
head.next = block;
|
||||
@@ -263,8 +258,9 @@ void *Z_Malloc(size_t size, INT32 tag, void *user)
|
||||
#endif
|
||||
block->size = size;
|
||||
|
||||
#ifdef VALGRIND_CREATE_MEMPOOL
|
||||
#ifdef HAVE_VALGRIND
|
||||
VALGRIND_CREATE_MEMPOOL(block, size, Z_calloc);
|
||||
Z_calloc = false;
|
||||
#endif
|
||||
|
||||
#ifdef PARANOIA
|
||||
@@ -301,7 +297,8 @@ void *Z_Calloc2(size_t size, INT32 tag, void *user, const char *file, INT32 line
|
||||
void *Z_Calloc(size_t size, INT32 tag, void *user)
|
||||
#endif
|
||||
{
|
||||
#ifdef VALGRIND_MEMPOOL_ALLOC
|
||||
|
||||
#ifdef HAVE_VALGRIND
|
||||
Z_calloc = true;
|
||||
#endif
|
||||
#ifdef ZDEBUG
|
||||
@@ -513,6 +510,16 @@ void Z_CheckHeap(INT32 tag)
|
||||
(void)tag;
|
||||
#endif
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#define HeapError(msg) \
|
||||
I_Error("Z_CheckHeap : %s:%d, block %u (owned by %s:%d) %s", \
|
||||
file, line, blocknumon, block->ownerfile, block->ownerline, msg)
|
||||
#else
|
||||
#define HeapError(msg) \
|
||||
I_Error("Z_CheckHeap : block %u (owned by %s:%d) %s", \
|
||||
blocknumon, block->ownerfile, block->ownerline, msg)
|
||||
#endif
|
||||
|
||||
for (block = head.next; block != &head; block = block->next)
|
||||
{
|
||||
blocknumon++;
|
||||
@@ -521,108 +528,30 @@ void Z_CheckHeap(INT32 tag)
|
||||
CONS_Debug(DBG_MEMORY, "block %u owned by %s:%d\n",
|
||||
blocknumon, block->ownerfile, block->ownerline);
|
||||
#endif
|
||||
#ifdef VALGRIND_MEMPOOL_EXISTS
|
||||
if (!VALGRIND_MEMPOOL_EXISTS(block))
|
||||
#ifdef HAVE_VALGRIND
|
||||
if (RUNNING_ON_VALGRIND && !VALGRIND_MEMPOOL_EXISTS(block))
|
||||
{
|
||||
I_Error("Z_CheckHeap :"
|
||||
#ifdef ZDEBUG
|
||||
" %s %d"
|
||||
#endif
|
||||
" block %u"
|
||||
#ifdef ZDEBUG
|
||||
" (owned by %s:%d)"
|
||||
#endif
|
||||
" should not exist"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
);
|
||||
HeapError(" should not exist");
|
||||
}
|
||||
#endif
|
||||
if (block->user != NULL && *(block->user) != given)
|
||||
{
|
||||
I_Error("Z_CheckHeap :"
|
||||
#ifdef ZDEBUG
|
||||
" %s %d"
|
||||
#endif
|
||||
" block %u"
|
||||
#ifdef ZDEBUG
|
||||
" (owned by %s:%d)"
|
||||
#endif
|
||||
" doesn't have a proper user"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
);
|
||||
HeapError(" doesn't have a proper user");
|
||||
}
|
||||
|
||||
if (block->next->prev != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap :"
|
||||
#ifdef ZDEBUG
|
||||
" %s %d"
|
||||
#endif
|
||||
" block %u"
|
||||
#ifdef ZDEBUG
|
||||
" (owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper backlink"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
);
|
||||
HeapError(" lacks proper backlink");
|
||||
}
|
||||
|
||||
if (block->prev->next != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap :"
|
||||
#ifdef ZDEBUG
|
||||
" %s %d"
|
||||
#endif
|
||||
" block %u"
|
||||
#ifdef ZDEBUG
|
||||
" (owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper forward link"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
);
|
||||
HeapError(" lacks proper forward link");
|
||||
}
|
||||
#ifdef PARANOIA
|
||||
if (block->id != ZONEID)
|
||||
{
|
||||
I_Error("Z_CheckHeap :"
|
||||
#ifdef ZDEBUG
|
||||
" %s %d"
|
||||
#endif
|
||||
" block %u"
|
||||
#ifdef ZDEBUG
|
||||
" (owned by %s:%d)"
|
||||
#endif
|
||||
" have the wrong ID"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
);
|
||||
HeapError(" has the wrong ID");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -734,8 +663,8 @@ static void Command_Memfree_f(void)
|
||||
|
||||
Z_CheckHeap(-1);
|
||||
CONS_Printf("\x82%s", M_GetText("Memory Info\n"));
|
||||
CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1(Z_TotalUsage()>>10));
|
||||
CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(Z_TagUsage(PU_LUA)>>10));
|
||||
CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1((Z_TotalUsage()>>10) + LUA_MemoryUsage()));
|
||||
CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(LUA_MemoryUsage())); // No longer uses z_zone memory but for consistency keep it here
|
||||
CONS_Printf(M_GetText("Static : %7s KB\n"), sizeu1(Z_TagUsage(PU_STATIC)>>10));
|
||||
CONS_Printf(M_GetText("Static (sound) : %7s KB\n"), sizeu1(Z_TagUsage(PU_SOUND)>>10));
|
||||
CONS_Printf(M_GetText("Static (music) : %7s KB\n"), sizeu1(Z_TagUsage(PU_MUSIC)>>10));
|
||||
|
||||
Reference in new issue
Block a user