Skip to content

Commit da205d9

Browse files
Merge branch 'stable' into horde-limit-redo
2 parents 96fd9c4 + 3c5df8c commit da205d9

29 files changed

+131
-126
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ include(GNUInstallDirs OPTIONAL)
2626
add_definitions(-DINSTALL_BINDIR="${CMAKE_INSTALL_BINDIR}")
2727
add_definitions(-DINSTALL_DATADIR="${CMAKE_INSTALL_DATADIR}")
2828

29+
# Set up FHS installation path
30+
if(NOT APPLE AND NOT WIN32)
31+
add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
32+
endif()
33+
2934
if(WIN32)
3035
set(USE_INTERNAL_LIBS 1)
3136
else()

client/CMakeLists.txt

+7-9
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ if(APPLE)
128128
${AUDIOUNIT_LIBRARY})
129129
endif()
130130

131-
# Set up FHS installation path
132-
if(NOT APPLE AND NOT WIN32)
133-
add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
134-
endif()
135-
136131
# Client target
137132
if(TARGET SDL2::SDL2 OR TARGET SDL::SDL)
138133

@@ -169,14 +164,17 @@ if(TARGET SDL2::SDL2 OR TARGET SDL::SDL)
169164
message(STATUS "Default SIMD flags not touched for AMD64")
170165
elseif(ODAMEX_TARGET_ARCH STREQUAL "i386")
171166
if(NOT MSVC)
172-
# Pentium M has SSE2.
173-
target_compile_definitions(odamex PRIVATE -march=pentium-m)
167+
target_compile_options(odamex PRIVATE -msse2)
174168
else()
175-
target_compile_definitions(odamex PRIVATE /arch:SSE2)
169+
target_compile_options(odamex PRIVATE /arch:SSE2)
176170
endif()
177171
message(STATUS "Default SIMD flags set to SSE2")
178172
elseif(ODAMEX_TARGET_ARCH MATCHES "ppc")
179-
target_compile_definitions(odamex PRIVATE -faltivec)
173+
if(APPLE)
174+
target_compile_options(odamex PRIVATE -faltivec)
175+
else()
176+
target_compile_options(odamex PRIVATE -maltivec)
177+
endif()
180178
message(STATUS "Default SIMD flags set to AltiVec")
181179
endif()
182180
else()

client/sdl/i_input_sdl20.cpp

+47-6
Original file line numberDiff line numberDiff line change
@@ -726,23 +726,56 @@ void ISDL20JoystickInputDevice::gatherEvents()
726726
}
727727
else
728728
{
729-
float deadzone = (joy_deadzone * 32767);
730729
event_t motion_event(ev_joystick);
731730
motion_event.type = ev_joystick;
732731
motion_event.data2 = sdl_ev.caxis.axis;
733-
if ((sdl_ev.caxis.value >= deadzone) ||
734-
(sdl_ev.caxis.value <= -deadzone)){
735-
motion_event.data3 = sdl_ev.caxis.value;
736-
}
737-
732+
motion_event.data3 = calcAxisValue(sdl_ev.caxis.value);
738733
mEvents.push(motion_event);
739734
}
740735

741736
}
742737
}
743738
}
739+
740+
// Flush all remaining joystick and game controller events.
741+
SDL_FlushEvents(SDL_JOYAXISMOTION, SDL_CONTROLLERDEVICEREMAPPED);
744742
}
745743

744+
int ISDL20JoystickInputDevice::calcAxisValue(int raw_value)
745+
{
746+
float value;
747+
748+
// Normalize.
749+
if (raw_value > 0)
750+
{
751+
value = (float)raw_value / (float)SDL_JOYSTICK_AXIS_MAX;
752+
}
753+
else if (raw_value < 0)
754+
{
755+
value = (float)raw_value / (float)abs(SDL_JOYSTICK_AXIS_MIN);
756+
}
757+
else
758+
{
759+
value = 0.0f;
760+
}
761+
762+
// Apply deadzone.
763+
if (value > joy_deadzone)
764+
{
765+
value = (value - joy_deadzone) / (1.0f - joy_deadzone);
766+
}
767+
else if (value < -joy_deadzone)
768+
{
769+
value = (value + joy_deadzone) / (1.0f - joy_deadzone);
770+
}
771+
else
772+
{
773+
value = 0.0f;
774+
}
775+
776+
// Scale value to the range used for calculations in G_BuildTiccmd().
777+
return lroundf(value * 32767.0f);
778+
}
746779

