Merge branch 'public_next'

# Conflicts:
#	src/Makefile
#	src/doomtype.h
#	src/hardware/hw_clip.c
#	src/hardware/hw_main.c
#	src/sdl12/sdl_sound.c
This commit is contained in:
Monster Iestyn 2018-11-10 19:18:34 +00:00
commit e4f157786c
21 changed files with 164 additions and 134 deletions

View File

@ -15,7 +15,9 @@
#define DEALIGNED
#endif
#ifndef _BIG_ENDIAN
#include "endian.h"
#ifndef SRB2_BIG_ENDIAN
//
// Little-endian machines
//
@ -75,7 +77,7 @@
#define READANGLE(p) *((angle_t *)p)++
#endif
#else //_BIG_ENDIAN
#else //SRB2_BIG_ENDIAN
//
// definitions for big-endian machines with alignment constraints.
//
@ -144,7 +146,7 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr)
#define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; })
#define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = readlong(p); p_tmp++; p = (void *)p_tmp; b; })
#define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = readulong(p); p_tmp++; p = (void *)p_tmp; b; })
#endif //_BIG_ENDIAN
#endif //SRB2_BIG_ENDIAN
#undef DEALIGNED

View File

@ -63,6 +63,7 @@ CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}};
CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}};
#define COM_BUF_SIZE 8192 // command buffer size
#define MAX_ALIAS_RECURSION 100 // max recursion allowed for aliases
static INT32 com_wait; // one command per frame (for cmd sequences)
@ -485,6 +486,7 @@ static void COM_ExecuteString(char *ptext)
{
xcommand_t *cmd;
cmdalias_t *a;
static INT32 recursion = 0; // detects recursion and stops it if it goes too far
COM_TokenizeString(ptext);
@ -497,6 +499,7 @@ static void COM_ExecuteString(char *ptext)
{
if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
{
recursion = 0;
cmd->function();
return;
}
@ -507,11 +510,20 @@ static void COM_ExecuteString(char *ptext)
{
if (!stricmp(com_argv[0], a->name))
{
if (recursion > MAX_ALIAS_RECURSION)
{
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
recursion = 0;
return;
}
recursion++;
COM_BufInsertText(a->value);
return;
}
}
recursion = 0;
// check cvars
// Hurdler: added at Ebola's request ;)
// (don't flood the console in software mode with bad gr_xxx command)

View File

@ -151,7 +151,7 @@ void D_PostEvent(const event_t *ev)
eventhead = (eventhead+1) & (MAXEVENTS-1);
}
// just for lock this function
#ifndef DOXYGEN
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void) {};
#endif
@ -766,10 +766,6 @@ static inline void D_CleanFile(void)
}
}
#ifndef _MAX_PATH
#define _MAX_PATH MAX_WADPATH
#endif
// ==========================================================================
// Identify the SRB2 version, and IWAD file to use.
// ==========================================================================

View File

@ -40,8 +40,8 @@ void D_SRB2Main(void);
// Called by IO functions when input is detected.
void D_PostEvent(const event_t *ev);
#ifndef DOXYGEN
FUNCMATH void D_PostEvent_end(void); // delimiter for locking memory
#if defined (PC_DOS) && !defined (DOXYGEN)
void D_PostEvent_end(void); // delimiter for locking memory
#endif
void D_ProcessEvents(void);

View File

@ -8307,7 +8307,7 @@ fixed_t get_number(const char *word)
#endif
}
void FUNCMATH DEH_Check(void)
void DEH_Check(void)
{
#if defined(_DEBUG) || defined(PARANOIA)
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);

View File

@ -571,4 +571,11 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// \note Required for proper collision with moving sloped surfaces that have sector specials on them.
#define SECTORSPECIALSAFTERTHINK
/// FINALLY some real clipping that doesn't make walls dissappear AND speeds the game up
/// (that was the original comment from SRB2CB, sadly it is a lie and actually slows game down)
/// on the bright side it fixes some weird issues with translucent walls
/// \note SRB2CB port.
/// SRB2CB itself ported this from PrBoom+
#define NEWCLIP
#endif // __DOOMDEF__

View File

