Merge branch 'master' of git.magicalgirl.moe:STJr/SRB2Internal into newmenus

This commit is contained in:
Steel Titanium 2019-08-18 13:46:50 -04:00
commit 07cf717e33
24 changed files with 166 additions and 193 deletions

View file

@ -92,8 +92,8 @@ before_build:
- ccache -V - ccache -V
- ccache -s - ccache -s
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" ) - if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC72=1 NOOBJDUMP=1 %NOUPX%" - set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC73=1 NOOBJDUMP=1 %NOUPX%"
- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1" ) - if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" )
- set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1" - set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1"
build_script: build_script:

View file

@ -7,11 +7,19 @@
# and other things # and other things
# #
ifdef GCC81 ifdef GCC91
GCC80=1 GCC83=1
endif endif
ifdef GCC80 ifdef GCC83
GCC82=1
endif
ifdef GCC82
GCC81=1
endif
ifdef GCC81
GCC72=1 GCC72=1
endif endif
@ -142,6 +150,9 @@ ifdef GCC43
endif endif
endif endif
WFLAGS+=-Wsign-compare WFLAGS+=-Wsign-compare
ifdef GCC91
WFLAGS+=-Wno-error=address-of-packed-member
endif
ifdef GCC45 ifdef GCC45
WFLAGS+=-Wlogical-op WFLAGS+=-Wlogical-op
endif endif
@ -178,6 +189,9 @@ ifndef GCC295
endif endif
endif endif
WFLAGS+=-Wformat-y2k WFLAGS+=-Wformat-y2k
ifdef GCC71
WFLAGS+=-Wno-error=format-overflow=2
endif
WFLAGS+=-Wformat-security WFLAGS+=-Wformat-security
ifndef GCC29 ifndef GCC29
#WFLAGS+=-Winit-self #WFLAGS+=-Winit-self
@ -215,7 +229,7 @@ ifdef GCC71
WFLAGS+=-Wno-error=implicit-fallthrough WFLAGS+=-Wno-error=implicit-fallthrough
WFLAGS+=-Wno-implicit-fallthrough WFLAGS+=-Wno-implicit-fallthrough
endif endif
ifdef GCC80 ifdef GCC81
WFLAGS+=-Wno-error=format-overflow WFLAGS+=-Wno-error=format-overflow
WFLAGS+=-Wno-error=stringop-truncation WFLAGS+=-Wno-error=stringop-truncation
WFLAGS+=-Wno-error=stringop-overflow WFLAGS+=-Wno-error=stringop-overflow

View file

@ -148,7 +148,7 @@ extern FILE *logstream;
// Does this version require an added patch file? // Does this version require an added patch file?
// Comment or uncomment this as necessary. // Comment or uncomment this as necessary.
#define USE_PATCH_DTA //#define USE_PATCH_DTA
// Use .kart extension addons // Use .kart extension addons
//#define USE_KART //#define USE_KART

View file

@ -46,7 +46,7 @@
// Stage of animation: // Stage of animation:
// 0 = text, 1 = art screen // 0 = text, 1 = art screen
static INT32 finalecount; static INT32 finalecount;
INT32 titlescrollxspeed = 80; INT32 titlescrollxspeed = 20;
INT32 titlescrollyspeed = 0; INT32 titlescrollyspeed = 0;
UINT8 titlemapinaction = TITLEMAP_OFF; UINT8 titlemapinaction = TITLEMAP_OFF;
@ -68,7 +68,7 @@ static INT32 menuanimtimer; // Title screen: background animation timing
mobj_t *titlemapcameraref = NULL; mobj_t *titlemapcameraref = NULL;
// menu presentation state // menu presentation state
char curbgname[8]; char curbgname[9];
SINT8 curfadevalue; SINT8 curfadevalue;
boolean curhidepics; boolean curhidepics;
INT32 curbgcolor; INT32 curbgcolor;
@ -2093,7 +2093,7 @@ void F_InitMenuPresValues(void)
activeMenuId = MainDef.menuid; activeMenuId = MainDef.menuid;
// Set defaults for presentation values // Set defaults for presentation values
strncpy(curbgname, "TITLESKY", 8); strncpy(curbgname, "TITLESKY", 9);
curfadevalue = 16; curfadevalue = 16;
curhidepics = hidetitlepics; curhidepics = hidetitlepics;
curbgcolor = -1; curbgcolor = -1;