747780
//
748781
// ISDL20JoystickInputDevice::getEvent
@@ -788,6 +821,14 @@ ISDL20InputSubsystem::ISDL20InputSubsystem() :
788821
SDL_EventState(SDL_CONTROLLERBUTTONDOWN, SDL_IGNORE);
789822
SDL_EventState(SDL_CONTROLLERBUTTONUP, SDL_IGNORE);
790823

824+
// Ignore unsupported game controller events.
825+
#if (SDL_MINOR_VERSION > 0 || SDL_PATCHLEVEL >= 14)
826+
SDL_EventState(SDL_CONTROLLERTOUCHPADDOWN, SDL_IGNORE);
827+
SDL_EventState(SDL_CONTROLLERTOUCHPADMOTION, SDL_IGNORE);
828+
SDL_EventState(SDL_CONTROLLERTOUCHPADUP, SDL_IGNORE);
829+
SDL_EventState(SDL_CONTROLLERSENSORUPDATE, SDL_IGNORE);
830+
#endif
831+
791832
grabInput();
792833
}
793834

client/sdl/i_input_sdl20.h

+2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ class ISDL20JoystickInputDevice : public IInputDevice
139139
virtual void flushEvents();
140140

141141
private:
142+
int calcAxisValue(int raw_value);
143+
142144
static const int JOY_DEADZONE = 6000;
143145

144146
bool mActive;

client/src/cl_cvarlist.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ CVAR (joy_fastsensitivity, "15.0", "", CVARTYPE_FLOAT, CVAR_CLIENTARCHIVE | CVAR
309309
CVAR (joy_freelook, "0", "", CVARTYPE_FLOAT, CVAR_CLIENTARCHIVE)
310310
CVAR (joy_invert, "0", "", CVARTYPE_FLOAT, CVAR_CLIENTARCHIVE)
311311

312-
CVAR_RANGE (joy_deadzone, "0.34", "", CVARTYPE_FLOAT, CVAR_CLIENTARCHIVE | CVAR_NOENABLEDISABLE, 0.0f, 1.0f)
312+
CVAR_RANGE (joy_deadzone, "0.20", "", CVARTYPE_FLOAT, CVAR_CLIENTARCHIVE | CVAR_NOENABLEDISABLE, 0.0f, 0.75f)
313313

314314
CVAR_RANGE(joy_lefttrigger_deadzone, "0.2", "Sets the required pressure to trigger a press on the left trigger (Analog controllers only)",
315315
CVARTYPE_FLOAT, CVAR_CLIENTARCHIVE | CVAR_NOENABLEDISABLE, 0.01f, 1.0f)

client/src/cl_parse.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ static void CL_SectorProperties(const odaproto::svc::SectorProperties* msg)
23542354
break;
23552355
}
23562356
case SPC_Gravity:
2357-
*(int*)&sector->gravity = msg->sector().gravity();
2357+
*&sector->gravity = msg->sector().gravity();
23582358
break;
23592359
case SPC_Panning:
23602360
sector->ceiling_xoffs = msg->sector().ceiling_offs().x();

client/src/m_menu.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#include "odamex.h"
2727

28+
#include <ctime>
29+
2830
#include "gstrings.h"
2931
#include "c_console.h"
3032
#include "c_dispatch.h"

client/src/r_drawt_altivec.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
#include "r_main.h"
3737
#include "i_video.h"
3838

39-
#if !defined(__APPLE_ALTIVEC__)
4039
#include <altivec.h>
41-
#endif
4240

4341
#define ALTIVEC_ALIGNED(x) x __attribute__((aligned(16)))
4442

client/src/v_screenshot.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#include "odamex.h"
2626

27+
#include <ctime>
28+
2729
#include <SDL.h>
2830

2931
#include <stdlib.h>

common/actor.h

-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ class AActor : public DThinker
521521
SWORD gear; // killough 11/98: used in torque simulation
522522

