Compare commits
58
Commits
luamusicdef
..
v8.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2049353647 | ||
|
|
845652cbfe | ||
|
|
ceafa06efc | ||
|
|
e6f487474b | ||
|
|
d8461bb44f | ||
|
|
e25d366728 | ||
|
|
2abf0b98ac | ||
|
|
2e914c61d1 | ||
|
|
50f7e2084c | ||
|
|
67cc5402cf | ||
|
|
2259d4f309 | ||
|
|
f8d903e7d2 | ||
|
|
805cde8ae8 | ||
|
|
b23906e327 | ||
|
|
2052afdb66 | ||
|
|
e749346f0c | ||
|
|
45629386bb | ||
|
|
ffec9d64d5 | ||
|
|
3e9f17af86 | ||
|
|
03ff2fc007 | ||
|
|
4492c00840 | ||
|
|
e15319ac9b | ||
|
|
fa012aefe1 | ||
|
|
e681d2d24d | ||
|
|
76e54762d8 | ||
|
|
3b7d517be2 | ||
|
|
f4da64e3fa | ||
|
|
384acf8e31 | ||
|
|
a423451383 | ||
|
|
66cfceedaf | ||
|
|
fe9107fa9d | ||
|
|
e4f2db54e7 | ||
|
|
2f5fe01ae0 | ||
|
|
1bb7bd0abc | ||
|
|
a84ec88bc3 | ||
|
|
4a2e78081a | ||
|
|
d09d2cb445 | ||
|
|
1faa585e83 | ||
|
|
7479c82691 | ||
|
|
cfab2236da | ||
|
|
d2ee344b22 | ||
|
|
b22737223e | ||
|
|
578158c060 | ||
|
|
8eda0f78f7 | ||
|
|
2c2c82dc1a | ||
|
|
d8c9522ec9 | ||
|
|
492aef2165 | ||
|
|
fc0409e967 | ||
|
|
8a89b57e48 | ||
|
|
0f6b9ba181 | ||
|
|
8f1b4004c9 | ||
|
|
bee5250940 | ||
|
|
c61a2e6ba2 | ||
|
|
d293bb9672 | ||
|
|
68cb96ab97 | ||
|
|
78b642cf2d | ||
|
|
a9209a4887 | ||
|
|
0a3e7ba09f |
No files matched your search
-31
@@ -161,37 +161,6 @@ Duration is in milliseconds and is optional to set, default value is 84ms.
|
||||
Exactly same as P_CheckSight but uses cheaper algorithm, useful for things like nametags. Doesn't work exactly
|
||||
like P_CheckSight so don't use it for anything gameplay-related.
|
||||
|
||||
## musicdef_t
|
||||
|
||||
Userdata structure representing a musicdef. Fields:
|
||||
|
||||
`musicdef.name` - song identifier ("kmap01" for example).
|
||||
|
||||
`musicdef.usage`, `musicdef.source` - fields from vanilla MUSICDEFS lump.
|
||||
|
||||
`musicdef.filename` - unused for now.
|
||||
|
||||
`musicdef.title`, `musicdef.alttitle`, `musicdef.authors` - fields from MUSCINFO lump.
|
||||
|
||||
`#musicdef` - returns integer id for musicdef (which can be used as index in `musicdefs`).
|
||||
|
||||
All fields are read-only.
|
||||
|
||||
## S_FindMusicCredit(name)
|
||||
|
||||
Returns musicdef corresponding to music with given identifier. For example, `S_FindMusicCredit("kmap01")` will return
|
||||
musicdef for green hills music.
|
||||
|
||||
## musicdefs
|
||||
|
||||
Global table for all musicdefs, similar to mobjinfo, states, etc. Can take either integer indices,
|
||||
from `0` to `#musicdefs-1`, or string indices (which is equal to calling `S_FindMusicCredit`).
|
||||
|
||||
## addHook("MusicCredit", function(musicdef))
|
||||
|
||||
Hook is called whenever `S_ShowMusicCredit` (either from game or mod) is called. Takes musicdef as only argument, returning true
|
||||
will overwrite vanilla behavior (not show music credit), can be used to implement custom music credit pop-ups.
|
||||
|
||||
# Other changes
|
||||
|
||||
## P_PlayRinglossSound(source, damager)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* backtrace.h -- Public header file for stack backtrace library.
|
||||
Copyright (C) 2012-2024 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Google.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,14 +54,13 @@ struct backtrace_state;
|
||||
invalid after this function returns.
|
||||
|
||||
As a special case, the ERRNUM argument will be passed as -1 if no
|
||||
debug info can be found for the executable, or if the debug info
|
||||
exists but has an unsupported version, but the function requires
|
||||
debug info (e.g., backtrace_full, backtrace_pcinfo). The MSG in
|
||||
this case will be something along the lines of "no debug info".
|
||||
Similarly, ERRNUM will be passed as -1 if there is no symbol table,
|
||||
but the function requires a symbol table (e.g., backtrace_syminfo).
|
||||
This may be used as a signal that some other approach should be
|
||||
tried. */
|
||||
debug info can be found for the executable, but the function
|
||||
requires debug info (e.g., backtrace_full, backtrace_pcinfo). The
|
||||
MSG in this case will be something along the lines of "no debug
|
||||
info". Similarly, ERRNUM will be passed as -1 if there is no
|
||||
symbol table, but the function requires a symbol table (e.g.,
|
||||
backtrace_syminfo). This may be used as a signal that some other
|
||||
approach should be tried. */
|
||||
|
||||
typedef void (*backtrace_error_callback) (void *data, const char *msg,
|
||||
int errnum);
|
||||
|
||||
Binary file not shown.
+7
-3
@@ -197,7 +197,7 @@ static fixed_t scale_mtof = (fixed_t)INITSCALEMTOF;
|
||||
// used by FTOM to scale from frame-buffer-to-map coords (=1/scale_mtof)
|
||||
static fixed_t scale_ftom;
|
||||
|
||||
static player_t *plr; // the player represented by an arrow
|
||||
static player_t *plr = NULL; // the player represented by an arrow
|
||||
|
||||
static boolean followplayer = true; // specifies whether to follow the player around
|
||||
|
||||
@@ -237,7 +237,7 @@ static inline void AM_restoreScaleAndLoc(void)
|
||||
m_x = old_m_x;
|
||||
m_y = old_m_y;
|
||||
}
|
||||
else
|
||||
else if (plr && plr->mo)
|
||||
{
|
||||
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
||||
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
||||
@@ -318,7 +318,8 @@ static void AM_initVariables(void)
|
||||
break;
|
||||
|
||||
plr = &players[pnum];
|
||||
if (plr != NULL && plr->mo != NULL)
|
||||
|
||||
if (plr && plr->mo)
|
||||
{
|
||||
m_x = (plr->mo->x >> FRACTOMAPBITS) - m_w/2;
|
||||
m_y = (plr->mo->y >> FRACTOMAPBITS) - m_h/2;
|
||||
@@ -597,6 +598,9 @@ static inline void AM_changeWindowScale(void)
|
||||
|
||||
static inline void AM_doFollowPlayer(void)
|
||||
{
|
||||
if (!plr || !plr->mo)
|
||||
return;
|
||||
|
||||
if (f_oldloc.x != plr->mo->x || f_oldloc.y != plr->mo->y)
|
||||
{
|
||||
m_x = FTOM(MTOF(plr->mo->x >> FRACTOMAPBITS)) - m_w/2;
|
||||
|
||||
+35
-15
@@ -240,7 +240,6 @@ void COM_ImmedExecute(const char *ptext)
|
||||
|
||||
while (i < strlen(ptext))
|
||||
{
|
||||
|
||||
quotes = 0;
|
||||
for (j = 0; i < strlen(ptext); i++,j++)
|
||||
{
|
||||
@@ -817,12 +816,17 @@ static void COM_Help_f(void)
|
||||
cvar = CV_FindVar(help);
|
||||
if (cvar)
|
||||
{
|
||||
boolean floatmode = false;
|
||||
const char *cvalue = NULL;
|
||||
CONS_Printf("\x82""Variable %s:\n", cvar->name);
|
||||
CONS_Printf(M_GetText(" flags: "));
|
||||
if (cvar->flags & CV_SAVE)
|
||||
CONS_Printf("AUTOSAVE ");
|
||||
if (cvar->flags & CV_FLOAT)
|
||||
{
|
||||
CONS_Printf("FLOAT ");
|
||||
floatmode = true;
|
||||
}
|
||||
if (cvar->flags & CV_NETVAR)
|
||||
CONS_Printf("NETVAR ");
|
||||
if (cvar->flags & CV_CALL)
|
||||
@@ -832,30 +836,43 @@ static void COM_Help_f(void)
|
||||
CONS_Printf("\n");
|
||||
if (cvar->PossibleValue)
|
||||
{
|
||||
if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX"))
|
||||
{
|
||||
CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[0].value,
|
||||
cvar->PossibleValue[1].value);
|
||||
i = 2;
|
||||
}
|
||||
if (!stricmp(cvar->PossibleValue[0].strvalue, "MIN") && !stricmp(cvar->PossibleValue[1].strvalue, "MAX"))
|
||||
{
|
||||
if (floatmode)
|
||||
{
|
||||
float fu = FIXED_TO_FLOAT(cvar->PossibleValue[0].value);
|
||||
float ck = FIXED_TO_FLOAT(cvar->PossibleValue[1].value);
|
||||
CONS_Printf(" range from %ld%s to %ld%s\n",
|
||||
(long)fu, M_Ftrim(fu),
|
||||
(long)ck, M_Ftrim(ck));
|
||||
}
|
||||
else
|
||||
CONS_Printf(" range from %d to %d\n", cvar->PossibleValue[0].value,
|
||||
cvar->PossibleValue[1].value);
|
||||
i = 2;
|
||||
}
|
||||
|
||||
{
|
||||
const char *cvalue = NULL;
|
||||
//CONS_Printf(M_GetText(" possible value : %s\n"), cvar->name);
|
||||
while (cvar->PossibleValue[i].strvalue)
|
||||
{
|
||||
CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value,
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
if (floatmode)
|
||||
CONS_Printf(" %-2f : %s\n", FIXED_TO_FLOAT(cvar->PossibleValue[i].value),
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
else
|
||||
CONS_Printf(" %-2d : %s\n", cvar->PossibleValue[i].value,
|
||||
cvar->PossibleValue[i].strvalue);
|
||||
if (cvar->PossibleValue[i].value == cvar->value)
|
||||
cvalue = cvar->PossibleValue[i].strvalue;
|
||||
i++;
|
||||
}
|
||||
if (cvalue)
|
||||
CONS_Printf(" Current value: %s\n", cvalue);
|
||||
else
|
||||
CONS_Printf(" Current value: %d\n", cvar->value);
|
||||
}
|
||||
}
|
||||
|
||||
if (cvalue)
|
||||
CONS_Printf(" Current value: %s\n", cvalue);
|
||||
else if (cvar->string)
|
||||
CONS_Printf(" Current value: %s\n", cvar->string);
|
||||
else
|
||||
CONS_Printf(" Current value: %d\n", cvar->value);
|
||||
}
|
||||
@@ -1026,7 +1043,10 @@ static void COM_Add_f(void)
|
||||
}
|
||||
|
||||
if (( cvar->flags & CV_FLOAT ))
|
||||
CV_Set(cvar, va("%f", FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2))));
|
||||
{
|
||||
float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2));
|
||||
CV_Set(cvar, va("%ld%s", (long)n, M_Ftrim(n)));
|
||||
}
|
||||
else
|
||||
CV_AddValue(cvar, atoi(COM_Argv(2)));
|
||||
}
|
||||
|
||||
+44
-24
@@ -95,7 +95,7 @@ UINT8 playernode[MAXPLAYERS];
|
||||
tic_t jointimeout = (3*TICRATE);
|
||||
static boolean sendingsavegame[MAXNETNODES]; // Are we sending the savegame?
|
||||
#ifdef SATURNPAK
|
||||
static boolean resendingsavegame[MAXNETNODES]; // Are we resending the savegame?
|
||||
static tic_t resendingsavegame[MAXNETNODES]; // Are we resending the savegame?
|
||||
static tic_t savegameresendcooldown[MAXNETNODES]; // How long before we can resend again?
|
||||
#endif
|
||||
static tic_t freezetimeout[MAXNETNODES]; // Until when can this node freeze the server before getting a timeout?
|
||||
@@ -1068,6 +1068,7 @@ static void SV_RequireResynch(INT32 node)
|
||||
|
||||
// Initial setup
|
||||
memset(resynch_sent[node], 0, MAXPLAYERS);
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (!playeringame[i]) // Player not in game so just drop it from required synch
|
||||
@@ -1687,13 +1688,7 @@ static void SV_SendPlayerInfo(INT32 node)
|
||||
|
||||
for (i = 0; i < MSCOMPAT_MAXPLAYERS; i++)
|
||||
{
|
||||
if (i >= MAXPLAYERS)
|
||||
{
|
||||
netbuffer->u.playerinfo[i].node = 255;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (playernode[i] == UINT8_MAX || !playeringame[i])
|
||||
if ((i >= MAXPLAYERS) || !playeringame[i])
|
||||
{
|
||||
netbuffer->u.playerinfo[i].node = 255; // This slot is empty.
|
||||
continue;
|
||||
@@ -1778,8 +1773,6 @@ static boolean SV_SendServerConfig(INT32 node)
|
||||
memset(netbuffer->u.servercfg.playerskins, 0xFF, sizeof(netbuffer->u.servercfg.playerskins));
|
||||
memset(netbuffer->u.servercfg.playercolor, 0xFF, sizeof(netbuffer->u.servercfg.playercolor));
|
||||
|
||||
memset(netbuffer->u.servercfg.adminplayers, -1, sizeof(netbuffer->u.servercfg.adminplayers));
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
netbuffer->u.servercfg.adminplayers[i] = (SINT8)adminplayers[i];
|
||||
@@ -3275,7 +3268,7 @@ void CL_ClearPlayer(INT32 playernum)
|
||||
P_RemoveMobj(players[playernum].mo);
|
||||
}
|
||||
|
||||
memset(&players[playernum], 0, sizeof (player_t));
|
||||
memset(&players[playernum], 0, sizeof(player_t));
|
||||
}
|
||||
|
||||
//
|
||||
@@ -4251,7 +4244,7 @@ static void ResetNode(INT32 node)
|
||||
// SATURN
|
||||
#ifdef SATURNPAK
|
||||
is_client_saturn[node] = false;
|
||||
resendingsavegame[node] = false;
|
||||
resendingsavegame[node] = 0;
|
||||
savegameresendcooldown[node] = 0;
|
||||
gamestate_resend_counter[node] = 0;
|
||||
#endif
|
||||
@@ -4284,14 +4277,14 @@ void SV_ResetServer(void)
|
||||
sprintf(player_names[i], "Player %d", i + 1);
|
||||
}
|
||||
|
||||
memset(player_name_changes, 0, sizeof player_name_changes);
|
||||
memset(player_name_changes, 0, sizeof(player_name_changes));
|
||||
|
||||
memset(playeringame, false, sizeof playeringame);
|
||||
memset(playernode, UINT8_MAX, sizeof playernode);
|
||||
memset(playeringame, false, sizeof(playeringame));
|
||||
memset(playernode, UINT8_MAX, sizeof(playernode));
|
||||
|
||||
pingmeasurecount = 1;
|
||||
memset(realpingtable, 0, sizeof realpingtable);
|
||||
memset(playerpingtable, 0, sizeof playerpingtable);
|
||||
memset(realpingtable, 0, sizeof(realpingtable));
|
||||
memset(playerpingtable, 0, sizeof(playerpingtable));
|
||||
|
||||
ClearAdminPlayers();
|
||||
|
||||
@@ -4952,7 +4945,7 @@ static void PT_CanReceiveGamestate(SINT8 node)
|
||||
CONS_Printf(M_GetText("Resending game state to %s...\n"), player_names[nodetoplayer[node]]);
|
||||
|
||||
SV_SendSaveGame(node, true); // Resend a complete game state
|
||||
resendingsavegame[node] = true;
|
||||
resendingsavegame[node] = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5395,11 +5388,11 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
|
||||
// Check player consistancy during the level
|
||||
if (gamestate == GS_LEVEL
|
||||
&& (realstart > gametic - TICQUEUE+1 && realstart <= gametic)
|
||||
&& (realstart <= gametic && realstart + TICQUEUE - 1 > gametic)
|
||||
&& consistancy[realstart%TICQUEUE] != SHORT(netbuffer->u.clientpak.consistancy)
|
||||
&& (!UseSaturnSynch(node) || (!resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime() && !SV_ResendingSavegameToAnyone())))
|
||||
{
|
||||
resendingsavegame[node] = false; // reset this before just in case
|
||||
resendingsavegame[node] = 0; // reset this before just in case
|
||||
|
||||
// Check if a client is saturn before sending ANYTHING!
|
||||
// this way we only send stuff to clients we know can use the gamestate resend
|
||||
@@ -5409,7 +5402,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
// Tell the client we are about to resend them the gamestate
|
||||
netbuffer->packettype = PT_WILLRESENDGAMESTATE;
|
||||
HSendPacket(node, true, 0, 0);
|
||||
resendingsavegame[node] = true;
|
||||
resendingsavegame[node] = 1;
|
||||
}
|
||||
else if (UseVanillaSynch(node))
|
||||
{
|
||||
@@ -5425,10 +5418,13 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
}
|
||||
|
||||
if (cv_blamecfail.value)
|
||||
{
|
||||
CONS_Printf(M_GetText("Synch failure for player %d (%s); expected %hd, got %hd\n"),
|
||||
netconsole+1, player_names[netconsole],
|
||||
consistancy[realstart%TICQUEUE],
|
||||
SHORT(netbuffer->u.clientpak.consistancy));
|
||||
}
|
||||
|
||||
DEBFILE(va("Restoring player %d (synch failure) [%update] %d!=%d\n",
|
||||
netconsole, realstart, consistancy[realstart%TICQUEUE],
|
||||
SHORT(netbuffer->u.clientpak.consistancy)));
|
||||
@@ -5700,7 +5696,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
break;
|
||||
}
|
||||
|
||||
//Update client ping table from the server.
|
||||
// Update client ping table from the server.
|
||||
if (client)
|
||||
{
|
||||
UINT8 i;
|
||||
@@ -5736,7 +5732,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
break;
|
||||
case PT_RECEIVEDGAMESTATE:
|
||||
sendingsavegame[node] = false;
|
||||
resendingsavegame[node] = false;
|
||||
resendingsavegame[node] = 0;
|
||||
savegameresendcooldown[node] = I_GetTime() + cv_resynchcooldown.value * TICRATE; // I_GetTime() + 5 * TICRATE;
|
||||
break;
|
||||
case PT_WILLRESENDGAMESTATE:
|
||||
@@ -6366,10 +6362,35 @@ static void SV_Maketic(void)
|
||||
maketic++;
|
||||
}
|
||||
|
||||
#ifdef SATURNPAK
|
||||
static void SV_UpdateResendGamestateTimeout(void)
|
||||
{
|
||||
for (INT32 i = 0; i < MAXNETNODES; ++i)
|
||||
{
|
||||
if (!resendingsavegame[i])
|
||||
continue;
|
||||
|
||||
resendingsavegame[i]++;
|
||||
|
||||
// Resending savegame took too long
|
||||
if (resendingsavegame[i] > (tic_t)TICRATE*cv_pingtimeout.value)
|
||||
{
|
||||
resendingsavegame[i] = 0;
|
||||
SendKick(i, KICK_MSG_CON_FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
boolean TryRunTics(tic_t realtics)
|
||||
{
|
||||
boolean ticking;
|
||||
|
||||
#ifdef SATURNPAK
|
||||
if (server)
|
||||
SV_UpdateResendGamestateTimeout();
|
||||
#endif
|
||||
|
||||
// the machine has lagged but it is not so bad
|
||||
if (realtics > TICRATE/7) // FIXME: consistency failure!!
|
||||
{
|
||||
@@ -6510,7 +6531,6 @@ static inline void PingUpdate(void)
|
||||
if (pingtimeout[i] > 0)
|
||||
pingtimeout[i]--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//kick lagging players... unless everyone but the server's ping sucks.
|
||||
|
||||
+22
-5
@@ -149,6 +149,8 @@ boolean dedicated = false;
|
||||
|
||||
boolean loaded_config = false; // true once config.cfg loaded AND executed
|
||||
|
||||
static void D_CleanFile(char **filearray);
|
||||
|
||||
//
|
||||
// D_PostEvent
|
||||
// Called by the I/O functions when input is detected
|
||||
@@ -866,9 +868,24 @@ void D_SRB2Loop(void)
|
||||
rendertimefrac_unpaused = FRACUNIT;
|
||||
}
|
||||
|
||||
if ((interp || doDisplay) && !frameskip)
|
||||
if (interp || doDisplay)
|
||||
{
|
||||
ranwipe = D_Display();
|
||||
if (!frameskip)
|
||||
{
|
||||
ranwipe = D_Display();
|
||||
}
|
||||
else if (!dedicated)
|
||||
{
|
||||
// always update console and hud
|
||||
// otherwise it may take minutes to open it
|
||||
CON_Drawer();
|
||||
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
ST_Drawer();
|
||||
HU_Drawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only take screenshots after drawing.
|
||||
@@ -1185,7 +1202,7 @@ void D_AddPostloadFiles(void)
|
||||
postautoloaded = true;
|
||||
}
|
||||
|
||||
void D_CleanFile(char **filearray)
|
||||
static void D_CleanFile(char **filearray)
|
||||
{
|
||||
size_t pnumwadfiles;
|
||||
for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++)
|
||||
@@ -1809,7 +1826,7 @@ void D_SRB2Main(void)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
if (name[5] != '\0')
|
||||
@@ -1839,7 +1856,7 @@ void D_SRB2Main(void)
|
||||
{
|
||||
name = lumpinfo->name;
|
||||
|
||||
if (name[0] == 'M' && name[1] == 'A' && name[2] == 'P') // Ignore the headers
|
||||
if (memcmp(name, "MAP", 3) == 0) // Ignore the headers
|
||||
{
|
||||
INT16 num;
|
||||
if (name[5] != '\0')
|
||||
|
||||
@@ -81,8 +81,6 @@ void D_PostEvent(const event_t *ev);
|
||||
|
||||
void D_ProcessEvents(void);
|
||||
|
||||
void D_CleanFile(char **filearray);
|
||||
|
||||
const char *D_Home(void);
|
||||
|
||||
//
|
||||
|
||||
+7
-2
@@ -2774,7 +2774,7 @@ static void Command_Map_f(void)
|
||||
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
||||
else
|
||||
{
|
||||
if (!mapheaderinfo[newmapnum-1] || mapheaderinfo[newmapnum-1] == NULL)
|
||||
if (!mapheaderinfo[newmapnum-1])
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Invalid mapheaderinfo for Course %s (%s)\n"), realmapname, G_BuildMapName(newmapnum));
|
||||
Z_Free(realmapname);
|
||||
@@ -3028,9 +3028,14 @@ static void Command_ReplayMarker(void)
|
||||
adjustedleveltime = 0;
|
||||
|
||||
char *title = G_BuildMapTitle(gamemap);
|
||||
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", title, G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||
|
||||
if (title)
|
||||
{
|
||||
snprintf(demo.titlename, 64, "%s [%i:%02d/%.5s]", title, G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||
Z_Free(title);
|
||||
}
|
||||
else
|
||||
snprintf(demo.titlename, 64, "[%i:%02d/%.5s]", G_TicsToMinutes(adjustedleveltime, false), G_TicsToSeconds(adjustedleveltime), modeattacking ? "Record Attack" : connectedservername);
|
||||
|
||||
CONS_Printf("Replay will be saved!\n");
|
||||
}
|
||||
|
||||
@@ -1183,6 +1183,18 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
|
||||
if (cv_addons_option.value == 3 && *cv_addons_folder.string != '\0')
|
||||
{
|
||||
// next, check any custom directory if specified
|
||||
homecheck = filesearch(filename, cv_addons_folder.string, wantedmd5sum, completepath, 10);
|
||||
|
||||
if (homecheck == FS_FOUND) // we found the file, so return that we have :)
|
||||
return FS_FOUND;
|
||||
else if (homecheck == FS_MD5SUMBAD) // file has a bad md5; move on and look for a file with the right md5
|
||||
badmd5 = true;
|
||||
// if not found at all, just move on without doing anything
|
||||
}
|
||||
|
||||
// finally check "." directory
|
||||
homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10);
|
||||
|
||||
|
||||
+10
-4
@@ -388,7 +388,7 @@ static void DRPC_GotServerIP(UINT32 address)
|
||||
--------------------------------------------------*/
|
||||
static const char *DRPC_GetServerIP(void)
|
||||
{
|
||||
const char *address;
|
||||
const char *address;
|
||||
|
||||
// If you're connected
|
||||
if (I_GetNodeAddress && (address = I_GetNodeAddress(servernode)) != NULL)
|
||||
@@ -489,7 +489,7 @@ void DRPC_UpdatePresence(void)
|
||||
{
|
||||
#endif
|
||||
discordPresence.state = "Private";
|
||||
#ifdef MASTERSERVER
|
||||
#ifdef MASTERSERVER
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -571,9 +571,15 @@ void DRPC_UpdatePresence(void)
|
||||
{
|
||||
// Map name on tool tip
|
||||
char *title = G_BuildMapTitle(gamemap);
|
||||
snprintf(mapname, 48, "Map: %s", title);
|
||||
if (title)
|
||||
{
|
||||
snprintf(mapname, 48, "Map: %s", title);
|
||||
Z_Free(title);
|
||||
}
|
||||
else
|
||||
snprintf(mapname, 48, "Map: UNKNOWN");
|
||||
|
||||
discordPresence.largeImageText = mapname;
|
||||
Z_Free(title);
|
||||
}
|
||||
|
||||
if (gamestate == GS_LEVEL && Playing())
|
||||
|
||||
+2
-2
@@ -113,8 +113,8 @@ extern char logfilename[1024];
|
||||
#else
|
||||
#define VERSION 1 // Game version
|
||||
#define SUBVERSION 6 // more precise version number
|
||||
#define VERSIONSTRING "Saturn v8.2"
|
||||
#define VERSIONSTRINGW L"Saturn v8.2"
|
||||
#define VERSIONSTRING "Saturn v8.3"
|
||||
#define VERSIONSTRINGW L"Saturn v8.3"
|
||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||
// AND appveyor.yml, for the build bots!
|
||||
|
||||
@@ -540,6 +540,8 @@ static const char *credits[] = {
|
||||
"\"Jin\"",
|
||||
"\"riomccloud\"",
|
||||
"\"chromaticpipe\"",
|
||||
"\"PAS\"",
|
||||
"\"$HOME\"",
|
||||
"\"Achii\"",
|
||||
"\"Anonimus\"",
|
||||
"\"scizor300\"",
|
||||
|
||||
+69
-60
@@ -124,7 +124,7 @@ boolean addedtogame;
|
||||
player_t players[MAXPLAYERS];
|
||||
|
||||
INT32 consoleplayer; // player taking events and displaying
|
||||
INT32 displayplayers[MAXSPLITSCREENPLAYERS]; // view being displayed
|
||||
INT32 displayplayers[MAXSPLITSCREENPLAYERS] = {0}; // view being displayed
|
||||
|
||||
tic_t gametic;
|
||||
tic_t levelstarttic; // gametic at level start
|
||||
@@ -751,47 +751,49 @@ INT32 JoyAxis(axis_input_e axissel, UINT8 player)
|
||||
INT32 axisval;
|
||||
boolean flp = false;
|
||||
|
||||
UINT8 pnum = player-1;
|
||||
|
||||
//find what axis to get
|
||||
switch (axissel)
|
||||
{
|
||||
case AXISTURN:
|
||||
axisval = cv_turnaxis[player-1].value;
|
||||
axisval = cv_turnaxis[pnum].value;
|
||||
break;
|
||||
case AXISMOVE:
|
||||
axisval = cv_moveaxis[player-1].value;
|
||||
axisval = cv_moveaxis[pnum].value;
|
||||
break;
|
||||
case AXISCAMTURN:
|
||||
axisval = cv_camturnaxis[player-1].value;
|
||||
axisval = cv_camturnaxis[pnum].value;
|
||||
break;
|
||||
case AXISCAMSTRAFE:
|
||||
axisval = cv_camstrafeaxis[player-1].value;
|
||||
axisval = cv_camstrafeaxis[pnum].value;
|
||||
break;
|
||||
case AXISBRAKE:
|
||||
axisval = cv_brakeaxis[player-1].value;
|
||||
axisval = cv_brakeaxis[pnum].value;
|
||||
break;
|
||||
case AXISAIM:
|
||||
axisval = cv_aimaxis[player-1].value;
|
||||
axisval = cv_aimaxis[pnum].value;
|
||||
break;
|
||||
case AXISLOOK:
|
||||
axisval = cv_lookaxis[player-1].value;
|
||||
axisval = cv_lookaxis[pnum].value;
|
||||
break;
|
||||
case AXISFIRE:
|
||||
axisval = cv_fireaxis[player-1].value;
|
||||
axisval = cv_fireaxis[pnum].value;
|
||||
break;
|
||||
case AXISDRIFT:
|
||||
axisval = cv_driftaxis[player-1].value;
|
||||
axisval = cv_driftaxis[pnum].value;
|
||||
break;
|
||||
case AXISLOOKBACK:
|
||||
axisval = cv_lookbackaxis[player-1].value;
|
||||
axisval = cv_lookbackaxis[pnum].value;
|
||||
break;
|
||||
case AXISCUSTOM1:
|
||||
axisval = cv_custom1axis[player-1].value;
|
||||
axisval = cv_custom1axis[pnum].value;
|
||||
break;
|
||||
case AXISCUSTOM2:
|
||||
axisval = cv_custom2axis[player-1].value;
|
||||
axisval = cv_custom2axis[pnum].value;
|
||||
break;
|
||||
case AXISCUSTOM3:
|
||||
axisval = cv_custom3axis[player-1].value;
|
||||
axisval = cv_custom3axis[pnum].value;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
@@ -802,44 +804,51 @@ INT32 JoyAxis(axis_input_e axissel, UINT8 player)
|
||||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
if (axisval%2)
|
||||
if (axisval % 2)
|
||||
{
|
||||
axisval /= 2;
|
||||
retaxis = joyxmove[axisval];
|
||||
retaxis = joyxmove[pnum][axisval];
|
||||
|
||||
if (retaxis < (-JOYAXISRANGE))
|
||||
retaxis = -JOYAXISRANGE;
|
||||
if (retaxis > (+JOYAXISRANGE))
|
||||
retaxis = +JOYAXISRANGE;
|
||||
if (!Joystick[player-1].bGamepadStyle && axissel < AXISDEAD)
|
||||
if (!Joystick[pnum].bGamepadStyle && axissel < AXISDEAD)
|
||||
{
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_xdeadzone[player-1].value) >> FRACBITS;
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_xdeadzone[pnum].value) >> FRACBITS;
|
||||
if (abs(retaxis) <= jdeadzone)
|
||||
return 0;
|
||||
}
|
||||
if (flp) retaxis = -retaxis; //flip it around
|
||||
|
||||
if (flp)
|
||||
retaxis = -retaxis; // flip it around
|
||||
|
||||
return retaxis;
|
||||
}
|
||||
else
|
||||
{
|
||||
axisval--;
|
||||
axisval /= 2;
|
||||
retaxis = joyymove[axisval];
|
||||
retaxis = joyymove[pnum][axisval];
|
||||
|
||||
if (retaxis < (-JOYAXISRANGE))
|
||||
retaxis = -JOYAXISRANGE;
|
||||
if (retaxis > (+JOYAXISRANGE))
|
||||
retaxis = +JOYAXISRANGE;
|
||||
if (!Joystick[player-1].bGamepadStyle && axissel < AXISDEAD)
|
||||
if (!Joystick[pnum].bGamepadStyle && axissel < AXISDEAD)
|
||||
{
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_ydeadzone[player-1].value) >> FRACBITS;
|
||||
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_ydeadzone[pnum].value) >> FRACBITS;
|
||||
if (abs(retaxis) <= jdeadzone)
|
||||
return 0;
|
||||
}
|
||||
if (flp) retaxis = -retaxis; //flip it around
|
||||
|
||||
if (flp)
|
||||
retaxis = -retaxis; // flip it around
|
||||
|
||||
return retaxis;
|
||||
}
|
||||
}
|
||||
@@ -1286,15 +1295,9 @@ static void G_DoLoadLevel(boolean resetplayer)
|
||||
}
|
||||
|
||||
// clear cmd building stuff
|
||||
memset(gamekeydown, 0, sizeof (gamekeydown));
|
||||
|
||||
for (i = 0; i < JOYAXISSET; i++)
|
||||
{
|
||||
joyxmove[i] = joyymove[i] = 0;
|
||||
joy2xmove[i] = joy2ymove[i] = 0;
|
||||
joy3xmove[i] = joy3ymove[i] = 0;
|
||||
joy4xmove[i] = joy4ymove[i] = 0;
|
||||
}
|
||||
memset(gamekeydown, 0, sizeof(gamekeydown));
|
||||
memset(joyxmove, 0, sizeof(joyxmove));
|
||||
memset(joyymove, 0, sizeof(joyymove));
|
||||
mousex = mousey = 0;
|
||||
|
||||
// clear hud messages remains (usually from game startup)
|
||||
@@ -3998,7 +4001,6 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char *G_BuildMapTitle(INT32 mapnum)
|
||||
{
|
||||
char *title = NULL;
|
||||
@@ -5465,33 +5467,36 @@ void G_GhostTicker(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (type == MT_GHOST)
|
||||
if (type != -1)
|
||||
{
|
||||
mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us
|
||||
mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<<FF_TRANSSHIFT; // P_SpawnGhostMobj sets trans50, we want trans60
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj = P_SpawnMobj(g->mo->x, g->mo->y, g->mo->z - FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK);
|
||||
mobj->sprite = states[mobjinfo[type].spawnstate].sprite;
|
||||
mobj->frame = (states[mobjinfo[type].spawnstate].frame & FF_FRAMEMASK) | tr_trans60<<FF_TRANSSHIFT;
|
||||
mobj->tics = -1; // nope.
|
||||
mobj->color = g->mo->color;
|
||||
if (g->mo->eflags & MFE_VERTICALFLIP)
|
||||
if (type == MT_GHOST)
|
||||
{
|
||||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us
|
||||
mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<<FF_TRANSSHIFT; // P_SpawnGhostMobj sets trans50, we want trans60
|
||||
}
|
||||
P_SetScale(mobj, g->mo->scale);
|
||||
mobj->destscale = g->mo->scale;
|
||||
else
|
||||
{
|
||||
mobj = P_SpawnMobj(g->mo->x, g->mo->y, g->mo->z - FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK);
|
||||
mobj->sprite = states[mobjinfo[type].spawnstate].sprite;
|
||||
mobj->frame = (states[mobjinfo[type].spawnstate].frame & FF_FRAMEMASK) | tr_trans60<<FF_TRANSSHIFT;
|
||||
mobj->tics = -1; // nope.
|
||||
mobj->color = g->mo->color;
|
||||
if (g->mo->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
P_SetScale(mobj, g->mo->scale);
|
||||
mobj->destscale = g->mo->scale;
|
||||
}
|
||||
mobj->floorz = mobj->z;
|
||||
mobj->ceilingz = mobj->z+mobj->height;
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up...
|
||||
P_SetThingPosition(mobj);
|
||||
mobj->fuse = 8;
|
||||
P_SetTarget(&mobj->target, g->mo);
|
||||
}
|
||||
mobj->floorz = mobj->z;
|
||||
mobj->ceilingz = mobj->z+mobj->height;
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; // make an ATTEMPT to curb crazy SOCs fucking stuff up...
|
||||
P_SetThingPosition(mobj);
|
||||
mobj->fuse = 8;
|
||||
P_SetTarget(&mobj->target, g->mo);
|
||||
}
|
||||
if (ziptic & EZT_HIT)
|
||||
{ // Spawn hit poofs for killing things!
|
||||
@@ -6068,15 +6073,19 @@ void G_BeginRecording(void)
|
||||
char *title = G_BuildMapTitle(gamemap);
|
||||
|
||||
// Print to a separate temp buffer instead of demo.titlename, so we can use it in M_TextInputSetString
|
||||
snprintf(demotitlename, 64, "%s - %s", title, modeattacking ? "Time Attack" : connectedservername);
|
||||
if (title)
|
||||
{
|
||||
snprintf(demotitlename, 64, "%s - %s", title, modeattacking ? "Time Attack" : connectedservername);
|
||||
Z_Free(title);
|
||||
}
|
||||
else
|
||||
snprintf(demotitlename, 64, "%s", modeattacking ? "Time Attack" : connectedservername);
|
||||
|
||||
// Init just in case it isn't initialized already
|
||||
M_TextInputInit(&demo.titlenameinput, demo.titlename, sizeof(demo.titlename));
|
||||
|
||||
// This will indirectly assign to demo.titlename too
|
||||
M_TextInputSetString(&demo.titlenameinput, demotitlename);
|
||||
|
||||
Z_Free(title);
|
||||
}
|
||||
|
||||
// demo checksum
|
||||
@@ -8140,7 +8149,7 @@ void G_SaveDemo(void)
|
||||
size_t i, strindex = 0;
|
||||
boolean dash = true;
|
||||
|
||||
for (i = 0; i < 127 && demo.titlename[i]; i++)
|
||||
for (i = 0; demo.titlename[i] && i < 127; i++)
|
||||
{
|
||||
if ((demo.titlename[i] >= 'a' && demo.titlename[i] <= 'z') ||
|
||||
(demo.titlename[i] >= '0' && demo.titlename[i] <= '9'))
|
||||
|
||||
+10
-20
@@ -114,8 +114,7 @@ INT32 mousex, mousey;
|
||||
INT32 mlooky; // like mousey but with a custom sensitivity for mlook
|
||||
|
||||
// joystick values are repeated
|
||||
INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
||||
|
||||
// current state of the keys: true if pushed
|
||||
UINT8 gamekeydown[NUMINPUTS];
|
||||
@@ -187,32 +186,32 @@ void G_MapEventsToControls(event_t *ev)
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET || menuactive || CON_Ready() || chat_on)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[0][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[0][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick2: // buttons are virtual keys
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET || menuactive)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy2xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy2ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[1][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[1][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick3:
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy3xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy3ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[2][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[2][i] = ev->data3;
|
||||
break;
|
||||
|
||||
case ev_joystick4:
|
||||
i = ev->data1;
|
||||
if (i >= JOYAXISSET)
|
||||
break;
|
||||
if (ev->data2 != INT32_MAX) joy4xmove[i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joy4ymove[i] = ev->data3;
|
||||
if (ev->data2 != INT32_MAX) joyxmove[3][i] = ev->data2;
|
||||
if (ev->data3 != INT32_MAX) joyymove[3][i] = ev->data3;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -258,15 +257,6 @@ void G_ResetControls(void)
|
||||
memset(joyxmove, 0, sizeof(joyxmove));
|
||||
memset(joyymove, 0, sizeof(joyymove));
|
||||
|
||||
memset(joy2xmove, 0, sizeof(joy2xmove));
|
||||
memset(joy2ymove, 0, sizeof(joy2ymove));
|
||||
|
||||
memset(joy3xmove, 0, sizeof(joy3xmove));
|
||||
memset(joy3ymove, 0, sizeof(joy3ymove));
|
||||
|
||||
memset(joy4xmove, 0, sizeof(joy4xmove));
|
||||
memset(joy4ymove, 0, sizeof(joy4ymove));
|
||||
|
||||
// reset those just in case the game missed the keyup event
|
||||
memset(dpadscrollstate, false, sizeof(dpadscrollstate));
|
||||
}
|
||||
@@ -1030,7 +1020,7 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
||||
if (!keystr[0])
|
||||
return 0;
|
||||
|
||||
if (!keystr[0] || (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z'))
|
||||
if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z')
|
||||
return keystr[0];
|
||||
|
||||
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')
|
||||
|
||||
+8
-5
@@ -41,10 +41,12 @@ typedef enum
|
||||
KEY_DBLJOY1 = KEY_DBLMOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBLHAT1 = KEY_DBLJOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_2JOY1 = KEY_DBLHAT1 + MOUSEBUTTONS,
|
||||
KEY_2MOUSE1 = KEY_DBLHAT1 + JOYHATS*4,
|
||||
KEY_2JOY1 = KEY_2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_2HAT1 = KEY_2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_DBL2JOY1 = KEY_2HAT1 + MOUSEBUTTONS,
|
||||
KEY_DBL2MOUSE1 = KEY_2HAT1 + JOYHATS*4,
|
||||
KEY_DBL2JOY1 = KEY_DBL2MOUSE1 + MOUSEBUTTONS,
|
||||
KEY_DBL2HAT1 = KEY_DBL2JOY1 + JOYBUTTONS,
|
||||
|
||||
KEY_3JOY1 = KEY_DBL2HAT1 + JOYHATS*4,
|
||||
@@ -61,8 +63,10 @@ typedef enum
|
||||
|
||||
KEY_MOUSEWHEELUP = KEY_DBL4HAT1 + JOYHATS*4,
|
||||
KEY_MOUSEWHEELDOWN = KEY_MOUSEWHEELUP + 1,
|
||||
KEY_2MOUSEWHEELUP = KEY_MOUSEWHEELDOWN + 1,
|
||||
KEY_2MOUSEWHEELDOWN = KEY_2MOUSEWHEELUP + 1,
|
||||
|
||||
NUMINPUTS = KEY_MOUSEWHEELDOWN + 1,
|
||||
NUMINPUTS = KEY_2MOUSEWHEELDOWN + 1, // FIXME: all the mouse 2 stuff should be removed, but it screws up mappings somehow
|
||||
} key_input_e;
|
||||
|
||||
typedef enum
|
||||
@@ -113,8 +117,7 @@ extern consvar_t cv_gamepadled[MAXSPLITSCREENPLAYERS];
|
||||
extern INT32 mousex, mousey;
|
||||
extern INT32 mlooky; //mousey with mlookSensitivity
|
||||
|
||||
extern INT32 joyxmove[JOYAXISSET], joyymove[JOYAXISSET], joy2xmove[JOYAXISSET], joy2ymove[JOYAXISSET],
|
||||
joy3xmove[JOYAXISSET], joy3ymove[JOYAXISSET], joy4xmove[JOYAXISSET], joy4ymove[JOYAXISSET];
|
||||
extern INT32 joyxmove[MAXSPLITSCREENPLAYERS][JOYAXISSET], joyymove[MAXSPLITSCREENPLAYERS][JOYAXISSET];
|
||||
|
||||
// current state of the keys: true if pushed
|
||||
extern UINT8 gamekeydown[NUMINPUTS];
|
||||
|
||||
@@ -124,7 +124,7 @@ void HWR_ProcessPolygon(FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPt
|
||||
polygonArray[polygonArraySize].numVerts = iNumPts;
|
||||
polygonArray[polygonArraySize].polyFlags = PolyFlags;
|
||||
polygonArray[polygonArraySize].texture = current_texture;
|
||||
polygonArray[polygonArraySize].shader = (shader_target != -1) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||
polygonArray[polygonArraySize].shader = (shader_target != SHADER_NONE) ? HWR_GetShaderFromTarget(shader_target) : shader_target;
|
||||
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
|
||||
polygonArraySize++;
|
||||
|
||||
|
||||
+14
-9
@@ -46,12 +46,16 @@ RGBA_t *HWR_GetTexturePalette(void)
|
||||
|
||||
static INT32 format2bpp(GLTextureFormat_t format)
|
||||
{
|
||||
if (format == GL_TEXFMT_RGBA)
|
||||
return 4;
|
||||
else if (format == GL_TEXFMT_ALPHA_INTENSITY_88 || format == GL_TEXFMT_AP_88)
|
||||
return 2;
|
||||
else
|
||||
return 1;
|
||||
switch (format)
|
||||
{
|
||||
case GL_TEXFMT_RGBA:
|
||||
return 4;
|
||||
case GL_TEXFMT_ALPHA_INTENSITY_88:
|
||||
case GL_TEXFMT_AP_88:
|
||||
return 2;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// This code was originally placed directly in HWR_DrawPatchInCache.
|
||||
@@ -221,8 +225,6 @@ static void HWR_DrawTexturePatchInCache(GLMipmap_t *mipmap,
|
||||
if (texture->width <= 0 || texture->height <= 0)
|
||||
return;
|
||||
|
||||
palette = HWR_GetTexturePalette();
|
||||
|
||||
x1 = patch->originx;
|
||||
width = SHORT(realpatch->width);
|
||||
height = SHORT(realpatch->height);
|
||||
@@ -234,6 +236,8 @@ static void HWR_DrawTexturePatchInCache(GLMipmap_t *mipmap,
|
||||
if (patch->originy > texture->height || (patch->originy + height) < 0)
|
||||
return; // patch not located within texture's y bounds, ignore
|
||||
|
||||
palette = HWR_GetTexturePalette();
|
||||
|
||||
// patch is actually inside the texture!
|
||||
// now check if texture is partly off-screen and adjust accordingly
|
||||
|
||||
@@ -323,7 +327,6 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
||||
boolean skyspecial = false; // poor hack for Legacy large skies..
|
||||
|
||||
RGBA_t *palette;
|
||||
palette = HWR_GetTexturePalette();
|
||||
|
||||
texture = textures[texnum];
|
||||
|
||||
@@ -361,6 +364,8 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *gltex, boolean noe
|
||||
INT32 j;
|
||||
RGBA_t col;
|
||||
|
||||
palette = HWR_GetTexturePalette();
|
||||
|
||||
col = palette[HWR_CHROMAKEY_EQUIVALENTCOLORINDEX];
|
||||
|
||||
for (idx = 0, j = 0; j < blockheight; j++)
|
||||
|
||||
@@ -318,8 +318,6 @@ enum hwdsetspecialstate
|
||||
HWD_SET_TEXTUREFILTERMODE,
|
||||
HWD_SET_TEXTUREANISOTROPICMODE,
|
||||
|
||||
HWD_SET_WIREFRAME,
|
||||
|
||||
HWD_SET_MSAA,
|
||||
|
||||
HWD_SET_SCREEN_TEXTURES,
|
||||
|
||||
+14
-21
@@ -226,8 +226,6 @@ consvar_t cv_glsolvetjoin = {"gr_solvetjoin", "On", 0, CV_OnOff, NULL, 0, NULL,
|
||||
|
||||
consvar_t cv_glbatching = {"gr_batching", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_glwireframe = {"gr_wireframe", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_glrenderdistance = {"gr_renderdistance", "Max", CV_SAVE, glrenderdistance_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_glhorizonlines = {"gr_horizonlines", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -340,12 +338,6 @@ static void HWR_SetShaderState(void)
|
||||
GL_SetSpecialState(HWD_SET_SHADERS, HWR_UseShader() ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
static boolean HWR_IsWireframeMode(void)
|
||||
{
|
||||
return (cv_glwireframe.value /*&& cv_debug*/);
|
||||
}
|
||||
|
||||
static boolean HWR_OverrideObjectLightLevel(mobj_t *thing, INT32 *lightlevel)
|
||||
{
|
||||
if (R_ThingIsFullBright(thing))
|
||||
@@ -3715,6 +3707,9 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
@@ -4002,6 +3997,9 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
|
||||
blend = HWR_GetBlendModeFlag(blendmode)|PF_Occlude;
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
if (HWR_UseShader())
|
||||
{
|
||||
shader = SHADER_SPRITE;
|
||||
@@ -4466,7 +4464,10 @@ static void HWR_DrawModels(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
if (!spr->mobj)
|
||||
continue;
|
||||
|
||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||
{
|
||||
md2_t *md2;
|
||||
|
||||
@@ -5267,9 +5268,6 @@ static void HWR_DrawSkyBackground(void)
|
||||
if (drewsky)
|
||||
return;
|
||||
|
||||
if (HWR_IsWireframeMode())
|
||||
return;
|
||||
|
||||
GL_SetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
||||
|
||||
memcpy(&dometransform, &atransform, sizeof(FTransform));
|
||||
@@ -5472,8 +5470,8 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl
|
||||
HWR_PortalClipping(rootportal);
|
||||
}
|
||||
|
||||
if (HWR_IsWireframeMode())
|
||||
GL_SetSpecialState(HWD_SET_WIREFRAME, 1);
|
||||
// Set transform.
|
||||
GL_SetTransform(&atransform);
|
||||
|
||||
ps_numbspcalls.value.i = 0;
|
||||
ps_numpolyobjects.value.i = 0;
|
||||
@@ -5538,9 +5536,6 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, const float fpov, player_t *pl
|
||||
ps_hw_nodedrawtime.value.p = 0;
|
||||
HWR_RenderDrawNodes();
|
||||
|
||||
if (HWR_IsWireframeMode())
|
||||
GL_SetSpecialState(HWD_SET_WIREFRAME, 0);
|
||||
|
||||
HWR_FreePortalList(portallist);
|
||||
}
|
||||
|
||||
@@ -5764,7 +5759,7 @@ static void HWR_TogglePaletteRendering(void)
|
||||
// If the r_opengl "texture palette" stays the same during this switch, these textures
|
||||
// will not be cleared out. However they are still out of date since the
|
||||
// composite texture blending method has changed. Therefore they need to be cleared.
|
||||
GL_ClearMipMapCache();
|
||||
HWR_LoadMapTextures(numtextures);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -5778,7 +5773,7 @@ static void HWR_TogglePaletteRendering(void)
|
||||
// If the r_opengl "texture palette" stays the same during this switch, these textures
|
||||
// will not be cleared out. However they are still out of date since the
|
||||
// composite texture blending method has changed. Therefore they need to be cleared.
|
||||
GL_ClearMipMapCache();
|
||||
HWR_LoadMapTextures(numtextures);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5815,8 +5810,6 @@ void HWR_AddCommands(void)
|
||||
|
||||
CV_RegisterVar(&cv_glbatching);
|
||||
|
||||
CV_RegisterVar(&cv_glwireframe);
|
||||
|
||||
CV_RegisterVar(&cv_glrenderdistance);
|
||||
|
||||
CV_RegisterVar(&cv_glhorizonlines);
|
||||
|
||||
@@ -202,8 +202,6 @@ extern consvar_t cv_glsolvetjoin;
|
||||
|
||||
extern consvar_t cv_glbatching;
|
||||
|
||||
extern consvar_t cv_glwireframe;
|
||||
|
||||
extern consvar_t cv_glrenderdistance;
|
||||
|
||||
extern consvar_t cv_glhorizonlines;
|
||||
@@ -225,7 +223,7 @@ FUNCINLINE static ATTRINLINE boolean HWR_ShouldUsePaletteRendering(void)
|
||||
|
||||
FUNCINLINE static ATTRINLINE boolean HWR_PalRenderFlashpal(void)
|
||||
{
|
||||
return (HWR_ShouldUsePaletteRendering() && cv_glflashpal.value);
|
||||
return (cv_glflashpal.value && HWR_ShouldUsePaletteRendering());
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1227,6 +1227,9 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
Surf.PolyFlags = HWR_GetBlendModeFlag(blendmode);
|
||||
}
|
||||
|
||||
if (cv_playerfade.value && spr->mobj->player)
|
||||
Surf.PolyColor.s.alpha = FixedMul(R_DoPlayerFade(spr->mobj), Surf.PolyColor.s.alpha);
|
||||
|
||||
// dont forget to enabled the depth test because we can't do this like
|
||||
// before: polygons models are not sorted
|
||||
|
||||
@@ -1241,7 +1244,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
else
|
||||
{
|
||||
md2s = md2_playermodels;
|
||||
skinnum = (skin_t *)spr->mobj->localskin - skins;
|
||||
skinnum = (skin_t *)spr->mobj->localskin - skins;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1266,6 +1269,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
|
||||
if (md2->error)
|
||||
return; // we already failed loading this before :(
|
||||
|
||||
if (!md2->model)
|
||||
{
|
||||
CONS_Debug(DBG_RENDER, "Loading model... (%s, %s)", sprnames[spr->mobj->sprite], md2->filename);
|
||||
@@ -1284,6 +1288,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//Hurdler: arf, I don't like that implementation at all... too much crappy
|
||||
gpatch = md2->glpatch;
|
||||
if (gpatch)
|
||||
|
||||
@@ -350,8 +350,6 @@ typedef void (APIENTRY * PFNglDisable) (GLenum cap);
|
||||
static PFNglDisable pglDisable;
|
||||
typedef void (APIENTRY * PFNglGetFloatv) (GLenum pname, GLfloat *params);
|
||||
static PFNglGetFloatv pglGetFloatv;
|
||||
typedef void (APIENTRY * PFNglPolygonMode) (GLenum, GLenum);
|
||||
static PFNglPolygonMode pglPolygonMode;
|
||||
|
||||
/* Depth Buffer */
|
||||
typedef void (APIENTRY * PFNglClearDepth) (GLclampd depth);
|
||||
@@ -551,7 +549,6 @@ boolean SetupGLfunc(void)
|
||||
GETOPENGLFUNC(pglGetFloatv, glGetFloatv)
|
||||
GETOPENGLFUNC(pglGetIntegerv, glGetIntegerv)
|
||||
GETOPENGLFUNC(pglGetString, glGetString)
|
||||
GETOPENGLFUNC(pglPolygonMode, glPolygonMode)
|
||||
|
||||
GETOPENGLFUNC(pglClearDepth, glClearDepth)
|
||||
GETOPENGLFUNC(pglDepthFunc, glDepthFunc)
|
||||
@@ -2367,10 +2364,6 @@ void GL_SetSpecialState(hwdspecialstate_t IdState, INT32 Value)
|
||||
GL_Flush(); //??? if we want to change filter mode by texture, remove this
|
||||
break;
|
||||
|
||||
case HWD_SET_WIREFRAME:
|
||||
pglPolygonMode(GL_FRONT_AND_BACK, Value ? GL_LINE : GL_FILL);
|
||||
break;
|
||||
|
||||
case HWD_SET_TEXTURE_FORMAT:
|
||||
gltexformat = (Value == 32) ? GL_RGBA : GL_RGB5_A1;
|
||||
GL_Flush();
|
||||
|
||||
+4
-4
@@ -220,9 +220,9 @@ HMS_connect (const char *format, ...)
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
||||
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, cv_masterserver_timeout.value);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)cv_masterserver_timeout.value);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, buffer);
|
||||
|
||||
@@ -339,8 +339,8 @@ HMS_unlist (void)
|
||||
if (! hms)
|
||||
return 0;
|
||||
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, 1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, 0);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POST, (long)1);
|
||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, (long)0);
|
||||
|
||||
okay = HMS_do(hms);
|
||||
HMS_end(hms);
|
||||
|
||||
+6
-8
@@ -311,7 +311,7 @@ void HU_LoadGraphics(void)
|
||||
lt_font[0] = (patch_t *)W_CachePatchName("LTFNT039", PU_HUDGFX); /// \note fake start hack
|
||||
|
||||
// Number support
|
||||
lt_font[9] = (patch_t *)W_CachePatchName("LTFNT048", PU_HUDGFX);
|
||||
lt_font[9] = (patch_t *)W_CachePatchName("LTFNT048", PU_HUDGFX);
|
||||
lt_font[10] = (patch_t *)W_CachePatchName("LTFNT049", PU_HUDGFX);
|
||||
lt_font[11] = (patch_t *)W_CachePatchName("LTFNT050", PU_HUDGFX);
|
||||
lt_font[12] = (patch_t *)W_CachePatchName("LTFNT051", PU_HUDGFX);
|
||||
@@ -748,7 +748,7 @@ static void Command_CSay_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!server && !IsPlayerAdmin(consoleplayer))
|
||||
if (!server && !IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Only servers and admins can use csay.\n"));
|
||||
return;
|
||||
@@ -2789,13 +2789,11 @@ void HU_DoCEcho(const char *msg)
|
||||
*p = '\n';
|
||||
|
||||
CONS_Printf("%s\n", temp);
|
||||
|
||||
return;
|
||||
}
|
||||
else if (cv_cechotoggle.value)
|
||||
cechotimer = cechoduration;
|
||||
|
||||
I_OutputMsg("%s\n", msg); // print to log
|
||||
|
||||
if (!cv_cechotoggle.value)
|
||||
return;
|
||||
|
||||
cechotimer = cechoduration;
|
||||
I_OutputMsg("%s\n", msg); // ALWAYS print to log
|
||||
}
|
||||
@@ -141,6 +141,8 @@ boolean I_UseNativeKeyboard(void);
|
||||
|
||||
boolean I_CheckNativeRes(void);
|
||||
|
||||
void I_SetBorderlessWindow(void);
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
|
||||
void RefreshOGLSDLSurface(void);
|
||||
|
||||
+3
-2
@@ -10525,11 +10525,12 @@ static void K_drawKartWanted(void)
|
||||
{
|
||||
INT32 x = basex+(splitscreen > 1 ? 13 : 8), y = basey+(splitscreen > 1 ? 16 : 21);
|
||||
fixed_t scale = FRACUNIT/2;
|
||||
player_t *p = &players[battlewanted[i]];
|
||||
|
||||
if (battlewanted[i] == -1)
|
||||
break;
|
||||
|
||||
player_t *p = &players[battlewanted[i]];
|
||||
|
||||
if (numwanted == 1)
|
||||
scale = FRACUNIT;
|
||||
else
|
||||
@@ -10540,7 +10541,7 @@ static void K_drawKartWanted(void)
|
||||
y += 16;
|
||||
}
|
||||
|
||||
if (players[battlewanted[i]].skincolor)
|
||||
if (p->skincolor)
|
||||
{
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE);
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, V_HUDTRANS|(splitscreen < 3 ? V_SNAPTORIGHT : 0)|V_SNAPTOBOTTOM, (scale == FRACUNIT ? R_GetSkinFaceWant(p) : R_GetSkinFaceRank(p)), colormap);
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
X (PlayerQuit),\
|
||||
X (PlayerThink),/* P_PlayerThink */\
|
||||
X (MusicChange),\
|
||||
X (MusicCredit),\
|
||||
X (ShouldSpin),/*SRB2KART*/\
|
||||
X (ShouldExplode),/*SRB2KART*/\
|
||||
X (ShouldSquish),/*SRB2KART*/\
|
||||
@@ -131,7 +130,6 @@ int LUA_HookPlayerCanDamage(player_t *, mobj_t *);
|
||||
void LUA_HookPlayerQuit(player_t *, int);
|
||||
int LUA_HookPlayerCmd(player_t *, ticcmd_t *);
|
||||
int LUA_HookMusicChange(const char *oldname, struct MusicChange *);
|
||||
int LUA_HookMusicCredit(musicdef_t *musicdef);
|
||||
|
||||
int LUA_HookShouldSpin(player_t *player, mobj_t *inflictor, mobj_t *source); // SRB2KART: Should player be spun out?
|
||||
int LUA_HookShouldExplode(player_t *player, mobj_t *inflictor, mobj_t *source); // SRB2KART: Should player be exploded?
|
||||
|
||||
@@ -1065,18 +1065,6 @@ int LUA_HookMusicChange(const char *oldname, struct MusicChange *param)
|
||||
return hook.status;
|
||||
}
|
||||
|
||||
int LUA_HookMusicCredit(musicdef_t *musicdef)
|
||||
{
|
||||
Hook_State hook;
|
||||
if (prepare_hook(&hook, 0, HOOK(MusicCredit)))
|
||||
{
|
||||
LUA_PushUserdata(gL, musicdef, META_MUSICDEF);
|
||||
call_hooks(&hook, 1, res_true);
|
||||
}
|
||||
|
||||
return hook.status;
|
||||
}
|
||||
|
||||
static int kartdamage_hook
|
||||
(
|
||||
player_t *player,
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "dehacked.h"
|
||||
#include "p_mobj.h"
|
||||
#include "p_local.h"
|
||||
#include "s_sound.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
#include "lua_script.h"
|
||||
@@ -1073,109 +1072,6 @@ static int sfxinfo_num(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
enum musicdef_e {
|
||||
musicdef_name = 0,
|
||||
musicdef_usage,
|
||||
musicdef_source,
|
||||
musicdef_filename,
|
||||
musicdef_title,
|
||||
musicdef_alttitle,
|
||||
musicdef_authors,
|
||||
};
|
||||
|
||||
const char *const musicdef_opt[] = {
|
||||
"name",
|
||||
"usage",
|
||||
"source",
|
||||
"filename",
|
||||
"title",
|
||||
"alttitle",
|
||||
"authors",
|
||||
NULL
|
||||
};
|
||||
|
||||
static int musicdef_fields_ref = LUA_NOREF;
|
||||
|
||||
static int lib_sFindMusicCredit(lua_State *L)
|
||||
{
|
||||
const char *name = luaL_checkstring(L, 1);
|
||||
LUA_PushUserdata(L, S_FindMusicCredit(name), META_MUSICDEF);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_getMusicDef(lua_State *L)
|
||||
{
|
||||
musicdef_t *def = NULL;
|
||||
|
||||
if (lua_isnumber(L, 2))
|
||||
def = S_GetMusicCredit(lua_tonumber(L, 2));
|
||||
else if (lua_isstring(L, 2))
|
||||
def = S_FindMusicCredit(lua_tostring(L, 2));
|
||||
else
|
||||
return luaL_error(L, "musicdefs index must be number or string (got %s)", luaL_typename(L, 2));
|
||||
|
||||
LUA_PushUserdata(L, def, META_MUSICDEF);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_setMusicDef(lua_State *L)
|
||||
{
|
||||
return luaL_error(L, "musicdefs is read only");
|
||||
}
|
||||
|
||||
static int lib_musicdefslen(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, nummusicdefs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int musicdef_get(lua_State *L)
|
||||
{
|
||||
musicdef_t *musicdef = *((musicdef_t **)luaL_checkudata(L, 1, META_MUSICDEF));
|
||||
enum musicdef_e field = Lua_optoption(L, 2, -1, musicdef_fields_ref);
|
||||
|
||||
I_Assert(musicdef != NULL);
|
||||
|
||||
switch (field)
|
||||
{
|
||||
case musicdef_name:
|
||||
lua_pushstring(L, musicdef->name);
|
||||
return 1;
|
||||
case musicdef_usage:
|
||||
lua_pushstring(L, musicdef->usage);
|
||||
return 1;
|
||||
case musicdef_source:
|
||||
lua_pushstring(L, musicdef->source);
|
||||
return 1;
|
||||
case musicdef_filename:
|
||||
lua_pushstring(L, musicdef->filename);
|
||||
return 1;
|
||||
case musicdef_title:
|
||||
lua_pushstring(L, musicdef->title);
|
||||
return 1;
|
||||
case musicdef_alttitle:
|
||||
lua_pushstring(L, musicdef->alttitle);
|
||||
return 1;
|
||||
case musicdef_authors:
|
||||
lua_pushstring(L, musicdef->authors);
|
||||
return 1;
|
||||
default:
|
||||
return luaL_error(L, LUA_QL("musicdef_t") " has no field named " LUA_QS, lua_tostring(L, 2));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int musicdef_num(lua_State *L)
|
||||
{
|
||||
musicdef_t *musicdef = *((musicdef_t **)luaL_checkudata(L, 1, META_MUSICDEF));
|
||||
|
||||
I_Assert(musicdef != NULL);
|
||||
|
||||
lua_pushinteger(L, musicdef->num);
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//
|
||||
// Now push all these functions into the Lua state!
|
||||
@@ -1230,18 +1126,6 @@ int LUA_InfoLib(lua_State *L)
|
||||
|
||||
sfxinfo_fields_ref = Lua_CreateFieldTable(L, sfxinfo_opt);
|
||||
|
||||
luaL_newmetatable(L, META_MUSICDEF);
|
||||
lua_pushcfunction(L, musicdef_get);
|
||||
lua_setfield(L, -2, "__index");
|
||||
|
||||
lua_pushcfunction(L, musicdef_num);
|
||||
lua_setfield(L, -2, "__len");
|
||||
lua_pop(L, 1);
|
||||
|
||||
musicdef_fields_ref = Lua_CreateFieldTable(L, musicdef_opt);
|
||||
|
||||
lua_register(L, "S_FindMusicCredit", lib_sFindMusicCredit);
|
||||
|
||||
lua_newuserdata(L, 0);
|
||||
lua_createtable(L, 0, 2);
|
||||
lua_pushcfunction(L, lib_getSprname);
|
||||
@@ -1292,19 +1176,5 @@ int LUA_InfoLib(lua_State *L)
|
||||
lua_pushvalue(L, -1);
|
||||
lua_setglobal(L, "S_sfx");
|
||||
lua_setglobal(L, "sfxinfo");
|
||||
|
||||
lua_newuserdata(L, 0);
|
||||
lua_createtable(L, 0, 2);
|
||||
lua_pushcfunction(L, lib_getMusicDef);
|
||||
lua_setfield(L, -2, "__index");
|
||||
|
||||
lua_pushcfunction(L, lib_setMusicDef);
|
||||
lua_setfield(L, -2, "__newindex");
|
||||
|
||||
lua_pushcfunction(L, lib_musicdefslen);
|
||||
lua_setfield(L, -2, "__len");
|
||||
lua_setmetatable(L, -2);
|
||||
lua_setglobal(L, "musicdefs");
|
||||
|
||||
return 0;
|
||||
}
|
||||
+1
-5
@@ -10,9 +10,6 @@
|
||||
/// \file lua_libs.h
|
||||
/// \brief libraries for Lua scripting
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "blua/lua.h"
|
||||
|
||||
extern lua_State *gL;
|
||||
|
||||
#define LREG_VALID "VALID_USERDATA"
|
||||
@@ -23,7 +20,6 @@ extern lua_State *gL;
|
||||
#define META_STATE "STATE_T*"
|
||||
#define META_MOBJINFO "MOBJINFO_T*"
|
||||
#define META_SFXINFO "SFXINFO_T*"
|
||||
#define META_MUSICDEF "MUSICDEF_T*"
|
||||
|
||||
#define META_MOBJ "MOBJ_T*"
|
||||
#define META_MAPTHING "MAPTHING_T*"
|
||||
@@ -72,4 +68,4 @@ int LUA_SkinLib(lua_State *L);
|
||||
int LUA_ThinkerLib(lua_State *L);
|
||||
int LUA_MapLib(lua_State *L);
|
||||
int LUA_BlockmapLib(lua_State *L);
|
||||
int LUA_HudLib(lua_State *L);
|
||||
int LUA_HudLib(lua_State *L);
|
||||
+98
-63
@@ -1521,6 +1521,7 @@ enum
|
||||
//op_exp_dirlight,
|
||||
op_exp_skybox,
|
||||
op_exp_accuratefps,
|
||||
op_exp_votescrn,
|
||||
#ifdef HWRENDER
|
||||
op_exp_glscrtx,
|
||||
#ifdef USE_FBO_OGL
|
||||
@@ -2464,32 +2465,38 @@ static menuitem_t OP_HudOffsetMenu[] =
|
||||
{IT_STRING | IT_CVAR, NULL, "Vertical Offset", &cv_stat_yoffset, 185},
|
||||
};
|
||||
|
||||
// FIXME: WE EFFECTIVELY HAVE NO MORE SPACE FOR GREEN RES
|
||||
// i had to put multiple names into single lines at this point
|
||||
// we ought to really do something better for this at this point
|
||||
// absolutely crazy how many people put work into this at this point <3
|
||||
static menuitem_t OP_SaturnCreditsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Saturn Credits", NULL, 0},
|
||||
{IT_HEADER, NULL, "Thanks to all contributers <3", NULL, 0},
|
||||
|
||||
{IT_HEADER, NULL, "Thanks to all contributers <3", NULL, 7},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Alug", NULL, 10},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Indev", NULL, 20},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Haya", NULL, 30},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nepdisk", NULL, 40},
|
||||
{IT_STRING2+IT_SPACE, NULL, "GenericHeroGuy", NULL, 50},
|
||||
{IT_STRING2+IT_SPACE, NULL, "xyzzy", NULL, 60},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Chearii", NULL, 70},
|
||||
{IT_STRING2+IT_SPACE, NULL, "riomccloud", NULL, 80},
|
||||
{IT_STRING2+IT_SPACE, NULL, "chromaticpipe", NULL, 90},
|
||||
{IT_STRING2+IT_SPACE, NULL, "PAS", NULL, 100},
|
||||
{IT_STRING2+IT_SPACE, NULL, "$HOME", NULL, 110},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Achii", NULL, 120},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Anonimus", NULL, 130},
|
||||
{IT_STRING2+IT_SPACE, NULL, "scizor300", NULL, 140},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Lugent", NULL, 150},
|
||||
|
||||
{IT_STRING2+IT_SPACE, NULL, "Alug", NULL, 17},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Indev", NULL, 27},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Haya", NULL, 37},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nepdisk", NULL, 47},
|
||||
{IT_STRING2+IT_SPACE, NULL, "GenericHeroGuy", NULL, 57},
|
||||
{IT_STRING2+IT_SPACE, NULL, "xyzzy", NULL, 67},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Chearii", NULL, 77},
|
||||
{IT_HEADER, NULL, "", NULL, 124},
|
||||
|
||||
{IT_STRING2+IT_SPACE, NULL, "Sunflower aka AnimeSonic", NULL, 87},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Yuz aka Yuzler", NULL, 97},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Democrab", NULL, 107},
|
||||
{IT_STRING2+IT_SPACE, NULL, "EXpand", NULL, 117},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nexit", NULL, 127},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Spee", NULL, 137},
|
||||
{IT_STRING2+IT_SPACE, NULL, "jin", NULL, 147},
|
||||
{IT_STRING2+IT_SPACE, NULL, "riomccloud", NULL, 157},
|
||||
{IT_STRING2+IT_SPACE, NULL, "chromaticpipe", NULL, 167},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Achii", NULL, 177},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Anonimus", NULL, 187},
|
||||
{IT_STRING2+IT_SPACE, NULL, "scizor300", NULL, 197},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Sunflower Yuz", NULL, 180},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Democrab EXpand", NULL, 190},
|
||||
{IT_STRING2+IT_SPACE, NULL, "Nexit Spee", NULL, 200},
|
||||
{IT_STRING2+IT_SPACE, NULL, "jin", NULL, 210},
|
||||
|
||||
{IT_HEADER, NULL, "Special Thanks <3", NULL, 168},
|
||||
|
||||
{IT_HEADER, NULL, "Special Thanks <3", NULL, 167},
|
||||
|
||||
@@ -2501,7 +2508,7 @@ static menuitem_t OP_SaturnCreditsMenu[] =
|
||||
{IT_STRING, NULL, "", NULL, 267}, // dummy text II
|
||||
};
|
||||
|
||||
// sry we dont have space for this anymore :/
|
||||
// sry we dont have space for this anymore :c
|
||||
/*static const char* OP_CreditTooltips[] =
|
||||
{
|
||||
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
|
||||
@@ -3600,8 +3607,8 @@ static void M_ChangeCvar(INT32 choice)
|
||||
char s[20];
|
||||
float increment;
|
||||
|
||||
increment = (currentMenu->menuitems[itemOn].status & IT_CV_BIGFLOAT) ? 0.5f : (1.0f/16.0f);
|
||||
sprintf(s, "%f",FIXED_TO_FLOAT(cv->value)+(choice)*increment);
|
||||
increment = FIXED_TO_FLOAT(cv->value)+(choice)*((currentMenu->menuitems[itemOn].status & IT_CV_BIGFLOAT) ? 0.5f : (1.0f/16.0f));
|
||||
sprintf(s,"%ld%s",(long)increment,M_Ftrim(increment));
|
||||
CV_Set(cv, s);
|
||||
}
|
||||
else
|
||||
@@ -5716,8 +5723,16 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
||||
{
|
||||
case LLM_CREATESERVER:
|
||||
// Should the map be hidden? <-- well imma wanna toggle it, its just annoying being unable to select hell maps in mapselect
|
||||
if ((mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap) && (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))) // map hell
|
||||
return cv_showallmaps.value;
|
||||
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap)
|
||||
{
|
||||
if (cv_showallmaps.value &&
|
||||
((gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE)) || // race map hell
|
||||
((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH)))) // battle map hell
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// same goes here, just show every map if i want to
|
||||
if (M_MapLocked(mapnum+1)) // not unlocked
|
||||
@@ -6059,8 +6074,8 @@ static void M_AddonsOptions(INT32 choice)
|
||||
M_SetupNextMenu(&OP_AddonsOptionsDef);
|
||||
}
|
||||
|
||||
#define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING1 "Visit \x83mb.srb2.org/addons\x80 to get & make addons!"
|
||||
#define LOCATIONSTRING2 "Visit \x88mb.srb2.org/addons\x80 to get & make addons!"
|
||||
|
||||
static void M_AddonsInternal(void)
|
||||
{
|
||||
@@ -7167,8 +7182,11 @@ static void DrawReplayHutReplayInfo(void)
|
||||
if (mapheaderinfo[demolist[dir_on[menudepthleft]].map-1])
|
||||
{
|
||||
char *title = G_BuildMapTitle(demolist[dir_on[menudepthleft]].map);
|
||||
V_DrawString(x, y, V_SNAPTOTOP|MENUCAPS, title);
|
||||
Z_Free(title);
|
||||
if (title)
|
||||
{
|
||||
V_DrawString(x, y, V_SNAPTOTOP|MENUCAPS, title);
|
||||
Z_Free(title);
|
||||
}
|
||||
}
|
||||
else
|
||||
V_DrawString(x, y, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded.");
|
||||
@@ -8120,6 +8138,9 @@ UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES];
|
||||
|
||||
static char *M_GetConditionString(condition_t cond)
|
||||
{
|
||||
char *title = NULL;
|
||||
char *response = NULL;
|
||||
|
||||
switch(cond.type)
|
||||
{
|
||||
case UC_PLAYTIME:
|
||||
@@ -8146,33 +8167,45 @@ static char *M_GetConditionString(condition_t cond)
|
||||
G_TicsToSeconds(cond.requirement));
|
||||
case UC_MAPVISITED:
|
||||
{
|
||||
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||
char *response = va("Visit %s", title);
|
||||
Z_Free(title);
|
||||
title = G_BuildMapTitle(cond.requirement-1);
|
||||
if (title)
|
||||
{
|
||||
response = va("Visit %s", title);
|
||||
Z_Free(title);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
case UC_MAPBEATEN:
|
||||
{
|
||||
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||
char *response = va("Beat %s", title);
|
||||
Z_Free(title);
|
||||
title = G_BuildMapTitle(cond.requirement-1);
|
||||
if (title)
|
||||
{
|
||||
response = va("Beat %s", title);
|
||||
Z_Free(title);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
case UC_MAPALLEMERALDS:
|
||||
{
|
||||
char *title = G_BuildMapTitle(cond.requirement-1);
|
||||
char *response = va("Beat %s w/ all emeralds", title);
|
||||
Z_Free(title);
|
||||
title = G_BuildMapTitle(cond.requirement-1);
|
||||
if (title)
|
||||
{
|
||||
response = va("Beat %s w/ all emeralds", title);
|
||||
Z_Free(title);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
case UC_MAPTIME:
|
||||
{
|
||||
char *title = G_BuildMapTitle(cond.extrainfo1-1);
|
||||
char *response = va("Beat %s in %i:%02i.%02i", title,
|
||||
G_TicsToMinutes(cond.requirement, true),
|
||||
G_TicsToSeconds(cond.requirement),
|
||||
G_TicsToCentiseconds(cond.requirement));
|
||||
Z_Free(title);
|
||||
title = G_BuildMapTitle(cond.extrainfo1-1);
|
||||
if (title)
|
||||
{
|
||||
response = va("Beat %s in %i:%02i.%02i", title,
|
||||
G_TicsToMinutes(cond.requirement, true),
|
||||
G_TicsToSeconds(cond.requirement),
|
||||
G_TicsToCentiseconds(cond.requirement));
|
||||
Z_Free(title);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
case UC_TOTALEMBLEMS:
|
||||
@@ -8458,7 +8491,7 @@ static void M_MusicTest(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
|
||||
if (!nummusicdefs)
|
||||
if (!S_PrepareSoundTest())
|
||||
{
|
||||
M_StartMessage(M_GetText("No selectable tracks found.\n"),NULL,MM_NOTHING);
|
||||
return;
|
||||
@@ -8537,33 +8570,33 @@ static void M_DrawMusicTest(void)
|
||||
{
|
||||
INT32 t, b, q, m = 128;
|
||||
|
||||
if (nummusicdefs <= 8)
|
||||
if (numsoundtestdefs <= 8)
|
||||
{
|
||||
t = 0;
|
||||
b = nummusicdefs - 1;
|
||||
b = numsoundtestdefs - 1;
|
||||
i = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
q = m;
|
||||
m = (5*m)/nummusicdefs;
|
||||
m = (5*m)/numsoundtestdefs;
|
||||
if (st_sel < 3)
|
||||
{
|
||||
t = 0;
|
||||
b = 7;
|
||||
i = 0;
|
||||
}
|
||||
else if (st_sel >= nummusicdefs-4)
|
||||
else if (st_sel >= numsoundtestdefs-4)
|
||||
{
|
||||
t = nummusicdefs - 8;
|
||||
b = nummusicdefs - 1;
|
||||
t = numsoundtestdefs - 8;
|
||||
b = numsoundtestdefs - 1;
|
||||
i = q-m;
|
||||
}
|
||||
else
|
||||
{
|
||||
t = st_sel - 3;
|
||||
b = st_sel + 4;
|
||||
i = (t * (q-m))/(nummusicdefs - 8);
|
||||
i = (t * (q-m))/(numsoundtestdefs - 8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8572,7 +8605,7 @@ static void M_DrawMusicTest(void)
|
||||
if (t != 0)
|
||||
V_DrawString(20+280+4, 60+4 - (skullAnimCounter/5), V_YELLOWMAP, "\x1A");
|
||||
|
||||
if (b != nummusicdefs - 1)
|
||||
if (b != numsoundtestdefs - 1)
|
||||
V_DrawString(20+280+4, 60+128-12 + (skullAnimCounter/5), V_YELLOWMAP, "\x1B");
|
||||
|
||||
x = 24;
|
||||
@@ -8586,9 +8619,8 @@ static void M_DrawMusicTest(void)
|
||||
V_DrawFill(20, y-4, 280-1, 16, 237);
|
||||
|
||||
{
|
||||
const musicdef_t *def = S_GetMusicCredit(t);
|
||||
const size_t MAXLENGTH = 34;
|
||||
const char *songname = def->title[0] ? def->title : def->source;
|
||||
const char *songname = soundtestdefs[t]->title[0] ? soundtestdefs[t]->title : soundtestdefs[t]->source;
|
||||
|
||||
size_t namelength = strlen(songname);
|
||||
|
||||
@@ -8601,7 +8633,7 @@ static void M_DrawMusicTest(void)
|
||||
buf[MAXLENGTH] = 0;
|
||||
|
||||
V_DrawString(x, y, (t == st_sel ? V_YELLOWMAP : 0)|V_ALLOWLOWERCASE|V_MONOSPACE, buf);
|
||||
if (curplaying == def)
|
||||
if (curplaying == soundtestdefs[t])
|
||||
{
|
||||
V_DrawFill(20+280-9, y-4, 8, 16, 230);
|
||||
}
|
||||
@@ -8619,7 +8651,7 @@ static void M_HandleMusicTest(INT32 choice)
|
||||
switch (choice)
|
||||
{
|
||||
case KEY_DOWNARROW:
|
||||
if (st_sel++ >= nummusicdefs-1)
|
||||
if (st_sel++ >= numsoundtestdefs-1)
|
||||
st_sel = 0;
|
||||
{
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
@@ -8628,18 +8660,18 @@ static void M_HandleMusicTest(INT32 choice)
|
||||
break;
|
||||
case KEY_UPARROW:
|
||||
if (!st_sel--)
|
||||
st_sel = nummusicdefs-1;
|
||||
st_sel = numsoundtestdefs-1;
|
||||
{
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
}
|
||||
st_musictime = 0;
|
||||
break;
|
||||
case KEY_PGDN:
|
||||
if (st_sel < nummusicdefs-1)
|
||||
if (st_sel < numsoundtestdefs-1)
|
||||
{
|
||||
st_sel += 3;
|
||||
if (st_sel >= nummusicdefs-1)
|
||||
st_sel = nummusicdefs-1;
|
||||
if (st_sel >= numsoundtestdefs-1)
|
||||
st_sel = numsoundtestdefs-1;
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
}
|
||||
st_musictime = 0;
|
||||
@@ -8673,7 +8705,7 @@ static void M_HandleMusicTest(INT32 choice)
|
||||
case KEY_ENTER:
|
||||
S_StopSounds();
|
||||
S_StopMusic();
|
||||
curplaying = S_GetMusicCredit(st_sel);
|
||||
curplaying = soundtestdefs[st_sel];
|
||||
S_ChangeMusicInternal(curplaying->name, true);
|
||||
break;
|
||||
|
||||
@@ -8682,6 +8714,9 @@ static void M_HandleMusicTest(INT32 choice)
|
||||
}
|
||||
if (exitmenu)
|
||||
{
|
||||
Z_Free(soundtestdefs);
|
||||
soundtestdefs = NULL;
|
||||
|
||||
if (currentMenu->prevMenu)
|
||||
M_SetupNextMenu(currentMenu->prevMenu);
|
||||
else
|
||||
|
||||
@@ -1965,6 +1965,25 @@ char *M_GetToken(const char *inputString)
|
||||
return texturesToken;
|
||||
}
|
||||
|
||||
|
||||
const char * M_Ftrim (double f)
|
||||
{
|
||||
static char dig[9];/* "0." + 6 digits (6 is printf's default) */
|
||||
int i;
|
||||
/* I know I said it's the default, but just in case... */
|
||||
sprintf(dig, "%.6f", fabs(modf(f, &f)));
|
||||
/* trim trailing zeroes */
|
||||
for (i = strlen(dig)-1; dig[i] == '0'; --i)
|
||||
;
|
||||
if (dig[i] == '.')/* :NOTHING: */
|
||||
return "";
|
||||
else
|
||||
{
|
||||
dig[i + 1] = '\0';
|
||||
return &dig[1];/* skip the 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/** Count bits in a number.
|
||||
*/
|
||||
UINT8 M_CountBits(UINT32 num, UINT8 size)
|
||||
|
||||
@@ -104,6 +104,12 @@ boolean M_IsPathAbsolute (const char *path);
|
||||
void M_MkdirEach (const char *path, int start, int mode);
|
||||
void M_MkdirEachUntil (const char *path, int start, int end, int mode);
|
||||
|
||||
/*
|
||||
Return dot and then the fractional part of a float, without
|
||||
trailing zeros, or "" if the fractional part is zero.
|
||||
*/
|
||||
const char * M_Ftrim (double);
|
||||
|
||||
// counting bits, for weapon ammo code, usually
|
||||
FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size);
|
||||
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (_LIBC)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#ifndef HAVE_MEMCPY
|
||||
#if !(defined (_WIN32) && !defined (__CYGWIN__)) && !defined (__APPLE__)
|
||||
#define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
+3
-1
@@ -1542,15 +1542,17 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
if (target->target->hnext)
|
||||
K_KillBananaChain(target->target->hnext, inflictor, source);
|
||||
|
||||
target->target->player->kartstuff[k_itemamount] = 0;
|
||||
}
|
||||
else if (target->target->player->kartstuff[k_itemamount])
|
||||
else
|
||||
target->target->player->kartstuff[k_itemamount]--;
|
||||
}
|
||||
else if ((target->type == MT_ORBINAUT_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items
|
||||
|| (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ))
|
||||
{
|
||||
target->target->player->kartstuff[k_itemamount]--;
|
||||
|
||||
if (target->lastlook != 0)
|
||||
{
|
||||
K_RepairOrbitChain(target);
|
||||
|
||||
@@ -158,6 +158,8 @@ extern consvar_t cv_tiltsmoothing;
|
||||
|
||||
extern consvar_t cv_actionmovie;
|
||||
|
||||
extern consvar_t cv_screenquake;
|
||||
|
||||
extern consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_verticallook[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
+2
-7
@@ -2747,8 +2747,6 @@ static void P_SetupPlayer(void)
|
||||
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
|
||||
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"online", srb2home), 0755);
|
||||
G_RecordDemo(buf);
|
||||
if (dedicated)
|
||||
G_BeginRecording(); //this has to move here, since dedicated servers dont run got_mapcmd
|
||||
}
|
||||
|
||||
wantedcalcdelay = wantedfrequency*2;
|
||||
@@ -2868,12 +2866,9 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false);
|
||||
}
|
||||
else //dedicated servers
|
||||
{
|
||||
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false);
|
||||
}
|
||||
|
||||
F_RunWipe(wipedefs[(encoremode ? wipe_level_final : wipe_level_toblack)], false);
|
||||
}
|
||||
|
||||
// Reset the palette now all fades have been done
|
||||
|
||||
+4
-3
@@ -573,7 +573,7 @@ static void P_RunQuakes(void)
|
||||
{
|
||||
fixed_t ir;
|
||||
|
||||
if (quake.time <= 0)
|
||||
if (!cv_screenquake.value || quake.time <= 0)
|
||||
{
|
||||
quake.x = quake.y = quake.z = quake.roll = 0;
|
||||
return;
|
||||
@@ -618,8 +618,8 @@ static inline void P_ResetSpriteStuff(void)
|
||||
if (!mo || (mo->sprite == SPR_NULL) || (mo->flags2 & MF2_DONTDRAW) || (mo->type == MT_SHADOW))
|
||||
continue;
|
||||
|
||||
mo->spritexscale = mo->realxscale;
|
||||
mo->spriteyscale = mo->realyscale;
|
||||
mo->spritexscale = mo->realxscale;
|
||||
mo->spriteyscale = mo->realyscale;
|
||||
mo->spritexoffset = mo->realxoffset;
|
||||
mo->spriteyoffset = mo->realyoffset;
|
||||
}
|
||||
@@ -654,6 +654,7 @@ void P_Ticker(boolean run)
|
||||
{
|
||||
P_MapStart();
|
||||
R_UpdateMobjInterpolators();
|
||||
R_UpdateLevelInterpolators();
|
||||
OP_ObjectplaceMovement(&players[0]);
|
||||
P_MoveChaseCamera(&players[0], &camera[0], false);
|
||||
R_UpdateViewInterpolation();
|
||||
|
||||
@@ -3044,6 +3044,8 @@ consvar_t cv_tiltsmoothing = {"tiltsmoothing", "32", CV_SAVE, CV_Natural, NULL,
|
||||
|
||||
consvar_t cv_actionmovie = {"actionmovie", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_screenquake = {"quakescreenshake", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t lookbackmom_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Double"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_lookbackmom[MAXSPLITSCREENPLAYERS] = {
|
||||
|
||||
+5
-5
@@ -264,12 +264,12 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||
mobj_t *pviewmobj = viewplayer->mo;
|
||||
INT32 heightsec;
|
||||
boolean underwater;
|
||||
UINT8 i = R_GetViewNumber();
|
||||
camera_t *thiscam = &camera[R_GetViewNumber()];
|
||||
|
||||
if (viewplayer == &players[displayplayers[i]] && camera[i].chase)
|
||||
heightsec = R_PointInSubsector(camera[i].x, camera[i].y)->sector->heightsec;
|
||||
else if (i > splitscreen && viewmobj)
|
||||
heightsec = R_PointInSubsector(pviewmobj->x, pviewmobj->y)->sector->heightsec;
|
||||
if (thiscam->chase)
|
||||
heightsec = thiscam->subsector->sector->heightsec;
|
||||
else if (viewmobj)
|
||||
heightsec = pviewmobj->subsector->sector->heightsec;
|
||||
else
|
||||
return sec;
|
||||
|
||||
|
||||
+16
-5
@@ -690,12 +690,15 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
|
||||
// Patch identifier
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch name should be");
|
||||
}
|
||||
|
||||
texturesTokenLength = strlen(texturesToken);
|
||||
if (texturesTokenLength>8)
|
||||
|
||||
if (texturesTokenLength > 8)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Patch name \"%s\" exceeds 8 characters",texturesToken);
|
||||
}
|
||||
@@ -713,10 +716,12 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// Comma 1
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after \"%s\"'s patch name should be",patchName);
|
||||
}
|
||||
|
||||
if (strcmp(texturesToken,",")!=0)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Expected \",\" after %s's patch name, got \"%s\"",patchName,texturesToken);
|
||||
@@ -725,14 +730,17 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// XPos
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s x coordinate should be",patchName);
|
||||
}
|
||||
|
||||
endPos = NULL;
|
||||
#ifndef AVOID_ERRNO
|
||||
errno = 0;
|
||||
#endif
|
||||
|
||||
patchXPos = strtol(texturesToken,&endPos,10);
|
||||
(void)patchXPos; //unused for now
|
||||
if (endPos == texturesToken // Empty string
|
||||
@@ -748,10 +756,12 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// Comma 2
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where comma after patch \"%s\"'s x coordinate should be",patchName);
|
||||
}
|
||||
|
||||
if (strcmp(texturesToken,",")!=0)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Expected \",\" after patch \"%s\"'s x coordinate, got \"%s\"",patchName,texturesToken);
|
||||
@@ -760,6 +770,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
||||
// YPos
|
||||
Z_Free(texturesToken);
|
||||
texturesToken = M_GetToken(NULL);
|
||||
|
||||
if (texturesToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s y coordinate should be",patchName);
|
||||
@@ -1131,9 +1142,9 @@ static void R_InitExtraColormaps(void)
|
||||
lumpnum_t R_GetFlatNumForName(const char *name)
|
||||
{
|
||||
INT32 i;
|
||||
lumpnum_t lump;
|
||||
lumpnum_t start;
|
||||
lumpnum_t end;
|
||||
lumpnum_t lump = LUMPERROR;
|
||||
lumpnum_t start = LUMPERROR;
|
||||
lumpnum_t end = LUMPERROR;
|
||||
|
||||
// Scan wad files backwards so patched flats take preference.
|
||||
for (i = numwadfiles - 1; i >= 0; i--)
|
||||
@@ -1608,7 +1619,7 @@ const char *R_ColormapNameForNum(INT32 num)
|
||||
if (num == -1)
|
||||
return "NONE";
|
||||
|
||||
if (num < 0 || num > MAXCOLORMAPS)
|
||||
if (num < 0 || num >= MAXCOLORMAPS)
|
||||
I_Error("R_ColormapNameForNum: num %d is invalid!\n", num);
|
||||
|
||||
if (foundcolormaps[num] == LUMPERROR)
|
||||
|
||||
+8
-20
@@ -42,13 +42,13 @@ static CV_PossibleValue_t fpscap_cons_t[] = {
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_fpscap = {"fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fpscap = {"fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_fpscapbg = {"fpscapbackground", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_precipinterp = {"precipinterpolation", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
ps_metric_t ps_interp_frac = {0};
|
||||
ps_metric_t ps_interp_lag = {0};
|
||||
ps_metric_t ps_interp_lag = {0};
|
||||
|
||||
static boolean R_UseBackgroundFramerateCap(void)
|
||||
{
|
||||
@@ -67,21 +67,21 @@ static boolean R_UseBackgroundFramerateCap(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
static UINT32 R_GetBackgroundFramerateCap(void)
|
||||
static UINT32 R_GetFrameCap(INT32 val)
|
||||
{
|
||||
if (cv_fpscapbg.value == 0)
|
||||
if (val == 0)
|
||||
{
|
||||
// 0: Match refresh rate
|
||||
return I_GetRefreshRate();
|
||||
}
|
||||
|
||||
if (cv_fpscapbg.value < 0)
|
||||
if (val < 0)
|
||||
{
|
||||
// -1: Unlimited
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cv_fpscapbg.value;
|
||||
return val;
|
||||
}
|
||||
|
||||
UINT32 R_GetFramerateCap(void)
|
||||
@@ -95,22 +95,10 @@ UINT32 R_GetFramerateCap(void)
|
||||
|
||||
if (R_UseBackgroundFramerateCap())
|
||||
{
|
||||
return R_GetBackgroundFramerateCap();
|
||||
return R_GetFrameCap(cv_fpscapbg.value);
|
||||
}
|
||||
|
||||
if (cv_fpscap.value == 0)
|
||||
{
|
||||
// 0: Match refresh rate
|
||||
return I_GetRefreshRate();
|
||||
}
|
||||
|
||||
if (cv_fpscap.value < 0)
|
||||
{
|
||||
// -1: Unlimited
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cv_fpscap.value;
|
||||
return R_GetFrameCap(cv_fpscap.value);
|
||||
}
|
||||
|
||||
boolean R_UsingFrameInterpolation(void)
|
||||
|
||||
+31
-28
@@ -125,24 +125,23 @@ static CV_PossibleValue_t drawdist_cons_t[] = {
|
||||
{8192, "8192"}, {12288, "12288"}, {20480, "20480"},
|
||||
{24576, "24576"},{0, "Infinite"}, {0, NULL}};
|
||||
|
||||
#if __SIZEOF_POINTER__ < 8 // only for 64bit
|
||||
#if defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__) || defined(__arm64__) // only for 64bit (idk how else to proper check lmao)
|
||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{0, "None"}, {0, NULL}};
|
||||
|
||||
#else
|
||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {0, "None"}, {0, NULL}};
|
||||
#else
|
||||
static CV_PossibleValue_t drawdist_precip_cons_t[] = {
|
||||
{256, "256"}, {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{0, "None"}, {0, NULL}};
|
||||
#endif
|
||||
|
||||
static CV_PossibleValue_t maxinterpdist_cons_t[] = {
|
||||
/*{256, "256"},*/ {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
|
||||
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
|
||||
/*{256, "256"},*/ {512, "512"}, {768, "768"},
|
||||
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
|
||||
{3072, "3072"}, {4096, "4096"}, {6144, "6144"},
|
||||
{8192, "8192"}, {0, "Infinite"}, {0, NULL}};
|
||||
|
||||
static CV_PossibleValue_t fov_cons_t[] = {{MINFOV*FRACUNIT, "MIN"}, {MAXFOV*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
|
||||
@@ -172,14 +171,14 @@ consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnO
|
||||
consvar_t cv_precachetextures = {"precachetextures", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam2", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam3", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam4", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_flipcam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}
|
||||
@@ -201,6 +200,7 @@ consvar_t cv_drawdist = {"drawdist", "Infinite", CV_SAVE, drawdist_cons_t, NULL,
|
||||
consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE|CV_CALL|CV_NOINIT, drawdist_precip_cons_t, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_lessprecip = {"lessweathereffects", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_mobjscaleprecip = {"scaleprecipmobjscale", "Off", CV_SAVE|CV_CALL|CV_NOINIT, CV_OnOff, Precipstuff_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_playerfade = {"playerfade", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_maxinterpdist = {"maxinterpdist", "Infinite", CV_SAVE, maxinterpdist_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
@@ -403,7 +403,8 @@ angle_t R_PlayerSliptideAngle(player_t *player)
|
||||
sprframe = &sprdef->spriteframes[rot];
|
||||
|
||||
// No sprite frame? I guess it is possible
|
||||
if (!sprframe) return 0;
|
||||
if (!sprframe)
|
||||
return 0;
|
||||
|
||||
if (sprframe->rotate != SRF_SINGLE || (mo->frame & FF_PAPERSPRITE))
|
||||
ang = R_PointToAngle(mo->x, mo->y) - mo->angle;
|
||||
@@ -463,6 +464,7 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe
|
||||
return false;
|
||||
|
||||
cullplane = cullheight->frontsector->floorheight;
|
||||
|
||||
if (cullheight->flags & ML_NOCLIMB) // Group culling
|
||||
{
|
||||
if (!viewcullheight)
|
||||
@@ -1063,7 +1065,7 @@ static void R_SetupCommonFrame(player_t * player, sector_t * sector)
|
||||
|
||||
static void R_SetupAimingFrame(player_t *player, camera_t *thiscam)
|
||||
{
|
||||
if (player->awayviewtics)
|
||||
if (player->awayviewtics && player->awayviewmobj)
|
||||
{
|
||||
newview->aim = player->awayviewaiming;
|
||||
newview->angle = player->awayviewmobj->angle;
|
||||
@@ -1169,7 +1171,7 @@ void R_SkyboxFrame(int s)
|
||||
{
|
||||
mapheader_t *mh = mapheaderinfo[gamemap-1];
|
||||
|
||||
if (player->awayviewtics)
|
||||
if (player->awayviewtics && player->awayviewmobj)
|
||||
{
|
||||
SETUPSKYVIEW(player->awayviewmobj, (player->awayviewmobj->z + 20*FRACUNIT));
|
||||
}
|
||||
@@ -1226,7 +1228,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
|
||||
R_SetupAimingFrame(player, thiscam);
|
||||
|
||||
if (player->awayviewtics) // cut-away view stuff
|
||||
if (player->awayviewtics && player->awayviewmobj) // cut-away view stuff
|
||||
{
|
||||
viewmobj = player->awayviewmobj; // should be a MT_ALTVIEWMAN
|
||||
I_Assert(viewmobj != NULL);
|
||||
@@ -1235,7 +1237,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = viewmobj->z + 20*FRACUNIT;
|
||||
|
||||
if (!P_MobjWasRemoved(viewmobj) && viewmobj->subsector && viewmobj->subsector->sector)
|
||||
if (viewmobj->subsector && viewmobj->subsector->sector)
|
||||
sector = viewmobj->subsector->sector;
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
@@ -1253,7 +1255,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
}
|
||||
else // use the player's eyes view
|
||||
else if (player->mo) // use the player's eyes view
|
||||
{
|
||||
viewmobj = player->mo;
|
||||
I_Assert(viewmobj != NULL);
|
||||
@@ -1262,7 +1264,7 @@ void R_SetupFrame(int s, boolean skybox)
|
||||
newview->y = viewmobj->y;
|
||||
newview->z = player->viewz;
|
||||
|
||||
if (!P_MobjWasRemoved(viewmobj) && viewmobj->subsector && viewmobj->subsector->sector)
|
||||
if (viewmobj->subsector && viewmobj->subsector->sector)
|
||||
sector = viewmobj->subsector->sector;
|
||||
|
||||
R_SetupCommonFrame(player, sector);
|
||||
@@ -1350,10 +1352,10 @@ void R_RenderPlayerView(player_t *player)
|
||||
|
||||
for (UINT8 j = 0; j <= splitscreen; j++)
|
||||
{
|
||||
if (player == &players[displayplayers[i]]
|
||||
&& viewfov[i] != fov)
|
||||
if (player == &players[displayplayers[j]]
|
||||
&& viewfov[j] != fov)
|
||||
{
|
||||
viewfov[i] = fov;
|
||||
viewfov[j] = fov;
|
||||
R_SetFov(fov);
|
||||
}
|
||||
}
|
||||
@@ -1523,10 +1525,6 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_fovchange);
|
||||
CV_RegisterVar(&cv_fov);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_chasecam[i]);
|
||||
}
|
||||
CV_RegisterVar(&cv_shadow);
|
||||
CV_RegisterVar(&cv_shadowoffs);
|
||||
CV_RegisterVar(&cv_skybox);
|
||||
@@ -1535,6 +1533,8 @@ void R_RegisterEngineStuff(void)
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_chasecam[i]);
|
||||
|
||||
CV_RegisterVar(&cv_cam_dist[i]);
|
||||
CV_RegisterVar(&cv_cam_still[i]);
|
||||
CV_RegisterVar(&cv_cam_height[i]);
|
||||
@@ -1551,6 +1551,8 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_tiltsmoothing);
|
||||
CV_RegisterVar(&cv_actionmovie);
|
||||
|
||||
CV_RegisterVar(&cv_screenquake);
|
||||
|
||||
CV_RegisterVar(&cv_driftsparkpulse);
|
||||
CV_RegisterVar(&cv_gravstretch);
|
||||
CV_RegisterVar(&cv_sloperoll);
|
||||
@@ -1568,6 +1570,7 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_randomdirlight);
|
||||
|
||||
CV_RegisterVar(&cv_maxinterpdist);
|
||||
CV_RegisterVar(&cv_playerfade);
|
||||
|
||||
CV_RegisterVar(&cv_ripplewater);
|
||||
|
||||
|
||||
@@ -213,6 +213,7 @@ extern consvar_t cv_fov, cv_fovchange;
|
||||
extern consvar_t cv_skybox;
|
||||
extern consvar_t cv_tailspickup;
|
||||
extern consvar_t cv_maxinterpdist;
|
||||
extern consvar_t cv_playerfade;
|
||||
extern consvar_t cv_ripplewater;
|
||||
|
||||
extern consvar_t cv_randomdirlight;
|
||||
|
||||
+38
-2
@@ -716,6 +716,13 @@ static void R_DrawFlippedMaskedColumn(column_t *column)
|
||||
dc_texturemid = basetexturemid;
|
||||
}
|
||||
|
||||
|
||||
// Based off of R_GetLinedefTransTable
|
||||
static transnum_t R_GetThingTransTable(fixed_t alpha, transnum_t transmap)
|
||||
{
|
||||
return (20*(FRACUNIT - ((alpha * (10 - transmap))/10) - 1) + FRACUNIT) >> (FRACBITS+1);
|
||||
}
|
||||
|
||||
//
|
||||
// R_DrawVisSprite
|
||||
// mfloorclip and mceilingclip should also be set.
|
||||
@@ -823,8 +830,8 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
||||
frac = vis->startfrac;
|
||||
windowtop = windowbottom = sprbotscreen = INT32_MAX;
|
||||
|
||||
if ((vis->mobj->skin || vis->mobj->localskin) && K_GetMobjSkin(vis->mobj)->flags & SF_HIRES)
|
||||
this_scale = FixedMul(this_scale, K_GetMobjSkin(vis->mobj)->highresscale);
|
||||
//if ((vis->mobj->skin || vis->mobj->localskin) && K_GetMobjSkin(vis->mobj)->flags & SF_HIRES)
|
||||
// this_scale = FixedMul(this_scale, K_GetMobjSkin(vis->mobj)->highresscale);
|
||||
|
||||
if (this_scale <= 0)
|
||||
this_scale = 1;
|
||||
@@ -1579,6 +1586,9 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||
else
|
||||
trans = 0;
|
||||
|
||||
if (cv_playerfade.value && oldthing->player)
|
||||
trans = R_GetThingTransTable(R_DoPlayerFade(oldthing), trans);
|
||||
|
||||
//SoM: 3/17/2000: Disregard sprites that are out of view..
|
||||
if (vflip)
|
||||
{
|
||||
@@ -2888,6 +2898,32 @@ boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist)
|
||||
return true;
|
||||
}
|
||||
|
||||
fixed_t R_DoPlayerFade(mobj_t *thing)
|
||||
{
|
||||
fixed_t fadealpha = FRACUNIT;
|
||||
static const tic_t countdownstarttime = (15 * TICRATE) / 4; // starttime - (3*TICRATE)
|
||||
|
||||
if (thing->player == viewplayer || viewplayer->exiting || camera[R_GetViewNumber()].freecam || leveltime < countdownstarttime)
|
||||
return fadealpha;
|
||||
|
||||
const INT32 playerdist = (FixedMul((thing->x - viewx), viewcos) + FixedMul((thing->y - viewy), viewsin)) >> FRACBITS;
|
||||
const INT32 viewplayerdist = (FixedMul((viewplayer->mo->x - viewx), viewcos) + FixedMul((viewplayer->mo->y - viewy), viewsin)) >> FRACBITS;
|
||||
|
||||
if (playerdist < viewplayerdist)
|
||||
{
|
||||
if (playerdist < viewplayerdist / 2) // stronger fade when very close
|
||||
{
|
||||
fadealpha = (playerdist * FRACUNIT) / (viewplayerdist / 2) / 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
fadealpha = (playerdist * FRACUNIT) / viewplayerdist;
|
||||
}
|
||||
}
|
||||
|
||||
return fadealpha;
|
||||
}
|
||||
|
||||
boolean R_ThingIsFullBright(mobj_t *thing)
|
||||
{
|
||||
return ((thing->frame & FF_BRIGHTMASK) == FF_FULLBRIGHT);
|
||||
|
||||
@@ -76,6 +76,8 @@ void R_InitSprites(void);
|
||||
void R_ClearSprites(void);
|
||||
void R_DrawMasked(void);
|
||||
|
||||
fixed_t R_DoPlayerFade(mobj_t *thing);
|
||||
|
||||
boolean R_ThingVisible (mobj_t *thing);
|
||||
boolean R_ThingWithinDist (mobj_t *thing, INT32 limit_dist);
|
||||
|
||||
|
||||
+54
-65
@@ -32,7 +32,6 @@
|
||||
#include "m_menu.h" // bird music stuff
|
||||
|
||||
#include "lua_hook.h" // MusicChange hook
|
||||
#include "lua_hud.h" // LUA_HudEnabled(hud_musiccredit)
|
||||
|
||||
static boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *vol, INT32 *sep, INT32 *pitch, sfxinfo_t *sfxinfo);
|
||||
static void SetChannelsNum(void);
|
||||
@@ -1203,58 +1202,8 @@ static consvar_t *music_refade_cv;
|
||||
/// Music Definitions
|
||||
/// ------------------------
|
||||
|
||||
// Similar system to vissprite allocation. Exists so external pointers to musicdefs are not invalidated
|
||||
// when allocating more space for musicdefs
|
||||
#define MUSICDEFCHUNKBITS 6
|
||||
#define MUSICDEFSPERCHUNK (1 << MUSICDEFCHUNKBITS)
|
||||
#define MUSICDEFINDEXMASK (MUSICDEFSPERCHUNK - 1)
|
||||
static musicdef_t **musicdefs = NULL;
|
||||
static INT32 numchunks = 0;
|
||||
INT32 nummusicdefs = 0;
|
||||
|
||||
//
|
||||
// S_GetMusicCredit
|
||||
//
|
||||
// Return music credit with given index.
|
||||
//
|
||||
musicdef_t *S_GetMusicCredit(INT32 i)
|
||||
{
|
||||
if (i < 0 || i >= nummusicdefs)
|
||||
return NULL;
|
||||
|
||||
INT32 chunk = i >> MUSICDEFCHUNKBITS;
|
||||
i &= MUSICDEFINDEXMASK;
|
||||
|
||||
return &musicdefs[chunk][i];
|
||||
}
|
||||
|
||||
//
|
||||
// S_AddMusicCredit
|
||||
//
|
||||
// Return new music credit, allocates memory for it if needed.
|
||||
//
|
||||
static musicdef_t *S_AddMusicCredit(void)
|
||||
{
|
||||
INT32 chunk = nummusicdefs >> MUSICDEFCHUNKBITS;
|
||||
INT32 i = nummusicdefs & MUSICDEFINDEXMASK;
|
||||
|
||||
// Allocate new chunk if needed. Other chunks stay valid
|
||||
if (chunk == numchunks)
|
||||
{
|
||||
++numchunks;
|
||||
musicdefs = (musicdef_t**)Z_Realloc(musicdefs, sizeof(musicdef_t*)*numchunks, PU_STATIC, NULL);
|
||||
musicdefs[chunk] = Z_Calloc(sizeof(musicdef_t)*MUSICDEFSPERCHUNK, PU_STATIC, NULL);
|
||||
}
|
||||
|
||||
// Store "id" of new musicdef (mostly exists only for lua)
|
||||
musicdefs[chunk][i].num = nummusicdefs;
|
||||
|
||||
++nummusicdefs;
|
||||
|
||||
return &musicdefs[chunk][i];
|
||||
}
|
||||
|
||||
struct cursongcredit cursongcredit = {0}; // Currently displayed song credit info
|
||||
musicdef_t *musicdefstart = NULL; // First music definition
|
||||
struct cursongcredit cursongcredit; // Currently displayed song credit info
|
||||
|
||||
static boolean
|
||||
ReadMusicDefFields (UINT16 wadnum, int line, char *stoken, musicdef_t **defp)
|
||||
@@ -1282,11 +1231,14 @@ ReadMusicDefFields (UINT16 wadnum, int line, char *stoken, musicdef_t **defp)
|
||||
// Nothing found, add to the end.
|
||||
if (!def)
|
||||
{
|
||||
def = S_AddMusicCredit();
|
||||
def = Z_Calloc(sizeof (musicdef_t), PU_STATIC, NULL);
|
||||
|
||||
STRBUFCPY(def->name, value);
|
||||
strlwr(def->name);
|
||||
def->hash = quickncasehash (def->name, 6);
|
||||
|
||||
def->next = musicdefstart;
|
||||
musicdefstart = def;
|
||||
}
|
||||
|
||||
(*defp) = def;
|
||||
@@ -1471,10 +1423,8 @@ musicdef_t *S_FindMusicCredit(const char *musname)
|
||||
UINT32 hash = quickncasehash (musname, 6);
|
||||
musicdef_t *def;
|
||||
|
||||
for (INT32 i = 0; i < nummusicdefs; ++i)
|
||||
for (def = musicdefstart; def; def = def->next)
|
||||
{
|
||||
def = S_GetMusicCredit(i);
|
||||
|
||||
if (hash != def->hash)
|
||||
continue;
|
||||
if (stricmp(def->name, musname))
|
||||
@@ -1502,7 +1452,7 @@ void S_ShowSpecifiedMusicCredit(const char *musname)
|
||||
|
||||
def = S_FindMusicCredit(musname);
|
||||
|
||||
if (def && !LUA_HookMusicCredit(def))
|
||||
if (def)
|
||||
{
|
||||
cursongcredit.def = def;
|
||||
cursongcredit.anim = 5*TICRATE;
|
||||
@@ -1521,6 +1471,41 @@ void S_ShowMusicCredit(void)
|
||||
S_ShowSpecifiedMusicCredit(music.name);
|
||||
}
|
||||
|
||||
musicdef_t **soundtestdefs = NULL;
|
||||
INT32 numsoundtestdefs = 0;
|
||||
|
||||
//
|
||||
// S_PrepareSoundTest
|
||||
//
|
||||
// Prepare sound test. What am I, your butler?
|
||||
//
|
||||
boolean S_PrepareSoundTest(void)
|
||||
{
|
||||
musicdef_t *def;
|
||||
INT32 pos = numsoundtestdefs = 0;
|
||||
|
||||
for (def = musicdefstart; def; def = def->next)
|
||||
{
|
||||
numsoundtestdefs++;
|
||||
}
|
||||
|
||||
if (!numsoundtestdefs)
|
||||
return false;
|
||||
|
||||
if (soundtestdefs)
|
||||
Z_Free(soundtestdefs);
|
||||
|
||||
if (!(soundtestdefs = Z_Malloc(numsoundtestdefs*sizeof(musicdef_t *), PU_STATIC, NULL)))
|
||||
I_Error("S_PrepareSoundTest(): could not allocate soundtestdefs.");
|
||||
|
||||
for (def = musicdefstart; def /*&& i < numsoundtestdefs*/; def = def->next)
|
||||
{
|
||||
soundtestdefs[pos++] = def;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// ------------------------
|
||||
/// Music Status
|
||||
/// ------------------------
|
||||
@@ -2025,7 +2010,7 @@ void S_KeepMusic(void)
|
||||
}
|
||||
|
||||
// Sets up the map music in case it should be reloaded
|
||||
// Special case for keep music
|
||||
// Special case for keepmusic
|
||||
void S_HandleReloadResetMusic(void)
|
||||
{
|
||||
if (!(mapmusic.flags & MUSIC_RELOADRESET))
|
||||
@@ -2050,20 +2035,24 @@ void S_HandleReloadResetMusic(void)
|
||||
|
||||
static boolean S_SkipIntroMusic(void)
|
||||
{
|
||||
boolean skip = cv_skipintromusic.value;
|
||||
if (!cv_skipintromusic.value)
|
||||
return false;
|
||||
|
||||
if (!skip)
|
||||
// check if menu music is playing, otherwise it may continue playing
|
||||
if (!stricmp(music.name, "titles"))
|
||||
return false;
|
||||
|
||||
char *maptitle = G_BuildMapTitle(gamemap); // Zzz...
|
||||
|
||||
// check if menu music is playing, otherwise it may continue playing
|
||||
if (!stricmp(music.name, "titles") || (maptitle && (!stricmp(maptitle, "Wandering Falls")))) // wandering balls changes its song when the race starts Zzz...
|
||||
skip = false;
|
||||
if (maptitle && !stricmp(maptitle, "Wandering Falls")) // wandering balls changes its song when the race starts Zzz...
|
||||
{
|
||||
Z_Free(maptitle);
|
||||
return false;
|
||||
}
|
||||
|
||||
Z_Free(maptitle);
|
||||
|
||||
return skip;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
+8
-3
@@ -182,9 +182,14 @@ typedef struct musicdef_s
|
||||
char alttitle[256];
|
||||
char authors[256];
|
||||
boolean use_info;
|
||||
size_t num;
|
||||
struct musicdef_s *next;
|
||||
} musicdef_t;
|
||||
|
||||
extern musicdef_t *musicdefstart;
|
||||
extern musicdef_t **soundtestdefs;
|
||||
extern INT32 numsoundtestdefs;
|
||||
extern UINT8 soundtestpage;
|
||||
|
||||
extern struct cursongcredit
|
||||
{
|
||||
musicdef_t *def;
|
||||
@@ -193,17 +198,17 @@ extern struct cursongcredit
|
||||
UINT8 trans;
|
||||
} cursongcredit;
|
||||
|
||||
extern INT32 nummusicdefs;
|
||||
|
||||
void S_LoadMusicDefs(UINT16 wadnum);
|
||||
void S_InitMusicDefs(void);
|
||||
void S_LoadMTDefs(UINT16 wadnum);
|
||||
void S_InitMTDefs(void);
|
||||
musicdef_t *S_GetMusicCredit(INT32 i);
|
||||
musicdef_t *S_FindMusicCredit(const char *musname);
|
||||
void S_ShowSpecifiedMusicCredit(const char *musname);
|
||||
void S_ShowMusicCredit(void);
|
||||
|
||||
boolean S_PrepareSoundTest(void);
|
||||
|
||||
//
|
||||
// Music Seeking
|
||||
//
|
||||
|
||||
+5
-1
@@ -80,7 +80,9 @@ static void Highreshudscale_OnChange(void)
|
||||
|
||||
static void SCR_ChangeFullscreen (void);
|
||||
|
||||
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t fullscreen_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Borderless Window"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, fullscreen_cons_t, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t accuratefps_cons_t[] = {{0, "Inaccurate"}, {1, "Accurate"}, {0, NULL}};
|
||||
consvar_t cv_accuratefps = {"fpssampling", "1", CV_SAVE, accuratefps_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -310,6 +312,8 @@ void SCR_SetDefaultMode(void)
|
||||
void SCR_ChangeFullscreen(void)
|
||||
{
|
||||
#ifdef DIRECTFULLSCREEN
|
||||
I_SetBorderlessWindow(); // Running this here so we can have borderless window at startup
|
||||
|
||||
// allow_fullscreen is set by VID_PrepareModeList
|
||||
// it is used to prevent switching to fullscreen during startup
|
||||
if (!allow_fullscreen)
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __unix__
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
|
||||
+4
-1
@@ -110,8 +110,11 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
|
||||
#if defined(UNIXCOMMON)
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
#if defined (__unix__) || (defined (UNIXCOMMON) && !defined (__APPLE__))
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
#define NEWSIGNALHANDLER
|
||||
|
||||
+8
-1
@@ -150,7 +150,7 @@ UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
||||
// To disable fullscreen at startup; is set in VID_PrepareModeList
|
||||
boolean allow_fullscreen = false;
|
||||
static SDL_bool disable_fullscreen = SDL_FALSE;
|
||||
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value
|
||||
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)? 0: (cv_fullscreen.value == 1)
|
||||
static SDL_bool disable_mouse = SDL_FALSE;
|
||||
#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus)
|
||||
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
|
||||
@@ -273,6 +273,7 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
|
||||
{
|
||||
wasfullscreen = SDL_TRUE;
|
||||
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
I_SetBorderlessWindow();
|
||||
}
|
||||
else // windowed mode
|
||||
{
|
||||
@@ -2289,4 +2290,10 @@ static void Impl_SetVsync(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void I_SetBorderlessWindow(void)
|
||||
{
|
||||
SDL_bool borderless = (cv_fullscreen.value == 2) ? SDL_FALSE : SDL_TRUE;
|
||||
SDL_SetWindowBordered(window, borderless);
|
||||
}
|
||||
|
||||
#endif
|
||||
+3
-13
@@ -213,20 +213,10 @@ void I_StartupSound(void)
|
||||
// call to start audio failed -- we do not have it
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_version SDLmixcompiled;
|
||||
const SDL_version *SDLmixlinked;
|
||||
SDL_MIXER_VERSION(&SDLmixcompiled)
|
||||
SDLmixlinked = Mix_Linked_Version();
|
||||
|
||||
I_OutputMsg("Compiled for SDL_mixer version: %d.%d.%d\n",
|
||||
SDLmixcompiled.major, SDLmixcompiled.minor, SDLmixcompiled.patch);
|
||||
I_OutputMsg("Linked with SDL_mixer version: %d.%d.%d\n",
|
||||
SDLmixlinked->major, SDLmixlinked->minor, SDLmixlinked->patch);
|
||||
|
||||
|
||||
#ifdef HAVE_OPENMPT
|
||||
I_OutputMsg("libopenmpt version: %s\n", openmpt_get_string("library_version"));
|
||||
I_OutputMsg("libopenmpt build date: %s\n", openmpt_get_string("build"));
|
||||
CONS_Printf("libopenmpt version: %s\n", openmpt_get_string("library_version"));
|
||||
CONS_Printf("libopenmpt build date: %s\n", openmpt_get_string("build"));
|
||||
#endif
|
||||
|
||||
sound_started = true;
|
||||
|
||||
@@ -1037,6 +1037,7 @@ sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean
|
||||
S_sfx[i].data = I_GetSfx(&S_sfx[i]);
|
||||
else
|
||||
S_sfx[i].data = NULL;
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
+18
-17
@@ -187,7 +187,7 @@ void ST_doPaletteStuff(void)
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl && !HWR_PalRenderFlashpal())
|
||||
palette = 0; // No flashpals here in OpenGL
|
||||
palette = 0; // Don't set the palette to a flashpal in OpenGL's truecolor mode
|
||||
#endif
|
||||
|
||||
palette = min(max(palette, 0), 13);
|
||||
@@ -418,27 +418,28 @@ static void ST_drawDebugInfo(void)
|
||||
|
||||
static void ST_drawLevelTitle(void)
|
||||
{
|
||||
char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
char *subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
char *actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
INT32 lvlttlxpos;
|
||||
INT32 ttlnumxpos;
|
||||
INT32 zonexpos;
|
||||
INT32 dupcalc = (vid.width/vid.dupx);
|
||||
UINT8 gtc = G_GetGametypeColor(gametype);
|
||||
char *lvlttl, *subttl, *zonttl, *actnum;
|
||||
INT32 lvlttlxpos, ttlnumxpos, zonexpos;
|
||||
INT32 dupcalc;
|
||||
UINT8 gtc;
|
||||
INT32 sub = 0;
|
||||
INT32 bary = (splitscreen)
|
||||
? BASEVIDHEIGHT/2
|
||||
: 163;
|
||||
INT32 bary;
|
||||
INT32 lvlw;
|
||||
|
||||
if (!cv_stagetitle.value)
|
||||
if (!cv_stagetitle.value || (timeinmap > 113))
|
||||
return;
|
||||
|
||||
if (timeinmap > 113)
|
||||
if (*mapheaderinfo[gamemap-1]->lvlttl == '\0')
|
||||
return;
|
||||
|
||||
lvlttl = mapheaderinfo[gamemap-1]->lvlttl;
|
||||
subttl = mapheaderinfo[gamemap-1]->subttl;
|
||||
zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
|
||||
actnum = mapheaderinfo[gamemap-1]->actnum;
|
||||
dupcalc = (vid.width/vid.dupx);
|
||||
gtc = G_GetGametypeColor(gametype);
|
||||
bary = (splitscreen) ? BASEVIDHEIGHT/2 : 163;
|
||||
|
||||
lvlw = V_LevelNameWidth(lvlttl);
|
||||
|
||||
if (actnum[0])
|
||||
@@ -602,7 +603,7 @@ static void ST_overlayDrawer(void)
|
||||
}
|
||||
|
||||
// draw level title Tails
|
||||
if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud)
|
||||
if (!(hu_showscores && (netgame || multiplayer) && !mapreset) && LUA_HudEnabled(hud_stagetitle) && !forceshowhud)
|
||||
ST_drawLevelTitle();
|
||||
|
||||
if (!hu_showscores && netgame && !mapreset)
|
||||
@@ -739,7 +740,7 @@ void ST_Drawer(void)
|
||||
UINT8 i;
|
||||
|
||||
#ifdef SEENAMES
|
||||
if (cv_seenames.value && cv_allowseenames.value && displayplayers[0] == consoleplayer && seenplayer && seenplayer->mo && !mapreset)
|
||||
if (UNLIKELY(cv_seenames.value && cv_allowseenames.value && displayplayers[0] == consoleplayer && seenplayer && seenplayer->mo && !mapreset))
|
||||
{
|
||||
if (cv_seenames.value == 1)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]);
|
||||
|
||||
@@ -457,6 +457,9 @@ static void LoadPalette(const char *lumpname)
|
||||
#endif
|
||||
pLocalPalette[i].s.alpha = 0xFF;
|
||||
|
||||
if (!Cubeapply)
|
||||
continue;
|
||||
|
||||
// lerp of colour cubing! if you want, make it smoother yourself
|
||||
V_CubeApply(&pLocalPalette[i].s.red, &pLocalPalette[i].s.green, &pLocalPalette[i].s.blue);
|
||||
}
|
||||
|
||||
+35
-2
@@ -2039,8 +2039,7 @@ static lumpchecklist_t folderblacklist[] =
|
||||
{NULL, 0},
|
||||
};
|
||||
|
||||
static int
|
||||
W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
static int W_VerifyPK3(FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
{
|
||||
int verified = true;
|
||||
|
||||
@@ -2082,7 +2081,10 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
char *cdir = (char*)(malloc(LONG(zend.cdirsize)));
|
||||
|
||||
if (fread(cdir, 1, LONG(zend.cdirsize), fp) < (UINT32)(LONG(zend.cdirsize)))
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t offset = 0;
|
||||
|
||||
@@ -2094,7 +2096,10 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
char* dotpos;
|
||||
|
||||
if (memcmp(zentry->signature, pat_central, 4) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (verified == true)
|
||||
{
|
||||
@@ -2132,10 +2137,16 @@ W_VerifyPK3 (FILE *fp, lumpchecklist_t *checklist, boolean status)
|
||||
sizeof *zentry + SHORT(zentry->namelen) + SHORT(zentry->xtralen) + SHORT(zentry->commlen);
|
||||
|
||||
if (fseek(fp, LONG(zentry->offset), SEEK_SET) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (fread(&zlentry, 1, sizeof(zlentry_t), fp) < sizeof (zlentry_t))
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
data_size +=
|
||||
sizeof zlentry + SHORT(zlentry.namelen) + SHORT(zlentry.xtralen) + LONG(zlentry.compsize);
|
||||
@@ -2186,7 +2197,9 @@ static int W_VerifyFile(const char *filename, lumpchecklist_t *checklist,
|
||||
goodfile = W_VerifyWAD(handle, checklist, status);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(handle);
|
||||
|
||||
return goodfile;
|
||||
}
|
||||
|
||||
@@ -2341,7 +2354,10 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
char *cdir = (char*)(malloc(LONG(zend.cdirsize)));
|
||||
|
||||
if (fread(cdir, 1, LONG(zend.cdirsize), fp) < (UINT32)(LONG(zend.cdirsize)))
|
||||
{
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t offset = 0;
|
||||
|
||||
@@ -2353,7 +2369,10 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
char* dotpos;
|
||||
|
||||
if (memcmp(zentry->signature, pat_central, 4) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return false;
|
||||
}
|
||||
|
||||
fullname = (char*)(malloc(SHORT(zentry->namelen) + 1));
|
||||
strlcpy(fullname, (char*)(zentry + 1), SHORT(zentry->namelen) + 1);
|
||||
@@ -2373,11 +2392,19 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
strncpy(lumpname, trimname, min(8, dotpos - trimname));
|
||||
|
||||
if (W_NameStartsWith(lumpname, checklist))
|
||||
{
|
||||
free(fullname);
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (W_NameStartsWith(fullname, checklist))
|
||||
{
|
||||
free(fullname);
|
||||
free(cdir);
|
||||
return true;
|
||||
}
|
||||
|
||||
free(fullname);
|
||||
|
||||
@@ -2387,10 +2414,16 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist)
|
||||
sizeof *zentry + SHORT(zentry->namelen) + SHORT(zentry->xtralen) + SHORT(zentry->commlen);
|
||||
|
||||
if (fseek(fp, LONG(zentry->offset), SEEK_SET) != 0)
|
||||
{
|
||||
free(cdir);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fread(&zlentry, 1, sizeof(zlentry_t), fp) < sizeof (zlentry_t))
|
||||
{
|
||||
free(cdir);
|
||||
return false;
|
||||
}
|
||||
|
||||
data_size +=
|
||||
sizeof zlentry + SHORT(zlentry.namelen) + SHORT(zlentry.xtralen) + LONG(zlentry.compsize);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <winuser.h>
|
||||
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
+63
-10
@@ -149,9 +149,12 @@ void Z_Free(void *ptr)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#ifdef ZDEBUG2
|
||||
// Write every Z_Free call to a debug file.
|
||||
CONS_Debug(DBG_MEMORY, "Z_Free at %s:%d\n", file, line);
|
||||
#elif defined(ZDEBUG)
|
||||
(void)file;
|
||||
(void)line;
|
||||
#endif
|
||||
|
||||
// anything that isn't by lua gets passed to lua just in case.
|
||||
@@ -358,8 +361,10 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
return NULL;
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#ifdef ZDEBUG2
|
||||
// Write every Z_Realloc call to a debug file.
|
||||
DEBFILE(va("Z_Realloc at %s:%d\n", file, line));
|
||||
#endif
|
||||
rez = Z_Malloc2(size, tag, user, alignbits, file, line);
|
||||
#else
|
||||
rez = Z_MallocAlign(size, tag, user, alignbits);
|
||||
@@ -394,11 +399,19 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
* \param lowtag The lowest tag to consider.
|
||||
* \param hightag The highest tag to consider.
|
||||
*/
|
||||
#ifdef ZDEBUG
|
||||
void Z_FreeTags2(INT32 lowtag, INT32 hightag, const char *file, INT32 line)
|
||||
#else
|
||||
void Z_FreeTags(INT32 lowtag, INT32 hightag)
|
||||
#endif
|
||||
{
|
||||
memblock_t *block, *next;
|
||||
|
||||
#ifdef ZDEBUG
|
||||
Z_CheckHeap2(file, line);
|
||||
#else
|
||||
Z_CheckHeap(420);
|
||||
#endif
|
||||
for (block = head.next; block != &head; block = next)
|
||||
{
|
||||
next = block->next; // get link before freeing
|
||||
@@ -468,12 +481,20 @@ void Z_CheckMemCleanup(void)
|
||||
* \param i Identifies from where in the code Z_CheckHeap was called.
|
||||
* \author Graue <graue@oceanbase.org>
|
||||
*/
|
||||
void Z_CheckHeap(INT32 i)
|
||||
#ifdef ZDEBUG
|
||||
void Z_CheckHeap2(const char *file, INT32 line)
|
||||
#else
|
||||
void Z_CheckHeap(INT32 tag)
|
||||
#endif
|
||||
{
|
||||
memblock_t *block;
|
||||
UINT32 blocknumon = 0;
|
||||
void *given;
|
||||
|
||||
#ifndef ZDEBUG
|
||||
(void)tag;
|
||||
#endif
|
||||
|
||||
for (block = head.next; block != &head; block = block->next)
|
||||
{
|
||||
blocknumon++;
|
||||
@@ -498,11 +519,19 @@ void Z_CheckHeap(INT32 i)
|
||||
#endif
|
||||
if (block->user != NULL && *(block->user) != given)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" doesn't have a proper user", i, blocknumon
|
||||
" doesn't have a proper user"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -510,11 +539,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->next->prev != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper backlink", i, blocknumon
|
||||
" lacks proper backlink"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -522,11 +559,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->prev->next != block)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" lacks proper forward link", i, blocknumon
|
||||
" lacks proper forward link"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
@@ -534,11 +579,19 @@ void Z_CheckHeap(INT32 i)
|
||||
}
|
||||
if (block->id != ZONEID)
|
||||
{
|
||||
I_Error("Z_CheckHeap %d: block %u"
|
||||
I_Error("Z_CheckHeap"
|
||||
#ifdef ZDEBUG
|
||||
"at %s %d :"
|
||||
#endif
|
||||
"block %u"
|
||||
#ifdef ZDEBUG
|
||||
"(owned by %s:%d)"
|
||||
#endif
|
||||
" have the wrong ID", i, blocknumon
|
||||
" have the wrong ID"
|
||||
#ifdef ZDEBUG
|
||||
, file, line
|
||||
#endif
|
||||
, blocknumon
|
||||
#ifdef ZDEBUG
|
||||
, block->ownerfile, block->ownerline
|
||||
#endif
|
||||
|
||||
+14
-2
@@ -28,7 +28,7 @@
|
||||
#define FUNCALLOC(x)
|
||||
#endif
|
||||
|
||||
//#define ZDEBUG
|
||||
#define ZDEBUG
|
||||
|
||||
//
|
||||
// Purge tags
|
||||
@@ -110,8 +110,14 @@ void *Z_ReallocAlign(void *ptr, size_t size, INT32 tag, void *user, INT32 alignb
|
||||
// Free all memory by tag
|
||||
// these don't give line numbers for ZDEBUG currently though
|
||||
// (perhaps this should be changed in future?)
|
||||
#ifdef ZDEBUG
|
||||
#define Z_FreeTag(tagnum) Z_FreeTags2(tagnum, tagnum, __FILE__, __LINE__)
|
||||
#define Z_FreeTags(tagnum, tagnum2) Z_FreeTags2(tagnum, tagnum2, __FILE__, __LINE__)
|
||||
void Z_FreeTags2(INT32 lowtag, INT32 hightag, const char *file, INT32 line);
|
||||
#else
|
||||
#define Z_FreeTag(tagnum) Z_FreeTags(tagnum, tagnum)
|
||||
void Z_FreeTags(INT32 lowtag, INT32 hightag);
|
||||
#endif
|
||||
|
||||
// Iterate memory by tag
|
||||
#define Z_IterateTag(tagnum, func) Z_IterateTags(tagnum, tagnum, func)
|
||||
@@ -121,7 +127,13 @@ void Z_IterateTags(INT32 lowtag, INT32 hightag, boolean (*iterfunc)(void *));
|
||||
// Utility functions
|
||||
//
|
||||
void Z_CheckMemCleanup(void);
|
||||
void Z_CheckHeap(INT32 i);
|
||||
|
||||
#ifdef ZDEBUG
|
||||
#define Z_CheckHeap(tag) Z_CheckHeap2(__FILE__, __LINE__)
|
||||
void Z_CheckHeap2(const char *file, INT32 line);
|
||||
#else
|
||||
void Z_CheckHeap(INT32 tag);
|
||||
#endif
|
||||
|
||||
//
|
||||
// Zone memory modification
|
||||
|
||||
Reference in new issue
Block a user