Commit graph

1055 commits

Author SHA1 Message Date
svdijk
1d81f2e2b6 screen: auto-scale the HUD when gl_hudscale < 0. 2014-05-06 19:45:11 +02:00
svdijk
9be6a7ec46 videomenu: minor tweak regarding the aniso filtering option. 2014-05-05 18:31:08 +02:00
svdijk
092e7e1888 SCR_ExecuteLayoutString: also apply scale to xl and yt to avoid overlap. 2014-05-04 21:07:23 +02:00
svdijk
d823940370 Also apply gl_hudscale cvar to the inventory. 2014-05-04 21:05:56 +02:00
svdijk
ba16e501d2 videomenu: minor cvar ordering change. 2014-05-04 20:47:52 +02:00
svdijk
4e8a5565a9 videomenu: remove obsolete options, some cleanup. 2014-05-04 20:44:29 +02:00
svdijk
af852ea5bd videomenu: add an "aniso filtering" option. 2014-05-04 20:26:12 +02:00
svdijk
97e149ba9e video: avoid artefacts when resizing the viewsize when paused. 2014-05-04 16:05:32 +02:00
svdijk
6b79e31d8d videomenu: correct the "screensize" slider range. 2014-05-04 13:39:05 +02:00
svdijk
a7edd7c466 video: apply changes to gl_anisotropic immediately. 2014-05-01 21:20:00 +02:00
svdijk
3bb9f49f19 videomenu: readd 16x MSAA option, check what we got after setting mode. 2014-05-01 20:52:25 +02:00
Daniel Gibson
7ace8c9116 Implementing gl_hudscale cvar to scale the HUD
because it's so small in high resolutions and I'm an old man with bad
eyes.
2014-04-25 21:24:26 +02:00
svdijk
a2b6f1b7af videomenu.c: remove unsupported "16x" option from MSAA list. 2014-04-20 03:12:13 +02:00
svdijk
a0ca33901e videomenu.c: minor fix regarding the multisampling option. 2014-04-19 13:00:12 +02:00
svdijk
0973c1de10 videomenu.c: consistent capitalization. 2014-04-17 20:25:39 +02:00
svdijk
5b6f351e67 refresh.c: some minor tuning/cleaning. 2014-04-17 20:14:42 +02:00
svdijk
04c5b881a2 Video menu: add msaa option. 2014-04-16 22:47:23 +02:00
svdijk
d089159ab9 VID: Implement a fallback when MSAA is not supported. 2014-04-16 21:51:36 +02:00
svdijk
ec8edb5d3b Video menu: add vsync option. 2014-04-12 15:03:40 +02:00
svdijk
4d201b3ff0 OpenAL: fix lagging audio when leaving the menu. 2014-04-12 14:27:10 +02:00
svdijk
3d2ff6795d R_ScreenShot: set GL_PACK_ALIGNMENT to 1 for glReadPixels. 2014-03-30 17:30:58 +02:00
svdijk
1fd8a853d1 R_ScreenShot: add another sanity check. 2014-03-30 16:32:36 +02:00
svdijk
ded9ed51ea R_ScreenShot: abort if malloc fails. 2014-03-29 19:52:24 +01:00
svdijk
e86aabc949 Menu: make sure spincontrols don't start out of range. 2014-03-29 18:50:48 +01:00
svdijk
219882dafa Make default video mode consistent, some comment/whitespace changes. 2014-03-28 21:12:15 +01:00
svdijk
503eefc301 Simplify the mouse grabbing/relative mode setting code. 2014-03-26 21:13:07 +01:00
svdijk
5338566852 Fix broken mouse release while in menu/console. 2014-03-26 20:51:02 +01:00
svdijk
69661e7cbd Implement a different workaround for when SDL_SetRelativeMouseMode() doesn't work.
This fixes the "stuttering mouse" reported in issue #38.
2014-03-26 20:34:19 +01:00
Yamagi Burmeister
5ce3a266e9 Force OpenGL path for light primitives
This fixes a long standing and until now unnoticed bug with negative
colored dynamic lights. Since we never set the OpenGL renderer as out
renderer, remaining softrenderer code was executed and the corresponding
effects never rendered. This manifested itself in missing darkness
around the "gravity well" in rogue.
2014-02-12 19:39:23 +01:00
Yamagi Burmeister
37dd396f36 Bump version to 5.22 2014-02-08 10:14:24 +01:00
Yamagi Burmeister
d0d81cf3ac Revert "Define HAVE_BOOLEAN on Windows"
This reverts commit 5e1419e6ba. It was a
bad idea, breaking 64 bit compatiblity on Windows. It should have never
been committed...
2014-01-28 08:13:21 +01:00
Yamagi Burmeister
eb879bb9b6 Rename VERSION to YQ2VERSION to prevent collisions
Newer jpeg versions (I guess starting with 9) define an macro
"VERSION", colliding with ours. While wie could #undef it, take
the less hacky route and rename it.
2014-01-27 18:14:36 +01:00
Yamagi Burmeister
5e1419e6ba Define HAVE_BOOLEAN on Windows
Without this define newer versions of jpeg define a type "bool" as char,
while the MinGW headers define it as "unsigned short". Automake should
have detected that, but...
2014-01-27 17:28:59 +01:00
Yamagi Burmeister
93b38c6312 Define macros needed by 26bbfea.
The code used build fine on my workstation, since Mesa3D has the
required macros since ever. But on Windows gl.h is still limited
to OpenGL 1 (really?).
2014-01-27 17:26:33 +01:00
Yamagi Burmeister
26bbfead45 Add support for MSAA.
MSAA was a long wanted and often requested feature. Just set set the
desired number of samples with gl_msaa_samples and do a vid_restart.
This code is based upon work done in Hecatomb.
2014-01-26 09:53:10 +01:00
Yamagi Burmeister
825a53009a Provide a workaround if SDL_GetRelativeMouseState() is disfunctional
On some systems SDL_SetRelativeMouseMode() can fail under several
circumstances. For example:
 - Security software is blocking acces to raw input.
 - XInput 2 is unavailable.
 - SDL2s configure script has messed up.
