Commit graph

2515 commits

Author SHA1 Message Date
Denis Pauk
a6839bc584 soft: add fullcolor light apply 2022-03-29 22:29:28 +03:00
Denis Pauk
15553b9971 soft: use plightvec directly 2022-03-29 22:29:28 +03:00
Denis Pauk
36542e737c soft: make pointcolor local 2022-03-29 22:29:28 +03:00
Denis Pauk
12b27e631d fix C --pedantic warnings
* extra semicolon in struct or union specified
* ISO C does not allow extra ‘;’ outside of a function
2022-03-29 22:29:28 +03:00
Denis Pauk
65f8c171c5 soft: use named struct vert_t instead array 2022-03-29 22:29:28 +03:00
Denis Pauk
f8cac738dc soft: sw_light: make variables local 2022-03-29 22:29:28 +03:00
Denis Pauk
512e128c5a soft: save full rgb light in model 2022-03-29 22:29:28 +03:00
Denis Pauk
7c31fd9de2 soft: sync model light calculation 2022-03-29 22:29:28 +03:00
Daniel Gibson
5535773521 GL1: Fix setting gl1_particle_square, fixes #805
both if GL pointparameters are used or not
(though depending on driver and hardware the pointparameters-based
 particles *might* be always square or always round, regardless of
 gl1_particle_square - that's driver-bugs which we can't fix, disable
 pointparameters with `gl1_pointparameters 0` to work around it, or
 just use the GL3 renderer)
2022-03-29 20:30:00 +02:00
Daniel Gibson
f7386eb296 Fix bug in (no)lerp logic in GL1
refs #805
2022-03-26 23:40:05 +01:00
Daniel Gibson
cc0eabffed Implement gl3_colorlight, when set to 0, render lights without color
like the (original) software renderer. defaults to 1, of course
2022-03-26 19:48:11 +01:00
Daniel Gibson
6eb9ca0f65 Add r_lerp_list and r_videos_unfiltered CVars, fix #800
r_lerp_list is to allow exceptions to r_2D_unfiltered (like for having
pixely UI in general, but filtered console background).

r_videos_unfiltered controls whether videos should be filtered or not

I also made r_nolerp_list CVAR_ARCHIVE, like users probably expect it.
2022-03-20 12:16:15 +01:00
Yamagi
3a528e608d
Merge pull request #796 from devnexen/few_simpl
habdful of little simplifications.
2022-03-12 17:10:35 +01:00
Daniel Gibson
09ede9cf47 Make basename() fully compliant and simplify it a bit 2022-03-12 17:01:37 +01:00
Daniel Gibson
6c41a60c6d Make it work with VS2015 and newer
the workaround is a bit ugly but should work..
(I only tested VS2017, but I guess 2015 should also work)
2022-03-12 17:01:37 +01:00
Daniel Gibson
d0507ef04a Win32 Sys_Quit(): Don't use printf() after fclose(stdout)
causes an assertion in MSVC's CRT
2022-03-12 17:01:37 +01:00
Daniel Gibson
4a02c790e9 MSVC: Don't use YQ2_VLA() in loops
because on MSVC it uses alloca() (or _malloca()) which mustn't be called
in loops, as the memory is only freed when returning from the function,
not when leaving the scope (or before the next loop iteration).