@ -40,12 +40,13 @@
typedef long ssize_t;
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
#endif
#if ((_MSC_VER <= 1200) && (!defined(PDWORD_PTR)))
#define PDWORD_PTR PDWORD
#if (_MSC_VER <= 1200)
#ifndef DWORD_PTR
#define DWORD_PTR DWORD
#endif
#ifndef PDWORD_PTR
#define PDWORD_PTR PDWORD
#endif
#endif
#elif defined (__DJGPP__)
#define UINT8 unsigned char
@ -80,11 +81,13 @@ typedef long ssize_t;
#define NOIPX
#endif
/* Strings and some misc platform specific stuff */
#ifdef _MSC_VER
// Microsoft VisualC++
#if (_MSC_VER <= 1800) // MSVC 2013 and back
#define snprintf _snprintf
#if (_MSC_VER <= 1200) // MSVC 2012 and back
#if (_MSC_VER <= 1200) // MSVC 6.0 and back
#define vsnprintf _vsnprintf
#endif
#endif
@ -148,6 +151,8 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
// not the number of bytes in the buffer.
#define STRBUFCPY(dst,src) strlcpy(dst, src, sizeof dst)
/* Boolean type definition */
// \note __BYTEBOOL__ used to be set above if "macintosh" was defined,
// if macintosh's version of boolean type isn't needed anymore, then isn't this macro pointless now?
#ifndef __BYTEBOOL__
@ -155,7 +160,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
//faB: clean that up !!
#if defined( _MSC_VER) && (_MSC_VER >= 1800) // MSVC 2013 and forward
#include "stdbool.h"
#include "stdbool.h"
#elif defined (_WIN32)
#define false FALSE // use windows types
#define true TRUE
@ -205,89 +210,65 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
#endif
union FColorRGBA
{
UINT32 rgba;
struct
{
UINT8 red;
UINT8 green;
UINT8 blue;
UINT8 alpha;
} s;
} ATTRPACK;
typedef union FColorRGBA RGBA_t;
typedef enum
{
postimg_none,
postimg_water,
postimg_motion,
postimg_flip,
postimg_heat
} postimg_t;
typedef UINT32 lumpnum_t; // 16 : 16 unsigned long (wad num: lump num)
#define LUMPERROR UINT32_MAX
typedef UINT32 tic_t;
#define INFTICS UINT32_MAX
#ifdef _BIG_ENDIAN
#define UINT2RGBA(a) a
#else
#define UINT2RGBA(a) (UINT32)((a&0xff)<<24)|((a&0xff00)<<8)|((a&0xff0000)>>8)|(((UINT32)a&0xff000000)>>24)
#endif
/* Compiler-specific attributes and other macros */
#ifdef __GNUC__ // __attribute__ ((X))
#define FUNCNORETURN __attribute__ ((noreturn))
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined (__MINGW32__)
#include "inttypes.h"
#if 0 //defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO > 0
#define FUNCPRINTF __attribute__ ((format(gnu_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(gnu_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(gnu_printf, 1, 2),noreturn))
#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
#define FUNCPRINTF __attribute__ ((format(ms_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(ms_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(ms_printf, 1, 2),noreturn))
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#ifndef FUNCIERROR
#define FUNCIERROR __attribute__ ((noreturn))
#endif
#define FUNCMATH __attribute__((const))
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define FUNCDEAD __attribute__ ((deprecated))
#define FUNCINLINE __attribute__((always_inline))
#define FUNCNONNULL __attribute__((nonnull))
#endif
#define FUNCNOINLINE __attribute__((noinline))
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
#ifdef __i386__ // i386 only
#define FUNCTARGET(X) __attribute__ ((__target__ (X)))
#endif
#endif
#if defined (__MINGW32__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#define ATTRPACK __attribute__((packed, gcc_struct))
#else
#define ATTRPACK __attribute__((packed))
#endif
#define ATTRUNUSED __attribute__((unused))
#define FUNCNORETURN __attribute__ ((noreturn))
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined (__MINGW32__) // MinGW, >= GCC 4.1
#include "inttypes.h"
#if 0 //defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO > 0
#define FUNCPRINTF __attribute__ ((format(gnu_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(gnu_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(gnu_printf, 1, 2),noreturn))
#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) // >= GCC 4.4
#define FUNCPRINTF __attribute__ ((format(ms_printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(ms_printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(ms_printf, 1, 2),noreturn))
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#else
#define FUNCPRINTF __attribute__ ((format(printf, 1, 2)))
#define FUNCDEBUG __attribute__ ((format(printf, 2, 3)))
#define FUNCIERROR __attribute__ ((format(printf, 1, 2),noreturn))
#endif
#ifndef FUNCIERROR
#define FUNCIERROR __attribute__ ((noreturn))
#endif
#define FUNCMATH __attribute__((const))
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) // >= GCC 3.1
#define FUNCDEAD __attribute__ ((deprecated))
#define FUNCINLINE __attribute__((always_inline))
#define FUNCNONNULL __attribute__((nonnull))
#endif
#define FUNCNOINLINE __attribute__((noinline))
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) // >= GCC 4.4
#ifdef __i386__ // i386 only
#define FUNCTARGET(X) __attribute__ ((__target__ (X)))
#endif
#endif
#if defined (__MINGW32__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) // MinGW, >= GCC 3.4
#define ATTRPACK __attribute__((packed, gcc_struct))
#else
#define ATTRPACK __attribute__((packed))
#endif
#define ATTRUNUSED __attribute__((unused))
#elif defined (_MSC_VER)
#define ATTRNORETURN __declspec(noreturn)
#define ATTRINLINE __forceinline
#if _MSC_VER > 1200
#define ATTRNOINLINE __declspec(noinline)
#endif
#define ATTRNORETURN __declspec(noreturn)
#define ATTRINLINE __forceinline
#if _MSC_VER > 1200 // >= MSVC 6.0
#define ATTRNOINLINE __declspec(noinline)
#endif
#endif
#ifndef FUNCPRINTF
@ -335,4 +316,43 @@ typedef UINT32 tic_t;
#ifndef ATTRNOINLINE
#define ATTRNOINLINE
#endif
/* Miscellaneous types that don't fit anywhere else (Can this be changed?) */
union FColorRGBA
{
UINT32 rgba;
struct
{
UINT8 red;
UINT8 green;
UINT8 blue;
UINT8 alpha;
} s;
} ATTRPACK;
typedef union FColorRGBA RGBA_t;
typedef enum
{
postimg_none,
postimg_water,
postimg_motion,
postimg_flip,
postimg_heat
} postimg_t;
typedef UINT32 lumpnum_t; // 16 : 16 unsigned long (wad num: lump num)
#define LUMPERROR UINT32_MAX
typedef UINT32 tic_t;
#define INFTICS UINT32_MAX
#include "endian.h" // This is needed to make sure the below macro acts correctly in big endian builds
#ifdef SRB2_BIG_ENDIAN
#define UINT2RGBA(a) a
#else
#define UINT2RGBA(a) (UINT32)((a&0xff)<<24)|((a&0xff00)<<8)|((a&0xff0000)>>8)|(((UINT32)a&0xff000000)>>24)
#endif
#endif //__DOOMTYPE__