Detect those situations and reposition the mouse manually to the
window center after having read it's current state. This fixes
issue #34 an #35.
2014-01-25 15:46:55 +01:00
Yamagi Burmeister
68d3da29e8 Destroy the window after the GL context.
The GL context is bound to a window, so destroy it before the window and
not after it. While here update the header comment.
2014-01-23 17:23:16 +01:00
svdijk
98a83e2322 Minor input grabbing cleanup. 2014-01-11 19:01:04 +01:00
svdijk
b33c895d56 Whitespace 2014-01-05 20:32:18 +01:00
svdijk
50e1bf16fe Fix key-repeats in the console (for instance the backspace key) 2014-01-05 20:22:34 +01:00
Yamagi Burmeister
84a1766702 Merge input backend init and keyboard init
Now that the refresher is part of the client, there's no need to init
the backend before the refresher and the keyboard after it.
2014-01-05 18:58:52 +01:00
Yamagi Burmeister
e8239291a7 Remove unnecessary IN_Close()
Having a special function to close the input devices is unnecessary. The
backend should close them at shutdown, when IN_BackendShutdown() is
called.
2014-01-05 18:53:03 +01:00
Yamagi Burmeister
18733b68ce Do not allow input devices to write to command buffer
Input devices should send key events and nothing more. The ability to
add commands into the input buffer was used by the joystick code
(removed long time ago) and as a dirty hack to work around limitations
of DirectInput.
2014-01-05 18:51:27 +01:00
Yamagi Burmeister
f80e02ffd9 Refactor the SDL input backend once again.
- Remove the keyq. This linked list was used to work around limitations
  of the good, old DirectInput API. It's not necessary with SDL.
- Inline some functions to others where apropriate and remove unused
  or unnecessary functions.
- Reorder functions into groups.
- Update comments.