Instead do one "dry-run" iteration to figure out how big the array must
be at most, and then allocate it once before the loop with that size.
2022-03-12 17:01:37 +01:00
Daniel Gibson
37b1b708c6 Fix some legitimate warnings from MSVC
MultiByteToWideChar() and other functions handlings WCHAR strings usually
expect length-like arguments in number of WCHARs, not in size in bytes
2022-03-12 17:01:37 +01:00
Daniel Gibson
ed918cf423 CMake: Make the game build with Visual Studio (2019 16.8 or newer)
The easiest way to build this is to check out the dhewm3-libs project
(https://github.com/dhewm/dhewm3-libs/) to provide the dependencies
(SDL2, OpenAL, cURL) and set YQUAKE2LIBS accordingly, by passing
-DYQUAKE2LIBS=c:/path/to/dhewm3-libs/i686-w64-mingw32 to cmake.

I wouldn't really recommend building with MSVC - I just somehow made it
work and ignored all the warnings and I have no idea how portable the
resulting binaries are etc. For binaries you actually want to use, please
continue using MinGW-w64. Especially my workaround for VLAs (C99 variable
length arrays) is kinda fishy, particularly if those arrays are allocated
in a loop (that's inly done in ref_gl1.dll's code).

The only reason I did this is that I had to debug on Windows and, at least
for my specific bug, gdb didn't really work with binaries produced by
MingGW-w64 and MSVC's debugger works well with binaries produced by MSVC.

Currently requires VS 2019 16.8 or newer with C11 (/std:c11) because I
couldn't get YQ2_ALIGNAS_TYPE() to work with MSVC without _Alignas().
If we can get this to work, VS2015 or newer might suffice (but not older
versions, because their so called C standardlib didn't provide exotic
functions like snprintf()).

# Conflicts:
#	CMakeLists.txt
2022-03-12 16:55:55 +01:00
David Carlier
12509f6242 habdful of little simplifications. 2022-02-27 09:03:06 +00:00
Yamagi
fca041c3ea
Merge pull request #792 from devnexen/cl_parse_overflow_fix
CL_ParseEntityBits overflow warning fix
2022-02-26 16:19:17 +01:00
David Carlier
ff3315d5d6 Haiku doc update, little code style fixes. 2022-02-26 08:35:10 +00:00
David Carlier
ca4e5ef935 CL_ParseEntityBits overflow warning fix 2022-02-21 08:39:08 +00:00
Yamagi
e7df0977b0
Merge pull request #789 from apartfromtime/dev
Confirm delete save game through status bar update
2022-02-13 09:44:01 +01:00
apartfromtime
a7b90aaa24 Amend white-space error 2022-02-13 09:30:48 +11:00
Yamagi
b92165a0e1 Fix two unused var warnings introduced by #788. 2022-02-12 17:01:12 +01:00
apartfromtime
298a411b87 Confirm delete save game through status bar update 2022-02-12 14:56:08 +11:00
Denis Pauk
138fce15ea gl1,gl3: sync model light calculation 2022-02-05 18:54:38 +02:00
Denis Pauk
b4fb6db4fc gl1,gl3: rename gl_lightmap->r_lightmap 2022-02-05 18:54:38 +02:00
Denis Pauk
f1ac7cafbf soft: add r_lightmap implementation 2022-02-05 18:54:38 +02:00
Denis Pauk
eb979d73ed soft: resuse image load code for wal 2022-02-05 18:54:38 +02:00
Denis Pauk
0c2bf1f65d soft: use pixel_t in skin and load lightmap 2022-02-05 18:54:38 +02:00
Yamagi
7004565c72 Reset the clip mask in ThrowHead() to MASK_SHOT.
xatrix uses MASK_SHOT and it sounds saner than 0.
2022-02-05 17:26:48 +01:00
Yamagi
a0cd32dddb Fix door_go_up(), G_UseTargets() exiting early if no activator is given.
The problem in door_go_up() may prevent doors from crushing something
blocking them. The problem in G_UseTargets() may prevent targets from
getting killed or fired.

Pointed out by @maraakate.
2022-02-05 17:02:24 +01:00
Yamagi
9d827b13da Force an empty clip mask for thrown heads.
The ThrowHead() and ThrowClientHead() functions are special. They
transform the entity given in `self` (mostly the caller itself) into a
ripped off head. They don't reset the entities clip mask, which may
cause problems in interactions with other entities. Fix that by reseting
the clip mask to `0`. `0` should be save, because that's the default and
and least SV_TestEntityPosition() handles `0` clip masks.

Suggested by @BjossiAlfreds.
2022-02-05 16:55:12 +01:00
Yamagi
acf92bdd08 Add back call to rotation_blocked() lost in 896bb48.
If `ent->dmg` is `0` it's set to `2`:

```
if (!ent->dmg)
{
	ent->dmg = 2;
}
```

This enforces func_rotate dealing at least `2` damage points per tick.
Vanilla Quake II had this code a few lines below:

```
if (ent->dmg)
{
	ent->blocked = rotating_blocked;
}
```

The if clause is always true. PVS studio complained about that. By
mistake the whole block was removed, essentially preveting func_rotate
from freeing itself when blocked. This broke at least the 'Emulsifying
Flesh Press' in the fact2.bsp.

Closes #786.
2022-02-05 16:26:37 +01:00
Yamagi
896bb48d36
Merge pull request #780 from devnexen/m_main_draw_fix
menu code unused var warning fix.
2022-01-22 10:54:27 +01:00
Yamagi
aa561bf50b
Merge pull request #778 from 0lvin/fixes
cppcheck fixes
2022-01-22 10:51:21 +01:00
Yamagi
76e114b06a Bump version number to 8.02pre. 2022-01-22 09:51:53 +01:00
Yamagi
32fc209084 Bump version number to 8.01. 2022-01-22 09:51:28 +01:00
Denis Pauk
a48c7e1850 gl3: Scale 3x for nolerp 8bit textures 2022-01-18 00:02:54 +02:00
Denis Pauk
dcdc37ea35 gl1: Scale 3x for nolerp 8bit textures 2022-01-18 00:02:26 +02:00
David CARLIER
62fba5a29d menu code unused var warning fix. 2022-01-15 15:57:11 +00:00
Denis Pauk
f49235d28a disable sound effect debug prints 2022-01-13 22:54:21 +02:00
Denis Pauk
da4bbd64d6 soft: add const to functions parameters 2022-01-12 22:11:18 +02:00
Denis Pauk
68ad03aac9 sound: fix local variable 'ogg_file' shadows outer variable 2022-01-12 21:55:56 +02:00
Yamagi
6bec90bbdd Use Windows compatible format specifiers. 2022-01-08 18:05:36 +01:00
David Carlier
80ce342557 client curl update.
displaying download progress based on a new cvar, 0 by default.
2021-12-16 14:55:58 +00:00
BjossiAlfreds
65b1cd167c Moved code hacks for waste3 to waste3.ent and addressed more issues with that map 2021-12-11 14:02:09 +00:00
apartfromtime
aa0ad74e06 Multiplayer\Co-op menu customize controls 2021-11-24 18:42:18 +01:00