View File

@ -1414,6 +1414,7 @@ void F_StartGameEnd(void)
//
void F_GameEndDrawer(void)
{
// this function does nothing
}
//

View File

@ -35,7 +35,7 @@ void F_CutsceneTicker(void);
void F_TitleDemoTicker(void);
// Called by main loop.
FUNCMATH void F_GameEndDrawer(void);
void F_GameEndDrawer(void);
void F_IntroDrawer(void);
void F_TitleScreenDrawer(void);

View File

@ -338,7 +338,7 @@ angle_t gld_FrustumAngle(void)
}
// If the pitch is larger than this you can look all around at a FOV of 90
if (aimingangle > (ANGLE_45+ANG1) && (ANGLE_315-ANG1) > aimingangle)
if (abs((signed)aimingangle) > 46 * ANG1)
return 0xffffffff;
// ok, this is a gross hack that barely works...

View File

@ -86,7 +86,7 @@ void HU_Init(void);
void HU_LoadGraphics(void);
// reset heads up when consoleplayer respawns.
FUNCMATH void HU_Start(void);
void HU_Start(void);
boolean HU_Responder(event_t *ev);

View File

@ -453,7 +453,7 @@ boolean P_SupermanLook4Players(mobj_t *actor);
void P_DestroyRobots(void);
void P_SnowThinker(precipmobj_t *mobj);
void P_RainThinker(precipmobj_t *mobj);
FUNCMATH void P_NullPrecipThinker(precipmobj_t *mobj);
void P_NullPrecipThinker(precipmobj_t *mobj);
void P_RemovePrecipMobj(precipmobj_t *mobj);
void P_SetScale(mobj_t *mobj, fixed_t newscale);
void P_XYMovement(mobj_t *mo);

View File

@ -87,7 +87,7 @@ extern lighttable_t **planezlight;
extern fixed_t *yslope;
extern fixed_t distscale[MAXVIDWIDTH];
FUNCMATH void R_InitPlanes(void);
void R_InitPlanes(void);
void R_PortalStoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor, fixed_t *scale);
void R_PortalRestoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor, fixed_t *scale);
void R_ClearPlanes(void);

View File

