Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2.git into 2214-pre2

This commit is contained in:
LJ Sonic 2024-10-16 22:46:16 +02:00
commit 3b7543645a
7 changed files with 29 additions and 29 deletions

View file

@ -999,20 +999,8 @@ static void I_GetConsoleEvents(void)
static void I_StartupConsole(void) static void I_StartupConsole(void)
{ {
HANDLE ci, co; HANDLE ci, co;
const INT32 ded = M_CheckParm("-dedicated"); BOOL gotConsole = AllocConsole();
BOOL gotConsole = FALSE; consolevent = !M_CheckParm("-noconsole");
if (M_CheckParm("-console") || ded)
gotConsole = AllocConsole();
#ifdef _DEBUG
else if (M_CheckParm("-noconsole") && !ded)
#else
else if (!M_CheckParm("-console") && !ded)
#endif
{
FreeConsole();
gotConsole = FALSE;
}
if (gotConsole) if (gotConsole)
{ {
SetConsoleTitleA("SRB2 Console"); SetConsoleTitleA("SRB2 Console");
@ -1040,12 +1028,7 @@ static inline void I_ShutdownConsole(void){}
static void I_GetConsoleEvents(void){} static void I_GetConsoleEvents(void){}
static inline void I_StartupConsole(void) static inline void I_StartupConsole(void)
{ {
#ifdef _DEBUG
consolevent = !M_CheckParm("-noconsole"); consolevent = !M_CheckParm("-noconsole");
#else
consolevent = M_CheckParm("-console");
#endif
framebuffer = M_CheckParm("-framebuffer"); framebuffer = M_CheckParm("-framebuffer");
if (framebuffer) if (framebuffer)

View file

@ -157,7 +157,7 @@ void I_wake_all_cond(I_cond *anchor)
pthread_mutex_lock(&thread_lock); pthread_mutex_lock(&thread_lock);
if (*anchor == NULL) if (*anchor == NULL)
{ {
*anchor = malloc(sizeof(pthread_t)); *anchor = malloc(sizeof(pthread_cond_t));
pthread_cond_init(*anchor, NULL); pthread_cond_init(*anchor, NULL);
} }
pthread_mutex_unlock(&thread_lock); pthread_mutex_unlock(&thread_lock);

View file

@ -498,7 +498,9 @@ static int call_string_hooks(Hook_State *hook)
static int call_mobj_type_hooks(Hook_State *hook, mobjtype_t mobj_type) static int call_mobj_type_hooks(Hook_State *hook, mobjtype_t mobj_type)
{ {
if (mobj_type == MT_NULL && ( int numCalls = call_mapped(hook, &mobjHookIds[mobj_type][hook->hook_type]);
if (numCalls > 0 && mobj_type == MT_NULL && (
hook->hook_type == MOBJ_HOOK(MobjThinker ) hook->hook_type == MOBJ_HOOK(MobjThinker )
|| hook->hook_type == MOBJ_HOOK(MobjCollide ) || hook->hook_type == MOBJ_HOOK(MobjCollide )
|| hook->hook_type == MOBJ_HOOK(MobjLineCollide) || hook->hook_type == MOBJ_HOOK(MobjLineCollide)
@ -514,7 +516,7 @@ static int call_mobj_type_hooks(Hook_State *hook, mobjtype_t mobj_type)
mobjHookNames[hook->hook_type]) mobjHookNames[hook->hook_type])
); );
return call_mapped(hook, &mobjHookIds[mobj_type][hook->hook_type]); return numCalls;
} }
static void call_hud_hooks static void call_hud_hooks

View file

@ -1501,13 +1501,13 @@ static void UnArchiveSectors(save_t *save_p)
sectors[i].ceilingheight = P_ReadFixed(save_p); sectors[i].ceilingheight = P_ReadFixed(save_p);
if (diff & SD_FLOORPIC) if (diff & SD_FLOORPIC)
{ {
sectors[i].floorpic = P_AddLevelFlatRuntime((char *)save_p); sectors[i].floorpic = P_AddLevelFlatRuntime((char *)&save_p->buf[save_p->pos]);
save_p += 8; save_p->pos += 8;
} }
if (diff & SD_CEILPIC) if (diff & SD_CEILPIC)
{ {
sectors[i].ceilingpic = P_AddLevelFlatRuntime((char *)save_p); sectors[i].ceilingpic = P_AddLevelFlatRuntime((char *)&save_p->buf[save_p->pos]);
save_p += 8; save_p->pos += 8;
} }
if (diff & SD_LIGHT) if (diff & SD_LIGHT)
sectors[i].lightlevel = P_ReadINT16(save_p); sectors[i].lightlevel = P_ReadINT16(save_p);

View file

@ -1152,8 +1152,14 @@ void R_SetupFrame(player_t *player)
if (quake.epicenter) { if (quake.epicenter) {
// Calculate 3D distance from epicenter, using the camera. // Calculate 3D distance from epicenter, using the camera.
fixed_t xydist = R_PointToDist2(thiscam->x, thiscam->y, quake.epicenter->x, quake.epicenter->y); fixed_t xydist, dist;
fixed_t dist = R_PointToDist2(0, thiscam->z, xydist, quake.epicenter->z); if (P_MobjWasRemoved(r_viewmobj)) {
xydist = R_PointToDist2(thiscam->x, thiscam->y, quake.epicenter->x, quake.epicenter->y);
dist = R_PointToDist2(0, thiscam->z, xydist, quake.epicenter->z);
} else {
xydist = R_PointToDist2(r_viewmobj->x, r_viewmobj->y, quake.epicenter->x, quake.epicenter->y);
dist = R_PointToDist2(0, r_viewmobj->z, xydist, quake.epicenter->z);
}
// More effect closer to epicenter, outside of radius = no effect // More effect closer to epicenter, outside of radius = no effect
if (!quake.radius || dist > quake.radius) if (!quake.radius || dist > quake.radius)

View file

@ -279,6 +279,14 @@ static boolean GetFramesAndRotationsFromShortLumpName(
*ret_rotation2 = R_Char2Rotation(name[7]); *ret_rotation2 = R_Char2Rotation(name[7]);
if (*ret_frame2 >= 64 || *ret_rotation2 == 255) if (*ret_frame2 >= 64 || *ret_rotation2 == 255)
return false; return false;
// TRNSLATE is a valid but extremely unlikely sprite name:
// * The sprite name is "TRNS"
// * The frame is L, rotation A; mirrored to frame T, rotation E
// In the very unfortunate event that TRNSLATE is found between sprite lumps,
// this name check prevents it from being added as a sprite, when it actually isn't.
if (memcmp(name, "TRNSLATE", 8) == 0)
return false;
} }
else else
{ {

View file

@ -2657,7 +2657,8 @@ static lumpchecklist_t folderblacklist[] =
{ {
{"Lua/", 4}, {"Lua/", 4},
{"SOC/", 4}, {"SOC/", 4},
{"Sprites/", 8}, {"Sprites/", 8},
{"LongSprites/", 12},
{"Textures/", 9}, {"Textures/", 9},
{"Patches/", 8}, {"Patches/", 8},
{"Flats/", 6}, {"Flats/", 6},