Commit Graph

3206 Commits

Author SHA1 Message Date
Yamagi 8fa5ea3599
Merge pull request #807 from devnexen/config_settings_haiku
saving data into Haiku system user config.
2022-04-03 17:44:06 +02:00
Yamagi d827636c73
Merge pull request #804 from 0lvin/softcolorlight
WIP: Add color light to soft render
2022-04-03 17:43:38 +02:00
David Carlier 7ce0964b9b saving data into Haiku system user config. 2022-04-02 04:22:55 +00:00
Denis Pauk ccb22843bf soft: use float for medium light 2022-03-29 22:29:28 +03:00
Denis Pauk e650eff100 soft: preshift values in lightmap 2022-03-29 22:29:28 +03:00
Denis Pauk 020ce27109 soft: speedup colorlight=0
colorlight>0 is regressed little bit.
2022-03-29 22:29:28 +03:00
Denis Pauk a0da1717cc soft: use max light in blocklights (colorlight=0) 2022-03-29 22:29:28 +03:00
Denis Pauk 3b825670ba soft: fix lightmap mask 2022-03-29 22:29:28 +03:00
Denis Pauk c20c47b06f soft: skip light apply on wall's 2022-03-29 22:29:28 +03:00
Denis Pauk ff1814922e soft: use vid_lightthreshold for skip apply light 2022-03-29 22:29:28 +03:00
Denis Pauk c73eac63b3 soft: rename r_colorlight -> sw_colorlight 2022-03-29 22:29:28 +03:00
Denis Pauk b5d45d0371 soft: use lightmap convert table 2022-03-29 22:29:28 +03:00
Denis Pauk 6af5dc1d98 soft: more use of light3_t 2022-03-29 22:29:28 +03:00
Denis Pauk 5eed0ca5d9 soft: reuse R_Alias_clip_scale 2022-03-29 22:29:28 +03:00
Denis Pauk 5fcf0a3afc soft: resuse compact vert_t 2022-03-29 22:29:28 +03:00
Denis Pauk 3f33522977 soft: use separate light3_t 2022-03-29 22:29:28 +03:00
Denis Pauk 480f278045 soft: directly copy r_ambientlight 2022-03-29 22:29:28 +03:00
Denis Pauk 6c80d9b987 soft: add full color light 2022-03-29 22:29:28 +03:00
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 b5a0050e31 Document gl3_colorlight and gl_texturemode 2022-03-26 19:48:33 +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
Yamagi 187d19215c
Merge pull request #806 from devnexen/cmake_build_fix
cmake build fix common linker settings.
2022-03-26 16:22:14 +01:00
David Carlier 20171efc15 cmake build fix common linker settings. 2022-03-22 20:25:17 +00:00
Yamagi 282d1b8ea6
Merge pull request #803 from DanielGibson/more-lerp-control
Add r_lerp_list and r_videos_unfiltered CVars, fix #800
2022-03-20 18:25:33 +01:00
Yamagi 38a952cf4e
Merge pull request #799 from devnexen/cmake_systemdir
cmake adding SYSTEMDIR variable to complete SYSTEMWIDE_SUPPORT option.
2022-03-20 17:57:54 +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
David Carlier cd641cfb9a cmake adding SYSTEMDIR variable to complete SYSTEMWIDE_SUPPORT option. 2022-03-17 12:10:54 +00:00
Daniel Gibson 1230e2c11c
Update docs for building with Visual Studio 2022-03-12 18:11:53 +01:00
Yamagi 3a528e608d
Merge pull request #796 from devnexen/few_simpl
habdful of little simplifications.
2022-03-12 17:10:35 +01:00
Yamagi 9654ed5562
Merge pull request #795 from DanielGibson/MSVC-upd
Support building with Visual Studio (via CMake)
2022-03-12 17:07:55 +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 34a8c3833f Some CMake improvements
- make sure MSVC builds in parallel
- make sure game.dll ends up in the correct directory
- set yquake2 as VS debugger start project
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 16c97f6ece CMake: MSVC build is cleaner now (and shows less warnings)
- suppress some compiler warnings
- don't pass GCC/clang-specific flags to MSVC

(also made sure it still builds with MinGW)
2022-03-12 17:01:27 +01:00
Daniel Gibson 35232218e9 CMake: Correctly identify CPU architecture, hopefully
because, sadly, CMAKE_SYSTEM_PROCESSOR is almost useless and they don't
have a more useful alternative either :-/
2022-03-12 16:57:14 +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
Yamagi bbe639a7b0
Merge pull request #797 from devnexen/cmake_no_cxx
cmake limiting the scope of concern to C only and detecting
2022-03-12 16:39:22 +01:00
David Carlier ea1d491ff3 cmake limiting the scope of concern to C only and detecting
the compiler from to one particular frontend since it can
happen to have differents for C and C++.
2022-03-02 19:31:37 +00:00