Commit graph

2155 commits

Author SHA1 Message Date
Yamagi Burmeister
9b82cad2c6 Bump version number to 2.10pre.
The next version will be 2.10 and not 2.03. This is done in preparation
of some Windows test builds.
2017-12-04 17:35:40 +01:00
Daniel Gibson
c3d3e9fc76 Make viewing with joystick framerate-independent
otherwise looking around is faster with higher framerates, that sucks,
especially with unstable framerates (on RPi)
2017-12-02 18:54:31 +01:00
Yamagi Burmeister
e429356bd3 Merge branch 'openal_volume' 2017-12-02 16:41:39 +01:00
Yamagi
44da2aca3b
Merge pull request #262 from DanielGibson/fix-win-msaa-crash
Fix crash on Windows if MSAA is set to a value the driver doesn't support
2017-12-02 16:38:26 +01:00
Daniel Gibson
c105117d41 cap cl_maxfps and gl_maxfps to sane values
gl_maxfps > 1000 breaks things, and cl_maxfps starts to behave weird
at >90, and while up to 125 or so you get the bugfeature of higher
jumping, beyond that things just get even buggier, at some point causing
bugs like #261
2017-12-02 16:36:50 +01:00
Yamagi Burmeister
e3e5bd1bdd Fix drop in volume when shooting into a Brains power screen.
If too many of these sounds are started in one frame (for example if the
player shoots with the super shotgun into the power screen of a Brain)
things get too loud and OpenAL is forced to scale the volume of several
other sounds and the background music down. That leads to a noticable
and annoying drop in the overall volume.

Work around that by limiting the number of sounds started. 16 was
choosen by empirical testing.
2017-11-30 08:26:39 +01:00
Yamagi Burmeister
e30f824944 Don't cast the array itself but it's content.
This was so broken... Casting the type of an array to silence a
warning... It worked on x86, of course. But gave a SIGBUS on ARM.
Do it right, cast / copy the content of the array into another
array of the correct type. Yeah.

This fixes issue #231.
2017-11-14 17:24:41 +00:00
Yamagi
82616d0992
Merge pull request #253 from 0lvin/sdl_build_fix
Fix build with SDL1.2
2017-11-07 10:32:52 +01:00
Yamagi Burmeister
1396741904 Fix possible Vorbis buffer underruns.
There're two possible problems with the calculation of the number of
sound buffers for Vorbis if OpenAL is in use:

* We assume that the (more or less) maximum number buffers is allocated
  during map load. This is not correct if in a multiplayer game a lot of
  custom models with custom sound connect at a later time.
* 64 buffers (about 3 seconds worth of music) may be too low in some
  situations.

Work around this by recalculating the number of buffers if necessary.
We're now reserving about 256 (== 12 seconds) buffers.

This may fix issue #252.
2017-11-04 18:22:53 +01:00
Denis Pauk
9495fe4da9 Show real place of error and fix build with SDL1.2 2017-11-01 22:57:54 +02:00
Yamagi
7b6340ddff Merge pull request #245 from 0lvin/back_button_as_escape
Add support for use controller back button as ESC
2017-10-22 18:19:56 +02:00
Yamagi Burmeister
185e89722a Don't unqueue OpenAL raw samples if OpenAL isn't initialized.
This fixes a crash at menu entry if a cinematic is playing when the
game is build with OpenAL support, but s_openal is set to 0.
2017-10-22 17:58:31 +02:00
Thomas Green
f46c46864a Fix a potential OGG issue when OpenAL library is not found. 2017-10-22 17:54:59 +02:00
Thomas Green
daa0c2c1bf Add improvements to Makefile for OSX. 2017-10-22 17:54:55 +02:00
Daniel Gibson
de5bd4c2c8 OSX: Fix usage of clock_get_time in Sys_Microseconds()
turns out clock_get_time() uses mach_timespec_t which is very similar
to POSIX timespec_t so we're back to just one Sys_Microseconds() function
with an #ifdef __APPLE__ for the (relatively small) differences
2017-10-22 17:54:19 +02:00
Yamagi Burmeister
3d459be4c1 Fix build on OS X that might not have clock_gettime().
Older versions of OS X don't implement clock_gettime() and no(?) version
seems to implement CLOCK_MONOTONIC. Work around this by implementing an
OS X specific variant of Sys_Microseconds() that relies on Mach APIs
provided by all OS X versions...

While at it alter the generic variant so that CLOCK_MONOTONIC is used
only if it's available. CLOCK_REALTIME as a fallback should be good
enough in most cases.