View file

@ -87,7 +87,7 @@ typedef enum
// Current menu parameters // Current menu parameters
extern mobj_t *titlemapcameraref; extern mobj_t *titlemapcameraref;
extern char curbgname[8]; extern char curbgname[9];
extern SINT8 curfadevalue; extern SINT8 curfadevalue;
extern boolean curhidepics; extern boolean curhidepics;
extern INT32 curbgcolor; extern INT32 curbgcolor;

View file

@ -97,7 +97,7 @@ boolean runemeraldmanager = false;
UINT16 emeraldspawndelay = 60*TICRATE; UINT16 emeraldspawndelay = 60*TICRATE;
// menu demo things // menu demo things
UINT8 numDemos = 3; UINT8 numDemos = 0;
UINT32 demoDelayTime = 15*TICRATE; UINT32 demoDelayTime = 15*TICRATE;
UINT32 demoIdleTime = 3*TICRATE; UINT32 demoIdleTime = 3*TICRATE;

View file

@ -1198,7 +1198,7 @@ static UINT8 P_GetModelSprite2(md2_t *md2, skin_t *skin, UINT8 spr2, player_t *p
if (!md2 || !skin) if (!md2 || !skin)
return 0; return 0;
if ((spr2 & ~FF_SPR2SUPER) >= free_spr2) if ((unsigned)(spr2 & ~FF_SPR2SUPER) >= free_spr2)
return 0; return 0;
while (!(md2->model->spr2frames[spr2*2 + 1]) while (!(md2->model->spr2frames[spr2*2 + 1])

View file

@ -68,10 +68,10 @@ static int inet_aton(const char *cp, struct in_addr *addr)
#ifdef USE_WINSOCK2 #ifdef USE_WINSOCK2
static HMODULE ipv6dll = NULL; static HMODULE ipv6dll = NULL;
typedef int (WSAAPI *p_getaddrinfo) (const char *node, const char *service, typedef int (WSAAPI *p_getaddrinfo) (const char *, const char *,
const struct my_addrinfo *hints, const struct my_addrinfo *,
struct my_addrinfo **res); struct my_addrinfo **);
typedef void (WSAAPI *p_freeaddrinfo) (struct my_addrinfo *res); typedef void (WSAAPI *p_freeaddrinfo) (struct my_addrinfo *);
static p_getaddrinfo WS_getaddrinfo = NULL; static p_getaddrinfo WS_getaddrinfo = NULL;
static p_freeaddrinfo WS_freeaddrinfo = NULL; static p_freeaddrinfo WS_freeaddrinfo = NULL;
@ -80,10 +80,10 @@ static HMODULE WS_getfunctions(HMODULE tmp)
{ {
if (tmp != NULL) if (tmp != NULL)
{ {
WS_getaddrinfo = (p_getaddrinfo)GetProcAddress(tmp, "getaddrinfo"); WS_getaddrinfo = (p_getaddrinfo)(LPVOID)GetProcAddress(tmp, "getaddrinfo");
if (WS_getaddrinfo == NULL) if (WS_getaddrinfo == NULL)
return NULL; return NULL;
WS_freeaddrinfo = (p_freeaddrinfo)GetProcAddress(tmp, "freeaddrinfo"); WS_freeaddrinfo = (p_freeaddrinfo)(LPVOID)GetProcAddress(tmp, "freeaddrinfo");
if (WS_freeaddrinfo == NULL) if (WS_freeaddrinfo == NULL)
{ {
WS_getaddrinfo = NULL; WS_getaddrinfo = NULL;

View file

@ -1310,12 +1310,12 @@ static menuitem_t OP_SoundOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 115}, // 56 {IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 115}, // 56
{IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, 125}, // 62 {IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, 125}, // 62
#if defined(HAVE_OPENMPT) || defined(HAVE_MIXERX) #ifdef HAVE_MIXERX
{IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 143}, {IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 143},
#endif #endif
}; };
#if defined(HAVE_OPENMPT) || defined(HAVE_MIXERX) #ifdef HAVE_MIXERX
#ifdef HAVE_OPENMPT #ifdef HAVE_OPENMPT
#define OPENMPT_MENUOFFSET 32 #define OPENMPT_MENUOFFSET 32
@ -2337,7 +2337,7 @@ static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval,
} }
else if (menupres[menutype].bgname[0]) else if (menupres[menutype].bgname[0])
{ {
strncpy(curbgname, menupres[menutype].bgname, 8); strncpy(curbgname, menupres[menutype].bgname, 9);
curbgxspeed = menupres[menutype].titlescrollxspeed != INT32_MAX ? menupres[menutype].titlescrollxspeed : titlescrollxspeed; curbgxspeed = menupres[menutype].titlescrollxspeed != INT32_MAX ? menupres[menutype].titlescrollxspeed : titlescrollxspeed;
curbgyspeed = menupres[menutype].titlescrollyspeed != INT32_MAX ? menupres[menutype].titlescrollyspeed : titlescrollyspeed; curbgyspeed = menupres[menutype].titlescrollyspeed != INT32_MAX ? menupres[menutype].titlescrollyspeed : titlescrollyspeed;
return true; return true;
@ -2350,7 +2350,7 @@ static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval,
curbghide = true; curbghide = true;
else else
{ {
strncpy(curbgname, defaultname, 8); strncpy(curbgname, defaultname, 9);
curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed; curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed;
curbgyspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollyspeed; curbgyspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollyspeed;
} }
@ -2509,7 +2509,7 @@ static void M_HandleMenuPresState(menu_t *newMenu)
activeMenuId = newMenu ? newMenu->menuid : 0; activeMenuId = newMenu ? newMenu->menuid : 0;
// Set defaults for presentation values // Set defaults for presentation values
strncpy(curbgname, "TITLESKY", 8); strncpy(curbgname, "TITLESKY", 9);
curfadevalue = 16; curfadevalue = 16;
curhidepics = hidetitlepics; curhidepics = hidetitlepics;
curbgcolor = -1; curbgcolor = -1;

View file

@ -58,7 +58,7 @@ typedef off_t off64_t;
#endif #endif
#endif #endif
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) #if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) && (__GNUC__ < 8)
#define PRIdS "u" #define PRIdS "u"
#elif defined (_WIN32) #elif defined (_WIN32)
#define PRIdS "Iu" #define PRIdS "Iu"

View file

@ -419,10 +419,6 @@ void P_CameraLineOpening(line_t *linedef)
if (front->ffloors || back->ffloors) if (front->ffloors || back->ffloors)
{ {
ffloor_t *rover; ffloor_t *rover;
fixed_t highestceiling = highceiling;
fixed_t lowestceiling = opentop;
fixed_t highestfloor = openbottom;
fixed_t lowestfloor = lowfloor;
fixed_t delta1, delta2; fixed_t delta1, delta2;
// Check for frontsector's fake floors // Check for frontsector's fake floors
@ -438,15 +434,15 @@ void P_CameraLineOpening(line_t *linedef)
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2))); delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (bottomheight < lowestceiling && delta1 >= delta2) if (bottomheight < opentop && delta1 >= delta2)
lowestceiling = bottomheight; opentop = bottomheight;
else if (bottomheight < highestceiling && delta1 >= delta2) else if (bottomheight < highceiling && delta1 >= delta2)
highestceiling = bottomheight; highceiling = bottomheight;
if (topheight > highestfloor && delta1 < delta2) if (topheight > openbottom && delta1 < delta2)
highestfloor = topheight; openbottom = topheight;
else if (topheight > lowestfloor && delta1 < delta2) else if (topheight > lowfloor && delta1 < delta2)
lowestfloor = topheight; lowfloor = topheight;
} }
// Check for backsectors fake floors // Check for backsectors fake floors
@ -462,28 +458,16 @@ void P_CameraLineOpening(line_t *linedef)
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2))); delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (bottomheight < lowestceiling && delta1 >= delta2) if (bottomheight < opentop && delta1 >= delta2)
lowestceiling = bottomheight; opentop = bottomheight;
else if (bottomheight < highestceiling && delta1 >= delta2) else if (bottomheight < highceiling && delta1 >= delta2)
highestceiling = bottomheight; highceiling = bottomheight;
if (topheight > highestfloor && delta1 < delta2) if (topheight > openbottom && delta1 < delta2)
highestfloor = topheight; openbottom = topheight;
else if (topheight > lowestfloor && delta1 < delta2) else if (topheight > lowfloor && delta1 < delta2)
lowestfloor = topheight; lowfloor = topheight;
} }
if (highestceiling < highceiling)
highceiling = highestceiling;
if (highestfloor > openbottom)
openbottom = highestfloor;
if (lowestceiling < opentop)
opentop = lowestceiling;
if (lowestfloor > lowfloor)
lowfloor = lowestfloor;
} }
openrange = opentop - openbottom; openrange = opentop - openbottom;
return; return;
@ -501,25 +485,27 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
return; return;
} }
// Treat polyobjects kind of like 3D Floors front = linedef->frontsector;
#ifdef POLYOBJECTS back = linedef->backsector;
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
{
front = linedef->frontsector;
back = linedef->frontsector;
}
else
#endif
{
front = linedef->frontsector;
back = linedef->backsector;
}
I_Assert(front != NULL); I_Assert(front != NULL);
I_Assert(back != NULL); I_Assert(back != NULL);
openfloorrover = openceilingrover = NULL; openfloorrover = openceilingrover = NULL;
#ifdef POLYOBJECTS
if (linedef->polyobj)
{
// set these defaults so that polyobjects don't interfere with collision above or below them
opentop = INT32_MAX;
openbottom = INT32_MIN;
highceiling = INT32_MIN;
lowfloor = INT32_MAX;
#ifdef ESLOPE
opentopslope = openbottomslope = NULL;
#endif
}
else
#endif
{ // Set open and high/low values here { // Set open and high/low values here
fixed_t frontheight, backheight; fixed_t frontheight, backheight;
@ -625,27 +611,49 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
} }
} }
} }
// Check for fake floors in the sector.
if (front->ffloors || back->ffloors
#ifdef POLYOBJECTS #ifdef POLYOBJECTS
|| linedef->polyobj if (linedef->polyobj)
{
// Treat polyobj's backsector like a 3D Floor
if (linedef->polyobj->flags & POF_TESTHEIGHT)
{
const sector_t *polysec = linedef->backsector;
fixed_t polytop, polybottom;
fixed_t delta1, delta2;
if (linedef->polyobj->flags & POF_CLIPPLANES)
{
polytop = polysec->ceilingheight;
polybottom = polysec->floorheight;
}
else
{
polytop = INT32_MAX;
polybottom = INT32_MIN;
}
delta1 = abs(mobj->z - (polybottom + ((polytop - polybottom)/2)));
delta2 = abs(thingtop - (polybottom + ((polytop - polybottom)/2)));
if (polybottom < opentop && delta1 >= delta2)
opentop = polybottom;
else if (polybottom < highceiling && delta1 >= delta2)
highceiling = polybottom;
if (polytop > openbottom && delta1 < delta2)
openbottom = polytop;
else if (polytop > lowfloor && delta1 < delta2)
lowfloor = polytop;
}
// otherwise don't do anything special, pretend there's nothing else there
}
else
#endif #endif
) // Check for fake floors in the sector.
if (front->ffloors || back->ffloors)
{ {
ffloor_t *rover; ffloor_t *rover;
fixed_t highestceiling = highceiling;
fixed_t lowestceiling = opentop;
fixed_t highestfloor = openbottom;
fixed_t lowestfloor = lowfloor;
fixed_t delta1, delta2; fixed_t delta1, delta2;
#ifdef ESLOPE
pslope_t *ceilingslope = opentopslope;
pslope_t *floorslope = openbottomslope;
#endif
ffloor_t *floorrover = NULL;
ffloor_t *ceilingrover = NULL;
// Check for frontsector's fake floors // Check for frontsector's fake floors
for (rover = front->ffloors; rover; rover = rover->next) for (rover = front->ffloors; rover; rover = rover->next)
@ -668,28 +676,28 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
{ {
if (bottomheight < lowestceiling) { if (bottomheight < opentop) {
lowestceiling = bottomheight; opentop = bottomheight;
#ifdef ESLOPE #ifdef ESLOPE
ceilingslope = *rover->b_slope; opentopslope = *rover->b_slope;
#endif #endif
ceilingrover = rover; openceilingrover = rover;
} }
else if (bottomheight < highestceiling) else if (bottomheight < highceiling)
highestceiling = bottomheight; highceiling = bottomheight;
} }
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
{ {
if (topheight > highestfloor) { if (topheight > openbottom) {
highestfloor = topheight; openbottom = topheight;
#ifdef ESLOPE #ifdef ESLOPE
floorslope = *rover->t_slope; openbottomslope = *rover->t_slope;
#endif #endif
floorrover = rover; openfloorrover = rover;
} }
else if (topheight > lowestfloor) else if (topheight > lowfloor)
lowestfloor = topheight; lowfloor = topheight;
} }
} }
@ -714,81 +722,30 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
{ {
if (bottomheight < lowestceiling) { if (bottomheight < opentop) {
lowestceiling = bottomheight; opentop = bottomheight;
#ifdef ESLOPE #ifdef ESLOPE
ceilingslope = *rover->b_slope; opentopslope = *rover->b_slope;
#endif #endif
ceilingrover = rover; openceilingrover = rover;
} }
else if (bottomheight < highestceiling) else if (bottomheight < highceiling)
highestceiling = bottomheight; highceiling = bottomheight;
} }
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
{ {
if (topheight > highestfloor) { if (topheight > openbottom) {
highestfloor = topheight; openbottom = topheight;
#ifdef ESLOPE #ifdef ESLOPE
floorslope = *rover->t_slope; openbottomslope = *rover->t_slope;
#endif #endif
floorrover = rover; openfloorrover = rover;
} }
else if (topheight > lowestfloor) else if (topheight > lowfloor)
lowestfloor = topheight; lowfloor = topheight;
} }
} }
#ifdef POLYOBJECTS
// Treat polyobj's backsector like a 3D Floor
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
{
const sector_t *polysec = linedef->backsector;
delta1 = abs(mobj->z - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2)));
delta2 = abs(thingtop - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2)));
if (polysec->floorheight < lowestceiling && delta1 >= delta2) {
lowestceiling = polysec->floorheight;
#ifdef ESLOPE
ceilingslope = NULL;
#endif
ceilingrover = NULL;
}
else if (polysec->floorheight < highestceiling && delta1 >= delta2)
highestceiling = polysec->floorheight;
if (polysec->ceilingheight > highestfloor && delta1 < delta2) {
highestfloor = polysec->ceilingheight;
#ifdef ESLOPE
floorslope = NULL;
#endif
floorrover = NULL;
}
else if (polysec->ceilingheight > lowestfloor && delta1 < delta2)
lowestfloor = polysec->ceilingheight;
}
#endif
if (highestceiling < highceiling)
highceiling = highestceiling;
if (highestfloor > openbottom) {
openbottom = highestfloor;
#ifdef ESLOPE
openbottomslope = floorslope;
#endif
openfloorrover = floorrover;
}
if (lowestceiling < opentop) {
opentop = lowestceiling;
#ifdef ESLOPE
opentopslope = ceilingslope;
#endif
openceilingrover = ceilingrover;
}
if (lowestfloor > lowfloor)
lowfloor = lowestfloor;
} }
} }

