Commit graph

1404 commits

Author SHA1 Message Date
Daniel Gibson
c4c21075a4 vid_listmodes command to show video modes, add 720p mode
the very unusual 1280x854 mode has been replaced with the more common
1280x720 ("720p").
2017-02-25 20:33:17 +01:00
Daniel Gibson
66e9c5f6db GL3: fix calculation of perspective matrix, some cleanups
turns out R_MYgluPerspective() was not the same as gluPerspective()
and thus not equivalent to HMM_Perspective() either. Because of this,
the weapon and corresponding arm looked different in GL3 vs GL1.
Created GL3_MYgluPerspective() to fix that.
Also tested optimized code in GL3_RotateForEntity() and
rotAroundAxisZYX(), use this code from now on and cleaned it all up by
removing commented out code.
2017-02-20 17:08:59 +01:00
Daniel Gibson
5511f44c99 GL3: Delete new shaders in GL3_ShutdownShaders()
also a small optimization in GL3_DrawAliasModel(), and adding that
function to local.h
2017-02-20 17:04:52 +01:00
Daniel Gibson
eadb607ac3 GL3: Support left-handed gun rendering (hand=1)
that was easy..
however, not related to this change or left vs right hand, the gun
seems to be drawn too far back, we should see more of the arm..
I wonder where that went wrong...
2017-02-20 02:16:34 +01:00
Daniel Gibson
de0197a8c0 GL3: Render models (weapons, items, monsters, projectiles etc)
introducing vertex color attributes GL3_ATTRIB_COLOR (it's used for
lighting models and to render models flat-colored, I think that's used
for quad damage effect and similar)
2017-02-20 02:03:31 +01:00
Daniel Gibson
098890805f GL3_BindVBO(vbo) wrapping glBindBuffer(GL_ARRAY_BUFFER, vbo)
avoids calling glBindBuffer() if the vbo is already bound, similar
to GL3_Bind(), GL3_BindVAO(), GL3_UseProgram() etc
2017-02-20 02:01:48 +01:00
Daniel Gibson
30026f2025 Make usage of anormtab.h a bit cleaner
bla =
#include "blub.h"
;

sucks, bla = {
#include "blub.h"
};
is a bit cleaner, especially regarding comments in "blub.h"

(Eclipse was very confused)
2017-02-19 06:04:47 +01:00
Daniel Gibson
f5e2fb16b4 GL3: Draw Entities (only brush-based so far) 2017-02-19 06:04:47 +01:00
Daniel Gibson
8723f73831 Show renderer name in window title 2017-02-19 06:04:47 +01:00
Daniel Gibson
7cd86106dc GL3: Use HMM types in structs for UBOs, some cleanups
.. hmm_mat4 and hmm_vec4 are much easier to set than float arrays.

removed some debug code from initShader2D()
2017-02-19 06:04:47 +01:00
Daniel Gibson
101b9b14bb GL3: Flowing (non-warping) textures 2017-02-19 06:04:47 +01:00
Daniel Gibson
d7b5c7e86e GL3: shared UBOs instead of normal uniforms; warping water 2017-02-19 06:04:47 +01:00
Daniel Gibson
6e07ff0a2d GL3: Rework 2D drawing, Rotation-Matrix stuff; common vtx attr layout
kind of messy commit with all the shit from last weekend, finished now

Most importantly the common vertex attribute layout stuff using
glBindAttribLocation()
2017-02-19 06:04:43 +01:00
Daniel Gibson
57fd192cda GL3: levels are rendered a bit
the code is still very much WIP and kinda crappy, especially the
  static GLuint vao = 0, vbo = 0;
part in GL3_DrawGLPoly()
2017-02-19 06:03:07 +01:00
Daniel Gibson
0b35ceabdc GL3: added missing source files and stubs of most functions
still no 3D rendering, but in theory it should be able to load models,
bsps etc, just not render them yet.

