Merge branch 'next' into gl-slopes

This commit is contained in:
Alam Ed Arias 2016-02-26 02:14:00 -05:00
commit 2ba90082c3
20 changed files with 79 additions and 107 deletions

View file

@ -24,8 +24,8 @@ addons:
before_script: before_script:
- mkdir $HOME/srb2_cache - mkdir $HOME/srb2_cache
- wget http://rosenthalcastle.org/srb2/SRB2-v2114-Installer.exe -c -O $HOME/srb2_cache/SRB2-v2114-Installer.exe - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2114-assets.7z -O $HOME/srb2_cache/SRB2-v2114-assets.7z
- 7z x $HOME/srb2_cache/SRB2-v2114-Installer.exe -oassets - 7z x $HOME/srb2_cache/SRB2-v2114-assets.7z -oassets
- mkdir build - mkdir build
- cd build - cd build
- cmake .. - cmake ..

View file

@ -28,7 +28,7 @@ macro(add_framework fwname appname)
${CMAKE_OSX_SYSROOT}/Library ${CMAKE_OSX_SYSROOT}/Library
/System/Library /System/Library
/Library /Library
PATH_SUFFIXES Frameworks ATH_SUFFIXES Frameworks
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND) if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND)
MESSAGE(ERROR ": Framework ${fwname} not found") MESSAGE(ERROR ": Framework ${fwname} not found")

View file

@ -202,7 +202,7 @@ static void CONS_Bind_f(void)
} }
key = G_KeyStringtoNum(COM_Argv(1)); key = G_KeyStringtoNum(COM_Argv(1));
if (!key) if (key <= 0 || key >= NUMINPUTS)
{ {
CONS_Alert(CONS_NOTICE, M_GetText("Invalid key name\n")); CONS_Alert(CONS_NOTICE, M_GetText("Invalid key name\n"));
return; return;

View file

@ -210,13 +210,6 @@ extern FILE *logstream;
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". // Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
#define MODVERSION 19 #define MODVERSION 19
// some tests, enable or disable it if it run or not
#define SPLITSCREEN
// ========================================================================= // =========================================================================
// The maximum number of players, multiplayer/networking. // The maximum number of players, multiplayer/networking.
@ -352,11 +345,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG;
#include "m_swap.h" #include "m_swap.h"
// Things that used to be in dstrings.h // Things that used to be in dstrings.h
#define DEVMAPS "devmaps"
#define DEVDATA "devdata"
#define SAVEGAMENAME "srb2sav" #define SAVEGAMENAME "srb2sav"
char savegamename[256]; char savegamename[256];
// m_misc.h // m_misc.h

View file

@ -1041,13 +1041,13 @@ INT32 G_KeyStringtoNum(const char *keystr)
if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z') if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z')
return keystr[0]; return keystr[0];
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')
return atoi(&keystr[3]);
for (j = 0; j < NUMKEYNAMES; j++) for (j = 0; j < NUMKEYNAMES; j++)
if (!stricmp(keynames[j].name, keystr)) if (!stricmp(keynames[j].name, keystr))
return keynames[j].keynum; return keynames[j].keynum;
if (strlen(keystr) > 3)
return atoi(&keystr[3]);
return 0; return 0;
} }

View file

@ -1339,6 +1339,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
} }
else else
player->pflags |= PF_ITEMHANG; player->pflags |= PF_ITEMHANG;
// Can't jump first frame
player->pflags |= PF_JUMPSTASIS;
return; return;
case MT_BIGMINE: case MT_BIGMINE:
case MT_BIGAIRMINE: case MT_BIGAIRMINE:

View file