523523
bool onground; // NES - Fixes infinite jumping bug like a charm.
524-
bool on_conveyor; // Blair - Update items on conveyors more often
525524

526525
// a linked list of sectors where this object appears
527526
struct msecnode_s *touching_sectorlist; // phares 3/14/98

common/c_cvarlist.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,13 @@ CVAR(g_preroundreset, "0", "After preround is over, reset the map one last time.
245245
CVAR(g_postroundtime, "3", "Amount of time after a round before the next round/endgame",
246246
CVARTYPE_INT, CVAR_SERVERARCHIVE | CVAR_NOENABLEDISABLE)
247247

248-
CVAR_RANGE(g_coopthingfilter, "0", "Removes cooperative things of the map. Values are:\n" \
249-
"// 0 - All Coop things are retained (default).\n" \
248+
CVAR_RANGE(g_thingfilter, "0", "Removes some things from the map. Values are:\n" \
249+
"// 0 - All things are retained (default).\n" \
250250
"// 1 - Only Coop weapons are removed.\n" \
251-
"// 2 - All Coop things are removed.",
251+
"// 2 - All Coop things are removed.\n" \
252+
"// 3 - All pickupable things are removed.",
252253
CVARTYPE_BYTE, CVAR_SERVERARCHIVE | CVAR_SERVERINFO | CVAR_NOENABLEDISABLE | CVAR_LATCH,
253-
0.0f, 2.0f)
254+
0.0f, 3.0f)
254255

255256
CVAR(g_resetinvonexit, "0",
256257
"Always reset players to their starting inventory on level exit", CVARTYPE_BOOL,

common/c_dispatch.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <sstream>
2828
#include <algorithm>
29+
#include <ctime>
2930

3031
#include "cmdlib.h"
3132
#include "c_console.h"

common/cmdlib.h

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#pragma once
2525

2626
#include <algorithm>
27+
#include <ctime>
2728

2829
#ifdef _MSC_VER
2930
#pragma warning(disable : 4244) // MIPS

common/doomdata.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ typedef struct MapThing
269269
#define MTF_DEATHMATCH 0x0400 // Thing appears in deathmatch games
270270

271271
// Custom MapThing Flags
272-
#define MTF_FILTER_COOPWPN 0x0800 // Weapon thing is filtered with g_coopthingfilter 1.
272+
#define MTF_FILTER_COOPWPN 0x0800 // Weapon thing is filtered with g_thingfilter 1.
273273
// (Hate this method but it works...)
274274

275275

common/m_resfile.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool OResFile::make(OResFile& out, const std::string& file)
7171

7272
out.m_fullpath = fullpath;
7373
out.m_md5 = hash;
74-
out.m_basename = StdStringToUpper(basename);
74+
out.m_basename = basename;
7575
return true;
7676
}
7777

@@ -111,7 +111,7 @@ bool OResFile::makeWithHash(OResFile& out, const std::string& file, const OMD5Ha
111111

112112
out.m_fullpath = fullpath;
113113
out.m_md5 = hash;
114-
out.m_basename = StdStringToUpper(basename);
114+
out.m_basename = basename;
115115
return true;
116116
}
117117

@@ -136,8 +136,8 @@ bool OWantFile::make(OWantFile& out, const std::string& file, const ofile_t type
136136

137137
out.m_wantedpath = file;
138138
out.m_wantedtype = type;
139-
out.m_basename = StdStringToUpper(basename);
140-
out.m_extension = std::string(".") + StdStringToUpper(extension);
139+
out.m_basename = basename;
140+
out.m_extension = std::string(".") + extension;
141141
return true;
142142
}
143143

@@ -165,8 +165,8 @@ bool OWantFile::makeWithHash(OWantFile& out, const std::string& file, const ofil
165165
out.m_wantedpath = file;
166166
out.m_wantedtype = type;
167167
out.m_wantedMD5 = hash;
168-
out.m_basename = StdStringToUpper(basename);
169-
out.m_extension = StdStringToUpper(extension);
168+
out.m_basename = basename;
169+
out.m_extension = extension;
170170
return true;
171171
}
172172

@@ -290,7 +290,7 @@ bool M_ResolveWantedFile(OResFile& out, const OWantFile& wanted)
290290
M_ExtractFileBase(path, basename);
291291
if (M_ExtractFileExtension(path, strext))
292292
{
293-
exts.push_back("." + StdStringToUpper(strext));
293+
exts.push_back("." + strext);
294294
}
295295
else
296296
{

common/p_boomfspec.cpp

+15-12
Original file line numberDiff line numberDiff line change
@@ -1304,32 +1304,35 @@ void P_PlayerInCompatibleSector(player_t* player)
13041304
{
13051305
switch ((sector->special & DAMAGE_MASK) >> DAMAGE_SHIFT)
13061306
{
1307-
case 0: // Kill player unless invuln or rad suit
1308-
if (!player->powers[pw_invulnerability] && !player->powers[pw_ironfeet])
1307+
case 0: // Kill player unless invuln or rad suit or IDDQD
1308+
if (!player->powers[pw_invulnerability] && !player->powers[pw_ironfeet] && !(player->cheats & CF_GODMODE))
13091309
{
1310-
P_DamageMobj(player->mo, NULL, NULL, 10000, MOD_UNKNOWN);
1310+
P_DamageMobj(player->mo, NULL, NULL, 999, MOD_UNKNOWN); // 999 so BUDDHA can survive
13111311
}
13121312
break;
1313-
case 1: // Kill player with no scruples
1314-
P_DamageMobj(player->mo, NULL, NULL, 10000, MOD_UNKNOWN);
1313+
case 1: // Kill player with no scruples unless IDDQD
1314+
if(!(player->cheats & CF_GODMODE))
1315+
{
1316+
P_DamageMobj(player->mo, NULL, NULL, 10000, MOD_UNKNOWN);
1317+
}
13151318
break;
13161319
case 2: // Kill all players and exit. There's no delay here so it may confuse
1317-
// some players.
1320+
// some players. Do NOT kill players with IDDQD.
13181321
if (serverside)
13191322
{
13201323
if (sv_allowexit)
13211324
{
13221325
for (Players::iterator it = ::players.begin();
13231326
it != ::players.end(); ++it)
13241327
{
1325-
if (player->ingame() && player->health > 0)
1328+
if (player->ingame() && player->health > 0 && !(player->cheats & CF_GODMODE))
13261329
{
13271330
P_DamageMobj((*it).mo, NULL, NULL, 10000, MOD_EXIT);
13281331
}
13291332
}
13301333
G_ExitLevel(0, 1);
13311334
}
1332-
else
1335+
else if (!(player->cheats & CF_GODMODE)) // Do NOT kill players with IDDQD.
13331336
{
13341337
P_DamageMobj(
13351338
player->mo, NULL, NULL, 10000,
@@ -1339,22 +1342,22 @@ void P_PlayerInCompatibleSector(player_t* player)
13391342
}
13401343
break;
13411344
case 3: // Kill all players and secret exit. There's no delay here so it may
1342-
// confuse some players.
1345+
// confuse some players. Do NOT kill players with IDDQD.
13431346
if (serverside)
13441347
{
13451348
if (sv_allowexit)
13461349
{
13471350
for (Players::iterator it = ::players.begin();
13481351
it != ::players.end(); ++it)
13491352
{
1350-
if (player->ingame() && player->health > 0)
1353+
if (player->ingame() && player->health > 0 && !(player->cheats & CF_GODMODE))
13511354
{
13521355
P_DamageMobj((*it).mo, NULL, NULL, 10000, MOD_EXIT);
13531356
}
13541357
}
13551358
G_SecretExitLevel(0, 1);
13561359
}
1357-
else
1360+
else if (!(player->cheats & CF_GODMODE)) // Do NOT kill players with IDDQD.
13581361
{
13591362
P_DamageMobj(
13601363
player->mo, NULL, NULL, 10000,
@@ -1365,7 +1368,7 @@ void P_PlayerInCompatibleSector(player_t* player)
13651368
break;
13661369
}
13671370
}
1368-
else
1371+
else if (!(player->cheats & CF_GODMODE)) // Do NOT damage players with IDDQD.
13691372
{
13701373
P_ApplyGeneralizedSectorDamage(player, (sector->special & DAMAGE_MASK) >>
13711374
DAMAGE_SHIFT);

0 commit comments

Comments
 (0)