also moved/copied md2.c and sp2.c to gl/ and gl3/ because they use
renderer-specific types
2017-02-19 06:03:07 +01:00
Daniel Gibson
ebbb675cb8 GL3: gamma and intensity via shader
only for 2D rendering, as we don't have 3D yet; also this might need
a more flexible solution later, as some textures are not supposed to
have intensity applied.
According to the old R_Upload32*() and R_LightScaleTexture() the ones
without mipmaps didn't get intensity. Those were it_pic and it_sky (and
the ones in the "scrap", but those were it_pic too)
2017-02-19 06:03:07 +01:00
Daniel Gibson
43e108fb9b GL3_Draw_* is done, menu, console, videos work 2017-02-19 06:03:07 +01:00
Daniel Gibson
678410bfb4 Added super simple shaders, does render videos now 2017-02-19 06:03:07 +01:00
Daniel Gibson
56661fd43f GL3: Add remaining stubs, add HandMadeMath, update Copyrights 2017-02-19 06:03:07 +01:00
Daniel Gibson
26904949c2 Implemented GL3_LoadPic() and related functions
so loading texture and uploading them to the GPU should work.
a pity there's no code to use them yet :P
2017-02-19 06:03:07 +01:00
Daniel Gibson
0787b75792 Cache gl_nolerp_list Cvar in ref libs, fix possible bug in R_FindImage()
I see no reason to Cvar_Get() gl_nolerp_list again and again, just save
it like all the other gl_ Cvars.
2017-02-19 06:03:07 +01:00
Daniel Gibson
64a456b867 Moved LoadWal() to r_image.c/gl3_image.c
It returns the renderer-specific image_t*; wal.c is now
renderer-agnostic and only contains GetWalInfo().
2017-02-19 06:03:07 +01:00
Daniel Gibson
c098ee2ce3 LoadPCX() supports palette=NULL to avoid malloc()
when called from R_FindImage() the palette wasn't used anyway.
R_FindImage() now passes NULL.
(LoadPCX() is still called with non-NULL palette from Draw_GetPalette())
2017-02-19 06:03:07 +01:00
Daniel Gibson
9970dc43ad some further steps; ref_shared.h shared between ref libs
still nothing useful..
2017-02-19 06:03:07 +01:00
Daniel Gibson
324eaa8048 begin implementing ref_gl3
so far it can't even be loaded completely and has no code for
rendering yet
2017-02-19 06:03:07 +01:00
Daniel Gibson
aaa73236ec refexport_t::Init() now returns bool and has no args; minor things
the arguments were not used anyway, and returning true/false is clearer
than returning -1 (for error) or sth else (which has no deeper meaning
anyway).

Also:
* PrepareForWindow() can now return -1 if there's an error
* suppress some warnings in Makefile
* fix error for building ref_gl.dylib on OSX
2017-02-19 06:03:07 +01:00
Daniel Gibson
5938a665e8 pass Com_VPrintf() to reflib used by R_Printf(), remove VID_Printf()
So in all code in the reflib (ref_gl.dll/.so/.dylib) calls to
ri.Con_Printf(print_level, fmt, ...) have been replaced by calls to
R_Printf(print_level, fmt, ...) which uses ri.Com_VPrintf().
2017-02-19 06:03:07 +01:00
Daniel Gibson
a0c1c74a2e (Mostly) get rid of VID_Printf() and VID_Error()
they're only wrapping Com_Printf() and Com_Error() anyway
2017-02-19 06:03:07 +01:00
Daniel Gibson
54ae3be0c6 Com_VPrintf(level, fmt, argptr) (Com_D?Printf() wraps that)
somehow all the printf()-like things in Q2 wrap each other and each
one prints into a buffer and then calls the next one with ("%s", buf).
That's not very clever and kinda annoying.
As in the end everyone calls Com_Printf() I created Com_VPrintf()
that can be called instead with the va_list.