This is believed to fix issue #239.
2017-10-22 17:52:02 +02:00
Denis Pauk
a08374c8cd Add more strict checks for read/write spaces in pcx decode logic 2017-10-21 01:01:41 +03:00
Denis Pauk
61da3dffd1 Add support for use back button as ESC, as example first button in SDL_GAMECONTROLLERCONFIG 2017-10-14 18:58:19 +03:00
Yamagi Burmeister
4bfd1cb9d4 Calculate the correct offset for the cl_drawfps 1 framecounter.
We need to take in account that scaling the characters makes them
bigger, thus they need need to be places depending on the scale and not
at a precaclulated position. This should fix issue #247.
2017-10-11 19:15:11 +02:00
Yamagi Burmeister
8bfcfa7e70 Fix Sys_*seconds() on legacy Windows versions.
Returning 'microseconds / 1000ll' at the first call is wrong, the game
would thing that the first frame too way too much time. For some reason
this wirks in (my) Win10, but breaks on (my) Win7...
2017-10-02 20:48:47 +02:00
Yamagi
db7676307a Merge pull request #242 from devnexen/macos_build_fix
Macos build fix
2017-10-02 18:02:09 +02:00
Yamagi
c4a86ecb49 Merge pull request #240 from devnexen/master
name field is not a pointer.
2017-10-02 17:59:52 +02:00
David Carlier
54f9798fc8 name field is not a pointer. 2017-10-01 17:47:06 +01:00
David Carlier
6ed1898440 dlopen wrapper expects .dylib extension on osx 2017-10-01 17:46:18 +01:00
Yamagi
b1e3c90a51 Merge pull request #215 from 0lvin/joystick
Add joystick support
2017-09-25 19:41:15 +02:00
Yamagi Burmeister
f9c7d57180 Bump version number to 7.03pre. 2017-09-25 19:39:46 +02:00
Yamagi Burmeister
a8aad9a38a Bump version number to 7.02. 2017-09-25 19:21:04 +02:00
Yamagi Burmeister
aa4f3e39a5 CHANGELOG entries for 7.02. 2017-09-23 14:05:18 +02:00
Yamagi Burmeister
e5c39eeb7f Set -ffloat-store when building with gcc for i386.
This helps the old and crappy x87 FPU to produce correct values. And
finally implement compiler detection in the Makefile.
2017-09-21 18:40:12 +02:00
Yamagi Burmeister
ce2c3292c6 Force the x87 FPU to double precision mode.
The original client used single precision mode on Windows and the
default mode on all other platforms. Most platform (at least OS X,
FreeBSD, NetBSD up to 6.0, OpenBSD and Solaris) set double precision
as default, Linux sets extended double precision... When playing a
network game there're several possibilities:

* Same precision on both sides: This one is okay, of course.
* single precision <-> double precision: This one is okay, too. I guess
  this is because the code allows a small deviation between client and
  server to work around imprecisions introduced be the network protocol.
* double precision <-> extended double precision: This one is okay,
  likely for the same reasons given above.
* single precision <-> extended double precision: This one gives a lot
  of misspredictions at client side.

All of these are more or less academic these days. Yamagi Quake II used
the platforms default mode for ages. And both gcc and clang default to
SSE2 math (with double precision as default on all platforms) when
compiling for amd64. So the only reasonable case is Linux/i386 on one
side and the original client or another source port on Windows/i386 at
the other side.

Work around this by forcing the x87 to double precision mode.
2017-09-20 21:55:43 +02:00
Denis Pauk
e7199f5c41 Add support for joystick/gamecontroller(axis/buttons/hats)/haptic.
By default joystick "in_joystick" and haptic feedback haptic ("joy_haptic_magnitude")
are disabled. And can be anabled by menu in options section. Joystick/Haptic
options are showed only if have found any.

By default axis is mapped in such way:
 * Left X(joy_axis_leftx): sidemove
 * Left Y(joy_axis_lefty): forwardmove
 * Right X(joy_axis_rightx): yaw
 * Right Y(joy_axis_righty): pitch
 * Trigger Left(joy_axis_triggerleft): triggerleft
 * Trigger Right(joy_axis_triggerright): triggerright

Joystick sensitivity varibales:
 * joy_yawsensitivity,
 * joy_pitchsensitivity,
 * joy_forwardsensitivity,
 * joy_sidesensitivity,
 * joy_upsensitivity.

For change joystick axis mapping to gamecontoller axis export SDL_GAMECONTROLLERCONFIG before run,
e.g.: SDL_GAMECONTROLLERCONFIG='<joystick guid>,<joystick name>,leftx:a0,lefty:a1,rightx:a2,righty:a3,'

Add menu navigation by dpad and thresholds:
 * Add threshold for axis (based on ioquake3), 0.15 by defaults.
 * Navigate in menus by dpad (up/down, left/right, any joystick button for enter).