View file

@ -2404,7 +2404,7 @@ static void P_NetArchiveThinkers(void)
} }
#endif // ESLOPE #endif // ESLOPE
#ifdef PARANOIA #ifdef PARANOIA
else if (th->function.acp1 != P_RemoveThinkerDelayed) // wait garbage collection else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection
I_Error("unknown thinker type %p", th->function.acp1); I_Error("unknown thinker type %p", th->function.acp1);
#endif #endif
} }

View file

@ -717,7 +717,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
if (slope->flags & SL_NOPHYSICS) { // No physics, no need to make anything complicated. if (slope->flags & SL_NOPHYSICS) { // No physics, no need to make anything complicated.
if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope
thing->momz = -P_MobjFlip(thing); //thing->momz = -P_MobjFlip(thing);
thing->standingslope = slope; thing->standingslope = slope;
} }
return; return;
@ -732,7 +732,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
if (P_MobjFlip(thing)*mom.z < 0) { // falling, land on slope if (P_MobjFlip(thing)*mom.z < 0) { // falling, land on slope
thing->momx = mom.x; thing->momx = mom.x;
thing->momy = mom.y; thing->momy = mom.y;
thing->momz = -P_MobjFlip(thing); //thing->momz = -P_MobjFlip(thing);
thing->standingslope = slope; thing->standingslope = slope;
} }