I also added printf-format annotation to Com_Printf() and Com_DPrintf()
and fixed places where Com_Printf() was called with the wrong type.
2017-02-19 06:03:07 +01:00
Daniel Gibson
c743aaa8fe Copyright-header in r_sdl.c
forgot that when I created the file..
2017-02-19 06:03:07 +01:00
Daniel Gibson
181d4fa0ea Move client/refresh/header/* and qgl.h to client/refresh/gl/header/*
and the changes in the including files for this.

(also removed gl.h includes from local.h, as it's already included in
 qgl.h which is included by local.h)
2017-02-19 06:03:07 +01:00
Daniel Gibson
73cf610cdb Only use client/refresh/header/local.h in refresh lib
that's why it's called "local.h". duh.
(next I'll move it to refresh/gl/)
2017-02-19 06:03:07 +01:00
Daniel Gibson
9252eba643 use vid_ref cvar to select render dll 2017-02-19 06:03:07 +01:00
Daniel Gibson
7f27c549a8 It works again, ref_gl doesn't use any client symbols anymore
So in theory this should even work on Windows now.
2017-02-19 06:03:07 +01:00
Daniel Gibson
0588d3f988 VID_Error -> ri.Sys_Error; VID_Printf -> ri.Con_Printf 2017-02-19 05:53:56 +01:00
Daniel Gibson
2062b319e9 move qgl.[ch] to src/client/refresh/gl/ 2017-02-19 05:53:56 +01:00
Daniel Gibson
f13e15e561 ref_gl.so builds and works (on Linux, with Makefile)
still dirty, seems to use some symbols from client directly, which will
not work on Windows.
2017-02-19 05:53:56 +01:00
Daniel Gibson
3a65b41d60 Move OpenGL render specific files to src/client/refresh/gl/ 2017-02-19 05:53:56 +01:00
Yamagi Burmeister
6e5cf7ee08 Add a cvar gl_showbbox for drawing entities bounding boxes 2017-01-19 21:04:58 +01:00
Yamagi Burmeister
55d7842a02 Add back 'spectator' and 'password' cvars.
Those are special cvars that just need to be registered. They're used
in the servers userinfo structures. This closes issue #166.
2017-01-02 19:45:22 +01:00
Yamagi Burmeister
44472722e0 Make sure that a monsters enemy is still alive when deciding to attack.
When the monster was already killed by another monster or a coop player
some references may be NULL and the game was crashed. This was observed
by maraakte, who reported it in issue #164. I've just merged his fix
from q2dos.
2016-12-28 18:29:08 +01:00
Yamagi Burmeister
af957c5e36 Fix a small buffer overflow when disabling shuffle playback
Repeat 10 times:
 - strcat() is evil
 - strcat() is evil
 ...

While here fix another small inconsistency: Vorbis playback should
stop when switching 'shuffle' on.

The overflow was reported by @tomgreen66 in pull request #168.
2016-12-28 17:23:51 +01:00
Yamagi Burmeister
c07fe5ac2d Reorder conditionals to please unoptimizing compilers
This was requested by Maraakate. This is likely a noop, since even
early compilers from th 1970th supported simple optimiziations like
this.
2016-12-20 15:14:59 +01:00
Yamagi Burmeister
693b7bfb84 Use strtod() instead of strof() to aid VS2005 2016-12-18 10:17:06 +01:00
Yamagi Burmeister
8fe8f832f8 Remove last remnant of multitexturing.
Pointed out by DanielGibson.
2016-12-18 09:48:06 +01:00
Yamagi Burmeister
a774846659 Change edict_s->show_hostile from qboolean to int and add casts
This variable is used as an integer. Defining it as a qbooblean is
just wrong. Add some explicit float -> int casts while at it.
2016-12-18 09:11:58 +01:00
Yamagi Burmeister
c26f85fd02 Rename teleport_time to last_sound time
teleport_time has nothing to do with teleports, it's just the time
since the last player sound. Rename it accordingly. This was suggest
by maraakate in issue #162.
2016-12-18 09:07:51 +01:00
Yamagi Burmeister
935c37f819 Fix monsters ignoring the player under certain circumstances
In ai_checkattack() is a check against AI_SOUND_TARGET. If the player
made a noice and the the monster noticed this noise it's true. If
that noice was more than 5 seconds ago the monster forgets that event
and continues with it's search for the player. Otherwise it informs
the surrounding monsters that something interesting has happened and
then returns false. So the problem is: Even if the monster heard the
player and can see him, it aborts at this point.

Fix this by adding an additional visibility check. Do the sound
checking only if the player is not visible, otherwise just continue.

This was reported by shoober420 and debbuged by maraakate. This fix
was DanielGibons idea. This commit fixes issue #162.
2016-12-18 09:04:46 +01:00
Yamagi Burmeister
9b8bb03df7 Make sure that strings are null terminated.
This is a noop, it just adds some safety. This was reported by maraakate
in yquake2 issue #160.
2016-12-17 11:47:43 +01:00
Yamagi Burmeister
025364677c Load sexed models only in multiplayer.
This was reported by maraakate in issue #160.
2016-12-17 11:28:57 +01:00
Yamagi Burmeister
d81768966b Use strtof() instead of strtod() to safe a case. 2016-12-17 11:27:30 +01:00
Yamagi Burmeister
bfae128a5c Use Q_strcasecmp instead of Q_stricmp().
This should be be noop but looks safer. Reported by maraakate in yquake2
issue #160.
2016-12-17 11:25:55 +01:00
Yamagi Burmeister
52fd07eb33 Add missing sanity checks to ED_ParseEdict() and ED_NewString()
This was reported by maraakate in issue #160.
2016-12-17 11:24:40 +01:00
Yamagi Burmeister
971bca9914 Send the player entity to the server when in intermission.
I don't think that this has any visible effect, but it's saver than
assume that in multiplayer all clients enter the intermission at the
same time. This was reported by maraakate in yquake2 issue #160.
2016-12-17 11:22:07 +01:00
Yamagi Burmeister
2b317075c7 Treat autoexec.cfg like every other config.
Until now autoexec.cfg was a special case. It was read several
times, whenever the 'game' cvar was altered or when the client was
restarted. But only if it was in the right directory in the right
position of the internal search path... Remove this altogether and
replace it by an ordinary 'exec autoexec.cfg' at startup.

This may break some mods that depend on an autoexec.cfg if the user has
his own version in ~/.yq2/. Such mods should use default.cfg instead.

This closes issue #163.
2016-12-13 17:03:11 +01:00
Yamagi Burmeister
68a12d4ee1 Remove multitexturing support
Multitexturing was never part of any official Quake II release. It was
added in version 3.21, which was released only in source. Over the years
many developers tried to fix multitexturing, including myself. Yamagi
Quake II had it even enabled by default for several releases... But:

  * Multitexturing is poorly implemented and **slow**
  * Multitexturing leads to render errors, for example in city3
  * Multitextring is ortogonal to the normal render path and adds a
    lot of special cases to the renderer

Remove it for good. Ciao, it wasn't a nice time. :) The last version
before this commit was at least somewhat fixed, read some of the worst
problems were fixed. If someone's ever going to resurrect it, it would
be a good idea to start at that point.
2016-12-03 09:46:08 +01:00
Yamagi Burmeister
248662ff73 Bump version number to 6.01pre 2016-12-03 09:16:02 +01:00
Yamagi Burmeister
bb54225ad9 Bump version to 6.00. 2016-12-02 16:39:02 +01:00
Yamagi Burmeister
c5a6dcf3e0 Revert 76e4017, it was a missmerge
In baseq2 there's no need to force a certain damage texture on gunners
since there's only one. Also gunners can't wear the powershield so
there's no need to turn it of.

This was noticed by Maraakate.
2016-12-02 15:51:14 +01:00
Yamagi Burmeister
f6f8394b74 Ensure that all keys are marked up when playing cinematics
Otherwise at least one key may be still marked as down causing an
immediate abort of playback. While here be a little bit paranoid
and clean up key states when focus is gained. In theory that's a
no-op.
2016-11-08 17:37:24 +01:00
Yamagi Burmeister
2f3f31f507 Remove an unused variables, forgotten in the last commit 2016-11-07 19:34:56 +01:00
Yamagi Burmeister
f41f96e899 Use correct texture coordinates when drawing the video
When the video is scaled through OpenGL we can just throw it on our
vertexes and everything's alright. But when we're softscaling the video
we must consider that the videos size doesn't really match the vertex
size...
2016-11-07 18:52:24 +01:00
Daniel Gibson
051be8285d Fix (text in) videos (for GPUs supporting NPOT textures)
especially in the intermission videos, the text looked broken, as parts
of the characters were missing.
This is because Draw_StretchRaw() converts the 320x240 video frame into
a 256x256 texture, without doing proper interpolation (just skipping
some pixels instead).
Now, if the GPU supports non-power-of-two texture sizes, the video
frames are uploaded as textures in their original size.

(Also fixed a harmless typo in common.h)
2016-11-06 23:44:54 +01:00
Yamagi Burmeister
5e5217e549 Fix a rare crash in flyer.c with self->enemy being NULL
This crash was found by DanielGibson, he even guessed the right fix
without having a usable coredump. ;) In boss1.bsp Macron is waiting for
the player, despawning as soon as the player moves to him. After that
the player needs to press 2 buttons, each button triggers 3 flyers. If
the player is fast enough, the first bunch of flyers may spawn before
macron is despawned. Now there's a small chance that a flyer decides to
attack macron... If Macron despwans at the the next frame, self->enemy
is set to NULL (Macron is gone) but nevertheless flyer_fire() is called.

The correct fix would be to call flyer_fire() before Macron despawns,
but that's hard to impossible. So take the easy route and check if
self->enemy is not NULL.
2016-11-04 19:22:33 +01:00
Yamagi Burmeister
548c217da8 Fix wrong monster count in city3.bsp
In city3.bsd ("Upper Palace") a hidden and unaccessible room next to the
security pass exists. In this room a grenate launcher and a pack of
grenates can be found. When the room is entered, two floaters are
triggered nearby. This can never happen, so the player is unable to
reach the goal of killing 75 monsters. Quirk around this by lowering
the total number of monsters by 2.

This bug has been known for a long time:
- http://quake2.weiel.net/2004/Aug/26/01150ca0bb36a5f46c9cb0b154aeb8d8.html
- https://groups.google.com/forum/#!topic/alt.games.quake2/W7jdIIHthrw
- http://www.quake3world.com/forum/viewtopic.php?f=3&t=4733
2016-11-04 19:12:39 +01:00
Yamagi Burmeister
882297c33e Fix monsters blocking when not on ground entity
This bug was "fixed" by id with removing two lines in the ground entity
check. When cleaning up the game I added them back... I don't know if
it's really correct to just remove them, but let's try it. This fixes
issue #157.
2016-10-31 11:51:07 +01:00
Yamagi Burmeister
aa897e3965 Make OSTYPE and ARCH user defineable.
The old implementation had two problems:

  * OSTYPE and ARCH are systemwide defines, overriding them may break
    the global libc headers. This is a theoretical problem, I've never
    seen it in praxis.

  * Not all system set ARCH correctly when building in a chroot env.
    For example on Linux ARCH is set to x86_64 when building in an
    i386 chroot. Now the user can do something like "make YQ2ARCH=i386"
    to get things right.
2016-10-24 18:02:17 +02:00
Daniel Gibson
5d440bbb00 Make debris SOLID_NOT, fixes #154
In lower mines you can drop a rock onto a tank by using a lever.
This was broken, the rock exploded instead of dropping, because debris
is spawned and that debris was solid.
Now the debris is not solid anymore (like it was up to
b4d16ab6b3
"Some additions to last commit:") and it works again
2016-10-24 17:27:57 +02:00
Yamagi Burmeister
a0a34e0a35 When an invalid muzzle flash offset is send, just return.
The original client crashed (or survived by pure luck) when muzzle
flash offsets >210 were send. Our fix was to bail out, but that broke
some buggy mods... So just return and print an optional debug message.

This fixes issue #153.
2016-10-23 18:36:43 +02:00
Daniel Gibson
10a8dfa388 Fix typo in ai_checkattack() leading to monsters running in place
this fixes #151
2016-10-23 17:55:04 +02:00
Yamagi Burmeister
7f996cc29e Don't smooth half height steps
This step height is used by several evelators, leading to stuttering due
to misspredictions. Additionally half height steps weren't smoothed by
the synchronous client.
2016-08-29 19:58:47 +02:00
Yamagi Burmeister
31c564a030 Setting the window position was unsupported for years. 2016-08-18 18:58:18 +02:00
Yamagi Burmeister
073d6ef837 Unify gl_cull and gl_nocull. 2016-08-18 18:25:23 +02:00
Yamagi Burmeister
b36e60e097 Remove gl_anisotropic_available. It's unnecessary... 2016-08-18 18:19:02 +02:00
Yamagi Burmeister
87f9084df1 Clamp overbright bits in warping surfaces to 1.
They oversaturate otherwise.
2016-08-17 21:12:52 +02:00
Yamagi Burmeister
1bbd8c04ff I think that steps between 94 and 98 are wrong, remove them.
Predicting these steps leads to a heavily stuttering elevator in
hangar1. I think that steps between 94 and 98 can't appear on stairs, so
just remove them. If I'm wrong we need a hack to the hack ontop of the
hack... ^^
2016-08-17 21:03:36 +02:00
Yamagi Burmeister
6ff41e6b2f Remove unused and broken functions for writing files. 2016-08-16 20:14:41 +02:00
Yamagi Burmeister
9af1af55a5 Allow reading player models from pak / pk2 / pk3 / zip files.
This fixes #119. As always I've chosen the least invasive way to solve
this problem. Trying to open players/$model/trix.md2 is hack, but solves
the problem without changes to filesystem.c and it's API.
2016-08-16 19:58:22 +02:00
Yamagi Burmeister
fb7c79c93b Be a tough boy and set cl_async to 1 2016-08-15 21:37:09 +02:00
Yamagi Burmeister
58d1fa02bc Switch overbright bits off by default to get the classic look 2016-08-15 21:36:33 +02:00
Yamagi Burmeister
88244bd4a4 Unbreak SDL 1.2 build. 2016-08-14 16:46:07 +02:00
Yamagi Burmeister
4d9d555d8e When vsync is enabled, cap the desired rfps.
With vsync enabled the render times of consecutive frames can diverge.
The first frame arrives right at the next display frame and is rendered
without waiting time. The next frame has to wait 20ms. The leads to some
problems with the move prediction if the client is asynchronous. Fix
this by capping the desired frame rate at the display refresh rate. Also
make sure that the network framerate is never higher then the renderer
framerate.

With the commit the timing is always correct:
* With no limit as much frames as possible are rendered. In this case
  rfps > nfps and everything's good.
* With vsync enabled rfps > nfps or rfps == nfps is given. Also rfps
  will never exceed the display refresh rate.
* On slow hardware either rfps > nfps or an implicit rfpc == nfps is
  given.
2016-08-14 16:35:48 +02:00
Yamagi Burmeister
0ba7614739 Use nanosleep() instead of a busy wait loop.
This cuts the cpu time requirements in half. Windows has no equivalent
for nanosleep(), so keep the busy loop.
2016-08-14 12:50:27 +02:00
Yamagi Burmeister
98683cbc31 Render the first frame right after the start.
Otherwise we would wait several client frames. This is a cosmetic change
without any visable effect.
2016-08-14 12:50:21 +02:00
Yamagi Burmeister
93e9633382 Port step smoothing code from r1q2.
While the bugfix in a6f4a3b made the steping prediction working for
stairs, elevators are still stuttering. r1q2s code solves this problem
and is a little bit faster. Use it instead.
2016-08-14 12:45:16 +02:00
Yamagi Burmeister
f16928f2cf Implement a better hack for warping surfaces regarding lightning.
The old hack was sufficient for classic rendering, but break with
gl_overbrightbits enabled. See the inline comment for details.
2016-08-13 12:18:31 +02:00
Yamagi Burmeister
d6136cbba5 Bump cl_maxfps to 60.
Yesterday I chose setting cl_async to 0 since I saw some movement
changed with the async client enabled. Especially when clipping against
bevels the game started to stutter and there were small rendering
problems. After some debugging I realized that it is caused by slight
inaccuracies in the move prediction. When cl_maxfps is too low, the
movement error between two render frames becomes to big, leading to
misspositions. There're two ways to solve this problem:

* Processing more client frames. Most async clients I've looked on
  process 60 or even 90 render frames. I chose to stay at 60 since
  I was unable to see differences with higher rates.

* Changed to pmove.c and the pmove_t struct. Some multiplayer focused
  clients go that way. But there's a very high of breaking singleplayer
  movement and pmove_t is part of the server <-> game API. Additionally
  the network code must / should be altered. So this is unsuitable for
  YQ2.

Please note that there's still a change in movement. Before 4ae8706 and
when cl_async is set to 0 movement is dependend on the render framerate.
At low framerate bevel clipping isn't working too good, at high
framerates prediction causes physics changes like the famous 125hz bug.
With cl_async set to 1 the network framerate is stable, leading to a
more consistant behahiour.
2016-08-13 12:17:31 +02:00
Yamagi Burmeister
070d94ec77 Add a cvar cl_async, off by default.
Most (all?) clients implement the synchronous and the asynchronous
client by seperate code pathes. Instead of doing that we force the
asynchronous path to process one network frame for each render frame.
2016-08-11 19:36:42 +02:00
Yamagi Burmeister
a6f4a3b309 Don't predict one frame too far.
We're missusing the current frame to pass data from the input subsystem
to the movement prediction without a server frame. While we can use the
current frame for the movements itself, it's not finished and thus
unsuitable for stair step prediction. Also oldframe is determined
wrongly. As a result the player "jumps" over stairs.
2016-08-11 19:11:33 +02:00
Yamagi Burmeister
a9853ae44e Remove more dead cvars. 2016-08-11 19:07:08 +02:00
Yamagi Burmeister
02725785dd Apply gl_overbrightbits to dynamic lightmaps.
Without this the dynamic lightning is too dark in contrast du the rest
of the world when gl_overbrightbits is 2 or even 4.
2016-08-08 21:06:59 +02:00
Yamagi Burmeister
347cdb7f81 Some more fixes to gl_overbrightbits in non multitexturing case.
- Apply overbright bits only to static lightmaps and not dynamic ones.
- Apply overbright bits to alias models.
2016-08-07 10:39:22 +02:00
Yamagi Burmeister
f8ac496b69 Bump version number to 6.00pre 2016-08-07 10:14:07 +02:00
Yamagi Burmeister
a6d77401ba Remove now unused variable 2016-08-07 10:12:56 +02:00
Yamagi Burmeister
5f4d4e533f Apply gl_overbrightbits only to full lightmap chains.
I think / guess / *fingers crossed* that this fixes the different
brightness levels between normal and multitexturing mode reported
in #147.
2016-08-06 19:21:34 +02:00
Yamagi Burmeister
f064c76eb2 Remove dead cvars and support code 2016-08-06 18:41:57 +02:00
Yamagi Burmeister
cd61504af8 gl_config.mtexcomb should depend on gl_config.multitexture 2016-08-06 18:28:02 +02:00
Yamagi Burmeister
dd36eee0f1 Apply gl_overbrightbits only at lightmaps, not normal textures. 2016-08-06 18:11:10 +02:00
Yamagi Burmeister
38a72e018a Implement gl_overbrightbits in non multitexturing mode
This is still slighty broken, looks the overbright bits are applied in
both R_DrawGLPoly() and R_DrawGLPolyChain(). Fix to come.
2016-08-06 17:06:37 +02:00
Yamagi Burmeister
a2400bc145 Clamp gl_overbrightbits to 0, 1, 2 or 4.
Most (all?) GPUs / OpenGL implementation doen't support more
2016-08-06 15:39:46 +02:00
Yamagi Burmeister
698e2a26ba Switch GL_ARB_texture_env_combine to our new probing logic 2016-08-06 15:32:08 +02:00
Yamagi Burmeister
5840bd570b Use vertex arrays in R_RenderLightmappedPoly.
This is done for normal surfaces only. To change SURF_FLOWING surfes I
need to find such a surface somewhere in the game...
2016-08-06 15:25:54 +02:00
Yamagi Burmeister
bcde80834f Probe GL_ARB_multitexture with our new proping logic
And rename gl_ext_multitexture to gl_multitexture.
2016-08-06 15:15:18 +02:00
Yamagi Burmeister
dafc41f509 Switch GL_ARB_texture_non_power_of_two to our new probing logic.
While at it rename R_Upload32Old to R_Upload32Soft.
2016-08-06 10:37:24 +02:00
Yamagi Burmeister
2e7166b157 Probe GL_EXT_texture_filter_anisotropic with our new logic 2016-08-06 10:18:58 +02:00
Yamagi Burmeister
43c9970772 Switch GL_EXT_paletted_texture to the new probing logic 2016-08-06 10:08:17 +02:00
Yamagi Burmeister
9f0b5d067b Use GL_ARB_point_parameters instead of GL_EXT_point_parameters.
While here switch GL_ARB_point_parameters to a new probing logic and
rename the Cvar to gl_pointparameters.
2016-08-06 09:50:16 +02:00
Yamagi Burmeister
4057376993 GL_EXT_compiled_vertex_array is unused. Remove it.
At can be added back, if it's ever needed.
2016-08-06 09:35:08 +02:00
Yamagi Burmeister
0967f051d8 Require OpenGL 1.4 2016-08-06 09:32:20 +02:00
Yamagi Burmeister
e4751e8c44 Use OpenGL multitexturing extensions to implement multitexturing...
This is a slighty revised version of id Software original code. Icculus
code may have some advantages on broken drivers or underpowered GPUs.
Today it's just a performance hook. This is a first step in fixing #147.
2016-08-05 18:38:48 +02:00
Yamagi Burmeister
2baf97bdf6 Throttle the client to 1000 FPS.
This is more than enough for everyone and prevents wasting CPU time.
Without this change as many client frames as possible are rendered,
Quake II uses a complete core.
2016-08-05 07:49:47 +02:00
Yamagi Burmeister
7ea4db4ace Remove now unused function CL_SendCommand(). 2016-08-04 21:29:30 +02:00
Yamagi Burmeister
d15f5d5b97 Make sure CL_UpdateWindowedMouse() is called.
Without this the automatic mouse grab is not working.
2016-08-04 21:28:17 +02:00
Yamagi Burmeister
a70cc2d923 Switch the refresher to vertex arrays
This is based on work submitted by Scott "pickle" Smith. It's said that
vertex arrays are somewhat faster and more compatible than the old way.
This may remove support of some very, very old GPUs like the Riva128.
2016-08-04 21:11:31 +02:00
Yamagi Burmeister
4dcdb0dc17 Force GL_LIGHTMAP_FORMAT instead of gl_tex_solid_format.
This is more less cosmetics since gl_tex_solid_format == GL_RGB and
GL_LIGHTMAP_FORMAT == GL_RGBA. No measurable FPS change on Nvidia and
Intel. Based upon the OpenGL ES patch by Scott "pickle" Smith.
2016-08-04 21:11:31 +02:00
Yamagi Burmeister
275271c647 Always specify the alpha channel.
This is based upon the original OpenGL ES patch by Scott "pickle"
Smith. This change gives about the same frame rate on an 750TI but
about 3% more frames on an Ivy Bridge IGP with Mesa3D...
2016-08-04 21:11:31 +02:00
Yamagi Burmeister
4ae8706d22 Make the client asynchronous, e.g. decouble net and refresh frames.
This is largely based upon the cl_async 1 mode from KMQuake2, which in
turn is based upon r1q2. The origins of this code may be even older...
Different to KMQuake2 the asynchonous mode is not optional, the client
is always asynchonous. Since we're mainly integrating this rather
fundamental change to simplify the complex internal timing between
client, server and refresh, there's no point in keeping it optional.

The old cl_maxfps cvar controls the network frames. 30 frames should be
enough, even Q3A hasn't more. The new gl_maxfps cvar controls the render
frames. It's set to 95 fps by default to avoid possible remnant of the
famous 125hz bug.
2016-08-04 17:36:42 +02:00
Yamagi Burmeister
fa4eacc976 At OpenAL shutdown don't do not stop only the stream chan but all chans.
I'm not quite sure if this really makes a difference. But it's the only
idea I have regarding several "Quake II hangs at shutdown when OpenAL is
run with Pulseaudio backend" bugs.
2016-08-04 09:21:33 +02:00
Yamagi Burmeister
978eec1a8d Add an explicit fflush() when writing the config.
Yes, fclose() flushes the stream and yes, this is unnecessary. But I've
seen at least two times partial written configs on Win 10. :(
2016-08-04 09:07:47 +02:00
Yamagi Burmeister
f291693c59 Quit the game if a SDL_QUIT event is received. 2016-07-18 10:11:54 +02:00
Yamagi
7cb455459a Merge pull request #144 from smcv/source-date-epoch
savegame: ensure that BUILD_DATE is defined
2016-07-05 19:37:56 +02:00
Simon McVittie
38ff49e480 savegame: ensure that BUILD_DATE is defined
The game code does not include common.h, so it needs to redo this
part for builds without SOURCE_DATE_EPOCH, where BUILD_DATE will
not have been passed in from the outside.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-07-05 18:29:54 +01:00
Yamagi
5323873476 Merge pull request #143 from smcv/link-libopenal
Optionally link libopenal at compile time
2016-07-05 19:13:57 +02:00
Yamagi
0da70104e2 Merge pull request #142 from smcv/source-date-epoch
Override __DATE__ from SOURCE_DATE_EPOCH if set
2016-07-05 18:50:31 +02:00
Simon McVittie
5887a9e79e Optionally link libopenal at compile time
In Linux distributions, having the executable depend on the right
libraries and arrange for them to be installed is straightforward,
and there's a lot of infrastructure for tracking which library
version a particular executable needs, including making sure we have
a version that contains all of the symbols that were used. Loading
libopenal at runtime defeats that infrastructure.

The ability to substitute a different-but-compatible libopenal,
or operate with reduced functionality without libopenal, might
still be desirable for generic/portable binary releases.

The CMake build system already linked the executable to
${OPENAL_LIBRARY} anyway, so it is already a hard dependency in that
build system.
2016-07-01 09:44:00 +01:00
Simon McVittie
c00707d449 Override __DATE__ from SOURCE_DATE_EPOCH if set
For deterministic/reproducible builds (where the same source and
toolchain can be verified to produce the same binary, allowing
maliciously substituted binaries to be detected) it is desirable to
take the software's idea of the build date from the build system;
otherwise, the real-time clock at the time of building affects the
result, making it non-reproducible.

SOURCE_DATE_EPOCH is a distribution-neutral specification for how
to do that. It is meant to be set by meta-build systems such as
dpkg or RPM, using a date/time that is already part of the source code,
for example the date of the latest git commit, the date in
the package's debian/changelog, or the date in the RPM spec file.

See https://reproducible-builds.org/specs/source-date-epoch/ for the
specification of SOURCE_DATE_EPOCH, or https://reproducible-builds.org/
for more information on reproducible builds in general.
2016-07-01 09:41:23 +01:00
Simon McVittie
92668ca6b1 Fix spelling errors detected by lintian
Based on a patch by Fabian Greffrath against an earlier version of
yquake2.
2016-07-01 09:38:54 +01:00
Yamagi Burmeister
6d38cc8609 Bump version number to 5.35pre 2016-06-25 11:03:48 +02:00
Yamagi Burmeister
bb8be981d5 Bump version number to 5.34 2016-06-25 10:22:18 +02:00
Yamagi Burmeister
5a384c79b1 Switch from an arch whitelist to an "all archs are supported" approach.
The old whitelist was a leftover from the early days of YQ2. It should
run on most / all architectures, as long SDL supports them. As suggested
by smcv in issue #138 generate the OSTYPE and ARCH defines by the build
system instead of hardcoding it.

Savegame compatibility is provided by bumping the savegame version. Old
savegames are compared against the old OSTYPE and ARCH defined, new ones
against the new defines. This compatibility code should be removed
somewhere in the distant future.
2016-06-11 09:23:10 +02:00
Daniel Gibson
da6ad6953d Use software gamma for OSX, fix #134
Hardware gamma is broken, especially in fullscreen, and a Mac user told me
that setting HW/screen gamma on OSX is a bad idea anyway, because it resets
the monitor calibration.
The game /should/ look ok with vid_gamma 1 (if your display is configured
properly), but if you think it's too dark set it a bit higher and do
vid_restart.
2016-05-28 16:04:07 +02:00
Yamagi Burmeister
6f64efbd17 Disable gl_ext_multitexturing by default.
Multitexturing was enabled by default in 0f7b422. It gives a small but
on todays hardware neglectable performance boost, but caused several
problems over the years. For example gl_showtris doesn't work with it
and there's at least one render glitch in city3.bsp.
2016-05-01 09:01:39 +02:00
Yamagi Burmeister
b4d16ab6b3 Some additions to last commit:
- SOLID_BBOX seems to be more correct.
- Make debris SOLID_BBOX, too.
2016-04-29 17:40:33 +02:00
Daniel Gibson
07477e0f75 Make gibs solid so they move with conveyor belts etc, like in fact2
not sure if this has any drawbacks, seems to work good so far.

No idea why id apparently deactivated this at some point, maybe to
optimize performance?
2016-04-16 21:04:32 +02:00
Yamagi Burmeister
eaee1d71d5 Rename cl_stereo* cvars to gl_stereo*.
They're renderer cvars, not client cvars.
2016-04-07 17:01:09 +02:00
Yamagi Burmeister
238ccb8adf Fix warnings with clang after the stereo merge 2016-04-07 16:57:32 +02:00
Valery Guskov
f6c596c1c5 better default configuration for 3d 2016-04-04 23:57:59 +03:00
Valery Guskov
9693004afb removed unused variable 2016-04-04 23:57:08 +03:00
Valery Guskov
248bebeca6 unncecessary newlines 2016-04-04 22:41:27 +03:00
Valery Guskov
d09c942b52 added pause changes from stereo-quake 2016-04-04 22:25:53 +03:00
Valery Guskov
45d3dd0a2f fixed loading display
i guess
2016-04-04 20:55:17 +03:00
Valery Guskov
135fb021e5 fixed viewports a bit 2016-04-04 19:33:18 +03:00
Valery Guskov
294a4dfbb9 cleaning up
removed non-minimal changes from porting stereo-quake
2016-04-04 00:25:20 +03:00
Valery Guskov
2e87216abf Revert "ported meatball crosshair"
This reverts commit 1e6f016fca.
2016-04-04 00:11:03 +03:00
Valery Guskov
bfa212f6ba correct models provide skin path 2016-04-03 19:26:16 +03:00
Valery Guskov
b3bea99597 added new code for 3d crosshair
original meat can be thrown out
2016-04-03 00:26:35 +03:00
Valery Guskov
1e6f016fca ported meatball crosshair
copied from http://www.quakewiki.net/archives/qdevels/quake2/12_1_98.html
2016-04-02 01:24:14 +03:00
Valery Guskov
b662cb9979 added split view basic support 2016-04-01 16:22:28 +03:00
Valery Guskov
0f8bda3c33 first attempt at porting separation support
ported from stereo-quake
http://www.benryves.com/products/stereoquake
2016-04-01 08:51:11 +03:00
Daniel Gibson
7f7ba1870b Bump version to 5.34pre 2016-01-30 20:03:33 +01:00