This commits still misses necessary changes to the frontend. They'll be
done in subsequential commits.
2014-01-05 18:40:24 +01:00
svdijk
7111f735f7 Fix a (harmless) off-by-one in a SDL_VideoDriverName() call 2014-01-05 17:44:29 +01:00
Yamagi Burmeister
a6b911a9a8 Bump version number to 5.21 2014-01-01 11:25:36 +01:00
Yamagi Burmeister
be14aea08d Add an signal handler for SIGINT and SIGTERM
This allows the user to shut the client down by pressing ctrl-c in it's
terminal or by sendig SIGTERM.
2014-01-01 11:17:28 +01:00
Yamagi Burmeister
fd1e55d18d Do not set the FPU to single precision on Windows
We had dual precision since ever on 64 bit unixoid systems and it "just
worked". So there should be no reason to still force Windows down to
single precision.  The performance impact should be negligible.
2013-12-31 13:18:05 +01:00
Yamagi Burmeister
8102e1a021 Move entitycmpfnc() to cl_view.c an reimplement it
This function is only used in cl_view.c, so no need for external
declaration. Reimplement it in a sane and on all platform 64 bit
clean way. This allows us to finally remove the horible INT macro.
2013-12-31 12:47:18 +01:00
Yamagi
78b974d3ca Merge pull request #28 from alericoveri/qgl_cleanup
QGL renundancy cleanup
2013-12-31 03:14:55 -08:00
Daniel Gibson
3afe57b8f2 Fix #29 by simplifying mouse button handling
Pressing two mouse buttons at the same time didn't work properly, only
one had effect, e.g. when pressing LMB to walk forward and RMB to shoot
(when bound like that...)

Not sure why that was, but the old mouse button handling (inherited from
the super-old win32 backend where it was supposed to work around bugs in
WinAPI or whatever, where sometimes there were two mouse button presses
in one event or something) was unnecessarily complicated anyway so I
replaced it with something simpler.
2013-11-26 19:22:29 +01:00
Alejandro Ricoveri
1cfb5c67d5 QGL renundancy cleanup
Despite QGL is only handling GL extensions, there was a little code renundancy.
QGL_EXT_Reset sets all extension pointers to NULL.
2013-11-22 08:17:34 -04:30
Yamagi Burmeister
64a39ce09e Bump version number to 5.20 2013-11-14 18:13:35 +01:00
Yamagi Burmeister
0f9dcba9ed Apply some cleanup to the input backend
Make non global functions static, give some better names to variables,
remove unneccessary special cases and remove some superflous functions.
Form most - if not all - users this changes should be a no-op.
2013-11-10 10:10:43 +01:00
Yamagi Burmeister
e7ac0653b2 Merge branch 'sdl2' 2013-11-09 13:21:39 +01:00
Scott Smith
70eef55ab5 OpenGL-ES converstion
Specific device options for pandora, gcw, gph
2013-10-12 12:31:20 -04:00
Yamagi Burmeister
82f3fa84a9 Use "directsound" as sounddriver when using SDL2 on Windows 2013-10-12 12:13:33 +02:00
Yamagi Burmeister
5c5a9beba5 Rename CreateWindow() to CreateSDLWindow()
CreateWindow() is a symbol internal to Windows. We can't use it in out
code or it will collide.
2013-10-12 11:07:05 +02:00
Yamagi Burmeister
5e85fbc8b9 Allow arbitrary screen sizes.
Without this change the width of the render windows was required to be a
multiple of 8, making it unable to use strange resolutions like 1366x768.
This change is based upon an idea submitted by "tmcp" in pull request
27.
2013-10-12 09:29:19 +02:00
Daniel Gibson
d1ca122955 Add -DSDL2 for Win32/OSX support (untested), print SDL2 usage on startup
The quake2 binary now gets -DSDL2 in the CFLAGS, so Win32/OSX can
use different #include paths accordingly.
This is also (ab)used to print which SDL version is used on startup.
Don't use this for anything else, use
#if SDL_VERSION_ATLEAST(2, 0, 0)
instead.