View file

@ -199,7 +199,7 @@ void P_InitThinkers(void)
void P_AddThinker(const thinklistnum_t n, thinker_t *thinker) void P_AddThinker(const thinklistnum_t n, thinker_t *thinker)
{ {
#ifdef PARANOIA #ifdef PARANOIA
I_Assert(n >= 0 && n < NUM_THINKERLISTS); I_Assert(n < NUM_THINKERLISTS);
#endif #endif
thlist[n].prev->next = thinker; thlist[n].prev->next = thinker;
@ -328,7 +328,7 @@ static inline void P_RunThinkers(void)
for (currentthinker = thlist[i].next; currentthinker != &thlist[i]; currentthinker = currentthinker->next) for (currentthinker = thlist[i].next; currentthinker != &thlist[i]; currentthinker = currentthinker->next)
{ {
#ifdef PARANOIA #ifdef PARANOIA
I_Assert(currentthinker->function.acp1 != NULL) I_Assert(currentthinker->function.acp1 != NULL);
#endif #endif
currentthinker->function.acp1(currentthinker); currentthinker->function.acp1(currentthinker);
} }

View file

@ -4730,6 +4730,7 @@ void P_DoAbilityBounce(player_t *player, boolean changemomz)
return; return;
if (changemomz) if (changemomz)
{ {
fixed_t minmomz;
prevmomz = player->mo->momz; prevmomz = player->mo->momz;
if (P_MobjFlip(player->mo)*prevmomz < 0) if (P_MobjFlip(player->mo)*prevmomz < 0)
prevmomz = 0; prevmomz = 0;
@ -4737,7 +4738,8 @@ void P_DoAbilityBounce(player_t *player, boolean changemomz)
prevmomz /= 2; prevmomz /= 2;
P_DoJump(player, false); P_DoJump(player, false);
player->pflags &= ~(PF_STARTJUMP|PF_JUMPED); player->pflags &= ~(PF_STARTJUMP|PF_JUMPED);
player->mo->momz = (FixedMul(player->mo->momz, 3*FRACUNIT/2) + prevmomz)/2; minmomz = FixedMul(player->mo->momz, 3*FRACUNIT/2);
player->mo->momz = max(minmomz, (minmomz + prevmomz)/2);
} }
S_StartSound(player->mo, sfx_boingf); S_StartSound(player->mo, sfx_boingf);
P_SetPlayerMobjState(player->mo, S_PLAY_BOUNCE_LANDING); P_SetPlayerMobjState(player->mo, S_PLAY_BOUNCE_LANDING);
@ -10389,7 +10391,7 @@ static void P_MinecartThink(player_t *player)
if (P_IsObjectOnGround(minecart)) if (P_IsObjectOnGround(minecart))
{ {
sector_t *sec; sector_t *sec;
INT32 lnum; INT32 lnum = -1;
fixed_t dummy; fixed_t dummy;
// Just hit floor. // Just hit floor.

View file

@ -2511,7 +2511,7 @@ UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player)
if (!skin) if (!skin)
return 0; return 0;
if ((spr2 & ~FF_SPR2SUPER) >= free_spr2) if ((unsigned)(spr2 & ~FF_SPR2SUPER) >= free_spr2)
return 0; return 0;
while (!(skin->sprites[spr2].numframes) while (!(skin->sprites[spr2].numframes)

View file

@ -1479,7 +1479,7 @@ const char *I_GetJoyName(INT32 joyindex)
{ {
tempname = SDL_JoystickNameForIndex(joyindex); tempname = SDL_JoystickNameForIndex(joyindex);
if (tempname) if (tempname)
strncpy(joyname, tempname, 255); strncpy(joyname, tempname, 254);
} }
SDL_QuitSubSystem(SDL_INIT_JOYSTICK); SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
} }
@ -1487,7 +1487,7 @@ const char *I_GetJoyName(INT32 joyindex)
{ {
tempname = SDL_JoystickNameForIndex(joyindex); tempname = SDL_JoystickNameForIndex(joyindex);
if (tempname) if (tempname)
strncpy(joyname, tempname, 255); strncpy(joyname, tempname, 254);
} }
return joyname; return joyname;
} }
@ -2042,7 +2042,7 @@ static void I_ShutdownTimer(void)
pfntimeGetTime = NULL; pfntimeGetTime = NULL;
if (winmm) if (winmm)
{ {
p_timeEndPeriod pfntimeEndPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeEndPeriod"); p_timeEndPeriod pfntimeEndPeriod = (p_timeEndPeriod)(LPVOID)GetProcAddress(winmm, "timeEndPeriod");
if (pfntimeEndPeriod) if (pfntimeEndPeriod)
pfntimeEndPeriod(1); pfntimeEndPeriod(1);
FreeLibrary(winmm); FreeLibrary(winmm);
@ -2087,10 +2087,10 @@ void I_StartupTimer(void)
winmm = LoadLibraryA("winmm.dll"); winmm = LoadLibraryA("winmm.dll");
if (winmm) if (winmm)
{ {
p_timeEndPeriod pfntimeBeginPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeBeginPeriod"); p_timeEndPeriod pfntimeBeginPeriod = (p_timeEndPeriod)(LPVOID)GetProcAddress(winmm, "timeBeginPeriod");
if (pfntimeBeginPeriod) if (pfntimeBeginPeriod)
pfntimeBeginPeriod(1); pfntimeBeginPeriod(1);
pfntimeGetTime = (p_timeGetTime)GetProcAddress(winmm, "timeGetTime"); pfntimeGetTime = (p_timeGetTime)(LPVOID)GetProcAddress(winmm, "timeGetTime");
} }
I_AddExitFunc(I_ShutdownTimer); I_AddExitFunc(I_ShutdownTimer);
#endif #endif
@ -2389,7 +2389,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
if (!testwin95) if (!testwin95)
{ {
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"); pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
testwin95 = true; testwin95 = true;
} }
if (pfnGetDiskFreeSpaceEx) if (pfnGetDiskFreeSpaceEx)
@ -2413,7 +2413,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
char *I_GetUserName(void) char *I_GetUserName(void)
{ {
static char username[MAXPLAYERNAME]; static char username[MAXPLAYERNAME+1];
char *p; char *p;
#ifdef _WIN32 #ifdef _WIN32
DWORD i = MAXPLAYERNAME; DWORD i = MAXPLAYERNAME;
@ -2884,7 +2884,7 @@ const CPUInfoFlags *I_CPUInfo(void)
#if defined (_WIN32) #if defined (_WIN32)
static CPUInfoFlags WIN_CPUInfo; static CPUInfoFlags WIN_CPUInfo;
SYSTEM_INFO SI; SYSTEM_INFO SI;
p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent");
ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo)); ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo));
if (pfnCPUID) if (pfnCPUID)

View file

@ -163,7 +163,10 @@ static void MidiSoundfontPath_Onchange(void)
boolean proceed = true; boolean proceed = true;
// check if file exists; menu calls this method at every keystroke // check if file exists; menu calls this method at every keystroke
while ((miditoken = strtok_r(source, ";", &source))) // get first token
miditoken = strtok(source, ";");
while (miditoken != NULL)
{ {
SDL_RWops *rw = SDL_RWFromFile(miditoken, "r"); SDL_RWops *rw = SDL_RWFromFile(miditoken, "r");
if (rw != NULL) if (rw != NULL)
@ -173,6 +176,7 @@ static void MidiSoundfontPath_Onchange(void)
proceed = false; proceed = false;
break; break;
} }
miditoken = strtok(NULL, ";");
} }
free(source); free(source);

