Merge branch 'Saturn-Next' into Saturn-Testing

This commit is contained in:
Alug committed 2025-05-29 12:43:04 +01:00
commit 9488d98cfd
9 files changed
+80 -42

No files matched your search

+6 -3
View File
@@ -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;
@@ -319,7 +319,7 @@ static void AM_initVariables(void)
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;
@@ -599,6 +599,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;
-1
View File
@@ -240,7 +240,6 @@ void COM_ImmedExecute(const char *ptext)
while (i < strlen(ptext))
{
quotes = 0;
for (j = 0; i < strlen(ptext); i++,j++)
{
+7 -2
View File
@@ -2776,7 +2776,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);
@@ -3030,9 +3030,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");
}
+9 -3
View File
@@ -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)
@@ -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())
+7 -4
View File
@@ -3998,7 +3998,6 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
}
}
char *G_BuildMapTitle(INT32 mapnum)
{
char *title = NULL;
@@ -6068,15 +6067,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
+35 -17
View File
@@ -7167,8 +7167,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.");
@@ -8123,6 +8126,9 @@ UINT8 skyRoomMenuTranslations[MAXUNLOCKABLES];
static char *M_GetConditionString(condition_t cond)
{
char *title = NULL;
char *response = NULL;
switch(cond.type)
{
case UC_PLAYTIME:
@@ -8149,33 +8155,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:
+7 -9
View File
@@ -2808,6 +2808,10 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
CON_Drawer(); // let the user know what we are going to do
I_FinishUpdate(); // page flip or blit buffer
// Reset the palette
if (rendermode != render_none)
V_SetPaletteLump("PLAYPAL");
// Initialize sector node list.
P_Initsecnode();
@@ -2869,20 +2873,14 @@ 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
if (rendermode != render_none)
{
//V_ResetPaletteCVars(); // dont carry over changed palettes
V_SetPaletteLump(GetPalette()); // Set the level palette
}
V_ReloadPalette(); // Set the level palette
// Print "SPEEDING OFF TO [ZONE] [ACT 1]..."
/*if (rendermode != render_none)
+6 -3
View File
@@ -2043,9 +2043,12 @@ static boolean S_SkipIntroMusic(void)
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)
{
// 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;
}
Z_Free(maptitle);
+3
View File
@@ -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);
}