@ -63,11 +63,7 @@ typedef struct floorsplat_s
fixed_t P_SegLength(seg_t *seg);
// call at P_SetupLevel()
#if !(defined (WALLSPLATS) || defined (FLOORSPLATS))
FUNCMATH void R_ClearLevelSplats(void);
#else
void R_ClearLevelSplats(void);
#endif
#ifdef WALLSPLATS
void R_AddWallSplat(line_t *wallline, INT16 sectorside, const char *patchname, fixed_t top,

View File

@ -69,11 +69,7 @@ consvar_t cv_scr_height = {"scr_height", "800", CV_SAVE, CV_Unsigned, NULL, 0, N
consvar_t cv_scr_depth = {"scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifdef DIRECTFULLSCREEN
static FUNCMATH void SCR_ChangeFullscreen (void);
#else
static void SCR_ChangeFullscreen (void);
#endif
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};

View File

@ -12,19 +12,19 @@ consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NUL
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
FUNCMATH void I_InitCD(void){}
void I_InitCD(void){}
FUNCMATH void I_StopCD(void){}
void I_StopCD(void){}
FUNCMATH void I_PauseCD(void){}
void I_PauseCD(void){}
FUNCMATH void I_ResumeCD(void){}
void I_ResumeCD(void){}
FUNCMATH void I_ShutdownCD(void){}
void I_ShutdownCD(void){}
FUNCMATH void I_UpdateCD(void){}
void I_UpdateCD(void){}
FUNCMATH void I_PlayCD(UINT8 track, UINT8 looping)
void I_PlayCD(UINT8 track, UINT8 looping)
{
(void)track;
(void)looping;

View File

@ -1929,14 +1929,14 @@ void I_StartupMouse2(void)
//
// I_Tactile
//
FUNCMATH void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect)
void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
(void)FFEffect;
}
FUNCMATH void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
@ -1947,7 +1947,7 @@ FUNCMATH void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
*/
static ticcmd_t emptycmd;
FUNCMATH ticcmd_t *I_BaseTiccmd(void)
ticcmd_t *I_BaseTiccmd(void)
{
return &emptycmd;
}
@ -1956,7 +1956,7 @@ FUNCMATH ticcmd_t *I_BaseTiccmd(void)
*/
static ticcmd_t emptycmd2;
FUNCMATH ticcmd_t *I_BaseTiccmd2(void)
ticcmd_t *I_BaseTiccmd2(void)
{
return &emptycmd2;
}
@ -2050,7 +2050,7 @@ tic_t I_GetTime (void)
//
//I_StartupTimer
//
FUNCMATH void I_StartupTimer(void)
void I_StartupTimer(void)
{
#ifdef _WIN32
// for win2k time bug
@ -2149,11 +2149,11 @@ void I_WaitVBL(INT32 count)
SDL_Delay(count);
}
FUNCMATH void I_BeginRead(void)
void I_BeginRead(void)
{
}
FUNCMATH void I_EndRead(void)
void I_EndRead(void)
{
}
@ -2916,5 +2916,5 @@ const CPUInfoFlags *I_CPUInfo(void)
}
// note CPUAFFINITY code used to reside here
FUNCMATH void I_RegisterSysCommands(void) {}
void I_RegisterSysCommands(void) {}
#endif

View File

@ -1059,7 +1059,7 @@ void I_SetPalette(RGBA_t *palette)
}
// return number of fullscreen + X11 modes
FUNCMATH INT32 VID_NumModes(void)
INT32 VID_NumModes(void)
{
if (USE_FULLSCREEN && numVidModes != -1)
return numVidModes - firstEntry;
@ -1067,7 +1067,7 @@ FUNCMATH INT32 VID_NumModes(void)
return MAXWINMODES;
}
FUNCMATH const char *VID_GetModeName(INT32 modeNum)
const char *VID_GetModeName(INT32 modeNum)
{
#if 0
if (USE_FULLSCREEN && numVidModes != -1) // fullscreen modes
@ -1097,7 +1097,7 @@ FUNCMATH const char *VID_GetModeName(INT32 modeNum)
return &vidModeName[modeNum][0];
}
FUNCMATH INT32 VID_GetModeForSize(INT32 w, INT32 h)
INT32 VID_GetModeForSize(INT32 w, INT32 h)
{
int i;
for (i = 0; i < MAXWINMODES; i++)

View File

@ -143,7 +143,7 @@ void I_ShutdownSound(void)
#endif
}
FUNCMATH void I_UpdateSound(void)
void I_UpdateSound(void)
{
}
@ -512,7 +512,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
/// Music System
/// ------------------------
FUNCMATH void I_InitMusic(void)
void I_InitMusic(void)
{
}

View File

@ -219,7 +219,7 @@ static void Snd_UnlockAudio(void) //Alam: Unlock audio data and reinstall audio
#endif
}
FUNCMATH static inline Uint16 Snd_LowerRate(Uint16 sr)
static inline Uint16 Snd_LowerRate(Uint16 sr)
{
if (sr <= audio.freq) // already lowered rate?
return sr; // good then

View File

@ -24,7 +24,7 @@
//
// Called by main loop.
FUNCMATH void ST_Ticker(void);
void ST_Ticker(void);
// Called by main loop.
void ST_Drawer(void);