I haven't tested building on/for Win32 or OSX, there may be more
work to do.

Furthermore I added Copyright-Info about CalculateGammaRamp()
in refresh.c (it's from SDL2)
2013-09-01 14:19:33 +02:00
Daniel Gibson
628dff77a8 Clean up + improve setting gamma via xRandR
* save gamma on start and restore on exit
* handle errors
* Restore SDL1.2 compatibility
2013-09-01 03:18:21 +02:00
Daniel Gibson
9af707c7a0 use xrandr for x11gamma (still hacky) 2013-08-27 21:54:48 +02:00
Daniel Gibson
d6dbd6497e Set gamma with SDL2 2013-08-27 19:57:14 +02:00
Daniel Gibson
a83f1c8ff0 SDL2: Fix Icon 2013-08-27 01:16:05 +02:00
Daniel Gibson
997be0dcd1 Fixes for SDL2
* Fix input issues (mouse-wheel and mouse input)
* SDL2 is not default anymore in the Makefile (use WITH_SDL2=yes)
* If SDL2 is enabled, CD audio is disabled (SDL2 doesn't support
  that - use OGG/Vorbis instead)
* Small fix to make it compile with SDL1.2 again
2013-08-26 23:55:34 +02:00
Daniel Gibson
51b7607548 SDL2 support (mostly)
Makefile is adjusted, it compiles and works mostly, but
* For some reason (bug in SDL_GetRelativeMouseState() ?)
  mouse input doesn't work properly.. it seems to be bound
  to window borders, even if input is grabbed
* some keys can't be used anymore because there's no SDLK_*
  for them anymore (gotta find out if this is important)
* Maybe some of the changes need cleanup
2013-08-26 00:55:31 +02:00
svdijk
ee03e7f03a simplify the input grabbing code 2013-07-30 20:13:49 +02:00
Yamagi Burmeister
005fea6c94 Call GLimp_GetProcAddress directly 2013-07-27 08:50:20 +02:00
Yamagi Burmeister
88bd357231 Remove support for old SGI Opengl extensions
Those extensions have become part of ARB about 15 years ago and most if
not all video cards still in use should support the ARB versions. I
believe that at least parts of this code were disfunctional.
2013-07-27 08:47:28 +02:00
Yamagi Burmeister
ad52c5c888 Rename all qgl* functions top their OpenGL counterparts
This removes the need to define the old qgl function names to the
official OpenGL names. The OpenGL functions are now called directly
without any abstraction.
2013-07-27 08:47:21 +02:00
Yamagi Burmeister
ecc4302f94 Alter Makefile and header pathes following the refresh move
With this change the "refresh" make target doesn't any longer exists.
It was merged into the "client" target. One will need a "make clean"
before building yQ2 after this change.
2013-06-15 10:37:11 +02:00
Yamagi Burmeister
8a17f20e64 Move refresher to client/refresh
This is the more appropriate place now that the refresher is merged into
the client
2013-06-15 10:37:11 +02:00
Yamagi Burmeister
85571cfc56 Only cleanup the GL context if OpenGL was initialized 2013-06-15 10:37:11 +02:00
Yamagi Burmeister
9af9f54f36 Remove QGL pointers
This is a manual merge of Hecatomb Q2 ref b8952d5. Manual since git
couldn't do an automerge for some reasons... Notable changes are:
- QGL function pointers are removed, libGL is linked directly
- The OpenGL log framework is removed. It was disfunctional
- The gl_driver cvar is finaly gone
This change is currently untested on Windows and OS. There should
be no problems but a better Makefile integration of libGL is needed.
2013-06-15 10:37:11 +02:00
Alejandro Ricoveri
2b0974822c Client refactoring
Some stuff being reordered
2013-06-15 10:37:11 +02:00
Alejandro Ricoveri
3e45c5e363 Refresh API refactoring
Analog functions of the former refexport_t are now public for the client
to access.
2013-06-15 10:27:30 +02:00
Alejandro Ricoveri
6686b875cc vid.c refactoring
VID_LoadRefresh with no parameters
VID_LoadRefresh doesn't need a DLL name (because there isn't one)
Rename reflib_active to ref_active
Reference to client input callbacks
All declarations are at the beginning of the file
Full reimplementation of VID_Shutdown
VID_Shutdown does all the refresher cleanup
Reimplementation of VID_FreeReflib
Implementation of VID_LoadRefresh
2013-06-15 10:27:30 +02:00
Alejandro Ricoveri
8e69d9dc5c Remove vid_ref cvar
Normally setting gl_mode cvar would result in VID_LoadRefresh because
of vid_ref being "modified". After removing vid_ref out of the picture
it will "modify" vid_fullscreen to replicate the same behaviour.

