Commit graph

358 commits

Author SHA1 Message Date
Denis Pauk
7372623056 cleanup function definitions 2024-01-01 17:36:53 +02:00
Denis Pauk
6b70251341 Merge remote-tracking branch 'yquake2/master' 2023-12-16 23:14:52 +02:00
apartfromtime
f0d2c5afaa More min\max function renaming
Missed function renaming.
2023-12-04 22:59:31 +11:00
Denis Pauk
63d3e5ac74 Merge remote-tracking branch 'yquake2/master' 2023-11-04 19:45:48 +02:00
Denis Pauk
07b3d0f9a7 Partial fix of windows build 2023-10-31 19:03:47 +02:00
Denis Pauk
64215c04f6 Fix endline in files, without code changes
Run: sed -i 's/[[:blank:]]*$//' */*.{c,h}
2023-10-29 01:58:20 +03:00
David Carlier
478d16e786 NET_Socket unix using getaddrinfo's error code in case. 2023-10-28 15:34:50 +01:00
Denis Pauk
3e1a3c6328 Revert back all limits
Code has issues with calculation of hunk size and mguhub load.
2023-10-10 00:43:19 +03:00
Denis Pauk
2274e86481 Make all names in render interface const 2023-09-21 23:40:45 +03:00
David CARLIER
437c16c0d1 "constifying" where underlying C calls expect compile time constants. 2023-09-16 18:16:52 +02:00
David CARLIER
3b8053edae "constifying" where underlying C calls expect compile time constants. 2023-09-16 16:20:21 +01:00
Jaime Moreira
9821c4b0a2 Show correct replacement for gl_lightmap cvar
Typos corrected
2023-08-26 19:18:24 -04:00
David Carlier
efc59a3e3d unix NET_Socket fix socket leak at address assignment failure. 2023-07-29 06:55:22 +01:00
Yamagi
f6361740f5 Fix another spurious warning.
gcc 13.1 thinks that `newsocket` can be used uninitialized, because it
doesn't know that a call to `Com_Error()` is fatal.
2023-07-01 17:52:36 +02:00
David CARLIER
c216eece9e network close descriptors on socket creation failure. 2023-05-21 15:24:28 +01:00
Yamagi
a241fd50e4
Merge pull request #999 from devnexen/gcc13_build_fixes
addressing few gcc 13 analyser warnings.
2023-05-08 21:16:55 +02:00
David Carlier
571f3f6fec addressing few gcc 13 analyser warnings. 2023-05-08 18:07:27 +01:00
Yamagi
22617d8812 Replace two more wcscat_s() overlooked in last commit. 2023-04-22 17:29:22 +02:00
Yamagi
df845e0f67 Avoid the use of wcscat_s() since it's unavailable under Win XP.
Code around it by using `wcsncpy()` and `wcscat()` combined with a
manual length check. This should be enough to make YQ2 working on Win
XP again.  Please note, that we don't support any Windows older than
10. However we still try to avoid breaking them.

Based on an idea by @ carlo-bramini, closes #994.
2023-04-22 16:44:26 +02:00
Yamagi
8b12b017f7 Handle SIGBUS. Or at least try it.
I was reported a strange problem were GL3 is crashing with SIGBUS while
enumerating the GL extensions. To me it looks like a problem in Nvidias
FreeBSD driver, which for some reason doesn't reproduce on my machine.
However it' hard to tell what exactly happens without a full backtrace
and the user is unable to provide one... For the future try to handle
SIGBUS to catch those problems.
2022-11-14 21:37:47 +01:00
Denis Pauk
c890e59aaa Reset to default font settings instead white on black 2022-10-23 22:44:30 +03:00
Denis Pauk
66d0751caf Linux: Add color output for console
Usecase: show map name on level load.

Add colorterminal cvar for disable.

xfce4-terminal has:
 * TERM=xterm-256color
 * COLORTERM=truecolor
2022-10-23 22:44:30 +03:00
Yamagi
72ec12f8df Fix two 'comparison will always be false' warnings:
* Check the return value for `_wfullpath()`, not the returned pointer.
* Check first byte of char array, not the array itself.
2022-10-09 11:21:21 +02:00
Daniel Gibson
86811a4c24 Fix fallback when window couldn't be created because renderer is unsupported
For example, on Windows with AMDs drivers, GLES3 isn't supported,
so CreateSDLWindow() will fail. We should just try the regular GL3
renderer then instead of exiting with Com_Error()

Also make (Windows') Sys_Error() print to stdout (in addition to stderr),
so errors end up in stdout.txt as well (like all other messages).
2022-06-11 17:57:29 +02:00
David Carlier
7ce0964b9b saving data into Haiku system user config. 2022-04-02 04:22:55 +00: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
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
Simon McVittie
d17c00dbd2 backends: Only enable ARM "RunFast" mode when targeting hardware FPU
Older ARM ABIs like Debian armel (ARMv5 EABI softfloat) don't use
or require a hardware FPU, so they can't execute the fmrx and fmxr
instructions. Only do this in hardfloat configurations that guarantee
VFP instructions are available.

The client might not be practically usable on ARM softfloat (although
nobody has reported that it isn't...) but the dedicated server is probably
fine, and ceasing to be able to build either would be a regression.

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-10-05 14:05:15 +01:00
Yamagi
fb080fc32c Add missing semicolon, Windows build fix 1/2. 2021-06-29 08:58:40 +02:00
Yamagi
61c08eee13 Fix ASAN and UBSAN builds, enhance sanitizers a little bit.
At least for LLVM / Clang the -fsanitize= option must be passed to the
linker before any objects or libraries, otherwise the sanitizers will
either noch link or are disfunctional. Split LDFLAGS into LDFLAGS for
flags and LDLIBS for librariers, pass LDFLAGS before any objects and
LDLIBS after all objects. While at it set RTLD_NODELETE so that shared
libs opened by dlopen() are never deleted from memory when building
with sanitizers.
2021-06-26 16:28:08 +02:00
Yamagi
c9f7faa7b1 Add logic to mark search path entries as required or optional.
Until 7.45 we supported adding non existent dirs to the search path,
8.00 bails out if it cannot at a dir. It turned out that some users
install the binary through their package management (SYSTEMWIDE is set),
but use local game data. This case was broken, because the SYSTEMDIR
doesn't exist. Fix this by marking the SYSTEMDIR as optional.

Closes #724.
2021-06-20 18:24:22 +02:00
David Carlier
53c684525f solairs/illumos build fix proposal. 2021-06-13 08:25:56 +01:00
Yamagi
33148a3085 Revert "unix network little change proposal. socket port fits within unsigned 16 bits type."
This reverts commit df3b2307f2.
2021-04-10 17:40:03 +02:00
Yamagi
1bae4e679f
Merge pull request #695 from devnexen/arm_runfast_mode
Little optimisation attempt targeted only for ARM 32 bits,
2021-04-07 09:32:18 +02:00
David Carlier
159f5e3ae4 Little optimisation attempt targeted only for ARM 32 bits,
enabling "RunFast" mode ; benefits might depend on the board
 at hand.
2021-04-04 13:15:42 +01:00
David Carlier
df3b2307f2 unix network little change proposal. socket port fits within unsigned 16 bits type. 2021-04-01 19:39:23 +01:00
Vasily Postnicov
8ba25e82c9 Fix segmentation fault on FreeBSD.
Specify correct protection flags when calling mmap() on FreeBSD.
prot | PROT_MAX (prot) are the correct flags because just PROT_MAX
(prot) leaves current protection flags set to PROT_NONE which causes
segmentation fault when reading or writing to the mapped region.
2021-02-17 22:16:58 +03:00
Yamagi
69ba055c2c Minimal error checking for Sys_Mkdir() on windows. 2020-12-31 09:09:09 +01:00
Yamagi
60d881437b Minimal error handling for Sys_Mkdir() under unixlike platforms. 2020-12-31 08:55:09 +01:00
Yamagi
8e223b2743 Make sure that the config dir exists.
Since 1a913eb we're calling realpath() on every dir and bail out if the
real path isn't available. If the game is started the first time, the
configuration dir doesn't exist at the first realpath() call and the
game errors out. Always create the configuration dir when determining
it's path.

This didn't happen on Windows because the configuration dir was created
when opening stdout.txt right after we entered main().

TODO: Sys_Mkdir() should grow at leas a little bit error handling. We're
silently ending up in -portable mode if the configuration dir couldn't
created.
2020-12-30 18:45:16 +01:00
Simon McVittie
45b922372a signalhandler: Fix a typo
Detected by Lintian, a QA tool used in Debian.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-10-31 11:59:22 +00:00
Yamagi
93008da0eb Make sure that the config dir exists before reopening stdout.
Without this to stdout.txt and stderr.txt are created at the first
start.
2020-10-20 09:38:26 +02:00
Yamagi
21d7c85044 Mark path passed to Sys_Mkdir as const. 2020-10-20 09:35:07 +02:00
Yamagi
1a913eb7d1 Resolve pathes before adding them to the search path.
Working with canonical fullpathes everywhere makes debugging easier.
And it will be used in a later commit to make sure, that each path is
added only once.
2020-10-20 08:20:20 +02:00
David Carlier
915c680f52 DragonFlyBSD build fix. 2020-10-10 14:29:28 +01:00
Yamagi
d5dcf3a772 Fix several inconsistencies and typos in console output. 2020-10-08 12:38:29 +02:00
Yamagi
dfaf33e478 Force stdout and standerr on Windows to unbuffered mode.
Normally stdout and stderr are buffered. In case of a crash the last
lines aren't written to the stdout.txt, making post mortem debugging
difficult. Forcing both FDs to unbuffered mode ensures that everything
gets written. The performance impact is negliable.
2020-10-06 17:22:50 +02:00
Yamagi
741ffcdb1c
Merge pull request #604 from devnexen/last_bit_for_haiku
Last bit for proper Haiku support.
2020-10-06 16:55:41 +02:00
David Carlier
800cdf9617 Last bit for proper Haiku support.
Even tough it is a multi user os, due to BeOs heritage and being backwards
compatible with, the desktop runs as root, thus its dog get eaten after all...
2020-10-02 14:36:57 +00:00
David Carlier
6bb23c908f Little simplification for NetBSD, sysctl works just fine too. 2020-09-30 22:56:19 +01:00