Commit graph

1610 commits

Author SHA1 Message Date
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
e0b1f98f40 Make user overwriteable OSTYPE and ARCH somewhat more saner
In the Makefile we can use whatever variables we want. It's only
necessary that we don't leak them into the compiler context.
2016-10-31 10:22:17 +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
1a05d19d17 Use correct link :)
This fixes issue #149
2016-09-19 09:52:58 +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