@ -503,7 +503,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; // overhead return true; // overhead
if (thing->z + thing->height < tmthing->z) if (thing->z + thing->height < tmthing->z)
return true; // underneath return true; // underneath
if (tmthing->player && tmthing->flags & MF_SHOOTABLE) if (tmthing->player && tmthing->flags & MF_SHOOTABLE && thing->health > 0)
P_DamageMobj(tmthing, thing, thing, 1); P_DamageMobj(tmthing, thing, thing, 1);
return true; return true;
} }
@ -514,7 +514,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; // overhead return true; // overhead
if (tmthing->z + tmthing->height < thing->z) if (tmthing->z + tmthing->height < thing->z)
return true; // underneath return true; // underneath
if (thing->player && thing->flags & MF_SHOOTABLE) if (thing->player && thing->flags & MF_SHOOTABLE && tmthing->health > 0)
P_DamageMobj(thing, tmthing, tmthing, 1); P_DamageMobj(thing, tmthing, tmthing, 1);
return true; return true;
} }

View file

@ -9696,7 +9696,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing)
// Diagonal rings (handles both types) // Diagonal rings (handles both types)
else if (mthing->type == 602 || mthing->type == 603) // Diagonal rings (5) else if (mthing->type == 602 || mthing->type == 603) // Diagonal rings (5)
{ {
angle_t angle = ANGLE_45 * (mthing->angle/45); angle_t angle = FixedAngle(mthing->angle*FRACUNIT);
mobjtype_t ringthing = MT_RING; mobjtype_t ringthing = MT_RING;
INT32 iterations = 5; INT32 iterations = 5;
if (mthing->type == 603) if (mthing->type == 603)

View file

@ -427,6 +427,8 @@ newseg:
// seg's ending vertex. // seg's ending vertex.
for (i = 0; i < numsegs; ++i) for (i = 0; i < numsegs; ++i)
{ {
if (segs[i].side != 0) // needs to be frontfacing
continue;
if (segs[i].v1->x == seg->v2->x && segs[i].v1->y == seg->v2->y) if (segs[i].v1->x == seg->v2->x && segs[i].v1->y == seg->v2->y)
{ {
// Make sure you didn't already add this seg... // Make sure you didn't already add this seg...
@ -593,6 +595,9 @@ static void Polyobj_spawnPolyObj(INT32 num, mobj_t *spawnSpot, INT32 id)
seg_t *seg = &segs[i]; seg_t *seg = &segs[i];
INT32 polyID, parentID; INT32 polyID, parentID;
if (seg->side != 0) // needs to be frontfacing
continue;
if (seg->linedef->special != POLYOBJ_START_LINE) if (seg->linedef->special != POLYOBJ_START_LINE)
continue; continue;

View file

@ -6340,8 +6340,7 @@ static void P_MovePlayer(player_t *player)
if (!(player->powers[pw_nocontrol] & (1<<15))) if (!(player->powers[pw_nocontrol] & (1<<15)))
player->pflags |= PF_JUMPSTASIS; player->pflags |= PF_JUMPSTASIS;
} }
else // note: don't unset stasis here
player->pflags &= ~PF_FULLSTASIS;
if (!player->spectator && G_TagGametype()) if (!player->spectator && G_TagGametype())
{ {
@ -8928,6 +8927,11 @@ void P_PlayerThink(player_t *player)
if (!player->mo) if (!player->mo)
return; // P_MovePlayer removed player->mo. return; // P_MovePlayer removed player->mo.
// Unset statis flags after moving.
// In other words, if you manually set stasis via code,
// it lasts for one tic.
player->pflags &= ~PF_FULLSTASIS;
#ifdef POLYOBJECTS #ifdef POLYOBJECTS
if (player->onconveyor == 1) if (player->onconveyor == 1)
player->cmomy = player->cmomx = 0; player->cmomy = player->cmomx = 0;

View file

@ -45,9 +45,6 @@ typedef DWORD (WINAPI *p_timeGetTime) (void);
typedef UINT (WINAPI *p_timeEndPeriod) (UINT); typedef UINT (WINAPI *p_timeEndPeriod) (UINT);
typedef HANDLE (WINAPI *p_OpenFileMappingA) (DWORD, BOOL, LPCSTR); typedef HANDLE (WINAPI *p_OpenFileMappingA) (DWORD, BOOL, LPCSTR);
typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
typedef HANDLE (WINAPI *p_GetCurrentProcess) (VOID);
typedef BOOL (WINAPI *p_GetProcessAffinityMask) (HANDLE, PDWORD_PTR, PDWORD_PTR);
typedef BOOL (WINAPI *p_SetProcessAffinityMask) (HANDLE, DWORD_PTR);
#endif #endif
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -2779,7 +2776,6 @@ static const char *locateWad(void)
{ {
return returnWadPath; return returnWadPath;
} }
#endif #endif
// examine default dirs // examine default dirs
@ -3070,52 +3066,6 @@ const CPUInfoFlags *I_CPUInfo(void)
#endif #endif
} }
#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX) // note CPUAFFINITY code used to reside here
static void CPUAffinity_OnChange(void); void I_RegisterSysCommands(void) {}
static consvar_t cv_cpuaffinity = {"cpuaffinity", "-1", CV_SAVE | CV_CALL, NULL, CPUAffinity_OnChange, 0, NULL, NULL, 0, 0, NULL};
static p_GetCurrentProcess pfnGetCurrentProcess = NULL;
static p_GetProcessAffinityMask pfnGetProcessAffinityMask = NULL;
static p_SetProcessAffinityMask pfnSetProcessAffinityMask = NULL;
static inline VOID GetAffinityFuncs(VOID)
{
HMODULE h = GetModuleHandleA("kernel32.dll");
pfnGetCurrentProcess = (p_GetCurrentProcess)GetProcAddress(h, "GetCurrentProcess");
pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)GetProcAddress(h, "GetProcessAffinityMask");
pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)GetProcAddress(h, "SetProcessAffinityMask");
}
static void CPUAffinity_OnChange(void)
{
DWORD_PTR dwProcMask, dwSysMask;
HANDLE selfpid;
if (!pfnGetCurrentProcess || !pfnGetProcessAffinityMask || !pfnSetProcessAffinityMask)
return;
else
selfpid = pfnGetCurrentProcess();
pfnGetProcessAffinityMask(selfpid, &dwProcMask, &dwSysMask);
/* If resulting mask is zero, don't change anything and fall back to
* actual mask.
*/
if(dwSysMask & cv_cpuaffinity.value)
{
pfnSetProcessAffinityMask(selfpid, dwSysMask & cv_cpuaffinity.value);
CV_StealthSetValue(&cv_cpuaffinity, (INT32)(dwSysMask & cv_cpuaffinity.value));
}
else
CV_StealthSetValue(&cv_cpuaffinity, (INT32)dwProcMask);
}
#endif
void I_RegisterSysCommands(void)
{
#if (defined (_WIN32) && !defined (_WIN32_WCE)) && !defined (_XBOX)
GetAffinityFuncs();
CV_RegisterVar(&cv_cpuaffinity);
#endif
}
#endif #endif

View file

@ -1701,22 +1701,12 @@ void I_StartupGraphics(void)
keyboard_started = true; keyboard_started = true;
#if !defined(HAVE_TTF) #if !defined(HAVE_TTF)
#ifdef _WIN32 // Initialize Audio as well, otherwise Win32's DirectX can not use audio // Previously audio was init here for questionable reasons?
if (SDL_InitSubSystem(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0)
#else //SDL_OpenAudio will do SDL_InitSubSystem(SDL_INIT_AUDIO)
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
#endif
{
#ifdef _WIN32
if (SDL_WasInit(SDL_INIT_AUDIO)==0)
CONS_Printf(M_GetText("Couldn't initialize SDL's Audio System with Video System: %s\n"), SDL_GetError());
if (SDL_WasInit(SDL_INIT_VIDEO)==0)
#endif
{ {
CONS_Printf(M_GetText("Couldn't initialize SDL's Video System: %s\n"), SDL_GetError()); CONS_Printf(M_GetText("Couldn't initialize SDL's Video System: %s\n"), SDL_GetError());
return; return;
} }
}
#endif #endif
{ {
char vd[100]; //stack space for video name char vd[100]; //stack space for video name

View file

@ -77,7 +77,16 @@ static INT32 current_track;
void I_StartupSound(void) void I_StartupSound(void)
{ {
I_Assert(!sound_started); I_Assert(!sound_started);
sound_started = true;
// EE inits audio first so we're following along.
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
CONS_Printf("SDL Audio already started\n");
else if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
{
CONS_Alert(CONS_ERROR, "Error initializing SDL Audio: %s\n", SDL_GetError());
// call to start audio failed -- we do not have it
return;
}
midimode = false; midimode = false;
music = NULL; music = NULL;
@ -86,19 +95,31 @@ void I_StartupSound(void)
#if SDL_MIXER_VERSION_ATLEAST(1,2,11) #if SDL_MIXER_VERSION_ATLEAST(1,2,11)
Mix_Init(MIX_INIT_FLAC|MIX_INIT_MOD|MIX_INIT_MP3|MIX_INIT_OGG); Mix_Init(MIX_INIT_FLAC|MIX_INIT_MOD|MIX_INIT_MP3|MIX_INIT_OGG);
#endif #endif
Mix_OpenAudio(44100, AUDIO_S16LSB, 2, 2048);
if (Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 2048) < 0)
{
CONS_Alert(CONS_ERROR, "Error starting SDL_Mixer: %s\n", Mix_GetError());
// call to start audio failed -- we do not have it
return;
}
sound_started = true;
Mix_AllocateChannels(256); Mix_AllocateChannels(256);
} }
void I_ShutdownSound(void) void I_ShutdownSound(void)
{ {
I_Assert(sound_started); if (!sound_started)
return; // not an error condition
sound_started = false; sound_started = false;
Mix_CloseAudio(); Mix_CloseAudio();
#if SDL_MIXER_VERSION_ATLEAST(1,2,11) #if SDL_MIXER_VERSION_ATLEAST(1,2,11)
Mix_Quit(); Mix_Quit();
#endif #endif
SDL_QuitSubSystem(SDL_INIT_AUDIO);
#ifdef HAVE_LIBGME #ifdef HAVE_LIBGME
if (gme) if (gme)
gme_delete(gme); gme_delete(gme);

View file

@ -1213,6 +1213,16 @@ void I_StartupSound(void)
// Configure sound device // Configure sound device
CONS_Printf("I_StartupSound:\n"); CONS_Printf("I_StartupSound:\n");
// EE inits audio first so we're following along.
if (SDL_WasInit(SDL_INIT_AUDIO) == SDL_INIT_AUDIO)
CONS_Printf("SDL Audio already started\n");
else if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
{
CONS_Alert(CONS_ERROR, "Error initializing SDL Audio: %s\n", SDL_GetError());
// call to start audio failed -- we do not have it
return;
}
// Open the audio device // Open the audio device
if (M_CheckParm ("-freq") && M_IsNextParm()) if (M_CheckParm ("-freq") && M_IsNextParm())
{ {

View file

@ -3656,7 +3656,7 @@ const CPUInfoFlags *I_CPUInfo(void)
} }
static void CPUAffinity_OnChange(void); static void CPUAffinity_OnChange(void);
static consvar_t cv_cpuaffinity = {"cpuaffinity", "1", CV_SAVE | CV_CALL, NULL, CPUAffinity_OnChange, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_cpuaffinity = {"cpuaffinity", "-1", CV_CALL, NULL, CPUAffinity_OnChange, 0, NULL, NULL, 0, 0, NULL};
typedef HANDLE (WINAPI *p_GetCurrentProcess) (VOID); typedef HANDLE (WINAPI *p_GetCurrentProcess) (VOID);
static p_GetCurrentProcess pfnGetCurrentProcess = NULL; static p_GetCurrentProcess pfnGetCurrentProcess = NULL;