View file

@ -56,10 +56,6 @@ ifndef GCC44
#OPTS+=-mms-bitfields #OPTS+=-mms-bitfields
endif endif
ifndef MINGW64
OPTS+=-gdwarf-2
endif
ifndef SDL ifndef SDL
OPTS+=-D_WINDOWS OPTS+=-D_WINDOWS
endif endif

View file

@ -147,7 +147,7 @@ static inline BOOL LoadDirectDraw(VOID)
DDrawDLL = LoadLibraryA("DDRAW.DLL"); DDrawDLL = LoadLibraryA("DDRAW.DLL");
if (DDrawDLL == NULL) if (DDrawDLL == NULL)
return false; return false;
pfnDirectDrawCreate = (DDCreate)GetProcAddress(DDrawDLL, "DirectDrawCreate"); pfnDirectDrawCreate = (DDCreate)(LPVOID)GetProcAddress(DDrawDLL, "DirectDrawCreate");
if (pfnDirectDrawCreate == NULL) if (pfnDirectDrawCreate == NULL)
return false; return false;
return true; return true;

View file

@ -3395,7 +3395,7 @@ BOOL LoadDirectInput(VOID)
DInputDLL = LoadLibraryA("DINPUT.DLL"); DInputDLL = LoadLibraryA("DINPUT.DLL");
if (DInputDLL == NULL) if (DInputDLL == NULL)
return false; return false;
pfnDirectInputCreateA = (DICreateA)GetProcAddress(DInputDLL, "DirectInputCreateA"); pfnDirectInputCreateA = (DICreateA)(LPVOID)GetProcAddress(DInputDLL, "DirectInputCreateA");
if (pfnDirectInputCreateA == NULL) if (pfnDirectInputCreateA == NULL)
return false; return false;
return true; return true;
@ -3529,7 +3529,7 @@ void I_GetDiskFreeSpace(INT64* freespace)
if (!testwin95) if (!testwin95)
{ {
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA"); pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
testwin95 = true; testwin95 = true;
} }
if (pfnGetDiskFreeSpaceEx) if (pfnGetDiskFreeSpaceEx)
@ -3615,7 +3615,7 @@ const CPUInfoFlags *I_CPUInfo(void)
{ {
static CPUInfoFlags WIN_CPUInfo; static CPUInfoFlags WIN_CPUInfo;
SYSTEM_INFO SI; SYSTEM_INFO SI;
p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent"); p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent");
ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo)); ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo));
if (pfnCPUID) if (pfnCPUID)
@ -3658,9 +3658,9 @@ static p_SetProcessAffinityMask pfnSetProcessAffinityMask = NULL;
static inline VOID GetAffinityFuncs(VOID) static inline VOID GetAffinityFuncs(VOID)
{ {
HMODULE h = GetModuleHandleA("kernel32.dll"); HMODULE h = GetModuleHandleA("kernel32.dll");
pfnGetCurrentProcess = (p_GetCurrentProcess)GetProcAddress(h, "GetCurrentProcess"); pfnGetCurrentProcess = (p_GetCurrentProcess)(LPVOID)GetProcAddress(h, "GetCurrentProcess");
pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)GetProcAddress(h, "GetProcessAffinityMask"); pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)(LPVOID)GetProcAddress(h, "GetProcessAffinityMask");
pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)GetProcAddress(h, "SetProcessAffinityMask"); pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)(LPVOID)GetProcAddress(h, "SetProcessAffinityMask");
} }
static void CPUAffinity_OnChange(void) static void CPUAffinity_OnChange(void)