Defaults:
 * in_joystick "0.0"
 * joy_haptic_magnitude "0.0"
 * joy_axis_leftx "sidemove"
 * joy_axis_leftx_threshold "0.15"
 * joy_axis_lefty "forwardmove"
 * joy_axis_lefty_threshold "0.15"
 * joy_axis_rightx "yaw"
 * joy_axis_rightx_threshold "0.15"
 * joy_axis_righty "pitch"
 * joy_axis_righty_threshold "0.15"
 * joy_axis_triggerleft "triggerleft"
 * joy_axis_triggerleft_threshold "0.15"
 * joy_axis_triggerright "triggerright"
 * joy_axis_triggerright_threshold "0.15"
 * joy_forwardsensitivity "1.0"
 * joy_pitchsensitivity "1.0"
 * joy_sidesensitivity "1.0"
 * joy_upsensitivity "1.0"
 * joy_yawsensitivity "1.0"
2017-09-16 14:23:12 +03:00
Yamagi Burmeister
e1ec177dbe Remove miscframe altogether.
Miscframes are coupled to renderframes and are just checking for
renderer changes (very cheap) and advancing CD audio if implemented.
There's no reason not to that at every frame.
2017-09-09 09:39:56 +02:00
Yamagi Burmeister
eb4fdb56de Miscframes must be synchronized with renderframes.
Otherwise vid_restart triggers only if misc- and renderframes match by
luck.
2017-09-08 19:43:54 +02:00
Yamagi Burmeister
b88b3cb85d Add back function call to Cvar_Fini() removed by git in branch merge.
Don't know why git removed it.
2017-09-07 18:31:49 +02:00
Yamagi Burmeister
a0db877031 Merge remote-tracking branch 'memleak/small_mem_leak_fixes' 2017-09-07 18:30:03 +02:00
Yamagi Burmeister
6c7039af80 Revert "Remove empty function Qcommon_shutdown()."
This reverts commit ec428bb752. Looks like
the function is usefull for pull request #232.
2017-09-07 18:19:45 +02:00
Yamagi Burmeister
f3df541b79 Fix a potential crash in ai_run_melee() and ai_run_missile().
This was found and fixed by Maraakate.
2017-09-07 18:13:01 +02:00
Yamagi Burmeister
f107a77edb Fix an undefined function warning on Windows.
shared.h is needed on all platforms so include it unconditionally.
2017-09-07 18:02:31 +02:00
Yamagi Burmeister
42dfd3dbdd Refactor curtime to be set at one defined point.
Until now the curtime variable was set at every call Sys_*seconds().
That's a little bit unfortunate because calls to that functions are
scattered around the code. Instead set it once every frame in
Qcommon_Frame().
2017-09-07 17:12:58 +02:00
Yamagi Burmeister
5fa6fa9175 Sleep 850 microseconds between dedicated server frames.
The dedicated server runs at cl_maxfps frames per second. Een with very
large values one server frame can never be shorter than 1 milliseconds.
And the timing doesn't need to be very precise since the network
latency adds a lot of more jitter.
2017-09-07 14:53:00 +02:00
Yamagi Burmeister
950e581103 Untangle global variables between dedicated only and normal build. 2017-09-07 14:37:51 +02:00
Yamagi Burmeister
70f678fb80 Implement distinct versions of Qcommon_Frame() for both build types.
Yes, this duplicates some code. But it's at least 100 times more
readable to have two distinct functions for distinct purposes instead
of about 25 #ifdef.
2017-09-07 14:24:09 +02:00
Yamagi Burmeister
85890da3bb Cleanup Qcommon_Init(). 2017-09-07 13:51:52 +02:00
Yamagi Burmeister
1fc565a33b Remove unused "error" command.
"error" was a debug command to test emergency shutdowns. It's not needed
any more. Since users may complain that "error" crashes their game
remove it.
2017-09-07 13:36:17 +02:00
Yamagi Burmeister
6ab2b3227a Rename common/misc.c to common/frame.c.
Now that we moved the CRC stuff to crc.c only the frame handling is
left in this files.
2017-09-07 13:31:52 +02:00
Yamagi Burmeister
801695cf35 Move several CRC function from misc.c to crc.c.
While here remove several unused functions and variables.
2017-09-07 13:22:36 +02:00
Yamagi Burmeister
629683ab40 Also print errors when build with DEDICATED_ONLY. 2017-09-07 13:17:02 +02:00
Yamagi Burmeister
ec428bb752 Remove empty function Qcommon_shutdown(). 2017-09-07 13:05:49 +02:00
Yamagi Burmeister
143c5d1e40 Merge branch 'framecounter_5th_try'
Like the branch name suggests this was a rather hard ride. Lessons
learned:

* Quake IIs timing is one big clusterfuck.
* The Radeon driver for Windows has a questionable vsync implementation.

What should be done:

* Get rid of the global currenttime.
* DEDICATED_ONLY needs to be refactored.

This commit closes issue #222.
2017-09-06 19:34:52 +02:00
Yamagi Burmeister
d0cb89ff52 Change Windows mainloop to microseconds.
While at it have another look at it's Sys_*seconds() implementations.
Also add a Sys_Nanosleep() and use it to throttle the game a litte bit.
2017-09-06 18:36:51 +02:00