Commit Graph

1801 Commits

Author SHA1 Message Date
Alibek Omarov 279cec5ae9 engine: rename cl/sv_allowdownload for GoldSrc compatibility 2023-10-27 07:25:09 +03:00
Alibek Omarov 6f6ddbce28 engine: add argument -timedemo that makes engine run timedemo and exit 2023-10-27 03:49:00 +03:00
Alibek Omarov 4cb425d2bb engine: console: do not draw console and do not draw notify in timedemo 2023-10-27 03:47:52 +03:00
Alibek Omarov 96a9172e36 engine: platform: sdl: check that we're handling SDL errors according to it's documentation 2023-10-26 23:06:50 +03:00
Alibek Omarov 9e107e900c engine: network: fix async NS resolve
If we're currently running NS resolving thread, any request would block.

Co-Authored-by: mittorn <mittorn@sibmail.com>
2023-10-24 18:11:31 +03:00
Alibek Omarov 8f819a2fde
engine: platform: sdl: fix forgotten icon setup call 2023-10-23 00:31:30 +03:00
Alibek Omarov 3ac8ad9484 engine: fixup endianness found by -Werror=strict-aliasing in old armv7hf compiler (d259421111) 2023-10-22 20:02:14 +03:00
Alibek Omarov b9ca0d4563 engine: common: network: more simple IP address copying from sockaddr to netadr_t and back 2023-10-22 20:02:14 +03:00
mittorn dcb3da53b0 engine/client: fallback to defaults in touch_reloadconfig if config not exist 2023-10-22 20:02:14 +03:00
mittorn e68b19ed1a engine/client: handle touch config aspect ratio, try correctly handle touch aspect on resizeable windows 2023-10-22 20:02:14 +03:00
mittorn 14c7a84482 engine/client: always save touch config if it was resetted manually (helps after writing broken/empty config) 2023-10-22 20:02:14 +03:00
mittorn bee81e9723 engine: Make SDL_GetBasePath error not fatal 2023-10-22 20:02:14 +03:00
mittorn 1bfb6c560a platform/sdl: add check for missing hint defines 2023-10-22 20:02:14 +03:00
mittorn 24d6f1788a platform/sdl: workaround ubuntu SDL2 bug preventing resolving any extensions on EGL 2023-10-22 20:02:14 +03:00
mittorn fb95cc9a97 engine/client: respect m_ignore in mouse client code as grabbing window breaks touch input 2023-10-22 20:02:14 +03:00
mittorn b949da291e engine: fix strict aliasing issues found by an old armv7hf compiler 2023-10-22 20:02:14 +03:00
Alibek Omarov 2ecbe5b67e engine: add testing master server at mentality.rip:27011 2023-10-22 19:39:58 +03:00
Alibek Omarov 7d61b5317c engine: client: add random key to the query, so we can validate master server response 2023-10-22 18:16:42 +03:00
Alibek Omarov 201258dc9e engine: client: allow passing additional filter through internetservers command arguments 2023-10-22 17:58:28 +03:00
Alibek Omarov 0330569537 engine: client: remove master server queries from NetAPI, they are never used by mods 2023-10-22 17:49:52 +03:00
Alibek Omarov 2d79f3ef7a engine: common: sys_con: enable writing build commit, os and arch to the engine.log 2023-10-22 17:37:09 +03:00
Ivan Avdeev a251600c8a
engine: common: imagelib: add KTX2 support (#1455)
* engine: common: imagelib: add KTX2 support

Adds basic KTX2 support for a few compressed formats. KTX2 essentially
is a Vulkan-centric texture format that supports literally hundreds of
pixel formats.
For now only support for these is added:
- `VK_FORMAT_BC4_UNORM_BLOCK`
- `VK_FORMAT_BC4_SNORM_BLOCK`
- `VK_FORMAT_BC5_UNORM_BLOCK`
- `VK_FORMAT_BC5_SNORM_BLOCK`
- `VK_FORMAT_BC6H_UFLOAT_BLOCK`
- `VK_FORMAT_BC6H_SFLOAT_BLOCK`
- `VK_FORMAT_BC7_UNORM_BLOCK`
- `VK_FORMAT_BC7_SRGB_BLOCK`

Adding more formats is relatively straightforward:
- Copy format definition from `VkFormat` enum in `vulkan_core.h`
- Add a new definition into `pixformat_t` enum.
- Add format size calculation into `Image_ComputeSize()`

While we're at it, also adds a few new formats to DDS:
- BC4_UNORM -- PF_BC4_UNSIGNED
- BC4_SNORM -- PF_BC4_SIGNED
- BC5_UNORM -- PF_BC5_UNSIGNED
- BC5_SNORM -- PF_BC5_SIGNED
- BC7 is expanded into BC7_UNORM and BC7_SRGB

ref_gl and ref_soft code is updated where it made sense. But not tested
really. Support for these formats has been tested with ref_vk.

* address spaces-vs-parentheses formatting where noticed

* parenthesize sizeofs

* move ktx2.h to imagelib as img_ktx2.h; massage it a bit

* use SetBits() instead of |=

* remove stale TODO comments
2023-10-18 10:31:40 +03:00
mittorn 6041bb0a43 platform/sdl: fix safegl 2023-10-16 06:47:55 +03:00
Alibek Omarov 5501ca927a engine: client: respect cl_allow_download and cl_download_ingame for legacy servers 2023-10-16 06:47:55 +03:00
Alibek Omarov 33be1b7591 engine: client: let time flow in Xash demos 2023-10-14 15:11:26 +03:00
Alibek Omarov 4acd0e5304 engine: platform: sdl: grab input only in true fullscreen mode 2023-10-11 16:49:49 +03:00
Alibek Omarov cb1063c305 engine: platform: sdl: fix qboolean to window_mode_t conversions 2023-10-10 14:41:39 +03:00
Alibek Omarov 59bfc8c32f engine: platform: sdl: fix qboolean to window_mode_t conversions 2023-10-10 14:41:05 +03:00
Alibek Omarov b58fbc0c94 engine: platform: linux: fix according to platform.h changes 2023-10-10 14:12:53 +03:00
Alibek Omarov 46f38c84b5 engine: platform: dos: fix according to platform.h changes 2023-10-10 14:12:42 +03:00
Alibek Omarov 99f290b622 engine: platform: sdl: support borderless mode, slight refactoring 2023-10-10 14:11:28 +03:00
Alibek Omarov 680ecfefab engine: platform: pass desired window mode through R_ChangeDisplaySettings 2023-10-10 14:11:06 +03:00
Alibek Omarov 7222c74000 engine: host: expose new -borderless flag in command line help 2023-10-10 14:09:05 +03:00
Alibek Omarov 1e43cb734b engine: client: add definitions for borderless fullscreen mode 2023-10-10 14:08:06 +03:00
Alibek Omarov cb19fa2f6d engine: client: restore window maximized state after engine restart 2023-10-09 05:26:17 +03:00
Alibek Omarov 73fcb84b62 engine: client: console: remove unneeded return from Con_DrawConsoleLen 2023-10-09 05:24:58 +03:00
Alibek Omarov 3584d3d1a6 engine: client: yet another BloodStream fix, normalize input velocity vector 2023-10-09 05:24:29 +03:00
Alibek Omarov e95139af94 engine: client: avoid unneeded comparisons in CL_UpdateFlashlight 2023-10-09 03:20:43 +03:00
Alibek Omarov 962f88d31b engine: client: use physents for flashlight tracing, as GoldSrc does 2023-10-08 01:52:42 +03:00
Alibek Omarov 34fa1b5ec8 engine: remove PORT_CLIENT, we should randomize client port by default, thus allowing easier connections from same IP address 2023-10-05 11:06:04 +03:00
Alibek Omarov bee35a1873 engine: client: do not check screenshots in base directory to guess the name 2023-09-13 18:49:10 +03:00
Alibek Omarov e4ae386964 engine: network: fix incorrect usage of qboolean, when it should be net_gai_state_t 2023-09-12 20:40:14 +03:00
Alibek Omarov 706ef65208 engine: client: make unprefixed important userinfo cvars filterable, so servers won't be able to change them, for security 2023-09-04 02:39:34 +03:00
Alibek Omarov 435b95fc5a engine: client: don't write download notify outside of window 2023-08-31 08:40:24 +03:00
Alibek Omarov aeece35291 engine: soundlib: mp3: fix check for Unicode in ID3v2.4 TXXX tag 2023-08-30 22:57:39 +03:00
Emil Tomczyk abd7f3dca3
engine: crashhandler: changed register names for NetBSD x86 (#1414)
Probably also needs change for x86_64
2023-08-30 18:53:41 +03:00
Alibek Omarov 1c9f333420
engine: server: fix attempting to free pool instead of an allocated memory 2023-08-30 18:52:44 +03:00
Alibek Omarov 75e5da071c engine: platform: win32: fix calculating RVAs for LLP64 2023-08-29 19:18:22 +03:00
Alibek Omarov 52bd923d9d engine: server: use generic host pool for temporary string allocation in case of PhysicAPI 2023-08-29 19:10:33 +03:00
Alibek Omarov ab5a9eec53 engine: soundlib: snd_mp3: fix extra-format-args 2023-08-21 10:02:43 +03:00
Alibek Omarov 88916fdac4 engine: ref_api: remove dead XASH_TEXTURE4 definition 2023-08-21 10:02:18 +03:00
Alibek Omarov 4ed562697b engine: soundlib: fix sizeof parameter in previous commit, I'm an idiot 2023-08-18 11:50:58 +03:00
Alibek Omarov 64166c7d82 engine: soundlib: fix slashes in Sound_GetApproxWavePlayLen, as it can be called from game DLL 2023-08-18 11:47:01 +03:00
Alibek Omarov 0df89bddeb engine: common: ipv6text: accept changes from upstream GameNetworkingSockets 2023-08-08 19:38:57 +03:00
Alibek Omarov 3168e5ccf0 wscript: add an option to request and accept any servers 2023-08-08 09:24:10 +03:00
Alibek Omarov 72fe214f49 engine: server: pre-process string before passing it to PhysicAPI AllocString, for compatibility with existing Xash3D games 2023-08-07 21:11:20 +03:00
Alibek Omarov 08a2d431da engine: client: cl_qparse: refactor quake baseline parser, so we don't call memset for nothing 2023-08-07 19:11:47 +03:00
Alibek Omarov 9968b192c3 engine: server: fix buffer overflow in invalid Q_strncpy call 2023-08-06 00:39:41 +03:00
Alibek Omarov 79f2c69963 engine: soundlib: missing newline in warning message about truncated WAV file 2023-08-05 04:05:23 +03:00
Alibek Omarov 2067667c9c engine: fix inverted check in DLL unloading in settings.scr parsing
Fixes: aee99f6094
2023-08-03 02:40:02 +03:00
Alibek Omarov e017b9145f engine: common: cvar: fix buffer overflow in Cvar_ValidateString 2023-08-03 01:12:16 +03:00
Alibek Omarov c1c27c5f18 engine: net_ws: fix printing multicast IPv6 address 2023-08-03 01:11:54 +03:00
Alibek Omarov 87a56a5fa1 engine: client: initialize netadr_t structure in LAN games scan 2023-08-03 01:11:31 +03:00
Alibek Omarov aee99f6094 engine: don't release DLL that wasn't loaded during settings.scr parsing. This should be deleted as soon as possible! 2023-08-03 01:11:06 +03:00
Alibek Omarov bf03f739bb engine: soundlib: snd_wav: take FindNextChunk fixes from FTEQW 2023-08-03 01:05:46 +03:00
Alibek Omarov e23580c1de engine: remove czeror sequence parser
This file initially came from HLND, a Chinese GoldSrc recreation.
It turned out to be suspiciously close to the original version, down
to the comments and code style. We don't work with leaked sources here,
so remove it.

A proper parser should be reimplemented from ground-up, when we will
start working on CZDS support.
2023-07-26 19:40:03 +03:00
Alibek Omarov a07f81820c engine: client: ref_common: fix missing newline in Host_Error 2023-07-22 05:51:18 +03:00
Alibek Omarov b39378a6da engine: common: fix warning about read-only cvar. In fact, we should force set them. 2023-07-22 05:50:38 +03:00
Alibek Omarov 6461fa5042 engine: client: make ref params static so client.dll can save address of it and don't trigger ASan 2023-07-17 05:52:45 +03:00
Alibek Omarov 36ff819daf engine: client: fix heap-buffer-overflow in remap when we switch model that have more remap textures than previous 2023-07-17 04:48:02 +03:00
Alibek Omarov 7e05562c14 engine: platform: sdl: check SDL version in Platform_Vibrate 2023-07-03 02:18:49 +03:00
Alibek Omarov d5f4b409e8 engine: server: sv_save: use new quicksave_aged_count and autosave_aged_count gameinfo.txt keys 2023-07-02 04:53:39 +03:00
Alibek Omarov a862446072 engine: client: restore cl_trace_events from old engine branch 2023-07-02 04:48:43 +03:00
Alibek Omarov 8d04ae8802 engine: client: fix appending extra .dem in record command 2023-07-02 02:44:25 +03:00
Alibek Omarov 0de0615eeb engine: client: implement map CRC32 checking on client side 2023-07-02 01:20:24 +03:00
Alibek Omarov ea24b5f3ca engine: server: make CRC32_MapFile public 2023-07-02 01:19:38 +03:00
Alibek Omarov eb7f19d3cf engine: server: properly remove remaining server operator commands 2023-07-02 01:19:21 +03:00
Alibek Omarov ca134a85ee engine: client: make it more obvious that CL_InitEdicts depends on maxclients value 2023-06-30 02:51:47 +03:00
Alibek Omarov 00765f1ff2 engine: client: cl_parse_48: add a temporary hack to avoid the lag issues after changelevel on legacy servers 2023-06-30 02:35:36 +03:00
Alibek Omarov 013bfe5c34 engine: common: sys_con: always read from stdin when engine is in dedicated mode 2023-06-30 01:44:03 +03:00
Alibek Omarov 5f625bb6e1 wscript: remove option --enable-stdin-input, it's enabled by default in dedicated mode sys_con now 2023-06-30 01:43:26 +03:00
Alibek Omarov 547a862024 engine: client: split protocol 48 support to separate file 2023-06-29 04:09:36 +03:00
Alibek Omarov 6ea8d141d9 engine: common: net_encode: fix usage of new Delta_ClampIntegerField, minor fixes 2023-06-28 14:30:06 +03:00
Alibek Omarov bdc2390d41 Revert "engine: common: net_encode: rewrite Delta_CompareField to be more efficient"
This reverts commit 82addf11bb.
2023-06-28 14:26:42 +03:00
Alibek Omarov acc113309c Revert "engine: common: net_encode: fix Delta_CompareField to include integer clamping, in case if no updates happen in significant bits"
This reverts commit 6a7b330463.
2023-06-28 14:26:40 +03:00
Alibek Omarov 5afda72290 engine: common: net_encode: simplify Delta_ClampIntegerField 2023-06-28 05:07:53 +03:00
Alibek Omarov 6a7b330463 engine: common: net_encode: fix Delta_CompareField to include integer clamping, in case if no updates happen in significant bits 2023-06-28 04:47:12 +03:00
Alibek Omarov f5b9826fd9 engine: common: net_encode: directly access delta description struct than searching for it every time 2023-06-27 19:56:32 +03:00
Alibek Omarov 82addf11bb engine: common: net_encode: rewrite Delta_CompareField to be more efficient 2023-06-27 18:06:24 +03:00
Alibek Omarov 40e248aa63 engine: common: remove unused tentlist_t definition 2023-06-27 17:30:09 +03:00
Alibek Omarov 7e06d049f5 engine: common: static-ize common.c functions, set GAME_EXPORT to API functions 2023-06-20 14:19:44 +03:00
Alibek Omarov 4bbd1e59a4 engine: server: static-ize world functions 2023-06-19 07:47:38 +03:00
Alibek Omarov 0809453b2c engine: server: static-ize sv_query functions 2023-06-19 07:39:00 +03:00
Alibek Omarov 8350d81c18 engine: server: static-ize sv_pmove functions 2023-06-19 07:38:18 +03:00
Alibek Omarov 57499dea33 engine: server: static-ize sv_phys functions, set GAME_EXPORT attribute for PhysicAPI functions 2023-06-19 07:32:22 +03:00
Alibek Omarov 6b223f1325 engine: server: static-ize functions in sv_game. Set GAME_EXPORT attribute to server GameAPI functions 2023-06-19 07:11:49 +03:00
Alibek Omarov 03a85e0caa engine: platform: psvita: add unused data to workaround bug in vita-elf-create (thanks @fgsfdsfgs) 2023-06-18 22:49:44 +03:00
Alibek Omarov 01ad3dda2a engine: server: escape rcon arguments before passing it to command buffer, also use more efficient concatenation 2023-06-18 04:44:28 +03:00
Alibek Omarov 2a05624615 engine: server: keep silence in case of unset or invalid rcon password 2023-06-18 04:30:21 +03:00
Alibek Omarov 16c87ae2c9 engine: platform: reorganize UpdateStatusLine, make it shared but implemented only if platform has SetStatus. Implement SetStatus for systemd/Linux 2023-06-16 08:43:16 +03:00
Alibek Omarov c16a10e6f3 engine: platform: refactor Platform_Init/Shutdown/GetNativeObject functions. They are now defined in the header, and call platform-specific functios that defined in platform code 2023-06-16 07:32:19 +03:00
Alibek Omarov c7d748e8df engine: server: add sv_log_outofband cvar that controls whether connectionless packets should be printed or not 2023-06-16 07:19:17 +03:00
Alibek Omarov c966589a50 engine: server: static-ize few game API functions, set GAME_EXPORT attribute 2023-06-15 19:22:13 +03:00
Alibek Omarov 4c02c25506 engine: server: do not assert if SetFatPVS/PAS were called without active player
Fixes issues with POD-Bot based bots.
2023-06-15 19:17:34 +03:00
Alibek Omarov a4997d0647 engine: server: port old engine's fullupdate ratelimit, but simplify it 2023-06-15 18:09:59 +03:00
Alibek Omarov 243c3cc80f engine: server: port old engine's userinfo penalty 2023-06-15 04:46:22 +03:00
Alibek Omarov 9c62fa901f engine: server: pregenerate CRC table and testpacket data 2023-06-14 00:35:07 +03:00
jeefo 61c75b9809 engine: server: log: use S_USAGE in logaddress for consistency with existing code 2023-06-11 16:28:36 +03:00
jeefo 868d10a842 engine: server: log: allow to disable logaddress without turning off logs completely 2023-06-11 16:28:36 +03:00
jeefo 699f3579fe engine: server: log: fix log off command not disabling logging to console (fixes #1340) 2023-06-11 16:28:36 +03:00
jeefo 873ce0ce48 engine: server: query: A2S_PLAYER response should contain bots and normal players 2023-06-11 14:14:59 +03:00
Alibek Omarov 450f77443d engine: client: ignore some out of band packets if we're not connecting to server 2023-06-11 07:06:01 +03:00
Alibek Omarov 278ff22ba9 engine: server: query: use common SV_GetPlayerCount, fix random styling issues 2023-06-10 02:47:52 +03:00
jeefo d9ef1d4608 server: implement correct answers to TSourceEngineQuery server queries
* count bots as clients as in goldsrc
* handle source-style packets after xash's built-in packets to not interfere with them
2023-06-10 02:06:45 +03:00
Alibek Omarov b84aba68fa engine: platform: implement generic GetNativeObject for POSIX systems without SDL2 2023-06-07 04:07:53 +03:00
Alibek Omarov 23f1c43282 engine: common: net_buffer: use uint32_t in place of dword 2023-06-06 00:28:23 +03:00
Alibek Omarov a7c76ac0bf engine: common: net_buffer: use stdint.h types in sizebuf_t reading/writing funcs 2023-06-06 00:26:54 +03:00
Alibek Omarov 26959cd280 engine: common: net_encode: use stdint.h types in Delta_CompareField 2023-06-06 00:20:56 +03:00
Alibek Omarov 1fdf6180e6 engine: platform: sdl: merge required SDL2 platform changes for new Android port from @Velaron's tree 2023-06-05 21:51:59 +03:00
Alibek Omarov d2237fa144 engine: platform: android: merge new SDL2 based Android port from @Velaron's tree 2023-06-05 21:35:58 +03:00
Alibek Omarov ef663a8790 engine: partially remove legacy Android port, in preparation of new port merge 2023-06-05 20:30:18 +03:00
Alibek Omarov ba039b8e71 engine: drop XASH_DYNAMIC_DLADDR 2023-06-05 20:30:18 +03:00
Alibek Omarov 02ce80981c filesystem: update optional funcs interface, add platform-specific GetNativeObject call 2023-06-05 20:30:18 +03:00
Alibek Omarov a23e17c6d7 engine: platform: sdl: set QtWayland hints 2023-06-02 06:18:47 +03:00
Alibek Omarov 8caa2d142f scripts: sailfish: initial SailfishOS support 2023-06-02 05:37:13 +03:00
Alibek Omarov f49a2bc8f3 engine: server: move pfnWriteString character replacement hack to the ALLOC_STRING, the same way as GoldSrc does 2023-05-29 14:40:54 +03:00
Alibek Omarov 7fd1534753 engine: common: cvar: remove unused CVAR_TO_BOOL macro 2023-05-27 21:52:58 +03:00
Alibek Omarov bd52a9ec2d engine: platform: linux: move evdev_keydebug cvar to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 9e0d389d9e engine: server: moved server cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 70b26a13c2 engine: allow ref dlls to use convar_t 2023-05-27 21:52:58 +03:00
Alibek Omarov 6a1f96a2c6 engine: always unlink variables and commands BEFORE all pointers to them would be lost 2023-05-27 21:52:58 +03:00
Alibek Omarov 4ce2475602 engine: common: move network cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov e7ece41ba0 engine: common: move model cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 05579927a5 engine: client: sound: move dsp cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 2f5b359c99 engine: client: move tracer cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 214fc7e827 engine: common: move host cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov df173a83ed engine: client: move touch cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 3918bcd71c engine: client: move console cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov f19ed1c1c2 engine: client: move joystick cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 03ec2f603b engine: client: move netgraph cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 1ee01163b7 engine: client: move scrn cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov b1d60c248d engine: client: move main client cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov d9cbf1fa89 engine: client: move input cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov cd022bdac7 engine: client: move keys cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 5d7d5319fd engine: move ref cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov d4470402ee engine: move vid cvars to static allocation 2023-05-27 21:52:58 +03:00
Alibek Omarov 05560c7607 engine: always read and set vid_fullscreen value directly with it's object 2023-05-27 21:52:58 +03:00
Alibek Omarov 5627dbbf34 engine: server: greatly simplify pfnWriteString implementation, it shouldn't modify input string 2023-05-27 20:02:09 +03:00
Alibek Omarov f13c285287 filesystem: verbose error printing in FS_SetCurrentDirectory, move error reporting from engine 2023-05-26 22:29:34 +03:00
Alibek Omarov cb43df43ef engine: common: cvar: do not check if cvar was registered in DirectSet when it has valid next pointer 2023-05-24 03:51:16 +03:00