Variable "name" (who used to hold refresh dll name) is now left unused

All references to vid_ref cvar has been taken out ...
2013-06-15 10:27:30 +02:00
Alejandro Ricoveri
35e1792c91 Input backend refactoring
Get rid of input backend function pointers + some code cleanup that is no longer necessary
2013-06-15 10:27:30 +02:00
Alejandro Ricoveri
a7f02a5b0e The refresher is linked statically into the client, no more 'ref_gl.so'. 2013-06-15 10:27:30 +02:00
svdijk
55d6a601c9 Fix default video mode.
Revert "The default video mode is 5 (640x480). Spotted by svdijk."
This reverts commit a76d7d5cfb.
2013-05-28 20:42:57 +02:00
svdijk
1251fde6e4 credits 2013-05-24 18:21:11 +02:00
Yamagi Burmeister
033550cd59 Bump the version number to 5.11 2013-05-20 19:14:29 +02:00
svdijk
9564b7b55e fix aspect ratio menu option 2013-05-19 18:42:44 +02:00
svdijk
1d0f979bf9 Q_strlcat minor bugfix 2013-05-18 21:07:52 +02:00
svdijk
5692388da1 cleanup Com_sprintf, minor tuning 2013-05-18 19:01:23 +02:00
svdijk
6472514c8f Lets not do the last two commits just before 5.11
Revert "change several strcat calls to Q_strlcat calls"
This reverts commit ab879f1bc7.

Revert "change (v)sprintf calls to (v)snprintf calls"
This reverts commit b46e210d76.
2013-05-18 18:59:39 +02:00
svdijk
ab879f1bc7 change several strcat calls to Q_strlcat calls 2013-05-17 22:25:18 +02:00
svdijk
b46e210d76 change (v)sprintf calls to (v)snprintf calls 2013-05-17 21:50:31 +02:00
svdijk
be63c7f198 note to self: always compile before you commit 2013-05-13 21:39:53 +02:00
svdijk
a5044a93eb make sure svs.demofile is set to NULL after closing it 2013-05-13 21:26:58 +02:00
svdijk
662229a568 fix FS_FOpenFileWrite, also make FS_FOpenFile{Write,Append} open in binary mode 2013-05-13 21:17:55 +02:00
svdijk
f5a44ff5ae remove unnecessary fileHandle_t typecasts 2013-05-13 21:11:52 +02:00
svdijk
2ad4255187 fix sv.demofile/svs.demofile type/treatment 2013-05-13 21:00:50 +02:00
svdijk
4bef586e67 remove unnecessary fileHandle_t typecasts 2013-05-13 18:49:16 +02:00
svdijk
b08fbb7cbf replace remaining strncat calls with memcpy calls 2013-05-13 18:38:37 +02:00
svdijk
8fad0a9008 change some more (mostly wrong) strncpy calls to Q_strlcpy calls 2013-05-12 20:25:00 +02:00
svdijk
c469a97b36 fix typo 2013-05-11 15:29:02 +02:00
svdijk
7c1d2b4219 fix incorrect typecasts in FS_* calls 2013-05-11 15:22:27 +02:00
svdijk
e07294b6b1 replace most strncpy calls (several of them wrong) by Q_strlcpy calls 2013-05-11 14:44:36 +02:00