Compare commits

..

1542 Commits

Author SHA1 Message Date
Alibek Omarov
70a3ff531c ref_gl: fix texturelist output 2021-11-24 01:41:25 +03:00
Alibek Omarov
501ff944b9 ref_gl: add VERY basic 16-bit texture support(no mips, no rescale, no filters), as an example to ref_vk dev 2021-11-23 04:12:30 +03:00
Alibek Omarov
f16641b606 engine: imagelib: add 16-bit PNG load support 2021-11-23 04:03:07 +03:00
Alibek Omarov
f045103abb engine: imagelib: add common definitions for 16-bit images 2021-11-23 03:58:47 +03:00
Bohdan Shulyar
8ab97fbbf0 engine: client: Add svc_exec support (#671)
* Add svc_exec support

* engine: client: add gamedir check for svc_exec
2021-11-14 00:55:15 +03:00
Alibek Omarov
a5a66f6c3e ref_gl: update gl4es 2021-11-10 01:08:12 +03:00
Alibek Omarov
1c6604806c mainui: update 2021-11-10 01:08:00 +03:00
Alibek Omarov
39893609fd engine: touch: cosmetical touch code refactoring 2021-11-10 01:06:56 +03:00
Alibek Omarov
b9901bcb70 engine: client: forgot to register s_warn_late_precache cvar 2021-11-01 14:49:30 +06:00
Alibek Omarov
6571c78ed4 engine: client: hide late precache warning under s_warn_late_precache cvar
This warn is valid mostly for multiplayer games.
In singleplayer games, this is a false-positive as sentences are hot loaded
2021-10-31 21:06:54 +06:00
Alibek Omarov
d1e6063650 ref_gl: add close_gl4es, fix #258 2021-10-31 20:59:20 +06:00
Alibek Omarov
42db1faa51 ref: update ref_gl and ref_soft interface according to previous commit 2021-10-30 21:49:52 +06:00
Alibek Omarov
efc156fcf5 engine: ref_api: purposefully moved WorldToScreen to 2D functions from TriAPI, since WorldToScreen is expected to be simpler in-engine version rather than TriAPI one 2021-10-30 21:49:27 +06:00
Alibek Omarov
207675990e public: build: fix missing define value 2021-10-28 20:11:31 +03:00
Alibek Omarov
e8cd6e9d65 engine: build: add RISC-V support(based on @archanox patches), add MIPS64 support 2021-10-27 20:59:02 +03:00
Alibek Omarov
ab256e294e public: build: add RISC-V support(based on @archanox patches), add forcing endianness from build system 2021-10-27 20:33:21 +03:00
Alibek Omarov
d9fd6aa05c engine: server: restore log functionality from old engine. Thanks to @ValeTheVioletMote for initial patch. 2021-10-27 19:40:05 +03:00
Vale the Violet Mote
57382c7cea readme: Linux Build Extended Clarity (#659) 2021-10-26 17:48:04 +03:00
Владислав Сухов
1042291ad6 client: Don't change loading bar color
Don't change loading bar color (fix yellow loading bar in Half-Rats Parasomnia, it should be white)
2021-10-25 00:48:36 +06:00
Владислав Сухов
c9e4912a2a client: backport con_fontnum from old engine 2021-10-12 13:43:23 +03:00
Alibek Omarov
e5e1570aed public: redeclare ParseFile flags to be exactly same as in exported API headers 2021-10-08 17:31:32 +03:00
Alibek Omarov
621399c49b engine: add safe ParseFile to client MobilityAPI 2021-10-08 17:31:32 +03:00
Alibek Omarov
c3684109bf mainui: update 2021-10-08 17:31:32 +03:00
Alibek Omarov
f3fedbfdba engine: add safe ParseFile to menu extended API 2021-10-08 17:31:32 +03:00
Alibek Omarov
29a8bfb1dc engine: common: fix ParseFile calls 2021-10-08 17:31:32 +03:00
Alibek Omarov
004e190435 engine: common: test ParseFile length return value 2021-10-08 17:31:32 +03:00
Alibek Omarov
378c4f30f3 public: ParseFile drops const qualifier, return -1 length on overflow
As we usually put allocated data to ParseFile, we don't need const qualifier
2021-10-08 17:31:32 +03:00
Alibek Omarov
a8c877c841 engine: server: fix ParseFile calls 2021-10-08 17:31:32 +03:00
Alibek Omarov
8ce448cc77 ref_gl: fix ParseFile calls 2021-10-08 17:31:32 +03:00
Alibek Omarov
4ba95277b9 engine: client: fix ParseFile calls 2021-10-08 17:31:32 +03:00
Alibek Omarov
cce7c7d782 public: declare unsafe ParseFile as ParseFileLegacy 2021-10-08 17:31:32 +03:00
Alibek Omarov
9e5d5e0ea3 public: moved COM_ParseFileSafe to libpublic, added optional argument for length and overflow checking 2021-10-08 17:31:32 +03:00
Alibek Omarov
a235bec5f1 engine: introduce COM_ParseFileSafe, add tests 2021-10-08 17:31:32 +03:00
Alibek Omarov
a3a8acfe6c engine: sound: add DSP coeffecients table from Half-Life Alpha, minor fixes to DSP code 2021-10-04 05:43:35 +03:00
Alibek Omarov
9e4e9cab04 engine: restore optional upscaling depending on SOUND_DMA_SPEED value :) 2021-10-04 05:43:35 +03:00
SNMetamorph
e4ad8def0d engine: filesystem: fixed current directory changing for Windows 2021-10-03 12:28:59 +03:00
SNMetamorph
ec95948b69 engine: server: implemented instant game library loading 2021-10-03 04:38:05 +03:00
Alibek Omarov
ef6ff3cfa6 mainui: update 2021-10-03 04:26:56 +03:00
Alibek Omarov
7bcfce5a7a ref_gl: use GCC provided offsetof implementation 2021-10-03 04:26:40 +03:00
Alibek Omarov
08c04200fb engine: use GCC provided offsetof implementation 2021-10-03 04:26:22 +03:00
Alibek Omarov
8bbd0d5119 ci: let's have a copy of original uploadtool instead of unsafe curl | sh 2021-10-03 03:53:06 +03:00
Alibek Omarov
ade0fd4afa ci: stop generating vc2008 project files
If somebody needs them, they can revert this comment and send a PR
Or better use official msvs.py tool
2021-10-02 04:05:52 +03:00
Alibek Omarov
ed7ed818bb Add .gitattributes to enforce Git write normal human file endings and show pretty diffs for C and Python 2021-10-02 03:47:32 +03:00
Alibek Omarov
91f845c335 engine: client: fix paused icon drawn when levelshots are disabled 2021-09-30 16:43:21 +03:00
Alibek Omarov
81ef12be9e Revert "ci: adding pvs-studio checking"
This reverts commit bd4979f5b0.
2021-09-30 16:38:32 +03:00
Alibek Omarov
2aafe9df9f Revert "ci: try to create license file by ourselves"
This reverts commit dd90262db2.
2021-09-30 16:38:29 +03:00
Alibek Omarov
3b933eabf5 engine: make test assert failure more pretty 2021-09-30 15:59:14 +03:00
Alibek Omarov
f5ccf093d6 scripts: waifulib: fix build with sanitizers on 2021-09-30 15:58:50 +03:00
Alibek Omarov
fe0da74e75 engine: fix build with tests on 2021-09-30 15:58:32 +03:00
Alibek Omarov
2939ab8ea4 wscript: allow compiling with disabled warning-as-error 2021-09-06 00:04:27 +03:00
Alibek Omarov
dd90262db2 ci: try to create license file by ourselves 2021-08-27 18:48:48 +03:00
Alibek Omarov
4f8e4b5f64 mainui: update 2021-08-27 18:23:38 +03:00
Alibek Omarov
32068d8090 client: fix wrong paused icon 2021-08-27 18:09:07 +03:00
Alibek Omarov
bd4979f5b0 ci: adding pvs-studio checking 2021-08-27 17:55:33 +03:00
Alibek Omarov
a5e1e9646c mainui: update 2021-08-27 17:47:37 +03:00
Alibek Omarov
013918a371 console: redefine con_color as cvar 2021-08-27 17:05:02 +03:00
Владислав Сухов
1b20694a1c ci: Fix missing extras in android builds 2021-08-06 13:06:44 +03:00
SNMetamorph
2db6ad2c8a ref_gl: fixed GL_CheckForErrors doesn't print error message 2021-08-01 22:28:24 +03:00
SNMetamorph
8c351d9255 engine: client: made pfnSPR_Load and pfnSPR_Frames functions as exported 2021-07-31 13:47:43 +03:00
SNMetamorph
c4ef42009c engine: client: fixed height argument writing in Con_DrawStringLen 2021-07-31 01:23:56 +03:00
SNMetamorph
8d5426cdcd utils: mdldec: fix of masked_solid texture flag 2021-07-29 13:17:38 +03:00
Alibek Omarov
7b8ec0ad4b engine: server: fix another const qualifier lose 2021-07-20 17:09:16 +03:00
Alibek Omarov
901e52615b engine: fix Com_ParseFile call 2021-07-20 16:26:17 +03:00
Alibek Omarov
88ce5fd0b6 engine: modify NetAPI to follow const qualifiers 2021-07-20 16:10:32 +03:00
Alibek Omarov
588dede2a2 ref_soft: fix pointer-to-int casts 2021-07-20 16:03:35 +03:00
Alibek Omarov
0efc5e82ec engine: fix some const qualifier lose and pointer-to-int casts 2021-07-20 16:03:06 +03:00
Alibek Omarov
c3da9d8c8f mainui: update 2021-07-20 16:02:09 +03:00
Alibek Omarov
a547526e86 engine: fix some signed char cases 2021-07-20 15:18:55 +03:00
SNMetamorph
09d647182d engine: net_encode: equality comparisions replaced with Q_equal macros 2021-07-09 14:57:49 +03:00
SNMetamorph
af3c0686c5 engine: mathlib: added Q_equal macros 2021-07-09 14:57:49 +03:00
SNMetamorph
8b76ab93fb engine: net_encode: made delta more GoldSrc consistant 2021-07-09 14:57:49 +03:00
Vladimir
9ffc02b6e9 ref_gl: gl_triapi: fixed culling enum in TriCullFace (#522) 2021-07-09 14:55:31 +03:00
Alibek Omarov
5d307d603c Remove clang-format 2021-07-09 14:40:24 +03:00
Alibek Omarov
affc64c6da gha: don't install unneeded multilib packages for amd64 2021-07-03 23:18:14 +03:00
Alibek Omarov
e00c20b288 readme: better wording 2021-07-03 22:54:31 +03:00
Alibek Omarov #SupportRMS
dcf7ec2c3d readme: migrate to GitHub Actions & Releases 2021-07-03 20:26:16 +03:00
Alibek Omarov #SupportRMS
21a31ec81d ci: migrate to GitHub Actions
* travis: disable build, disable deploy, add free aarch64/ppc64le/s390x builds

* scripts: cleanup of old CI scripts

* scripts: now port to GitHub Actions

* actions: fix extras checkout

* github: remove codeql action, turned out not to be very useful

* github: remove quiet flag on wget

* github: are we allowed to use envvars?

* github: add needed dependencies for linux

* github: install wget for windows

* scripts: convert our CPU architecture naming into what AppImage uses

* github: run scripts with bash explicitly

* github: first try to upload to GitHub Releases, enable amd64 win32 builds

* Use our uploadtool fork

* ci: include android, motomagx build for gha, refactor cirrus and travis ci scripts

* gha: try to fix build

* travis: try to fix build

* gha: try to fix upload, fix win32 build

* gha: use curl instead of wget, as it's preinstalled for windows. Fix Android build

* gha: add llvm repository, install clang-12 for android

* gha: motomagx: fail fast

* gha: android: explicitly set clang-12 as compiler and llvm-strip-12 as strip

* waifulib: xcompile: respect environment variables when using host compiler for Android

* waifulib: xcompile: use correct environ dict

* gha: try to fix -fuse-ld=lld with clang-12

* waifulib: xcompile: fix typo

* scripts: xcompile: fix motomagx build

* mainui: upgrade

* gha: fix android build, last time

* engine: wscript: disable crashhandler for magx
2021-07-03 20:21:09 +03:00
Alibek Omarov
9287a0f5c5 wscript: add some more warnings as errors 2021-07-02 19:27:45 +03:00
Alibek Omarov
4723eb2586 public: crtlib: fix error in COM_SlashPathFix 2021-07-02 19:27:04 +03:00
Alibek Omarov
15ec6539e3 engine: filesystem: fix custom loader enabled by mistype 2021-07-02 19:26:01 +03:00
Nord1cWarr1or
8d793521c4 engine: keys: fix misleading comment
Update keys.c (#514)
2021-06-28 20:10:41 +03:00
Alibek Omarov
2147542e33 engine: all user libraries packed inside archives are now deprecated 2021-06-27 00:20:23 +03:00
Alibek Omarov
a0af256641 engine: library: fix saves on 64-bit Windows, compile custom loader only on x86 2021-06-27 00:03:39 +03:00
Alibek Omarov
21174dc9cf engine: library: fix missing return 2021-06-27 00:02:41 +03:00
Alibek Omarov
894726d699 engine: disable custom DLL loader for everything except 32-bit x86 2021-06-27 00:02:16 +03:00
Alibek Omarov
f8e6033ae6 engine: move TIMER_LINUX to TIMER_POSIX, enabling dedicated builds for FreeBSD and other *nix platforms 2021-06-26 00:19:49 +03:00
a1batross
4abe1a77f4 engine: filesystem: fix missing newline in debug message 2021-06-22 11:31:53 +03:00
Alibek Omarov #SupportRMS
79f3a6f60e engine: sound: code style fix 2021-06-22 00:49:22 +03:00
SNMetamorph
a2c83144c0 engine: sound: warn about late precached sounds in developer mode 2021-06-22 00:48:02 +03:00
Alibek Omarov
6e0d372504 engine: fix FunctionFromName on MSVC, fix memory leak 2021-06-21 10:20:29 +03:00
Alibek Omarov
91ee9bd32a engine: merge tests for imagelib 2021-06-20 20:26:22 +03:00
Alibek Omarov
6ea25b8194 engine: add simple unit-testing (v3?) 2021-06-20 19:59:16 +03:00
Alibek Omarov
5bc4359a2f engine: implement platform neutral saves, now we can load saves made in Linux on Windows and vice-versa 2021-06-20 19:59:16 +03:00
Alibek Omarov
17d3eaa590 engine: win32: remove normal win32 library loader, from now on every win32 port must port custom loader 2021-06-20 19:59:16 +03:00
SNMetamorph
6ceb101ba1 engine: client: correctly named values in net_speeds stats 2021-06-18 08:58:46 +03:00
SNMetamorph
f7f069a38b engine: client: added Host_Error for CL_EDICT_NUM (hotfix for issue #434) 2021-06-18 08:58:46 +03:00
Alibek Omarov
37c5dfa49f engine: generalize maps command and map command autocompletion 2021-06-18 00:05:34 +03:00
tyabus
0260a6c234 engine: server: backport maps command implementation from old engine 2021-06-18 00:05:34 +03:00
lilmayofuksu
2ad209b973 engine: server: updated TSource query to be more compatible with GoldSrc standard (#497)
Mark TSource queries as connectionless.
Only send Windows as the os if the engine was built on it.
2021-06-16 13:09:31 +03:00
Alibek Omarov #SupportRMS
e9712fc24f Documentation: rework ports.md
Add new Switch and Wii ports
Add DOS port
Mark everything merged to main tree as supported, otherwise leave as in progress
2021-06-15 19:00:12 +03:00
Alibek Omarov
eef52ea2d0 mainui: update 2021-06-14 21:15:34 +03:00
Alibek Omarov
8018f4a000 waf: update 2021-06-14 21:14:22 +03:00
Alibek Omarov
9d0c7338ab wscript: make win32 common libraries check faster 2021-06-14 01:13:28 +03:00
Barış
18d8ef287d engine: fix client can use kill command while not connected (#492) 2021-06-12 18:19:23 +03:00
Alibek Omarov
9b1fccd1fa engine: move Cbuf_Execute to ClientBegin stub for dedicated server, to avoid confusion 2021-06-08 01:08:06 +03:00
Alibek Omarov
32e96bdad1 engine: support legacy net protocol in demos 2021-06-08 01:04:18 +03:00
Alibek Omarov
c50f73b892 engine: fix brush model sound spatialization 2021-06-07 22:54:41 +03:00
exstrim401
a1c948e591 game_launch: add const to game var 2021-06-07 19:39:52 +03:00
exstrim401
db3e71bfcc engine: Removed unused Haiku variables 2021-06-07 19:39:52 +03:00
exstrim401
2b436dced0 engine: Remove XASH3D_MIRRORDIR
also make XASH3D_GAME for all platforms
2021-06-07 19:39:52 +03:00
exstrim401
a89f9fa181 engine: Haiku BeGameLauncher support 2021-06-07 19:39:52 +03:00
Alibek Omarov
6063149b93 engine: match DT_TIMEWINDOW_* behaviour to GoldSrc: it's always signed and it's more of an integer than float value 2021-06-07 17:31:54 +03:00
Alibek Omarov
a28d15e519 engine: match DT_TIMEWINDOW_* behaviour to GoldSrc: it's always signed and it's more of an integer than float value 2021-06-07 17:30:40 +03:00
Alibek Omarov
94959110f6 engine: fix typo, #488 2021-06-07 15:53:20 +03:00
Alibek Omarov
86be161677 ref_gl: add missing HACKS_RELATED_HLMODS define, lost after renderer split 2021-06-07 02:40:40 +03:00
Alibek Omarov
9313f7e80e engine: replace pool pointer by pool handle 2021-06-07 02:33:15 +03:00
Alibek Omarov
43f1137565 engine: use substring search for mpfilter 2021-06-07 02:23:44 +03:00
Alibek Omarov
ad4062969b engine: client: fix warnings in cl_pmove 2021-06-07 02:22:08 +03:00
Alibek Omarov
60c10333aa engine: client: fix sound not spatialized correctly, remove unused field from rawchan 2021-06-07 02:21:46 +03:00
Alibek Omarov
0f84ce40f0 engine: client: fix cl_smoothtime, don't smooth movements when running local server(singleplayer, listenserve, etc) 2021-06-06 16:22:04 +03:00
Alibek Omarov
3894edcb98 engine: client: enhance cl_showevents for reverse-engineering needs 2021-06-06 16:22:04 +03:00
Alibek Omarov
5b387ba36a engine: client: move Cbuf_Execute out of Host_InputFrame, cbuf will be executed always at ClientBegin. Fixes #482 2021-06-06 16:22:04 +03:00
Velaron
d011dccaab engine: client: remove redundant index check 2021-06-06 15:51:41 +03:00
exstrim401
b7922368bd engine: Haiku OS support (#478) 2021-06-05 10:54:37 +03:00
Alibek Omarov
947a615707 ref_gl: gl4es: update 2021-06-03 21:44:55 +03:00
Alibek Omarov
b2d93b7b55 mainui: update 2021-06-03 21:44:45 +03:00
Alibek Omarov
49a20a9ac5 engine: server: fix memleak after previous commit 2021-06-02 22:06:17 +03:00
Alibek Omarov
8966172ce0 engine: server: avoid crash if map entity doesn't have classname (tfc map flagwar for example) 2021-06-01 23:45:55 +03:00
Alibek Omarov
ddd48c420b engine: decrease instanced baseline index by minus one to avoid zero offset which interpreted as no baseline at all 2021-06-01 21:52:33 +03:00
Alibek Omarov
f31e9ae19e engine: server: fix bounds check in SV_GetFragmentSize 2021-06-01 18:35:38 +03:00
Alibek Omarov
4543008012 engine: server: declare sv_client_t::flags as unsigned 2021-06-01 17:58:33 +03:00
Alibek Omarov
d54a648792 engine: common: avoid sign bit loss in MSG_WriteBitLong 2021-06-01 17:57:54 +03:00
Alibek Omarov
13a3f22001 engine: client: netgraph: add in_graph kbutton support, staticify netgraph 2021-06-01 17:57:03 +03:00
SNMetamorph
75e80bc2ff engine: server: fixed cvars sv_max/minupdaterate, sv_max/minrate 2021-05-30 09:40:03 +03:00
SNMetamorph
386ae2067b engine: client: another interpolation fix 2021-05-30 09:40:03 +03:00
SNMetamorph
b289de26a6 engine: client: added cvar cl_nointerp for disabling interpolation 2021-05-30 09:40:03 +03:00
SNMetamorph
415f5baa1c engine: client: CL_LerpPoint hotfix 2021-05-30 09:40:03 +03:00
Bohdan Shulyar
3fdfbff09b readme: update discord invite (#458)
* readme: update discord invite

* readme: update discord invite
2021-05-29 21:32:20 +03:00
Alibek Omarov #SupportRMS
163225e180 travis: android: switch to mobile_hacks hlsdk 2021-05-26 18:18:22 +03:00
Andrey Akhmichin
1369c2029b Documentation: opensource-mods.md: add "Expanded Arsenal" and "ESHQ". 2021-05-18 23:25:08 +03:00
Velaron
4f31d7504a ref_api: fix remap info allocation (fixes #200) 2021-05-02 20:02:04 +03:00
Alibek Omarov
585955eb19 engine: filesystem: add an error message if we're trying to get a handle of a compressed file in ZIP archive 2021-05-02 01:20:18 +03:00
SNMetamorph
1a5b2576f7 wscript: added support for "Edit and Continue" MSVC feature 2021-04-30 16:12:08 +03:00
Bohdan Shulyar
ddc4d76668 engine: common: add quote symbol escaping support (#411) 2021-04-04 22:03:02 +03:00
Alibek Omarov
f5e400de69 server: fix wrong xashid key on server, it's uuid now 2021-03-28 01:57:40 +03:00
Alibek Omarov
9c8059ea96 engine: imagelib: add BGRA saving for PNG
Fix incorrect output, when input format has alpha but flags don't
have set IMAGE_HAS_ALPHA.
Flags are meant to control output format, but input format may be arbitrary,
as usually given by video driver(screenshots, etc)
2021-03-28 00:34:42 +03:00
Alibek Omarov
c62db950f1 server: implement rcon redirection, add redirect command from old engine 2021-03-27 23:46:57 +03:00
Alibek Omarov
9c9953bb60 server: fix some cvars being registered incorrectly or not registered at all 2021-03-27 23:23:37 +03:00
Alibek Omarov
acaf15c5d2 engine: increase MAX_LEGACY_SERVERS limit 2021-03-27 23:22:51 +03:00
Alibek Omarov #SupportRMS
25569db053 readme: clarify issue languages 2021-03-26 20:49:39 +03:00
Alibek Omarov #SupportRMS
a391038d27 travis: rename win32 build to xash3d-win32-vc.7z 2021-03-26 17:58:35 +03:00
Alibek Omarov #SupportRMS
9ea45a71f5 scripts: rename win32 build to xash3d-win32-vc.7z 2021-03-26 17:57:51 +03:00
nekonomicon
ea39836b88 Documentation: opensource-mods.md: add "Year of the Dragon" and "Overturn". (#375) 2021-03-26 02:16:26 +03:00
nekonomicon
bfa01f5b3b Documentation: opensource-mods.md: update. (#372) 2021-03-25 10:49:03 +03:00
Alibek Omarov
23974d24c3 engine: try to avoid broken -Werror=duplicated-branches for old GCCs 2 2021-03-24 19:11:17 +03:00
Alibek Omarov
868947cbb4 engine: try to avoid broken -Werror=duplicated-branches for old GCCs 2021-03-23 23:49:08 +03:00
a1batross
cb942d7e81 mainui: update 2021-03-15 14:05:52 +03:00
Vladimir
05cf8d0edc readme: improved installation instructions (#363) 2021-03-15 12:23:25 +03:00
Alibek Omarov
071f15b570 mainui: update 2021-03-15 03:44:44 +03:00
Alibek Omarov
e5a40fd745 server: fix password presence wasn't advertised to clients on info message #359 2021-03-15 03:40:46 +03:00
Alibek Omarov
f2ab4c0d0e engine: cfgscript: don't let scr vars overwrite existing variables
we don't use them for storing settings anyway
only for reference in UI
2021-03-15 03:39:20 +03:00
Alibek Omarov
0ba1a8e7bc engine: cfgscript: reduce copypasted code 2021-03-15 03:38:10 +03:00
Alibek Omarov
ed0ca2b2d2 engine: fix predicting oldbuttons 2021-03-12 00:10:51 +03:00
Alibek Omarov
26404315cb engine: filesystem: avoid unnecessary padding in private structs 2021-03-11 21:46:00 +03:00
Alibek Omarov
be1958473b engine: filesystem: fix liblistgam converting to gameinfo when rodir was enabled 2021-03-11 21:42:35 +03:00
Alibek Omarov
8b59875e93 mainui: update 2021-03-11 20:23:03 +03:00
Alibek Omarov
accacd54f5 waifulib: set debug builds to be built with -O0, gcc -Od is broken 2021-03-11 20:17:39 +03:00
Alibek Omarov
331a2046c8 engine: net: fix delta incorrect casts when field is signed 2021-03-10 21:51:21 +03:00
Alibek Omarov
c9f176f802 common: remove double defines 2021-03-10 21:49:09 +03:00
Alibek Omarov
523798857b engine: platform: fix opensles audio 2021-03-10 13:45:02 +03:00
Alibek Omarov
2edc8b16ae engine: platform: fix sdl audio 2021-03-10 13:44:25 +03:00
Alibek Omarov
29902f48d5 public: oops, fix broken crtlib 2021-03-10 13:38:36 +03:00
Alibek Omarov
d25a661701 public: moar int to size_t for string length 2021-03-10 13:18:23 +03:00
Alibek Omarov
a93d9ac71c engine: platform: simplify sound code
Remove SNDDMA_GetSoundtime, because it was mostly copypasted from one
platform code to another.
SNDDMA_GetDMAPos gets removed too, as we have dma.samplepos for that.
2021-03-10 00:16:13 +03:00
Alibek Omarov
c68af64fe5 engine: platform: fix access to uninitialized audio subsystem when -nosound was passed 2021-03-10 00:03:12 +03:00
Alibek Omarov
3d9a4560d5 client: make sound cvars statically allocated, to avoid access to invalid pointers in the future 2021-03-09 23:59:29 +03:00
Alibek Omarov
9120d40ce5 engine: redefine CVAR_DEFINE_AUTO through CVAR_DEFINE macro 2021-03-09 23:58:21 +03:00
Alibek Omarov
4db2aaffc4 client: port fix of spk/speak commands from old engine 2021-03-09 23:34:12 +03:00
Alibek Omarov
155eb1ba58 engine: fix various warnings 2021-03-07 03:40:01 +03:00
Alibek Omarov
efaf7ac622 engine: fix UB on MSG_BigShort 2021-03-07 03:39:16 +03:00
Alibek Omarov
6cc2205321 public: strlen must return size_t, not int 2021-03-07 03:38:54 +03:00
Alibek Omarov
0a818f3f3f client: add waveplaylen console command like in GoldSrc 2021-03-07 02:51:03 +03:00
Alibek Omarov
fe2c4af8c2 engine: soundlib: make Sound_GetApproxWavePlayLen behave like in GoldSrc 2021-03-07 02:49:40 +03:00
Alibek Omarov
3e7dd30fd7 engine: soundlib: use stdint definitions for WAV headers 2021-03-07 02:48:56 +03:00
Alibek Omarov
42f47f51b5 server: implement GetFileSize and GetApproxWavePlayLen from HLSDK 2.4 2021-03-07 02:46:38 +03:00
Alibek Omarov
aea9e8efa2 server: sv_validate_changelevel is deprecated now and disabled by default
If anyone wants this feature back, use +sv_validate_changelevel 1 in command line.
2021-03-07 02:20:30 +03:00
Alibek Omarov
a6cd67cc65 mainui: update submodule, fix #332 2021-03-07 02:01:36 +03:00
Alibek Omarov
585ae28dd2 server: fix some int <> unsigned int conversions 2021-03-07 02:00:46 +03:00
Alibek Omarov
4abac92891 wscript: try to fix tgmath detection on freebsd 2021-03-07 00:28:57 +03:00
Alibek Omarov
a813be7d54 client: add cl_showpos 2021-03-07 00:03:19 +03:00
Alibek Omarov
e77957bc81 client: decrease visibility of some cvars 2021-03-06 23:40:04 +03:00
Alibek Omarov
9b6f26c191 mdldec: build with CONSOLE subsystem on Win32 2021-03-05 17:59:54 +03:00
Alibek Omarov
385cc3f497 public: remote obsolete header 2021-03-05 16:09:59 +03:00
Alibek Omarov
c0db39594b scripts: enable building utils for PC platforms 2021-03-05 16:04:20 +03:00
Alibek Omarov
add4cf4232 mdldec: add wscript, disabled by default 2021-03-05 16:00:26 +03:00
Alibek Omarov
586d613a27 ref_soft: uncomment texture API functions implementations, they must be working now
Fixes #326 and probably some ref_soft crashes
2021-03-02 17:49:37 +03:00
Alibek Omarov
45334064b6 ref_gl: remove detail textures list generation leftovers 2021-03-01 21:53:43 +03:00
Alibek Omarov
ca84a1a10e engine: fix building with SDL older than 2.0.4 2021-03-01 21:48:31 +03:00
Alibek Omarov
14008703f6 wscript: fix tgmath check for old toolchails like GCW0 2021-03-01 21:46:58 +03:00
Alibek Omarov
58edfbc485 engine: move cvars that expected to exist by client.dll from render dll to engine
Fixes #316
2021-03-01 20:03:32 +03:00
Alibek Omarov
fa555c1f09 server: add hardcoded list of chapters for HL, BS and OF, same as GoldSrc
Fix incomplete comment in save file when server DLL provides SV_SaveGameComment.
Fix possible buffer overflow when reading comment from save file.
2021-03-01 19:53:17 +03:00
Andrey Akhmichin
75210b1ff6 engine: common: filesystem.c: add binary search for files from zip-archives. 2021-03-01 19:53:07 +03:00
Alibek Omarov
b278751834 waf: upgrade to waifu 1.1.0 2021-02-28 15:39:22 +03:00
a1batross
3b192ca490 engine: sdl: don't free NULL vidmodes 2021-02-27 00:08:42 +03:00
Alibek Omarov
12dd225db2 cirrus: fix freebsd 12 image 2021-02-26 18:33:26 +03:00
SNMetamorph
56d5f08128 platform: win32: fixed crashes in COM_CheckLibraryDirectDependency 2021-02-26 16:05:34 +03:00
Alibek Omarov
256284d76f wscript: refactor loading MSVC tools, apply @w23 hack for renaming DEST_CPU 2021-02-26 16:04:45 +03:00
Alibek Omarov
cf5ebd128c client: fix XASH_64BIT check 2021-02-26 16:04:45 +03:00
Ivan 'provod' Avdeev
5b597028fe make it reliably compile for amd64 on windows
This makes it possible to just pass `-8` to ./waf configure on Windows
and it will build 64-bit binaries. Yay I guess.

However, it's completely broken conceptually -- it ends up just brute
rewriting `conf.env.DEST_CPU` from `amd64` to `x86_64` at one particular
point in wscript. Why? Because many places in build system expect
`x86_64` as 64-bit DEST_CPU, especially breaking SDL2 lib detection.
Some of these are in waifu and patching that is beyond what I can hold
in my head right now.
Why that particular point? Because it DEST_CPU gets rewritten a few
times before that and no times after it seems.

This does not address `./waf msvs` VS project generation yet -- it will
still produce only Win32 platform that needs to be manually rewritten.

There's a mechanism for msvs extras to be passed a set of platforms, but
I've yet to make it work.
2021-02-26 16:04:45 +03:00
Ivan Avdeev
012d1fa8bd fix USE_MMAP usage
should fix CI failures
2021-02-26 16:04:45 +03:00
Ivan Avdeev
1b426b67e7 partially fix amd64 build on windows
Quality of this commit is questionable. I have no idea whether what I did
here makes sense or not.
But it compiles and runs (provided with hlsdk-xash3d amd64 build, which
is another story).

This omits necessary waf changes that are necessary to make a valid
64-bit build. Apparently it's not enough to just pass `-8` on Windows,
you also need to hack wscript to add `x64` target to MSVC. I'll do that
later when I figure out how.

This change is a precursor for RTX Vulkan effort --
VK_KHR_ray_tracing_pipeline and friends are only available on 64-bit
nvidia drivers (no idea about AMD, pls send GPUs onegai).
2021-02-26 16:04:45 +03:00
SNMetamorph
8d50049db7 netgraph: fixed data usage graphs rendering 2021-02-20 14:22:20 +03:00
SNMetamorph
cba9fb1a07 vid_common: added vid_mode cvar for proper working VideoModes menu in game settings 2021-02-20 14:22:20 +03:00
SNMetamorph
932fc8e3c7 wscript: fixed MSVC optimization flag in debug mode 2021-02-20 14:22:20 +03:00
mittorn
5884cf88d3 crtlib: fix undefined behaviour when stripping extenstion from empty string 2021-02-14 21:33:41 +00:00
Skyrim-police
d2157fa28c Documentation: supported-mod-list: fix dead links 2021-02-12 04:21:57 +03:00
mittorn
6e43f9bdd0 waf: fix wrong message about 32-bit build 2021-02-12 00:05:41 +03:00
Gleb Mazovetskiy
d9ed654f04 bump gl4es
Build fix: d79ac6a6d7

A few rendering fixes:

* 1f52c84f5a
* d8a2dc35ee
2021-02-03 16:16:51 +03:00
Alibek Omarov
8090db2e75 netgraph: change netgraph buffer size for low memory mode 2021-02-01 10:06:55 +03:00
Alibek Omarov
652a946e09 ref_gl: update gl4es submodule 2021-01-29 03:33:36 +03:00
Alibek Omarov
d6d90f03a0 wscript: refactoring, split optimization flags selection and fpic control into standalone modules 2021-01-29 03:33:14 +03:00
Alibek Omarov
d7b3c7b681 engine: proper order for XASH_LOW_MEMORY definitions 2021-01-29 03:24:41 +03:00
Andrey Akhmichin
c158771f59 ref_gl: gl_rsurf.c: don't use asserts to prevent engine from stopping when vbo is disabled. 2021-01-17 23:11:59 +03:00
lewa_j
63c4b2748c platform: win32: sdl: Fix zombie processes after early Sys_Error on windows+sdl 2021-01-16 01:13:57 +03:00
Andrey Akhmichin
9bc3d6d315 utils: mdldec: better validity checks. 2021-01-10 02:31:19 +03:00
Andrey Akhmichin
1a59389261 utils: mdldec: STUDIO_NF_SMOOTH texture flag means "smooth" texrendermode. 2021-01-10 02:30:56 +03:00
Alexey
221a9bab54 Fix screenshots on gles1
> format must be either GL_RGBA or the value of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES.
2021-01-09 18:36:46 +03:00
a1batross
102fb8ec40 mainui: update submodule 2021-01-08 07:43:06 +03:00
a1batross
db89c4236a vgui-dev: update submodule 2021-01-08 07:42:57 +03:00
Alibek Omarov
b1048556c6 gitignore: fix waf ignores 2021-01-08 00:25:14 +03:00
Gleb Mazovetskiy
11194f339d game_launch: Add a --disable-menu-changegame build option
This option is useful when xash3d is launched externally by a script
that performs additional setup.
2021-01-07 22:27:21 +03:00
Gleb Mazovetskiy
c95e847890 Fix joystick trigger thresholds
They were negative by default but they should've been positive:

> a value ranging from -32768 to 32767. Triggers, however, range from 0 to 32767 (they never return a negative value).
https://wiki.libsdl.org/SDL_GameControllerGetAxis

This fixes LTRIGGER and RTRIGGER (L2/Zl and R2/Zr on most gamepads)
2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
4daa7c23a0 SDL2 GameController: Map axes to engine explicitly 2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
3e8e751dc7 GameController: Add separate D-Pad bindings
1. Adds separate D-Pad bindings so that they don't conflict with arrow
   keys on the keyboard.
2. Also adds some basic defaults for gamepad buttons.
2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
239474b01e .clang-format: SpaceBeforeParens: Never
This is more consistent with how xash3d formats its `if` and `switch` statements
2021-01-07 17:34:51 +03:00
Gleb Mazovetskiy
12b579bc34 Fix R_CollectRendererNames
Previously R_CollectRendererNames left gaps in the `ref` subarrays.
This caused `R_Init` to fail in some cases because it iterates between `0` and `ref.numRenderers`.
2021-01-07 17:34:34 +03:00
Gleb Mazovetskiy
6d614e028a Fix COM_LibraryError newline handling
1. Do not append a trailing newline to the result of COM_GetLibraryError.
2. Fix call sites.
2021-01-07 17:33:09 +03:00
Gleb Mazovetskiy
a234888d44 Remove DEFAULT_(ACCELERATED|SOFTWARE)_RENDERER
This is no longer needed as we now use DEFAULT_RENDERERS order priority
and only try to load the detected renderers.
2021-01-07 17:31:56 +03:00
Gleb Mazovetskiy
5e0a0765ce Trim all trailing whitespace
The `.editorconfig` file in this repo is configured to trim all trailing
whitespace regardless of whether the line is modified.

Trims all trailing whitespace in the repository to make the codebase easier
to work with in editors that respect `.editorconfig`.

`git blame` becomes less useful on these lines but it already isn't very useful.

Commands:

```
find . -type f -name '*.h' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
find . -type f -name '*.c' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
```
2021-01-04 20:55:10 +03:00
Gleb Mazovetskiy
3af742f103 in_touch.c: Fix -Wpointer-to-int-cast 2021-01-02 18:01:53 +03:00
Gleb Mazovetskiy
9452a389a5 SDL GameController: Hotplug and multiple gamepads
1. Process events from all game controllers.
2. Support controller hotplug.
2021-01-02 18:00:36 +03:00
Alibek Omarov
766ef84af4 engine: ref: try to bruteforce all available renderers if we're failed to load requested one 2021-01-02 17:59:53 +03:00
Gleb Mazovetskiy
5b8d504817 Add .clang-format
Based on
725fd84b5b/.clang-format
with the following changes:

1. Uncomments `BasedOnStyle: WebKit` to be explicit.
2. Adds:

       AlignConsecutiveDeclarations: true
       AlignConsecutiveMacros: true
2021-01-02 17:56:58 +03:00
Alibek Omarov
61fe9fd1fe engine: fix some left shifts on signed integers 2021-01-02 05:01:51 +03:00
Gleb Mazovetskiy
33ba1f25f3 sys_linux.c: Increase buffer size for /proc/self/status
Fixes #263
2021-01-02 04:21:01 +03:00
Gleb Mazovetskiy
2106eef4b2 system.c: Fix Sys_Warn/Error text buffer sizes
This was using the wrong define
E.g. `-dev 2 -help` output did not fit into it
2021-01-02 03:43:17 +03:00
Gleb Mazovetskiy
23998ef720 makepak.py: Skip all filenames starting with .
This makes it much simpler to define a buildroot package for xash-extras
buildroot places various buildroot-internal dot files in the package build directory
2020-12-30 14:40:32 +03:00
Andrey Akhmichin
1332381e2d engine: server: simplified strings operations. 2020-12-29 20:20:25 +03:00
Gleb Mazovetskiy
7f98998765 ref_gl/gl4es: bump
To get this bugfix: 221fa1e67a
2020-12-29 03:25:57 +03:00
Andrey Akhmichin
5aef09ce5d engine: client: simplified strings operations. 2020-12-29 01:07:00 +03:00
Gleb Mazovetskiy
69e15e9c7b gl4es: Fix so name and add to renderer collector
1. `libref_gles2_gl4es.so` -> `libref_gl4es.so` because this is what's
    passed to `R_LoadRenderer`.

2. Add `gl4es` to `DEFAULT_RENDERERS` so that `R_CollectRendererNames`
   finds it.
2020-12-29 00:44:42 +03:00
Andrey Akhmichin
9e1170fc56 Documentation: add list of non-supported mods. 2020-12-29 00:43:50 +03:00
Gleb Mazovetskiy
5a36a26dd1 Fix SDL_GAMECONTROLLER handling
1. Do not disable SDL_JOYSTICK events. Disabling these events causes
   game controller events to be disabled as well. Instead, filter these events out.

2. Fix button mapping (it was off by one).
2020-12-28 16:11:19 +03:00
Gleb Mazovetskiy
a92b310e0e Add gl4es submodule
Fixes #248
2020-12-28 16:11:04 +03:00
Gleb Mazovetskiy
b40344f1f0 travis: unzip quietly
Helps avoid the following error message:

> The job exceeded the maximum log length, and has been terminated.

(e.g. https://travis-ci.org/github/FWGS/xash3d-fwgs/jobs/751744736)
2020-12-28 13:09:01 +03:00
Gleb Mazovetskiy
36b32cad0f Fix 2 instances of void* pointer arithmetic
Partially reverts 341e440c07

Let's see if this fixes the windows build on travis
2020-12-28 13:08:18 +03:00
mittorn
7b127c23f5 client: fix vgui leaving text input move enabled (breaks CTRL in SDL2) 2020-12-13 10:11:32 +03:00
Alibek Omarov
9acedb3408 travis: restore unzipping file 2020-11-29 19:45:05 +03:00
Andrey Akhmichin
5f54582692 ref_gl: simplified strings operations. 2020-11-29 13:46:48 +03:00
Andrey Akhmichin
63d8794902 ref_soft: r_image.c: remove duplicated Q_strlen() call. 2020-11-29 13:33:50 +03:00
Alibek Omarov
ede9e5095d travis: fix getting android deps 2020-11-28 23:22:57 +03:00
Andrey Akhmichin
abd9778ef3 engine: common: simplified strings operations. 2020-11-28 23:20:14 +03:00
Andrey Akhmichin
299e3fe957 utils: mdldec: small update. 2020-11-28 23:18:30 +03:00
Alibek Omarov
3e7e251828 codeql: try to fix analysis tool 2020-11-28 01:34:26 +03:00
Alibek Omarov
f2120672d0 travis: update android sdk level 2020-11-28 01:30:55 +03:00
Alibek Omarov
d3ab2023ae travis: combine downloading zip file and unpacking it 2020-11-28 01:30:55 +03:00
Andrey Akhmichin
cdcd139171 engine: studio.h: rename unused fields as "unused".
engine: studio.h: add assimp-like comments.
2020-11-27 22:06:05 +03:00
Andrey Akhmichin
88e1780c68 engine: studio.h: use vec_t instead of float. 2020-11-27 22:06:05 +03:00
Andrey Akhmichin
68e10d7b53 engine: studio.h: use C99 types. 2020-11-27 22:06:05 +03:00
Andrey Akhmichin
378b655cd2 engine: studio.h: add Paranoia 2: The Savior structures and macros. 2020-11-27 22:06:05 +03:00
Alibek Omarov
b7fa48a1eb cirrus: try to fix freebsd 11.4 ci build 2020-11-27 21:59:41 +03:00
Alibek Omarov
eb652d53ac public: fix compiling 2020-11-22 19:08:51 +03:00
Andrey Akhmichin
c53985c0bc engine: common: imagelib: img_tga.c: refactor Targa encoder. 2020-11-18 18:54:25 +05:00
mittorn
f60c398f32 scripts/xcompile/android: add ability to specify HOST_TOOLCHAIN and override hard-coded one 2020-11-18 12:34:38 +03:00
mittorn
bb387cfe4b ref_gl/gl4es: fix android build 2020-11-18 12:19:52 +03:00
mittorn
341e440c07 public,sprites: fix -Wcast-align, disable -Werror for it 2020-11-18 12:15:54 +03:00
Aydar Zarifullin
e6b9b67825 add codeql-analysis.yml 2020-10-07 23:50:13 +03:00
Alibek Omarov
9c6183e6a0 wscript: add some more alignment related diagnostics 2020-09-29 15:42:43 +03:00
Alibek Omarov
2aaa6c6e04 public: build: add ARMv8 32-bit support, in case of someone actually uses it 2020-09-28 16:17:08 +03:00
Alibek Omarov
80a5c53cb2 engine: client: move ref state updating into standalone function 2020-09-14 14:33:43 +03:00
Agent Agrimar
e4a71afe63 engine: client: update the ref state before R_NewMap is called
This fixes fades that occur at the beginning of a map being a tad screwy as a result of the ref state not being updated with fresh values, which only happens when a frame is being rendered (loading happens to prevent that).
2020-09-14 14:33:18 +03:00
Andrey Akhmichin
23ea7ecbcc public: optimize MD5_Print function. 2020-09-14 14:28:47 +03:00
Logan
5cdb35f508 Pass cl.viewentity into S_StartSound for pfnPlaySoundByNameAtLocation
This fixes a minor bug where sounds played via pfnPlaySoundByNameAtLocation (mainly from viewmodel animations e.g. MP5) would be left where it was emitted in the world, rather than following the local player as it does in Goldsrc.
2020-09-11 22:10:32 +03:00
Velaron
03668116d7 platform: win32: COM_CheckLibraryDirectDependency fixes 2020-09-03 22:04:13 +03:00
Velaron
f3d8a2bcb0 client: vgui: don't fail if client path not given 2020-09-03 19:22:22 +03:00
Velaron
09ae961221 remove platform-specific macros 2020-08-24 21:22:02 +03:00
Velaron
d015e97eae engine: client: m_rawinput support on windows 2020-08-24 21:22:02 +03:00
Velaron
b4aecfbf23 engine: move some input code 2020-08-24 21:22:02 +03:00
lewa_j
df7f8259a1 mainui: update 2020-08-24 20:27:08 +03:00
Alexey
fff71e449e Fix android travis build again 2020-08-24 19:08:38 +03:00
Alibek Omarov
d4003f9527 crashhandler: fix build 2020-08-23 20:33:17 +03:00
Alibek Omarov
9acd2f5d22 waf: upgrade waf 2020-08-23 19:02:15 +03:00
Alibek Omarov
d30605c09f engine: fixes for dedicated 2020-08-23 19:02:15 +03:00
Alibek Omarov
9ff6d44178 crashhandler: remove unknown arch error 2020-08-23 19:02:15 +03:00
Alibek Omarov
90b163dc1d waf: add more ignored files 2020-08-23 19:02:15 +03:00
Alibek Omarov
2d97126baf defaults: if no crashhandler was defined, fallback to null 2020-08-23 19:02:15 +03:00
Alibek Omarov
3f3160e220 readme: remove archlinux package, it's outdated and there is no one to update it 2020-08-14 15:58:23 +03:00
Andrey Akhmichin
065811cc46 engine: common: filesystem.c: do not load zip-archives with zip extension as bullet proof. 2020-07-27 18:59:50 +03:00
Andrey Akhmichin
e69956c9ea engine: common: imagelib: img_png.c: set IMAGE_HAS_ALPHA flag only for RGBA images. 2020-07-22 14:37:40 +03:00
mittorn
e96271a8a9 platform/android: make host.state actual in Android_UpdateSurface call 2020-07-12 05:16:08 +07:00
mittorn
f0c9aa1585 vid_android: workaround small output buffer 2020-07-10 09:51:00 +07:00
mittorn
ce269f8c6d ref_soft/glblit: fix wrong MapBuffer function in GLES3 2020-07-10 09:49:13 +07:00
mittorn
4515d3e3cb platform/android: implement native software blitter, fix lost context on resize, fix safegl 2020-07-08 08:48:46 +07:00
mittorn
c80da05e94 ref_gl: make renderer fallback possible 2020-07-08 08:46:07 +07:00
mittorn
bef873e1f8 platform/android: enable dynamic dladdr, fix build 2020-07-08 08:45:24 +07:00
mittorn
a5e3a74e93 waf/xcompile: gnu hash on android confuses old linkers 2020-07-08 02:40:43 +07:00
mittorn
d9290f2e03 gles1 and non-pbo fallbacks 2020-07-07 00:23:23 +07:00
mittorn
98ffbaf87a android: fix fallbacks 2020-07-07 00:22:01 +07:00
Alibek Omarov
1e1c0a9aa3 readme: fix #187 2020-06-23 16:21:43 +03:00
Alibek Omarov
9979d4feb7 readme: add a note about github's generated zip archives 2020-05-25 22:35:34 +03:00
Marc-Antoine Lortie
5f2d346b9b Fixed mod title in Open Source mods documentation.
In section 'Derived Work' under 'Half-Life: Induction', both links appear to link to projects related to 'Half-Life: Invasion'. The mod title was probably meant to be 'Half-Life: Invasion'.
2020-05-25 16:59:34 +03:00
Alibek Omarov
64a96b26ad wscript: disable treating uninitialized as error because it gives too much false-positives 2020-05-13 00:24:50 +03:00
Alibek Omarov
0db1a7743d engine: try to fix -Wmaybe-uninitialized that may be enabled with -Wuninitialized. Diagnostic is prone to false-positives, as compiler don't have enough data for this 2020-05-12 02:00:34 +03:00
Alibek Omarov
a641488b98 engine: imagelib: img_bmp: add paranoid checks for estimated file size to not exceed real buffer. Needs proper testing. 2020-05-11 03:02:13 +03:00
Alibek Omarov
371cfc1cce mainui: update 2020-05-11 02:28:18 +03:00
Alibek Omarov
46b0590e4e engine: imagelib: refactor to use stdint.h definitions, use spaces for alignment instead of tabs 2020-05-11 02:28:04 +03:00
Andrey Akhmichin
95393cde72 Documentation: add list of opensource mods 2020-05-08 16:00:50 +03:00
Alibek Omarov
ea6846e2f9 ci: run pkg update for freebsd 2020-05-03 15:17:53 +03:00
Alibek Omarov
9b22149509 engine: host: execute server.cfg right before main loop starts 2020-05-02 19:26:41 +03:00
Alibek Omarov
ce1fc386a2 engine: server: reformat SV_Init 2020-05-02 19:14:23 +03:00
Alibek Omarov
77bebe3000 engine: server: remove FCVAR_SERVER from gamedir cvar, set FCVAR_READ_ONLY instead. Seems it was used when Xash had hot change game, i.e. without restarting engine. 2020-05-02 19:08:43 +03:00
Alibek Omarov
9292d81052 ref_soft: remove leftover debug volatile 2020-05-02 19:07:56 +03:00
FOTMarut
e1985eeb4f ref_soft: de-duplicated symbols
- Compiles correctly with GCC 10 now
2020-05-02 18:57:37 +03:00
FOTMarut
53768c84d6 ref_gl: de-duplicate GL function definitions
- Used APIENTRY_LINKAGE in ref_gl to remove duplicate definitions of GL
  functions among translation units
- Fixes building ref_gl with -fno-common (GCC 10)
2020-05-02 18:57:37 +03:00
FOTMarut
3c2840f7d1 ref_gl: Added APIENTRY_LINKAGE macro
- Added APIENTRY_LINKAGE macro to specify linkage of GL functions inside
  ref_gl/gl_export.h
  Currently defaults to empty (-> auto)
2020-05-02 18:57:37 +03:00
Alibek Omarov
32f6f359a4 ref_soft: comment out useless line 2020-05-02 18:02:32 +03:00
Alibek Omarov
0428de6285 ref_soft: check if offsetof was defined before 2020-05-02 18:02:05 +03:00
Alibek Omarov
92f0bf54f1 wscript: enforce error on uninitialized variables 2020-05-02 18:01:44 +03:00
Alibek Omarov
8fcfde1e42 ref_soft: comment out useless code to make compiler happy about uninitialized variables 2020-05-02 18:01:30 +03:00
Alibek Omarov
e0dfc4c0b4 launcher: oops, enable NOCONHOST only for Win32 2020-04-30 20:48:33 +03:00
Alibek Omarov
80a806aaad engine: wscript: remove non-actual comment line about include dirs order 2020-04-25 21:28:20 +03:00
Alibek Omarov
762d57fd88 waf: upgrade to latest waifu version 2020-04-25 21:28:20 +03:00
Alibek Omarov
732cb925e5 launcher: use engine definitions, enable cocon_win by default, fix Com_LoadLibrary to COM_LoadLibrary, fix memory leak, fix incorrect argv 2020-04-25 21:28:19 +03:00
Alibek Omarov
f59a3ca417 defaults: use appropriate Win32 check macro 2020-04-25 21:28:19 +03:00
lewa_j
deb7591d1e Fix SaveBMP 2020-04-25 21:19:58 +03:00
Alibek Omarov
82c54b1b54 engine: disallow zero-width strings for getenv() 2020-04-19 13:02:51 +03:00
Alibek Omarov
8d942bcc86 xash3d_types: start refactoring engine to use stdint.h types 2020-04-19 13:02:51 +03:00
Alibek Omarov
c39d42cc62 avi: replace longs by ints 2020-04-19 13:02:51 +03:00
Aimless Wanderer
51a45d745e engine: userconfig.d support from old engine 2020-04-14 20:08:08 +03:00
Alibek Omarov
544fc63b6b ref_gl: nanogl: update 2020-03-30 00:48:31 +03:00
Alibek Omarov
e06518c594 engine: studio: fix signed left shift to unsigned left shift 2020-03-30 00:48:17 +03:00
Alibek Omarov
012a193685 wscript: check for stdint.h and use it, instead use pstdint.h 2020-03-30 00:46:58 +03:00
Alibek Omarov
dc2ab714f6 mpg123: backport some UB fixes from upstream 2020-03-30 00:46:39 +03:00
Alibek Omarov
4c6fd79f07 tgmath: remove including tgmath.h in everything that uses xash3d_mathlib, as it's included already 2020-03-30 00:42:10 +03:00
Alibek Omarov
293b42b9d4 public: add stdint.h implementation by Paul Hsich http://www.azillionmonkeys.com/qed/pstdint.h 2020-03-30 00:13:20 +03:00
Alibek Omarov
88ab42cc15 Merge branch 'master' of https://github.com/FWGS/xash3d-fwgs 2020-03-29 17:46:12 +03:00
Alibek Omarov
7429a6bc8a Add 'ref_soft/' from commit '9045657352c7dfd3622cdf2b69462ca33f4262ee'
git-subtree-dir: ref_soft
git-subtree-mainline: 89ca0dec5e
git-subtree-split: 9045657352
2020-03-29 17:45:00 +03:00
Alibek Omarov
89ca0dec5e platform: android: slightly more verbosity 2020-03-29 17:44:23 +03:00
Alibek Omarov
9045657352 ref_soft: sprite: fix to compile(copypasted from ref_gl) 2020-03-29 17:02:24 +03:00
Alibek Omarov
3984a58025 ref_soft: upgrade to latest RefAPI and libpublic 2020-03-29 17:01:45 +03:00
Alibek Omarov
237d6f8689 ref_soft: upgrade to latest RefAPI version 2020-03-29 16:58:27 +03:00
FOTMarut
79a7b7b1a3 engine: platform: sdl: Fix mousewheel in SDL2
- See issue 143
- Tested on SDL2
- Untested on SDL1.2
2020-03-29 11:27:08 +03:00
Alibek Omarov
b81345f063 ref_soft: add some cvars to GLCONFIG, so they would be saved into ref_soft.cfg and fix UB in cast 2020-03-28 21:56:08 +03:00
Andrey Akhmichin
87340ceca8 engine: server: fix godmode behavior. 2020-03-12 05:48:51 +06:00
Andrey Akhmichin
7a58813254 utils: add studio model decompiler. 2020-03-04 09:23:12 +03:00
Alibek Omarov
3d9c482eae host: add -help, fix #136 2020-03-04 08:55:22 +03:00
Alibek Omarov
5d97a293fe menu_int: add DoubleTime extension 2020-03-04 07:23:38 +03:00
Alibek Omarov
3c8ce640c4 Merge neko/mathlib into master 2020-03-04 05:38:30 +03:00
Alibek Omarov
efafd7c01c mainui: update 2020-03-04 05:26:29 +03:00
Alibek Omarov
fb165dfec1 Merge pull request #137 from nekonomicon/imagelib
engine: common: imagelib: split imagelib.h.
2020-03-03 07:12:30 +03:00
Andrey Akhmichin
248c8a745c engine: common: imagelib: split imagelib.h. 2020-03-03 05:03:15 +05:00
Alibek Omarov
7c47bfd0db Merge pull request #122 from nekonomicon/palette
engine: common: imagelib: use rgba_t as RGBA palette type.
2020-03-02 21:44:32 +03:00
Andrey Akhmichin
e96ea719d5 engine: common: imagelib: use rgba_t as RGBA palette type. 2020-03-02 15:07:54 +05:00
Alibek Omarov
17cf4bf402 scripts: travis: we're NOT moved to GitHub Releases 2020-02-28 09:13:33 +03:00
mittorn
04c17995a2 Merge pull request #132 from Velaron/xshlib-fix
scripts/xshlib: line endings fix
2020-02-25 19:44:25 +07:00
mittorn
4994a7ef6f ref_gl: fix build 2020-02-25 19:08:17 +07:00
Aimless Wanderer
e3d9ac4840 scripts/xshlib: line endings fix 2020-02-25 13:35:55 +02:00
mittorn
0c69f7649c ref_gl: add gl4es support 2020-02-25 12:59:04 +07:00
mittorn
84a3f6883d sdl: add EGL hint 2020-02-25 12:59:04 +07:00
mittorn
8f8c8e6614 ref: add export that returns GL_GetProcAddress for renderapi 2020-02-25 12:59:04 +07:00
mittorn
1b4f997951 renderapi: add glcore context and gl4es wrapper 2020-02-25 12:59:04 +07:00
Alibek Omarov
6e6185dba2 readme: wording 2020-02-25 01:43:45 +03:00
Alibek Omarov
1f134fdb72 readme: links to downloads to badges, fix testing build link 2020-02-25 01:37:54 +03:00
Alibek Omarov
64b001a505 Update README.md 2020-02-25 01:34:47 +03:00
Alibek Omarov
5f4d81866f cirrus: update freebsd images 2020-02-25 01:30:29 +03:00
Alibek Omarov
19303f7bd7 game_launch: fix Win32 main 2020-02-24 16:48:30 +03:00
mittorn
a967caa91f Merge pull request #125 from nekonomicon/crtlib
public: crtlib.c: reduce memory usage.
2020-02-18 03:52:36 +07:00
mittorn
3ce16227ba Merge pull request #123 from nekonomicon/tga
engine: common: imagelib: img_tga.c: check pixel type before buffer allocation.
2020-02-18 03:52:09 +07:00
mittorn
3e7351cb33 Merge pull request #127 from nillerusr/custom
imagelib: fix unaligned access
2020-02-18 03:51:13 +07:00
nillerusr
4021d7bf5c imagelib: fix unaligned access 2020-02-17 23:25:39 +03:00
mittorn
68472f90eb filesystem: disable XASH_REDUCE_FD where it not needed, fix null pointer deference 2020-02-14 21:48:26 +07:00
mittorn
7ad658ee3a wscript: increase stack size for owcc 2020-02-12 17:41:24 +07:00
mittorn
0ee5ff3aad waifulib/owcc: add -xx to ignore default includes 2020-02-12 17:39:42 +07:00
Andrey Akhmichin
9a0da3cd4f public: crtlib.c: reduce memory usage. 2020-02-12 14:40:19 +05:00
Andrey Akhmichin
e3b547c8a9 public: rename mathlib to xash3d_mathlib. 2020-02-12 14:32:26 +05:00
mittorn
e602ca1d66 public: synchronize build.h with hlsdk 2020-02-12 15:10:10 +07:00
Andrey Akhmichin
01e2ea24da engine: common: imagelib: img_png.c: add a missing return statement. 2020-02-11 17:06:41 +03:00
Andrey Akhmichin
f5783ae1df engine: common: imagelib: img_tga.c: check pixel type before buffer allocation. 2020-02-11 15:39:05 +05:00
mittorn
49445f0663 wscript: check for fPIC before removing 2020-02-09 01:00:45 +07:00
mittorn
27da2e10ff filesystem: fix const cast 2020-02-09 00:29:56 +07:00
mittorn
7d0e45b507 network: restore WSAsize_t define for win32 2020-02-08 23:59:43 +07:00
mittorn
9b40d91a9b wscript: do not enforce PIC with lib_static 2020-02-08 23:55:56 +07:00
mittorn
02c68c3a70 platform/sdl: add missing Platform_Shutdown 2020-02-08 23:48:52 +07:00
mittorn
a0d09c9954 lib_static: fix warnings 2020-02-08 23:39:35 +07:00
mittorn
c7e3eae9dd filesystem: fix wrong types 2020-02-08 23:38:45 +07:00
mittorn
70cc52e203 posix/sdl: fix build 2020-02-08 23:38:19 +07:00
mittorn
51849c6140 platform: DOS4GW port 2020-02-08 23:15:40 +07:00
mittorn
fe07c48431 port.h: split common and posix defines 2020-02-08 23:15:40 +07:00
mittorn
d8f20f3642 common: add DOS4GW platform 2020-02-08 23:15:40 +07:00
mittorn
828def3b25 waifulib: owcc tool 2020-02-08 23:15:40 +07:00
mittorn
97228a4249 lib_static: use functions for exports instead of globals 2020-02-08 23:15:40 +07:00
mittorn
3e3aff040e platform: add Platfrom_Init, Platform_Shutdown, Platform_MouseMove move platform-specific code from host.c 2020-02-08 23:15:40 +07:00
mittorn
adc718f4d5 public: add XASH_POSIX platform define 2020-02-08 23:15:40 +07:00
mittorn
22c148a39e filesystem: refactor zip/pak loading, partially fix reading files from zip, add option to reduce FD usage, remove dup() dependency 2020-02-08 23:15:40 +07:00
mittorn
70cddcb9ca client: fix assert when sprite exist, but not loadable 2020-02-08 23:15:40 +07:00
mittorn
2b90790071 network: add stub for systems without BSD sockets, WATTCP support 2020-02-08 23:15:40 +07:00
mittorn
070272489d library: fix saverestore offsets code from old engine 2020-02-08 23:15:40 +07:00
mittorn
538d8a6fb4 network: fix NET_MAX_FRAGMENT limit 2020-02-08 23:15:40 +07:00
mittorn
c8be38e75d mathlib: use tgmath in SinCos 2020-02-08 23:15:40 +07:00
mittorn
303a88730c server: fix crash when sorting entities on watcom libc 2020-02-08 23:15:40 +07:00
mittorn
26a1ba543f client: add some useful keys to Key_ToUpper 2020-02-08 23:15:40 +07:00
mittorn
2e2a716710 ref_api: fix remap code 2020-01-30 07:15:23 +07:00
mittorn
4c7e19adeb ref_soft: fix unaligned access 2020-01-25 21:57:49 +07:00
mittorn
59f053b1db ref_soft: fix Werrors 2020-01-25 15:54:56 +07:00
mittorn
dce35f453d wscript: fix build without DLLEMU 2020-01-19 08:28:37 +07:00
mittorn
3a416636f1 engine: mark GAME_EXPORT's 2020-01-19 08:15:54 +07:00
mittorn
bbd033c254 lib: restore dll loader support 2020-01-19 07:38:37 +07:00
mittorn
22dc5b7416 Merge branch 'lib' of https://github.com/FWGS/xash3d-fwgs 2020-01-18 07:15:45 +07:00
AimlessWanderer
40c73719c0 engine: remove useless defines 2020-01-12 03:56:53 +03:00
AimlessWanderer
022792709d engine: fix build 2020-01-12 03:56:53 +03:00
AimlessWanderer
b9ec7ac886 engine: fix dedicated server crash 2020-01-12 03:56:53 +03:00
Alibek Omarov
32eb42a92f wscript: don't error if uninitialized(old compilers like gcc5 have bad heuristics) 2019-12-24 03:56:07 +03:00
Alibek Omarov
5d8b770e6c engine: client: declare CL_Quit_f as noreturn 2019-12-24 02:57:08 +03:00
Alibek Omarov
0fe18ae6dc engine: fix -Wmaybe-uninitialized 2019-12-24 02:47:51 +03:00
Alibek Omarov
d0dbd185ad engine: android: fix enum-conversion 2019-12-23 06:55:00 +03:00
Alibek Omarov
e11a08064d engine: fix implicit-fallthrough, uninitialized, enum-conversation compiler diagnostics 2019-12-23 06:48:17 +03:00
Alibek Omarov
e424112020 engine: don't update screen when we're only in transition from STATE_RUNFRAME to something else 2019-12-23 06:32:39 +03:00
Alibek Omarov
4a56dfcd00 engine: fix extra zeros in %0 2019-12-23 06:29:20 +03:00
Alibek Omarov
6a8cd7090a mainui: update 2019-12-23 02:32:28 +03:00
Aimless-Wanderer
c57d8995c6 wscript: fix syntax
Same as https://github.com/FWGS/hlsdk-xash3d/pull/116
2019-12-10 14:32:52 +03:00
Alibek Omarov
da65cc99d9 travis: don't upload dead APKs [ci skip] 2019-12-03 04:00:11 +03:00
Alibek Omarov
7dde4c03a7 scripts: enable mobile_hacks HLSDK branch for MotoMAGX 2019-12-03 03:49:47 +03:00
Alibek Omarov
326a7d79f0 mainui: update 2019-12-03 03:47:28 +03:00
Alibek Omarov
dd3fcb6461 scripts: fix android travis build 2019-12-03 02:58:03 +03:00
Alibek Omarov
fa90dbbd5e wscript: fix sanitize build 2019-12-03 02:35:23 +03:00
Alibek Omarov
dd1daa5bff engine: correctly validate blueshift maps 2019-12-03 02:27:08 +03:00
Alibek Omarov
154dd5c9ae engine: console: temporarily disable updating screen when something is printed to console, because it can mess up with textures 2019-12-03 02:17:12 +03:00
Alibek Omarov
2ee7367567 scripts: don't symlink engine and hlsdk sources on Android as -sl 2019-12-02 02:15:25 +03:00
Alibek Omarov
3da10f28c4 engine: restored BShift maps support 2019-12-02 02:14:02 +03:00
Alibek Omarov
612e7560ae engine: client: fix r_showtextures 2019-12-02 02:13:41 +03:00
Alibek Omarov
fe362a1ab5 wscript: add incompatible-pointer-types only for C 2019-12-02 02:13:23 +03:00
Alibek Omarov
8399107826 engine: platform: android: remake video backend to use EGL through Java code 2019-12-02 01:01:39 +03:00
Alibek Omarov
077bc7323c engine: host: fix crash 2019-12-02 01:01:39 +03:00
Andrey Akhmichin
6f2b559c5a engine: common: cfgscript.c: change wrong variable type to fix compilation. 2019-12-01 17:30:48 +03:00
Alibek Omarov
fec0a6baf6 engine: platform: android: change package name 2019-12-01 02:17:51 +03:00
Alibek Omarov
ac75bdf2d4 ref_gl: update gl-wes-v2 submodule 2019-12-01 01:42:27 +03:00
Alibek Omarov
56859e03c3 travis: disable hardfp finally, it mostly useless with newer NDK updates 2019-11-29 14:44:24 +03:00
Alibek Omarov
959e10f720 mainui: update 2019-11-28 23:05:17 +03:00
Alibek Omarov
0991255534 engine: dedicated: fix dedicated build 2019-11-28 19:23:34 +03:00
Alibek Omarov
199d3fd422 contrib: remove my personal qtcreator project, as I'm using compile_commands.json support now 2019-11-28 19:21:53 +03:00
Alibek Omarov
c07109e69c engine: fix -Wincompatible-pointer-types, add it to Werror list 2019-11-28 19:18:50 +03:00
Alibek Omarov
08e7bb1bf4 engine: common: enable our own build number counter, move legacy to Q_buildnum_compat 2019-11-28 17:49:14 +03:00
Alibek Omarov
d0010cf9cb engine: don't call SCR_VidInit too soon 2019-11-28 17:43:06 +03:00
Alibek Omarov
ecd675926a engine: cvar: add null checks as these functions are passed to user's DLL 2019-11-26 02:48:16 +03:00
Alibek Omarov
0c3be639c5 engine: reliably tell client.dll about vid mode changes 2019-11-26 02:47:48 +03:00
Alibek Omarov
3a9801853d engine: client: detailed message if menu failed to load 2019-11-26 02:47:25 +03:00
Alibek Omarov
3907be3c8f mainui: update 2019-11-26 02:47:04 +03:00
Alibek Omarov
9421457b3a engine: big refactoring commit, instead of using platform-specific platform-specific macros, use appropriate macros set by public/build.h 2019-11-24 03:52:08 +03:00
Alibek Omarov
ac4a14ef6c engine: host: support DEFAULT_DEV macro 2019-11-24 03:02:12 +03:00
Alibek Omarov
c613118199 defaults: refactoring, remove XASH_FBDEV macro, remove dead macros(DEFAULT_CON_MAXFRAC and DEFAULT_SV_FORCESIMULATING) 2019-11-24 03:01:50 +03:00
Alibek Omarov
755db4d56b backends: reformat 2019-11-24 03:00:35 +03:00
Alibek Omarov
2e180d5548 Documentation: engine-porting-guide: finalize document 2019-11-24 02:31:48 +03:00
Alibek Omarov
bf9840c2a8 mainui: update 2019-11-24 02:12:27 +03:00
Alibek Omarov
f56887bde9 engine: fix rodir, now it always creates gamefolder in rwdir. Fixes #87 2019-11-24 02:12:17 +03:00
Alibek Omarov
23fe1c0985 engine: use appropriate path array length 2019-11-24 02:10:52 +03:00
Alibek Omarov
5266f17d56 Documentation: extensions: library-naming: proper line breaks and links to buildsystem integration for HLSDK 2019-11-20 19:58:43 +03:00
Alibek Omarov
744f75d4a3 engine: linux: simplify Platform_DoubleTime 2019-11-20 16:45:55 +03:00
mittorn
37435365e2 platform/posix: fix _GNU_SOURCE define in lib_posix 2019-11-18 23:48:49 +07:00
mittorn
94fc0febc7 fix some comments 2019-11-18 21:13:21 +07:00
mittorn
6f58ef2394 scripts/xshlib: code clean 2019-11-18 21:08:03 +07:00
mittorn
177f8ed653 platform: introduce lib backends, add static linking, wscript: add optional projects support, add static linking support, scripts: add xshlib for advanced linking options 2019-11-18 03:31:55 +07:00
Alibek Omarov
09203dc512 ref_gl: temporarily fix water drawing on GLES 2019-11-17 18:51:39 +03:00
Alibek Omarov
3c3d5d472e ref_gl: bring back glDrawRangeElements support 2019-11-17 18:51:03 +03:00
Alibek Omarov
4c6e64c89b mainui: update 2019-11-17 18:05:12 +03:00
Alibek Omarov
7afee98f99 engine: ref: check if refdll was initialized before freeing texture 2019-11-17 18:05:05 +03:00
Alibek Omarov
f562926aaa Documentation: Xash3D FWGS Engine porting guide, not finished 2019-11-15 17:25:24 +03:00
Alibek Omarov
b25c83edc4 Documentation: ports: define MotoMAGX port as supported 2019-11-15 17:23:55 +03:00
Alibek Omarov
c42b5e043d Documentation: input-interface: split Russian translation to new file 2019-11-15 14:48:29 +03:00
Alibek Omarov
1e5921d33f Documentation: move FWGS engine extensions to appropriate folder [ci skip] 2019-11-15 14:42:52 +03:00
Alibek Omarov
663344eeaa Create supported-mod-list.md [ci skip] 2019-11-15 14:38:04 +03:00
Alibek Omarov
e4e34cc835 Create input-interface.md [ci skip] 2019-11-15 14:08:40 +03:00
Alibek Omarov
b36fc0e2ae Create console-scripting.md [ci skip] 2019-11-15 14:07:35 +03:00
Alibek Omarov
924d6ada60 Create public-server-rules-and-recommendations.md [ci skip] 2019-11-15 14:06:26 +03:00
Alibek Omarov
8343cadd30 Create mod-porting-guide.md 2019-11-15 14:01:14 +03:00
Alibek Omarov
0636dc45bd engine: sdl: fix resizing event handling 2019-11-12 02:04:18 +03:00
Alibek Omarov
611ee64cd9 scripts: build_motomagx_engine: use waf install now, as HLSDK now supports library naming scheme 2019-11-11 04:14:18 +03:00
Alibek Omarov
5a17e7f425 build: add XASH_ARMvX defines(buildsystem integration), add oneliner to generate #undef list 2019-11-11 00:38:40 +03:00
Alibek Omarov
db39f0cc88 engine: client: combine loading or paused icon drawing 2019-11-08 01:28:01 +03:00
Alibek Omarov
3f48bce7da engine: client: fix #79 2019-11-08 01:09:55 +03:00
Alibek Omarov
936b491248 engine: dedicated: remove unused stub 2019-11-08 01:09:55 +03:00
Alibek Omarov
428e8ef427 engine: server: simplify game saving code, hide GL_FreeImage under XASH_DEDICATED macro 2019-11-08 01:09:55 +03:00
tyabus
934dffd273 engine: common: fix message formating 2019-11-07 23:26:11 +03:00
Andrey Akhmichin
0c34a5081c engine: client: make the code that generates screenshots and demos names simpler. 2019-11-07 23:12:34 +03:00
Alibek Omarov
f09682131f travis: fix magx deploy 2019-11-07 08:41:10 +03:00
Alibek Omarov
32ddc2a47f waifulib: xcompile: we need to disable builtins even on armeabi with host compiler and NDK r10e 2019-11-07 07:30:41 +03:00
Alibek Omarov
729f534614 waf: third msvc test 2019-11-07 07:19:08 +03:00
Alibek Omarov
6937d0c17e travis: fix unpacking r10e, add clang-9 2019-11-07 07:13:28 +03:00
Alibek Omarov
4dba8219ca waf: another msvc test 2019-11-07 07:05:31 +03:00
Alibek Omarov
f8b0ec8c4b wscript: tune-up options for magx 2019-11-07 06:56:07 +03:00
Alibek Omarov
ce20da28e1 travis: reorder tasks depending on their breakability. Use r10e for Android and host toolchain 2019-11-07 06:55:40 +03:00
Alibek Omarov
40ed87d8de waf: msvc test 2019-11-07 06:54:42 +03:00
Alibek Omarov
5bae732818 scripts: build ref_soft for magx 2019-11-07 05:15:45 +03:00
Alibek Omarov
08b3de08e7 wscript: use SINGLE_BINARY on motomagx 2019-11-07 05:07:28 +03:00
Alibek Omarov
a51c5d93fc Revert "game_launch: check for Platform_Main before Host_Main"
This reverts commit 6aa61657e0.
2019-11-07 05:06:51 +03:00
Alibek Omarov
55dbb2ca3f Revert "game_launch: fix start up"
This reverts commit a46e459124.
2019-11-07 05:06:43 +03:00
Alibek Omarov
4b930c7854 Revert "engine: platform: magx: add pre-init platform-specific hook"
This reverts commit 2958b14cc2.
2019-11-07 05:06:24 +03:00
Alibek Omarov
d68823708f scripts: include run.sh script for magx 2019-11-07 05:01:16 +03:00
Alibek Omarov
4b5d09a968 travis: rename build 2019-11-07 04:52:13 +03:00
Alibek Omarov
7e4a7ac23d wscript: workaround bug when CC_VERSION is not set for msvc 2019-11-07 04:49:49 +03:00
Alibek Omarov
62cdf2ae5b engine: input: hide SDL_ functions under XASH_SDL macro 2019-11-07 04:44:24 +03:00
Alibek Omarov
94c42160b7 travis: enable CI for motomagx 2019-11-07 02:46:04 +03:00
Alibek Omarov
18bbfebc5d mainui: update 2019-11-07 02:22:35 +03:00
Alibek Omarov
d18cb1f74c wscript: add special options for fast build type for gcc3 2019-11-07 02:20:17 +03:00
Alibek Omarov
2807841511 waf: update to latest waifu revision 2019-11-07 02:19:21 +03:00
Alibek Omarov
13ed8d4529 wscript: move motomagx options to root wscript, disable PIC for this old machine, set default options 2019-11-06 23:14:20 +03:00
Alibek Omarov
1ff06c2c1e mainui: update 2019-11-06 22:32:30 +03:00
Alibek Omarov
0cb591821a Merge sdl12-port into master 2019-11-06 22:29:04 +03:00
Alibek Omarov
8700f44175 public: unittest: use static everywhere to prevent collision when tests may be linked into engine 2019-11-05 11:35:39 +03:00
Alibek Omarov
6ba73a732a mainui: update 2019-11-05 11:23:56 +03:00
Alibek Omarov
4b97d8bcda public: add simple C89-compatible testing framework (wip) 2019-11-05 11:22:16 +03:00
Alibek Omarov
0dc6f1674f mainui: updatr 2019-11-05 09:50:01 +03:00
Alibek Omarov
6bc6f0dd70 scripts: run windows builds verbose 2019-11-05 09:41:58 +03:00
Alibek Omarov
39abd82e5d wscript: silence MSVC tgmath nonsense 2019-11-05 09:41:26 +03:00
Alibek Omarov
15924aebaa xash3d-fwgs: check if HAVE_TGMATH_H is set to positive value rather it's just defined 2019-11-05 01:41:35 +03:00
Alibek Omarov
b79c95d295 engine: wscript: fix typo, use pthreads.py tool 2019-11-05 01:40:06 +03:00
Alibek Omarov
453c0d890d engine: wscript: rename fbdev to enable-fbdev for great consistency, check definition instead of putting vars into env 2019-11-05 01:35:20 +03:00
Alibek Omarov
60f0f68e68 Merge remote-tracking branch 'origin/master' 2019-11-05 01:16:39 +03:00
Alibek Omarov
79adaa11e0 lowmemory: merge 2019-11-05 01:15:31 +03:00
Alibek Omarov
6819050d91 waf: upgrade to latest waifu revision 2019-11-05 01:15:03 +03:00
Alibek Omarov
d2740f78c1 wscript: refactoring, add waf_unit_test, disable -Wdouble-promotion, rename fast as fastnative and leave fast without -march=native for x-compiling 2019-11-05 01:01:33 +03:00
mittorn
d4efb55492 ref_soft: lowmemory: prevent redefines 2019-11-04 22:39:22 +07:00
mittorn
6953e829c4 lowmemory: prevent redefines 2019-11-04 22:34:08 +07:00
mittorn
ef270eb642 ref_soft: update ref api 2019-11-04 22:12:09 +07:00
mittorn
d1af73bfcb ref_soft: image: fix wrong alpha buffer 2019-11-04 22:11:11 +07:00
mittorn
1365020302 ref: add enum for screen rotation 2019-11-04 20:27:46 +07:00
mittorn
0e7013eeb0 lowmemory: tune XASH_LOW_MEMORY=1 not breaking multiplayer 2019-11-04 19:58:45 +07:00
mittorn
a3a0db447b ref_soft: draw: check screen bounds in Draw_Fill 2019-11-03 19:09:41 +07:00
Alibek Omarov
a46e459124 game_launch: fix start up 2019-11-02 08:56:07 +03:00
Alibek Omarov
dfed24c290 public: build: add new ARMv6 detect macro 2019-11-02 08:56:07 +03:00
Alibek Omarov
1f308a43c8 engine: fix build after lowmemory rebase 2019-11-02 08:56:07 +03:00
Alibek Omarov
2062e55c6a lowmemory: cut up netgraph buffers 2019-11-02 08:56:07 +03:00
Alibek Omarov
90038d2924 common: fix broken build 2019-11-02 08:56:07 +03:00
Alibek Omarov
9aff6ca633 engine: wscript: support building for MotoMAGX 2019-11-02 08:56:07 +03:00
Alibek Omarov
6aa61657e0 game_launch: check for Platform_Main before Host_Main 2019-11-02 08:56:07 +03:00
Alibek Omarov
2958b14cc2 engine: platform: magx: add pre-init platform-specific hook 2019-11-02 08:56:07 +03:00
Alibek Omarov
aa6674b032 engine: support compiling with gcc3 2019-11-02 08:56:07 +03:00
Alibek Omarov
7a7bca2991 engine: wscript: always add librt on linux if it was checked before 2019-11-02 08:56:07 +03:00
Alibek Omarov
7e9f90a09d public: fix detecting ARM on gcc3 2019-11-02 08:56:07 +03:00
Alibek Omarov
5e8373fa46 engine: slightly update RefAPI 2019-11-02 08:56:07 +03:00
Alibek Omarov
9d826016b0 engine: finish sdl1.2 port 2019-11-02 08:56:07 +03:00
Alibek Omarov
7f1dd248c2 backends: add XASH_MESSAGEBOX to specify messagebox platform implementation 2019-11-02 08:56:07 +03:00
Alibek Omarov
4d5e7c0557 platform: minify changes, use SDL_VERSION_ATLEAST macro(left unfinished) 2019-11-02 08:56:07 +03:00
Alibek Omarov
9e99a2bc37 engine: dirty sdl1.2 port 2019-11-02 08:56:07 +03:00
Alibek Omarov
8dafbaeda2 engine: platform: sdl: dirty wip sdl1.2 port 2019-11-02 08:56:07 +03:00
Alibek Omarov
ae35f15f15 engine: wscript: add option to build against sdl1.2 2019-11-02 08:56:07 +03:00
Alibek Omarov
0dd91ceda2 xash3d-fwgs: append missing new line at the end of file 2019-11-02 08:56:07 +03:00
mittorn
d6f8112860 gameinfo: add MIN_EDICTS constant instead of magic number 600, low it to 64 2019-11-02 12:46:11 +07:00
mittorn
3589537147 ref_soft: lowmemory: use ushort for r_leafkeys 2019-11-02 12:43:45 +07:00
Alibek Omarov
26b8a1fe1d ref_soft: blit: restore height for bpp 16 and 32 2019-11-02 04:44:37 +03:00
mittorn
a1db6c6a9b lowmemory: remove datagram limit 2019-11-01 13:49:53 +07:00
mittorn
271d15f989 client: prevent precache overflow 2019-11-01 13:41:30 +07:00
Aimless-Wanderer
00e5d42459 platform: android: fix macros 2019-10-31 18:42:34 +03:00
mittorn
291fdfac68 platform/evdev: add some keys, add keyevent debug 2019-10-31 13:22:58 +07:00
mittorn
5e31e3fad0 keys: rotation support 2019-10-31 13:22:58 +07:00
mittorn
609235b4f1 ref_soft: fix texcoords on image blitting 2019-10-31 01:52:38 +07:00
mittorn
b3ad557dd2 ref_soft: update api, display rotation support 2019-10-31 01:43:40 +07:00
mittorn
7f6395fa7d ref: display transformation API 2019-10-31 01:36:07 +07:00
Alibek Omarov
aee9f454fc Documentation: update ports.md, include @masterfeizz 3DS port, add new ports, stabilize ARM and Android ports although we aren't released yet 2019-10-30 17:10:55 +03:00
Alibek Omarov
e3c3b05396 engine: platform: android: don't check if XASH_ENGLIBDIR and XASH_GAMELIBDIR are null. Load library by direct path if PATH_SPLITTER was found. Partially fixes #74 2019-10-30 16:55:00 +03:00
Alibek Omarov
6e637456ef platform: define platform-specific posix-compatible library loaders as macros to reduce macros hell in lib_posix.c 2019-10-30 16:46:18 +03:00
mittorn
9c7c279a5b ref_soft: XASH_LOW_MEMORY 2019-10-29 13:16:16 +07:00
mittorn
5e5ffec67d lowmemory: tweak some protocol limits for HL1, restore bit counts (maybe even restore multiplayer compatibility) 2019-10-29 11:35:02 +07:00
mittorn
06cadacb59 lowmemory: cut resources array for legacy mode, only related to downloads 2019-10-29 11:32:32 +07:00
mittorn
cb8e0a50bc lowmemory: reduce MAX_QPATH 2019-10-29 11:30:57 +07:00
mittorn
b3a5283517 lowmemory: rename waf options 2019-10-28 12:31:29 +07:00
mittorn
5348046109 lowmemory: increase decals limit 2019-10-28 12:29:44 +07:00
mittorn
57d48b64eb keys: add OSK 2019-10-28 12:28:52 +07:00
mittorn
5145b1956c zone; revert removing clean check 2019-10-28 12:25:20 +07:00
mittorn
bb48e5209e console: fix wrong line width on start, remove some hard-coded sizes 2019-10-28 12:14:19 +07:00
mittorn
37cba10c14 lowmemory: fix sentences 2019-10-28 12:07:15 +07:00
Alibek Omarov
1decb1c7fb xash3d-fwgs: append missing new line at the end of file 2019-10-27 22:29:03 +03:00
mittorn
ba1347a8ce wscript: add options for low memory, async ns resolve and swap allocator 2019-10-26 12:12:59 +07:00
mittorn
feb01b270e zone, platform: add swap allocator 2019-10-26 12:10:50 +07:00
mittorn
114a256675 Implement XASH_LOW_MEMORY, memory-reduced configuration 2019-10-26 07:06:26 +07:00
mittorn
2897e5f17e input: fix evdev macro 2019-10-26 06:53:24 +07:00
mittorn
6723758edc platform/alsa: fix case when buffer size is POT, improve latency, calculate sample count 2019-10-26 05:49:23 +07:00
mittorn
23956a0b82 platform: alsa support 2019-10-25 09:04:52 +07:00
Alibek Omarov
93a43ae9a5 mainui: update 2019-10-24 12:45:27 +03:00
Alibek Omarov
8905e7cbb7 wscript: fix stdin input wasn't enabled for dedicated. Fix single-binary help string 2019-10-23 20:47:49 +03:00
iZarif
bf8b87c29d engine: client/common: fix a few more format warnings 2019-10-22 17:56:08 +03:00
mittorn
803c396fa2 platform: new fbdev bakend, move in_evdev to bakends 2019-10-22 01:42:02 +07:00
Alibek Omarov
0933261898 wscript: oops, remove trailing colon 2019-10-18 16:46:54 +03:00
Alibek Omarov
e93d362391 wscript: explicitly undefine HAVE_TGMATH_H if tests are failed 2019-10-18 16:46:54 +03:00
Alibek Omarov
2b13de80bf wscript: check if tgmath actually compiles, should fix building under freebsd 2019-10-18 16:46:54 +03:00
Alibek Omarov
2c67f4cb39 wscript: fix wrong object method call 2019-10-18 16:46:54 +03:00
Alibek Omarov
4705683ebc wscript: conf.define instead of directly appending to DEFINES 2019-10-18 16:46:54 +03:00
Alibek Omarov
78baf568ae engine: more double promotion fixes 2019-10-18 16:46:54 +03:00
Alibek Omarov
1218f4aeb6 ref_gl: explicitly cast literals to floats 2019-10-18 16:46:54 +03:00
Alibek Omarov
531c6cc375 engine: server: explicitly cast literals to floats 2019-10-18 16:46:54 +03:00
Alibek Omarov
edf3fcd398 engine: common: explicitly cast literals to floats, include tgmath when needed 2019-10-18 16:46:54 +03:00
Alibek Omarov
c67f065d90 engine: client: explicitly cast literals to floats 2019-10-18 16:46:54 +03:00
Alibek Omarov
148846c02d common: explicitly cast literals to floats 2019-10-18 16:46:54 +03:00
Alibek Omarov
8afb2dbdec wscript: better tgmath check, make double-promotion not an error 2019-10-18 16:46:54 +03:00
Alibek Omarov
14be566401 public: include tgmath in mathlib.h, so macros will be used inside Vector macros 2019-10-18 16:46:54 +03:00
Alibek Omarov
0577ecbccf public: initial fix of double promotion 2019-10-18 16:46:54 +03:00
Alibek Omarov
880dd2546f engine: client: fix wrong type in DSP 2019-10-18 08:11:05 +03:00
Alibek Omarov
c2063c869d engine: client: fix demoplayback type from qboolean to int(can exceed false and true) 2019-10-18 08:04:00 +03:00
Alibek Omarov
49a133514a ref_gl: fix wrong type 2019-10-18 07:51:11 +03:00
Alibek Omarov
94dc801150 scripts: remove single-binary for xashds, as it already set implicitly. 2019-10-18 07:45:05 +03:00
Alibek Omarov
fe118e9683 ci: disable dedicated build for freebsd at now 2019-10-18 07:36:03 +03:00
Alibek Omarov
e0d993a5a8 public: fix tautological-compare 2019-10-18 07:23:34 +03:00
Alibek Omarov
cf35943f51 scripts: build_freebsd_engine: remove building SDL2, as it will be installed from ports, use /bin/sh as interpreter 2019-10-18 07:13:48 +03:00
Alibek Omarov
cd715178d2 scripts: set executable flags when needed 2019-10-18 07:05:16 +03:00
Alibek Omarov
869b684536 wscript: remove multicheck for win32 libs, remove sdl2 checking from main wscript 2019-10-18 06:35:05 +03:00
Alibek Omarov
bc56ce754b wscript: move C only flags from common flags, correct multicheck again 2019-10-18 06:20:27 +03:00
Alibek Omarov
32897450fc wscript: declare uselib_store for multicheck 2019-10-18 05:41:56 +03:00
Alibek Omarov
e0e9942bd5 waifulib: remove modules that now part of waifu distribution 2019-10-18 05:14:01 +03:00
Alibek Omarov
fdbd1c5658 wscript: check win32 libraries in parallel 2019-10-18 05:11:18 +03:00
Alibek Omarov
eaf983c054 wscript: remove BIT32_ALLOW 2019-10-18 05:06:10 +03:00
Alibek Omarov
e11eeb24fc waf: upgrade to waifu 1.0.0 2019-10-18 05:05:29 +03:00
Alibek Omarov
6dcd8c3af8 travis: fix amd64 linux build 2019-10-18 05:05:11 +03:00
Alibek Omarov
d68eab6b65 ci: autoconfirm for pkg installg 2019-10-16 02:35:35 +03:00
Alibek Omarov
8ec6eaa49a ci: try to install needed dependencies for freebsd 2019-10-16 02:27:24 +03:00
Alibek Omarov
a38f561d7c ci: use SDL2 zip source archive 2019-10-16 02:18:12 +03:00
Alibek Omarov
cb404b2730 cI: borrow image names from rust-lang/libc 2019-10-16 02:11:26 +03:00
Alibek Omarov
83d3c02e53 ci: add Cirrus CI support with FreeBSD 2019-10-16 02:09:47 +03:00
mittorn
f376d5d59c ref_soft: glblit: gles3 pbo+fbo blitter 2019-10-13 03:52:47 +07:00
mittorn
2493659b23 ref_soft: glblit: change projection scale 2019-10-12 22:36:21 +07:00
mittorn
e1efacb399 ref_soft: glblit: GLES1 blitter 2019-10-12 14:11:55 +07:00
mittorn
05d793c34b ref_soft: glblit: refactor 2019-10-12 04:18:05 +07:00
mittorn
86867dcbe3 ref_soft: restore fallback gl1 blitter (force enable with -glblit) 2019-10-12 04:05:23 +07:00
Alibek Omarov
8be58bcd21 engine: android: fix EGL context create error condition 2019-10-11 17:36:56 +03:00
Alibek Omarov
06e38b45c8 engine: android: don't throw host error when initializing software renderer on Android 2019-10-11 11:53:52 +03:00
Alibek Omarov
d3dd671759 engine: android: quick hack to load libraries on aarch64 until we don't symlinking lib folder 2019-10-11 11:50:21 +03:00
Alibek Omarov
e0b8c338a8 engine: ref: more verbose refdll loading 2019-10-11 11:46:59 +03:00
Alibek Omarov
ee363ebb74 waifulib: fix including system includes 2019-10-11 10:04:32 +03:00
Alibek Omarov
e4bb3ecd12 travis: use r20 for softfp build 2019-10-11 09:38:44 +03:00
Alibek Omarov
d05bfb55c5 travis: forgot to upload softfp test 2019-10-11 09:22:28 +03:00
Alibek Omarov
9c26983136 travis: enable softfp build with poly opt 2019-10-11 09:16:21 +03:00
Alibek Omarov
fa622168a0 engine: fix style, disable XASH_USE_SELECT 2019-10-11 08:51:30 +03:00
Alibek Omarov
eff814b148 engine: ref: remove redutant continue, return false in case of failed renderer initialization 2019-10-11 07:57:59 +03:00
Alibek Omarov
11c373a183 waf: upgrade to latest waifu 2019-10-11 07:40:40 +03:00
Alibek Omarov
898b697b70 engine: ref: allow to set r_refdll or -ref with ref_ prefix 2019-10-11 05:36:17 +03:00
Alibek Omarov
6d8026cd81 engine: ref: fix spamming in console when getting human readable renderer names 2019-10-11 05:11:45 +03:00
Alibek Omarov
1e7abdc144 wscript: fix ref_gl linking 2019-10-11 04:21:35 +03:00
Alibek Omarov
ff1b28244b engine: client: port ui_renderworld from old engine 2019-10-11 04:12:52 +03:00
Alibek Omarov
7782fa09ac wscript: refactor cflags appending, add optional polyhedral optimizations 2019-10-11 04:12:07 +03:00
Alibek Omarov
ae624801ac wscript: proper default showing in help 2019-10-11 03:46:17 +03:00
Alibek Omarov
8889bda261 wscript: use ConfigurationContext.define instead of appending to env['DEFINES'] 2019-10-11 03:42:20 +03:00
Alibek Omarov
c8eac04e9b ref_soft: fix double promotion 2019-10-10 06:23:57 +03:00
Alibek Omarov
a5fa4df37c ref_gl: fix wrong texture resampling condition 2019-10-10 06:02:26 +03:00
Alibek Omarov
d96dcfba59 ref_soft: fix different warnings 2019-10-10 05:55:44 +03:00
Alibek Omarov
690a317f4f ref_soft: fix style errors 2019-10-10 05:32:20 +03:00
Alibek Omarov
9c4a0d2397 ref_soft: context: upgrade to latest RefAPI 2019-10-10 05:32:01 +03:00
Alibek Omarov
2183240221 waifulib: xcompile: fix aarch64 binary installation 2019-10-09 05:52:43 +03:00
Alibek Omarov
33800954ec travis: fix mistyped ARCHS for Android 64 2019-10-09 05:21:09 +03:00
Alibek Omarov
67cb5a4dde travis: fix mistyped ARCHS 2019-10-09 04:47:11 +03:00
Alibek Omarov
9fd7e333df travis: another blind try to fix r10e unpack 2019-10-09 04:37:38 +03:00
Alibek Omarov
a9628cc0f0 travis: install lld-8 also 2019-10-09 04:10:34 +03:00
Alibek Omarov
f33de46508 travis: verbose 7z x for r10e ndk 2019-10-09 04:08:34 +03:00
Alibek Omarov
595d452c23 travis: s/p7zip/p7zip-full/g 2019-10-09 04:00:13 +03:00
Alibek Omarov
911e670be6 travis: install p7zip to be able to unpack r10e ndk 2019-10-09 03:51:58 +03:00
Alibek Omarov
9ea973dad6 waifulib: xcompile: fix C++ with host toolchain 2019-10-09 03:48:51 +03:00
Alibek Omarov
fcdd45341c travis: switch to clang-8 for android host build 2019-10-09 02:52:59 +03:00
Alibek Omarov
53d2d10932 travis: add Android 64 and Android hardfp experimental builds 2019-10-09 02:34:30 +03:00
Wei Mingzhi
88772a1c34 engine: GetGameDir should return gamedir only. Add proper stub functions for some engine APIs. 2019-10-07 16:08:10 +03:00
Alibek Omarov
1c21590e96 travis: set android autobuilds as release to have high optimization 2019-10-06 09:23:14 +03:00
Alibek Omarov
d2a8cfe614 Revert "engine: client: implement connectionprogress partially"
This reverts commit cb417a3d51.

This commit breaks demo playback. Figure out why, then revert it back.
2019-10-06 07:45:32 +03:00
Alibek Omarov
39ff3b199a wscript: fix LTO check scope 2019-10-06 06:58:45 +03:00
Alibek Omarov
ddf070b63d ref_gl: fix build 2019-10-06 06:55:16 +03:00
iZarif
4c559a4a08 wscript: add --enable-lto option 2019-10-06 06:10:06 +03:00
Alibek Omarov
fa16c49246 readme: sligthly update contributing guidelines 2019-10-06 03:49:46 +03:00
Alibek Omarov
d382f6886d engine: fix build 2019-10-05 04:02:25 +03:00
Alibek Omarov
02e111c5e1 waifulib: xcompile: fix clang detection 2019-10-05 03:35:11 +03:00
Alibek Omarov
73516eea4c ref_gl: update glwesv2 submodule 2019-10-05 03:34:52 +03:00
Alibek Omarov
6e2dbd4e1c engine: android: get rid of VLA 2019-10-05 03:33:13 +03:00
Alibek Omarov
67cdbef833 engine: fix signed char in studio 2019-10-05 03:33:00 +03:00
Alibek Omarov
d6bb72f772 engine: dedicated: fix old-style-definitions 2019-10-05 03:17:38 +03:00
Alibek Omarov
e6dd4882cc wscript: more paranoic Werrors 2019-10-05 03:06:51 +03:00
Alibek Omarov
cb62e65f9f public: fix implicit fallthrough 2019-10-05 02:49:04 +03:00
Alibek Omarov
cb5e282af4 engine: sequence: fix condition 2019-10-05 02:22:46 +03:00
Alibek Omarov
b175d8a0cb engine: net_encode: due to bug in GCC <9, disable duplicated-branches here 2019-10-05 02:22:10 +03:00
Alibek Omarov
fbb88a55cb engine: linux: fix C89 2019-10-05 02:10:46 +03:00
Alibek Omarov
f3a40ac794 engine: cfgscript: fix userinfo cvars wrong dump to config 2019-10-05 02:10:09 +03:00
Alibek Omarov
dc207a449c engine: fix -Werror=strict-prototypes 2019-10-05 02:09:45 +03:00
Alibek Omarov
5a8de90918 waifulib: xcompile: light refactoring 2019-10-05 01:16:20 +03:00
Alibek Omarov
2d6b770e7c waifulib: xcompile: allow building with host Clang and NDK r10e sysroot 2019-10-04 22:21:11 +03:00
Aimless Wanderer
409eee3bb4 engine: fix gameinfo parsing 2019-10-04 11:58:14 +03:00
Alibek Omarov
ac5bb86301 travis: nah, I don't have wish to experiment with yaml trash 2019-09-29 19:02:11 +03:00
Alibek Omarov
530d376c44 travis: push newengine branch at deploy higher 2019-09-29 18:43:53 +03:00
Alibek Omarov
b777ba9549 scripts: comment out github releases deployment until github fixes itself 2019-09-29 18:39:33 +03:00
Alibek Omarov
bc39b707d4 Revert github repository deploy removal 2019-09-29 18:38:31 +03:00
mittorn
cb0791c915 http: do not continue after HTTP_Free, fix potential buffer overflow 2019-09-29 01:42:17 +07:00
mittorn
03c73f56d2 waf: add linkflags before filtering cflags 2019-09-29 01:42:17 +07:00
Alibek Omarov
94d0c78913 ref_gl: update gles2 wrapper 2019-09-28 21:17:16 +03:00
mittorn
34463dcddc ref_gl: fix glConfig.max_texture_units when GL_MAX_TEXTURE_UNITS_ARB query not supported 2019-09-28 21:13:38 +07:00
mittorn
da11da97ad android: enable touch support 2019-09-28 20:09:26 +07:00
mittorn
c0043a5467 touch: implement wheel 2019-09-28 19:35:30 +07:00
mittorn
7770b1a82b input: improve touch emulation 2019-09-28 19:33:57 +07:00
mittorn
faf592adb4 waf: filter_cflags does not work with msvc 2019-09-28 04:59:09 +07:00
mittorn
0aa57854ca waf: fix unwanted required_flags modification 2019-09-28 04:36:08 +07:00
mittorn
fd8c1becec waifulib: gcc-6 support for android 2019-09-28 04:26:19 +07:00
mittorn
0afc3d83c6 android: add stub for Platform_PreCreateMove 2019-09-28 04:26:19 +07:00
mittorn
d633fe5deb waf: add cflags detection, make some warning flags optional 2019-09-28 04:26:19 +07:00
Alibek Omarov
5040cb83d0 engine: win32: lib: oops, fix wrong sizeof 2019-09-27 17:02:04 +03:00
Alibek Omarov
2b385ff1f4 engine: win32: lib: try to fix crash when checking dependencies 2019-09-27 16:56:20 +03:00
Alibek Omarov
cd5028eed1 ci: move signing to android project, don't call it here 2019-09-27 05:35:16 +03:00
mittorn
3ce014d5f5 ci: sign apk and fix filename 2019-09-27 02:58:17 +07:00
mittorn
75aaf1c66d ci: try fix upload 2019-09-27 02:47:44 +07:00
mittorn
26401a4fbf ci: enable android build upload 2019-09-27 02:33:00 +07:00
mittorn
dba757f0c2 touch: fix wrong dx/dy sign 2019-09-27 02:25:38 +07:00
mittorn
7f3ee9ca71 input: merge touch support again. Fix m_ignore, fix EngineAppendMove 2019-09-27 02:19:03 +07:00
mittorn
9a1414505a imagelib: support for 16-bit transparent tga 2019-09-27 02:12:35 +07:00
Alibek Omarov
13c1e807ad engine: s_mouth: fix another signed char 2019-09-25 04:10:47 +03:00
Alibek Omarov
6e95e19589 submodules: update 2019-09-25 04:09:48 +03:00
Alibek Omarov
8f47596ad0 waifulib: xcompile: append SONAME to shared libraries, experimental support for host compiling with NDK r10e(don't work), replace exceptions with fatal messages 2019-09-21 03:52:47 +03:00
Alibek Omarov
4f4c63b1dd waifulib: xcompile: enhance compiling using host clang, refactoring 2019-09-20 18:49:37 +03:00
Alibek Omarov
66323fe9ca waifulib: xcompile: preserve order of MACROS_TO_DESTOS, add -stdlib=libstdc++ to use system provided C++ standard library 2019-09-20 16:30:17 +03:00
Alibek Omarov
16e60bbb5f waifulib: xcompile: use llvm-strip on host 2019-09-19 18:18:42 +03:00
Alibek Omarov
0389d2495f waifulib: strip_on_install: add changed bytes counter 2019-09-19 18:18:25 +03:00
Alibek Omarov
4049c54511 engine: android: fix video backend not compiled 2019-09-19 18:17:56 +03:00
Alibek Omarov
e8006c3253 engine: move ShellExecute to client, as it cannot be used in dedicated 2019-09-19 17:09:18 +03:00
Alibek Omarov
07aa9595c0 engine: android: allow building dedicated on Android 2019-09-19 17:09:18 +03:00
Alibek Omarov
b91e97ca53 wscript: remove DEST_OS2 2019-09-19 17:09:18 +03:00
Alibek Omarov
cd0f7af38a waifulib: xcompile: get rid of DEST_OS2 2019-09-19 17:09:18 +03:00
Alibek Omarov
ac1bf4a9f8 waifulib: strip_on_install: fix typo 2019-09-12 17:00:08 +03:00
Alibek Omarov
af0046f401 waifulib: strip_on_install: don't strip on PE and unknown binaries [ci skip] 2019-09-11 20:37:47 +03:00
Alibek Omarov
43575b485d wscript: add an option to not strip binaries 2019-09-11 20:26:34 +03:00
Alibek Omarov
67c6cfce71 waf: strip installed binaries to reduce size 2019-09-11 18:47:44 +03:00
Alibek Omarov
5986874be2 wscript: enable clang_compilation_database in options 2019-09-10 10:30:03 +03:00
Alibek Omarov
cf17b4f63c waf: update binary waf 2019-09-10 10:27:42 +03:00
Alibek Omarov
d1ac48b2a1 waifulib: allow compiling using host clang and NDK sysroots, thus enabling building engine from any environment that has clang(termux as example) 2019-09-10 11:24:11 +06:00
Alibek Omarov
3032ce3bee engine: android: fix building dlsym_weak on latest NDK 2019-09-10 11:15:48 +06:00
Alibek Omarov
ba69f9e62a travis: comment osx autobuilds #61 2019-08-10 14:47:35 +03:00
Alibek Omarov
8323df240b engine: implement menu extensions to allow choosing renderers from GUI 2019-08-09 04:44:50 +03:00
Alibek Omarov
a1ae770f70 engine: ref: add optional export to determine actual human readable renderer name 2019-08-09 03:39:24 +03:00
Alibek Omarov
56938344b8 engine: win32: include shellapi.h 2019-08-09 03:07:56 +03:00
Alibek Omarov
a862e641f1 game_launch: fix build on windows 2019-08-09 02:59:40 +03:00
Alibek Omarov
00b9ac676e engine: win32: fix inconsistent dll linkage 2019-08-09 02:51:15 +03:00
Alibek Omarov
8bb6aa2c51 engine: don't include windows headers, as they globally included by port.h already 2019-08-09 02:46:29 +03:00
Alibek Omarov
505392c2f8 imagelib: png: include correct winsock 2019-08-09 02:35:53 +03:00
Alibek Omarov
37f9c25212 port: include winsock2 explicitly, so winsock1 would not be included with windows.h 2019-08-09 02:28:28 +03:00
Alibek Omarov
ee2c1ad8fa engine: net_ws: include engine headers first 2019-08-08 16:09:32 +03:00
Alibek Omarov
7771356e66 engine: net_ws: fix dedicated build 2019-08-08 07:33:47 +03:00
Alibek Omarov
cb417a3d51 engine: client: implement connectionprogress partially 2019-08-08 07:19:08 +03:00
Alibek Omarov
01dcb52b4c mainui: update submodule, add connectionprogress calls to engine 2019-08-08 07:18:02 +03:00
Alibek Omarov
24adb6e3e0 ref_gl: update wrappers 2019-08-08 05:57:33 +03:00
Alibek Omarov
d992f8525b ref_gl: enable VBO for GLES targets, slightly refactor extensions checking, fix UB when initializing glwes 2019-08-08 05:53:34 +03:00
Alibek Omarov
7be094b563 sdl: vid: prevent infinite recursion if SDL failed create window with selected GL attributes 2019-08-03 19:01:35 +03:00
Alibek Omarov
386a68e334 engine: fix wrong function called on closing socket on Win32 2019-07-30 18:41:24 +03:00
Alibek Omarov
ca57c8424d filesystem: follow C89 2019-07-30 18:20:54 +03:00
Jonathan Poncelet
214f53b8a7 SV_DropClient: Prevented transmission to fake clients 2019-07-30 15:46:10 +03:00
Alibek Omarov
143310bdb7 travis: android: make it more quiet 2019-07-29 08:31:38 +03:00
Alibek Omarov
dc8b8ccab3 travis: android: accept all licenses 2019-07-29 08:27:11 +03:00
Alibek Omarov
e3c095a3fa travis: specify android version 2019-07-29 08:20:05 +03:00
Alibek Omarov
61f49938e5 travis: build for android, not publish until touch controls are not done 2019-07-29 08:10:04 +03:00
Alibek Omarov
d697421d81 scripts: waifulib: add ndk r20 support 2019-07-29 06:54:05 +03:00
Alibek Omarov
f71619d541 public: build: fix wrong hardfp abi detection 2019-07-29 06:53:42 +03:00
Alibek Omarov
0eb1d4c7c0 engine: build: fix armhf compiling 2019-07-29 06:53:18 +03:00
Alibek Omarov
5cfe9ef181 ref_gl: update gles1 and gles2 wrappers 2019-07-29 05:35:34 +03:00
Alibek Omarov
d790292829 engine: replace CFG_END macro with function, add saving support for R_GetConfigName 2019-07-28 00:27:35 +03:00
Alibek Omarov
fce0ef6ad2 ref_gl: change gl_round_down flag, remove executing configs, implement GetConfigName call 2019-07-28 00:26:56 +03:00
Alibek Omarov
f9269dcc1c engine: ref: implement executing renderer config before creating context from engine and video config before loading refdll, update api, add r_refdll cvar to video.cfg 2019-07-28 00:23:22 +03:00
Alibek Omarov
4b163e6d30 engine: hide FCVAR_RENDERINFO from renderdll, remove OpenGLConfigHack from engine functions, add GetConfigName to renderdll functions 2019-07-28 00:13:40 +03:00
Alibek Omarov
147c702f2f defaults: specify two default renderers, one is accelerated, second is software 2019-07-28 00:10:55 +03:00
Alibek Omarov
b1f23f9ff6 engine: patch dedicated to build 2019-07-27 15:40:57 +03:00
Alibek Omarov
53eb569216 scripts: fix linux build again 2019-07-27 15:33:03 +03:00
Alibek Omarov
7c8105247c scripts: allow building dedicated, rename appimage to lower-case, fix warnings found by shellcheck 2019-07-27 14:49:01 +03:00
Alibek Omarov
35ae421ac1 wscript: add shortened option for win-style-install 2019-07-27 14:34:59 +03:00
Alibek Omarov
e3e161f281 scripts: explicitly name appimage 2019-07-27 13:49:37 +03:00
Alibek Omarov
8f9800eb3c ref: move R_DrawTree from refdll to engine, implement using ref's triapi 2019-07-27 13:27:40 +03:00
Alibek Omarov
a5593963c5 scripts: fix amd64 build 2019-07-26 17:25:46 +03:00
Alibek Omarov
e308281b0b engine: fix buffer overflow in COM_ParseFile 2019-07-26 17:24:09 +03:00
Alibek Omarov
0ce8d92f27 wscript: ease debugging with sanitizers under Clang 2019-07-26 17:10:47 +03:00
Alibek Omarov
938a9f372f engine: add stub function for new undocumented function in clientdll api 2019-07-26 14:51:21 +03:00
Alibek Omarov
a0514c242b travis: fix-up arch name from amd64 to x86_64 2019-07-25 20:11:25 +03:00
Alibek Omarov
b96eb14cf7 travis: restore accidentally removed zlib for i686 build 2019-07-25 20:10:05 +03:00
Alibek Omarov
1636d36dc2 travis: try to fix linux builds #2 2019-07-25 04:56:59 +03:00
Alibek Omarov
9bb2870e38 travis: try to fix travis 2019-07-21 12:40:47 +03:00
Alibek Omarov
d9545e5e78 cl_game: fix missing } 2019-07-20 05:09:24 +03:00
Alibek Omarov
827105405f travis: enable building and publishing for AMD64. Use at your own risk! 2019-07-20 05:07:22 +03:00
Alibek Omarov
2f8fec6b70 Remove trailing spaces, convert mistakenly put spaces to tabs. The most useful commit ever. 2019-07-19 20:23:08 +03:00
Alibek Omarov
20ecfcd8e0 mainui: update 2019-07-19 17:24:25 +03:00
Alibek Omarov
b539ed5a3d engine: remove write_to_clipboard, as there was no way to enable it for a long time and no one even asked for this 2019-07-19 17:24:25 +03:00
Alibek Omarov
4eab7d6503 engine: fix build 2019-07-19 17:17:12 +03:00
Alibek Omarov
8a4239d48d wscript: disallow -Wparentheses 2019-07-13 23:26:19 +03:00
Alibek Omarov
cedc1e0eb2 engine: soundlib: show mpg123 errors in console 2019-07-13 23:25:55 +03:00
Alibek Omarov
4beba75159 engine: fix various compiler warnings 2019-07-13 23:25:03 +03:00
Alibek Omarov
a0cbac4fc7 engine: server: use generic SV_RejectConnection instead of directly sending errormsg 2019-07-13 20:59:43 +03:00
Alibek Omarov
9662ab106f engine: client: implement errormsg, secure client by checking server IP address we're connected to 2019-07-13 20:54:16 +03:00
Alibek Omarov
4e4a9827b1 defaults: remove dead macro 2019-07-13 19:49:27 +03:00
Alibek Omarov
04ee7c3a55 engine: fix build 2019-07-12 22:43:58 +03:00
Alibek Omarov
a85a856215 engine: implement connection warning dialog showing up, update menu 2019-07-12 22:42:13 +03:00
Alibek Omarov
9e30fc253f engine: gameui: add new extended API and declare old engine menu extensions deprecated 2019-07-12 22:42:13 +03:00
Alibek Omarov
b2895770b8 platform: remove unneeded argument from SNDDMA_Init 2019-07-12 22:42:13 +03:00
Jonathan Poncelet
37255354d4 Various: Fixed obscure crashes on Mac
There were a couple of out-of-range/post-free accesses going on, which caused the Mac
build to crash when optimisations were turned on.
2019-07-12 18:18:42 +03:00
Alibek Omarov
661b53d0b3 mainui: update to fix build 2019-07-11 20:55:07 +03:00
Alibek Omarov
56e256fc86 mainui: update 2019-07-11 04:00:42 +03:00
Alibek Omarov
1f7dfecf89 platform: posix: library: properly use directpath argument 2019-07-11 04:00:25 +03:00
Alibek Omarov
6f121b90c1 public: wscript: skip installation 2019-07-11 03:59:56 +03:00
Alibek Omarov
2d48e73f9d ref_gl: fix compiler warning, most useful commit 2019-07-11 03:59:39 +03:00
Alibek Omarov
58a747e8ac wscript: proper activation of sanitizer on Clang 2019-07-11 03:59:20 +03:00
Alibek Omarov
3bf5f19446 keys: fix default binding of ESC button after unbindall command 2019-07-11 03:57:09 +03:00
Alibek Omarov
da4062ede9 engine: cmd: add apropos command from old engine 2019-07-09 16:36:34 +03:00
Alibek Omarov
e700a7498e engine: move matchpattern from old engine 2019-07-09 16:36:15 +03:00
Alibek Omarov
6f27d05361 travis: ignore continuous branches [ci skip] 2019-07-09 16:04:45 +03:00
Alibek Omarov
baefab7e3d travis: remove repository deployment 2019-07-09 15:43:30 +03:00
Alibek Omarov
7dda1c28f4 engine: console: add missing hpk commands autocomplete 2019-07-09 15:23:55 +03:00
Alibek Omarov
364c96f45c engine: console: sort output in commmand autocomplete for bind 2019-07-09 15:11:50 +03:00
Alibek Omarov
7aa163f713 engine: console: implement autocomplete for any arg count, add autocomplete for bind for both keys and commands 2019-07-09 15:08:00 +03:00
Alibek Omarov
62fb743a20 engine: sound: clear leftovers from previous commit 2019-07-09 13:24:24 +03:00
Alibek Omarov
40211efa9a engine: sound: remove s_cull and s_phs, because they never worked. It's better to write our own occluder in future or use any opensource library 2019-07-09 13:17:10 +03:00
Alibek Omarov
be98a228a7 wscript: enforce hidden visibility 2019-07-09 04:53:25 +03:00
Alibek Omarov
1f7171462b vgui_support: properly EXPORT main entry point 2019-07-09 04:53:05 +03:00
Alibek Omarov
511d728337 ref_gl: remove unused static function 2019-07-09 04:52:40 +03:00
Alibek Omarov
61b39f4257 mainui: update 2019-07-09 03:48:09 +03:00
Alibek Omarov
3e4bd20919 engine: client: implement sending input devices list to server, using protinfo 2019-07-09 03:48:09 +03:00
Alibek Omarov
7d10660b87 engine: keys: give gamepad keys names 2019-07-09 03:48:09 +03:00
Alibek Omarov
6aa4765c3e engine: input: implement input devices collecting 2019-07-09 03:48:09 +03:00
Alibek Omarov
fa68108907 engine: input: adapt gamepad code for new engine, remove gamepad ids, as it was never used and probably will never be, small optimizations 2019-07-09 03:48:09 +03:00
Alibek Omarov
771c09226e ref_gl: patched to compile 2019-07-09 03:48:09 +03:00
Alibek Omarov
8d0ea1d03e wscript: disallow int-conversion 2019-07-09 03:48:09 +03:00
Andrey Akhmichin
83953c7fb3 Port ip filter and partially useragent from old engine. 2019-07-09 03:48:09 +03:00
Alibek Omarov
8b94443ba2 scripts: travis: make PRs succeed, add a note about moving to GitHub Releases 2019-07-08 19:10:49 +03:00
Alibek Omarov
5e8d3acc51 engine: build: fix ARM64 macro 2019-07-08 19:10:49 +03:00
Alibek Omarov
d347096396 engine: sound: allow cubic sound interpolation 2019-07-07 02:48:19 +03:00
Alibek Omarov
54920f13df engine: rename library naming function, as it returns a full path and not just library name 2019-07-07 02:47:45 +03:00
Alibek Omarov
d01a33814c readme: wording 2019-07-07 02:46:16 +03:00
Alibek Omarov
efd2e434b4 engine: fix build on non-x86 archs 2019-07-07 00:20:38 +03:00
Alibek Omarov
2202e13a61 ref_gl: fix #52 2019-07-07 00:17:03 +03:00
Alibek Omarov
7702a7a8d0 wscript: force /MT for msvc explicitly 2019-07-07 00:15:52 +03:00
Alibek Omarov
8320f0598f Merge 4529 update 2019-07-02 23:44:42 +03:00
Alibek Omarov
165c1622f8 mainui: update 2019-07-01 05:51:19 +03:00
Alibek Omarov
b8c0d7f59e port: clean-up old port header 2019-07-01 05:50:54 +03:00
Alibek Omarov
6197ba8af6 engine: ref: remove redutant LoadLibrary call 2019-07-01 05:50:31 +03:00
Alibek Omarov
89a3fd6323 engine: make use of platform-unique library naming scheme 2019-07-01 05:50:04 +03:00
Alibek Omarov
ec18dd9535 engine: implement platform-unique library naming 2019-07-01 05:48:53 +03:00
Alibek Omarov
bb4c73b25c engine: build: lower case operating system names 2019-07-01 05:47:38 +03:00
Alibek Omarov
90e0c070ac engine: network: refactor net_ws.c since winsock2 is linked directly to engine DLL, correct some signness 2019-07-01 04:03:18 +03:00
Alibek Omarov
83b7f795c1 travis: missed an OSX upload script 2019-07-01 00:51:25 +03:00
Alibek Omarov
0366035237 travis: add github releases uploader (#47) 2019-07-01 00:40:52 +03:00
Alibek Omarov
a8f7b4fc5c win32: lib: remove unused variable, fix error message may be not printed 2019-06-30 17:26:57 +03:00
Alibek Omarov
f2d588574c sdl: vid: fix engine window being restored immediately after being maximized 2019-06-30 16:19:34 +03:00
Alibek Omarov
0579ecd30f engine: check if client.dll linked to SDL2.dll (#37) 2019-06-29 23:56:50 +03:00
Alibek Omarov
b5d9bf5dc8 engine: add a function to determine if library has direct dependency on chosen DLL(Win32 only) 2019-06-29 23:25:50 +03:00
Alibek Omarov
413882a8d5 sdl: fix typos 2019-06-29 23:25:00 +03:00
Alibek Omarov
c92f8f71a7 sdl: vid: allow to build with earlier versions of SDL2 2019-06-29 22:59:13 +03:00
Alibek Omarov
a378379ac5 engine: network: link to Winsock2 directly 2019-06-29 22:01:32 +03:00
Alibek Omarov
bcb4c9a722 Merge remote-tracking branch 'nekonomicon/png' 2019-06-29 20:41:53 +03:00
Alibek Omarov
eb22ff53c4 sdl: vid: fix washed out screen on Windows and probably other platforms(#50) 2019-06-29 20:40:23 +03:00
Alibek Omarov
b1406e8ecd waf: fix multiprocess compilation with msvc 2019-06-26 16:41:58 +03:00
Night Owl
4eee187f1b engine: common: imagelib: add simple decoder/encoder for 8-bit RGB/RGBA PNG images. 2019-06-22 16:06:44 +05:00
Alibek Omarov
76a8fe4873 engine: use build.h for printing architecture and operating system, also implement architecture names from library naming scheme proposal (#39) 2019-06-21 17:25:43 +03:00
Alibek Omarov
f010e2be12 public: build: add a header that defines some build-time information, like target OS or platform 2019-06-21 17:20:57 +03:00
Alibek Omarov
7484c51490 appimage: fix packaging 2019-06-17 18:29:31 +03:00
Alibek Omarov
96c4044a6c appimage: use APPDIR enviroment variable to determine application directory 2019-06-17 15:45:28 +03:00
Alibek Omarov
3d9a97348e readme: update 2019-06-17 09:09:15 +03:00
Alibek Omarov
81b6c1c333 Documentation: move pages from GitHub Wiki here, GitHub Wiki now will be disabled 2019-06-17 09:05:20 +03:00
Alibek Omarov
a62cb2a93f readme: add note for debian/ubuntu prerequisites, add vgui-dev as submodule, update mainui 2019-06-17 09:04:39 +03:00
Alibek Omarov
e9f26fe29d port: don't define XASH_64BIT, as it defined by waf 2019-06-17 08:37:51 +03:00
Alibek Omarov
3ae7ecaeb3 engine: patched to compile, moved gl_clear to engine 2019-06-17 08:37:34 +03:00
Alibek Omarov
75e690791d vgui_support: wscript: don't test if current platform supports VGUI if one of checks has failed already 2019-06-17 08:21:56 +03:00
Alibek Omarov
f2c927906f Merge 4511 update 2019-06-17 07:36:46 +03:00
Alibek Omarov
61751cc306 readme: fix url to development builds 2019-06-13 01:25:21 +03:00
Alibek Omarov
ba11b849ed wscript: disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP 2019-06-13 00:49:27 +03:00
Alibek Omarov
014a09e222 appimage: fix AppRun shell-script POSIX compatibility 2019-06-12 22:14:12 +03:00
Alibek Omarov
b535c24edb editorconfig: initial add 2019-06-11 03:07:02 +03:00
Alibek Omarov
8d2bea03e0 filesystem: disable netpath code
This code was used in ancient approach, where executables and game files may have different path.
And this code was working only on Win32 with case-insensitive `getenv()`
2019-06-10 00:21:41 +03:00
mittorn
497ae6d269 Remove optimizations on mingw until game exports is marked 2019-06-08 20:36:29 +07:00
Alibek Omarov
e7eeba1de0 waf: update 2019-06-07 02:21:22 +03:00
Jonathan Poncelet
d14ce5ac39 SV_LoadProgs: Fixed potential memory leak if function failed (#46)
SV_LoadProgs: Fixed potential memory leak if function failed
2019-06-06 15:02:22 +03:00
Alibek Omarov
76dae35955 ref: remove COM_HashKey API call 2019-06-06 04:34:28 +03:00
Alibek Omarov
70d45f23de public: crclib now is part of public library 2019-06-06 04:33:57 +03:00
Alibek Omarov
9735dedf2f contrib: generate me an IDE project instead of updating it manually everytime 2019-06-06 04:02:06 +03:00
Alibek Omarov
a8cc5b7cef waf: update to 2.0.17, rename module dir to waifulib, remove some modules, as they moved to waf binary itself(see waifu project) 2019-06-06 03:26:45 +03:00
Alibek Omarov
003bbea358 engine: common: remove unneeded REF_DLL ifdef, keep #error anyway 2019-06-06 01:28:59 +03:00
Alibek Omarov
5be28ce93d readme: multirenderer is supported, so move it from planned 2019-06-03 16:53:23 +03:00
Alibek Omarov
647b2658d1 mainui: update 2019-06-02 12:28:10 +03:00
Alibek Omarov
85240f0145 filesystem: zip: use miniz header only library instead of zlib, add miniz generated header(stripped ZIP reading/writing code) 2019-06-02 12:27:58 +03:00
Alibek Omarov
9119635ed3 engine: wscript: fix broken wscript after revert, oops 2019-06-02 12:26:58 +03:00
Alibek Omarov
ab16867f6b Revert "wscript: add zlib library"
This reverts commit 9b68b0c1e2.
2019-06-02 11:22:18 +03:00
Mr0maks
73cf465ce4 Merge https://github.com/FWGS/xash3d-fwgs 2019-06-01 21:06:34 +05:00
Andrey Akhmichin
37181e410f waflib: fix wrong identation. 2019-06-01 18:59:24 +03:00
Alibek Omarov
1ffc593993 wscript: check for 64-bit only for Win/Linux/Mac and only on amd64
It's useless to force 32-bit code for everything, as GoldSrc exists only for Intel CPUs and Windows, Linux or OSX
2019-05-31 02:59:45 +03:00
Mr0maks
8ef383a4d3 wscript: fix spaces 2019-05-30 22:18:53 +05:00
Mr0maks
3023c8a72b Merge branch 'master' into master 2019-05-30 21:25:56 +05:00
Mr0maks
9b68b0c1e2 wscript: add zlib library 2019-05-30 09:38:53 +05:00
Mr0maks
01a33dcf7e filesystem: zip: remove 'big' block 2019-05-30 00:51:52 +05:00
Alibek Omarov
4000654deb engine: port: disable ARCH_SUFFIX set to "64" for 64-bit platforms, it would replaced with new library naming scheme in near future 2019-05-29 19:53:48 +03:00
Alibek Omarov
90ff7f24b3 sdl: vid: fix building with older SDL2 2019-05-29 18:41:43 +03:00
Mr0maks
b42f020ad5 filesystem: zip: warning else zip file is empty 2019-05-29 20:04:14 +05:00
Mr0maks
6422005716 filesystem: zip: remove commented code 2019-05-29 13:05:19 +05:00
Mr0maks
efc9048b43 filesystem: zip: zlib error code 2019-05-29 13:01:33 +05:00
Mr0maks
12bc507156 filesystem: zip: working unpack code 2019-05-28 18:51:44 +05:00
Mr0maks
f9a7ffa5e8 filesystem: zip: remove malloc 2019-05-28 15:04:08 +05:00
Alibek Omarov
b9a2f58e23 mainui: update 2019-05-28 04:15:44 +03:00
Alibek Omarov
b146f495fc Add gl-wes-v2 and nanogl submodules 2019-05-28 04:15:23 +03:00
Alibek Omarov
4a1f441151 waflib: xcompile: Android NDK r19c support 2019-05-28 04:13:19 +03:00
Alibek Omarov
94ec8cb997 wscript: add -fPIC for static libraries globally 2019-05-28 04:12:02 +03:00
Alibek Omarov
621e33fde2 engine: wscript: define XASH_64BIT on non-32 bits targets 2019-05-28 04:10:22 +03:00
Alibek Omarov
db72378806 engine: android: fix building custom dlsym with NDK r19c, clean-up 2019-05-28 04:09:47 +03:00
Alibek Omarov
d596f4ea52 engine: android: vid: fix building with NDK r19c 2019-05-28 03:55:54 +03:00
Alibek Omarov
6f2016db06 engine: imagelib: bmp: fix unaligned access 2019-05-28 03:55:22 +03:00
Alibek Omarov
27e742df12 engine: crclib: fix unaligned access 2019-05-28 03:55:04 +03:00
Alibek Omarov
86d823b877 engine: client: fix demo playback on ARM 2019-05-28 03:45:02 +03:00
Alibek Omarov
82697ca2a9 waflib: force_32bit: fix wrong DEST_SIZEOF_VOID_P when 64-bit build is allowed 2019-05-28 03:44:46 +03:00
Alibek Omarov
4606a18b25 wscript: add useful flags for clang also 2019-05-28 00:30:52 +03:00
Alibek Omarov
9145589414 waflib: xcompile: fix hardfp linking 2019-05-28 00:29:26 +03:00
Alibek Omarov
1d78d7c720 filesystem: fix even more char signness 2019-05-27 23:27:20 +03:00
Mr0maks
1cc2ec9095 filesystem: zip: codestyle 2 2019-05-27 23:02:38 +05:00
Mr0maks
5cf4e34607 filesystem: zip: codestyle 2019-05-27 20:44:14 +05:00
Mr0maks
b32de42ab7 filesystem: zip: fix memory leak (not freed info) 2019-05-26 23:04:17 +05:00
Mr0maks
b04a48f126 filesystem: zip: remove XASH_ZLIB macro 2019-05-26 20:12:41 +05:00
Mr0maks
3c0a34926a filesystem: zip: pk3 support 2019-05-26 00:38:21 +05:00
Mr0maks
039b42868d filesystem: zip: add FS_AddFileToZip 2019-05-25 23:24:34 +05:00
Mr0maks
671c247381 Merge branch 'master' of https://github.com/FWGS/xash3d-fwgs 2019-05-25 22:54:42 +05:00
Alibek Omarov
9048c108c4 engine: fix char default signness 2019-05-25 03:12:17 +03:00
Alibek Omarov
b797e0af1a Merge 4483 update 2019-05-25 02:44:24 +03:00
Mr0maks
85b5b4e965 filesystem: add support for zip files 2019-05-24 21:13:03 +05:00
Alibek Omarov
74062fab12 waf.bat: fix strange ERRORLEVEL bug 2019-05-23 22:28:35 +03:00
Alibek Omarov
67ce4cfbef travis: windows: die if waf has failed 2019-05-23 22:13:00 +03:00
Alibek Omarov
fe464af3ff ref_gl: fix msvc build 2019-05-23 22:10:35 +03:00
Alibek Omarov
45b091028b travis: comment mingw build until it's not stable 2019-05-23 22:01:06 +03:00
Alibek Omarov
00619d5795 travis: remove allow_failures, looks like it was copypasted from somewhere by mistake 2019-05-23 21:56:47 +03:00
mittorn
a2cba95a3a ref_soft: Merge pull request #1 from a1batross/master
update to latest API version
2019-05-13 01:17:47 +07:00
Alibek Omarov
fd962869e6 ref_soft: update to latest API version 2019-05-12 18:05:03 +03:00
Alibek Omarov
2e953bd1a9 ref_api: remove GL_OnContextCreated, remove return value of GL_RenderFrame 2019-05-12 18:02:59 +03:00
Alibek Omarov
57f9e7dda6 sdl: vid: fix forgotten return, slightly refactor SW_UnlockBuffer 2019-05-12 17:49:20 +03:00
Alibek Omarov
d14ce61520 engine: no return type for RenderFrame 2019-05-12 03:09:40 +03:00
Alibek Omarov
5af6506d86 engine: ensure that we loading same client library 2019-05-12 03:08:51 +03:00
Alibek Omarov
e9e4a1296d engine: android: fix possible crash in custom dlsym 2019-05-12 03:07:28 +03:00
Alibek Omarov
85c2126775 engine: android: implement egl context management 2019-05-12 03:06:55 +03:00
Alibek Omarov
a1391f3d0b engine: ref_api: comment unused opengl attributes 2019-05-12 03:06:01 +03:00
Alibek Omarov
bb8ba4225c ref_gl: show r_info after loading extensions, add GL_GetProcAddress call 2019-05-12 03:04:26 +03:00
Alibek Omarov
7d3e8c0a57 wscript: error on return-type, some android related changes 2019-05-12 03:03:34 +03:00
Alibek Omarov
55c3040db1 ref_gl: fix unaligned access in sprites 2019-05-12 03:02:01 +03:00
Alibek Omarov
90e4fbed31 port.h: temporarily disable hardfp postfix 2019-05-12 03:00:50 +03:00
Alibek Omarov
4819790272 engine: console: fix invalid REF_GET_PARM call 2019-05-11 18:52:32 +03:00
Alibek Omarov
f904ba53e2 wscript: fix typo 2019-05-06 19:25:10 +03:00
Alibek Omarov
e06b7412ac engine: wscript: don't build external launcher for Android and disable main() 2019-05-06 04:40:46 +03:00
Alibek Omarov
dec1b8dfb4 waflib: xcompile: even if hardfloat ABI is selected, force architecture name as armeabi-v7a, as armeabi-v7a-hard is completely virtual. Move options defines to main wscript 2019-05-06 04:11:12 +03:00
Alibek Omarov
c9b5332d16 waflib: subproject: preserve IGNORED_SUBDIRS between contexts, fix broken logic 2019-05-05 00:22:03 +03:00
Alibek Omarov
fe14a360b4 engine: fix fs_offset_t/size_t conversion, const qualifiers 2019-05-02 19:12:23 +03:00
Alibek Omarov
ab7a67464b engine: fix long<->int conversion UBs 2019-05-02 19:05:09 +03:00
Alibek Omarov
29a48cb34c sdl: vid: fix disabling vsync when loading a level 2019-05-02 18:07:27 +03:00
Alibek Omarov
3fef353291 android: initial port 2019-05-02 18:07:03 +03:00
Alibek Omarov
1a700fd06b platform: move MSGBOX implementation to platform backends 2019-05-01 19:44:48 +03:00
Alibek Omarov
e3e2f3afe5 platform: move Sys_ShellExecute implementation to platform backends 2019-05-01 19:21:47 +03:00
Alibek Omarov
87f380b90c waflib: xcompile: define both __ANDROID__ and ANDROID for compatibility 2019-05-01 19:03:23 +03:00
Alibek Omarov
3ebb4d0ea3 waflib: xcompile: check arch, configure 'M' uselib to m_hard on hardfp, remove linker select 2019-05-01 01:58:27 +03:00
Alibek Omarov
d4b4a4a864 waflib: xcompile: add support for ANDROID_NDK environment variable, as well as ANDROID_NDK_HOME. Fix help message. 2019-04-27 13:01:05 +03:00
mittorn
7663da80c3 ref_soft: Setup viewport 2019-04-17 07:17:43 +07:00
mittorn
bd6532fae4 wscript: Add shared lib flags to public 2019-04-17 06:42:34 +07:00
mittorn
25235b5296 ref_gl: remove Mod_SetCurrentLoadingModel call 2019-04-17 06:42:34 +07:00
mittorn
103077b686 ref_soft: clean unused variables 2019-04-17 06:34:01 +07:00
mittorn
fbef500fb3 ref_soft: Fix division by zero 2019-04-17 06:15:24 +07:00
mittorn
37ee9752e1 ref_soft: Update ref interface 2019-04-17 06:11:11 +07:00
Alibek Omarov
2c17af4850 engine: ref: fix possible null dereference, if client doesn't export studio renderer 2019-04-16 23:39:37 +03:00
Alibek Omarov
7d8b63fd88 ref: get rid of R_IncrementSpeedsCounter 2019-04-15 02:17:43 +03:00
Alibek Omarov
5be982cc72 ref: remove shared textures enum, instead use hardcoded texture names 2019-04-15 01:43:43 +03:00
Alibek Omarov
2d968cf328 ref: remove unused GL_BuildLightmaps export 2019-04-15 01:20:15 +03:00
Alibek Omarov
4d9563ea03 ref: make api thinner by removing IsNormalPass and moving CL_FxBlend to refdll 2019-04-15 01:19:05 +03:00
mittorn
a6572dd042 ref_soft: fix crash on map restart again 2019-04-15 04:59:05 +07:00
Alibek Omarov
d62a12dd9a ref: allow to use shortened name when specifying -ref in command line 2019-04-14 22:04:32 +03:00
mittorn
8a99d64139 ref_soft: fix blocksize 2019-04-14 06:20:22 +07:00
Alibek Omarov
99478ba9bd sdl: vid: fix unitialized variables, better warning report 2019-04-13 21:49:01 +03:00
mittorn
1c0262a8c4 ref_soft: Partial world luxels support 2019-04-14 00:58:14 +07:00
Alibek Omarov
211d3c5213 sdl: vid: refactor context creation, fix crash on exit on REF_SOFTWARE 2019-04-13 20:34:32 +03:00
Alibek Omarov
20c7c36996 ref_gl: remove dead WGL extensions 2019-04-13 19:39:49 +03:00
Alibek Omarov
228dab5965 ref_gl: move GLES and GL_STATIC defintions to gl_export.h. Add REF_GL_KEEP_MANGLED_FUNCTIONS, to keep use pgl instead of re-defining everything to gl. Used in conjuction with GL_STATIC 2019-04-13 19:39:22 +03:00
Alibek Omarov
4b955a320b ref_gl: allow gldebug for GL_STATIC. Rewrite extension querying for GLES. Allow gldebug for GLES(using GL_KHR_debug). ref_gles1 through nanogl now works 2019-04-13 19:38:41 +03:00
mittorn
ee67d350e3 ref_soft: Fix world unload. Improve lightmap sample detection 2019-04-13 20:50:27 +07:00
mittorn
60e3a78221 ref_soft: Implement texture free 2019-04-13 20:49:07 +07:00
mittorn
b2105a113c ref_soft: extended bsp support 2019-04-13 19:15:26 +07:00
mittorn
c293a7a26d ref_soft: update wscript 2019-04-13 19:14:07 +07:00
mittorn
d5911b33b1 msvc8 support 2019-04-12 14:33:57 +07:00
mittorn
f1638b09c5 waf: implement 'reconfigure' module 2019-04-12 02:45:23 +07:00
mittorn
741fcfb202 Add new build types, fix gcc colors 2019-04-12 00:19:40 +07:00
mittorn
54d54b1457 waf: fix python3 2019-04-12 00:19:12 +07:00
mittorn
d5b6ccb3e2 ref: REF_SOFTWARE support with SDL_Surface/SDL_Renderer 2019-04-11 22:19:08 +07:00
Alibek Omarov
6448964c37 vgui_support: remove miniutl submodule 2019-04-11 01:51:54 +03:00
Alibek Omarov
46378e3738 ref_gl: fix build 2019-04-11 01:41:52 +03:00
Alibek Omarov
b2038e76d3 waflib: subproject: carefully restore previous enviroment in configuration context 2019-04-11 01:38:00 +03:00
Alibek Omarov
eb650b71ad waflib: subproject: restore environment in build context 2019-04-11 01:32:19 +03:00
Alibek Omarov
968994bba5 ref_gl: add an option to disable ref_gl building 2019-04-11 01:26:33 +03:00
Alibek Omarov
3c1c13850e vgui_support: remove utl dependency, by porting new vgui support code from original engine, remove dead function definitions, remove dead vgui_main.h header from engine 2019-04-11 01:12:52 +03:00
Alibek Omarov
459f4a9788 scripts: waflib: introduce new waf plugin -- subproject, which makes easier use of standalone envs for each subdirectory 2019-04-11 00:15:48 +03:00
Alibek Omarov
d17fdea884 waflib: remove get_subproject_name function 2019-04-11 00:13:59 +03:00
mittorn
b20efff57c msdev: add line breaks to lines 2019-04-10 01:55:43 +03:00
mittorn
36159e6622 msdev: convert solution to list 2019-04-10 01:55:43 +03:00
mittorn
c953ba0852 msdev: add line breaks to solution 2019-04-10 01:55:43 +03:00
mittorn
b38ef43260 msdev: include solution file 2019-04-10 01:55:43 +03:00
mittorn
fea2395a80 msdev: fix 2019-04-10 01:55:43 +03:00
mittorn
ffaab11da9 msdev: add relative library paths 2019-04-10 01:55:43 +03:00
mittorn
f6b3603934 msdev: fix 2019-04-10 01:55:43 +03:00
mittorn
9421963b29 msdev: print abspath 2019-04-10 01:55:43 +03:00
mittorn
239c13da28 msdev: remove printing bld.root 2019-04-10 01:55:43 +03:00
mittorn
eb6f67ed07 msdev: print include paths 2019-04-10 01:55:43 +03:00
mittorn
c206e72f7b msdev: fix 2019-04-10 01:55:43 +03:00
mittorn
79e6ebbe23 msdev: fix 2019-04-10 01:55:43 +03:00
mittorn
d4638a9cf4 msdev: find relative include path 2019-04-10 01:55:43 +03:00
mittorn
7ccc9b0795 Revert "waf: try relative SDL2 path"
This reverts commit 50f0ae5234.
2019-04-10 01:55:43 +03:00
mittorn
6c1d911193 waf: try relative SDL2 path 2019-04-10 01:55:43 +03:00
Alibek Omarov
9587aacee3 mainui: update 2019-04-10 01:55:24 +03:00
Alibek Omarov
777562aea8 Revert "Revert "scripts: try to avoid race condition when MSVC writes to same pdb file in multiple threads""
This reverts commit a40d64d3a6.
2019-04-08 21:46:59 +03:00
Alibek Omarov
a40d64d3a6 Revert "scripts: try to avoid race condition when MSVC writes to same pdb file in multiple threads"
This reverts commit d87dd2a60a.
2019-04-08 21:36:48 +03:00
Alibek Omarov
7704d9b2ef wscript: add /FS to avoid race condition on PDB file(second try) 2019-04-08 21:34:41 +03:00
Alibek Omarov
d87dd2a60a scripts: try to avoid race condition when MSVC writes to same pdb file in multiple threads 2019-04-08 21:31:57 +03:00
mittorn
6403a265de Try fix python encoding again 2019-04-08 21:16:29 +03:00
mittorn
3fa4a36983 wscript: specifiy psapi version on win32 2019-04-08 21:15:05 +03:00
Alibek Omarov
8b16c30fb8 wscript: always optimize on MSVC(temporary) and always generate PDB using /Zi 2019-04-08 21:10:36 +03:00
Alibek Omarov
20a177c783 wscript: enable msvs.py, as it's handy for those who can actually install Python 2019-04-08 21:09:23 +03:00
Alibek Omarov
0840d9ec25 scripts: fix deploying vc2008 solution and empty vc2008 folder 2019-04-08 21:09:23 +03:00
Alibek Omarov
4124e01d65 scripts: enable deploying vc2008 project 2019-04-08 21:09:21 +03:00
Alibek Omarov
129325f3a4 scripts: waflib: add msdev.py tool by Michel Mooij, patched to support uselib, separate envs and so 2019-04-08 21:08:52 +03:00
Alibek Omarov
9cd22a98bd wscript: fix mistyped msvc flag 2019-04-08 21:08:50 +03:00
Alibek Omarov
6a6d21ed32 vgui_support: wscript: don't continue configuration if vgui_supoport can't be built 2019-04-08 21:08:17 +03:00
Alibek Omarov
041315da44 scripts: use waf install to generate packages 2019-04-08 21:08:15 +03:00
Alibek Omarov
aa30661c26 vgui_support: wscript: disable build on mingw 2019-04-08 21:07:02 +03:00
Alibek Omarov
031bac8d13 wscript: move msvc.py initialization BEFORE compiler_c, so we can set compiler with --msvc_version command line switch 2019-04-08 21:07:02 +03:00
mittorn
4dae13d7bc ref_soft: Add GAME_EXPORT to exports 2019-04-08 05:09:02 +07:00
mittorn
5140bb8d7f ref_soft: Use Q_memprint to report cache size 2019-04-07 22:29:48 +07:00
mittorn
320a3b0834 ref_soft: Fix cache flush on reconnect, fix division by zero in decals 2019-04-07 22:10:41 +07:00
mittorn
79405c7cc9 ref_soft: Fix polyset bounds checking 2019-04-07 15:52:27 +07:00
mittorn
99fa5d0252 ref_soft: Another bound check implementation (todo: compare) 2019-04-06 15:55:00 +07:00
mittorn
b584e89d90 ref_soft: add bounds checking in triangle render 2019-04-06 14:40:08 +07:00
mittorn
7f1491f884 ref_soft: Try fix crash on changelevel 2019-04-05 15:56:05 +07:00
Alibek Omarov
0cf1e3b1da ref: add REF_D3D placeholder for compatibiltiy(not planned anyway) 2019-04-04 23:13:55 +03:00
Alibek Omarov
441795943b ref_gl: move gl specific defines out from defaults.h, remove VIDEO_DONTCARE hack, automatically set XASH_GLES if wrapper is set 2019-04-04 23:13:17 +03:00
Alibek Omarov
a9cf3357c7 ref: move GLES driver hint to SetAttribute as we don't choose GLES renderer in compile-time anymore 2019-04-04 22:43:33 +03:00
mittorn
9fbb8a8201 ref_soft: Add alpha test for brushes to all rendermodes 2019-04-04 10:51:31 +07:00
mittorn
4aa5778606 ref_soft: Alpha support for additive/glow 2019-04-04 10:37:41 +07:00
mittorn
338b404055 ref_soft: clamp alpha values 2019-04-04 10:27:18 +07:00
mittorn
500ff629bf ref_soft: decrease alpha to make water visible again 2019-04-04 10:01:11 +07:00
mittorn
033a947631 ref_soft: set minor bits in alpha map to make it more accurate 2019-04-04 09:38:17 +07:00
mittorn
c08c35df69 ref_soft: FillRGBA, FillRGBABlend 2019-04-04 04:44:06 +07:00
mittorn
cefe42fd66 ref_soft: Fix R_NewMap, prevent crashes on changelevel/restart 2019-04-04 02:56:29 +07:00
mittorn
e0cd5edddb ref_soft: Ignore non-horizontal water planes 2019-04-04 02:38:57 +07:00
mittorn
ebd1da2730 ref_soft: Transform dlights for entitites 2019-04-04 02:00:24 +07:00
mittorn
4bbcd5daef ref_soft: Use r_math, this will fix beamfollow and glow sprites 2019-04-04 01:32:06 +07:00
mittorn
8d88ecb951 ref_soft: Remove more unused globals/functions 2019-04-04 00:29:35 +07:00
mittorn
b5e1382232 ref_soft: Merge some globals 2019-04-04 00:12:57 +07:00
mittorn
8f5c72c510 ref_soft: Add macro to disable texture filter preventing slowdown on cvar checking 2019-04-03 23:24:10 +07:00
mittorn
c52453faa3 ref_soft: Remove r_poly 2019-04-03 23:01:25 +07:00
mittorn
8c9aa2588c ref_soft: Fix studio rendermodes, add additive brush rendermode 2019-04-03 22:55:46 +07:00
mittorn
d03d29f6f5 ref_soft: Fix transparency in API 2019-04-03 22:21:08 +07:00
mittorn
77f8da275a ref_soft: Extend edge drawing with zbuffer support, draw transparent brushes with it 2019-04-03 22:20:33 +07:00
Alibek Omarov
84761e62ff Merge pull request #34 from x6herbius/netcode-reduce-failures
Prevented net send errors from triggering an entire host error
2019-04-01 23:04:00 +03:00
Jonathan Poncelet
60a1c4f0cc Prevented net send errors from triggering an entire host error 2019-04-01 20:17:13 +01:00
mittorn
0c6c0003b1 ref_soft: Bound texcoords again, disable drawing spans on FloorDivMod overflow 2019-04-01 02:42:13 +07:00
mittorn
1c49d76fb7 ref_soft: Fix some integer overflows 2019-04-01 01:55:37 +07:00
mittorn
714084bf5b ref_soft: Fix hang on big texcoords 2019-03-31 20:57:29 +07:00
mittorn
2efdf56317 ref_soft: fix particles 2019-03-31 19:07:55 +07:00
mittorn
7fc09da482 ref_soft: TriAPI texturing, rendermodes 2019-03-31 18:00:25 +07:00
mittorn
d315a838bd ref_soft: invalidata all caches on dlight rebuild 2019-03-31 03:44:57 +07:00
mittorn
6879c1f097 ref_soft: Remove R_ConcatTransform, try fix transparent bmodels origin 2019-03-31 03:18:03 +07:00
mittorn
25860f6263 ref_soft: remove some unused globals 2019-03-31 02:05:08 +07:00
mittorn
c52d4b7998 ref_soft: Restore lightmap gamma calculation 2019-03-30 21:16:14 +07:00
mittorn
0c62967d8a ref_soft: re-enable lightstyles for LightPoint 2019-03-30 21:04:14 +07:00
mittorn
f34db62940 ref_soft: Add sprite, EFX 2019-03-30 20:24:58 +07:00
Alibek Omarov
77b23eec9f ref_gl: add options for linking-in nanogl and glwes(thus getting GLES1 and GLES2 renderers) and static gl 2019-03-30 03:10:43 +03:00
Alibek Omarov
f4bcea6182 ref_gl: don't use dxt on gles 2019-03-30 03:09:07 +03:00
Alibek Omarov
ea6a86a83d ref_gl: bring back GL_STATIC option 2019-03-30 03:08:44 +03:00
Alibek Omarov
47879942bb ref_gl: remove dead extensions from GLES code 2019-03-30 03:07:52 +03:00
Alibek Omarov
6c006e087d common: don't use SDL headers and types in refdll, if for some reason dll wants it 2019-03-30 03:06:23 +03:00
Alibek Omarov
8385563bef engine: fix possible crash during exit 2019-03-30 01:29:40 +03:00
Alibek Omarov
f9f96552b7 travis: move mingw engine build to standalone VM 2019-03-30 01:29:40 +03:00
mittorn
b0ed8a5ba3 ref_soft: Fix some UB 2019-03-30 04:50:18 +07:00
mittorn
ca3913cd88 fix windows build 2019-03-30 00:43:49 +03:00
Alibek Omarov
8b07916598 scripts: travis: fix deployment, finally 2019-03-29 23:57:44 +03:00
Alibek Omarov
5f122a7435 travis: experiment to move apt addons under stage 2019-03-29 23:49:33 +03:00
Alibek Omarov
50c656df94 scripts: travis: fix upload to yadisk 2019-03-29 23:48:34 +03:00
Alibek Omarov
5436658ce7 scripts: travis: accept everything when installing python from choco 2019-03-29 23:40:25 +03:00
Alibek Omarov
d7ea40d850 scripts: remove waf jobs, as waf smart enough to get CPU number, fix upload archive name for osx, install newer python in windows 2019-03-29 23:32:06 +03:00
Alibek Omarov
184ca6517c travis: oops, forgot to set OSes 2019-03-29 23:22:47 +03:00
Alibek Omarov
f4c36f49db travis: another try to fix matrices 2019-03-29 23:21:40 +03:00
Alibek Omarov
ae26783902 scripts: travis: yet another workaround for mingw... 2019-03-29 23:11:39 +03:00
Alibek Omarov
45fdd74dd2 travis: fix matrices 2019-03-29 23:11:20 +03:00
Alibek Omarov
880a9651d8 scripts: travis: use stages, use yandex disk as temporary place for build artifacts 2019-03-29 22:51:31 +03:00
mittorn
95ff769020 ref_soft: Add option to disable slow brush transparency 2019-03-30 02:41:36 +07:00
mittorn
9b158f5926 ref_soft: Studio alpha blending 2019-03-30 01:34:57 +07:00
mittorn
29c2169012 ref_soft: improve alpha map 2019-03-29 21:37:21 +07:00
Alibek Omarov
db30358d06 travis: fix osx archive name, remove unneeded envvars on osx, try to fix windows python 2019-03-29 06:08:41 +03:00
Alibek Omarov
ebbe22b09a travis: force newer python for windows 2019-03-29 05:52:55 +03:00
Alibek Omarov
752dd13c04 scripts: travis: uncomment osx packaging 2019-03-29 05:44:36 +03:00
Alibek Omarov
469a080000 travis: add windows, test commit up 2019-03-29 05:42:20 +03:00
Alibek Omarov
efc12f1045 scripts: travis: test windows scripts 2019-03-29 05:39:41 +03:00
Alibek Omarov
becb58223a scripts: travis: rewrite deploy script with commit up support 2019-03-29 05:26:01 +03:00
mittorn
56ef16b0f9 ref_soft: enable stiple alpha by default, cache conveyors 2019-03-29 03:52:08 +07:00
mittorn
eeda097603 ref_soft: Fix water 2019-03-29 02:13:45 +07:00
mittorn
77e296ffef ref_soft: Add r_poly, transparent brushes support 2019-03-29 02:02:54 +07:00
Alibek Omarov
f48335f2f2 ref: get rid of fov in globals, add RenderFrame wrapper, which correctly initialize shared global values 2019-03-28 18:17:58 +03:00
Alibek Omarov
8b5926f9b1 ref_gl: fix alpha in menu (and anywhere else where triColor4ub is used) 2019-03-28 18:17:58 +03:00
mittorn
72d5dfed34 ref_soft: Fill sky, enable turb code (not working correctly) 2019-03-28 03:42:28 +07:00
mittorn
7f8caf1634 ref_soft: Fix crash on glowshell, tune decals blending 2019-03-28 02:33:49 +07:00
mittorn
1871f39b2b ref_soft: Decals support 2019-03-28 02:05:19 +07:00
mittorn
6eae7acd34 ref_soft: lightstyle support 2019-03-27 21:34:37 +07:00
mittorn
36a5247181 ref_soft: bmodel dlights (ignore transform) 2019-03-27 21:16:33 +07:00
mittorn
153b8cbcc3 ref_soft: Xash3D lightmaps and dynamic lighting (world only) 2019-03-27 21:09:44 +07:00
mittorn
44a8ede94d ref_soft: Re-enable lightvec calculation 2019-03-27 20:17:58 +07:00
mittorn
529bb53d52 ref_soft: Static quake-based lightmap (does not work with extended bsp) 2019-03-27 19:57:37 +07:00
mittorn
b35415637b ref_soft: colormap support, basic studiomodel lighting 2019-03-27 17:53:42 +07:00
mittorn
35e42a2295 ref_soft: Viewmodel support 2019-03-26 22:57:34 +07:00
Alibek Omarov
0b13bf393f vgui_support: wscript: set default vgui-dev repo path, check OS in configuration stage 2019-03-26 16:28:40 +03:00
Alibek Omarov
58b5e1a9df wscript: introduce shortened frequently used configuration options 2019-03-26 16:26:02 +03:00
mittorn
dbabb861f2 ref_soft: studiomodel texturing, finally fix TRIANGLE_STRIP 2019-03-26 16:39:16 +07:00
mittorn
224bf07930 ref_soft: Fix TRIANGLE_STRIP draw 2019-03-26 06:01:20 +07:00
mittorn
870ae030ca ref_soft: Simple triapi and studio rendering (flat fill only) 2019-03-26 05:53:00 +07:00
mittorn
9ba39f65b3 ref_soft: Triangle drawing 2019-03-26 03:12:35 +07:00
mittorn
3d8fe065b5 ref_soft: Fix windows build 2019-03-25 21:18:47 +07:00
mittorn
513381a322 ref_soft: Flush caches and clear textures on newmap correctly 2019-03-25 11:59:25 +07:00
mittorn
c36f415793 ref_soft: Do not clip submodels with negative topnode content (fix crash on some maps) 2019-03-25 11:46:37 +07:00
Alibek Omarov
17f719558c wscript: move build env setup to main wscript 2019-03-25 01:25:44 +03:00
mittorn
3617e8e7a1 ref_soft: REF_SOFTWARE, resize support 2019-03-25 03:34:30 +07:00
Alibek Omarov
70abee3e28 Merge pull request #32 from iZarif/cf749c8c
vgui_support/wscript fix indentation
2019-03-24 19:14:21 +03:00
iZarif
37defbbd14 vgui_support/wscript fix indentation 2019-03-24 20:00:49 +04:00
mittorn
65cf77c32b ref_soft: declare r_bsp.c functions 2019-03-24 02:03:29 +07:00
mittorn
e0ce5640d1 ref_soft: Separate buffer for transparent textures 2019-03-23 18:49:27 +07:00
mittorn
e7f369a765 ref_soft: Fix breaking server vis, transparent texture decoding 2019-03-23 14:50:53 +07:00
mittorn
58429bbc79 ref_soft: submodel drawing 2019-03-23 13:49:55 +07:00
mittorn
5fc39662ec ref_soft: Increase limits again, this will fix some HL maps 2019-03-23 05:43:41 +07:00
mittorn
4c73f026b2 ref_soft: Fix render setup 2019-03-23 05:39:45 +07:00
mittorn
932ad73441 ref_soft: Add OpenMP for blit and 2d draw 2019-03-23 03:25:57 +07:00
mittorn
bf0d694c71 ref_soft: mipmap support 2019-03-23 02:37:56 +07:00
mittorn
a2e689aba3 ref_soft: Fix crash on x86 2019-03-23 01:19:15 +07:00
mittorn
c82eb39d54 ref_soft: Skip sky and transparent surfaces (increase FPS) 2019-03-23 00:49:46 +07:00
mittorn
a00256a61c ref_soft: Update API 2019-03-23 00:46:57 +07:00
mittorn
842a15ee45 ref_soft: Merge kernel texture filter 2019-03-22 23:58:43 +07:00
mittorn
e7785c9ccb ref_soft: Make it draw something, screen settings still wrong 2019-03-22 23:40:27 +07:00
Alibek Omarov
62f04137a5 engine: hide ref calls under Host_IsDedicated checks, replace ref function ptr checks by \!Host_IsDedicated 2019-03-22 18:41:57 +03:00
Alibek Omarov
5f849c4823 engine: bring back XASH_USE_SELECT. I need somehow disable this only on my work PC 2019-03-22 18:29:42 +03:00
Alibek Omarov
b09242e41c engine: fix dedicated check 2019-03-22 18:26:44 +03:00
Alibek Omarov
1538bc609d vgui_support: wscript: automatically disable vgui_support build on unsupported CPU type 2019-03-22 18:22:49 +03:00
Alibek Omarov
26616314f8 engine: add initial support for MCST Elbrus 2019-03-22 18:21:47 +03:00
Alibek Omarov
1483b21f00 Merge branch '0.20-renderdll' 2019-03-22 18:19:13 +03:00
Alibek Omarov
743c5ca8d5 engine: make dedicated work again 2019-03-22 16:47:52 +03:00
Alibek Omarov
92b89936b3 ref: make API thinner by moving simple calls into EngineGetParm(RenderGetParm with ref extensions), fix some UBs 2019-03-22 16:36:46 +03:00
mittorn
2b521ee201 ref_soft: Copy world renderer from zq/q2, does not render anything now 2019-03-22 19:33:14 +07:00
Alibek Omarov
8abbef8dbd scripts: try to workaround mingw bug by adding sse2 2019-03-21 17:47:16 +03:00
Alibek Omarov
59f3b63e0a ref_gl: wscript: fix libm linking 2019-03-21 17:31:18 +03:00
Alibek Omarov
6a6f341c07 Merge pull request #22 from FWGS/netsplit
Extended netsplit, network extensions
2019-03-21 17:23:49 +03:00
mittorn
ce27aad67b ref_soft: Fix alpha blending, optimize blitting 2019-03-21 17:56:42 +07:00
mittorn
6784b9062e ref_soft: hide color loops to macro 2019-03-20 21:55:04 +07:00
mittorn
f23ecc6895 ref_soft: Implement rendermodes, colors, alpha textures/blending 2019-03-20 21:44:21 +07:00
mittorn
ae6b460f35 ref_soft: Implement internal color tables 2019-03-20 15:26:53 +07:00
Alibek Omarov
402a596415 ref: add EXPORT to GetRefAPI, so MSVC will create *.lib file and not confuse waf or dynamic linker 2019-03-20 02:42:44 +03:00
Alibek Omarov
52eb84d34b mainui: update 2019-03-20 02:41:44 +03:00
Alibek Omarov
f3a2f46fb3 wscript: remove libm linking to static public, it's useless. Correct include path order 2019-03-20 02:40:47 +03:00
Alibek Omarov
4880ca3ca2 engine: move EXPORT definition to xash3d_types 2019-03-20 02:38:37 +03:00
Alibek Omarov
121c72c9e0 Merge origin/master into ref_dll 2019-03-20 02:38:13 +03:00
Alibek Omarov
e20e114643 miniutl: update 2019-03-20 01:21:10 +03:00
Alibek Omarov
7e08104631 ref_gl: fixes for MSVC 2019-03-20 01:20:58 +03:00
Alibek Omarov
7aa7f4dbbd engine: fix broken win32 types after moving more definitions to xash3d_types.h 2019-03-20 01:18:26 +03:00
Alibek Omarov
fb6fd61cd9 public: initial moving some common code into static public library, that can be linked to any engine part 2019-03-20 01:17:46 +03:00
mittorn
1ca28badad ref_soft: initial 2D drawing implementation 2019-03-20 04:29:25 +07:00
mittorn
34da3e0ccd ref: clear draw entities when clearing edicts 2019-03-18 00:56:38 +07:00
mittorn
0a22040c6e Fix SpriteTexture 2019-03-17 23:41:11 +07:00
mittorn
c55b7dcda7 ref: simplify efx api, move efrags to engine 2019-03-17 23:14:53 +07:00
mittorn
78f8932313 Fill client RenderAPI 2019-03-17 21:58:26 +07:00
mittorn
f00181223f Remove duplicate R_ClearScene 2019-03-17 21:56:29 +07:00
mittorn
bf2f829382 Disable Mod_ClearUserData in SV_UnloadProgs (it is still called on restart) 2019-03-17 21:26:38 +07:00
mittorn
297ca08e81 ref: replace model (un)loading by Mod_ProcessRenderData 2019-03-17 21:19:24 +07:00
mittorn
8339096ad8 ref: Improve model unloading, fix texture leak 2019-03-17 18:26:57 +07:00
mittorn
3d39d78e53 ref: fix hud sprites 2019-03-16 19:21:32 +07:00
mittorn
00ce909fc8 Setup renderer time 2019-03-16 18:51:30 +07:00
mittorn
aabf5f5621 ref: remove convar_t from renderer, disable engine-related definitions in mod_local 2019-03-16 18:15:05 +07:00
mittorn
9c6352ec57 ref: move tracer color cvars to ref 2019-03-16 17:49:07 +07:00
mittorn
7382fc7c49 mobility: add stub for touch (hlsdk-xash3d compatibility 2019-03-16 17:48:12 +07:00
mittorn
5fa9632ec0 fix studiomodel textures 2019-03-16 17:24:32 +07:00
mittorn
db78726656 ref: implement ASSERT macro 2019-03-16 17:23:41 +07:00
mittorn
57320c0c25 ref: get rid of vidState, add GL_SwapBuffers to engine exports 2019-03-16 11:58:44 +07:00
mittorn
31ab710485 Fix sprite loading 2019-03-16 11:27:15 +07:00
mittorn
4247af8fa8 Reduce engine dependencies. crtlib/mathlib/matrixlib now can be built standalone 2019-03-16 11:18:43 +07:00
Alibek Omarov
e5000742f1 ref: context creating prototype, not working yet 2019-03-16 05:15:32 +03:00
Alibek Omarov
971f9b6de5 ref: fix compiling errors 2019-03-16 04:24:27 +03:00
Alibek Omarov
199ebfed48 ref: implement engine ref API 2019-03-16 04:17:56 +03:00
Alibek Omarov
97aba69ed0 ref: implement API interface for ref_gl, get rid of RenderAPI, RenderInterface and vgui_support API references 2019-03-15 21:23:59 +03:00
Alibek Omarov
234507b7f1 ref: fix all undefined references 2019-03-11 17:37:58 +03:00
Alibek Omarov
d0d5fd1a3f ref: fix some undefined references, compile-in mathlib and crtlib to refdll 2019-03-06 17:14:25 +03:00
Alibek Omarov
e7234bada2 ref: now it compiles, not linking yet. ref_api header moved to engine/ to clarify, that it's sort of engine internals 2019-03-06 16:23:33 +03:00
Alibek Omarov
94cbb4e1e0 wscript: fix wrong dedicated skip subproject check 2019-03-03 03:38:02 +03:00
mittorn
437ba6d7a2 ref:Fix some clgame, world and renderapi usages, import renderapi funcs from engine 2019-02-27 06:23:03 +07:00
Alibek Omarov
574f03c139 ref: initial engine to ref API draft, not compiling, work in progress [ci skip] 2019-02-24 18:45:44 +03:00
Alibek Omarov
c3abec5127 readme: add missed newlines 2019-02-24 01:11:23 +03:00
Alibek Omarov
a69bda0b9b readme: add note about commit tags 2019-02-24 01:09:35 +03:00
mittorn
576b78799e readme: fix links 2019-02-24 05:47:57 +07:00
Gianluca Boiano
faee030740 Updated instructions for Arch Linux 2019-02-24 00:19:52 +03:00
mittorn
8b5c5826a8 legacymode: prevent dropping from server when fps too high 2019-02-24 02:48:53 +07:00
Alibek Omarov
e193ac2c04 ref: more @mittorn's changes on RefAPI 2019-02-23 21:49:46 +03:00
Alibek Omarov
ee4744e7cd Merge pull request #25 from M0Rf30/master
fixed taberror: inconsistent use of tabs and spaces in indentation
2019-02-23 19:22:08 +03:00
Gianluca Boiano
142a38f3dc fixed taberror: inconsistent use of tabs and spaces in indentation 2019-02-23 15:51:03 +01:00
Alibek Omarov
e50b91b559 Update note on 64-bit engine [ci skip] 2019-02-23 13:46:16 +03:00
Alibek Omarov
2bf2b95b3a Correct & simplify CONTRIBUTING.md 2019-02-23 13:46:16 +03:00
Alibek Omarov
94cfe1217a Create CONTRIBUTING.md 2019-02-23 13:46:16 +03:00
Alibek Omarov
dbb4b2c1f9 Fix some mistypes [ci skip] 2019-02-23 13:46:16 +03:00
Alibek Omarov
6ede01ea05 Fix italic to bold [ci skip] 2019-02-23 13:46:16 +03:00
Alibek Omarov
2ecfa20f94 Fix formatting [ci skip] 2019-02-23 13:46:16 +03:00
Alibek Omarov
48808e4ede Update readme [ci skip] 2019-02-23 13:46:16 +03:00
Alibek Omarov
955dde6d5f Create README.md 2019-02-23 13:46:16 +03:00
mittorn
7299ee9f11 Try fix mingw linking 2019-02-23 18:32:49 +07:00
Alibek Omarov
5e17b4bf17 wscript: remove useless option type specifier 2019-02-19 17:55:45 +03:00
Alibek Omarov
2c17dce25b wscript: check for dedicated or singlebinary before recurse into subdirectory, add a chance to skip some subprojects on configuration stage 2019-02-19 17:49:09 +03:00
Alibek Omarov
1b372115a5 wscript: move options to subgroups, reorder option plugins loading 2019-02-19 16:33:14 +03:00
Alibek Omarov
99bd7c81da ref: render code moved out of engine, doesn't compile, first API prototype 2019-02-18 21:25:26 +03:00
mittorn
2b1ed2b20a Merge branch 'master' into netsplit 2019-02-08 07:59:52 +00:00
mittorn
f7c60ea9d1 vbo: Fix return value 2019-02-07 04:58:18 +07:00
mittorn
119b458b0f vbo: optimize buffer usage, fix some rendermodes 2019-02-07 04:35:42 +07:00
mittorn
d913ef0fc4 Port r_studio_drawelements render 2019-02-07 02:36:34 +07:00
mittorn
bccc0e63d5 Port VBO world renderer 2019-02-07 00:40:38 +07:00
mittorn
23d0f33ad1 Refactor extension detection, add VBO detection 2019-02-07 00:36:15 +07:00
mittorn
ddd17fe238 client: clear usermessages 2019-02-05 01:28:39 +07:00
mittorn
b1e3fa5f4d http: fix uninitialized progress value 2019-02-05 01:11:12 +07:00
mittorn
e99ca5947b legacymode: resource list support 2019-02-05 01:10:26 +07:00
mittorn
932cf03a29 mainui: update 2019-02-04 23:54:12 +07:00
mittorn
c09190f66e legacymode: add legacy infokey for legacy servers 2019-02-04 23:53:46 +07:00
mittorn
1d9b5d4611 http: remove unneeded platform-depended macros 2019-02-03 16:37:58 +07:00
mittorn
e05c1ed912 HTTP download support 2019-02-02 05:15:59 +07:00
mittorn
7b36796f41 Merge pull request #20 from x6herbius/improve-logging
Made various log messages more informative
2019-02-01 05:59:35 +00:00
Jonathan Poncelet
69bb25bb18 Updated a couple of messages as per pull request 2019-01-31 13:31:27 +00:00
Alibek Omarov
398d6007be Merge branch 'master' into resource 2019-01-30 22:14:13 +03:00
Alibek Omarov
4d63eb4413 sv_game: fix pfnSetModel theoretically may ignore precached models 2019-01-30 21:55:53 +03:00
Alibek Omarov
8770bdc694 keys: allow autorepeat for menu and console for any keys 2019-01-30 21:47:05 +03:00
Alibek Omarov
74f935d94f common: fix COM_IsSafeFileToDownload extension check 2019-01-30 21:39:50 +03:00
Alibek Omarov
cd30812607 sv_frame: fakeclients must be kicked on changelevel(GoldSrc compatibity) (port from Old Engine #b5b493) 2019-01-30 20:09:43 +03:00
mittorn
8b30a7631d Merge branch 'master' into resource 2019-01-30 13:38:36 +00:00
mittorn
a169f93b9f legacymode: fix netsplit settings 2019-01-30 18:56:52 +07:00
mittorn
f786ea65f5 Fix default splitsize 2019-01-30 18:41:45 +07:00
mittorn
b578d44ea2 Fix NET_EXT_SPLITSIZE console reporting 2019-01-30 16:15:57 +07:00
mittorn
40574d9be0 Network extensions 2019-01-30 16:06:32 +07:00
mittorn
7bb8124b69 legacymode: Mark old netsplit extension legacy, fix magic number 2019-01-30 15:14:43 +07:00
mittorn
2b1d4f4377 Fix zero maxsize for reliable 2019-01-30 14:48:43 +07:00
mittorn
31a53f4842 Fix cl_dlmax bounds 2019-01-30 14:11:49 +07:00
mittorn
f3468c0321 Fix Netchan_Setup arguments 2019-01-30 14:04:29 +07:00
mittorn
23af5dcaf1 In-game fragment size setting 2019-01-30 13:56:08 +07:00
mittorn
097974bde2 Check cl_dlmax sizes on client 2019-01-30 13:38:32 +07:00
mittorn
a97d8c119b network: enable new netsplit, netsplit size settings 2019-01-30 03:44:48 +07:00
mittorn
480ef0a468 legacymode: add netsplit support (incoming only) 2019-01-29 19:01:21 +07:00
mittorn
f044a59984 Port old netsplit implementation 2019-01-29 17:29:31 +07:00
mittorn
f3ae5159cb Add endian conversion macros 2019-01-29 17:27:36 +07:00
mittorn
52fca4ac0c legacymode: send identification 2019-01-29 17:00:40 +07:00
mittorn
98bf05b948 identification: fix network device detection 2019-01-29 16:38:19 +07:00
mittorn
bbd4c1315e legacymode: implement clc_userinfo 2019-01-29 02:33:30 +07:00
Jonathan Poncelet
35869586c9 Made various log messages more informative 2019-01-28 18:32:29 +00:00
mittorn
ed049ea539 Implement --single-binary and --stdin-input options 2019-01-28 14:09:06 +00:00
Alibek Omarov
6ba406be7d legacymode: some codestyle fixes 2019-01-27 03:02:16 +03:00
Alibek Omarov
860d3be42d demo: draw recording message a bit higher 2019-01-27 02:42:28 +03:00
Alibek Omarov
0801922466 cvar: don't change cvars without FCVAR_GLCONFIG variable during opengl.cfg reading 2019-01-27 02:27:12 +03:00
Alibek Omarov
103a2fccaa sdl: vid: rework safegl option 2019-01-27 02:26:23 +03:00
Alibek Omarov
cb7820b45b mainui: update 2019-01-26 23:54:11 +03:00
mittorn
1a6fd72d19 legacymode: fix choke counter 2019-01-27 02:48:09 +07:00
mittorn
5e65df3c2a legacymode: fix numFields for movevars_t 2019-01-27 02:47:43 +07:00
mittorn
b534422aed Clean delta when getting delta from server 2019-01-27 02:06:21 +07:00
mittorn
1866c00789 legacymode: fix dedicated server build 2019-01-26 17:53:38 +00:00
Alibek Omarov
1162e5a65b legacymode: retry connecting using legacy protocol automatically 2019-01-26 20:47:19 +03:00
Alibek Omarov
5da11291a2 legacymode: support server scanning 2019-01-26 18:54:23 +03:00
Alibek Omarov
042d2e436c mainui: update 2019-01-26 14:31:02 +03:00
Alibek Omarov
2da65ab122 Update submodules 2019-01-26 14:31:02 +03:00
Alibek Omarov
8c668b29c6 mainui: update 2019-01-26 14:31:02 +03:00
Alibek Omarov
75643895ef vgui_support: switch to free miniutl 2019-01-26 14:31:02 +03:00
mittorn
6a02a571c1 Legacy protocol compatibility (cl_legacymode) 2019-01-25 20:54:05 +07:00
mittorn
1e5f12a0ae Fix crash on broken model 2019-01-25 20:54:05 +07:00
Alibek Omarov
a297a0b5ad wscript: fix git commit hash 2019-01-13 16:46:50 +03:00
Alibek Omarov
9da413b2cc waf: add clang compilation database support 2019-01-13 16:46:12 +03:00
Alibek Omarov
0ca0dc9731 travis: fix packaging mingw build 2019-01-13 18:26:00 +05:00
Alibek Omarov
7205f2d4fa sound: sdl: use SDL_setenv for crossplatform 2019-01-13 18:19:35 +05:00
Alibek Omarov
196c311113 wcon: fix implicit declaration 2019-01-12 03:13:03 +03:00
Alibek Omarov
0409107ee2 scripts: appimage: fix generating extras.pak 2019-01-12 03:01:50 +03:00
Alibek Omarov
c8035c1adf host: fix implicit declaration on Win32 builds 2019-01-12 02:53:41 +03:00
Alibek Omarov
5fda638edf host: fix compiling error 2019-01-12 02:48:56 +03:00
Alibek Omarov
ed05519c60 host: rearrange conditionals in Host_CalcFPS for better readability 2019-01-11 23:20:35 +03:00
Alibek Omarov
ac77bab967 sound: opensles: same fix applied for OpenSLES/Android backend 2019-01-07 04:17:40 +03:00
Alibek Omarov
9935e2c8d3 sound: sdl: set pulseaudio environment variables regardless of target OS, because PA is crossplatform 2019-01-07 04:09:55 +03:00
Alibek Omarov
80fc7209ed sound: move related function declarations to platform header. Remove unused. 2019-01-07 04:07:06 +03:00
Alibek Omarov
908082097f wscript: error on implicit function declaration by default on any build type. Remove redutant Options import. 2019-01-07 03:59:56 +03:00
iZarif
245533defa wscript: SUBDIRS loop refactor 2018-12-30 20:39:17 +03:00
Alibek Omarov
b8c4c31e02 Merge 4344 update 2018-12-30 01:51:02 +03:00
Alibek Omarov
626df3673c Fix missing newline after exec userconfig.cfg 2018-12-25 06:12:01 +03:00
Alibek Omarov
3a288ffe4a Merge pull request #12 from Slipyx/misc
Add the 'sleeptime' cvar and behavior from the 'Old Engine'.
2018-12-23 16:32:48 +03:00
Josh K
422e511aac Added the 'sleeptime' cvar and behavior from the 'Old Engine'. 2018-12-23 07:32:13 -05:00
Alibek Omarov
621cdba53c engine: android: restore OpenSL ES audio 2018-12-20 10:22:04 +03:00
Alibek Omarov
e7ddc6d6c5 engine: android: restore dlsym hack for old Android(<5.0) 2018-12-20 10:15:44 +03:00
Alibek Omarov
b1a06baf83 wscript: link -llog on Android 2018-12-20 10:15:08 +03:00
Alibek Omarov
c3c0954613 mainui: update 2018-12-20 10:14:45 +03:00
Alibek Omarov
463a339a09 wscript: initial support for building on Android 2018-12-20 09:48:22 +03:00
Alibek Omarov
71cae6b02b waflib: add xcompile helper plugin intended to integrate with platform SDKs, like Android NDK 2018-12-20 09:44:51 +03:00
Alibek Omarov
ccac3e9cfc wscript: try to fix linking vgui on osx 2018-12-19 07:12:45 +03:00
Alibek Omarov
aac44ef866 waflib: try to fix sdl2 searching on osx again 2018-12-19 06:57:54 +03:00
Alibek Omarov
5d6d6c766e scripts: sdl2: fix finding sdl2 on osx 2018-12-17 03:11:41 +03:00
Alibek Omarov
28e6dec4b0 scripts: osx: fix path to SDL2 framework 2018-12-17 02:59:57 +03:00
Alibek Omarov
e2606cf97f scripts: stop executing script and print config.log, if waf was failed. 2018-12-17 02:53:00 +03:00
Alibek Omarov
cfea381c84 vgui_support: wscript: fix finding VGUI on osx, simplify sanity check 2018-12-17 02:36:14 +03:00
Alibek Omarov
bd7e2fe88d wscript: use no-undefined only on gcc 2018-12-17 02:35:37 +03:00
Alibek Omarov
30c32b0088 waflib: sdl2: fix finding sdl2 on osx 2018-12-17 02:34:49 +03:00
Alibek Omarov
95ce9fc00f wscript: explicitly set language when checking library 2018-12-16 17:10:01 +03:00
Alibek Omarov
a580e98f28 waflib: force_32bit: try to fix passing additional flags to generate 32bit code on MacOSX 2018-12-16 17:01:12 +03:00
Alibek Omarov
2072f5c276 scripts: fix travis scripts after refactoring wscript 2018-12-13 18:44:13 +03:00
Alibek Omarov
28c47a5c86 scripts: fix travis scripts after refactoring wscripts 2018-12-13 18:43:33 +03:00
Alibek Omarov
08dd632d87 wscript: fix git version definition 2018-12-13 08:13:27 +03:00
Alibek Omarov
bbde1394e1 wscript: move some code to our waflib, remove --no-gcc-colors, as newer GCC colorize output automatically, so there is no need in -fdisagnostic-colors=aloways flag, move common win32 libraries check here, better output for subprojects 2018-12-13 08:08:33 +03:00
Alibek Omarov
ede52d7808 mainui: update 2018-12-13 08:05:56 +03:00
Alibek Omarov
9ce9fa8cb5 vgui_support: wscript: refactor, use shared get_subproject_name, rename no-vgui to disable-vgui to follow automake-style convention, add vGUI library sanity check 2018-12-13 08:05:31 +03:00
Alibek Omarov
6debd84a2e game_launch: wscript: refactor, use shared get_subproject_name 2018-12-13 08:03:51 +03:00
Alibek Omarov
62995b0769 engine: wscript: refactor, use sdl2.py to get configure SDL2, use shared get_subproject_name 2018-12-13 08:03:26 +03:00
Alibek Omarov
ec50c4571c waflib: add some waf plugins by FWGS 2018-12-13 08:00:22 +03:00
Alibek Omarov
09938b978b gitignore: allow waflib directory, hide pyc and pycache 2018-12-13 07:48:51 +03:00
Alibek Omarov
6eb327eac2 scripts: enable verbose build, fix including SDL2 2018-12-13 03:25:46 +03:00
Alibek Omarov
cbb8db0089 travis: add mingw build deployment 2018-12-12 04:50:24 +03:00
Alibek Omarov
154ef82719 scripts: add mingw build archive creation 2018-12-12 04:49:11 +03:00
Alibek Omarov
ec80b0884f travis: deploy at least appimage now 2018-12-12 04:33:36 +03:00
Alibek Omarov
6a78b4ed1f scripts: fix appimagetool warning 2018-12-12 04:33:18 +03:00
Alibek Omarov
239c6759cb scripts: add travis deploy script 2018-12-12 04:32:58 +03:00
Alibek Omarov
017714f3a0 scripts: give build_appimage.sh +x 2018-12-12 04:24:47 +03:00
Alibek Omarov
16aa5a78fe travis: building appimage requires libfuse2 library 2018-12-12 04:21:10 +03:00
Alibek Omarov
baa94e2064 mainui: update 2018-12-12 04:19:47 +03:00
Alibek Omarov
f9b13472b5 scripts: autobuild appimage on travis 2018-12-12 04:19:17 +03:00
Alibek Omarov
2922267ae1 scripts: add xash-extras to travis common deps 2018-12-12 04:18:58 +03:00
Alibek Omarov
3c4e75f1b2 scripts: add script building AppImage based on portable build for Linux 2018-12-12 04:18:09 +03:00
Alibek Omarov
130a7b3c42 scripts: move makepak.py from android project repo to engine main repo, port to python3, replace spaces by tabs 2018-12-12 04:16:23 +03:00
mittorn
17b0c23f2e Show engine arch in version 2018-12-06 04:28:19 +07:00
mittorn
4b58b0b168 Fix console background aspect ratio 2018-12-06 03:00:39 +07:00
mittorn
298393b653 Initial amd64 port 2018-12-05 23:57:05 +07:00
mittorn
aed53c4fda Do not spam in console if vsync not availiable 2018-12-05 23:56:41 +07:00
a1batross
7ad7af76dd render: register r_showtree cvar 2018-11-30 22:56:20 +03:00
a1batross
0964fb11e4 sdl: partially fix maximizing window on Windows 2018-11-29 21:43:51 +03:00
a1batross
f173ce11f7 console: fix version drawn all the time which engine runs 2018-11-29 20:43:53 +03:00
a1batross
3046c9e68e gitignore: update 2018-11-29 20:24:39 +03:00
a1batross
137836348b client: fix GetCenterWindow engine call 2018-11-29 20:24:25 +03:00
a1batross
05eab0b5b0 system: fix win32 build 2018-11-29 19:48:16 +03:00
Alibek Omarov
a1edbaced4 mainui: update submodule 2018-11-29 01:54:45 +03:00
Alibek Omarov
3fe737058f buildinfo: add host_ver cvar 2018-11-29 01:54:25 +03:00
Alibek Omarov
9c3e8f7e48 buildinfo: remove XASH_RELEASE 2018-11-29 01:54:09 +03:00
Alibek Omarov
dcf64c6b33 Fix build, update menu 2018-11-27 16:38:22 +03:00
Alibek Omarov
b9945d62a3 Apply 4312 update 2018-11-27 16:15:24 +03:00
Alibek Omarov
776d1cb52c wscript: try to fix windres searching for game_launch, fix osx 32 bit compiling 2018-11-19 01:58:40 +03:00
Alibek Omarov
81e142936d wscript: use lower-case win32 libraries names for crosscompiling from Linux 2018-11-19 00:46:29 +03:00
Alibek Omarov
a6fba0cb96 travis: scripts: try to fix mingw and osx build 2018-11-18 23:16:12 +03:00
Alibek Omarov
1b9bfd8906 platform: sdl: fix compiling 2018-11-18 23:04:47 +03:00
Alibek Omarov
e9d988f5d6 wscript: spaces to tabs 2018-11-18 23:04:30 +03:00
Alibek Omarov
7852192fc4 wscript: replace include/SDL by include/SDL2 2018-11-18 22:56:30 +03:00
Alibek Omarov
4db01487ba travis: scripts: install python for osx 2018-11-18 22:55:47 +03:00
Alibek Omarov
7b806add63 wscript: fix SDL2 include path 2018-11-18 22:48:52 +03:00
Alibek Omarov
d3c310628f travis: scripts: enable stb font renderer for linux 2018-11-18 22:41:16 +03:00
Alibek Omarov
62af116654 travis: scripts: set SDL2 prefix 2018-11-18 22:37:06 +03:00
Alibek Omarov
2b085cb69e game_launch: remove SDL for simplicity 2018-11-18 22:34:16 +03:00
Alibek Omarov
27ee4337fe travis: fix building sdl2, fix libpath in wscript 2018-11-18 18:52:57 +03:00
Alibek Omarov
f0297fc448 travis: initial support 2018-11-18 18:33:32 +03:00
Alibek Omarov
d74743ac1d mainui: update 2018-11-18 18:19:45 +03:00
Alibek Omarov
28471aee97 cl_game: get rid of int* to float* conversion 2018-11-18 18:19:31 +03:00
Alibek Omarov
deb537c1bb common: fix NULL redefine(do we really need NULL definition?) 2018-11-18 17:52:01 +03:00
Alibek Omarov
9d93eca572 platform: linux: fix descriptor leak 2018-11-18 17:50:15 +03:00
Alibek Omarov
66d1a632a7 net_ws: fix possible garabe in return value due to uninitialized value 2018-11-18 17:14:38 +03:00
Alibek Omarov
847be54457 wscript: refactor adding compiler flags, remove --release flag, instead add mandatory --build-type flag 2018-11-18 17:02:40 +03:00
Alibek Omarov
9d156b4285 crclib: md5: fix memset call 2018-11-17 01:40:35 +03:00
Alibek Omarov
edde871eb5 console: fix console font scale for Quake I fonts, fix drawing arrows in console for Quake I 2018-11-17 01:26:57 +03:00
Alibek Omarov
7c772d6bfd engine: rework timer stuff, move to platform. Move debugger present checks to platform 2018-11-16 16:32:16 +03:00
Alibek Omarov
f0d0861160 PhysicAPI: fix callback list initialization 2018-11-16 15:34:33 +03:00
Alibek Omarov
1ef0b44a41 filesystem: allow setting extras.pak by env-var for everyone 2018-11-16 15:34:02 +03:00
Alibek Omarov
25d8a94c1c engine: fix implicit declaration, remove dead MsgDev now, fix const modifier loss in host.c 2018-11-16 15:25:04 +03:00
Alibek Omarov
b60b3f7d18 GameUI: avoid const modifier loss 2018-11-16 15:12:43 +03:00
Alibek Omarov
b1db062fbc Merge pull request #3 from nekonomicon/bsd
*BSD-related fixes.
2018-11-05 18:25:05 +03:00
Night Owl
d4e5e609af Do not break video subsystem initialization. 2018-11-05 15:39:00 +05:00
Night Owl
f36d1f5621 Use execv instead of execve, because environ symbol breaks compilation with -Wl,--no-undefined flag under FreeBSD via Waf. 2018-11-05 15:39:00 +05:00
Night Owl
f350683e83 wscript: avoid linuxisms and gccisms. 2018-11-05 15:38:48 +05:00
Alibek Omarov
3c5f7de747 vgui_support: wscript: forgot to set MSVC_SUBSYSTEM for WinXP compatibility 2018-11-02 01:35:45 +03:00
Alibek Omarov
d81288d281 wscript: remove no-download-deps, autodownloading of dependencies not done yet 2018-11-02 01:35:10 +03:00
Alibek Omarov
d18708acf5 keys: fix indentation 2018-11-02 01:09:09 +03:00
Alibek Omarov
18353d9ae6 net_ws: allow to set custom IP address, use Q_strncpy instead of Q_strcpy 2018-11-02 01:06:23 +03:00
Alibek Omarov
ef39f9c9cf engine: dedicated: fix build 2018-11-01 23:31:16 +03:00
Alibek Omarov
a03aa3ddb3 Merge 4281 update 2018-10-28 00:39:29 +03:00
Alibek Omarov
c09aff8bd7 mainui: update 2018-10-27 23:29:10 +03:00
Alibek Omarov
70518a873c update my Qt Creator project 2018-10-27 23:28:29 +03:00
Alibek Omarov
95e64f3997 vgui: remove dead vgui_surf.cpp file 2018-10-27 23:28:29 +03:00
Alibek Omarov
2fab2d9f7e wscript: update 2018-10-27 23:28:29 +03:00
Alibek Omarov
de838ec5e8 rename backend files for great justice and consistency 2018-10-27 23:28:29 +03:00
Alibek Omarov
90d2434bb0 platform: add Set/GetClipboardText calls. Remove unneeded SDL_SetHint call on Android, because Android does not use SDL anymore 2018-10-27 23:28:29 +03:00
Alibek Omarov
96e0167e47 platform: add GetMousePos, SetMousePos calls, fix typo 2018-10-27 23:28:29 +03:00
a1batross
68ed732928 win_con: fix version in title, change title for dedicated server 2018-10-24 20:55:00 +03:00
a1batross
c603abfebf crashhandler: fix developer mode check 2018-10-24 20:18:06 +03:00
a1batross
85960b2c90 wscript: enable DBGHELP for Win32 2018-10-24 20:17:44 +03:00
a1batross
ca501c0378 wscript: add possibility to select windows subsystem during link, add define to use WinXP SDK. This commit forces WinXP compability on latest Visual Studio 2018-10-24 20:12:32 +03:00
Alibek Omarov
e9e364f054 wscript: move sdl path to root wscript 2018-10-22 01:01:22 +03:00
Alibek Omarov
7c9af89620 input: remove unneeded joy_found extern 2018-10-22 00:36:58 +03:00
Alibek Omarov
f4567b2c9d sound: make snd_mute_losefocus accessible outside 2018-10-22 00:36:38 +03:00
Alibek Omarov
7390d11505 platform_sdl: adapt SDL backend code to new platform backends system 2018-10-22 00:28:24 +03:00
Alibek Omarov
960e46c564 engine: adapt engine code to new platform backends system 2018-10-22 00:27:52 +03:00
Alibek Omarov
265f79fc72 platform: add GetNativeObject call 2018-10-22 00:21:05 +03:00
Alibek Omarov
a5258bea65 library: move win32 definitions to win_lib.c 2018-10-22 00:13:56 +03:00
Alibek Omarov
25f07ddb97 platform: introduce common header for platform-dependent functions. To keep clean code and engine platform-agnostic, now including headers from platform folder, except this one, is strictly prohibited. 2018-10-21 23:52:14 +03:00
Alibek Omarov
6ba7781a61 input: various fixes: fix mistyped pitch/yaw, replace SDL_GetMouseState by SDL_GetRelativeMouseState, fix disabling mouse with -nomouse argument 2018-10-21 22:13:58 +03:00
Alibek Omarov
23a7dce3be mainui: update 2018-10-21 22:06:17 +03:00
Alibek Omarov
880d3de53a input: move evdev under m_ignore 2018-10-21 22:04:24 +03:00
Alibek Omarov
5af7a19b40 Rename contib to contrib 2018-10-21 14:17:36 +03:00
Alibek Omarov
da094fa04e input: provide a common function for collecting input from different sources 2018-10-11 00:04:23 +03:00
Alibek Omarov
bff9ca8438 console: fix double printed console messages on Win32 2018-10-10 23:43:03 +03:00
Alibek Omarov
e50d22bce7 mainui: update 2018-10-10 23:38:58 +03:00
Alibek Omarov
216b4f4147 vid_sdl: fix incorrect video modes list length 2018-10-10 23:36:34 +03:00
Alibek Omarov
4ced29ee8f vid_common: fix window_center_x/y initialization 2018-10-10 20:22:11 +03:00
Alibek Omarov
844b3a39a7 vid_sdl: fix GL_UpdateContext, fix window created outside screen if positions were negative 2018-10-10 20:01:54 +03:00
Alibek Omarov
9e618ce3e1 cmd: base_cmd: fix inconsistency between linked list and hash map 2018-10-10 00:42:06 +03:00
Alibek Omarov
abda3b52ab game_launch: remove two different names for engine DLLs 2018-10-10 00:41:18 +03:00
Alibek Omarov
649f32a185 wscript: fix install 2018-10-08 22:39:33 +03:00
Alibek Omarov
8710922a61 waf: update 2018-10-08 22:39:33 +03:00
Alibek Omarov
8ea5536b42 wscript: fix win32 build 2018-10-08 22:39:33 +03:00
Alibek Omarov
48d1aa5115 engine: fix warnings 2018-10-06 03:42:09 +03:00
Alibek Omarov
eafe5d6c68 mainui: update 2018-10-06 03:30:38 +03:00
Alibek Omarov
f1d9034546 GameUI: fix menu APIs loading order 2018-10-06 03:28:40 +03:00
mittorn
b0c077ccf8 Persistent console history 2018-10-04 18:10:12 +07:00
mittorn
a0f0eca77c Backup console input when using history 2018-10-04 16:38:39 +07:00
mittorn
e74513556a Fix gcc colors 2018-10-04 16:09:03 +07:00
mittorn
891c984c56 Port some config changes 2018-10-04 16:08:49 +07:00
mittorn
491188a0f3 Merge branch 'original' 2018-10-04 14:27:14 +07:00
mittorn
9dadc0de93 Make vgui build dependence optional as it does not have opensource license 2018-10-04 12:28:25 +07:00
mittorn
1dedf0e208 Fix tab in wscript 2018-10-04 12:15:05 +07:00
Alibek Omarov
e123499e23 Fix build 2018-07-12 23:22:06 +03:00
Alibek Omarov
7601a4cd29 Revert 64257ef to not break C++ header compability 2018-07-12 23:13:30 +03:00
Alibek Omarov
c8b78b4124 Update mainui 2018-07-10 23:05:57 +03:00
Alibek Omarov
fdb2055b62 Add RoDir support 2018-07-10 23:03:27 +03:00
Alibek Omarov
2c0a03704c Update mainui. Add --enable-bsp2 switch into wscript 2018-07-10 17:29:05 +03:00
Alibek Omarov
2edbcb996d Merge 4150 update. Fix some mistypings. Rename CL_IsQuakeCompatible to Host_IsQuakeCompatible, as it may be used in whole engine and even in dedicated builds. IN_RecalcCenter was not added, window center positions should be updated by backends. 2018-06-19 16:59:53 +03:00
Alibek Omarov
76e01f490c Update mainui. Make VGUI search message more friendly. Update gitignore 2018-06-19 16:17:27 +03:00
Alibek Omarov
f23029efe0 Refactoring wscript. Add execute flag on waf 2018-06-17 14:30:59 +03:00
Alibek Omarov
e70dea54c0 Add waf itself(with included wurf and msvs.py) and waf.bat launcher for Windows 2018-06-14 21:23:38 +03:00
Alibek Omarov
ca28332c6c Use msvs.py to generate Visual Studio project. Add debug flags for Visual Studio 2018-06-14 21:22:17 +03:00
Alibek Omarov
f15e2c2dcf Move command autocomplete to common engine files, as it used by Wcon and may be used by curses console in future 2018-06-14 21:19:04 +03:00
Alibek Omarov
572705bc08 MSVC & Win32 wscript fixes 2018-06-14 20:34:51 +03:00
Alibek Omarov
473810fc0c MSVC & Win32 related fixes 2018-06-14 20:32:40 +03:00
Alibek Omarov
d0ff201da2 Fix dedicated compiling errors 2018-06-14 20:31:46 +03:00
Alibek Omarov
b5c621ae36 Fix mainui submodule 2018-06-14 19:27:06 +03:00
Alibek Omarov
7cdead7bac Merge 4143 update 2018-06-12 12:18:14 +03:00
Alibek Omarov
f26ac52102 Merge 4140 update 2018-06-11 14:04:50 +03:00
Alibek Omarov
5d48708615 Forgot to add cvars into basecmd. Add basecmd_test to check is basecmd valid 2018-06-01 22:11:22 +03:00
Alibek Omarov
0561ac2076 Add basecmd from old engine. Add basecmd_stats command 2018-06-01 21:28:25 +03:00
Alibek Omarov
ae5257c654 Add masterlist from engine. Use non-blocking network name resolution 2018-06-01 20:44:16 +03:00
Alibek Omarov
5a449a56ea Port restricted cmds and cvars from old engine. TODO: implement better stufftext filter 2018-06-01 19:57:54 +03:00
Alibek Omarov
69549787bc net_ws refactoring, fix minor bugs 2018-06-01 19:29:47 +03:00
Alibek Omarov
0db8d95bc9 Update mainui. Add possibility to install engine ignoring *nix file hierarchy in wscript. Fix debugging. 2018-05-29 01:02:32 +03:00
Alibek Omarov
236c16e35f Update QtCreator project 2018-05-29 00:58:45 +03:00
Alibek Omarov
79d8bc2cdd Get rid of accidentally added CMakeLists 2018-05-29 00:20:07 +03:00
Alibek Omarov
fac536f8c4 Add mainui_cpp. Use appropriate message in vgui_support's wscript. 2018-05-28 23:47:38 +03:00
Alibek Omarov
aa5d52cebc Change libxashmenu to libmenu to keep same names between different OSes 2018-05-28 23:44:52 +03:00
Alibek Omarov
7e372645da Add my personal IDE settings to contrib. Add QtCreator generated files to gitignore. 2018-05-28 23:13:50 +03:00
Alibek Omarov
0c058f2eca Add waf buildscripts, add updated game_launch 2018-05-28 23:13:50 +03:00
Alibek Omarov
d9320f964e Crashhandler refactoring for POSIX systems. Shows engine version now. 2018-05-28 23:13:50 +03:00
Alibek Omarov
b29adf752c Merge pull request #1 from lewa-j/master
Fix MinGW build
2018-05-13 23:39:36 +03:00
lewa_j
43b746d2f8 Fix MinGW build 2018-05-13 23:25:51 +03:00
mittorn
817206815d reslist.txt support 2018-05-05 02:24:55 +07:00
mittorn
37aa201ed7 Fix memory leak 2018-05-05 01:20:46 +07:00
mittorn
d3a0146b5a Fix sound downloading 2018-05-05 00:12:30 +07:00
mittorn
30771fefa6 Forbid download not precached files 2018-05-05 00:01:32 +07:00
mittorn
6ae44d7577 Fix downloading models with zero res->ucFlags 2018-05-04 23:16:47 +07:00
mittorn
42b4e456a2 Fix log 2018-05-03 23:51:23 +07:00
mittorn
290b9cae0b Restore utf-8 support 2018-05-03 23:31:03 +07:00
Alibek Omarov
ec6bfa2421 Let server physics simulate even when there is no players(GoldSrc behaviour) 2018-05-03 17:53:49 +03:00
Alibek Omarov
46a3e729db Fix collision being calculated on unlagged value for both players and bots. 2018-05-03 17:43:26 +03:00
Alibek Omarov
5ca7bb5f12 Fix noise index for not sine beams 2018-05-03 17:42:21 +03:00
Alibek Omarov
86dfaf9930 Fix too loud entities in multiplayer 2018-05-03 17:41:39 +03:00
Alibek Omarov
7d37ff33aa Fix high CPU load on Linux 2018-05-01 21:52:17 +03:00
Alibek Omarov
415e517107 Library loader refactoring. Not tested for platforms other than Linux 2018-05-01 21:52:00 +03:00
Alibek Omarov
0b0ec876a5 Oops, this isn't supposed to be commited 2018-05-01 17:53:25 +03:00
Alibek Omarov
34f6f6d539 Fix implicit declaration on dedicated 2018-05-01 17:37:25 +03:00
Alibek Omarov
0681209114 Remove useless host.type set, replace HOST_DEDICATED checks by Host_IsDedicated 2018-05-01 17:30:33 +03:00
Alibek Omarov
becd0eba03 Possibility to use dedicated version with SDL(it's used only by internal timer) 2018-05-01 17:30:33 +03:00
mittorn
063eb151c4 waf options for dedicated server and 64-bits 2018-05-01 03:04:30 +07:00
Alibek Omarov
3f2a8f7704 Remove vid_mode. VID_GetModeString now returns only supported modes from SDL2 2018-04-29 09:21:23 +03:00
Alibek Omarov
c8b83385df Add waf related files to gitignore. Restore cl_trace_messages 2018-04-29 04:25:41 +03:00
mittorn
ac1c8594b7 Add waf build script and legacy makefile to contrib 2018-04-28 23:32:55 +00:00
mittorn
0c903c1e56 Fix dedicated server build 2018-04-26 14:11:01 +00:00
Alibek Omarov
dcc19aeafb Merge 4097 2018-04-26 03:23:00 +03:00
Alibek Omarov
faf15df62f Correct max_particles clamping 2018-04-26 02:53:24 +03:00
Alibek Omarov
a3c90248a7 Remove unneeded argument in SDLash_KeyEvent. Remove copypasted code 2018-04-26 02:52:49 +03:00
Alibek Omarov
78365d2bc6 Add new two functions to Menu API 2018-04-24 05:54:57 +03:00
Alibek Omarov
176b31b4a2 Fix wrong max edicts clamp. Add game_dll_linux and game_dll_osx to gameinfo.txt. Fix crash in R_ChangeVideoSettings 2018-04-24 05:50:10 +03:00
Alibek Omarov
efe8ddf151 Fix missing const-qualifiers in engine code. Fix qboolean/int mixing in interface implementations(int is preferred). Replace long by int in COM_RandomLong. 2018-04-23 23:07:54 +03:00
Alibek Omarov
e1f80fba3d Add forgotten const-qualifiers in interface headers. Remove unneeded PM headers 2018-04-23 23:06:18 +03:00
Alibek Omarov
fd649905ea Fix some format warnings 2018-04-23 21:49:37 +03:00
Alibek Omarov
bd4988e588 More _format() attribute 2018-04-23 21:37:35 +03:00
Alibek Omarov
4ef527a92d Print version by _sv_build_info server command 2018-04-23 21:36:59 +03:00
Alibek Omarov
e8d13cd0d5 Rebrand from Xash3D to Xash3D FWGS. Add _format() attrubute to print-like functions 2018-04-23 21:36:33 +03:00
Alibek Omarov
501985be48 Remove accidentally left debug 2018-04-22 17:19:54 +03:00
Alibek Omarov
ebe3a203ba Always fragment upload data, this fixes some cases when upload must be fragmented, but download test shown no fragmentation requirement 2018-04-22 17:17:35 +03:00
Alibek Omarov
63513ec475 Small refactoring of EnableTextInput 2018-04-22 14:01:56 +03:00
Alibek Omarov
545b781934 Restore hud_utf8 2018-04-22 14:01:22 +03:00
Alibek Omarov
0d035746d5 Remove lowercase-ing in listdirectory() 2018-04-22 13:10:16 +03:00
Alibek Omarov
ec41db7ef8 Prepend USE_SELECT and COLORIZE_CONSOLE with XASH_ 2018-04-22 13:07:40 +03:00
Alibek Omarov
362217935f Don't increase server library reference counter, free it pfnCheckGameDll 2018-04-22 13:01:06 +03:00
mittorn
8704c07e4b Merge branch 'original' 2018-04-21 13:44:06 +00:00
mittorn
7d1df4c097 Add string.h, fix decals with unsigned char 2018-04-21 13:39:55 +00:00
Alibek Omarov
2c755778f4 Deprecate secure parameter 2018-04-21 11:16:33 +03:00
Alibek Omarov
9ab3300b76 Rename allow_console to developer in menu_int.h. Define NEW_ENGINE_INTERFACE. 2018-04-21 11:16:11 +03:00
Alibek Omarov
535b00d98f Fix GameInfo parsing 2018-04-21 02:51:14 +03:00
Alibek Omarov
de35262a3b Fix network send packet 2018-04-21 02:50:50 +03:00
Alibek Omarov
314a6deba9 Remove gamedir[] from engine-side gameinfo_t 2018-04-21 01:22:00 +03:00
Alibek Omarov
d3990e03e6 Add text input mode calls where they should be. Disable text input mode at initialization 2018-04-21 00:37:16 +03:00
Alibek Omarov
cec7bf8488 Fix server library sanity checking 2018-04-21 00:36:14 +03:00
Alibek Omarov
32aa9a9f54 Implement Mobility API support. Add missing IN_TouchShutdown and Joy_Shutdown calls. Don't save video and opengl configs if engine crashed. 2018-04-21 00:13:20 +03:00
Alibek Omarov
b7622e6009 Fix implicit function declaration. Fix struct declaration in parameter list 2018-04-21 00:05:08 +03:00
Alibek Omarov
fd1f0e685a Restore con_fontscale functionality 2018-04-21 00:03:59 +03:00
Alibek Omarov
a015d6b915 Revert fork's hud_scale behaviour 2018-04-21 00:03:19 +03:00
mittorn
7350be6e7f Fix build after update 2018-04-20 21:48:12 +00:00
mittorn
926b909f3d Merge branch 'original' 2018-04-20 12:38:53 +00:00
mittorn
c1076f43f7 Update client engine interface 2018-04-19 21:51:17 +00:00
mittorn
af7123f7dd Merge branch 'original' (except gldebug, msaa) 2018-04-19 20:47:41 +00:00
Alibek Omarov
5d13112e25 Dedicated build 2018-04-18 18:32:30 +03:00
Alibek Omarov
40094f2867 Move client-only parts to client 2018-04-18 18:10:32 +03:00
Alibek Omarov
6db7c191eb Add fork's mobility_int.h(no support yet, just header) 2018-04-17 03:57:21 +03:00
Alibek Omarov
a2e2dd5bdf Add libmpg source 2018-04-17 03:57:04 +03:00
Alibek Omarov
7fdabb73a8 Add identification support from fork 2018-04-17 03:56:49 +03:00
Alibek Omarov
86337db5b3 Use fork's keydefs.h 2018-04-17 03:56:13 +03:00
Alibek Omarov
8e3c748f12 Adapt vgui_support support to newer engine 2018-04-17 03:56:01 +03:00
Alibek Omarov
b825e584f3 Replace GL_TEXTURE by XASH_TEXTURE because it's used internally by GL.h 2018-04-17 03:55:36 +03:00
Alibek Omarov
13fe097318 Merge fork's unicode changes(partial) 2018-04-17 03:54:07 +03:00
Alibek Omarov
5af7eb6c18 Add support for TextAPI in menu 2018-04-17 03:53:18 +03:00
Alibek Omarov
be4b885254 Merge common SDL port changes 2018-04-17 03:53:01 +03:00
Alibek Omarov
b70fab5384 Add Sys_GetIntFromCmdLine 2018-04-17 03:49:30 +03:00
Alibek Omarov
92c321848d Adapt input code to newer engine 2018-04-17 03:48:02 +03:00
Alibek Omarov
2de6d00a82 Update filesystem. Use fork's gameinfo/liblistgam parser, use PATH_SPLITTER to avoid errors 2018-04-17 03:46:30 +03:00
Alibek Omarov
5744aa8d9e Add SDL sound backend 2018-04-17 03:44:53 +03:00
Alibek Omarov
fc7ed1ab75 Add SDL video backend 2018-04-17 03:44:17 +03:00
Alibek Omarov
7c9b724531 Implement dynamic library loading and symbol resolving 2018-04-17 03:43:27 +03:00
Alibek Omarov
64257ef428 Avoid some struct declaration in parameter list 2018-04-14 04:26:12 +03:00
Alibek Omarov
4a0add4063 Move Win32 console into separate file(second commit), hide Win32 console code under _WIN32 macro. Add some fork-specific macros. Add sys_con.c for generic log file implementation. 2018-04-14 04:08:28 +03:00
Alibek Omarov
45c0eaa26c Move Win32 console and library loader to platform/win32 folder. 2018-04-14 03:31:43 +03:00
Alibek Omarov
15096aa15a net_ws port. Port non-blocking NS resolution also. 2018-04-14 03:27:52 +03:00
Alibek Omarov
36f756feeb Avoid some struct declarations inside paramater list, it makes even GCC7 confusing 2018-04-14 02:51:00 +03:00
Alibek Omarov
4d4a7d49d5 mathlib.c port 2018-04-14 02:45:48 +03:00
Alibek Omarov
4189af8b50 Engine input port. Incomplete integration of touch, gamepad, evdev input 2018-04-14 02:42:41 +03:00
Alibek Omarov
990d526a07 Add crashhandler.c file 2018-04-14 01:50:19 +03:00
Alibek Omarov
5a1b03ac20 Integrate FWGS vgui_support 2018-04-14 01:49:14 +03:00
Alibek Omarov
158db1c454 img_bmp.c port 2018-04-14 01:26:52 +03:00
Alibek Omarov
7ace83eeab Add Sys_Warn 2018-04-14 01:26:25 +03:00
Alibek Omarov
b940a62f02 host.c port 2018-04-13 21:28:46 +03:00
Alibek Omarov
d564a062ce Filesystem port 2018-04-13 20:44:39 +03:00
Alibek Omarov
7671365c92 Rename _alloca back to alloca 2018-04-13 20:22:12 +03:00
Alibek Omarov
f7a58ec04d Remove MSVC-specific try-except for C in Q_vsnprintf 2018-04-13 20:14:20 +03:00
Alibek Omarov
8e508cf065 Remove WGL function pointers, remove HDC 2018-04-13 20:13:54 +03:00
Alibek Omarov
e5b0473e4a Fix conflicting types on NXPrintf function family 2018-04-13 20:08:50 +03:00
Alibek Omarov
136123eeb3 SV_BroadcastPrintf already defined in common.h. Remove definition from server.h. 2018-04-13 19:58:47 +03:00
Alibek Omarov
32b07cda86 Add kbutton.h, fix includes 2018-04-13 19:58:17 +03:00
Alibek Omarov
25325e6150 Port common.h and system.h. Add backends.h, defaults.h, port.h, xash3d_types.h from fork 2018-04-13 19:56:43 +03:00
Alibek Omarov
a639b72e90 AVI stub for non-Windows 2018-04-13 19:42:17 +03:00
Alibek Omarov
08984bd549 Rename features.h to enginefeatures.h because this name used internally by glibc 2018-04-13 19:26:48 +03:00
Alibek Omarov
bf08a8261b Add .gitignore 2018-04-13 19:25:39 +03:00
424 changed files with 100730 additions and 22419 deletions

35
.cirrus.yml Normal file
View File

@@ -0,0 +1,35 @@
task:
name: freebsd-11-amd64
freebsd_instance:
image_family: freebsd-11-4
setup_script:
- pkg update
- pkg install -y git sdl2 python
- git submodule update --init --recursive
test_script:
- ./scripts/cirrus/build_freebsd.sh dedicated
- ./scripts/cirrus/build_freebsd.sh full
task:
name: freebsd-12-amd64
freebsd_instance:
image_family: freebsd-12-2
setup_script:
- pkg update
- pkg install -y git sdl2 python
- git submodule update --init --recursive
test_script:
- ./scripts/cirrus/build_freebsd.sh dedicated
- ./scripts/cirrus/build_freebsd.sh full
task:
name: freebsd-13-amd64
freebsd_instance:
image_family: freebsd-13-0-snap
setup_script:
- pkg update
- pkg install -y git sdl2 python
- git submodule update --init --recursive
test_script:
- ./scripts/cirrus/build_freebsd.sh dedicated
- ./scripts/cirrus/build_freebsd.sh full

9
.editorconfig Normal file
View File

@@ -0,0 +1,9 @@
# EditorConfig is awesome: https://EditorConfig.org
root = true
[*]
charset = latin1
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
*.c text eol=lf diff=cpp
*.h text eol=lf diff=cpp
wscript text eol=lf diff=python

70
.github/workflows/c-cpp.yml vendored Normal file
View File

@@ -0,0 +1,70 @@
name: Build & Deploy Engine
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
targetos: linux
targetarch: amd64
- os: ubuntu-18.04
targetos: linux
targetarch: i386
- os: ubuntu-18.04
targetos: android
targetarch: 32
- os: ubuntu-18.04
targetos: android
targetarch: 64
- os: ubuntu-18.04
targetos: motomagx
targetarch: armv6
- os: windows-latest
targetos: win32
targetarch: amd64
- os: windows-latest
targetos: win32
targetarch: i386
env:
SDL_VERSION: 2.0.14
GH_CPU_ARCH: ${{ matrix.targetarch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANDROID_SDK_TOOLS_VER: 4333796
ANDROID_NDK_VER: r10e
UPLOADTOOL_ISPRERELEASE: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Checkout xash-extras
uses: actions/checkout@v2
with:
repository: FWGS/xash-extras
path: xash-extras
- name: Install dependencies
run: bash scripts/gha/deps_${{ matrix.targetos }}.sh
- name: Build engine
run: bash scripts/gha/build_${{ matrix.targetos }}.sh
- name: Upload engine (android)
if: matrix.targetos == 'android'
run: bash scripts/continious_upload.sh xashdroid-${{ matrix.targetarch }}.apk
- name: Upload engine (motomagx)
if: matrix.targetos == 'motomagx'
run: bash scripts/continious_upload.sh xash3d-fwgs-magx.7z
- name: Upload engine (linux)
if: matrix.targetos == 'linux'
run: bash scripts/continious_upload.sh xash3d-fwgs-${{ matrix.targetarch }}.AppImage xashds-linux-${{ matrix.targetarch }}
- name: Upload engine (windows)
if: matrix.targetos == 'win32'
run: bash scripts/continious_upload.sh xash3d-fwgs-win32-${{ matrix.targetarch }}.7z

334
.gitignore vendored Normal file
View File

@@ -0,0 +1,334 @@
# Binaries
*.o
*.so
*.a
*.framework
# Other
*.save
# Qt Creator for some reason creates *.user.$version files, so exclude it too
*.user*
*~
### Xcode ###
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### CMake ###
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
# makedepend
Makefile.dep
*.bak
ALL_BUILD.*
INSTALL.*
ZERO_CHECK.*
# Visual Studio
*.obj
*.dll
*.exp
*.lib
*.suo
*.sdf
Debug/
Release/
ipch/
*.opensdf
# Use CMake for generating projects
*.vcxproj.filters
*.vcxproj
*.sln
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# PVS Studio for Linux output
*.cl.cfg
# Kate
*.kate-swp
*.swp
# QtCreator
build-*
# Android
*.apk
*.config
*.creator
*.includes
*.files
# Waf
build_current
*waf-*/
*waf3-*/
.lock-waf*
*.lastbuildstate
*.unsuccessfulbuild
__pycache__
*.pyc
# MSVC projects
*.vcproj
*.sln
*.vcxproj
# Visual Studio Code
.vscode/*
*.code-workspace
.history/*
.cache/*

15
.gitmodules vendored Normal file
View File

@@ -0,0 +1,15 @@
[submodule "mainui"]
path = mainui
url = https://github.com/FWGS/mainui_cpp
[submodule "ref_gl/nanogl"]
path = ref_gl/nanogl
url = https://github.com/FWGS/nanogl
[submodule "ref_gl/gl-wes-v2"]
path = ref_gl/gl-wes-v2
url = https://github.com/FWGS/gl-wes-v2
[submodule "vgui-dev"]
path = vgui-dev
url = https://github.com/FWGS/vgui-dev
[submodule "ref_gl/gl4es"]
path = ref_gl/gl4es
url = https://github.com/ptitSeb/gl4es

35
.travis.yml Normal file
View File

@@ -0,0 +1,35 @@
language: c
compiler: gcc
sudo: false
env:
global:
- SDL_VERSION=2.0.14
git:
depth: 50
submodules: true
os: linux
arch:
- aarch64
- ppc64le
- s390x
addons:
apt:
update: true
packages:
- libx11-dev
- libxext-dev
- x11-utils
- libgl1-mesa-dev
- libasound-dev
- libstdc++6
- libfuse2
- unzip
before_script:
- sh scripts/travis/deps_common.sh
- sh scripts/travis/deps_${TRAVIS_OS_NAME}.sh
script:
- sh scripts/travis/build_${TRAVIS_OS_NAME}.sh
after_script:
- ccache --show-stats
- sh scripts/continious_upload.sh xash3d-fwgs-${ARCH}.tar.xz xashds-linux-${ARCH}

47
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,47 @@
## If you are reporting bugs
1. Check you are using latest version. You can build latest Xash3D FWGS for yourself, look to README.md.
2. Check open issues is your bug is already reported and closed issues if it reported and fixed. Don't send bug if it's already reported.
3. Re-run engine with `-dev 2 -log` arguments, reproduce bug and post engine.log which can be found in your working directory.
3. Describe steps to reproduce bug.
4. Describe which OS and architecture you are using.
6. Attach screenshot if it will help clarify the situation.
## If you are contributing code
### Which branch?
* We recommend using `master` branch.
### Third-party libraries
* Philosophy of any Xash Project by Uncle Mike: don't be bloated. We follow it too.
* Adding new library is allowed only if there is a REAL reason to use it. It's will be nice, if you will leave a possibility to remove new dependency at build-time.
* Adding new dependencies for Waf Build System is not welcomed.
### Portability level
* Xash3D have it's own crt library. It's recommended to use it. It most cases it's just a wrappers around standart C library.
* If your feature need platform-specific code, move it to `engine/platform` and try to implement to every supported OS and every supported compiler or at least leave a stubs.
* You must put it under appopriate macro. It's a rule: Xash3D FWGS must compile everywhere. For list of platforms we support, refer to public/build.h file.
### Code style
* This project uses mixed Quake's and HLSDK's C/C++ code style convention.
* In short:
* Use spaces in parenthesis.
* Only tabs for indentation.
* Any brace must have it's own line.
* Short blocks, if statements and loops on single line are allowed.
* Avoid magic numbers.
* While macros are powerful, it's better to avoid overusing them.
* If you unsure, try to mimic code style from anywhere else of engine source code.
* **ANY** commit message should start from declaring a tags, in format:
`tag: added some bugs`
`tag: subtag: fixed some features`
Tags can be any: subsystem, simple feature name or even just a filename, without extension.
Just keep them always same, it helps keep history clean and commit messages short.

View File

@@ -0,0 +1,71 @@
## Abstract
Before start, I would recommend you to compile and run engine for already supported and well-spread platform, such as GNU/Linux or Windows. Hack it, get familiar with engine.
One beauties of Xash3D FWGS Engine is it modularity, so game logic, UI and renderers are located in platform-independent libraries. Every library is loaded at run time and may or may be not optional. For example, if your platform doesn't have OpenGL of any kind, you can skip it and use our software renderer! Of course, there is no real reason to run game engine, if you don't have game logic of any kind, so the minimal build of Xash3D FWGS is headless dedicated server.
Historically, Xash3D Engine was even more modular(see github.com/a1batross/Xash3D_ancient), but we thought that to fulfill our crossplatform needs we will keep all platform-specific stuff in the engine itself and libraries must import or expose platform-independent APIs.
Ok, get to the point!
## Porting guidelines
It will not be a complete tutorial as covering everything in one article is probably just impossible. Instead, I will give you hints on how engine can be ported, how to get your port to upstreamed and how you should maintain your port.
0) Get to know your platform. Maybe I asked for this lately, but you MUST KNOW YOUR PLATFORM, i.e. what's this capable of.
The one of unsupported configurations at this time is when platform can't load dynamic libraries(`*.so` or DLLs). We can't help you as supporting full-static ports are violating the GPL license in various ways.
The other yet unsupported configuration is the big endian.
1) Setup toolchain. For dirty port, you can write Makefile for yourself, engine is written that way, so **it doesn't relies** on any generated data or any special processing. But I recommend you to use Waf anyway, it's better integrated to engine and self-documentable. Also, I will cover only our Waf build options.
2) Open `public/build.h` file. Add appropriate checks for your operating system and/or CPU architecture. It shouldn't be hard.
Also, you'll need to build [Half-Life SDK](https://github.com/FWGS/hlsdk-xash3d/). It has same `public/build.h` so reflect changes into it. Note that to be compatible with HLSDK proprietary license, it's relicensed as public domain under [Unlicense](https://unlicense.org).
We have a library naming scheme that allows us and game creators to distribute binaries for different platforms in one archive. Read `Documentation/extensions/library-naming.md` for more information.
In short, you need to call your platform in unique way. For engine side it's done in `engine/common/build.c` file in engine source code, for HLSDK side it's done in `cmake/LibraryNaming.cmake` and `scripts/waifulib/library-naming.py` files in HLSDK source code.
You can use [predef project wiki](https://sourceforge.net/p/predef/wiki/Home/) for reference.
2) Look at the `engine/platform` directory. We usually try to have all platform-specific stuff inside this folder.
* Functions that must be available on your platform are declared in `platform.h` header. Most of them aren't used in headless dedicated build, but I will cover that later.
* The POSIX-compliant(for *nix operating systems) goes into `posix` subdirectory.
* The SDL-specific code goes into `sdl` subdirectory. Note that even I said before that platform-specific code is in `platform` directory, SDL obviously isn't a __platform__, so you can met checks for XASH_SDL inside whole engine, usually in input.
* Custom SWAP implementation for *nix-based systems is in `swap` subdirectory. It's used when hardware may not have enough memory and you can't add swap memory. I will cover that later
It relies on a fact that systems with paged memory will load pages into RAM and move unused to mmap()-ed by custom swap area.
That allowed to run game engine on music player with MIPS CPU, Linux without SWAP support and
* Other folders as `win32`, `android`, `linux` and so on are self-descriptive.
3) As proof of concept, you can try to test that network features and dynamic library loading are implemented correctly. Build a dedicated server with XASH_DEDICATED or `--dedicated` passed to `waf configure`.
Start a server and try to connect to it from PC. If everything is fine, then you can move to next step.
If you get out of memory issues, you can try Low Memory Mode, it's enabled with `--low-memory-mode=N` passed to `waf configure` where N is 1 or 2. Low Memory Mode 1 means that we will NOT break a network compatibility. 2 is deeper and doesn't guarantee protocol compatibility and available multiplayer. Of course, with Low Memory Mode 2 you can't test your port dedicated server.
If you got anything compiling, it's nice time to make a commit. Commit your changes into git and push them somewhere(GitHub, GitLab or what you prefer), so you will not lose them accidentally.
4) Here is most interesting, building the client part.
There are three possible situations for you, by increasing difficulty.
1. Do you have SDL2 for your platform? If yes, go ahead and compile engine with client part enabled.
2. Do you have SDL1.2 for your platform? If yes, try to compile it, but SDL1.2 support is very limited and not tested well.
3. You don't have SDL and you can't port it for some reason by yourself or SDL port just don't stable for your platform? Then you need to implement an engine backend.
How to implement engine backend? Well, we have a backends system that was introduced in Old Engine. It's simply two files: backends.h and defaults.h in `common` folder in repository root. You will need to add a macros for your backends in `backends.h` and define a logic in `defaults.h`. We have already have some, check them out, as they may be handy for you.
Once you did it, go back to `platform` directory and open `platform.h` headers. Create new subdirectory in `platform` folder and start implementing missing platform-specific backends one by one. I can't explain this as for obvious reasons it's too specific. You can use macros you defined before in `build.h` to check that you're compiling for your platform and `backends.h` macros to check if platform-specific backend must be enabled.
As you finished, compile engine, fix errors and commit your changes and push to repository.
Remember, if something doesn't work and you can't figure out why, you can join our Discord server at discord.me/fwgs. Ping me (@a1batross) or other engine developer and attach link to your repository, so we can discuss and help you in porting.

View File

@@ -0,0 +1,68 @@
## Console variables
Console variables (or CVars) are present in all quake-based games.
By default, it is settings, created by engine, server or client libraries.
But you can use `set` command to define variables even if they are not created by the engine.
For example, you can set cvar before it is registered in code.
`set defaultmap crossfire`
This works even in server.cfg before server cvars initialization and the engine will reuse its value on cvar creation
## Aliases
An alias allows to define new commands.
`alias wnext "invnext;wait;wait;+attack;wait;-attack"`
You can hook any command by adding an alias to it and unaliasing it, when you want to use original command.
```
alias invnext1 "unalias invnext;wnext;alias invnext invnext1"
alias invnext invnext1
```
## Scripting extensions
This is an extensions of Xash3D FWGS(merged to original Xash3D since build 3887), that can be enabled by cmd_scripting cvar.
Enabling scripting: `cmd_scripting 1`
This is an archive cvar and it will be saved.
### CVar substitution
You can substitute cvar value to any command by adding \$ symbol:
`echo $sv_cheats`
### Condition checking
Allows checking cvar values.
```
if <value1> <operator> <value2>
:<action1>
:if <value3>
::<action2>
:<action3>
else
:<action4>
```
* Values are any string or numeric values (for example, substituted cvars).
* Operator is = (or ==), \!=, \<, \>, \<=, \>=. == is same to =.
* If single value specified, condition is true when value is non-zero
Example:
```
if $sv_cheats == 1
:echo Cheats enabled, adding cheat menu
:exec cheatmenu.cfg
else
:echo Please enable cheats to use this!
```

View File

@@ -0,0 +1,48 @@
## Цель
На текущий момент клиенты имеют некоторые части платформозависимого кода внутри себя. Это плохо, т.к. мы не можем использовать одинаковые функции (если не перепишем почти половину кода SDL) на разных платформах.
## Клиентская часть
* Клиент будет иметь возможность полностью реализовать touch-ввод. Отрисовка может быть произведена через HUD.
* Клиент получит простые события движения и обзора от движка
### Клиентская реализация
#### Клиент будет экспортировать некоторые функции движку (опционально):
* `int IN_ClientTouchEvent ( int fingerID, float x, float y, float dx, float dy );`
Вернёт 1 если касание активно, иначе 0.
* `void IN_ClientMoveEvent ( float forwardmove, float sidemove );`
Клиент будет накапливать значения величин для команд движения перед созданием команд и очищать их при CreateMove.
* `void IN_ClientLookEvent ( float relyaw, float relpitch );`
Клиент будет вращать камерой когда нужно, прямо как в реализации мыши
## Движковая часть
* Движок будет управлять событиями платформы и вызывать клиентские функции
* Движок реализует стандартную систему взгляда и движения если её нет в клиенте
### Движковая реализация
#### События касания
Перед вызовом ClientMove движок обязан получить события о касании.
Если из клиента экспортирована функция IN_ClientTouchEvent, событие будет отправлено клиенту.
Иначе, движок будет рисовать свой touch-интерфейс.
#### Другие события
Интерфейс прикосновений и код джойстика в движке будут генерировать следующие два типа событий:
* События движения (функция IN_ClientMoveEvent)
* События просмотра (функция IN_ClientLookEvent)
Если клиент экспортирует эти функции, события будут отправляться клиенту перед CreateMove
Иначе события просмотра будут происходить перед CreateMove, но после MoveEvent. Они будут применены к генерируемым командам

View File

@@ -0,0 +1,48 @@
## Purpose
Clients have different platform-depended input code now.
It is bad because we cannot use same functions (if we won't rewrite almost half of SDL) on different platforms.
## Client part
* Client will have ability to fully implement touch input. Drawing may be done by HUD.
* Client will receive basic motion and look events from engine
### Client implementation
#### Client will optionally export some functions to Engine:
* `int IN_ClientTouchEvent ( int fingerID, float x, float y, float dx, float dy );`
Return 1 if touch is active, 0 otherwise.
* `void IN_ClientMoveEvent ( float forwardmove, float sidemove );`
Client wil accumulate move values before creating commands and flush it on CreateMove.
* `void IN_ClientLookEvent ( float relyaw, float relpitch );`
Client will rotate camera when needed as in mouse implementation
## Engine part
* Engine will handle platform events and call client functions.
* Engine will implement fallback look and movement system when client interface not present
### Engine implementation
#### Touch events
Before calling ClientMove engine must get touch events.
If client exported IN_ClientTouchEvent, event will be sent to client.
Otherwise engine will draw own touch interface.
#### Other events
Engine touch interface and joystick support code will generate two types of events:
* Move events (IN_ClientMoveEvent function)
* Look events (IN_ClientLookEvent function)
If client exported these functions, events will be sent to client before CreateMove
Otherwise Look Event will be processed before CreateMove, but MoveEvent after. It will be applied to generated command

View File

@@ -0,0 +1,41 @@
I propose a new library naming scheme, which will allow to distribute mods and games in single archive to different operating systems and CPUs:
Legend:
* $os -- Q_buildos() return value, in lower case.
* $arch -- Q_buildarch() return value, in lower case.
* $ext -- OS-specific extension: dll, so, dylib, etc.
The scheme will be:
1. Client library:
* ```client.$ext``` for **Win/Lin/Mac** with **x86**.
* ```client_$arch.$ext``` for **Win/Lin/Mac** with **NON-x86**.
* ```client_$os_$arch.$ext``` for everything else.
2. Menu library:
* ```menu.$ext``` for **Win/Lin/Mac** with **x86**.
* ```menu_$arch.$ext``` for **Win/Lin/Mac** with **NON-x86**.
* ```menu_$os_$arch.$ext``` for everything else.
3. Server library:
* On **Win/Lin/Mac** with **x86**, it **MUST** use the raw gamedll name for corresponding OS field from `gameinfo.txt`.
* On **Win/Lin/Mac** with **NON-x86**, it **MUST** use the raw gamedll name for corresponding OS field from `gameinfo.txt`, but append ```_$arch``` before file extension. Like: ```hl_amd64.so``` or ```cs_e2k.so```.
* On everything else, it must use gamedll name from ```gamedll_linux``` field, but append ```_$os_$arch``` before file extension. Like: ```hl_haiku_amd64.so``` or ```cs_freebsd_armhf.so```.
Why ```gamedll_linux``` and not ```gamedll```? Because it looks more logic that way, most operating systems are *nix-like and share code with Linux, rather than Windows.
4. Refresh library: not needed, as RefAPI is not stable and it's not intended to distribute with mods.
For any libraries distributed **with** engine, naming scheme should be used more convenient for OS port.
Issue #0. Inconsistency between ABI and Q_buildarch.\
Resolution: Change Q_buildarch return value to use Debian-styled architectures list: https://www.debian.org/ports/, which includes a special naming for big/little-endian and hard/soft-float ARM.
Issue #1: Build-system integration.\
Resolution: implemented as [LibraryNaming.cmake](https://github.com/FWGS/hlsdk-xash3d/blob/master/cmake/LibraryNaming.cmake) and [library_naming.py](https://github.com/FWGS/hlsdk-xash3d/blob/master/scripts/waifulib/library_naming.py) extensions, see
Issue #2(related to #0): Which ARM flavours we actually need to handle?\
Resolution: Little-endian only, as there is no known big-endian ARM platforms in the wild.
Architecture is coded this way:
* ```armvxy```, where `x` is ARM instruction set level and `y` is hard-float ABI presence: `hf` where hard float ABI used, otherwise `l`.
See discussion: https://github.com/FWGS/xash3d-fwgs/issues/39

View File

@@ -0,0 +1,75 @@
# Server porting
Original valve's server code was compatible with linux and gcc 2.x.
Newer gcc versions have restriction which breaks build.
Now, to make it building with gcc 4.x, you need do following:
* Go to cbase.h and redefine macros as following
```
#define SetThink( a ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (&a)
#define SetTouch( a ) m_pfnTouch = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (&a)
#define SetUse( a ) m_pfnUse = static_cast <void (CBaseEntity::*)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )> (&a)
#define SetBlocked( a ) m_pfnBlocked = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (&a)
#define ResetThink( ) m_pfnThink = static_cast <void (CBaseEntity::*)(void)> (NULL)
#define ResetTouch( ) m_pfnTouch = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (NULL)
#define ResetUse( ) m_pfnUse = static_cast <void (CBaseEntity::*)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )> (NULL)
#define ResetBlocked( ) m_pfnBlocked = static_cast <void (CBaseEntity::*)(CBaseEntity *)> (NULL)
...
#define SetMoveDone( a ) m_pfnCallWhenMoveDone = static_cast <void (CBaseToggle::*)(void)> (&a)
```
* Replace all SetThink(NULL), SetTouch(NULL), setUse(NULL) and SetBlocked(NULL) by ResetThink(), ResetTouch(), ResetUse() and ResetBlocked()
* Sometimes you may need to add #include <ctype.h> if functions tolower or isspace are missing
# Client porting
## VGUI library
Valve's client uses vgui library which is available only on x86 systems and has big amount of mistakes in headers. The best and simplest way of porting is removing VGUI dependency at all.
Most singleplayer mods don't really use VGUI at all. It is used in multiplayer only to show score table and MOTD window
## Porting
### First strategy: full port
#### Basic port (Stage 1)
* First, remove all files and headers which use vgui (contains "vgui" in file name).
* After that, try to build it and remove vgui includes.
* Remove all gViewPort usings.
* Remove all CVoiceManager usings (xash3d does not support voice)
* Redefine all DLLEXPORT defines as empty field (Place it under _WIN32 macro if you want to keep windows compatibility).
* Remove hud_servers.cpp and Servers_Init/Servers_Shutdown from hud.cpp
* Fix CAPS filenames in includes (like STDIO.H, replace by stdio.h).
* Replace broken macros as DECLARE_MESSAGE, DECLARE_COMMAND by fixed examples from our hlsdk-xash3d port (cl_util.h)
* Add ctype.h where it is need (tolower, isspace functions)
* Add string.h where it is need (memcpy, strcpy, etc)
* Use in_defs.h from hlsdk_client
* Add scoreboard_stub.cpp and input_stub.cpp from hlsdk-xash3d to fix linking.
Now your client should be able to build and work correctly. Add input_xash3d.cpp from hlsdk-xash3d project to fix input.
#### Multiplayer fix (Stage 2)
Look at hlsdk-xash3d project.
Main changes are:
* Add MOTD.cpp, scoreboard.cpp and input_xash3d.cpp
* Add missing functions to hud_redraw.cpp, hud.cpp and tri.cpp, fix class defination in hud.h
* Remove duplicate functions from hud.cpp and HOOK_MESSAGE's for it
* Remove +showscores/-showscores hooks from input.h
* Fix cl_util.h
### Second way: move mod to hlsdk-xash3d
Look at changes you made in client.
If there are not much changes (for example, only some weapons was add), add these changes in hlsdk-xash3d.
You may use diff with original HLSDK you used and apply it as patch to hlsdk-xash3d.
Files must have same line endings (use dos2unix on all files).
I recommend to enable ignoring space changes in diff.
### Writing Makefiles
Use Makefile from hlsdk-xash3d as Makefile example.
Get .c and .cpp file lists from Visual Studio project and fill SRCS and SRCS_C variables to Makefile.
Remove all files containing vgui in name from list, add missing include dirs.
Do same for Android.mk if you are building for android.

View File

@@ -0,0 +1,12 @@
# Not supported mods and reasons why
|Name |Version |Why not working |What was made for that
|---- |------- |--------------- |----------------------
|Blue Shift |The latest steam release |Uses vgui2 library which xash3d does not support |Recreated source code here: https://github.com/FWGS/hlsdk-xash3d/tree/bshift
|Counter Strike |1.6(The latest steam release) |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|Counter Strike: Condition Zero |The latest steam release |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|Counter Strike: Condition Zero - Deleted scenes |The latest steam release |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|Day of Defeat |The latest steam release |Uses vgui2 library which xash3d does not support |Some work on vgui2 support was made here: https://github.com/FWGS/xash3d/tree/vinterface
|Sven-Coop |5.0+ |Uses filesystem_stdio library which xash3d does not support |filesystem_stdio replacement already was made: https://github.com/FWGS/filesystem_stdio_xash
|XDM |3.0.4.0 | |

View File

@@ -0,0 +1,321 @@
Source code of this mods is available for modders and porters in public access.
# Original Work
## Absolute Zero
Official gitlab repository - https://gitlab.com/Cobalt-57/half-life-absolute-zero/
## Adrenaline Gamer
Official github repository by Martin \"Bullet\" Webrant - https://github.com/martinwebrant/agmod
## Arrangement
Mirrored on github - https://github.com/JoelTroch/am_src_30jan2011
## Arrangemode: Rebirth
Mirrored on github - https://github.com/JoelTroch/am_src_rebirth
## Battle Grounds
Mirrored on github - https://github.com/nekonomicon/BattleGrounds
## Bubblemod
Download page on official site - http://www.bubblemod.org/dl_default.php
## Chicken Fortress
Official github repository - https://github.com/CKFDevPowered/CKF3Alpha
## Cold Ice
Version 1.9 is available on ModDB - https://www.moddb.com/mods/cold-ice/downloads/cold-ice-sdk
## Cthulhu
Uploaded to github by Oleg Cherkasky - https://github.com/gunrunners-paradise/Cthulhu-HLmod-SDK
## Deathmatch Classic
Available in Valve's Half-Life repository - https://github.com/ValveSoftware/halflife/tree/master/dmc
## ESHQ
Official github repository - https://github.com/adslbarxatov/xash3d-for-ESHQ
## Flat-Life
Available on GamerLab - http://gamer-lab.com/eng/code_mods_goldsrc/Half-Life_2D_(Flat-Life)
## Gang Wars
Mirrored on github - https://github.com/hammermaps/gw1.45src
## Go-mod
Versions 2.0 and 3.0, available in mod archives on ModDB - https://www.moddb.com/mods/go-mod/downloads
## GT mod
Available on GamerLab - http://gamer-lab.com/eng/code_mods_goldsrc/GT_mod_(Polnie_ishodniki)
## Half-Life: Echoes
Download link on dropbox - https://www.dropbox.com/s/s6j8gtegn10wgvj/dlls.zip?dl=1
## Half-Life: Expanded Arsenal
Available on ModDB - https://www.moddb.com/mods/half-life-expanded-arsenal
## Half-Life: Gravgun mod
Branch **gravgun** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/gravgun
## Half-Life: Invasion
official github repository - https://github.com/jlecorre/hlinvasion
## Half-Life: Quest Mode
Available on cs-mapping.com.ua - https://old.cs-mapping.com.ua/forum/showthread.php?t=38030
## Half-Life: Top-Down
Official gitlab repository - https://gitlab.com/Sockman/hltopdown
## Half-Life: Update
Official github repository - https://github.com/Fograin/hl-subsmod-ex
## Half-Life: Weapon Edition
Available on ModDB - https://www.moddb.com/mods/half-life-weapon-edition/downloads/half-life-weapon-edition-1508-alpha-open-src
## Half-Life: Year of the Dragon
Available on ModDB - https://www.moddb.com/mods/year-of-the-dragon
## Half-Nuked
Available on ModDB - https://www.moddb.com/mods/half-nuked/downloads/half-nuked-src
## Half-Payne
Official github repository - https://github.com/suXinjke/HalfPayne
## Half-Quake
Official github repository - https://github.com/muddasheep/hqtrilogy
## Half-Rats: Parasomnia
Official github repository - https://github.com/HeathGames/half_rats_parasomnia_src
## Half-Screwed
Official github repository - https://github.com/desukuran/half-screwed
## Headcrab Frenzy
Version 1.3 on ModDB - https://www.moddb.com/mods/headcrab-frenzy/downloads/headcrab-frenzy-13-beta-source-code
## Heart of Evil
Available on ModDB - https://www.moddb.com/mods/heart-of-evil/downloads/heart-of-evil-dlls-source-code
## Ingram Chillin' Mod
Official SourceForge repository - https://sourceforge.net/projects/icm-hl/
## MechMod
Official github repository - https://github.com/vermagav/mechmod
## Mortal Combat Forever
Available on GamerLab - http://gamer-lab.com/eng/code_mods_goldsrc/Mortal_Combat_Forever_(Polnie_ishodniki)
## Natural Selection
Official github repository - https://github.com/unknownworlds/NS
## Overturn
Available in mod archive on ModDB - https://www.moddb.com/mods/overturn
## Spirit of Half-Life
[Logic&Trick's](https://github.com/LogicAndTrick) mirror - https://files.logic-and-trick.com/#/Half-Life/Mods/Spirit%20of%20Half-Life
## Threewave CTF
*Unfinished mod by Valve Software*
Available in Valve's Half-Life repository with Deathmatch Classic sources - https://github.com/ValveSoftware/halflife/tree/master/dmc
## Trinity Render
Available on ModDB: https://www.moddb.com/mods/half-life-episode-two/downloads/trinity-rendering-engine-v308f
## Tyrian: Ground Assault
Available on ModDB: https://www.moddb.com/mods/tyriangroundassault/downloads/tyrianga-v1-0-src
## Paranoia
Available on ModDB: https://www.moddb.com/mods/paranoia/downloads/paranoia-toolkit
## Paranoia 2: The Savior
Prealpha, mirrored on github - https://github.com/a1batross/Paranoia2_ancient
Version 1.51, mirrored on github - https://github.com/a1batross/Paranoia2_original
## Raven City
*Unfinished mod*
Was found on HLFX - http://hlfx.ru/forum/showthread.php?s=2c892dfc52f72be52a89c3f52a397cd0&threadid=1819&postid=44674#post44674
## Ricochet
Available in Valve's Half-Life repository - https://github.com/ValveSoftware/halflife/tree/master/ricochet
## Wizard Wars
Download page on official site - http://www.thothie.com/ww/
## XashXT
Mirrored on github - https://github.com/a1batross/XashXT_original
## Zombie-X
Available in mod archive on ModDB - https://www.moddb.com/mods/zombie-x-10-final/downloads/zombie-x-10-dle-beta6-last-version
## ZXC
Available on ModDB - https://www.moddb.com/mods/zxc-mod-133/downloads/zxc-mod-136-final
Mirrored on github - https://github.com/ZXCmod/ZXCmod
# Reimplementation
## Absolute Redemption
Branch **redempt** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/redempt
## Adrenaline Gamer
OpenAG by YaLTeR - https://github.com/YaLTeR/OpenAG
## Afraid of Monsters
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-aom
Branch **aom** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/aom
## Afraid of Monsters: Director's cut
Reverse-engineered code, branch **aomdc** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/aomdc
## Azure Sheep
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-asheep
Reverse-engineered code, branch **asheep** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/asheep
## Big Lolly
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-biglolly
Branch **biglolly** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/biglolly
## Black Ops
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-blackops
Branch **blackops** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/blackops
## Bloody Pizza: Vendetta
Branch **caseclosed** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/caseclosed
## Case Closed
Branch **caseclosed** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/caseclosed
## Cleaner's Adventures
Branch **CAd** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/CAd
## Counter Strike
Reverse-engineered code of client part by a1batross - https://github.com/FWGS/cs16-client/tree/v1.32
Reverse-engineered code of server part by nagist - https://github.com/nagist/cs16nd
Reverse-engineered code of server part by s1lentq - https://github.com/s1lentq/ReGameDLL_CS
## Counter Strike Online
CSO-like Xash3D-based mod, CSMoE - https://github.com/MoeMod/CSMoE
## Crack-Life: Campaign Mode
Recreation by lostgamer aka nillerusr - https://github.com/LostGamerHL/crack_life
## Escape from the Darkness
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-eftd
Reverse-engineered code, branch **eftd** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/eftd
## Half-Life: Blue Shift
Unkle Mike's recreation - https://hlfx.ru/forum/showthread.php?s=&threadid=5253
Reverse-engineered code, branch **bshift** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/bshift
## Half-Life: Induction
Branch **induction** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/induction
## Half-Life: Opposing Force
Recreation by lostgamer aka nillerusr - https://github.com/LostGamerHL/hlsdk-xash3d
Reverse-engineered code, clean branch **opfor** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/opfor
Spirit of Half Life: Opposing-Force Edition - https://github.com/Hammermaps-DEV/SOHL-V1.9-Opposing-Force-Edition
## Half-Life: Rebellion
Reverse-engineered code, branch **rebellion** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/rebellion
## Half-Life: Visitors
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-visitors
Reverse-engineered code, branch **visitors** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/visitors
## Half-Secret
Branch **half-secret** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/half-secret
## Night at the Office
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-noffice
Branch **noffice** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/noffice
## Poke 646
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-poke646
Reverse-engineered code, branch **poke646** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/poke646
## Poke 646: Vendetta
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-poke646
Reverse-engineered code, branch **poke646_vendetta** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/poke646_vendetta
## Residual Life
Reverse-engineered code, branch **residual_point** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/residual_point
## Residual Point
Reverse-engineered code, branch **residual_point** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/residual_point
## Team Fortress Classic
Reverse-engineered code by Velaron - https://github.com/Velaron/tf15-client
## The Gate
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-TheGate
Reverse-engineered code, branch **thegate** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/thegate
## They Hunger
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-Hunger
Reverse-engineered code, branch **theyhunger** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/theyhunger
They Hunger: Tactical - https://www.moddb.com/mods/they-hunger-tactical/downloads/tht-source-code-documentation
## Times of Troubles
malortie's recreation - https://github.com/malortie/halflife/tree/mod-hl-tot
Branch **tot** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/tot
# Derived work
## Adrenaline Gamer
Branch **aghl** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/aghl
## Bubblemod
Branch **bubblemod** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/bubblemod
## Deathmatch Classic
Deathmatch Classic: Adrenaline Gamer Edition - https://github.com/martinwebrant/agmod/tree/master/src/dmc
Deathmatch Quaked - https://www.moddb.com/games/deathmatch-classic/downloads/dmq2
Branch **dmc** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/dmc
## Half-Life: Echoes
Branch **echoes** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/echoes
## Half-Life: Invasion
Port to HLSDK 2.4 by malortie - https://github.com/malortie/halflife/tree/mod-hl-invasion
Port to Linux by fmoraw - https://github.com/fmoraw/hlinvasion
## Half-Life: Top-Down
Branch **hltopdown** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/hltopdown
## Half-Screwed
Branch **half-screwed** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/half-screwed
## Natural Selection
Port to Linux - https://github.com/fmoraw/NS
## Swiss Cheese Halloween 2002
Just more playable version by malortie - https://github.com/malortie/halflife/tree/mod-hl-halloween
Branch **halloween** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/halloween
## Threewave CTF
Branch **dmc** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/dmc
## Zombie-X
Branch **zombie-x** in hlsdk-xash3d - https://github.com/FWGS/hlsdk-xash3d/tree/zombie-x

38
Documentation/ports.md Normal file
View File

@@ -0,0 +1,38 @@
Xash3D FWGS is intended to be easily ported to specific platform, however main issue is maintaining such ports.
This page is about merged ports to main source tree and responsible for it developers.
For porting guidelines, look here(TODO!)
Status:
* **Supported**: active, confirmed to be fully functional.
* **In progress**: active, under development.
* **Incomplete**: not active, but some work was accepted to main repository before
* **Old Engine**: port was for old engine fork
* **Not maintained**: lack of human resources
* **Not merged**: was done in third-party fork, real status unknown
* **Deprecated**: not supported anymore
Table is sorted by status.
| Platform | Status | Maintainer | Note
| -------- | ------ | ---------- | ----
| Windows | Supported | @a1batross |
| *BSD | Supported | @nekonomicon |
| GNU/Linux(x86, amd64, arm) | Supported | @a1batross, @mittorn |
| Android | Supported | @a1batross, @mittorn |
| MotoMAGX | Supported | @a1batross |
| GNU/Linux(elbrus) | Supported | @a1batross, @mittorn | Rare and eventual access to e2k machine
| Haiku | Supported | not maintained | Was added by #478 and #483
| DOS4GW | Supported | @mittorn |
| GNU/Linux(mipsel) | Supported | @mittorn |
| Switch | In progress | @fgsfdsfgs | [Github Repository](https://github.com/fgsfdsfgs/xash3d-fwgs/tree/switch_new)
| Wii | In progress | Collaborative effort | [Github Repository](https://github.com/saucesaft/xash3d-wii)
| PSP | In progress | Collaborative effort | No sources available at this moment
| Emscripten | Old Engine | not maintained |
| Oculus Quest | Old Engine fork | @DrBeef | [GitHub Repository](https://github.com/DrBeef/Lambda1VR)
| PSVita | Old Engine fork | not maintained | [GitHub Repository](https://github.com/fgsfdsfgs/vitaXash3D)
| Switch | Old Engine fork | not maintained | [GitHub Repository](https://github.com/switchports/xash3d-switch)
| 3DS | Old Engine fork | not maintained | [GitHub Repository](https://github.com/masterfeizz/Xash3DS)
| macOS | Deprecated | not maintained | See GitHub issue #61
| iOS | Deprecated | not maintained | See GitHub issue #61

View File

@@ -0,0 +1,15 @@
As online community is growing, we don't want to keep bad or invalid servers on the Internet Games list. It's a common rules for all Xash3D server owners who are using default master server.
1. Breaking master server or clients is prohibited in any way. If you found a serious bug, contact us at contact 'at' fwgs.ru or post an issue at GitHub.
2. Changing settings, exploiting vulnerabilities of clients is prohibited in any way. If you found a serious bug, contact us at contact 'at' fwgs.ru or post an issue at GitHub.
2. Agressive advertisement and spam on other servers is prohibited in any way.
3. If your server is require downloading custom content, it should be available for everyone. Recommended way to deliver custom content is FastDL.
4. It's recommended to keep your server is up-to-date. You may use our public Debian/Ubuntu/Arch Linux [repository](https://github.com/FWGS/xash3d/wiki/How-to-set-up-a-Xash3D-Dedicated-Server-on-Debian-or-Ubuntu) to simplify updating process.
Just follow these rules to not get banned on our master server. Good luck, have fun!

File diff suppressed because it is too large Load Diff

96
README.md Normal file
View File

@@ -0,0 +1,96 @@
# Xash3D FWGS Engine
[![GitHub Actions Status](https://github.com/FWGS/xash3d-fwgs/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/FWGS/xash3d-fwgs/actions/workflows/c-cpp.yml) [![Travis CI Status](https://api.travis-ci.org/FWGS/xash3d-fwgs.svg?branch=master)](https://travis-ci.org/FWGS/xash3d-fwgs) [![FreeBSD Build Status](https://img.shields.io/cirrus/github/FWGS/xash3d-fwgs?label=freebsd%20build)](https://cirrus-ci.com/github/FWGS/xash3d-fwgs) [![Discord Server](https://img.shields.io/discord/355697768582610945.svg)](http://discord.fwgs.ru/) \
[![Download Stable](https://img.shields.io/badge/download-stable-yellow)](https://github.com/FWGS/xash3d-fwgs/releases/latest) [![Download Testing](https://img.shields.io/badge/downloads-testing-orange)](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous)
Xash3D FWGS is a fork of Xash3D Engine by Unkle Mike with extended features and crossplatform.
```
Xash3D is a game engine, aimed to provide compatibility with Half-Life Engine,
as well as to give game developers well known workflow and extend it.
Read more about Xash3D on ModDB: https://www.moddb.com/engines/xash3d-engine
```
## Fork features
* HLSDK 2.4 support.
* Crossplatform: supported x86 and ARM on Windows/Linux/BSD/Android. ([see docs for more info](Documentation/ports.md))
* Modern compilers support: say no more to MSVC6.
* Better multiplayer support: multiple master servers, headless dedicated server.
* Mobility API: allows better game integration on mobile devices(vibration, touch controls)
* Different input methods: touch, gamepad and classic mouse & keyboard.
* TrueType font rendering, as a part of mainui_cpp.
* Multiple renderers support: OpenGL, GLESv1, GLESv2, Software
* A set of small improvements, without broken compatibility.
## Planned fork features
* Virtual Reality support and game API
* Voice support
* Vulkan renderer
## Installation & Running
0) Get Xash3D binaries: you can use [testing](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous) build or you can compile engine from source code.
Choose proper build package depending on which platform you're using.
1) Copy engine binaries to some directory.
2) Copy `valve` directory from [Half-Life](https://store.steampowered.com/app/70/HalfLife/) to directory with engine binaries.
Also if you're using Windows: you should copy `vgui.dll` library from Half-Life directory to Xash3D directory.
As alternative, you can compile [hlsdk-xash3d](https://github.com/FWGS/hlsdk-xash3d) instead of using official Valve game binaries, but you still needed to copy `valve` directory as all game resources located in there.
3) Download [extras.pak](https://github.com/FWGS/xash-extras/releases/tag/v0.19.2) and place it to `valve` directory.
4) Run `xash3d.exe`/`xash3d.sh`/`xash3d` depending on which platform you're using.
Note: on Linux, you may need to create an sh file with the command `LD_LIBRARY_PATH=. ./xash3d`.
For additional info, run Xash3D with `-help` command line key.
## Contributing
* Before sending an issue, check if someone already reported your issue. Make sure you're following "How To Ask Questions The Smart Way" guide by Eric Steven Raymond. Read more: http://www.catb.org/~esr/faqs/smart-questions.html
* Issues are accepted in both English and Russian
* Before sending a PR, check if you followed our contribution guide in CONTRIBUTING.md file.
## Build instructions
We are using Waf build system. If you have some Waf-related questions, I recommend you to read https://waf.io/book/
NOTE: NEVER USE GitHub's ZIP ARCHIVES. GitHub doesn't include external dependencies we're using!
### Prerequisites
#### Windows (Visual Studio)
* Install Visual Studio.
* Install latest [Python](https://python.org) **OR** run `cinst python.install` if you have Chocolatey.
* Install latest [Git](https://git-scm.com/download/win) **OR** run `cinst git.install` if you have Chocolatey.
* Download [SDL2](https://libsdl.org/download-2.0.php) development package for Visual Studio.
* Clone this repository: `git clone --recursive https://github.com/FWGS/xash3d-fwgs`.
* Make sure you have at least 12GB of free space to store all build-time dependencies: ~10GB for Visual Studio, 300 MB for Git, 100 MB for Python and other.
#### GNU/Linux
NOTE FOR USERS WITH X86 COMPATIBLE CPUs:
We have forced Waf to throw an error, if you're trying to build 64-bit engine. This was done for keeping compatibility with Steam releases of Half-Life and based on it's engine games.
Even if Xash3D FWGS does support targetting 64-bit, you can't load games without recompiling them from source code!
##### Debian/Ubuntu
* Enable i386 on your system, if you're compiling 32-bit engine on amd64. If not, skip this
`$ sudo dpkg --add-architecture i386`
* Install development tools
* For 32-bit engine on amd64: \
`$ sudo apt install build-essential gcc-multilib g++-multilib python libsdl2-dev:i386 libfontconfig-dev:i386 libfreetype6-dev:i386`
* For everything else: \
`$ sudo apt install build-essential python libsdl2-dev libfontconfig-dev libfreetype6-dev`
* Clone this repostory:
`$ git clone --recursive https://github.com/FWGS/xash3d-fwgs`
### Building
#### Windows (Visual Studio)
0) Open command line
1) Navigate to `xash3d-fwgs` directory.
2) Carefully examine which build options are available: `waf --help`
3) Configure build: `waf configure -T release --sdl2=c:/path/to/SDL2 --prefix=c:/path/to/any/output/directory`
4) Compile: `waf build`
5) Install: `waf install`
#### Linux
0) Examine which build options are available: `./waf --help`
1) Configure build: `./waf configure -T release --prefix=/path/to/any/output/directory`
(You need to pass `-8` to compile 64-bit engine on 64-bit x86 processor)
2) Compile: `./waf build`
3) Install(optional): `./waf install`
Note: if compiling 32-bit on amd64, you may need to supply `export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig` prior to running configure.

65
common/backends.h Normal file
View File

@@ -0,0 +1,65 @@
/*
backends.h - backend macro definitions
Copyright (C) 2016 Mittorn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifndef BACKENDS_H
#define BACKENDS_H
// video backends (XASH_VIDEO)
#define VIDEO_NULL 0
#define VIDEO_SDL 1
#define VIDEO_ANDROID 2
#define VIDEO_FBDEV 3
#define VIDEO_DOS 4
// audio backends (XASH_SOUND)
#define SOUND_NULL 0
#define SOUND_SDL 1
#define SOUND_OPENSLES 2
#define SOUND_ALSA 3
// crash handler (XASH_CRASHHANDLER)
#define CRASHHANDLER_NULL 0
#define CRASHHANDLER_UCONTEXT 1
#define CRASHHANDLER_DBGHELP 2
#define CRASHHANDLER_WIN32 3
// input (XASH_INPUT)
#define INPUT_NULL 0
#define INPUT_SDL 1
#define INPUT_ANDROID 2
#define INPUT_EVDEV 3
// timer (XASH_TIMER)
#define TIMER_NULL 0 // not used
#define TIMER_SDL 1
#define TIMER_POSIX 2
#define TIMER_WIN32 3
#define TIMER_DOS 4
// messageboxes (XASH_MESSAGEBOX)
#define MSGBOX_STDERR 0
#define MSGBOX_SDL 1
#define MSGBOX_ANDROID 2
#define MSGBOX_WIN32 3
// library loading (XASH_LIB)
#define LIB_NULL 0
#define LIB_POSIX 1
#define LIB_WIN32 2
#define LIB_STATIC 3
#endif /* BACKENDS_H */

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -57,4 +57,4 @@ struct beam_s
struct particle_s *particles;
};
#endif//BEAMDEF_H
#endif//BEAMDEF_H

View File

@@ -22,4 +22,4 @@ typedef struct
vec3_t origin;
} boneinfo_t;
#endif//BONEINFO_H
#endif//BONEINFO_H

View File

@@ -48,7 +48,7 @@ BRUSH MODELS
#define SURF_PLANEBACK BIT( 1 ) // plane should be negated
#define SURF_DRAWSKY BIT( 2 ) // sky surface
#define SURF_DRAWTURB_QUADS BIT( 3 ) // all subidivided polygons are quads
#define SURF_DRAWTURB_QUADS BIT( 3 ) // all subidivided polygons are quads
#define SURF_DRAWTURB BIT( 4 ) // warp surface
#define SURF_DRAWTILED BIT( 5 ) // face without lighmap
#define SURF_CONVEYOR BIT( 6 ) // scrolled texture (was SURF_DRAWBACKGROUND)
@@ -166,7 +166,7 @@ typedef struct
{
int id; // must be little endian XASH
int version;
dlump_t lumps[EXTRA_LUMPS];
dlump_t lumps[EXTRA_LUMPS];
} dextrahdr_t;
typedef struct
@@ -321,4 +321,4 @@ typedef struct
int lightofs; // start of [numstyles*surfsize] samples
} dface32_t;
#endif//BSPFILE_H
#endif//BSPFILE_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -33,7 +33,7 @@ typedef struct
typedef struct
{
float prevanimtime;
float prevanimtime;
float sequencetime;
byte prevseqblending[2];
vec3_t prevorigin;
@@ -102,4 +102,4 @@ struct cl_entity_s
colorVec cvFloorColor;
};
#endif//CL_ENTITY_H
#endif//CL_ENTITY_H

113
common/com_image.h Normal file
View File

@@ -0,0 +1,113 @@
#pragma once
/*
========================================================================
internal image format
typically expanded to rgba buffer
NOTE: number at end of pixelformat name it's a total bitscount e.g. PF_RGB_24 == PF_RGB_888
========================================================================
*/
#define ImageRAW( type ) (type == PF_RGBA_32 || type == PF_BGRA_32 || type == PF_RGB_24 || type == PF_BGR_24 || type == PF_LUMINANCE)
#define ImageDXT( type ) (type == PF_DXT1 || type == PF_DXT3 || type == PF_DXT5 || type == PF_ATI2)
#define Image16( type ) (type == PF_RGBA_64 || type == PF_RGB_48)
typedef enum
{
PF_UNKNOWN = 0,
PF_INDEXED_24, // inflated palette (768 bytes)
PF_INDEXED_32, // deflated palette (1024 bytes)
PF_RGBA_32, // normal rgba buffer
PF_BGRA_32, // big endian RGBA (MacOS)
PF_RGB_24, // uncompressed dds or another 24-bit image
PF_BGR_24, // big-endian RGB (MacOS)
PF_LUMINANCE,
PF_DXT1, // s3tc DXT1 format
PF_DXT3, // s3tc DXT3 format
PF_DXT5, // s3tc DXT5 format
PF_ATI2, // latc ATI2N format
PF_RGBA_64, // 16-bit RGBA
PF_RGB_48, // 16-bit RGB
PF_TOTALCOUNT, // must be last
} pixformat_t;
typedef struct bpc_desc_s
{
int format; // pixelformat
char name[16]; // used for debug
uint glFormat; // RGBA format
int bpp; // channels (e.g. rgb = 3, rgba = 4)
} bpc_desc_t;
// imagelib global settings
typedef enum
{
IL_USE_LERPING = BIT(0), // lerping images during resample
IL_KEEP_8BIT = BIT(1), // don't expand paletted images
IL_ALLOW_OVERWRITE = BIT(2), // allow to overwrite stored images
IL_DONTFLIP_TGA = BIT(3), // Steam background completely ignore tga attribute 0x20 (stupid lammers!)
IL_DDS_HARDWARE = BIT(4), // DXT compression is support
IL_LOAD_DECAL = BIT(5), // special mode for load gradient decals
IL_OVERVIEW = BIT(6), // overview required some unque operations
} ilFlags_t;
// goes into rgbdata_t->encode
#define DXT_ENCODE_DEFAULT 0 // don't use custom encoders
#define DXT_ENCODE_COLOR_YCoCg 0x1A01 // make sure that value dosn't collide with anything
#define DXT_ENCODE_ALPHA_1BIT 0x1A02 // normal 1-bit alpha
#define DXT_ENCODE_ALPHA_8BIT 0x1A03 // normal 8-bit alpha
#define DXT_ENCODE_ALPHA_SDF 0x1A04 // signed distance field
#define DXT_ENCODE_NORMAL_AG_ORTHO 0x1A05 // orthographic projection
#define DXT_ENCODE_NORMAL_AG_STEREO 0x1A06 // stereographic projection
#define DXT_ENCODE_NORMAL_AG_PARABOLOID 0x1A07 // paraboloid projection
#define DXT_ENCODE_NORMAL_AG_QUARTIC 0x1A08 // newton method
#define DXT_ENCODE_NORMAL_AG_AZIMUTHAL 0x1A09 // Lambert Azimuthal Equal-Area
// rgbdata output flags
typedef enum
{
// rgbdata->flags
IMAGE_CUBEMAP = BIT(0), // it's 6-sides cubemap buffer
IMAGE_HAS_ALPHA = BIT(1), // image contain alpha-channel
IMAGE_HAS_COLOR = BIT(2), // image contain RGB-channel
IMAGE_COLORINDEX = BIT(3), // all colors in palette is gradients of last color (decals)
IMAGE_HAS_LUMA = BIT(4), // image has luma pixels (q1-style maps)
IMAGE_SKYBOX = BIT(5), // only used by FS_SaveImage - for write right suffixes
IMAGE_QUAKESKY = BIT(6), // it's a quake sky double layered clouds (so keep it as 8 bit)
IMAGE_DDS_FORMAT = BIT(7), // a hint for GL loader
IMAGE_MULTILAYER = BIT(8), // to differentiate from 3D texture
IMAGE_ONEBIT_ALPHA = BIT(9), // binary alpha
IMAGE_QUAKEPAL = BIT(10), // image has quake1 palette
// Image_Process manipulation flags
IMAGE_FLIP_X = BIT(16), // flip the image by width
IMAGE_FLIP_Y = BIT(17), // flip the image by height
IMAGE_ROT_90 = BIT(18), // flip from upper left corner to down right corner
IMAGE_ROT180 = IMAGE_FLIP_X|IMAGE_FLIP_Y,
IMAGE_ROT270 = IMAGE_FLIP_X|IMAGE_FLIP_Y|IMAGE_ROT_90,
IMAGE_EMBOSS = BIT(19), // apply emboss mapping
IMAGE_RESAMPLE = BIT(20), // resample image to specified dims
// reserved
// reserved
IMAGE_FORCE_RGBA = BIT(23), // force image to RGBA buffer
IMAGE_MAKE_LUMA = BIT(24), // create luma texture from indexed
IMAGE_QUANTIZE = BIT(25), // make indexed image from 24 or 32- bit image
IMAGE_LIGHTGAMMA = BIT(26), // apply gamma for image
IMAGE_REMAP = BIT(27), // interpret width and height as top and bottom color
} imgFlags_t;
typedef struct rgbdata_s
{
word width; // image width
word height; // image height
word depth; // image depth
uint type; // compression type
uint flags; // misc image flags
word encode; // DXT may have custom encoder, that will be decoded in GLSL-side
byte numMips; // mipmap count
byte *palette; // palette if present
byte *buffer; // image buffer
rgba_t fogParams; // some water textures in hl1 has info about fog color and alpha
size_t size; // for bounds checking
} rgbdata_t;

View File

@@ -16,11 +16,9 @@ GNU General Public License for more details.
#ifndef COM_MODEL_H
#define COM_MODEL_H
#include "xash3d_types.h"
#include "bspfile.h" // we need some declarations from it
typedef vec_t vec2_t[2];
typedef vec_t vec4_t[4];
/*
==============================================================================
@@ -34,16 +32,17 @@ typedef vec_t vec4_t[4];
#define MIPLEVELS 4
#define VERTEXSIZE 7
#define MAXLIGHTMAPS 4
#define MAXLIGHTMAPS 4 // max light styles per face
#define MAXDYNLIGHTS 8 // maximum dynamic lights per one pixel
#define NUM_AMBIENTS 4 // automatic ambient sounds
// model types
typedef enum
{
mod_bad = -1,
mod_brush,
mod_sprite,
mod_alias,
mod_brush,
mod_sprite,
mod_alias,
mod_studio
} modtype_t;
@@ -94,7 +93,7 @@ typedef struct texture_s
struct texture_s *alternate_anims; // bmodels in frame 1 use these
unsigned short fb_texturenum; // auto-luma texturenum
unsigned short dt_texturenum; // detail-texture binding
unsigned int unused[3]; // reserved
unsigned int unused[3]; // reserved
} texture_t;
typedef struct
@@ -148,7 +147,7 @@ typedef struct mnode_s
// node specific
mplane_t *plane;
struct mnode_s *children[2];
struct mnode_s *children[2];
#ifdef SUPPORT_BSP2_FORMAT
int firstsurface;
int numsurfaces;
@@ -167,7 +166,7 @@ struct decal_s
decal_t *pnext; // linked list for each surface
msurface_t *psurface; // Surface id for persistence / unlinking
float dx; // local texture coordinates
float dy; //
float dy; //
float scale; // Pixel scale
short texture; // Decal texture
short flags; // Decal flags FDECAL_*
@@ -232,7 +231,7 @@ typedef struct mextrasurf_s
int reserved[32]; // just for future expansions or mod-makers
} mextrasurf_t;
typedef struct msurface_s
struct msurface_s
{
int visframe; // should be drawn when node is crossed
@@ -264,7 +263,7 @@ typedef struct msurface_s
color24 *samples; // note: this is the actual lightmap data for this surface
decal_t *pdecals;
} msurface_t;
};
typedef struct hull_s
{
@@ -292,7 +291,7 @@ typedef struct model_s
// shared modelinfo
modtype_t type; // model type
int numframes; // sprite's framecount
byte *mempool; // private mempool (was synctype)
poolhandle_t mempool; // private mempool (was synctype)
int flags; // hl compatibility
//
@@ -300,7 +299,7 @@ typedef struct model_s
//
vec3_t mins, maxs; // bounding box at angles '0 0 0'
float radius;
// brush model
int firstmodelsurface;
int nummodelsurfaces;
@@ -387,7 +386,7 @@ typedef struct player_info_s
int bottomcolor;
// last frame rendered
int renderframe;
int renderframe;
// Gait frame estimation
int gaitsequence;
@@ -504,4 +503,36 @@ typedef struct
maliasframedesc_t frames[1]; // variable sized
} aliashdr_t;
#endif//COM_MODEL_H
// remapping info
#define SUIT_HUE_START 192
#define SUIT_HUE_END 223
#define PLATE_HUE_START 160
#define PLATE_HUE_END 191
#define SHIRT_HUE_START 16
#define SHIRT_HUE_END 32
#define PANTS_HUE_START 96
#define PANTS_HUE_END 112
// 1/32 epsilon to keep floating point happy
#define DIST_EPSILON (1.0f / 32.0f)
#define FRAC_EPSILON (1.0f / 1024.0f)
#define BACKFACE_EPSILON 0.01f
#define MAX_BOX_LEAFS 256
#define ANIM_CYCLE 2
#define MOD_FRAMES 20
#define MAX_DEMOS 32
#define MAX_MOVIES 8
#define MAX_CDTRACKS 32
#define MAX_CLIENT_SPRITES 256 // SpriteTextures
#define MAX_EFRAGS 8192 // Arcane Dimensions required
#define MAX_REQUESTS 64
#endif//COM_MODEL_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -22,4 +22,4 @@ typedef struct con_nprint_s
float color[3]; // RGB colors ( 0.0 -> 1.0 scale )
} con_nprint_t;
#endif//CON_NPRINT_H
#endif//CON_NPRINT_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -20,45 +20,45 @@
// Most came from server.h
// edict->flags
#define FL_FLY (1<<0) // Changes the SV_Movestep() behavior to not need to be on ground
#define FL_SWIM (1<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
#define FL_CONVEYOR (1<<2)
#define FL_CLIENT (1<<3)
#define FL_INWATER (1<<4)
#define FL_MONSTER (1<<5)
#define FL_GODMODE (1<<6)
#define FL_NOTARGET (1<<7)
#define FL_SKIPLOCALHOST (1<<8) // Don't send entity to local host, it's predicting this entity itself
#define FL_ONGROUND (1<<9) // At rest / on the ground
#define FL_PARTIALGROUND (1<<10) // not all corners are valid
#define FL_WATERJUMP (1<<11) // player jumping out of water
#define FL_FROZEN (1<<12) // Player is frozen for 3rd person camera
#define FL_FAKECLIENT (1<<13) // JAC: fake client, simulated server side; don't send network messages to them
#define FL_DUCKING (1<<14) // Player flag -- Player is fully crouched
#define FL_FLOAT (1<<15) // Apply floating force to this entity when in water
#define FL_GRAPHED (1<<16) // worldgraph has this ent listed as something that blocks a connection
#define FL_FLY (1U<<0) // Changes the SV_Movestep() behavior to not need to be on ground
#define FL_SWIM (1U<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
#define FL_CONVEYOR (1U<<2)
#define FL_CLIENT (1U<<3)
#define FL_INWATER (1U<<4)
#define FL_MONSTER (1U<<5)
#define FL_GODMODE (1U<<6)
#define FL_NOTARGET (1U<<7)
#define FL_SKIPLOCALHOST (1U<<8) // Don't send entity to local host, it's predicting this entity itself
#define FL_ONGROUND (1U<<9) // At rest / on the ground
#define FL_PARTIALGROUND (1U<<10) // not all corners are valid
#define FL_WATERJUMP (1U<<11) // player jumping out of water
#define FL_FROZEN (1U<<12) // Player is frozen for 3rd person camera
#define FL_FAKECLIENT (1U<<13) // JAC: fake client, simulated server side; don't send network messages to them
#define FL_DUCKING (1U<<14) // Player flag -- Player is fully crouched
#define FL_FLOAT (1U<<15) // Apply floating force to this entity when in water
#define FL_GRAPHED (1U<<16) // worldgraph has this ent listed as something that blocks a connection
// UNDONE: Do we need these?
#define FL_IMMUNE_WATER (1<<17)
#define FL_IMMUNE_SLIME (1<<18)
#define FL_IMMUNE_LAVA (1<<19)
#define FL_IMMUNE_WATER (1U<<17)
#define FL_IMMUNE_SLIME (1U<<18)
#define FL_IMMUNE_LAVA (1U<<19)
#define FL_PROXY (1<<20) // This is a spectator proxy
#define FL_ALWAYSTHINK (1<<21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path)
#define FL_BASEVELOCITY (1<<22) // Base velocity has been applied this frame (used to convert base velocity into momentum)
#define FL_MONSTERCLIP (1<<23) // Only collide in with monsters who have FL_MONSTERCLIP set
#define FL_ONTRAIN (1<<24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
#define FL_WORLDBRUSH (1<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
#define FL_SPECTATOR (1<<26) // This client is a spectator, don't run touch functions, etc.
#define FL_LASERDOT (1<<27) // Predicted laser spot from rocket launcher
#define FL_PROXY (1U<<20) // This is a spectator proxy
#define FL_ALWAYSTHINK (1U<<21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path)
#define FL_BASEVELOCITY (1U<<22) // Base velocity has been applied this frame (used to convert base velocity into momentum)
#define FL_MONSTERCLIP (1U<<23) // Only collide in with monsters who have FL_MONSTERCLIP set
#define FL_ONTRAIN (1U<<24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
#define FL_WORLDBRUSH (1U<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
#define FL_SPECTATOR (1U<<26) // This client is a spectator, don't run touch functions, etc.
#define FL_LASERDOT (1U<<27) // Predicted laser spot from rocket launcher
#define FL_CUSTOMENTITY (1<<29) // This is a custom entity
#define FL_KILLME (1<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time
#define FL_DORMANT (1<<31) // Entity is dormant, no updates to client
#define FL_CUSTOMENTITY (1U<<29) // This is a custom entity
#define FL_KILLME (1U<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time
#define FL_DORMANT (1U<<31) // Entity is dormant, no updates to client
// Goes into globalvars_t.trace_flags
#define FTRACE_SIMPLEBOX (1<<0) // Traceline with a simple box
#define FTRACE_IGNORE_GLASS (1<<1) // traceline will be ignored entities with rendermode != kRenderNormal
#define FTRACE_SIMPLEBOX (1U<<0) // Traceline with a simple box
#define FTRACE_IGNORE_GLASS (1U<<1) // traceline will be ignored entities with rendermode != kRenderNormal
// walkmove modes
#define WALKMOVE_NORMAL 0 // normal walkmove
@@ -114,50 +114,50 @@
#define EF_LIGHT 64 // rocket flare glow sprite
#define EF_NODRAW 128 // don't draw entity
#define EF_WATERSIDES (1<<26) // Do not remove sides for func_water entity
#define EF_FULLBRIGHT (1<<27) // Just get fullbright
#define EF_NOSHADOW (1<<28) // ignore shadow for this entity
#define EF_MERGE_VISIBILITY (1<<29) // this entity allowed to merge vis (e.g. env_sky or portal camera)
#define EF_REQUEST_PHS (1<<30) // This entity requested phs bitvector instead of pvsbitvector in AddToFullPack calls
#define EF_WATERSIDES (1U<<26) // Do not remove sides for func_water entity
#define EF_FULLBRIGHT (1U<<27) // Just get fullbright
#define EF_NOSHADOW (1U<<28) // ignore shadow for this entity
#define EF_MERGE_VISIBILITY (1U<<29) // this entity allowed to merge vis (e.g. env_sky or portal camera)
#define EF_REQUEST_PHS (1U<<30) // This entity requested phs bitvector instead of pvsbitvector in AddToFullPack calls
// g-cont. one reserved bit here for me
// entity flags
#define EFLAG_SLERP 1 // do studio interpolation of this entity
//
// temp entity events
//
#define TE_BEAMPOINTS 0 // beam effect between two points
// coord coord coord (start position)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (start position)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_BEAMENTPOINT 1 // beam effect between point and entity
// short (start entity)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// short (start entity)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_GUNSHOT 2 // particle effect plus ricochet sound
// coord coord coord (position)
// coord coord coord (position)
#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps
// coord coord coord (position)
// coord coord coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (framerate)
@@ -173,54 +173,54 @@
#define TE_EXPLFLAG_ROTATE 32 // rotate the sprite randomly
#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound
// coord coord coord (position)
// coord coord coord (position)
#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps
// coord coord coord (position)
// coord coord coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (framerate)
#define TE_TRACER 6 // tracer effect from point to point
// coord, coord, coord (start)
// coord, coord, coord (start)
// coord, coord, coord (end)
#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters
// coord, coord, coord (start)
// coord, coord, coord (end)
// byte (life in 0.1's)
// byte (width in 0.1's)
// coord, coord, coord (start)
// coord, coord, coord (end)
// byte (life in 0.1's)
// byte (width in 0.1's)
// byte (amplitude in 0.01's)
// short (sprite model index)
#define TE_BEAMENTS 8
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
#define TE_BEAMENTS 8
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite
// coord coord coord (position)
// coord coord coord (position)
#define TE_LAVASPLASH 10 // Quake1 lava splash
// coord coord coord (position)
// coord coord coord (position)
#define TE_TELEPORT 11 // Quake1 teleport splash
// coord coord coord (position)
// coord coord coord (position)
#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound
// coord coord coord (position)
// coord coord coord (position)
// byte (starting color)
// byte (num colors)
#define TE_BSPDECAL 13 // Decal from the .BSP file
#define TE_BSPDECAL 13 // Decal from the .BSP file
// coord, coord, coord (x,y,z), decal position (center of texture in world)
// short (texture index of precached decal texture name)
// short (entity index)
@@ -230,67 +230,67 @@
// coord, coord, coord (position)
// byte (radius)
// byte (count)
// byte (life in 0.1's)
// byte (life in 0.1's)
#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions
// coord, coord, coord (start)
// coord, coord, coord (end)
// coord, coord, coord (start)
// coord, coord, coord (end)
// short (sprite index)
// byte (count)
// byte (life in 0.1's)
// byte (scale in 0.1's)
// byte (life in 0.1's)
// byte (scale in 0.1's)
// byte (velocity along vector in 10's)
// byte (randomness of velocity in 10's)
#define TE_BEAM 16 // obsolete
#define TE_SPRITE 17 // additive sprite, plays 1 cycle
// coord, coord, coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// coord, coord, coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (brightness)
#define TE_BEAMSPRITE 18 // A beam with a sprite at the end
// coord, coord, coord (start position)
// coord, coord, coord (end position)
// short (beam sprite index)
// short (end sprite index)
// coord, coord, coord (start position)
// coord, coord, coord (end position)
// short (beam sprite index)
// short (end sprite index)
#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
@@ -298,30 +298,30 @@
#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving
// short (entity:attachment to follow)
// short (sprite index)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte,byte,byte (color)
// byte (brightness)
#define TE_GLOWSPRITE 23
#define TE_GLOWSPRITE 23
// coord, coord, coord (pos) short (model index) byte (scale / 10)
#define TE_BEAMRING 24 // connect a beam ring to two entities
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_STREAK_SPLASH 25 // oriented shower of tracers
// coord coord coord (start position)
// coord coord coord (direction vector)
// coord coord coord (start position)
// coord coord coord (direction vector)
// byte (color)
// short (count)
// short (base speed)
@@ -330,15 +330,15 @@
#define TE_BEAMHOSE 26 // obsolete
#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect
// coord, coord, coord (pos)
// byte (radius in 10's)
// coord, coord, coord (pos)
// byte (radius in 10's)
// byte byte byte (color)
// byte (life in 10's)
// byte (decay rate in 10's)
#define TE_ELIGHT 28 // point entity light, no world effect
// short (entity:attachment to follow)
// coord coord coord (initial position)
// coord coord coord (initial position)
// coord (radius)
// byte byte byte (color)
// byte (life in 0.1's)
@@ -374,8 +374,8 @@
#define TE_LARGEFUNNEL 100
// coord coord coord (funnel position)
// short (sprite index)
// short (flags)
// short (sprite index)
// short (flags)
#define TE_BLOODSTREAM 101 // particle spray
// coord coord coord (start position)
@@ -404,7 +404,7 @@
// byte (density)
#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits
// coord, coord, coord (position)
// coord, coord, coord (position)
// coord, coord, coord (velocity)
// angle (initial yaw)
// short (model index)
@@ -441,7 +441,7 @@
// byte (speed)
// byte (noise)
#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound.
#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound.
// coord, coord, coord (position)
// byte (scale in 0.1's)
@@ -529,7 +529,7 @@
#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance)
#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered as additive
#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent)
@@ -606,13 +606,6 @@
#define CONTENT_GRAVITY_FLYFIELD -18
#define CONTENT_FOG -19
#define CONTENT_EMPTY -1
#define CONTENT_SOLID -2
#define CONTENT_WATER -3
#define CONTENT_SLIME -4
#define CONTENT_LAVA -5
#define CONTENT_SKY -6
// channels
#define CHAN_AUTO 0
#define CHAN_WEAPON 1
@@ -620,7 +613,7 @@
#define CHAN_ITEM 3
#define CHAN_BODY 4
#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area
#define CHAN_STATIC 6 // allocate channel from the static area
#define CHAN_STATIC 6 // allocate channel from the static area
#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network
#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END).
@@ -628,7 +621,7 @@
#define ATTN_NONE 0
#define ATTN_NORM (float)0.8
#define ATTN_IDLE (float)2
#define ATTN_STATIC (float)1.25
#define ATTN_STATIC (float)1.25
// pitch values
#define PITCH_NORM 100 // non-pitch shifted
@@ -647,22 +640,22 @@
#define SF_TRAIN_PASSABLE 8 // Train is not solid -- used to make water trains
// buttons
#define IN_ATTACK (1<<0)
#define IN_JUMP (1<<1)
#define IN_DUCK (1<<2)
#define IN_FORWARD (1<<3)
#define IN_BACK (1<<4)
#define IN_USE (1<<5)
#define IN_CANCEL (1<<6)
#define IN_LEFT (1<<7)
#define IN_RIGHT (1<<8)
#define IN_MOVELEFT (1<<9)
#define IN_MOVERIGHT (1<<10)
#define IN_ATTACK2 (1<<11)
#define IN_RUN (1<<12)
#define IN_RELOAD (1<<13)
#define IN_ALT1 (1<<14)
#define IN_SCORE (1<<15) // Used by client.dll for when scoreboard is held down
#define IN_ATTACK (1U<<0)
#define IN_JUMP (1U<<1)
#define IN_DUCK (1U<<2)
#define IN_FORWARD (1U<<3)
#define IN_BACK (1U<<4)
#define IN_USE (1U<<5)
#define IN_CANCEL (1U<<6)
#define IN_LEFT (1U<<7)
#define IN_RIGHT (1U<<8)
#define IN_MOVELEFT (1U<<9)
#define IN_MOVERIGHT (1U<<10)
#define IN_ATTACK2 (1U<<11)
#define IN_RUN (1U<<12)
#define IN_RELOAD (1U<<13)
#define IN_ALT1 (1U<<14)
#define IN_SCORE (1U<<15) // Used by client.dll for when scoreboard is held down
// Break Model Defines
#define BREAK_TYPEMASK 0x4F
@@ -691,8 +684,8 @@
#define TE_BOUNCE_SHOTSHELL 2
// Rendering constants
enum
{
enum
{
kRenderNormal, // src
kRenderTransColor, // c*a+dest*(1-a)
kRenderTransTexture, // src*a+dest*(1-a)
@@ -701,21 +694,21 @@ enum
kRenderTransAdd, // src*a+dest
};
enum
{
kRenderFxNone = 0,
kRenderFxPulseSlow,
kRenderFxPulseFast,
kRenderFxPulseSlowWide,
kRenderFxPulseFastWide,
kRenderFxFadeSlow,
kRenderFxFadeFast,
kRenderFxSolidSlow,
kRenderFxSolidFast,
kRenderFxStrobeSlow,
kRenderFxStrobeFast,
kRenderFxStrobeFaster,
kRenderFxFlickerSlow,
enum
{
kRenderFxNone = 0,
kRenderFxPulseSlow,
kRenderFxPulseFast,
kRenderFxPulseSlowWide,
kRenderFxPulseFastWide,
kRenderFxFadeSlow,
kRenderFxFadeFast,
kRenderFxSolidSlow,
kRenderFxSolidFast,
kRenderFxStrobeSlow,
kRenderFxStrobeFast,
kRenderFxStrobeFaster,
kRenderFxFlickerSlow,
kRenderFxFlickerFast,
kRenderFxNoDissipation,
kRenderFxDistort, // Distort/scale/translate flicker
@@ -729,20 +722,11 @@ enum
typedef int func_t;
typedef int string_t;
typedef unsigned char byte;
typedef unsigned short word;
#include "xash3d_types.h"
#define Q_isspace( ch ) (ch < 32 || ch > 255)
#undef true
#undef false
#ifndef __cplusplus
typedef enum { false, true } qboolean;
#else
typedef int qboolean;
#endif
typedef struct
{
byte r, g, b;
@@ -778,4 +762,4 @@ typedef struct
int hitgroup; // 0 == generic, non zero is specific body part
} trace_t;
#endif//CONST_H
#endif//CONST_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -28,11 +28,11 @@
#define FCVAR_MOVEVARS (1<<10) // this cvar is a part of movevars_t struct that shared between client and server
#define FCVAR_LATCH (1<<11) // notify client what this cvar will be applied only after server restart (but don't does more nothing)
#define FCVAR_GLCONFIG (1<<12) // write it into opengl.cfg
#define FCVAR_GLCONFIG (1<<12) // write it into <renderer>.cfg(see RefAPI)
#define FCVAR_CHANGED (1<<13) // set each time the cvar is changed
#define FCVAR_GAMEUIDLL (1<<14) // defined by the menu DLL
#define FCVAR_CHEAT (1<<15) // can not be changed if cheats are disabled
typedef struct cvar_s
{
char *name;
@@ -42,4 +42,4 @@ typedef struct cvar_s
struct cvar_s *next;
} cvar_t;
#endif//CVARDEF_H
#endif//CVARDEF_H

195
common/defaults.h Normal file
View File

@@ -0,0 +1,195 @@
/*
defaults.h - set up default configuration
Copyright (C) 2016 Mittorn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifndef DEFAULTS_H
#define DEFAULTS_H
#include "backends.h"
#include "build.h"
/*
===================================================================
SETUP BACKENDS DEFINITIONS
===================================================================
*/
#if !XASH_DEDICATED
#if XASH_SDL
// we are building using libSDL
#ifndef XASH_VIDEO
#define XASH_VIDEO VIDEO_SDL
#endif // XASH_VIDEO
#ifndef XASH_INPUT
#define XASH_INPUT INPUT_SDL
#endif // XASH_INPUT
#ifndef XASH_SOUND
#define XASH_SOUND SOUND_SDL
#endif // XASH_SOUND
#if XASH_SDL == 2
#ifndef XASH_TIMER
#define XASH_TIMER TIMER_SDL
#endif // XASH_TIMER
#ifndef XASH_MESSAGEBOX
#define XASH_MESSAGEBOX MSGBOX_SDL
#endif // XASH_MESSAGEBOX
#endif
#elif XASH_ANDROID
// we are building for Android platform, use Android APIs
#ifndef XASH_VIDEO
#define XASH_VIDEO VIDEO_ANDROID
#endif // XASH_VIDEO
#ifndef XASH_INPUT
#define XASH_INPUT INPUT_ANDROID
#endif // XASH_INPUT
#ifndef XASH_SOUND
#define XASH_SOUND SOUND_OPENSLES
#endif // XASH_SOUND
#ifndef XASH_MESSAGEBOX
#define XASH_MESSAGEBOX MSGBOX_ANDROID
#endif // XASH_MESSAGEBOX
#define XASH_USE_EVDEV
#define XASH_DYNAMIC_DLADDR
#elif XASH_LINUX
// we are building for Linux without SDL2, can draw only to framebuffer yet
#ifndef XASH_VIDEO
#define XASH_VIDEO VIDEO_FBDEV
#endif // XASH_VIDEO
#ifndef XASH_INPUT
#define XASH_INPUT INPUT_EVDEV
#endif // XASH_INPUT
#ifndef XASH_SOUND
#define XASH_SOUND SOUND_ALSA
#endif // XASH_SOUND
#define XASH_USE_EVDEV
#elif XASH_DOS4GW
#ifndef XASH_VIDEO
#define XASH_VIDEO VIDEO_DOS
#endif
#ifndef XASH_TIMER
#define XASH_TIMER TIMER_DOS
#endif
// usually only 10-20 fds availiable
#define XASH_REDUCE_FD
#endif
#endif // XASH_DEDICATED
//
// select messagebox implementation
//
#ifndef XASH_MESSAGEBOX
#if XASH_WIN32
#define XASH_MESSAGEBOX MSGBOX_WIN32
#else // !XASH_WIN32
#define XASH_MESSAGEBOX MSGBOX_STDERR
#endif // !XASH_WIN32
#endif // XASH_MESSAGEBOX
//
// select crashhandler based on defines
//
#ifndef XASH_CRASHHANDLER
#if XASH_WIN32 && defined(DBGHELP)
#define XASH_CRASHHANDLER CRASHHANDLER_DBGHELP
#elif XASH_LINUX || XASH_BSD
#define XASH_CRASHHANDLER CRASHHANDLER_UCONTEXT
#endif // !(XASH_LINUX || XASH_BSD || XASH_WIN32)
#endif
//
// no timer - no xash
//
#ifndef XASH_TIMER
#if XASH_WIN32
#define XASH_TIMER TIMER_WIN32
#else // !XASH_WIN32
#define XASH_TIMER TIMER_POSIX
#endif // !XASH_WIN32
#endif
#ifdef XASH_STATIC_LIBS
#define XASH_LIB LIB_STATIC
#define XASH_INTERNAL_GAMELIBS
#define XASH_ALLOW_SAVERESTORE_OFFSETS
#elif XASH_WIN32
#define XASH_LIB LIB_WIN32
#elif XASH_POSIX
#define XASH_LIB LIB_POSIX
#endif
//
// fallback to NULL
//
#ifndef XASH_VIDEO
#define XASH_VIDEO VIDEO_NULL
#endif // XASH_VIDEO
#ifndef XASH_SOUND
#define XASH_SOUND SOUND_NULL
#endif // XASH_SOUND
#ifndef XASH_INPUT
#define XASH_INPUT INPUT_NULL
#endif // XASH_INPUT
#ifndef XASH_CRASHHANDLER
#define XASH_CRASHHANDLER CRASHHANDLER_NULL
#endif // XASH_CRASHHANDLER
/*
=========================================================================
Default build-depended cvar and constant values
=========================================================================
*/
#if XASH_MOBILE_PLATFORM
#define DEFAULT_TOUCH_ENABLE "1"
#define DEFAULT_M_IGNORE "1"
#else // !XASH_MOBILE_PLATFORM
#define DEFAULT_TOUCH_ENABLE "0"
#define DEFAULT_M_IGNORE "0"
#endif // !XASH_MOBILE_PLATFORM
#if XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
#define XASH_INTERNAL_GAMELIBS
// this means that libraries are provided with engine, but not in game data
// You need add library loading code to library.c when adding new platform
#endif // XASH_ANDROID || XASH_IOS || XASH_EMSCRIPTEN
// allow override for developer/debug builds
#ifndef DEFAULT_DEV
#define DEFAULT_DEV 0
#endif // DEFAULT_DEV
#ifndef DEFAULT_FULLSCREEN
#define DEFAULT_FULLSCREEN 1
#endif // DEFAULT_FULLSCREEN
#endif // DEFAULTS_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -24,4 +24,4 @@ typedef struct demo_api_s
void (*WriteBuffer)( int size, unsigned char *buffer );
} demo_api_t;
#endif//DEMO_API_H
#endif//DEMO_API_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -28,4 +28,4 @@ typedef struct dlight_s
qboolean dark; // subtracts light instead of adding
} dlight_t;
#endif//DLIGHT_H
#endif//DLIGHT_H

View File

@@ -17,7 +17,7 @@ GNU General Public License for more details.
#define FEATURES_H
// list of engine features that can be enabled through callback SV_CheckFeatures
#define ENGINE_WRITE_LARGE_COORD (1<<0) // replace standard message WRITE_COORD with big message for support more than 8192 units in world
#define ENGINE_WRITE_LARGE_COORD (1<<0) // replace standard message WRITE_COORD with big message for support more than 8192 units in world
#define ENGINE_QUAKE_COMPATIBLE (1<<1) // make engine compatible with quake (flags and effects)
#define ENGINE_LOAD_DELUXEDATA (1<<2) // loading deluxemap for map (if present)
#define ENGINE_PHYSICS_PUSHER_EXT (1<<3) // enable sets of improvements for MOVETYPE_PUSH physics
@@ -26,4 +26,4 @@ GNU General Public License for more details.
#define ENGINE_IMPROVED_LINETRACE (1<<6) // new traceline that tracing through alphatextures
#define ENGINE_COMPUTE_STUDIO_LERP (1<<7) // enable MOVETYPE_STEP lerping back in engine
#endif//FEATURES_H
#endif//FEATURES_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -19,7 +19,7 @@
#define ENTITY_NORMAL (1<<0)
#define ENTITY_BEAM (1<<1)
// Entity state is used for the baseline and for delta compression of a packet of
// Entity state is used for the baseline and for delta compression of a packet of
// entities that is sent to a client.
typedef struct entity_state_s entity_state_t;
@@ -28,7 +28,7 @@ struct entity_state_s
// Fields which are filled in by routines outside of delta compression
int entityType;
// Index into cl_entities array for this entity.
int number;
int number;
float msg_time;
// Message number last time the player/entity state was updated.
@@ -63,36 +63,36 @@ struct entity_state_s
vec3_t velocity;
// Send bbox down to client for use during prediction.
vec3_t mins;
vec3_t mins;
vec3_t maxs;
int aiment;
// If owned by a player, the index of that player ( for projectiles ).
int owner;
int owner;
// Friction, for prediction.
float friction;
float friction;
// Gravity multiplier
float gravity;
float gravity;
// PLAYER SPECIFIC
int team;
int playerclass;
int health;
qboolean spectator;
qboolean spectator;
int weaponmodel;
int gaitsequence;
// If standing on conveyor, e.g.
vec3_t basevelocity;
vec3_t basevelocity;
// Use the crouched hull, or the regular player hull.
int usehull;
int usehull;
// Latched buttons last time state updated.
int oldbuttons;
int oldbuttons;
// -1 = in air, else pmove entity number
int onground;
int onground;
int iStepLeft;
// How fast we are falling
float flFallVelocity;
float flFallVelocity;
float fov;
int weaponanim;
@@ -135,7 +135,7 @@ typedef struct clientdata_s
int bInDuck;
int weapons; // remove?
int flTimeStepSound;
int flDuckTime;
int flSwimTime;
@@ -152,7 +152,7 @@ typedef struct clientdata_s
int ammo_cells;
int ammo_rockets;
float m_flNextAttack;
int tfstate;
int pushmsec;
int deadflag;
@@ -185,4 +185,4 @@ typedef struct local_state_s
weapon_data_t weapondata[MAX_LOCAL_WEAPONS];
} local_state_t;
#endif//ENTITY_STATE_H
#endif//ENTITY_STATE_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -22,4 +22,4 @@
#define ET_BEAM 3
#define ET_FRAGMENTED 4 // BMODEL or SPRITE that was split across BSP nodes
#endif//ENTITY_TYPES_H
#endif//ENTITY_TYPES_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -55,4 +55,4 @@ typedef struct event_api_s
void ( *EV_PopTraceBounds)( void );
} event_api_t;
#endif//EVENT_API_H
#endif//EVENT_API_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -44,4 +44,4 @@ typedef struct event_args_s
int bparam2;
} event_args_t;
#endif//EVENT_ARGS_H
#endif//EVENT_ARGS_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -17,13 +17,13 @@
#define EVENT_FLAGS_H
// Skip local host for event send.
#define FEV_NOTHOST (1<<0)
#define FEV_NOTHOST (1<<0)
// Send the event reliably. You must specify the origin and angles and use
// PLAYBACK_EVENT_FULL for this to work correctly on the server for anything
// that depends on the event origin/angles. I.e., the origin/angles are not
// taken from the invoking edict for reliable events.
#define FEV_RELIABLE (1<<1)
#define FEV_RELIABLE (1<<1)
// Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC
// sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ).
@@ -42,4 +42,4 @@
// Only issue event client side ( from shared code )
#define FEV_CLIENT (1<<6)
#endif//EVENT_FLAGS_H
#endif//EVENT_FLAGS_H

View File

@@ -47,4 +47,4 @@ typedef struct
int gamemode;
} GAMEINFO;
#endif//GAMEINFO_H
#endif//GAMEINFO_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -23,7 +23,7 @@
// sub commands of svc_hltv:
#define HLTV_ACTIVE 0 // tells client that he's an spectator and will get director commands
#define HLTV_STATUS 1 // send status infos about proxy
#define HLTV_STATUS 1 // send status infos about proxy
#define HLTV_LISTEN 2 // tell client to listen to a multicast stream
// sub commands of svc_director:
@@ -45,7 +45,7 @@
// HLTV_EVENT event flags
#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
#define DRC_FLAG_SIDE (1<<4) //
#define DRC_FLAG_SIDE (1<<4) //
#define DRC_FLAG_DRAMATIC (1<<5) // is a dramatic scene
#define DRC_FLAG_SLOWMOTION (1<<6) // would look good in SloMo
#define DRC_FLAG_FACEPLAYER (1<<7) // player is doning something (reload/defuse bomb etc)
@@ -56,4 +56,4 @@
#define MAX_DIRECTOR_CMD_PARAMETERS 4
#define MAX_DIRECTOR_CMD_STRING 128
#endif//HLTV_H
#endif//HLTV_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -26,13 +26,13 @@ typedef enum
typedef struct IVoiceTweak_s
{
// These turn voice tweak mode on and off. While in voice tweak mode, the user's voice is echoed back
// without sending to the server.
// without sending to the server.
int (*StartVoiceTweakMode)( void ); // Returns 0 on error.
void (*EndVoiceTweakMode)( void );
// Get/set control values.
void (*SetControlFloat)( VoiceTweakControl iControl, float value );
float (*GetControlFloat)( VoiceTweakControl iControl );
} IVoiceTweak;
#endif//IVOICETWEAK_H
#endif//IVOICETWEAK_H

18
common/kbutton.h Normal file
View File

@@ -0,0 +1,18 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#if !defined( KBUTTONH )
#define KBUTTONH
#pragma once
typedef struct kbutton_s
{
int down[2]; // key nums holding it down
int state; // low bit is down state
} kbutton_t;
#endif // !KBUTTONH

View File

@@ -26,4 +26,4 @@ typedef struct
float time; // local time is gurantee what new style begins from the start, not mid or end of the sequence
} lightstyle_t;
#endif//LIGHTSTYLE_H
#endif//LIGHTSTYLE_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -28,6 +28,7 @@
// kill the request hook after receiving the first response
#define FNETAPI_MULTIPLE_RESPONSE ( 1<<0 )
struct net_response_s;
typedef void (*net_api_response_func_t) ( struct net_response_s *response );
#define NET_SUCCESS ( 0 )
@@ -63,7 +64,7 @@ typedef struct net_response_s
typedef struct net_status_s
{
// Connected to remote server? 1 == yes, 0 otherwise
int connected;
int connected;
// Client's IP address
netadr_t local_address;
// Address of remote server
@@ -86,7 +87,7 @@ typedef struct net_api_s
void (*SendRequest)( int context, int request, int flags, double timeout, struct netadr_s *remote_address, net_api_response_func_t response );
void (*CancelRequest)( int context );
void (*CancelAllRequests)( void );
char *(*AdrToString)( struct netadr_s *a );
const char *(*AdrToString)( struct netadr_s *a );
int ( *CompareAdr)( struct netadr_s *a, struct netadr_s *b );
int ( *StringToAdr)( char *s, struct netadr_s *a );
const char *(*ValueForKey)( const char *s, const char *key );
@@ -94,4 +95,4 @@ typedef struct net_api_s
void (*SetValueForKey)( char *s, const char *key, const char *value, int maxsize );
} net_api_t;
#endif//NET_APIH
#endif//NET_APIH

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -34,4 +34,4 @@ typedef struct netadr_s
unsigned short port;
} netadr_t;
#endif//NETADR_H
#endif//NETADR_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -18,7 +18,7 @@
typedef enum
{
pt_static,
pt_static,
pt_grav,
pt_slowgrav,
pt_fire,
@@ -45,9 +45,9 @@ typedef struct particle_s
// for pt_clientcusttom, we'll call this function each frame
void (*callback)( struct particle_s *particle, float frametime );
// For deathfunc, etc.
unsigned char context;
} particle_t;
#endif//PARTICLEDEF_H
#endif//PARTICLEDEF_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -33,9 +33,9 @@ struct pmtrace_s
vec3_t endpos; // final position
pmplane_t plane; // surface normal at impact
int ent; // entity at impact
vec3_t deltavelocity; // Change in player's velocity caused by impact.
vec3_t deltavelocity; // Change in player's velocity caused by impact.
// Only run on server.
int hitgroup;
};
#endif//PM_TRACE_H
#endif//PM_TRACE_H

152
common/port.h Normal file
View File

@@ -0,0 +1,152 @@
/*
port.h -- Portability Layer for Windows types
Copyright (C) 2015 Alibek Omarov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef PORT_H
#define PORT_H
#include "build.h"
#if !XASH_WIN32
#if XASH_APPLE
#include <sys/syslimits.h>
#define OS_LIB_EXT "dylib"
#define OPEN_COMMAND "open"
#else
#define OS_LIB_EXT "so"
#define OPEN_COMMAND "xdg-open"
#endif
#define OS_LIB_PREFIX "lib"
#if XASH_ANDROID
//#if defined(LOAD_HARDFP)
// #define POSTFIX "_hardfp"
//#else
#define POSTFIX
//#endif
#else
#endif
#define VGUI_SUPPORT_DLL "libvgui_support." OS_LIB_EXT
// Windows-specific
#define __cdecl
#define __stdcall
#define _inline static inline
#define FORCEINLINE inline __attribute__((always_inline))
#if XASH_POSIX
#define PATH_SPLITTER "/"
#include <unistd.h>
#include <dlfcn.h>
#define O_BINARY 0 // O_BINARY is Windows extension
#define O_TEXT 0 // O_TEXT is Windows extension
// Windows functions to posix equivalent
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
#define LoadLibrary( x ) dlopen( x, RTLD_NOW )
#define GetProcAddress( x, y ) dlsym( x, y )
#define FreeLibrary( x ) dlclose( x )
#define tell( a ) lseek(a, 0, SEEK_CUR)
#define HAVE_DUP
#endif
#if XASH_DOS4GW
#define PATH_SPLITTER "\\"
#define LoadLibrary( x ) (0)
#define GetProcAddress( x, y ) (0)
#define FreeLibrary( x ) (0)
#endif
//#define MAKEWORD( a, b ) ((short int)(((unsigned char)(a))|(((short int)((unsigned char)(b)))<<8)))
#define max( a, b ) (((a) > (b)) ? (a) : (b))
#define min( a, b ) (((a) < (b)) ? (a) : (b))
/// TODO: check if we may clean this defines, it should not appear in non-platform code!
typedef unsigned char BYTE;
typedef short int WORD;
typedef unsigned int DWORD;
typedef int LONG;
typedef unsigned int ULONG;
typedef int WPARAM;
typedef unsigned int LPARAM;
typedef void* HANDLE;
typedef void* HMODULE;
typedef void* HINSTANCE;
typedef char* LPSTR;
typedef struct tagPOINT
{
int x, y;
} POINT;
#else // WIN32
#define PATH_SPLITTER "\\"
#ifdef __MINGW32__
#define _inline static inline
#define FORCEINLINE inline __attribute__((always_inline))
#else
#define FORCEINLINE __forceinline
#endif
#define open _open
#define read _read
#define alloca _alloca
// shut-up compiler warnings
#pragma warning(disable : 4244) // MIPS
#pragma warning(disable : 4018) // signed/unsigned mismatch
#pragma warning(disable : 4305) // truncation from const double to float
#pragma warning(disable : 4115) // named type definition in parentheses
#pragma warning(disable : 4100) // unreferenced formal parameter
#pragma warning(disable : 4127) // conditional expression is constant
#pragma warning(disable : 4057) // differs in indirection to slightly different base types
#pragma warning(disable : 4201) // nonstandard extension used
#pragma warning(disable : 4706) // assignment within conditional expression
#pragma warning(disable : 4054) // type cast' : from function pointer
#pragma warning(disable : 4310) // cast truncates constant value
#define HSPRITE WINAPI_HSPRITE
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <windows.h>
#undef HSPRITE
#define OS_LIB_PREFIX ""
#define OS_LIB_EXT "dll"
#define VGUI_SUPPORT_DLL "../vgui_support." OS_LIB_EXT
#ifdef XASH_64BIT
// windows NameForFunction not implemented yet
#define XASH_ALLOW_SAVERESTORE_OFFSETS
#endif
#define HAVE_DUP
#endif //WIN32
#ifndef XASH_LOW_MEMORY
#define XASH_LOW_MEMORY 0
#endif
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#if defined XASH_SDL && !defined REF_DLL
#include <SDL.h>
#endif
#endif // PORT_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -35,4 +35,4 @@ typedef struct qfont_s
byte data[4];
} qfont_t;
#endif//QFONT_H
#endif//QFONT_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -17,7 +17,7 @@
#define R_EFX_H
// particle_t
#if !defined( PARTICLEDEFH )
#if !defined( PARTICLEDEFH )
#include "particledef.h"
#endif
@@ -75,7 +75,7 @@ color24 gTracerColors[] =
#define FTENT_SPIRAL 0x00000400
#define FTENT_SPRCYCLE 0x00000800
#define FTENT_COLLIDEALL 0x00001000 // will collide with world and slideboxes
#define FTENT_PERSIST 0x00002000 // tent is not removed when unable to draw
#define FTENT_PERSIST 0x00002000 // tent is not removed when unable to draw
#define FTENT_COLLIDEKILL 0x00004000 // tent is removed upon collision with anything
#define FTENT_PLYRATTACHMENT 0x00008000 // tent is attached to a player (owner)
#define FTENT_SPRANIMATELOOP 0x00010000 // animating sprite doesn't die when last frame is displayed
@@ -84,7 +84,7 @@ color24 gTracerColors[] =
#define FTENT_CLIENTCUSTOM 0x00080000 // Must specify callback. Callback function is responsible for killing tempent and updating fields ( unless other flags specify how to do things )
#define FTENT_SCALE 0x00100000 // An experiment
typedef struct tempent_s TEMPENTITY;
struct pmtrace_s;
typedef struct tempent_s
{
int flags;
@@ -98,11 +98,11 @@ typedef struct tempent_s
int hitSound;
void (*hitcallback)( struct tempent_s *ent, struct pmtrace_s *ptr );
void (*callback)( struct tempent_s *ent, float frametime, float currenttime );
TEMPENTITY *next;
struct tempent_s *next;
int priority;
short clientIndex; // if attached, this is the index of the client to stick to
// if COLLIDEALL, this is the index of the client to ignore
// TENTS with FTENT_PLYRATTACHMENT MUST set the clientindex!
// TENTS with FTENT_PLYRATTACHMENT MUST set the clientindex!
vec3_t tentOffset; // if attached, client origin + tentOffset = tent origin.
cl_entity_t entity;
@@ -117,58 +117,58 @@ typedef struct efx_api_s efx_api_t;
struct efx_api_s
{
particle_t *(*R_AllocParticle)( void (*callback)( struct particle_s *particle, float frametime ));
void (*R_BlobExplosion)( float *org );
void (*R_Blood)( float *org, float *dir, int pcolor, int speed );
void (*R_BloodSprite)( float *org, int colorindex, int modelIndex, int modelIndex2, float size );
void (*R_BloodStream)( float *org, float *dir, int pcolor, int speed );
void (*R_BreakModel)( float *pos, float *size, float *dir, float random, float life, int count, int modelIndex, char flags );
void (*R_Bubbles)( float *mins, float *maxs, float height, int modelIndex, int count, float speed );
void (*R_BubbleTrail)( float *start, float *end, float height, int modelIndex, int count, float speed );
void (*R_BulletImpactParticles)( float *pos );
void (*R_BlobExplosion)( const float *org );
void (*R_Blood)( const float *org, const float *dir, int pcolor, int speed );
void (*R_BloodSprite)( const float *org, int colorindex, int modelIndex, int modelIndex2, float size );
void (*R_BloodStream)( const float *org, const float *dir, int pcolor, int speed );
void (*R_BreakModel)( const float *pos, const float *size, const float *dir, float random, float life, int count, int modelIndex, char flags );
void (*R_Bubbles)( const float *mins, const float *maxs, float height, int modelIndex, int count, float speed );
void (*R_BubbleTrail)( const float *start, const float *end, float height, int modelIndex, int count, float speed );
void (*R_BulletImpactParticles)( const float *pos );
void (*R_EntityParticles)( struct cl_entity_s *ent );
void (*R_Explosion)( float *pos, int model, float scale, float framerate, int flags );
void (*R_FizzEffect)( struct cl_entity_s *pent, int modelIndex, int density );
void (*R_FireField)( float *org, int radius, int modelIndex, int count, int flags, float life );
void (*R_FlickerParticles)( float *org );
void (*R_FunnelSprite)( float *org, int modelIndex, int reverse );
void (*R_Implosion)( float *end, float radius, int count, float life );
void (*R_LargeFunnel)( float *org, int reverse );
void (*R_LavaSplash)( float *org );
void (*R_MultiGunshot)( float *org, float *dir, float *noise, int count, int decalCount, int *decalIndices );
void (*R_MuzzleFlash)( float *pos1, int type );
void (*R_ParticleBox)( float *mins, float *maxs, unsigned char r, unsigned char g, unsigned char b, float life );
void (*R_ParticleBurst)( float *pos, int size, int color, float life );
void (*R_ParticleExplosion)( float *org );
void (*R_ParticleExplosion2)( float *org, int colorStart, int colorLength );
void (*R_ParticleLine)( float *start, float *end, unsigned char r, unsigned char g, unsigned char b, float life );
void (*R_FlickerParticles)( const float *org );
void (*R_FunnelSprite)( const float *org, int modelIndex, int reverse );
void (*R_Implosion)( const float *end, float radius, int count, float life );
void (*R_LargeFunnel)( const float *org, int reverse );
void (*R_LavaSplash)( const float *org );
void (*R_MultiGunshot)( const float *org, const float *dir, const float *noise, int count, int decalCount, int *decalIndices );
void (*R_MuzzleFlash)( const float *pos1, int type );
void (*R_ParticleBox)( const float *mins, const float *maxs, unsigned char r, unsigned char g, unsigned char b, float life );
void (*R_ParticleBurst)( const float *pos, int size, int color, float life );
void (*R_ParticleExplosion)( const float *org );
void (*R_ParticleExplosion2)( const float *org, int colorStart, int colorLength );
void (*R_ParticleLine)( const float *start, const float *end, unsigned char r, unsigned char g, unsigned char b, float life );
void (*R_PlayerSprites)( int client, int modelIndex, int count, int size );
void (*R_Projectile)( float *origin, float *velocity, int modelIndex, int life, int owner, void (*hitcallback)( struct tempent_s *ent, struct pmtrace_s *ptr ) );
void (*R_RicochetSound)( float *pos );
void (*R_RicochetSprite)( float *pos, struct model_s *pmodel, float duration, float scale );
void (*R_RocketFlare)( float *pos );
void (*R_Projectile)( const float *origin, const float *velocity, int modelIndex, int life, int owner, void (*hitcallback)( struct tempent_s *ent, struct pmtrace_s *ptr ) );
void (*R_RicochetSound)( const float *pos );
void (*R_RicochetSprite)( const float *pos, struct model_s *pmodel, float duration, float scale );
void (*R_RocketFlare)( const float *pos );
void (*R_RocketTrail)( float *start, float *end, int type );
void (*R_RunParticleEffect)( float *org, float *dir, int color, int count );
void (*R_ShowLine)( float *start, float *end );
void (*R_SparkEffect)( float *pos, int count, int velocityMin, int velocityMax );
void (*R_SparkShower)( float *pos );
void (*R_SparkStreaks)( float *pos, int count, int velocityMin, int velocityMax );
void (*R_Spray)( float *pos, float *dir, int modelIndex, int count, int speed, int spread, int rendermode );
void (*R_RunParticleEffect)( const float *org, const float *dir, int color, int count );
void (*R_ShowLine)( const float *start, const float *end );
void (*R_SparkEffect)( const float *pos, int count, int velocityMin, int velocityMax );
void (*R_SparkShower)( const float *pos );
void (*R_SparkStreaks)( const float *pos, int count, int velocityMin, int velocityMax );
void (*R_Spray)( const float *pos, const float *dir, int modelIndex, int count, int speed, int spread, int rendermode );
void (*R_Sprite_Explode)( TEMPENTITY *pTemp, float scale, int flags );
void (*R_Sprite_Smoke)( TEMPENTITY *pTemp, float scale );
void (*R_Sprite_Spray)( float *pos, float *dir, int modelIndex, int count, int speed, int iRand );
void (*R_Sprite_Spray)( const float *pos, const float *dir, int modelIndex, int count, int speed, int iRand );
void (*R_Sprite_Trail)( int type, float *start, float *end, int modelIndex, int count, float life, float size, float amplitude, int renderamt, float speed );
void (*R_Sprite_WallPuff)( TEMPENTITY *pTemp, float scale );
void (*R_StreakSplash)( float *pos, float *dir, int color, int count, float speed, int velocityMin, int velocityMax );
void (*R_TracerEffect)( float *start, float *end );
void (*R_StreakSplash)( const float *pos, const float *dir, int color, int count, float speed, int velocityMin, int velocityMax );
void (*R_TracerEffect)( const float *start, const float *end );
void (*R_UserTracerParticle)( float *org, float *vel, float life, int colorIndex, float length, unsigned char deathcontext, void (*deathfunc)( struct particle_s *particle ));
particle_t *(*R_TracerParticles)( float *org, float *vel, float life );
void (*R_TeleportSplash)( float *org );
void (*R_TempSphereModel)( float *pos, float speed, float life, int count, int modelIndex );
TEMPENTITY *(*R_TempModel)( float *pos, float *dir, float *angles, float life, int modelIndex, int soundtype );
TEMPENTITY *(*R_DefaultSprite)( float *pos, int spriteIndex, float framerate );
TEMPENTITY *(*R_TempSprite)( float *pos, float *dir, float scale, int modelIndex, int rendermode, int renderfx, float a, float life, int flags );
void (*R_TeleportSplash)( const float *org );
void (*R_TempSphereModel)( const float *pos, float speed, float life, int count, int modelIndex );
TEMPENTITY *(*R_TempModel)( const float *pos, const float *dir, const float *angles, float life, int modelIndex, int soundtype );
TEMPENTITY *(*R_DefaultSprite)( const float *pos, int spriteIndex, float framerate );
TEMPENTITY *(*R_TempSprite)( float *pos, const float *dir, float scale, int modelIndex, int rendermode, int renderfx, float a, float life, int flags );
int (*Draw_DecalIndex)( int id );
int (*Draw_DecalIndexFromName)( char *name );
int (*Draw_DecalIndexFromName)( const char *name );
void (*R_DecalShoot)( int textureIndex, int entity, int modelIndex, float *position, int flags );
void (*R_AttachTentToPlayer)( int client, int modelIndex, float zoffset, float life );
void (*R_KillAttachedTents)( int client );
@@ -182,14 +182,14 @@ struct efx_api_s
BEAM *(*R_BeamRing)( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b );
dlight_t *(*CL_AllocDlight)( int key );
dlight_t *(*CL_AllocElight)( int key );
TEMPENTITY *(*CL_TempEntAlloc)( float *org, struct model_s *model );
TEMPENTITY *(*CL_TempEntAllocNoModel)( float *org );
TEMPENTITY *(*CL_TempEntAllocHigh)( float *org, struct model_s *model );
TEMPENTITY *(*CL_TentEntAllocCustom)( float *origin, struct model_s *model, int high, void (*callback)( struct tempent_s *ent, float frametime, float currenttime ));
TEMPENTITY *(*CL_TempEntAlloc)( const float *org, struct model_s *model );
TEMPENTITY *(*CL_TempEntAllocNoModel)( const float *org );
TEMPENTITY *(*CL_TempEntAllocHigh)( const float *org, struct model_s *model );
TEMPENTITY *(*CL_TentEntAllocCustom)( const float *origin, struct model_s *model, int high, void (*callback)( struct tempent_s *ent, float frametime, float currenttime ));
void (*R_GetPackedColor)( short *packed, short color );
short (*R_LookupColor)( unsigned char r, unsigned char g, unsigned char b );
void (*R_DecalRemoveAll)( int textureIndex ); // textureIndex points to the decal index in the array, not the actual texture index.
void (*R_FireCustomDecal)( int textureIndex, int entity, int modelIndex, float *position, int flags, float scale );
};
#endif//R_EFX_H
#endif//R_EFX_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -26,7 +26,7 @@ typedef struct engine_studio_api_s
// Check to see if pointer is in the cache
void *( *Cache_Check )( struct cache_user_s *c );
// Load file into cache ( can be swapped out on demand )
void ( *LoadCacheFile )( char *path, struct cache_user_s *cu );
void ( *LoadCacheFile )( const char *path, struct cache_user_s *cu );
// Retrieve model pointer for the named model
struct model_s *( *Mod_ForName )( const char *name, int crash_if_missing );
// Retrieve pointer to studio model data block from a model
@@ -103,7 +103,7 @@ typedef struct engine_studio_api_s
// True if using D3D/OpenGL
int ( *IsHardware )( void );
// Only called by hardware interface
void ( *GL_StudioDrawShadow )( void );
void ( *GL_SetRenderMode )( int mode );
@@ -120,7 +120,7 @@ typedef struct server_studio_api_s
// Check to see if pointer is in the cache
void *( *Cache_Check )( struct cache_user_s *c );
// Load file into cache ( can be swapped out on demand )
void ( *LoadCacheFile )( char *path, struct cache_user_s *cu );
void ( *LoadCacheFile )( const char *path, struct cache_user_s *cu );
// Retrieve pointer to studio model data block from a model
void *( *Mod_Extradata )( struct model_s *mod );
} server_studio_api_t;
@@ -140,7 +140,7 @@ typedef struct sv_blending_interface_s
{
int version;
void ( *SV_StudioSetupBones )( struct model_s *pModel,
void ( *SV_StudioSetupBones )( struct model_s *pModel,
float frame,
int sequence,
const vec3_t angles,
@@ -151,4 +151,4 @@ typedef struct sv_blending_interface_s
const edict_t *pEdict );
} sv_blending_interface_t;
#endif//R_STUDIOINT_H
#endif//R_STUDIOINT_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -25,7 +25,7 @@ typedef struct ref_params_s
vec3_t forward;
vec3_t right;
vec3_t up;
// Client frametime;
float frametime;
// Client time
@@ -54,7 +54,7 @@ typedef struct ref_params_s
int viewentity;
int playernum;
int max_entities;
int demoplayback;
int demoplayback;
int hardware;
int smoothing;
@@ -102,4 +102,4 @@ typedef struct ref_viewpass_s
int flags; // if !=0 nothing is drawn by the engine except clientDraw functions
} ref_viewpass_t;
#endif//REF_PARAMS_H
#endif//REF_PARAMS_H

View File

@@ -111,15 +111,18 @@ typedef enum
typedef enum
{
CONTEXT_TYPE_GL = 0,
CONTEXT_TYPE_GL = 0, // compatibility profile
CONTEXT_TYPE_GLES_1_X,
CONTEXT_TYPE_GLES_2_X
CONTEXT_TYPE_GLES_2_X,
CONTEXT_TYPE_GL_CORE
} gl_context_type_t;
typedef enum
{
GLES_WRAPPER_NONE = 0, // native GLES
GLES_WRAPPER_NONE = 0, // native GL
GLES_WRAPPER_NANOGL, // used on GLES platforms
GLES_WRAPPER_WES, // used on GLES platforms
GLES_WRAPPER_GL4ES, // used on GLES platforms
} gles_wrapper_t;
// 30 bytes here
@@ -129,7 +132,7 @@ typedef struct modelstate_s
short frame; // 10 bits multiple by 4, should be enough
byte blending[2];
byte controller[4];
byte poseparam[16];
byte poseparam[16];
byte body;
byte skin;
short scale; // model scale (multiplied by 16)
@@ -152,13 +155,15 @@ typedef struct decallist_s
modelstate_t studio_state; // studio decals only
} decallist_t;
struct ref_viewpass_s;
typedef struct render_api_s
{
// Get renderer info (doesn't changes engine state at all)
int (*RenderGetParm)( int parm, int arg ); // generic
void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale );
void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha );
lightstyle_t* (*GetLightStyle)( int number );
lightstyle_t* (*GetLightStyle)( int number );
dlight_t* (*GetDynamicLight)( int number );
dlight_t* (*GetEntityLight)( int number );
byte (*LightToTexGamma)( byte color ); // software gamma support
@@ -175,9 +180,9 @@ typedef struct render_api_s
const char* (*GL_TextureName)( unsigned int texnum );
const byte* (*GL_TextureData)( unsigned int texnum ); // may be NULL
int (*GL_LoadTexture)( const char *name, const byte *buf, size_t size, int flags );
int (*GL_CreateTexture)( const char *name, int width, int height, const void *buffer, int flags );
int (*GL_CreateTexture)( const char *name, int width, int height, const void *buffer, texFlags_t flags );
int (*GL_LoadTextureArray)( const char **names, int flags );
int (*GL_CreateTextureArray)( const char *name, int width, int height, int depth, const void *buffer, int flags );
int (*GL_CreateTextureArray)( const char *name, int width, int height, int depth, const void *buffer, texFlags_t flags );
void (*GL_FreeTexture)( unsigned int texnum );
// Decals manipulating (draw & remove)
@@ -187,9 +192,9 @@ typedef struct render_api_s
// AVIkit support
void *(*AVI_LoadVideo)( const char *filename, qboolean load_audio );
int (*AVI_GetVideoInfo)( void *Avi, long *xres, long *yres, float *duration );
long (*AVI_GetVideoFrameNumber)( void *Avi, float time );
byte *(*AVI_GetVideoFrame)( void *Avi, long frame );
int (*AVI_GetVideoInfo)( void *Avi, int *xres, int *yres, float *duration ); // a1ba: changed longs to int
int (*AVI_GetVideoFrameNumber)( void *Avi, float time );
byte *(*AVI_GetVideoFrame)( void *Avi, int frame );
void (*AVI_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data );
void (*AVI_FreeVideo)( void *Avi );
int (*AVI_IsActive)( void *Avi );
@@ -219,7 +224,7 @@ typedef struct render_api_s
struct mstudiotex_s *( *StudioGetTexture )( struct cl_entity_s *e );
const struct ref_overview_s *( *GetOverviewParms )( void );
const char *( *GetFileByIndex )( int fileindex );
int (*pfnSaveFile)( const char *filename, const void *data, long len );
int (*pfnSaveFile)( const char *filename, const void *data, int len );
void (*R_Reserved0)( void );
// static allocations
@@ -228,14 +233,15 @@ typedef struct render_api_s
// engine utils (not related with render API but placed here)
char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly );
unsigned long (*pfnFileBufferCRC32)( const void *buffer, const int length );
unsigned int (*pfnFileBufferCRC32)( const void *buffer, const int length );
int (*COM_CompareFileTime)( const char *filename1, const char *filename2, int *iCompare );
void (*Host_Error)( const char *error, ... ); // cause Host Error
void* ( *pfnGetModel )( int modelindex );
float (*pfnTime)( void ); // Sys_DoubleTime
void (*Cvar_Set)( char *name, char *value );
void (*Cvar_Set)( const char *name, const char *value );
void (*S_FadeMusicVolume)( float fadePercent ); // fade background track (0-100 percents)
void (*SetRandomSeed)( long lSeed ); // set custom seed for RANDOM_FLOAT\RANDOM_LONG for predictable random
// a1ba: changed long to int
void (*SetRandomSeed)( int lSeed ); // set custom seed for RANDOM_FLOAT\RANDOM_LONG for predictable random
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 37
} render_api_t;
@@ -254,7 +260,7 @@ typedef struct render_interface_s
// clear decals by engine request (e.g. for demo recording or vid_restart)
void (*R_ClearStudioDecals)( void );
// grab r_speeds message
qboolean (*R_SpeedsMessage)( char *out, size_t size );
qboolean (*R_SpeedsMessage)( char *out, size_t size );
// alloc or destroy model custom data
void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create, const byte *buffer );
// alloc or destroy entity custom data
@@ -269,4 +275,4 @@ typedef struct render_interface_s
void (*CL_UpdateLatchedVars)( struct cl_entity_s *e, qboolean reset );
} render_interface_t;
#endif//RENDER_API_H
#endif//RENDER_API_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -26,4 +26,4 @@ typedef struct screenfade_s
int fadeFlags; // Fading flags
} screenfade_t;
#endif//SCREENFADE_H
#endif//SCREENFADE_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -12,16 +12,26 @@
* without written permission from Valve LLC.
*
****/
#pragma once
#ifndef STUDIO_EVENT_H
#define STUDIO_EVENT_H
#define MAXEVENTSTRING 64
typedef struct mstudioevent_s
{
int frame;
int event;
int type;
char options[64];
// the frame at which this animation event occurs
int32_t frame;
// the script event type
int32_t event;
// was "type"
int32_t unused;
// options
// could be path to sound WAVE files
char options[MAXEVENTSTRING];
} mstudioevent_t;
#endif//STUDIO_EVENT_H
#endif // STUDIO_EVENT_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -16,7 +16,7 @@
#ifndef TRIANGLEAPI_H
#define TRIANGLEAPI_H
typedef enum
typedef enum
{
TRI_FRONT = 0,
TRI_NONE = 1,
@@ -44,14 +44,14 @@ typedef struct triangleapi_s
void (*Color4f)( float r, float g, float b, float a );
void (*Color4ub)( unsigned char r, unsigned char g, unsigned char b, unsigned char a );
void (*TexCoord2f)( float u, float v );
void (*Vertex3fv)( float *worldPnt );
void (*Vertex3fv)( const float *worldPnt );
void (*Vertex3f)( float x, float y, float z );
void (*Brightness)( float brightness );
void (*CullFace)( TRICULLSTYLE style );
void (*CullFace)( TRICULLSTYLE style );
int (*SpriteTexture)( struct model_s *pSpriteModel, int frame );
int (*WorldToScreen)( float *world, float *screen ); // Returns 1 if it's z clipped
int (*WorldToScreen)( const float *world, float *screen ); // Returns 1 if it's z clipped
void (*Fog)( float flFogColor[3], float flStart, float flEnd, int bOn ); //Works just like GL_FOG, flFogColor is r/g/b.
void (*ScreenToWorld)( float *screen, float *world );
void (*ScreenToWorld)( const float *screen, float *world );
void (*GetMatrix)( const int pname, float *matrix );
int (*BoxInPVS)( float *mins, float *maxs );
void (*LightAtPoint)( float *pos, float *value );
@@ -59,4 +59,4 @@ typedef struct triangleapi_s
void (*FogParams)( float flDensity, int iFogSkybox );
} triangleapi_t;
#endif//TRIANGLEAPI_H
#endif//TRIANGLEAPI_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -36,4 +36,4 @@ typedef struct usercmd_s
vec3_t impact_position;
} usercmd_t;
#endif//USERCMD_H
#endif//USERCMD_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -83,4 +83,4 @@ typedef struct mip_s
unsigned int offsets[4]; // four mip maps stored
} mip_t;
#endif//WADFILE_H
#endif//WADFILE_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -47,4 +47,4 @@ typedef struct weapon_data_s
float fuser4;
} weapon_data_t;
#endif//WEAPONINFO_H
#endif//WEAPONINFO_H

View File

@@ -21,4 +21,4 @@ typedef struct wrect_s
int left, right, top, bottom;
} wrect_t;
#endif//WRECT_H
#endif//WRECT_H

151
common/xash3d_types.h Normal file
View File

@@ -0,0 +1,151 @@
// basic typedefs
#ifndef XASH_TYPES_H
#define XASH_TYPES_H
#ifdef _WIN32
#include <wchar.h> // off_t
#endif // _WIN32
#include <sys/types.h> // off_t
#include STDINT_H
typedef unsigned char byte;
typedef int sound_t;
typedef float vec_t;
typedef vec_t vec2_t[2];
typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
typedef vec_t quat_t[4];
typedef byte rgba_t[4]; // unsigned byte colorpack
typedef byte rgb_t[3]; // unsigned byte colorpack
typedef vec_t matrix3x4[3][4];
typedef vec_t matrix4x4[4][4];
typedef uint32_t poolhandle_t;
#undef true
#undef false
#ifndef __cplusplus
typedef enum { false, true } qboolean;
#else
typedef int qboolean;
#endif
typedef uint64_t longtime_t;
#define MAX_STRING 256 // generic string
#define MAX_INFO_STRING 256 // infostrings are transmitted across network
#define MAX_SERVERINFO_STRING 512 // server handles too many settings. expand to 1024?
#define MAX_LOCALINFO_STRING 32768 // localinfo used on server and not sended to the clients
#define MAX_SYSPATH 1024 // system filepath
#define MAX_PRINT_MSG 8192 // how many symbols can handle single call of Con_Printf or Con_DPrintf
#define MAX_TOKEN 2048 // parse token length
#define MAX_MODS 512 // environment games that engine can keep visible
#define MAX_USERMSG_LENGTH 2048 // don't modify it's relies on a client-side definitions
#define BIT( n ) ( 1U << ( n ))
#define GAMMA ( 2.2f ) // Valve Software gamma
#define INVGAMMA ( 1.0f / 2.2f ) // back to 1.0
#define TEXGAMMA ( 0.9f ) // compensate dim textures
#define SetBits( iBitVector, bits ) ((iBitVector) = (iBitVector) | (bits))
#define ClearBits( iBitVector, bits ) ((iBitVector) = (iBitVector) & ~(bits))
#define FBitSet( iBitVector, bit ) ((iBitVector) & (bit))
#ifndef __cplusplus
#ifdef NULL
#undef NULL
#endif
#define NULL ((void *)0)
#endif
// color strings
#define IsColorString( p ) ( p && *( p ) == '^' && *(( p ) + 1) && *(( p ) + 1) >= '0' && *(( p ) + 1 ) <= '9' )
#define ColorIndex( c ) ((( c ) - '0' ) & 7 )
#if defined(__GNUC__)
#ifdef __i386__
#define EXPORT __attribute__ ((visibility ("default"),force_align_arg_pointer))
#define GAME_EXPORT __attribute((force_align_arg_pointer))
#else
#define EXPORT __attribute__ ((visibility ("default")))
#define GAME_EXPORT
#endif
#elif defined(_MSC_VER)
#define EXPORT __declspec( dllexport )
#define GAME_EXPORT
#else
#define EXPORT
#define GAME_EXPORT
#endif
#ifdef XASH_BIG_ENDIAN
#define LittleLong(x) (((int)(((x)&255)<<24)) + ((int)((((x)>>8)&255)<<16)) + ((int)(((x)>>16)&255)<<8) + (((x) >> 24)&255))
#define LittleLongSW(x) (x = LittleLong(x) )
#define LittleShort(x) ((short)( (((short)(x) >> 8) & 255) + (((short)(x) & 255) << 8)))
#define LittleShortSW(x) (x = LittleShort(x) )
_inline float LittleFloat( float f )
{
union
{
float f;
unsigned char b[4];
} dat1, dat2;
dat1.f = f;
dat2.b[0] = dat1.b[3];
dat2.b[1] = dat1.b[2];
dat2.b[2] = dat1.b[1];
dat2.b[3] = dat1.b[0];
return dat2.f;
}
#else
#define LittleLong(x) (x)
#define LittleLongSW(x)
#define LittleShort(x) (x)
#define LittleShortSW(x)
#define LittleFloat(x) (x)
#endif
typedef unsigned int dword;
typedef unsigned int uint;
typedef char string[MAX_STRING];
typedef struct file_s file_t; // normal file
typedef struct wfile_s wfile_t; // wad file
typedef struct stream_s stream_t; // sound stream for background music playing
typedef off_t fs_offset_t;
typedef struct dllfunc_s
{
const char *name;
void **func;
} dllfunc_t;
typedef struct dll_info_s
{
const char *name; // name of library
const dllfunc_t *fcts; // list of dll exports
qboolean crash; // crash if dll not found
void *link; // hinstance of loading library
} dll_info_t;
typedef void (*setpair_t)( const char *key, const void *value, void *buffer, void *numpairs );
// config strings are a general means of communication from
// the server to all connected clients.
// each config string can be at most CS_SIZE characters.
#if XASH_LOW_MEMORY == 0
#define MAX_QPATH 64 // max length of a game pathname
#elif XASH_LOW_MEMORY == 2
#define MAX_QPATH 32 // should be enough for singleplayer
#elif XASH_LOW_MEMORY == 1
#define MAX_QPATH 48
#endif
#define MAX_OSPATH 260 // max length of a filesystem pathname
#define CS_SIZE 64 // size of one config string
#define CS_TIME 16 // size of time string
#endif // XASH_TYPES_H

View File

@@ -0,0 +1,206 @@
#############################################
# Makefile.linux - linux makefile
# Copyright (C) 2017 mittorn
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
##############################################
# Default options - optimized to debug on local machine
CC ?= gcc
CXX ?= g++
CFLAGS ?= -g -O1 -fsigned-char -Wall -Wextra -Wsign-compare -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-but-set-variable
LDFLAGS =
LBITS := $(shell getconf LONG_BIT)
DEPS :=
XASH_COMMIT := $(firstword $(shell git rev-parse --short=6 HEAD) unknown)
ifeq ($(XASH_COMMIT),unknown)
$(warning You seems to build xash3d without git)
$(warning Please use git if you are going to publish your build)
endif
# Pass 64BIT=1 to make arguments to allow amd64 builds
ifneq ($(64BIT),1)
ifeq ($(LBITS),64)
LDFLAGS += -m32
CFLAGS += -m32
endif
endif
TOPDIR = $(PWD)/..
INCLUDES :=
XASH_SINGLE_BINARY ?= 1
INSTALL_DIR ?= ./install/
ifeq ($(NANOGL),1)
INCLUDES += -Inanogl -Inanogl/GL
endif
INCLUDES += -I/usr/include/SDL2 -Icommon -I../common -I. -I../pm_shared -Iclient -Iserver -Iclient/vgui -Icommon/sdl
#############################
# Preprocessor defines:
#############################
DEFINES =
# Specify commit hash in version string
DEFINES += -DXASH_BUILD_COMMIT=\"$(XASH_COMMIT)\"
# Only SDL backend exists on linux
ifeq ($(XASH_DEDICATED),1)
DEFINES += -DXASH_DEDICATED
else
DEFINES += -DXASH_SDL
LIBS += -lSDL2
endif
#############################################
# GL/GLES translators.
# You need clone it to engine folder to use
# Only one translator should be enabled
#############################################
ifeq ($(NANOGL),1)
DEFINES += -DXASH_NANOGL -D__MULTITEXTURE_SUPPORT__ -DEGL_LIB=\"libEGL.so\"
endif
ifeq ($(WES),1)
DEFINES += -DXASH_WES -D__MULTITEXTURE_SUPPORT__ -DEGL_LIB=\"libEGL.so\"
endif
ifeq ($(REGAL),1)
DEFINES += -DXASH_REGAL -D__MULTITEXTURE_SUPPORT__ -DEGL_LIB=\"regal/lib/linux-32/libRegal.so\"
LIBS += regal/lib/linux-32/libRegal.so
endif
# Some libc implementations cannot use libdl in static builds, so disable it by default
ifeq ($(XASH_STATIC),1)
ifneq ($(XASH_STATIC_LIBDL),1)
DEFINES += -DNO_LIBDL
endif
XASH_SINGLE_BINARY := 1
endif
ifneq ($(XASH_STATIC),1)
LIBS += -ldl
endif
ifeq ($(XASH_STATIC_LIBDL),1)
LIBS += -ldl
endif
LIBS += -lm -pthread
ifeq ($(XASH_SINGLE_BINARY),1)
DEFINES += -DSINGLE_BINARY
endif
# Collect files
SRCS_CPP =
SRCS = $(wildcard server/*.c) $(wildcard client/vgui/*.c) $(wildcard client/avi/*.c) $(wildcard common/*.c) $(wildcard common/imagelib/*.c) $(wildcard common/soundlib/*.c) $(wildcard common/soundlib/libmpg/*.c)
ifneq ($(XASH_DEDICATED),1)
SRCS += $(wildcard client/*.c)
SRCS += $(wildcard platform/sdl/*.c)
ifeq ($(WES),1)
SRCS += $(wildcard gl-wes-v2/src/*.c)
endif
ifeq ($(NANOGL),1)
SRCS_CPP += $(wildcard nanogl/*.cpp)
endif
endif
OBJS = $(patsubst %.c,obj/%.o,$(SRCS))
OBJS_CPP = $(patsubst %.cpp,obj/%.o,$(SRCS_CPP))
#################################
# Windows DLL loader
# Should be enabled only on i386 builds
#################################
LOADER :=
ifeq ($(XASH_DLL_LOADER),1)
DEFINES += -DDLL_LOADER
ifeq ($(XASH_SINGLE_BINARY),1)
LOADER = libloader.a
else
LOADER = libloader.so
endif
DEPS += $(LOADER)
LIBS += $(LOADER)
endif
# Rules for binaries
ifeq ($(XASH_SINGLE_BINARY),0)
BINARIES = libxash.so
libxash.so : $(OBJS) $(OBJS_CPP) $(DEPS)
$(CC) -fvisibility=hidden -o libxash.so $(LDFLAGS) -shared $(OBJS) $(OBJS_CPP) $(LIBS)
else
BINARIES = xash
xash: $(OBJS) $(OBJS_CPP) $(DEPS)
ifeq ($(XASH_STATIC),1)
$(CC) -o xash -static $(LDFLAGS) $(OBJS) $(OBJS_CPP) $(LIBS)
else
$(CC) -o xash -fvisibility=hidden $(LDFLAGS) $(OBJS) $(OBJS_CPP) $(LIBS)
endif
endif
ifeq ($(XASH_DLL_LOADER),1)
$(LOADER):
$(MAKE) -f ../loader/Makefile.linux -C ../loader $(LOADER)
cp ../loader/$(LOADER) .
endif
# Create dirs for object files
DIRS := obj obj/server obj/client/avi obj/client/vgui obj/common/sdl obj/common/imagelib obj/common/soundlib/libmpg obj/platform/sdl obj/nanogl
$(OBJS): | $(DIRS)
$(DIRS) :
mkdir -p $(DIRS)
# Object rules
obj/%.o : %.c
$(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -c "$<" -o "$@" -Wno-unused-result -fvisibility=hidden
obj/%.o : %.cpp
$(CXX) $(CFLAGS) $(INCLUDES) $(DEFINES) -c "$<" -o "$@"
default: $(BINARIES)
.PHONY: depend clean list install
clean:
$(RM) $(OBJS) $(OBJS_CPP) $(BINARIES) ../loader/*.o ../loader/*.a ../loader/*.so $(LOADER)
list:
@echo Sources:
@echo $(SRCS)
@echo C++ Sources:
@echo $(SRCS_CPP)
@echo Objects:
@echo $(OBJS) $(OBJS_CPP)
@echo Dirs:
@echo $(DIRS)
@echo Dependencies:
@echo $(DEPS)
# Simple install rule
install: $(BINARIES)
mkdir -p $(INSTALL_DIR)
ifeq ($(XASH_SINGLE_BINARY),1)
cp xash $(INSTALL_DIR)/xash_bin
else
cp libxash.so $(INSTALL_DIR)/
cp libloader.so $(INSTALL_DIR)/
endif

269
contrib/mittorn/README.md Normal file
View File

@@ -0,0 +1,269 @@
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
- [Building](#building)
- [Manual build (without CMake)](#manual-build-without-cmake)
- [Building Engine](#building-engine)
- [Building launch binary](#building-launch-binary)
- [Building on Windows](#building-on-windows)
- [Visual Studio 2013 (recommended for Windows)](#visual-studio-2013-recommended-for-windows)
- [Visual Studio 6](#visual-studio-6)
- [MinGW](#mingw)
- [Building Game mods](#building-game-mods)
- [Linux](#linux)
- [microndk](#microndk)
- [Makefile.linux](#makefile-linux)
- [Windows](#windows)
- [Running](#running)
- [Manual running](#manual-running)
- [Running with GDB](#running-with-gdb)
- [Using DLL Loader](#using-dll-loader)
- [Running MinGW builds](#running-mingw-builds)
- [Running MinGW builds under GDB](#running-mingw-builds-under-gdb)
# Building
## Manual build (without CMake)
### Building engine
Clone Xash3D repository using git:
git clone https://github.com/FWGS/xash3d
Move to the Xash3D folder:
cd xash3d/engine
make -f Makefile.linux XASH_VGUI=1
or same for dedicated
make -f Makefile.linux XASH_DEDICATED=1
To enable dll support on linux, build loader library:
cd ../loader
make -f Makefile.linux libloader.so libloader.a
cp libloader.so libloader.a ../engine/
And built engine with XASH_DLL_LOADER=1:
cd ../engine
make -f Makefile.linux XASH_VGUI=1 XASH_SDL=1 XASH_DLL_LOADER=1
or same for dedicated server
cd ../engine
make -f Makefile.linux XASH_DEDICATED=1 XASH_DLL_LOADER=1
### Building engine in separate library
Some old distros does not support hidden symbol visibility
This results in crash when loading server library
Building launch binary
cd (xash3d)/game_launch
gcc xash.c -o xash -ldl -lrt -lm
Building engine library:
make -f Makefile.linux XASH_SINGLE_BINARY=0
## Building on Windows
### Visual Studio 2013 (recommended for Windows)
Download latest prebuilt SDL2 from
https://www.libsdl.org/release/SDL2-devel-2.0.4-VC.zip
Unzip and rename `SDL2-2.0.4` folder to `SDL2` and put it next to xash3d project folder.
..\xash3d\
..\SDL2\
Open `xash.sln` with Visual Studio 2013 and make a build. After building, copy contents of `Debug` or
`Release` folder to directory you choose. Copy `valve` folder and `vgui.dll` from your Half Life game
installation folder and `SDL2.dll` form `\SDL2\lib\x86\` to it.
Move `vgui_support.dll` into `valve` folder.
..\valve\
..\valve\vgui_support.dll
..\menu.dll
..\SDL2.dll
..\vgui.dll
..\xash.dll
..\xash.exe
Now you good to go, just run `xash.exe`.
### Visual Studio 6
This is legacy configuration, but msvc6 seems to generate more stable and more effective code
Setup your msvc6 enviroment, unpack SDL2-2.0.4 to xash3d folder and do:
cd (xash3d)\engine
..\msvc6\build.bat
cd (xash3d)\game_launch
..\msvc6\build_launch.bat
### MinGW
The most effective configuration, but maybe unstable.
Setup your MinGW environment and run:
cd (xash3d)\engine\
CC=gcc mingw32-make -f Makefile.mingw
engine will be built to single exe binary
## Building game mods
### Linux
#### microndk
All mods that ported to android may be build to linux using Android.mk with microndk:
[https://github.com/SDLash3D/microndk]
Clone microndk repo somewhere, change xash3d_config to preffered configuration (change arch to x86
for example)
Go to dlls folder if you are building server or cl_dlls if you are building client and do:
make -f /path/to/microndk/microndk.mk -j4
Do:
make -f /path/to/microndk/microndk.mk -j4 clean
every time when you build client after building server
#### Makefile.linux
### Windows
On windows common way is using Visual Studio as many mods does not correctly work with mingw.
Just open project and build it.
Other is using mingw and microndk, but it was not tested yet.
hlsdk-xash3d based mods may work fine with mingw.
You may use microndk to build it. Build process is very similar to linux one.
After setting up MinGW enviroment, do:<br>
`mingw32-make -f \path\to\microndk\Microndk.mk`
to build 64-bit library, use:<br>
`mingw32-make -f \path\to\microndk\Microndk.mk 64BIT=1`
Edit xash3d_config.mk to set optimal CFLAGS if you are running server
# Running
Copy **valve** folder from Half-Life:
cp -r $HOME/.steam/steam/steamapps/common/Half-Life/valve $HOME/Games/Xash3D
**NOTE**: If you build with CMake, you can now use `make install`. It will install binaries where
they must be located. So just run `xash3d` from command line in directory where is gamedata is located.
For additional info look to the CMakeLists.txt in repo root and xash3d.sh script.
After a successful build, copy the next files to some other directory where you want to run Xash3D:
cp engine/libxash.so game_launch/xash3d mainui/libxashmenu.so $HOME/Games/Xash3D
If you built it with XASH_VGUI, also copy vgui.so:
cp ../hlsdk/linux/vgui.so vgui_support/libvgui_support.so $HOME/Games/Xash3D
Copy script:
cp ../xash3d.sh $HOME/Games/Xash3D
Run:
cd $HOME/Games/Xash3D
./xash3d.sh
## Manual running
Put xash3d binaries and vgui(optionally) to you game data directory and run:
LD_LIBRARY_PATH=. ./xash -dev 5
## Running under GDB
LD_LIBRARY_PATH=. gdb --args ./xash -dev 5
## Using DLL Loader
Put vgui_support.dll from windows build to your game data folder and run:
LD_LIBRARY_PATH=. ./xash -dev 5 -vguilib vgui.dll -clientlib valve/cl_dlls/client.dll -dll dlls/hl.dll
## Running MinGW builds
Put exe file to your game data directory
cd (game)\
xash_bin -dev 5
### Running MinGW builds under GDB
gdb --args ./xash_bin.exe -dev 5
# Useful GDB commands
Start or restart process:
(gdb) r
Show backtrace:
(gdb) bt
Full backtrace:
(gdb) bt full
Continue execution:
(gdb) c
Recover from segmentation fault:
Skipping function:
(gdb) handle SIGSEGV nopass
(gdb) ret
(gdb) c
Restart frame for beginning:
(gdb) handle SIGSEGV nopass
(gdb) jump *Host_AbortCurrentFrame
Anti-Crash script (useful for scripting servers):
```
cd /path/to/rootdir
file xash
set args xash -dev 5 -nowcon
handle SIGSEGV nopass
catch signal SIGSEGV
set $crashes=0
commands
print $crashes++
if $crashes > 500
set $crashes=0
run
else
jump *Host_AbortCurrentFrame
end
end
run
```

7
contrib/mittorn/setup.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
SCRIPTDIR=$(dirname "$0")
TOPDIR=$SCRIPTDIR/../../
cp $SCRIPTDIR/Makefile.dllloader $TOPDIR/loader/
cp $SCRIPTDIR/Makefile.emscripten $TOPDIR/engine/
cp $SCRIPTDIR/Makefile.linux $TOPDIR/engine/
cp $SCRIPTDIR/wscript $TOPDIR/engine/

73
contrib/mittorn/wscript Normal file
View File

@@ -0,0 +1,73 @@
#! /usr/bin/env python
# encoding: utf-8
# mittorn, 2018
VERSION='0.99'
APPNAME='xash3d-fwgs'
top = '.'
def options(opt):
opt.load('compiler_c')
# opt.load('msvs')
opt.add_option('--dedicated', action = 'store_true', help = 'build dedicated server only' )
opt.add_option('--64bits', dest = 'amd64', action = 'store_true', help = 'build 64-bit engine on x86_64' )
def configure(conf):
conf.load('compiler_c')
conf.env.append_unique('CFLAGS', '-O2')
conf.env.append_unique('DEFINES', 'SINGLE_BINARY')
conf.env.append_value('LINKFLAGS', '-ldl')
conf.env.append_value('LINKFLAGS', '-lm')
conf.env.append_value('LINKFLAGS', '-pthread')
# check for 64-bit builds
# TODO: check 32-bit toolchain and dependencies
if conf.env.DEST_CPU == 'x86_64' and not conf.options.amd64:
conf.env.append_value('LINKFLAGS', '-m32')
conf.env.append_value('CFLAGS', '-m32')
print('NOTE: will build engine with 64-bit toolchain using -m32')
else:
print('Warning: 64bit engine may be unstable')
# check for dedicated server build
if conf.options.dedicated:
conf.env.append_unique('DEFINES', 'XASH_DEDICATED')
conf.env.dedicated = True
else:
# TODO: add way to specify SDL2 path, move to separate function
try:
conf.check_cfg(path='sdl2-config', args='--cflags --libs', package='', msg='Checking for SDL2', uselib_store='SDL2')
except conf.errors.ConfigurationError:
conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated')
conf.env.append_unique('DEFINES', 'XASH_SDL')
def build(bld):
# basic build: dedicated only, no dependencies
use = [];
source = bld.path.ant_glob([
'common/*.c',
'common/imagelib/*.c',
'common/soundlib/*.c',
'common/soundlib/libmpg/*.c',
'server/*.c'])
# add client files and sdl2 library
if not bld.env.dedicated:
use += ['SDL2']
source += bld.path.ant_glob([
'client/*.c',
'client/vgui/*.c',
'client/avi/*.c',
'platform/sdl/*.c'])
bld(
target = 'xash',
features = 'c cprogram',
includes = ['../common', '../pm_shared', 'common', 'server', 'client', 'client/vgui', '.' ],
source = source,
use = use
)

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -135,4 +135,4 @@ typedef struct
aliasskintype_t type;
} daliasskintype_t;
#endif//ALIAS_H
#endif//ALIAS_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -13,165 +13,165 @@
*
****/
{-0.525731, 0.000000, 0.850651},
{-0.442863, 0.238856, 0.864188},
{-0.295242, 0.000000, 0.955423},
{-0.309017, 0.500000, 0.809017},
{-0.162460, 0.262866, 0.951056},
{0.000000, 0.000000, 1.000000},
{0.000000, 0.850651, 0.525731},
{-0.147621, 0.716567, 0.681718},
{0.147621, 0.716567, 0.681718},
{0.000000, 0.525731, 0.850651},
{0.309017, 0.500000, 0.809017},
{0.525731, 0.000000, 0.850651},
{0.295242, 0.000000, 0.955423},
{0.442863, 0.238856, 0.864188},
{0.162460, 0.262866, 0.951056},
{-0.681718, 0.147621, 0.716567},
{-0.809017, 0.309017, 0.500000},
{-0.587785, 0.425325, 0.688191},
{-0.850651, 0.525731, 0.000000},
{-0.864188, 0.442863, 0.238856},
{-0.716567, 0.681718, 0.147621},
{-0.688191, 0.587785, 0.425325},
{-0.500000, 0.809017, 0.309017},
{-0.238856, 0.864188, 0.442863},
{-0.425325, 0.688191, 0.587785},
{-0.716567, 0.681718, -0.147621},
{-0.500000, 0.809017, -0.309017},
{-0.525731, 0.850651, 0.000000},
{0.000000, 0.850651, -0.525731},
{-0.238856, 0.864188, -0.442863},
{0.000000, 0.955423, -0.295242},
{-0.262866, 0.951056, -0.162460},
{0.000000, 1.000000, 0.000000},
{0.000000, 0.955423, 0.295242},
{-0.262866, 0.951056, 0.162460},
{0.238856, 0.864188, 0.442863},
{0.262866, 0.951056, 0.162460},
{0.500000, 0.809017, 0.309017},
{0.238856, 0.864188, -0.442863},
{0.262866, 0.951056, -0.162460},
{0.500000, 0.809017, -0.309017},
{0.850651, 0.525731, 0.000000},
{0.716567, 0.681718, 0.147621},
{0.716567, 0.681718, -0.147621},
{0.525731, 0.850651, 0.000000},
{0.425325, 0.688191, 0.587785},
{0.864188, 0.442863, 0.238856},
{0.688191, 0.587785, 0.425325},
{0.809017, 0.309017, 0.500000},
{0.681718, 0.147621, 0.716567},
{0.587785, 0.425325, 0.688191},
{0.955423, 0.295242, 0.000000},
{1.000000, 0.000000, 0.000000},
{0.951056, 0.162460, 0.262866},
{0.850651, -0.525731, 0.000000},
{0.955423, -0.295242, 0.000000},
{0.864188, -0.442863, 0.238856},
{0.951056, -0.162460, 0.262866},
{0.809017, -0.309017, 0.500000},
{0.681718, -0.147621, 0.716567},
{0.850651, 0.000000, 0.525731},
{0.864188, 0.442863, -0.238856},
{0.809017, 0.309017, -0.500000},
{0.951056, 0.162460, -0.262866},
{0.525731, 0.000000, -0.850651},
{0.681718, 0.147621, -0.716567},
{0.681718, -0.147621, -0.716567},
{0.850651, 0.000000, -0.525731},
{0.809017, -0.309017, -0.500000},
{0.864188, -0.442863, -0.238856},
{0.951056, -0.162460, -0.262866},
{0.147621, 0.716567, -0.681718},
{0.309017, 0.500000, -0.809017},
{0.425325, 0.688191, -0.587785},
{0.442863, 0.238856, -0.864188},
{0.587785, 0.425325, -0.688191},
{0.688191, 0.587785, -0.425325},
{-0.147621, 0.716567, -0.681718},
{-0.309017, 0.500000, -0.809017},
{0.000000, 0.525731, -0.850651},
{-0.525731, 0.000000, -0.850651},
{-0.442863, 0.238856, -0.864188},
{-0.295242, 0.000000, -0.955423},
{-0.162460, 0.262866, -0.951056},
{0.000000, 0.000000, -1.000000},
{0.295242, 0.000000, -0.955423},
{0.162460, 0.262866, -0.951056},
{-0.442863, -0.238856, -0.864188},
{-0.309017, -0.500000, -0.809017},
{-0.162460, -0.262866, -0.951056},
{0.000000, -0.850651, -0.525731},
{-0.147621, -0.716567, -0.681718},
{0.147621, -0.716567, -0.681718},
{0.000000, -0.525731, -0.850651},
{0.309017, -0.500000, -0.809017},
{0.442863, -0.238856, -0.864188},
{0.162460, -0.262866, -0.951056},
{0.238856, -0.864188, -0.442863},
{0.500000, -0.809017, -0.309017},
{0.425325, -0.688191, -0.587785},
{0.716567, -0.681718, -0.147621},
{0.688191, -0.587785, -0.425325},
{0.587785, -0.425325, -0.688191},
{0.000000, -0.955423, -0.295242},
{0.000000, -1.000000, 0.000000},
{0.262866, -0.951056, -0.162460},
{0.000000, -0.850651, 0.525731},
{0.000000, -0.955423, 0.295242},
{0.238856, -0.864188, 0.442863},
{0.262866, -0.951056, 0.162460},
{0.500000, -0.809017, 0.309017},
{0.716567, -0.681718, 0.147621},
{0.525731, -0.850651, 0.000000},
{-0.238856, -0.864188, -0.442863},
{-0.500000, -0.809017, -0.309017},
{-0.262866, -0.951056, -0.162460},
{-0.850651, -0.525731, 0.000000},
{-0.716567, -0.681718, -0.147621},
{-0.716567, -0.681718, 0.147621},
{-0.525731, -0.850651, 0.000000},
{-0.500000, -0.809017, 0.309017},
{-0.238856, -0.864188, 0.442863},
{-0.262866, -0.951056, 0.162460},
{-0.864188, -0.442863, 0.238856},
{-0.809017, -0.309017, 0.500000},
{-0.688191, -0.587785, 0.425325},
{-0.681718, -0.147621, 0.716567},
{-0.442863, -0.238856, 0.864188},
{-0.587785, -0.425325, 0.688191},
{-0.309017, -0.500000, 0.809017},
{-0.147621, -0.716567, 0.681718},
{-0.425325, -0.688191, 0.587785},
{-0.162460, -0.262866, 0.951056},
{0.442863, -0.238856, 0.864188},
{0.162460, -0.262866, 0.951056},
{0.309017, -0.500000, 0.809017},
{0.147621, -0.716567, 0.681718},
{0.000000, -0.525731, 0.850651},
{0.425325, -0.688191, 0.587785},
{0.587785, -0.425325, 0.688191},
{0.688191, -0.587785, 0.425325},
{-0.955423, 0.295242, 0.000000},
{-0.951056, 0.162460, 0.262866},
{-1.000000, 0.000000, 0.000000},
{-0.850651, 0.000000, 0.525731},
{-0.955423, -0.295242, 0.000000},
{-0.951056, -0.162460, 0.262866},
{-0.864188, 0.442863, -0.238856},
{-0.951056, 0.162460, -0.262866},
{-0.809017, 0.309017, -0.500000},
{-0.864188, -0.442863, -0.238856},
{-0.951056, -0.162460, -0.262866},
{-0.809017, -0.309017, -0.500000},
{-0.681718, 0.147621, -0.716567},
{-0.681718, -0.147621, -0.716567},
{-0.850651, 0.000000, -0.525731},
{-0.688191, 0.587785, -0.425325},
{-0.587785, 0.425325, -0.688191},
{-0.425325, 0.688191, -0.587785},
{-0.425325, -0.688191, -0.587785},
{-0.587785, -0.425325, -0.688191},
{-0.688191, -0.587785, -0.425325},
{-0.525731, 0.000000, 0.850651},
{-0.442863, 0.238856, 0.864188},
{-0.295242, 0.000000, 0.955423},
{-0.309017, 0.500000, 0.809017},
{-0.162460, 0.262866, 0.951056},
{0.000000, 0.000000, 1.000000},
{0.000000, 0.850651, 0.525731},
{-0.147621, 0.716567, 0.681718},
{0.147621, 0.716567, 0.681718},
{0.000000, 0.525731, 0.850651},
{0.309017, 0.500000, 0.809017},
{0.525731, 0.000000, 0.850651},
{0.295242, 0.000000, 0.955423},
{0.442863, 0.238856, 0.864188},
{0.162460, 0.262866, 0.951056},
{-0.681718, 0.147621, 0.716567},
{-0.809017, 0.309017, 0.500000},
{-0.587785, 0.425325, 0.688191},
{-0.850651, 0.525731, 0.000000},
{-0.864188, 0.442863, 0.238856},
{-0.716567, 0.681718, 0.147621},
{-0.688191, 0.587785, 0.425325},
{-0.500000, 0.809017, 0.309017},
{-0.238856, 0.864188, 0.442863},
{-0.425325, 0.688191, 0.587785},
{-0.716567, 0.681718, -0.147621},
{-0.500000, 0.809017, -0.309017},
{-0.525731, 0.850651, 0.000000},
{0.000000, 0.850651, -0.525731},
{-0.238856, 0.864188, -0.442863},
{0.000000, 0.955423, -0.295242},
{-0.262866, 0.951056, -0.162460},
{0.000000, 1.000000, 0.000000},
{0.000000, 0.955423, 0.295242},
{-0.262866, 0.951056, 0.162460},
{0.238856, 0.864188, 0.442863},
{0.262866, 0.951056, 0.162460},
{0.500000, 0.809017, 0.309017},
{0.238856, 0.864188, -0.442863},
{0.262866, 0.951056, -0.162460},
{0.500000, 0.809017, -0.309017},
{0.850651, 0.525731, 0.000000},
{0.716567, 0.681718, 0.147621},
{0.716567, 0.681718, -0.147621},
{0.525731, 0.850651, 0.000000},
{0.425325, 0.688191, 0.587785},
{0.864188, 0.442863, 0.238856},
{0.688191, 0.587785, 0.425325},
{0.809017, 0.309017, 0.500000},
{0.681718, 0.147621, 0.716567},
{0.587785, 0.425325, 0.688191},
{0.955423, 0.295242, 0.000000},
{1.000000, 0.000000, 0.000000},
{0.951056, 0.162460, 0.262866},
{0.850651, -0.525731, 0.000000},
{0.955423, -0.295242, 0.000000},
{0.864188, -0.442863, 0.238856},
{0.951056, -0.162460, 0.262866},
{0.809017, -0.309017, 0.500000},
{0.681718, -0.147621, 0.716567},
{0.850651, 0.000000, 0.525731},
{0.864188, 0.442863, -0.238856},
{0.809017, 0.309017, -0.500000},
{0.951056, 0.162460, -0.262866},
{0.525731, 0.000000, -0.850651},
{0.681718, 0.147621, -0.716567},
{0.681718, -0.147621, -0.716567},
{0.850651, 0.000000, -0.525731},
{0.809017, -0.309017, -0.500000},
{0.864188, -0.442863, -0.238856},
{0.951056, -0.162460, -0.262866},
{0.147621, 0.716567, -0.681718},
{0.309017, 0.500000, -0.809017},
{0.425325, 0.688191, -0.587785},
{0.442863, 0.238856, -0.864188},
{0.587785, 0.425325, -0.688191},
{0.688191, 0.587785, -0.425325},
{-0.147621, 0.716567, -0.681718},
{-0.309017, 0.500000, -0.809017},
{0.000000, 0.525731, -0.850651},
{-0.525731, 0.000000, -0.850651},
{-0.442863, 0.238856, -0.864188},
{-0.295242, 0.000000, -0.955423},
{-0.162460, 0.262866, -0.951056},
{0.000000, 0.000000, -1.000000},
{0.295242, 0.000000, -0.955423},
{0.162460, 0.262866, -0.951056},
{-0.442863, -0.238856, -0.864188},
{-0.309017, -0.500000, -0.809017},
{-0.162460, -0.262866, -0.951056},
{0.000000, -0.850651, -0.525731},
{-0.147621, -0.716567, -0.681718},
{0.147621, -0.716567, -0.681718},
{0.000000, -0.525731, -0.850651},
{0.309017, -0.500000, -0.809017},
{0.442863, -0.238856, -0.864188},
{0.162460, -0.262866, -0.951056},
{0.238856, -0.864188, -0.442863},
{0.500000, -0.809017, -0.309017},
{0.425325, -0.688191, -0.587785},
{0.716567, -0.681718, -0.147621},
{0.688191, -0.587785, -0.425325},
{0.587785, -0.425325, -0.688191},
{0.000000, -0.955423, -0.295242},
{0.000000, -1.000000, 0.000000},
{0.262866, -0.951056, -0.162460},
{0.000000, -0.850651, 0.525731},
{0.000000, -0.955423, 0.295242},
{0.238856, -0.864188, 0.442863},
{0.262866, -0.951056, 0.162460},
{0.500000, -0.809017, 0.309017},
{0.716567, -0.681718, 0.147621},
{0.525731, -0.850651, 0.000000},
{-0.238856, -0.864188, -0.442863},
{-0.500000, -0.809017, -0.309017},
{-0.262866, -0.951056, -0.162460},
{-0.850651, -0.525731, 0.000000},
{-0.716567, -0.681718, -0.147621},
{-0.716567, -0.681718, 0.147621},
{-0.525731, -0.850651, 0.000000},
{-0.500000, -0.809017, 0.309017},
{-0.238856, -0.864188, 0.442863},
{-0.262866, -0.951056, 0.162460},
{-0.864188, -0.442863, 0.238856},
{-0.809017, -0.309017, 0.500000},
{-0.688191, -0.587785, 0.425325},
{-0.681718, -0.147621, 0.716567},
{-0.442863, -0.238856, 0.864188},
{-0.587785, -0.425325, 0.688191},
{-0.309017, -0.500000, 0.809017},
{-0.147621, -0.716567, 0.681718},
{-0.425325, -0.688191, 0.587785},
{-0.162460, -0.262866, 0.951056},
{0.442863, -0.238856, 0.864188},
{0.162460, -0.262866, 0.951056},
{0.309017, -0.500000, 0.809017},
{0.147621, -0.716567, 0.681718},
{0.000000, -0.525731, 0.850651},
{0.425325, -0.688191, 0.587785},
{0.587785, -0.425325, 0.688191},
{0.688191, -0.587785, 0.425325},
{-0.955423, 0.295242, 0.000000},
{-0.951056, 0.162460, 0.262866},
{-1.000000, 0.000000, 0.000000},
{-0.850651, 0.000000, 0.525731},
{-0.955423, -0.295242, 0.000000},
{-0.951056, -0.162460, 0.262866},
{-0.864188, 0.442863, -0.238856},
{-0.951056, 0.162460, -0.262866},
{-0.809017, 0.309017, -0.500000},
{-0.864188, -0.442863, -0.238856},
{-0.951056, -0.162460, -0.262866},
{-0.809017, -0.309017, -0.500000},
{-0.681718, 0.147621, -0.716567},
{-0.681718, -0.147621, -0.716567},
{-0.850651, 0.000000, -0.525731},
{-0.688191, 0.587785, -0.425325},
{-0.587785, 0.425325, -0.688191},
{-0.425325, 0.688191, -0.587785},
{-0.425325, -0.688191, -0.587785},
{-0.587785, -0.425325, -0.688191},
{-0.688191, -0.587785, -0.425325},

View File

@@ -15,6 +15,14 @@ GNU General Public License for more details.
#ifndef CDLL_EXP_H
#define CDLL_EXP_H
struct tempent_s;
struct usercmd_s;
struct physent_s;
struct playermove_s;
struct mstudioevent_s;
struct engine_studio_api_s;
struct r_studio_interface_s;
// NOTE: ordering is important!
typedef struct cldll_func_s
{
@@ -62,6 +70,10 @@ typedef struct cldll_func_s
// Xash3D extension
int (*pfnGetRenderInterface)( int version, render_api_t *renderfuncs, render_interface_t *callback );
void (*pfnClipMoveToEntity)( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
// Xash3D FWGS extension
int (*pfnTouchEvent)( int type, int fingerID, float x, float y, float dx, float dy );
void (*pfnMoveEvent)( float forwardmove, float sidemove );
void (*pfnLookEvent)( float relyaw, float relpitch );
} cldll_func_t;
#endif//CDLL_EXP_H
#endif//CDLL_EXP_H

View File

@@ -1,9 +1,9 @@
/***
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
@@ -15,7 +15,7 @@
//
// cdll_int.h
//
// 4-23-98
// 4-23-98
// JOHN: client dll interface declarations
//
@@ -27,6 +27,16 @@ extern "C" {
#endif
#include "const.h"
#include <stdint.h>
#define MAX_ALIAS_NAME 32
typedef struct cmdalias_s
{
struct cmdalias_s *next;
char name[MAX_ALIAS_NAME];
char *value;
} cmdalias_t;
// this file is included by both the engine and the client-dll,
// so make sure engine declarations aren't done twice
@@ -96,8 +106,14 @@ typedef struct hud_player_info_s
char *model;
short topcolor;
short bottomcolor;
uint64_t m_nSteamID;
} hud_player_info_t;
struct screenfade_s;
struct tagPOINT;
struct event_args_s;
typedef struct cl_enginefuncs_s
{
// sprite handlers
@@ -119,20 +135,20 @@ typedef struct cl_enginefuncs_s
void (*pfnSetCrosshair)( HSPRITE hspr, wrect_t rc, int r, int g, int b );
// cvar handlers
struct cvar_s *(*pfnRegisterVariable)( char *szName, char *szValue, int flags );
float (*pfnGetCvarFloat)( char *szName );
char* (*pfnGetCvarString)( char *szName );
struct cvar_s *(*pfnRegisterVariable)( const char *szName, const char *szValue, int flags );
float (*pfnGetCvarFloat)( const char *szName );
const char* (*pfnGetCvarString)( const char *szName );
// command handlers
int (*pfnAddCommand)( char *cmd_name, void (*function)(void) );
int (*pfnHookUserMsg)( char *szMsgName, pfnUserMsgHook pfn );
int (*pfnServerCmd)( char *szCmdString );
int (*pfnClientCmd)( char *szCmdString );
int (*pfnAddCommand)( const char *cmd_name, void (*function)(void) );
int (*pfnHookUserMsg)( const char *szMsgName, pfnUserMsgHook pfn );
int (*pfnServerCmd)( const char *szCmdString );
int (*pfnClientCmd)( const char *szCmdString );
void (*pfnGetPlayerInfo)( int ent_num, hud_player_info_t *pinfo );
// sound handlers
void (*pfnPlaySoundByName)( char *szSound, float volume );
void (*pfnPlaySoundByName)( const char *szSound, float volume );
void (*pfnPlaySoundByIndex)( int iSound, float volume );
// vector helpers
@@ -154,14 +170,14 @@ typedef struct cl_enginefuncs_s
void (*GetViewAngles)( float * );
void (*SetViewAngles)( float * );
int (*GetMaxClients)( void );
void (*Cvar_SetValue)( char *cvar, float value );
void (*Cvar_SetValue)( const char *cvar, float value );
int (*Cmd_Argc)( void );
char *(*Cmd_Argv)( int arg );
void (*Con_Printf)( char *fmt, ... );
void (*Con_DPrintf)( char *fmt, ... );
void (*Con_NPrintf)( int pos, char *fmt, ... );
void (*Con_NXPrintf)( struct con_nprint_s *info, char *fmt, ... );
int (*Cmd_Argc)( void );
const char *(*Cmd_Argv)( int arg );
void (*Con_Printf)( const char *fmt, ... );
void (*Con_DPrintf)( const char *fmt, ... );
void (*Con_NPrintf)( int pos, const char *fmt, ... );
void (*Con_NXPrintf)( struct con_nprint_s *info, const char *fmt, ... );
const char* (*PhysInfo_ValueForKey)( const char *key );
const char* (*ServerInfo_ValueForKey)( const char *key );
@@ -180,8 +196,8 @@ typedef struct cl_enginefuncs_s
void (*V_CalcShake)( void );
void (*V_ApplyShake)( float *origin, float *angles, float factor );
int (*PM_PointContents)( float *point, int *truecontents );
int (*PM_WaterEntity)( float *p );
int (*PM_PointContents)( const float *point, int *truecontents );
int (*PM_WaterEntity)( const float *p );
struct pmtrace_s *(*PM_TraceLine)( float *start, float *end, int flags, int usehull, int ignore_pe );
struct model_s *(*CL_LoadModel)( const char *modelname, int *index );
@@ -189,35 +205,36 @@ typedef struct cl_enginefuncs_s
const struct model_s* (*GetSpritePointer)( HSPRITE hSprite );
void (*pfnPlaySoundByNameAtLocation)( char *szSound, float volume, float *origin );
unsigned short (*pfnPrecacheEvent)( int type, const char* psz );
void (*pfnPlaybackEvent)( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
void (*pfnWeaponAnim)( int iAnim, int body );
float (*pfnRandomFloat)( float flLow, float flHigh );
long (*pfnRandomLong)( long lLow, long lHigh );
void (*pfnHookEvent)( char *name, void ( *pfnEvent )( struct event_args_s *args ));
int (*Con_IsVisible) ();
float (*pfnRandomFloat)( float flLow, float flHigh );
int (*pfnRandomLong)( int lLow, int lHigh );
void (*pfnHookEvent)( const char *name, void ( *pfnEvent )( struct event_args_s *args ));
int (*Con_IsVisible) ( void );
const char *(*pfnGetGameDirectory)( void );
struct cvar_s *(*pfnGetCvarPointer)( const char *szName );
const char *(*Key_LookupBinding)( const char *pBinding );
const char *(*pfnGetLevelName)( void );
void (*pfnGetScreenFade)( struct screenfade_s *fade );
void (*pfnSetScreenFade)( struct screenfade_s *fade );
void* (*VGui_GetPanel)( );
void* (*VGui_GetPanel)( void );
void (*VGui_ViewportPaintBackground)( int extents[4] );
byte* (*COM_LoadFile)( char *path, int usehunk, int *pLength );
byte* (*COM_LoadFile)( const char *path, int usehunk, int *pLength );
char* (*COM_ParseFile)( char *data, char *token );
void (*COM_FreeFile)( void *buffer );
struct triangleapi_s *pTriAPI;
struct efx_api_s *pEfxAPI;
struct event_api_s *pEventAPI;
struct event_api_s *pEventAPI;
struct demo_api_s *pDemoAPI;
struct net_api_s *pNetAPI;
struct IVoiceTweak_s *pVoiceTweak;
// returns 1 if the client is a spectator only (connected to a proxy), 0 otherwise or 2 if in dev_overview mode
// returns 1 if the client is a spectator only (connected to a proxy), 0 otherwise or 2 if in dev_overview mode
int (*IsSpectateOnly)( void );
struct model_s *(*LoadMapSprite)( const char *filename );
@@ -248,39 +265,47 @@ typedef struct cl_enginefuncs_s
void (*pfnGetMousePos)( struct tagPOINT *ppt );
void (*pfnSetMousePos)( int x, int y );
void (*pfnSetMouseEnable)( qboolean fEnable );
void (*pfnUnused1)( void );
void (*pfnUnused2)( void );
void (*pfnUnused3)( void );
void (*pfnUnused4)( void );
float (*pfnGetClientOldTime)( void );
float (*pfnGetGravity)( void );
struct model_s*(*pfnGetModelByIndex)( int index );
void (*pfnUnused5)( void );
void (*pfnUnused6)( void );
void (*pfnUnused7)( void );
void (*pfnUnused8)( void );
void (*pfnUnused9)( void );
void (*pfnUnused10)( void );
void (*pfnUnused11)( void );
void (*pfnUnused12)( void );
const char*(*LocalPlayerInfo_ValueForKey)( const char* key );
void (*pfnUnused13)( void );
void (*pfnUnused14)( void );
void (*pfnUnused15)( void );
void (*pfnUnused16)( void );
void (*Cvar_Set)( char *name, char *value );
void (*pfnUnused17)( void );
void (*pfnUnused18)( void );
void (*pfnUnused19)( void );
double (*pfnSys_FloatTime)( void );
void (*pfnUnused20)( void );
void (*pfnUnused21)( void );
void (*pfnUnused22)( void );
void (*pfnUnused23)( void );
void (*pfnFillRGBABlend)( int x, int y, int width, int height, int r, int g, int b, int a );
int (*pfnGetAppID)( void );
void (*pfnUnused24)( void );
void (*pfnUnused25)( void );
// undocumented interface starts here
struct cvar_s* (*pfnGetFirstCvarPtr)( void );
void* (*pfnGetFirstCmdFunctionHandle)( void );
void* (*pfnGetNextCmdFunctionHandle)( void *cmdhandle );
const char* (*pfnGetCmdFunctionName)( void *cmdhandle );
float (*pfnGetClientOldTime)( void );
float (*pfnGetGravity)( void );
struct model_s* (*pfnGetModelByIndex)( int index );
void (*pfnSetFilterMode)( int mode ); // same as gl_texsort in original Quake
void (*pfnSetFilterColor)( float red, float green, float blue );
void (*pfnSetFilterBrightness)( float brightness );
void *(*pfnSequenceGet)( const char *fileName, const char *entryName );
void (*pfnSPR_DrawGeneric)( int frame, int x, int y, const wrect_t *prc, int blendsrc, int blenddst, int width, int height );
void *(*pfnSequencePickSentence)( const char *groupName, int pickMethod, int *entryPicked );
int (*pfnDrawString)( int x, int y, const char *str, int r, int g, int b );
int (*pfnDrawStringReverse)( int x, int y, const char *str, int r, int g, int b );
const char *(*LocalPlayerInfo_ValueForKey)( const char* key );
int (*pfnVGUI2DrawCharacter)( int x, int y, int ch, unsigned int font );
int (*pfnVGUI2DrawCharacterAdditive)( int x, int y, int ch, int r, int g, int b, unsigned int font );
unsigned int (*pfnGetApproxWavePlayLen)( const char *filename );
void* (*GetCareerGameUI)( void ); // g-cont. !!!! potential crash-point!
void (*Cvar_Set)( const char *name, const char *value );
int (*pfnIsPlayingCareerMatch)( void );
void (*pfnPlaySoundVoiceByName)( char *szSound, float volume, int pitch );
void (*pfnPrimeMusicStream)( char *filename, int looping );
double (*pfnSys_FloatTime)( void );
// decay funcs
void (*pfnProcessTutorMessageDecayBuffer)( int *buffer, int buflen );
void (*pfnConstructTutorMessageDecayBuffer)( int *buffer, int buflen );
void (*pfnResetTutorMessageDecayData)( void );
void (*pfnPlaySoundByNameAtPitch)( char *szSound, float volume, int pitch );
void (*pfnFillRGBABlend)( int x, int y, int width, int height, int r, int g, int b, int a );
int (*pfnGetAppID)( void );
cmdalias_t *(*pfnGetAliases)( void );
void (*pfnVguiWrap2_GetMouseDelta)( int *x, int *y );
// added in 2019 update, not documented yet
int (*pfnFilteredClientCmd)( const char *cmd );
} cl_enginefunc_t;
#define CLDLL_INTERFACE_VERSION 7
@@ -289,4 +314,4 @@ typedef struct cl_enginefuncs_s
}
#endif
#endif//CDLL_INT_H
#endif//CDLL_INT_H

38
engine/client/avi/avi.h Normal file
View File

@@ -0,0 +1,38 @@
/*
avi.h -- common avi support header
Copyright (C) 2018 a1batross, Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#ifndef AVI_H
#define AVI_H
//
// avikit.c
//
typedef struct movie_state_s movie_state_t;
int AVI_GetVideoFrameNumber( movie_state_t *Avi, float time );
byte *AVI_GetVideoFrame( movie_state_t *Avi, int frame );
qboolean AVI_GetVideoInfo( movie_state_t *Avi, int *xres, int *yres, float *duration );
qboolean AVI_GetAudioInfo( movie_state_t *Avi, wavdata_t *snd_info );
int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int length );
void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audio, int quiet );
movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio );
int AVI_TimeToSoundPosition( movie_state_t *Avi, int time );
int AVI_GetVideoFrameCount( movie_state_t *Avi );
void AVI_CloseVideo( movie_state_t *Avi );
qboolean AVI_IsActive( movie_state_t *Avi );
void AVI_FreeVideo( movie_state_t *Avi );
movie_state_t *AVI_GetState( int num );
qboolean AVI_Initailize( void );
void AVI_Shutdown( void );
#endif // AVI_H

View File

@@ -0,0 +1,95 @@
/*
avi_stub.c - playing AVI files (stub)
Copyright (C) 2018 a1batross
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "build.h"
#if !XASH_WIN32
#include "common.h"
int AVI_GetVideoFrameNumber( movie_state_t *Avi, float time )
{
return 0;
}
byte *AVI_GetVideoFrame( movie_state_t *Avi, int frame )
{
return NULL;
}
qboolean AVI_GetVideoInfo( movie_state_t *Avi, int *xres, int *yres, float *duration )
{
return false;
}
qboolean AVI_GetAudioInfo( movie_state_t *Avi, wavdata_t *snd_info )
{
return false;
}
int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int length )
{
return 0;
}
void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audio, int quiet )
{
;
}
movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio )
{
return NULL;
}
int AVI_TimeToSoundPosition( movie_state_t *Avi, int time )
{
return 0;
}
int AVI_GetVideoFrameCount( movie_state_t *Avi )
{
return 0;
}
void AVI_CloseVideo( movie_state_t *Avi )
{
;
}
qboolean AVI_IsActive( movie_state_t *Avi )
{
return false;
}
void AVI_FreeVideo( movie_state_t *Avi )
{
;
}
movie_state_t *AVI_GetState( int num )
{
return NULL;
}
qboolean AVI_Initailize( void )
{
return false;
}
void AVI_Shutdown( void )
{
;
}
#endif // WIN32

View File

@@ -1,5 +1,5 @@
/*
avikit.c - playing AVI files (based on original AVIKit code)
avi_win.c - playing AVI files (based on original AVIKit code, Win32 version)
Copyright (C) 2010 Uncle Mike
This program is free software: you can redistribute it and/or modify
@@ -13,9 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "build.h"
#if XASH_WIN32
#include "common.h"
#include "client.h"
#include "gl_local.h"
#include <vfw.h> // video for windows
// msvfw32.dll exports
@@ -58,14 +59,14 @@ dll_info_t msacm_dll = { "msacm32.dll", msacm_funcs, false };
static int (_stdcall *pAVIStreamInfo)( PAVISTREAM pavi, AVISTREAMINFO *psi, LONG lSize );
static int (_stdcall *pAVIStreamRead)( PAVISTREAM pavi, LONG lStart, LONG lSamples, void *lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples );
static PGETFRAME (_stdcall *pAVIStreamGetFrameOpen)( PAVISTREAM pavi, LPBITMAPINFOHEADER lpbiWanted );
static long (_stdcall *pAVIStreamTimeToSample)( PAVISTREAM pavi, LONG lTime );
static int (_stdcall *pAVIStreamTimeToSample)( PAVISTREAM pavi, LONG lTime );
static void* (_stdcall *pAVIStreamGetFrame)( PGETFRAME pg, LONG lPos );
static int (_stdcall *pAVIStreamGetFrameClose)( PGETFRAME pg );
static dword (_stdcall *pAVIStreamRelease)( PAVISTREAM pavi );
static int (_stdcall *pAVIFileOpen)( PAVIFILE *ppfile, LPCSTR szFile, UINT uMode, LPCLSID lpHandler );
static int (_stdcall *pAVIFileGetStream)( PAVIFILE pfile, PAVISTREAM *ppavi, DWORD fccType, LONG lParam );
static int (_stdcall *pAVIStreamReadFormat)( PAVISTREAM pavi, LONG lPos,LPVOID lpFormat, LONG *lpcbFormat );
static long (_stdcall *pAVIStreamStart)( PAVISTREAM pavi );
static int (_stdcall *pAVIStreamStart)( PAVISTREAM pavi );
static dword (_stdcall *pAVIFileRelease)( PAVIFILE pfile );
static void (_stdcall *pAVIFileInit)( void );
static void (_stdcall *pAVIFileExit)( void );
@@ -90,7 +91,7 @@ static dllfunc_t avifile_funcs[] =
};
dll_info_t avifile_dll = { "avifil32.dll", avifile_funcs, false };
typedef struct movie_state_s
{
qboolean active;
@@ -99,17 +100,17 @@ typedef struct movie_state_s
PAVIFILE pfile; // avi file pointer
PAVISTREAM video_stream; // video stream pointer
PGETFRAME video_getframe; // pointer to getframe object for video stream
long video_frames; // total frames
long video_xres; // video stream resolution
long video_yres;
int video_frames; // total frames
int video_xres; // video stream resolution
int video_yres;
float video_fps; // video stream fps
PAVISTREAM audio_stream; // audio stream pointer
WAVEFORMAT *audio_header; // audio stream header
long audio_header_size; // WAVEFORMAT is returned for PCM data; WAVEFORMATEX for others
long audio_codec; // WAVE_FORMAT_PCM is oldstyle: anything else needs conversion
long audio_length; // in converted samples
long audio_bytes_per_sample; // guess.
int audio_header_size; // WAVEFORMAT is returned for PCM data; WAVEFORMATEX for others
int audio_codec; // WAVE_FORMAT_PCM is oldstyle: anything else needs conversion
int audio_length; // in converted samples
int audio_bytes_per_sample; // guess.
// compressed audio specific data
dword cpa_blockalign; // block size to read
@@ -251,7 +252,7 @@ qboolean AVI_ACMConvertAudio( movie_state_t *Avi )
return true;
}
qboolean AVI_GetVideoInfo( movie_state_t *Avi, long *xres, long *yres, float *duration )
qboolean AVI_GetVideoInfo( movie_state_t *Avi, int *xres, int *yres, float *duration )
{
if( !Avi->active )
return false;
@@ -269,7 +270,7 @@ qboolean AVI_GetVideoInfo( movie_state_t *Avi, long *xres, long *yres, float *du
}
// returns a unique frame identifier
long AVI_GetVideoFrameNumber( movie_state_t *Avi, float time )
int AVI_GetVideoFrameNumber( movie_state_t *Avi, float time )
{
if( !Avi->active )
return 0;
@@ -277,7 +278,7 @@ long AVI_GetVideoFrameNumber( movie_state_t *Avi, float time )
return (time * Avi->video_fps);
}
long AVI_GetVideoFrameCount( movie_state_t *Avi )
int AVI_GetVideoFrameCount( movie_state_t *Avi )
{
if( !Avi->active )
return 0;
@@ -285,7 +286,7 @@ long AVI_GetVideoFrameCount( movie_state_t *Avi )
return Avi->video_frames;
}
long AVI_TimeToSoundPosition( movie_state_t *Avi, long time )
int AVI_TimeToSoundPosition( movie_state_t *Avi, int time )
{
if( !Avi->active || !Avi->audio_stream )
return 0;
@@ -295,7 +296,7 @@ long AVI_TimeToSoundPosition( movie_state_t *Avi, long time )
}
// gets the raw frame data
byte *AVI_GetVideoFrame( movie_state_t *Avi, long frame )
byte *AVI_GetVideoFrame( movie_state_t *Avi, int frame )
{
LPBITMAPINFOHEADER frame_info;
byte *frame_raw;
@@ -382,9 +383,9 @@ qboolean AVI_SeekPosition( movie_state_t *Avi, dword offset )
}
// get a chunk of audio from the stream (in bytes)
long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long length )
int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int length )
{
long result = 0;
int result = 0;
int i;
// zero data past the end of the file
@@ -392,7 +393,7 @@ long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long l
{
if( offset <= Avi->audio_length )
{
long remaining_length = Avi->audio_length - offset;
int remaining_length = Avi->audio_length - offset;
AVI_GetAudioChunk( Avi, audiodata, offset, remaining_length );
@@ -422,12 +423,12 @@ long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long l
result = 0;
// seek to correct chunk and all that stuff
if( !AVI_SeekPosition( Avi, offset ))
if( !AVI_SeekPosition( Avi, offset ))
return 0; // don't continue if we're waiting for the play pointer to catch up
while( length > 0 )
{
long blockread = Avi->cpa_conversion_header.cbDstLengthUsed - Avi->cpa_blockpos;
int blockread = Avi->cpa_conversion_header.cbDstLengthUsed - Avi->cpa_blockpos;
if( blockread <= 0 ) // read next
{
@@ -490,7 +491,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
{
BITMAPINFOHEADER bmih;
AVISTREAMINFO stream_info;
long opened_streams = 0;
int opened_streams = 0;
LONG hr;
// default state: non-working.
@@ -534,7 +535,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
Avi->video_stream = Avi->audio_stream = NULL;
// open the streams until a stream is not available.
// open the streams until a stream is not available.
while( 1 )
{
PAVISTREAM stream = NULL;
@@ -557,7 +558,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
}
else if( stream_info.fccType == streamtypeAUDIO && Avi->audio_stream == NULL && load_audio )
{
long size;
int size;
Avi->audio_stream = stream;
@@ -570,7 +571,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
Avi->audio_codec = Avi->audio_header->wFormatTag;
// length of converted audio in samples
Avi->audio_length = (long)((float)stream_info.dwLength / Avi->audio_header->nAvgBytesPerSec );
Avi->audio_length = (int)((float)stream_info.dwLength / Avi->audio_header->nAvgBytesPerSec );
Avi->audio_length *= Avi->audio_header->nSamplesPerSec;
if( Avi->audio_codec != WAVE_FORMAT_PCM )
@@ -584,17 +585,17 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
}
else Avi->audio_bytes_per_sample = Avi->audio_header->nBlockAlign;
Avi->audio_length *= Avi->audio_bytes_per_sample;
}
}
else
{
pAVIStreamRelease( stream );
}
}
// display error message-stream not found.
// display error message-stream not found.
if( Avi->video_stream == NULL )
{
if( Avi->pfile ) // if file is open, close it
if( Avi->pfile ) // if file is open, close it
pAVIFileRelease( Avi->pfile );
if( !Avi->quiet )
Con_DPrintf( S_ERROR "couldn't find a valid video stream.\n" );
@@ -612,9 +613,9 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
}
bmih.biSize = sizeof( BITMAPINFOHEADER );
bmih.biPlanes = 1;
bmih.biPlanes = 1;
bmih.biBitCount = 32;
bmih.biCompression = BI_RGB;
bmih.biCompression = BI_RGB;
bmih.biWidth = Avi->video_xres;
bmih.biHeight = -Avi->video_yres; // invert height to flip image upside down
@@ -729,4 +730,5 @@ void AVI_Shutdown( void )
Sys_FreeLibrary( &msvfw_dll );
Sys_FreeLibrary( &msacm_dll );
avi_initialized = false;
}
}
#endif // _WIN32

View File

@@ -15,7 +15,6 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "gl_local.h"
/*
====================
@@ -127,8 +126,8 @@ void CL_PlayCDTrack_f( void )
int i, maxTrack;
for( maxTrack = i = 0; i < MAX_CDTRACKS; i++ )
if( Q_strlen( clgame.cdtracks[i] )) maxTrack++;
if( COM_CheckStringEmpty( clgame.cdtracks[i] ) ) maxTrack++;
Con_Printf( "%u tracks\n", maxTrack );
if( track )
{
@@ -141,43 +140,31 @@ void CL_PlayCDTrack_f( void )
else Con_Printf( "%s: unknown command %s\n", Cmd_Argv( 0 ), command );
}
/*
==================
/*
==================
CL_ScreenshotGetName
==================
*/
==================
*/
qboolean CL_ScreenshotGetName( int lastnum, char *filename )
{
int a, b, c, d;
if( lastnum < 0 || lastnum > 9999 )
{
Con_Printf( S_ERROR "unable to write screenshot\n" );
return false;
}
a = lastnum / 1000;
lastnum -= a * 1000;
b = lastnum / 100;
lastnum -= b * 100;
c = lastnum / 10;
lastnum -= c * 10;
d = lastnum;
Q_sprintf( filename, "scrshots/%s_shot%i%i%i%i.bmp", clgame.mapname, a, b, c, d );
Q_sprintf( filename, "scrshots/%s_shot%04d.png", clgame.mapname, lastnum );
return true;
}
/*
==================
/*
==================
CL_SnapshotGetName
==================
*/
==================
*/
qboolean CL_SnapshotGetName( int lastnum, char *filename )
{
int a, b, c, d;
if( lastnum < 0 || lastnum > 9999 )
{
Con_Printf( S_ERROR "unable to write snapshot\n" );
@@ -185,34 +172,26 @@ qboolean CL_SnapshotGetName( int lastnum, char *filename )
return false;
}
a = lastnum / 1000;
lastnum -= a * 1000;
b = lastnum / 100;
lastnum -= b * 100;
c = lastnum / 10;
lastnum -= c * 10;
d = lastnum;
Q_sprintf( filename, "../%s_%i%i%i%i.bmp", clgame.mapname, a, b, c, d );
Q_sprintf( filename, "../%s_%04d.png", clgame.mapname, lastnum );
return true;
}
/*
==============================================================================
SCREEN SHOTS
==============================================================================
/*
==============================================================================
SCREEN SHOTS
==============================================================================
*/
/*
==================
/*
==================
CL_ScreenShot_f
normal screenshot
==================
==================
*/
void CL_ScreenShot_f( void )
void CL_ScreenShot_f( void )
{
int i;
string checkname;
@@ -243,14 +222,14 @@ void CL_ScreenShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_SnapShot_f
save screenshots into root dir
==================
==================
*/
void CL_SnapShot_f( void )
void CL_SnapShot_f( void )
{
int i;
string checkname;
@@ -284,12 +263,12 @@ void CL_SnapShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_EnvShot_f
cubemap view
==================
==================
*/
void CL_EnvShot_f( void )
{
@@ -305,12 +284,12 @@ void CL_EnvShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_SkyShot_f
skybox view
==================
==================
*/
void CL_SkyShot_f( void )
{
@@ -326,13 +305,13 @@ void CL_SkyShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_LevelShot_f
splash logo while map is loading
==================
*/
==================
*/
void CL_LevelShot_f( void )
{
size_t ft1, ft2;
@@ -344,7 +323,7 @@ void CL_LevelShot_f( void )
// check for exist
if( cls.demoplayback && ( cls.demonum != -1 ))
{
Q_sprintf( cls.shotname, "levelshots/%s_%s.bmp", cls.demoname, glState.wideScreen ? "16x9" : "4x3" );
Q_sprintf( cls.shotname, "levelshots/%s_%s.bmp", cls.demoname, refState.wideScreen ? "16x9" : "4x3" );
Q_snprintf( filename, sizeof( filename ), "%s.dem", cls.demoname );
// make sure what levelshot is newer than demo
@@ -353,7 +332,7 @@ void CL_LevelShot_f( void )
}
else
{
Q_sprintf( cls.shotname, "levelshots/%s_%s.bmp", clgame.mapname, glState.wideScreen ? "16x9" : "4x3" );
Q_sprintf( cls.shotname, "levelshots/%s_%s.bmp", clgame.mapname, refState.wideScreen ? "16x9" : "4x3" );
// make sure what levelshot is newer than bsp
ft1 = FS_FileTime( cl.worldmodel->name, false );
@@ -366,13 +345,13 @@ void CL_LevelShot_f( void )
else cls.scrshot_action = scrshot_inactive; // disable - not needs
}
/*
==================
/*
==================
CL_SaveShot_f
mini-pic in loadgame menu
==================
*/
==================
*/
void CL_SaveShot_f( void )
{
if( Cmd_Argc() < 2 )
@@ -381,7 +360,7 @@ void CL_SaveShot_f( void )
return;
}
Q_sprintf( cls.shotname, "%s%s.bmp", DEFAULT_SAVE_DIRECTORY, Cmd_Argv( 1 ));
Q_sprintf( cls.shotname, DEFAULT_SAVE_DIRECTORY "%s.bmp", Cmd_Argv( 1 ));
cls.scrshot_action = scrshot_savegame; // build new frame for saveshot
}
@@ -424,53 +403,7 @@ void CL_SetSky_f( void )
return;
}
R_SetupSky( Cmd_Argv( 1 ));
}
/*
================
SCR_TimeRefresh_f
timerefresh [noflip]
================
*/
void SCR_TimeRefresh_f( void )
{
int i;
double start, stop;
double time;
if( cls.state != ca_active )
return;
start = Sys_DoubleTime();
// run without page flipping like GoldSrc
if( Cmd_Argc() == 1 )
{
pglDrawBuffer( GL_FRONT );
for( i = 0; i < 128; i++ )
{
RI.viewangles[1] = i / 128.0 * 360.0f;
R_RenderScene();
}
pglFinish();
R_EndFrame();
}
else
{
for( i = 0; i < 128; i++ )
{
R_BeginFrame( true );
RI.viewangles[1] = i / 128.0 * 360.0f;
R_RenderScene();
R_EndFrame();
}
}
stop = Sys_DoubleTime ();
time = (stop - start);
Con_Printf( "%f seconds (%f fps)\n", time, 128 / time );
ref.dllFuncs.R_SetupSky( Cmd_Argv( 1 ));
}
/*
@@ -482,6 +415,35 @@ viewpos (level-designer helper)
*/
void SCR_Viewpos_f( void )
{
Con_Printf( "org ( %g %g %g )\n", RI.vieworg[0], RI.vieworg[1], RI.vieworg[2] );
Con_Printf( "ang ( %g %g %g )\n", RI.viewangles[0], RI.viewangles[1], RI.viewangles[2] );
}
Con_Printf( "org ( %g %g %g )\n", refState.vieworg[0], refState.vieworg[1], refState.vieworg[2] );
Con_Printf( "ang ( %g %g %g )\n", refState.viewangles[0], refState.viewangles[1], refState.viewangles[2] );
}
/*
=============
CL_WavePlayLen_f
=============
*/
void CL_WavePlayLen_f( void )
{
const char *name;
uint msecs;
if( Cmd_Argc() != 2 )
{
Con_Printf( "waveplaylen <wave file name>: returns approximate number of milliseconds a wave file will take to play.\n" );
return;
}
name = Cmd_Argv( 1 );
msecs = Sound_GetApproxWavePlayLen( name );
if( msecs == 0 )
{
Con_Printf( "Unable to read %s, file may be missing or incorrectly formatted.\n", name );
return;
}
Con_Printf( "Play time is approximately %dms\n", msecs );
}

View File

@@ -39,9 +39,9 @@ qboolean CL_CheckFile( sizebuf_t *msg, resource_t *pResource )
}
if( pResource->type == t_sound )
Q_strncpy( filepath, va( "%s%s", DEFAULT_SOUNDPATH, pResource->szFileName ), sizeof( filepath ));
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", pResource->szFileName );
else Q_strncpy( filepath, pResource->szFileName, sizeof( filepath ));
if( !COM_IsSafeFileToDownload( filepath ))
{
Con_Reportf( "refusing to download %s\n", filepath );
@@ -70,6 +70,13 @@ qboolean CL_CheckFile( sizebuf_t *msg, resource_t *pResource )
return true;
}
if( cl.downloadUrl[0] )
{
HTTP_AddDownload( filepath, pResource->nDownloadSize, true );
host.downloadcount++;
return false;
}
MSG_BeginClientCmd( msg, clc_stringcmd );
MSG_WriteString( msg, va( "dlfile %s", filepath ));
host.downloadcount++;
@@ -140,4 +147,4 @@ void CL_ClearResourceLists( void )
{
CL_ClearResourceList( &cl.resourcesneeded );
CL_ClearResourceList( &cl.resourcesonhand );
}
}

View File

@@ -17,7 +17,6 @@ GNU General Public License for more details.
#include "client.h"
#include "net_encode.h"
#include "particledef.h"
#include "gl_local.h"
#include "cl_tent.h"
#include "shake.h"
#include "hltv.h"
@@ -87,6 +86,7 @@ const char *svc_strings[svc_lastmsg+1] =
"svc_resourcelocation",
"svc_querycvarvalue",
"svc_querycvarvalue2",
"svc_exec",
};
typedef struct
@@ -98,7 +98,7 @@ typedef struct
typedef struct
{
oldcmd_t oldcmd[MSG_COUNT];
oldcmd_t oldcmd[MSG_COUNT];
int currentcmd;
qboolean parsing;
} msg_debug_t;
@@ -156,7 +156,7 @@ void CL_Parse_RecordCommand( int cmd, int startoffset )
int slot;
if( cmd == svc_nop ) return;
slot = ( cls_message_debug.currentcmd++ & MSG_MASK );
cls_message_debug.oldcmd[slot].command = cmd;
cls_message_debug.oldcmd[slot].starting_offset = startoffset;
@@ -188,7 +188,7 @@ write net_message into buffer.dat for debugging
static void CL_WriteErrorMessage( int current_count, sizebuf_t *msg )
{
const char *buffer_file = "buffer.dat";
file_t *fp;
file_t *fp;
fp = FS_Open( buffer_file, "wb", false );
if( !fp ) return;
@@ -239,4 +239,4 @@ void CL_WriteMessageHistory( void )
if( host_developer.value >= DEV_EXTENDED )
CL_WriteErrorMessage( MSG_GetNumBytesRead( msg ) - 1, msg );
cls_message_debug.parsing = false;
}
}

View File

@@ -15,7 +15,6 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "gl_local.h"
#include "net_encode.h"
#define dem_unknown 0 // unknown command
@@ -52,6 +51,7 @@ const char *demo_cmd[dem_lastcmd+1] =
"dem_stop",
};
#pragma pack( push, 1 )
typedef struct
{
int id; // should be IDEM
@@ -63,6 +63,7 @@ typedef struct
char gamedir[64]; // name of game directory (FS_Gamedir())
int directory_offset; // offset of Entry Directory.
} demoheader_t;
#pragma pack( pop )
typedef struct
{
@@ -155,7 +156,7 @@ CL_GetDemoRecordClock
write time while demo is recording
====================
*/
float CL_GetDemoRecordClock( void )
float CL_GetDemoRecordClock( void )
{
return cl.mtime[0];
}
@@ -167,7 +168,7 @@ CL_GetDemoPlaybackClock
overwrite host.realtime
====================
*/
float CL_GetDemoPlaybackClock( void )
float CL_GetDemoPlaybackClock( void )
{
return host.realtime + host.frametime;
}
@@ -349,10 +350,10 @@ Write demo header
*/
void CL_WriteDemoHeader( const char *name )
{
long copysize;
long savepos;
long curpos;
int copysize;
int savepos;
int curpos;
Con_Printf( "recording to %s.\n", name );
cls.demofile = FS_Open( name, "wb", false );
cls.demotime = 0.0;
@@ -370,7 +371,7 @@ void CL_WriteDemoHeader( const char *name )
demo.header.id = IDEMOHEADER;
demo.header.dem_protocol = DEMO_PROTOCOL;
demo.header.net_protocol = PROTOCOL_VERSION;
demo.header.net_protocol = cls.legacymode ? PROTOCOL_LEGACY_VERSION : PROTOCOL_VERSION;
demo.header.host_fps = bound( MIN_FPS, host_maxfps->value, MAX_FPS );
Q_strncpy( demo.header.mapname, clgame.mapname, sizeof( demo.header.mapname ));
Q_strncpy( demo.header.comment, clgame.maptitle, sizeof( demo.header.comment ));
@@ -466,7 +467,7 @@ void CL_StopRecord( void )
demo.header.directory_offset = curpos;
FS_Seek( cls.demofile, 0, SEEK_SET );
FS_Write( cls.demofile, &demo.header, sizeof( demo.header ));
FS_Close( cls.demofile );
cls.demofile = NULL;
cls.demorecording = false;
@@ -489,7 +490,7 @@ void CL_DrawDemoRecording( void )
{
char string[64];
rgba_t color = { 255, 255, 255, 255 };
long pos;
int pos;
int len;
if(!( host_developer.value && cls.demorecording ))
@@ -497,10 +498,10 @@ void CL_DrawDemoRecording( void )
pos = FS_Tell( cls.demofile );
Q_snprintf( string, sizeof( string ), "^1RECORDING:^7 %s: %s time: %02d:%02d", cls.demoname,
Q_memprint( pos ), (int)(cls.demotime / 60.0f ), (int)fmod( cls.demotime, 60.0f ));
Q_memprint( pos ), (int)(cls.demotime / 60.0f ), (int)fmod( cls.demotime, 60.0f ));
Con_DrawStringLen( string, &len, NULL );
Con_DrawString(( glState.width - len ) >> 1, glState.height >> 2, string, color );
Con_DrawString(( refState.width - len ) >> 1, refState.height >> 4, string, color );
}
/*
@@ -725,9 +726,9 @@ qboolean CL_DemoMoveToNextSection( void )
// switch to next section, we got a dem_stop
demo.entry = &demo.directory.entries[demo.entryIndex];
// ready to continue reading, reset clock.
FS_Seek( cls.demofile, demo.entry->offset, SEEK_SET );
FS_Seek( cls.demofile, demo.entry->offset, SEEK_SET );
// time is now relative to this chunk's clock.
demo.starttime = CL_GetDemoPlaybackClock();
@@ -738,7 +739,7 @@ qboolean CL_DemoMoveToNextSection( void )
qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length )
{
int msglen = 0;
int msglen = 0;
Assert( buffer != NULL );
Assert( length != NULL );
@@ -794,8 +795,8 @@ qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )
demoangle_t *a;
*length = 0; // assume we fail
// decide if it is time to grab the next message
// decide if it is time to grab the next message
if( cls.signon == SIGNONS ) // allways grab until fully connected
{
if( cls.timedemo )
@@ -970,7 +971,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
}
} while( swallowmessages );
// If we are playing back a timedemo, and we've already passed on a
// If we are playing back a timedemo, and we've already passed on a
// frame update for this host_frame tag, then we'll just skip this message.
if( cls.timedemo && ( tdlastdemoframe == host.framecount ))
{
@@ -992,7 +993,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
{
// cheat by moving the relative start time forward.
demo.starttime = CL_GetDemoPlaybackClock();
}
}
}
demo.framecount++;
@@ -1100,9 +1101,9 @@ void CL_FinishTimeDemo( void )
{
int frames;
double time;
cls.timedemo = false;
// the first frame didn't count
frames = (host.framecount - cls.td_startframe) - 1;
time = host.realtime - cls.td_starttime;
@@ -1150,9 +1151,10 @@ void CL_StopPlayback( void )
}
else
{
// let game known about demo state
// let game known about demo state
Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
cls.state = ca_disconnected;
memset( &cls.serveradr, 0, sizeof( cls.serveradr ) );
cls.set_lastdemo = false;
S_StopBackgroundTrack();
cls.connect_time = 0;
@@ -1164,12 +1166,12 @@ void CL_StopPlayback( void )
}
}
/*
==================
/*
==================
CL_GetDemoComment
==================
*/
qboolean CL_GetDemoComment( const char *demoname, char *comment )
==================
*/
int GAME_EXPORT CL_GetDemoComment( const char *demoname, char *comment )
{
file_t *demfile;
demoheader_t demohdr;
@@ -1177,15 +1179,15 @@ qboolean CL_GetDemoComment( const char *demoname, char *comment )
demoentry_t entry;
float playtime = 0.0f;
int i;
if( !comment ) return false;
demfile = FS_Open( demoname, "rb", false );
if( !demfile )
{
Q_strncpy( comment, "", MAX_STRING );
comment[0] = '\0';
return false;
}
}
// read in the m_DemoHeader
FS_Read( demfile, &demohdr, sizeof( demoheader_t ));
@@ -1197,7 +1199,9 @@ qboolean CL_GetDemoComment( const char *demoname, char *comment )
return false;
}
if( demohdr.net_protocol != PROTOCOL_VERSION || demohdr.dem_protocol != DEMO_PROTOCOL )
if(( demohdr.net_protocol != PROTOCOL_VERSION &&
demohdr.net_protocol != PROTOCOL_LEGACY_VERSION ) ||
demohdr.dem_protocol != DEMO_PROTOCOL )
{
FS_Close( demfile );
Q_strncpy( comment, "<invalid protocol>", MAX_STRING );
@@ -1224,11 +1228,11 @@ qboolean CL_GetDemoComment( const char *demoname, char *comment )
// split comment to sections
Q_strncpy( comment, demohdr.mapname, CS_SIZE );
Q_strncpy( comment + CS_SIZE, demohdr.comment, CS_SIZE );
Q_strncpy( comment + CS_SIZE * 2, va( "%g sec", playtime ), CS_TIME );
Q_snprintf( comment + CS_SIZE * 2, CS_TIME, "%g sec", playtime );
// all done
FS_Close( demfile );
return true;
}
@@ -1265,12 +1269,12 @@ qboolean CL_NextDemo( void )
return true;
}
/*
==================
/*
==================
CL_CheckStartupDemos
queue demos loop after movie playing
==================
==================
*/
void CL_CheckStartupDemos( void )
{
@@ -1295,15 +1299,13 @@ void CL_CheckStartupDemos( void )
CL_NextDemo ();
}
/*
==================
/*
==================
CL_DemoGetName
==================
*/
==================
*/
static void CL_DemoGetName( int lastnum, char *filename )
{
int a, b, c, d;
if( lastnum < 0 || lastnum > 9999 )
{
// bound
@@ -1311,15 +1313,7 @@ static void CL_DemoGetName( int lastnum, char *filename )
return;
}
a = lastnum / 1000;
lastnum -= a * 1000;
b = lastnum / 100;
lastnum -= b * 100;
c = lastnum / 10;
lastnum -= c * 10;
d = lastnum;
Q_sprintf( filename, "demo%i%i%i%i", a, b, c, d );
Q_sprintf( filename, "demo%04d", lastnum );
}
/*
@@ -1389,13 +1383,13 @@ void CL_Record_f( void )
// open the demo file
Q_sprintf( demopath, "%s.dem", demoname );
// make sure what old demo is removed
// make sure that old demo is removed
if( FS_FileExists( demopath, false ))
FS_Delete( demopath );
Q_strncpy( cls.demoname, demoname, sizeof( cls.demoname ));
Q_strncpy( gameui.globals->demoname, demoname, sizeof( gameui.globals->demoname ));
CL_WriteDemoHeader( demopath );
}
@@ -1484,13 +1478,17 @@ void CL_PlayDemo_f( void )
return;
}
if( demo.header.net_protocol != PROTOCOL_VERSION || demo.header.dem_protocol != DEMO_PROTOCOL )
if( demo.header.dem_protocol != DEMO_PROTOCOL )
{
if( demo.header.dem_protocol != DEMO_PROTOCOL )
Con_Printf( S_ERROR "playdemo: demo protocol outdated (%i should be %i)\n", demo.header.dem_protocol, DEMO_PROTOCOL );
Con_Printf( S_ERROR "playdemo: demo protocol outdated (%i should be %i)\n", demo.header.dem_protocol, DEMO_PROTOCOL );
CL_DemoAborted();
return;
}
if( demo.header.net_protocol != PROTOCOL_VERSION )
Con_Printf( S_ERROR "playdemo: net protocol outdated (%i should be %i)\n", demo.header.net_protocol, PROTOCOL_VERSION );
if( demo.header.net_protocol != PROTOCOL_VERSION &&
demo.header.net_protocol != PROTOCOL_LEGACY_VERSION )
{
Con_Printf( S_ERROR "playdemo: net protocol outdated (%i should be %i)\n", demo.header.net_protocol, PROTOCOL_VERSION );
CL_DemoAborted();
return;
}
@@ -1523,6 +1521,7 @@ void CL_PlayDemo_f( void )
// g-cont. is this need?
Q_strncpy( cls.servername, demoname, sizeof( cls.servername ));
cls.legacymode = demo.header.net_protocol == PROTOCOL_LEGACY_VERSION;
// begin a playback demo
}
@@ -1627,4 +1626,4 @@ void CL_Stop_f( void )
{
S_StopBackgroundTrack();
}
}
}

View File

@@ -14,11 +14,11 @@ GNU General Public License for more details.
*/
#include "common.h"
#include "client.h"
#include "gl_local.h"
#include "mod_local.h"
#include "entity_types.h"
#include "studio.h"
#include "world.h" // BOX_ON_PLANE_SIDE
#include "client.h"
#include "xash3d_mathlib.h"
/*
===============================================================================
@@ -43,9 +43,9 @@ Call when removing an object from the world or moving it to another position
void R_RemoveEfrags( cl_entity_t *ent )
{
efrag_t *ef, *old, *walk, **prev;
ef = ent->efrag;
while( ef )
{
prev = &ef->leaf->efrags;
@@ -55,22 +55,22 @@ void R_RemoveEfrags( cl_entity_t *ent )
if( !walk ) break;
if( walk == ef )
{
{
// remove this fragment
*prev = ef->leafnext;
break;
}
else prev = &walk->leafnext;
}
old = ef;
ef = ef->entnext;
// put it on the free list
old->entnext = clgame.free_efrags;
clgame.free_efrags = old;
}
ent->efrag = NULL;
ent->efrag = NULL;
}
/*
@@ -83,10 +83,10 @@ static void R_SplitEntityOnNode( mnode_t *node )
efrag_t *ef;
mleaf_t *leaf;
int sides;
if( node->contents == CONTENTS_SOLID )
return;
// add an efrag if the node is a leaf
if( node->contents < 0 )
{
@@ -103,31 +103,31 @@ static void R_SplitEntityOnNode( mnode_t *node )
return; // no free fragments...
}
clgame.free_efrags = clgame.free_efrags->entnext;
clgame.free_efrags = ef->entnext;
ef->entity = r_addent;
// add the entity link
// add the entity link
*lastlink = ef;
lastlink = &ef->entnext;
ef->entnext = NULL;
// set the leaf links
ef->leaf = leaf;
ef->leafnext = leaf->efrags;
leaf->efrags = ef;
return;
}
// NODE_MIXED
sides = BOX_ON_PLANE_SIDE( r_emins, r_emaxs, node->plane );
if( sides == 3 )
{
// split on this plane
// if this is the first splitter of this bmodel, remember it
if( !r_pefragtopnode ) r_pefragtopnode = node;
}
// recurse down the contacted sides
if( sides & 1 ) R_SplitEntityOnNode( node->children[0] );
if( sides & 2 ) R_SplitEntityOnNode( node->children[1] );
@@ -143,7 +143,7 @@ void R_AddEfrags( cl_entity_t *ent )
matrix3x4 transform;
vec3_t outmins, outmaxs;
int i;
if( !ent->model )
return;
@@ -202,8 +202,8 @@ void R_StoreEfrags( efrag_t **ppefrag, int framecount )
ppefrag = &pefrag->leafnext;
break;
default:
default:
break;
}
}
}
}

2192
engine/client/cl_efx.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -63,7 +63,7 @@ void CL_CalcPlayerVelocity( int idx, vec3_t velocity )
if( dt != 0.0 )
{
VectorSubtract( clgame.entities[idx].curstate.velocity, clgame.entities[idx].prevstate.velocity, delta );
VectorScale( delta, 1.0 / dt, velocity );
VectorScale( delta, 1.0f / dt, velocity );
}
else
{
@@ -78,23 +78,48 @@ CL_DescribeEvent
=============
*/
void CL_DescribeEvent( int slot, int flags, const char *eventname )
void CL_DescribeEvent( event_info_t *ei, int slot )
{
int idx = (slot & 31);
int idx = (slot & 63) * 2;
con_nprint_t info;
string origin_str = { 0 }; //, angles_str = { 0 };
if( !eventname || !cl_showevents->value )
if( !cl_showevents->value )
return;
// mark reliable as green and unreliable as red
if( FBitSet( flags, FEV_RELIABLE ))
VectorSet( info.color, 0.0f, 1.0f, 0.0f );
else VectorSet( info.color, 1.0f, 0.0f, 0.0f );
info.time_to_live = 0.5f;
info.time_to_live = 1.0f;
info.index = idx;
Con_NXPrintf( &info, "%i %f %s", slot, cl.time, eventname );
// mark reliable as green and unreliable as red
if( FBitSet( ei->flags, FEV_RELIABLE ))
VectorSet( info.color, 0.5f, 1.0f, 0.5f );
else VectorSet( info.color, 1.0f, 0.5f, 0.5f );
if( !VectorIsNull( ei->args.origin ))
{
Q_snprintf( origin_str, sizeof( origin_str ), "(%.2f,%.2f,%.2f)",
ei->args.origin[0], ei->args.origin[1], ei->args.origin[2]);
}
/*if( !VectorIsNull( ei->args.angles ))
{
Q_snprintf( angles_str, sizeof( angles_str ), "ang %.2f %.2f %.2f",
ei->args.angles[0], ei->args.angles[1], ei->args.angles[2]);
}*/
Con_NXPrintf( &info, "%i %.2f %c %s %s",
slot, cl.time,
(FBitSet( ei->flags, FEV_CLIENT ) ? 'c' :
FBitSet( ei->flags, FEV_SERVER ) ? 's' : '?'),
cl.event_precache[ei->index],
origin_str);
info.index++;
Con_NXPrintf( &info, "b(%i,%i) i(%i,%i) f(%.2f,%.2f)",
ei->args.bparam1, ei->args.bparam2,
ei->args.iparam1, ei->args.iparam2,
ei->args.fparam1, ei->args.fparam2);
}
/*
@@ -134,7 +159,7 @@ CL_EventIndex
word CL_EventIndex( const char *name )
{
int i;
if( !COM_CheckString( name ))
return 0;
@@ -189,7 +214,7 @@ qboolean CL_FireEvent( event_info_t *ei, int slot )
// get the func pointer
for( i = 0; i < MAX_EVENTS; i++ )
{
ev = clgame.events[i];
ev = clgame.events[i];
if( !ev )
{
@@ -202,14 +227,14 @@ qboolean CL_FireEvent( event_info_t *ei, int slot )
{
if( ev->func )
{
CL_DescribeEvent( slot, ei->flags, cl.event_precache[ei->index] );
CL_DescribeEvent( ei, slot );
ev->func( &ei->args );
return true;
}
name = cl.event_precache[ei->index];
Con_Reportf( S_ERROR "CL_FireEvent: %s not hooked\n", name );
break;
break;
}
}
@@ -393,7 +418,7 @@ void CL_ParseEvent( sizebuf_t *msg )
event_index = MSG_ReadUBitLong( msg, MAX_EVENT_BITS );
if( MSG_ReadOneBit( msg ))
packet_index = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
packet_index = MSG_ReadUBitLong( msg, cls.legacymode ? MAX_LEGACY_ENTITY_BITS : MAX_ENTITY_BITS );
else packet_index = -1;
if( MSG_ReadOneBit( msg ))
@@ -437,7 +462,7 @@ void CL_ParseEvent( sizebuf_t *msg )
args.angles[PITCH] /= -3.0f;
}
}
// Place event on queue
CL_QueueEvent( FEV_SERVER, event_index, delay, &args );
}
@@ -450,7 +475,7 @@ CL_PlaybackEvent
=============
*/
void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, float delay, float *origin,
void GAME_EXPORT CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, float delay, float *origin,
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
{
event_args_t args;
@@ -469,7 +494,7 @@ void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, floa
if( !CL_EventIndex( cl.event_precache[eventindex] ))
{
Con_DPrintf( S_ERROR "CL_PlaybackEvent: event %i was not precached\n", eventindex );
return;
return;
}
SetBits( flags, FEV_CLIENT ); // it's a client event
@@ -492,4 +517,4 @@ void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, floa
args.bparam2 = bparam2;
CL_QueueEvent( flags, eventindex, delay, &args );
}
}

View File

@@ -17,7 +17,6 @@ GNU General Public License for more details.
#include "client.h"
#include "net_encode.h"
#include "entity_types.h"
#include "gl_local.h"
#include "pm_local.h"
#include "cl_tent.h"
#include "studio.h"
@@ -102,7 +101,7 @@ qboolean CL_EntityTeleported( cl_entity_t *ent )
VectorSubtract( ent->curstate.origin, ent->prevstate.origin, delta );
// compute potential max movement in units per frame and compare with entity movement
maxlen = ( clgame.movevars.maxvelocity * ( 1.0 / GAME_FPS ));
maxlen = ( clgame.movevars.maxvelocity * ( 1.0f / GAME_FPS ));
len = VectorLength( delta );
return (len > maxlen);
@@ -132,6 +131,9 @@ some ents will be ignore lerping
*/
qboolean CL_EntityIgnoreLerp( cl_entity_t *e )
{
if( cl_nointerp->value > 0.f )
return true;
if( e->model && e->model->type == mod_alias )
return false;
@@ -230,6 +232,33 @@ void CL_UpdateLatchedVars( cl_entity_t *ent )
clgame.drawFuncs.CL_UpdateLatchedVars( ent, false );
}
/*
====================
CL_GetStudioEstimatedFrame
====================
*/
float CL_GetStudioEstimatedFrame( cl_entity_t *ent )
{
studiohdr_t *pstudiohdr;
mstudioseqdesc_t *pseqdesc;
int sequence;
if( ent->model != NULL && ent->model->type == mod_studio )
{
pstudiohdr = (studiohdr_t *)Mod_StudioExtradata( ent->model );
if( pstudiohdr )
{
sequence = bound( 0, ent->curstate.sequence, pstudiohdr->numseq - 1 );
pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + sequence;
return ref.dllFuncs.R_StudioEstimateFrame( ent, pseqdesc );
}
}
return 0;
}
/*
====================
CL_ResetLatchedVars
@@ -297,7 +326,7 @@ void CL_ProcessEntityUpdate( cl_entity_t *ent )
}
// g-cont. it should be done for all the players?
if( ent->player && !FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
if( ent->player && !FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
ent->curstate.angles[PITCH] /= -3.0f;
VectorCopy( ent->curstate.origin, ent->origin );
@@ -330,7 +359,7 @@ qboolean CL_FindInterpolationUpdates( cl_entity_t *ent, float targettime, positi
for( i = 1; i < HISTORY_MAX - 1; i++ )
{
at = ent->ph[( imod - i ) & HISTORY_MASK].animtime;
if( at == 0.0 ) break;
if( at == 0.0f ) break;
if( targettime > at )
{
@@ -503,6 +532,13 @@ void CL_ComputePlayerOrigin( cl_entity_t *ent )
if( !ent->player || ent->index == ( cl.playernum + 1 ))
return;
if( cl_nointerp->value > 0.f )
{
VectorCopy( ent->curstate.angles, ent->angles );
VectorCopy( ent->curstate.origin, ent->origin );
return;
}
if( cls.demoplayback == DEMO_QUAKE1 )
{
// quake lerping is easy
@@ -729,7 +765,10 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
CL_WriteDemoJumpTime();
// sentinel count. save it for debug checking
count = ( MSG_ReadUBitLong( msg, MAX_VISIBLE_PACKET_BITS ) + 1 );
if( cls.legacymode )
count = MSG_ReadWord( msg );
else count = MSG_ReadUBitLong( msg, MAX_VISIBLE_PACKET_BITS ) + 1;
newframe = &cl.frames[cl.parsecountmod];
// allocate parse entities
@@ -753,7 +792,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
}
if( subtracted >= CL_UPDATE_MASK )
{
{
// we can't use this, it is too old
Con_NPrintf( 2, "^3Warning:^1 delta frame is too old^7\n" );
CL_FlushEntityPacket( msg );
@@ -803,15 +842,25 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
while( 1 )
{
newnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
if( newnum == LAST_EDICT ) break; // end of packet entities
int lastedict;
if( cls.legacymode )
{
newnum = MSG_ReadWord( msg );
lastedict = 0;
}
else
{
newnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
lastedict = LAST_EDICT;
}
if( newnum == lastedict ) break; // end of packet entities
if( MSG_CheckOverflow( msg ))
Host_Error( "CL_ParsePacketEntities: overflow\n" );
player = CL_IsPlayerIndex( newnum );
while( oldnum < newnum )
{
{
// one or more entities from the old packet are unchanged
CL_DeltaEntity( msg, newframe, oldnum, oldent, false );
oldindex++;
@@ -828,7 +877,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
}
if( oldnum == newnum )
{
{
// delta from previous state
bufStart = MSG_GetNumBytesRead( msg );
CL_DeltaEntity( msg, newframe, newnum, oldent, true );
@@ -848,7 +897,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
}
if( oldnum > newnum )
{
{
// delta from baseline ?
bufStart = MSG_GetNumBytesRead( msg );
CL_DeltaEntity( msg, newframe, newnum, NULL, true );
@@ -859,7 +908,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
// any remaining entities in the old frame are copied over
while( oldnum != MAX_ENTNUMBER )
{
{
// one or more entities from the old packet are unchanged
CL_DeltaEntity( msg, newframe, oldnum, oldent, false );
oldindex++;
@@ -889,10 +938,10 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
// first update is the final signon stage where we actually receive an entity (i.e., the world at least)
if( cls.signon == ( SIGNONS - 1 ))
{
{
// we are done with signon sequence.
cls.signon = SIGNONS;
// Clear loading plaque.
CL_SignonReply ();
}
@@ -934,10 +983,10 @@ qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType )
if( entityType == ET_BEAM )
{
CL_AddCustomBeam( ent );
ref.dllFuncs.CL_AddCustomBeam( ent );
return true;
}
else if( !R_AddEntity( ent, entityType ))
else if( !ref.dllFuncs.R_AddEntity( ent, entityType ))
{
return false;
}
@@ -1109,7 +1158,7 @@ void CL_LinkPacketEntities( frame_t *frame )
if( ent->curstate.rendermode == kRenderNormal )
{
// auto 'solid' faces
if( FBitSet( ent->model->flags, MODEL_TRANSPARENT ) && CL_IsQuakeCompatible( ))
if( FBitSet( ent->model->flags, MODEL_TRANSPARENT ) && Host_IsQuakeCompatible( ))
{
ent->curstate.rendermode = kRenderTransAlpha;
ent->curstate.renderamt = 255;
@@ -1185,8 +1234,8 @@ void CL_LinkPacketEntities( frame_t *frame )
if( ent->model->type == mod_studio )
{
if( interpolate && FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
R_StudioLerpMovement( ent, cl.time, ent->origin, ent->angles );
if( interpolate && FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
ref.dllFuncs.R_StudioLerpMovement( ent, cl.time, ent->origin, ent->angles );
}
}
@@ -1257,8 +1306,6 @@ void CL_EmitEntities( void )
{
if( cl.paused ) return; // don't waste time
R_ClearScene ();
// not in server yet, no entities to redraw
if( cls.state != ca_active || !cl.validsequence )
return;
@@ -1268,7 +1315,7 @@ void CL_EmitEntities( void )
return;
// animate lightestyles
CL_RunLightStyles ();
ref.dllFuncs.CL_RunLightStyles ();
// decay dynamic lights
CL_DecayLights ();
@@ -1279,9 +1326,7 @@ void CL_EmitEntities( void )
// set client ideal pitch when mlook is disabled
CL_SetIdealPitch ();
// clear the scene befor start new frame
if( clgame.drawFuncs.R_ClearScene != NULL )
clgame.drawFuncs.R_ClearScene();
ref.dllFuncs.R_ClearScene ();
// link all the visible clients first
CL_LinkPlayers ( &cl.frames[cl.parsecountmod] );
@@ -1325,35 +1370,27 @@ qboolean CL_GetEntitySpatialization( channel_t *ch )
if(( ch->entnum - 1 ) == cl.playernum )
{
VectorCopy( RI.vieworg, ch->origin );
VectorCopy( refState.vieworg, ch->origin );
return true;
}
valid_origin = VectorIsNull( ch->origin ) ? false : true;
valid_origin = VectorIsNull( ch->origin ) ? false : true;
ent = CL_GetEntityByIndex( ch->entnum );
// entity is not present on the client but has valid origin
if( !ent || !ent->index || ent->curstate.messagenum == 0 )
if( !ent || !ent->model || ent->curstate.messagenum != cl.parsecount )
return valid_origin;
#if 0
// uncomment this if you want enable additional check by PVS
if( ent->curstate.messagenum != cl.parsecount )
return valid_origin;
#endif
ch->movetype = ent->curstate.movetype;
// setup origin
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin );
VectorAdd( ch->origin, ent->curstate.origin, ch->origin );
// setup mins\maxs
VectorAdd( ent->curstate.mins, ent->curstate.origin, ch->absmin );
VectorAdd( ent->curstate.maxs, ent->curstate.origin, ch->absmax );
// setup radius
if( ent->model != NULL && ent->model->radius ) ch->radius = ent->model->radius;
else ch->radius = RadiusFromBounds( ent->curstate.mins, ent->curstate.maxs );
if( ent->model->type == mod_brush )
{
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
VectorAdd( ent->origin, ch->origin, ch->origin );
}
else
{
VectorCopy( ent->origin, ch->origin );
}
return true;
}
@@ -1363,7 +1400,7 @@ qboolean CL_GetMovieSpatialization( rawchan_t *ch )
cl_entity_t *ent;
qboolean valid_origin;
valid_origin = VectorIsNull( ch->origin ) ? false : true;
valid_origin = VectorIsNull( ch->origin ) ? false : true;
ent = CL_GetEntityByIndex( ch->entnum );
// entity is not present on the client but has valid origin
@@ -1371,12 +1408,15 @@ qboolean CL_GetMovieSpatialization( rawchan_t *ch )
return valid_origin;
// setup origin
VectorAverage( ent->curstate.mins, ent->curstate.maxs, ch->origin );
VectorAdd( ch->origin, ent->curstate.origin, ch->origin );
// setup radius
if( ent->model != NULL && ent->model->radius ) ch->radius = ent->model->radius;
else ch->radius = RadiusFromBounds( ent->curstate.mins, ent->curstate.maxs );
if( ent->model->type == mod_brush )
{
VectorAverage( ent->model->mins, ent->model->maxs, ch->origin );
VectorAdd( ent->origin, ch->origin, ch->origin );
}
else
{
VectorCopy( ent->origin, ch->origin );
}
return true;
}
@@ -1385,4 +1425,4 @@ void CL_ExtraUpdate( void )
{
clgame.dllFuncs.IN_Accumulate();
S_ExtraUpdate();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -16,11 +16,11 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "const.h"
#include "gl_local.h"
#include "library.h"
#include "input.h"
#include "server.h" // !!svgame.hInstance
#include "vid_common.h"
static MENUAPI GetMenuAPI;
static void UI_UpdateUserinfo( void );
gameui_static_t gameui;
@@ -47,7 +47,7 @@ void UI_UpdateMenu( float realtime )
gameui.globals->frametime = host.realframetime;
gameui.globals->demoplayback = cls.demoplayback;
gameui.globals->demorecording = cls.demorecording;
gameui.globals->allow_console = host.allow_console;
gameui.globals->developer = host.allow_console;
gameui.dllFuncs.pfnRedraw( realtime );
UI_UpdateUserinfo();
@@ -135,7 +135,162 @@ qboolean UI_IsVisible( void )
return gameui.dllFuncs.pfnIsVisible();
}
static void UI_DrawLogo( const char *filename, float x, float y, float width, float height )
/*
=======================
UI_AddTouchButtonToList
send button parameters to menu
=======================
*/
void UI_AddTouchButtonToList( const char *name, const char *texture, const char *command, unsigned char *color, int flags )
{
if( gameui.dllFuncs2.pfnAddTouchButtonToList )
{
gameui.dllFuncs2.pfnAddTouchButtonToList( name, texture, command, color, flags );
}
}
/*
=================
UI_ResetPing
notify gameui dll about latency reset
=================
*/
void UI_ResetPing( void )
{
if( gameui.dllFuncs2.pfnResetPing )
{
gameui.dllFuncs2.pfnResetPing( );
}
}
/*
=================
UI_ShowConnectionWarning
show connection warning dialog implemented by gameui dll
=================
*/
void UI_ShowConnectionWarning( void )
{
if( cls.state != ca_connected )
return;
if( Host_IsLocalClient() )
return;
if( ++cl.lostpackets == 8 )
{
CL_Disconnect();
if( gameui.dllFuncs2.pfnShowConnectionWarning )
{
gameui.dllFuncs2.pfnShowConnectionWarning();
}
Con_DPrintf( S_WARN "Too many lost packets! Showing Network options menu\n" );
}
}
/*
=================
UI_ShowConnectionWarning
show update dialog
=================
*/
void UI_ShowUpdateDialog( qboolean preferStore )
{
if( gameui.dllFuncs2.pfnShowUpdateDialog )
{
gameui.dllFuncs2.pfnShowUpdateDialog( preferStore );
}
Con_Printf( S_WARN "This version is not supported anymore. To continue, install latest engine version\n" );
}
/*
=================
UI_ShowConnectionWarning
show message box
=================
*/
void UI_ShowMessageBox( const char *text )
{
if( gameui.dllFuncs2.pfnShowMessageBox )
{
gameui.dllFuncs2.pfnShowMessageBox( text );
}
}
void UI_ConnectionProgress_Disconnect( void )
{
if( gameui.dllFuncs2.pfnConnectionProgress_Disconnect )
{
gameui.dllFuncs2.pfnConnectionProgress_Disconnect( );
}
}
void UI_ConnectionProgress_Download( const char *pszFileName, const char *pszServerName, const char *pszServerPath, int iCurrent, int iTotal, const char *comment )
{
if( !gameui.dllFuncs2.pfnConnectionProgress_Download )
return;
if( pszServerPath )
{
char serverpath[MAX_SYSPATH];
Q_snprintf( serverpath, sizeof( serverpath ), "%s%s", pszServerName, pszServerPath );
gameui.dllFuncs2.pfnConnectionProgress_Download( pszFileName, serverpath, iCurrent, iTotal, comment );
}
else
{
gameui.dllFuncs2.pfnConnectionProgress_Download( pszFileName, pszServerName, iCurrent, iTotal, comment );
}
}
void UI_ConnectionProgress_DownloadEnd( void )
{
if( gameui.dllFuncs2.pfnConnectionProgress_DownloadEnd )
{
gameui.dllFuncs2.pfnConnectionProgress_DownloadEnd( );
}
}
void UI_ConnectionProgress_Precache( void )
{
if( gameui.dllFuncs2.pfnConnectionProgress_Precache )
{
gameui.dllFuncs2.pfnConnectionProgress_Precache( );
}
}
void UI_ConnectionProgress_Connect( const char *server ) // NULL for local server
{
if( gameui.dllFuncs2.pfnConnectionProgress_Connect )
{
gameui.dllFuncs2.pfnConnectionProgress_Connect( server );
}
}
void UI_ConnectionProgress_ChangeLevel( void )
{
if( gameui.dllFuncs2.pfnConnectionProgress_ChangeLevel )
{
gameui.dllFuncs2.pfnConnectionProgress_ChangeLevel( );
}
}
void UI_ConnectionProgress_ParseServerInfo( const char *server )
{
if( gameui.dllFuncs2.pfnConnectionProgress_ParseServerInfo )
{
gameui.dllFuncs2.pfnConnectionProgress_ParseServerInfo( server );
}
}
static void GAME_EXPORT UI_DrawLogo( const char *filename, float x, float y, float width, float height )
{
static float cin_time;
static int last_frame = -1;
@@ -151,7 +306,7 @@ static void UI_DrawLogo( const char *filename, float x, float y, float width, fl
{
string path;
const char *fullpath;
// run cinematic if not
Q_snprintf( path, sizeof( path ), "media/%s", filename );
COM_DefaultExtension( path, ".avi" );
@@ -201,20 +356,20 @@ static void UI_DrawLogo( const char *filename, float x, float y, float width, fl
redraw = true;
}
R_DrawStretchRaw( x, y, width, height, gameui.logo_xres, gameui.logo_yres, cin_data, redraw );
ref.dllFuncs.R_DrawStretchRaw( x, y, width, height, gameui.logo_xres, gameui.logo_yres, cin_data, redraw );
}
static int UI_GetLogoWidth( void )
static int GAME_EXPORT UI_GetLogoWidth( void )
{
return gameui.logo_xres;
}
static int UI_GetLogoHeight( void )
static int GAME_EXPORT UI_GetLogoHeight( void )
{
return gameui.logo_yres;
}
static float UI_GetLogoLength( void )
static float GAME_EXPORT UI_GetLogoLength( void )
{
return gameui.logo_length;
}
@@ -235,7 +390,7 @@ static void UI_UpdateUserinfo( void )
player->bottomcolor = Q_atoi( Info_ValueForKey( player->userinfo, "bottomcolor" ));
host.userinfo_changed = false; // we got it
}
void Host_Credits( void )
{
if( !gameui.hInstance ) return;
@@ -248,7 +403,7 @@ static void UI_ConvertGameInfo( GAMEINFO *out, gameinfo_t *in )
Q_strncpy( out->startmap, in->startmap, sizeof( out->startmap ));
Q_strncpy( out->trainmap, in->trainmap, sizeof( out->trainmap ));
Q_strncpy( out->title, in->title, sizeof( out->title ));
Q_strncpy( out->version, va( "%g", in->version ), sizeof( out->version ));
Q_snprintf( out->version, sizeof( out->version ), "%g", in->version );
Q_strncpy( out->game_url, in->game_url, sizeof( out->game_url ));
Q_strncpy( out->update_url, in->update_url, sizeof( out->update_url ));
@@ -358,8 +513,8 @@ static void PIC_DrawGeneric( float x, float y, float width, float height, const
return;
PicAdjustSize( &x, &y, &width, &height );
R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, gameui.ds.gl_texturenum );
pglColor4ub( 255, 255, 255, 255 );
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, gameui.ds.gl_texturenum );
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
}
/*
@@ -374,13 +529,13 @@ pfnPIC_Load
=========
*/
static HIMAGE pfnPIC_Load( const char *szPicName, const byte *image_buf, long image_size, long flags )
static HIMAGE GAME_EXPORT pfnPIC_Load( const char *szPicName, const byte *image_buf, int image_size, int flags )
{
HIMAGE tx;
if( !COM_CheckString( szPicName ))
{
Con_Reportf( S_ERROR "CL_LoadImage: bad name!\n" );
Con_Reportf( S_ERROR "CL_LoadImage: refusing to load image with empty name\n" );
return 0;
}
@@ -388,7 +543,7 @@ static HIMAGE pfnPIC_Load( const char *szPicName, const byte *image_buf, long im
SetBits( flags, TF_IMAGE );
Image_SetForceFlags( IL_LOAD_DECAL ); // allow decal images for menu
tx = GL_LoadTexture( szPicName, image_buf, image_size, flags );
tx = ref.dllFuncs.GL_LoadTexture( szPicName, image_buf, image_size, flags );
Image_ClearForceFlags();
return tx;
@@ -400,7 +555,7 @@ pfnPIC_Width
=========
*/
static int pfnPIC_Width( HIMAGE hPic )
static int GAME_EXPORT pfnPIC_Width( HIMAGE hPic )
{
int picWidth;
@@ -415,7 +570,7 @@ pfnPIC_Height
=========
*/
static int pfnPIC_Height( HIMAGE hPic )
static int GAME_EXPORT pfnPIC_Height( HIMAGE hPic )
{
int picHeight;
@@ -430,14 +585,14 @@ pfnPIC_Set
=========
*/
void pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a )
void GAME_EXPORT pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a )
{
gameui.ds.gl_texturenum = hPic;
r = bound( 0, r, 255 );
g = bound( 0, g, 255 );
b = bound( 0, b, 255 );
a = bound( 0, a, 255 );
pglColor4ub( r, g, b, a );
ref.dllFuncs.Color4ub( r, g, b, a );
}
/*
@@ -446,9 +601,9 @@ pfnPIC_Draw
=========
*/
void pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc )
void GAME_EXPORT pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc )
{
GL_SetRenderMode( kRenderNormal );
ref.dllFuncs.GL_SetRenderMode( kRenderNormal );
PIC_DrawGeneric( x, y, width, height, prc );
}
@@ -458,9 +613,9 @@ pfnPIC_DrawTrans
=========
*/
void pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc )
void GAME_EXPORT pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc )
{
GL_SetRenderMode( kRenderTransTexture );
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
PIC_DrawGeneric( x, y, width, height, prc );
}
@@ -470,9 +625,9 @@ pfnPIC_DrawHoles
=========
*/
void pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc )
void GAME_EXPORT pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc )
{
GL_SetRenderMode( kRenderTransAlpha );
ref.dllFuncs.GL_SetRenderMode( kRenderTransAlpha );
PIC_DrawGeneric( x, y, width, height, prc );
}
@@ -482,9 +637,9 @@ pfnPIC_DrawAdditive
=========
*/
void pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc )
void GAME_EXPORT pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc )
{
GL_SetRenderMode( kRenderTransAdd );
ref.dllFuncs.GL_SetRenderMode( kRenderTransAdd );
PIC_DrawGeneric( x, y, width, height, prc );
}
@@ -494,7 +649,7 @@ pfnPIC_EnableScissor
=========
*/
static void pfnPIC_EnableScissor( int x, int y, int width, int height )
static void GAME_EXPORT pfnPIC_EnableScissor( int x, int y, int width, int height )
{
// check bounds
x = bound( 0, x, gameui.globals->scrWidth );
@@ -515,7 +670,7 @@ pfnPIC_DisableScissor
=========
*/
static void pfnPIC_DisableScissor( void )
static void GAME_EXPORT pfnPIC_DisableScissor( void )
{
gameui.ds.scissor_x = 0;
gameui.ds.scissor_width = 0;
@@ -530,16 +685,16 @@ pfnFillRGBA
=============
*/
static void pfnFillRGBA( int x, int y, int width, int height, int r, int g, int b, int a )
static void GAME_EXPORT pfnFillRGBA( int x, int y, int width, int height, int r, int g, int b, int a )
{
r = bound( 0, r, 255 );
g = bound( 0, g, 255 );
b = bound( 0, b, 255 );
a = bound( 0, a, 255 );
pglColor4ub( r, g, b, a );
GL_SetRenderMode( kRenderTransTexture );
R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, tr.whiteTexture );
pglColor4ub( 255, 255, 255, 255 );
ref.dllFuncs.Color4ub( r, g, b, a );
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, R_GetBuiltinTexture( REF_WHITE_TEXTURE ) );
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
}
/*
@@ -548,7 +703,7 @@ pfnClientCmd
=============
*/
static void pfnClientCmd( int exec_now, const char *szCmdString )
static void GAME_EXPORT pfnClientCmd( int exec_now, const char *szCmdString )
{
if( !szCmdString || !szCmdString[0] )
return;
@@ -566,7 +721,7 @@ pfnPlaySound
=============
*/
static void pfnPlaySound( const char *szSound )
static void GAME_EXPORT pfnPlaySound( const char *szSound )
{
if( !COM_CheckString( szSound )) return;
S_StartLocalSound( szSound, VOL_NORM, false );
@@ -579,7 +734,7 @@ pfnDrawCharacter
quakefont draw character
=============
*/
static void pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, int ulRGBA, HIMAGE hFont )
static void GAME_EXPORT pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, int ulRGBA, HIMAGE hFont )
{
rgba_t color;
float row, col, size;
@@ -597,7 +752,7 @@ static void pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, i
color[0] = (ulRGBA & 0xFF0000) >> 16;
color[1] = (ulRGBA & 0xFF00) >> 8;
color[2] = (ulRGBA & 0xFF) >> 0;
pglColor4ubv( color );
ref.dllFuncs.Color4ub( color[0], color[1], color[2], color[3] );
col = (ch & 15) * 0.0625f + (0.5f / 256.0f);
row = (ch >> 4) * 0.0625f + (0.5f / 256.0f);
@@ -612,19 +767,19 @@ static void pfnDrawCharacter( int ix, int iy, int iwidth, int iheight, int ch, i
if( gameui.ds.scissor_test && !PIC_Scissor( &x, &y, &width, &height, &s1, &t1, &s2, &t2 ))
return;
GL_SetRenderMode( kRenderTransTexture );
R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, hFont );
pglColor4ub( 255, 255, 255, 255 );
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, hFont );
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
}
/*
=============
UI_DrawConsoleString
drawing string like a console string
drawing string like a console string
=============
*/
static int UI_DrawConsoleString( int x, int y, const char *string )
static int GAME_EXPORT UI_DrawConsoleString( int x, int y, const char *string )
{
int drawLen;
@@ -642,7 +797,7 @@ pfnDrawSetTextColor
set color for anything
=============
*/
static void UI_DrawSetTextColor( int r, int g, int b, int alpha )
static void GAME_EXPORT UI_DrawSetTextColor( int r, int g, int b, int alpha )
{
// bound color and convert to byte
gameui.ds.textColor[0] = r;
@@ -658,7 +813,7 @@ pfnGetPlayerModel
for drawing playermodel previews
====================
*/
static cl_entity_t* pfnGetPlayerModel( void )
static cl_entity_t* GAME_EXPORT pfnGetPlayerModel( void )
{
return &gameui.playermodel;
}
@@ -670,7 +825,7 @@ pfnSetPlayerModel
for drawing playermodel previews
====================
*/
static void pfnSetPlayerModel( cl_entity_t *ent, const char *path )
static void GAME_EXPORT pfnSetPlayerModel( cl_entity_t *ent, const char *path )
{
ent->model = Mod_ForName( path, false, false );
ent->curstate.modelindex = MAX_MODELS; // unreachable index
@@ -683,10 +838,10 @@ pfnClearScene
for drawing playermodel previews
====================
*/
static void pfnClearScene( void )
static void GAME_EXPORT pfnClearScene( void )
{
R_PushScene();
R_ClearScene();
ref.dllFuncs.R_PushScene();
ref.dllFuncs.R_ClearScene();
}
/*
@@ -696,19 +851,23 @@ pfnRenderScene
for drawing playermodel previews
====================
*/
static void pfnRenderScene( const ref_viewpass_t *rvp )
static void GAME_EXPORT pfnRenderScene( const ref_viewpass_t *rvp )
{
ref_viewpass_t copy;
// to avoid division by zero
if( !rvp || rvp->fov_x <= 0.0f || rvp->fov_y <= 0.0f )
return;
// don't allow special modes from menu
((ref_viewpass_t *)&rvp)->flags = 0;
copy = *rvp;
R_Set2DMode( false );
R_RenderFrame( rvp );
R_Set2DMode( true );
R_PopScene();
// don't allow special modes from menu
copy.flags = 0;
ref.dllFuncs.R_Set2DMode( false );
GL_RenderFrame( &copy );
ref.dllFuncs.R_Set2DMode( true );
ref.dllFuncs.R_PopScene();
}
/*
@@ -718,9 +877,9 @@ pfnAddEntity
adding player model into visible list
====================
*/
static int pfnAddEntity( int entityType, cl_entity_t *ent )
static int GAME_EXPORT pfnAddEntity( int entityType, cl_entity_t *ent )
{
if( !R_AddEntity( ent, entityType ))
if( !ref.dllFuncs.R_AddEntity( ent, entityType ))
return false;
return true;
}
@@ -732,7 +891,7 @@ pfnClientJoin
send client connect
====================
*/
static void pfnClientJoin( const netadr_t adr )
static void GAME_EXPORT pfnClientJoin( const netadr_t adr )
{
Cbuf_AddText( va( "connect %s\n", NET_AdrToString( adr )));
}
@@ -744,7 +903,7 @@ pfnKeyGetOverstrikeMode
get global key overstrike state
====================
*/
static int pfnKeyGetOverstrikeMode( void )
static int GAME_EXPORT pfnKeyGetOverstrikeMode( void )
{
return host.key_overstrike;
}
@@ -756,7 +915,7 @@ pfnKeySetOverstrikeMode
set global key overstrike mode
====================
*/
static void pfnKeySetOverstrikeMode( int fActive )
static void GAME_EXPORT pfnKeySetOverstrikeMode( int fActive )
{
host.key_overstrike = fActive;
}
@@ -792,7 +951,7 @@ pfnMemFree
=========
*/
static void pfnMemFree( void *mem, const char *filename, const int fileline )
static void GAME_EXPORT pfnMemFree( void *mem, const char *filename, const int fileline )
{
_Mem_Free( mem, filename, fileline );
}
@@ -803,7 +962,7 @@ pfnGetGameInfo
=========
*/
static int pfnGetGameInfo( GAMEINFO *pgameinfo )
static int GAME_EXPORT pfnGetGameInfo( GAMEINFO *pgameinfo )
{
if( !pgameinfo ) return 0;
@@ -817,7 +976,7 @@ pfnGetGamesList
=========
*/
static GAMEINFO **pfnGetGamesList( int *numGames )
static GAMEINFO ** GAME_EXPORT pfnGetGamesList( int *numGames )
{
if( numGames ) *numGames = SI.numgames;
return gameui.modsInfo;
@@ -830,7 +989,7 @@ pfnGetFilesList
release prev search on a next call
=========
*/
static char **pfnGetFilesList( const char *pattern, int *numFiles, int gamedironly )
static char ** GAME_EXPORT pfnGetFilesList( const char *pattern, int *numFiles, int gamedironly )
{
static search_t *t = NULL;
@@ -865,17 +1024,29 @@ pfnCheckGameDll
=========
*/
int pfnCheckGameDll( void )
int GAME_EXPORT pfnCheckGameDll( void )
{
string dllpath;
void *hInst;
if( SV_Initialized( )) return true;
#if TARGET_OS_IPHONE
// loading server library drains too many ram
// so 512MB iPod Touch cannot even connect to
// to servers in cstrike
return true;
#endif
if(( hInst = COM_LoadLibrary( GI->game_dll, true, false )) != NULL )
if( svgame.hInstance )
return true;
COM_GetCommonLibraryPath( LIBRARY_SERVER, dllpath, sizeof( dllpath ));
if(( hInst = COM_LoadLibrary( dllpath, true, false )) != NULL )
{
COM_FreeLibrary( hInst );
COM_FreeLibrary( hInst ); // don't increase linker's reference counter
return true;
}
Con_Reportf( S_WARN "Could not load server library: %s\n", COM_GetLibraryError() );
return false;
}
@@ -885,7 +1056,7 @@ pfnChangeInstance
=========
*/
static void pfnChangeInstance( const char *newInstance, const char *szFinalMessage )
static void GAME_EXPORT pfnChangeInstance( const char *newInstance, const char *szFinalMessage )
{
if( !szFinalMessage ) szFinalMessage = "";
if( !newInstance || !*newInstance ) return;
@@ -899,10 +1070,10 @@ pfnHostEndGame
=========
*/
static void pfnHostEndGame( const char *szFinalMessage )
static void GAME_EXPORT pfnHostEndGame( const char *szFinalMessage )
{
if( !szFinalMessage ) szFinalMessage = "";
Host_EndGame( false, szFinalMessage );
Host_EndGame( false, "%s", szFinalMessage );
}
/*
@@ -911,13 +1082,44 @@ pfnStartBackgroundTrack
=========
*/
static void pfnStartBackgroundTrack( const char *introTrack, const char *mainTrack )
static void GAME_EXPORT pfnStartBackgroundTrack( const char *introTrack, const char *mainTrack )
{
S_StartBackgroundTrack( introTrack, mainTrack, 0, false );
}
static void GAME_EXPORT GL_ProcessTexture( int texnum, float gamma, int topColor, int bottomColor )
{
ref.dllFuncs.GL_ProcessTexture( texnum, gamma, topColor, bottomColor );
}
/*
=================
UI_ShellExecute
=================
*/
static void GAME_EXPORT UI_ShellExecute( const char *path, const char *parms, int shouldExit )
{
Platform_ShellExecute( path, parms );
if( shouldExit )
Sys_Quit();
}
/*
==============
pfnParseFile
legacy wrapper
==============
*/
static char *pfnParseFile( char *buf, char *token )
{
return COM_ParseFile( buf, token, INT_MAX );
}
// engine callbacks
static ui_enginefuncs_t gEngfuncs =
static ui_enginefuncs_t gEngfuncs =
{
pfnPIC_Load,
GL_FreeImage,
@@ -958,7 +1160,7 @@ static ui_enginefuncs_t gEngfuncs =
Con_DefaultColor,
pfnGetPlayerModel,
pfnSetPlayerModel,
pfnClearScene,
pfnClearScene,
pfnRenderScene,
pfnAddEntity,
Host_Error,
@@ -968,7 +1170,7 @@ static ui_enginefuncs_t gEngfuncs =
CL_Active,
pfnClientJoin,
COM_LoadFileForMe,
COM_ParseFile,
pfnParseFile,
COM_FreeFile,
Key_ClearStates,
Key_SetKeyDest,
@@ -988,7 +1190,7 @@ static ui_enginefuncs_t gEngfuncs =
CL_GetDemoComment,
pfnCheckGameDll,
pfnGetClipboardData,
Sys_ShellExecute,
UI_ShellExecute,
Host_WriteServerConfig,
pfnChangeInstance,
pfnStartBackgroundTrack,
@@ -1000,8 +1202,38 @@ static ui_enginefuncs_t gEngfuncs =
GL_ProcessTexture,
COM_CompareFileTime,
VID_GetModeString,
COM_SaveFile,
FS_Delete,
(void*)COM_SaveFile,
(void*)FS_Delete
};
static void pfnEnableTextInput( int enable )
{
Key_EnableTextInput( enable, false );
}
static int pfnGetRenderers( unsigned int num, char *shortName, size_t size1, char *readableName, size_t size2 )
{
if( num >= ref.numRenderers )
return 0;
if( shortName && size1 )
Q_strncpy( shortName, ref.shortNames[num], size1 );
if( readableName && size2 )
Q_strncpy( readableName, ref.readableNames[num], size2 );
return 1;
}
static ui_extendedfuncs_t gExtendedfuncs =
{
pfnEnableTextInput,
Con_UtfProcessChar,
Con_UtfMoveLeft,
Con_UtfMoveRight,
pfnGetRenderers,
Sys_DoubleTime,
_COM_ParseFileSafe
};
void UI_UnloadProgs( void )
@@ -1024,7 +1256,12 @@ void UI_UnloadProgs( void )
qboolean UI_LoadProgs( void )
{
static ui_enginefuncs_t gpEngfuncs;
static ui_extendedfuncs_t gpExtendedfuncs;
static ui_globalvars_t gpGlobals;
UIEXTENEDEDAPI GetExtAPI;
UITEXTAPI GiveTextApi;
MENUAPI GetMenuAPI;
string dllpath;
int i;
if( gameui.hInstance ) UI_UnloadProgs();
@@ -1032,12 +1269,27 @@ qboolean UI_LoadProgs( void )
// setup globals
gameui.globals = &gpGlobals;
if(( gameui.hInstance = COM_LoadLibrary( va( "%s/menu.dll", GI->dll_path ), false, false )) == NULL )
COM_GetCommonLibraryPath( LIBRARY_GAMEUI, dllpath, sizeof( dllpath ));
if(!( gameui.hInstance = COM_LoadLibrary( dllpath, false, false )))
{
if(( gameui.hInstance = COM_LoadLibrary( "menu.dll", false, true )) == NULL )
string path = OS_LIB_PREFIX "menu." OS_LIB_EXT;
FS_AllowDirectPaths( true );
// no use to load it from engine directory, as library loader
// that implements internal gamelibs already knows how to load it
#ifndef XASH_INTERNAL_GAMELIBS
if(!( gameui.hInstance = COM_LoadLibrary( path, false, true )))
#endif
{
FS_AllowDirectPaths( false );
return false;
}
}
FS_AllowDirectPaths( false );
if(( GetMenuAPI = (MENUAPI)COM_GetProcAddress( gameui.hInstance, "GetMenuAPI" )) == NULL )
{
COM_FreeLibrary( gameui.hInstance );
@@ -1046,6 +1298,9 @@ qboolean UI_LoadProgs( void )
return false;
}
gameui.use_text_api = false;
// make local copy of engfuncs to prevent overwrite it with user dll
memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs ));
@@ -1060,6 +1315,41 @@ qboolean UI_LoadProgs( void )
return false;
}
// make local copy of engfuncs to prevent overwrite it with user dll
memcpy( &gpExtendedfuncs, &gExtendedfuncs, sizeof( gExtendedfuncs ));
memset( &gameui.dllFuncs2, 0, sizeof( gameui.dllFuncs2 ));
// try to initialize new extended API
if( ( GetExtAPI = (UIEXTENEDEDAPI)COM_GetProcAddress( gameui.hInstance, "GetExtAPI" ) ) )
{
Con_Reportf( "UI_LoadProgs: extended Menu API found\n" );
if( GetExtAPI( MENU_EXTENDED_API_VERSION, &gameui.dllFuncs2, &gpExtendedfuncs ) )
{
Con_Reportf( "UI_LoadProgs: extended Menu API initialized\n" );
gameui.use_text_api = true;
}
}
else // otherwise, fallback to old and deprecated extensions
{
if( ( GiveTextApi = (UITEXTAPI)COM_GetProcAddress( gameui.hInstance, "GiveTextAPI" ) ) )
{
Con_Reportf( "UI_LoadProgs: extended text API found\n" );
Con_Reportf( S_WARN "Text API is deprecated! If you are mod developer, consider moving to Extended Menu API!\n" );
if( GiveTextApi( &gpExtendedfuncs ) ) // they are binary compatible, so we can just pass extended funcs API to menu
{
Con_Reportf( "UI_LoadProgs: extended text API initialized\n" );
gameui.use_text_api = true;
}
}
gameui.dllFuncs2.pfnAddTouchButtonToList = (ADDTOUCHBUTTONTOLIST)COM_GetProcAddress( gameui.hInstance, "AddTouchButtonToList" );
if( gameui.dllFuncs2.pfnAddTouchButtonToList )
{
Con_Reportf( "UI_LoadProgs: AddTouchButtonToList call found\n" );
Con_Reportf( S_WARN "AddTouchButtonToList is deprecated! If you are mod developer, consider moving to Extended Menu API!\n" );
}
}
Cvar_FullSet( "host_gameuiloaded", "1", FCVAR_READ_ONLY );
// setup gameinfo
@@ -1072,10 +1362,10 @@ qboolean UI_LoadProgs( void )
UI_ConvertGameInfo( &gameui.gameInfo, SI.GameInfo ); // current gameinfo
// setup globals
gameui.globals->allow_console = host.allow_console;
gameui.globals->developer = host.allow_console;
// initialize game
gameui.dllFuncs.pfnInit();
return true;
}
}

File diff suppressed because it is too large Load Diff

137
engine/client/cl_mobile.c Normal file
View File

@@ -0,0 +1,137 @@
/*
cl_mobile.c - common mobile interface
Copyright (C) 2015 a1batross
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "common.h"
#include "client.h"
#include "mobility_int.h"
#include "library.h"
#include "input.h"
#include "platform/platform.h"
mobile_engfuncs_t *gMobileEngfuncs;
convar_t *vibration_length;
convar_t *vibration_enable;
static void pfnVibrate( float life, char flags )
{
if( !vibration_enable->value )
return;
if( life < 0.0f )
{
Con_Reportf( S_WARN "Negative vibrate time: %f\n", life );
return;
}
//Con_Reportf( "Vibrate: %f %d\n", life, flags );
// here goes platform-specific backends
Platform_Vibrate( life * vibration_length->value, flags );
}
static void Vibrate_f( void )
{
if( Cmd_Argc() != 2 )
{
Msg( S_USAGE "vibrate <time>\n" );
return;
}
pfnVibrate( Q_atof( Cmd_Argv(1) ), VIBRATE_NORMAL );
}
static void pfnEnableTextInput( int enable )
{
Key_EnableTextInput( enable, false );
}
static int pfnDrawScaledCharacter( int x, int y, int number, int r, int g, int b, float scale )
{
int width = clgame.scrInfo.charWidths[number] * scale * hud_scale->value;
int height = clgame.scrInfo.iCharHeight * scale * hud_scale->value;
if( !cls.creditsFont.valid )
return 0;
x *= hud_scale->value;
y *= hud_scale->value;
number &= 255;
number = Con_UtfProcessChar( number );
if( number < 32 )
return 0;
if( y < -height )
return 0;
pfnPIC_Set( cls.creditsFont.hFontTexture, r, g, b, 255 );
pfnPIC_DrawAdditive( x, y, width, height, &cls.creditsFont.fontRc[number] );
return width;
}
static void *pfnGetNativeObject( const char *obj )
{
if( !obj )
return NULL;
// Backend should consider that obj is case-sensitive
return Platform_GetNativeObject( obj );
}
static mobile_engfuncs_t gpMobileEngfuncs =
{
MOBILITY_API_VERSION,
pfnVibrate,
pfnEnableTextInput,
Touch_AddClientButton,
Touch_AddDefaultButton,
Touch_HideButtons,
Touch_RemoveButton,
(void*)Touch_SetClientOnly,
Touch_ResetDefaultButtons,
pfnDrawScaledCharacter,
Sys_Warn,
pfnGetNativeObject,
ID_SetCustomClientID,
_COM_ParseFileSafe
};
qboolean Mobile_Init( void )
{
qboolean success = false;
pfnMobilityInterface ExportToClient;
// find a mobility interface
ExportToClient = COM_GetProcAddress( clgame.hInstance, MOBILITY_CLIENT_EXPORT );
gMobileEngfuncs = &gpMobileEngfuncs;
if( ExportToClient && !ExportToClient( gMobileEngfuncs ) )
success = true;
Cmd_AddCommand( "vibrate", (xcommand_t)Vibrate_f, "Vibrate for specified time");
vibration_length = Cvar_Get( "vibration_length", "1.0", FCVAR_ARCHIVE, "Vibration length");
vibration_enable = Cvar_Get( "vibration_enable", "1", FCVAR_ARCHIVE, "Enable vibration");
return success;
}
void Mobile_Shutdown( void )
{
Cmd_RemoveCommand( "vibrate" );
}

View File

@@ -15,24 +15,30 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "gl_local.h"
#include "kbutton.h"
#if XASH_LOW_MEMORY == 0
#define NET_TIMINGS 1024
#elif XASH_LOW_MEMORY == 1
#define NET_TIMINGS 256
#elif XASH_LOW_MEMORY == 2
#define NET_TIMINGS 64
#endif
#define NET_TIMINGS_MASK (NET_TIMINGS - 1)
#define LATENCY_AVG_FRAC 0.5
#define FRAMERATE_AVG_FRAC 0.5
#define PACKETLOSS_AVG_FRAC 0.5
#define PACKETCHOKE_AVG_FRAC 0.5
#define LATENCY_AVG_FRAC 0.5f
#define FRAMERATE_AVG_FRAC 0.5f
#define PACKETLOSS_AVG_FRAC 0.5f
#define PACKETCHOKE_AVG_FRAC 0.5f
#define NETGRAPH_LERP_HEIGHT 24
#define NETGRAPH_NET_COLORS 5
#define NUM_LATENCY_SAMPLES 8
convar_t *net_graph;
convar_t *net_graphpos;
convar_t *net_graphwidth;
convar_t *net_graphheight;
convar_t *net_graphsolid;
convar_t *net_scale;
static convar_t *net_graphpos;
static convar_t *net_graphwidth;
static convar_t *net_graphheight;
static convar_t *net_graphsolid;
static convar_t *net_scale;
static struct packet_latency_t
{
@@ -75,12 +81,12 @@ NetGraph_FillRGBA shortcut
*/
static void NetGraph_DrawRect( wrect_t *rect, byte colors[4] )
{
pglColor4ubv( colors ); // color for this quad
ref.dllFuncs.Color4ub( colors[0], colors[1], colors[2], colors[3] ); // color for this quad
pglVertex2f( rect->left, rect->top );
pglVertex2f( rect->left + rect->right, rect->top );
pglVertex2f( rect->left + rect->right, rect->top + rect->bottom );
pglVertex2f( rect->left, rect->top + rect->bottom );
ref.dllFuncs.Vertex3f( rect->left, rect->top, 0 );
ref.dllFuncs.Vertex3f( rect->left + rect->right, rect->top, 0 );
ref.dllFuncs.Vertex3f( rect->left + rect->right, rect->top + rect->bottom, 0 );
ref.dllFuncs.Vertex3f( rect->left, rect->top + rect->bottom, 0 );
}
/*
@@ -90,7 +96,7 @@ NetGraph_AtEdge
edge detect
==========
*/
qboolean NetGraph_AtEdge( int x, int width )
static qboolean NetGraph_AtEdge( int x, int width )
{
if( x > 3 )
{
@@ -108,38 +114,38 @@ NetGraph_InitColors
init netgraph colors
==========
*/
void NetGraph_InitColors( void )
static void NetGraph_InitColors( void )
{
byte mincolor[2][3];
byte maxcolor[2][3];
float dc[2][3];
int i, hfrac;
int i, hfrac;
float f;
mincolor[0][0] = 63;
mincolor[0][1] = 0;
mincolor[0][2] = 100;
maxcolor[0][0] = 0;
maxcolor[0][1] = 63;
maxcolor[0][2] = 255;
mincolor[1][0] = 255;
mincolor[1][1] = 127;
mincolor[1][2] = 0;
maxcolor[1][0] = 250;
maxcolor[1][1] = 0;
maxcolor[1][2] = 0;
for( i = 0; i < 3; i++ )
{
dc[0][i] = (float)(maxcolor[0][i] - mincolor[0][i]);
dc[1][i] = (float)(maxcolor[1][i] - mincolor[1][i]);
}
hfrac = NETGRAPH_LERP_HEIGHT / 3;
for( i = 0; i < NETGRAPH_LERP_HEIGHT; i++ )
{
if( i < hfrac )
@@ -162,7 +168,7 @@ NetGraph_GetFrameData
get frame data info, like chokes, packet losses, also update graph, packet and cmdinfo
==========
*/
void NetGraph_GetFrameData( float *latency, int *latency_count )
static void NetGraph_GetFrameData( float *latency, int *latency_count )
{
int i, choke_count = 0, loss_count = 0;
double newtime = Sys_DoubleTime();
@@ -204,7 +210,7 @@ void NetGraph_GetFrameData( float *latency, int *latency_count )
else
{
int frame_latency = Q_min( 1.0f, f->latency );
p->latency = (( frame_latency + 0.1 ) / 1.1 ) * ( net_graphheight->value - NETGRAPH_LERP_HEIGHT - 2 );
p->latency = (( frame_latency + 0.1f ) / 1.1f ) * ( net_graphheight->value - NETGRAPH_LERP_HEIGHT - 2 );
if( i > cls.netchan.incoming_sequence - NUM_LATENCY_SAMPLES )
{
@@ -230,12 +236,12 @@ void NetGraph_GetFrameData( float *latency, int *latency_count )
}
// packet loss
loss = 100.0 * (float)loss_count / CL_UPDATE_BACKUP;
packet_loss = PACKETLOSS_AVG_FRAC * packet_loss + ( 1.0 - PACKETLOSS_AVG_FRAC ) * loss;
loss = 100.0f * (float)loss_count / CL_UPDATE_BACKUP;
packet_loss = PACKETLOSS_AVG_FRAC * packet_loss + ( 1.0f - PACKETLOSS_AVG_FRAC ) * loss;
// packet choke
choke = 100.0 * (float)choke_count / CL_UPDATE_BACKUP;
packet_choke = PACKETCHOKE_AVG_FRAC * packet_choke + ( 1.0 - PACKETCHOKE_AVG_FRAC ) * choke;
choke = 100.0f * (float)choke_count / CL_UPDATE_BACKUP;
packet_choke = PACKETCHOKE_AVG_FRAC * packet_choke + ( 1.0f - PACKETCHOKE_AVG_FRAC ) * choke;
}
/*
@@ -244,7 +250,7 @@ NetGraph_DrawTimes
===========
*/
void NetGraph_DrawTimes( wrect_t rect, int x, int w )
static void NetGraph_DrawTimes( wrect_t rect, int x, int w )
{
int i, j, extrap_point = NETGRAPH_LERP_HEIGHT / 3, a, h;
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
@@ -319,7 +325,7 @@ NetGraph_DrawHatches
===========
*/
void NetGraph_DrawHatches( int x, int y )
static void NetGraph_DrawHatches( int x, int y )
{
int ystep = (int)( 10.0f / net_scale->value );
byte colorminor[4] = { 0, 63, 63, 200 };
@@ -348,7 +354,7 @@ NetGraph_DrawTextFields
===========
*/
void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, float avg, int packet_loss, int packet_choke )
static void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, float avg, int packet_loss, int packet_choke, int graphtype )
{
static int lastout;
rgba_t colors = { 0.9 * 255, 0.9 * 255, 0.7 * 255, 255 };
@@ -366,12 +372,12 @@ void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, floa
avg -= 1000.0f / cl_updaterate->value;
// can't be below zero
avg = Q_max( 0.0, avg );
avg = Q_max( 0.0f, avg );
}
else avg = 0.0;
// move rolling average
framerate = FRAMERATE_AVG_FRAC * host.frametime + ( 1.0 - FRAMERATE_AVG_FRAC ) * framerate;
framerate = FRAMERATE_AVG_FRAC * host.frametime + ( 1.0f - FRAMERATE_AVG_FRAC ) * framerate;
Con_SetFont( 0 );
if( framerate > 0.0f )
@@ -395,16 +401,16 @@ void NetGraph_DrawTextFields( int x, int y, int w, wrect_t rect, int count, floa
Con_DrawString( x, y, va( "out: %i %.2f k/s", out, cls.netchan.flow[FLOW_OUTGOING].avgkbytespersec ), colors );
y += 15;
if( net_graph->value > 2 )
if( graphtype > 2 )
{
int loss = (int)(( packet_loss + PACKETLOSS_AVG_FRAC ) - 0.01 );
int choke = (int)(( packet_choke + PACKETCHOKE_AVG_FRAC ) - 0.01 );
int loss = (int)(( packet_loss + PACKETLOSS_AVG_FRAC ) - 0.01f );
int choke = (int)(( packet_choke + PACKETCHOKE_AVG_FRAC ) - 0.01f );
Con_DrawString( x, y, va( "loss: %i choke: %i", loss, choke ), colors );
}
}
if( net_graph->value < 3 )
if( graphtype < 3 )
Con_DrawString( ptx, pty, va( "%i/s", (int)cl_cmdrate->value ), colors );
Con_DrawString( ptx, last_y, va( "%i/s" , (int)cl_updaterate->value ), colors );
@@ -418,7 +424,7 @@ NetGraph_DrawDataSegment
===========
*/
int NetGraph_DrawDataSegment( wrect_t *fill, int bytes, byte r, byte g, byte b, byte a )
static int NetGraph_DrawDataSegment( wrect_t *fill, int bytes, byte r, byte g, byte b, byte a )
{
float h = bytes / net_scale->value;
byte colors[4] = { r, g, b, a };
@@ -445,7 +451,7 @@ NetGraph_ColorForHeight
color based on packet latency
===========
*/
void NetGraph_ColorForHeight( struct packet_latency_t *packet, byte color[4], int *ping )
static void NetGraph_ColorForHeight( struct packet_latency_t *packet, byte color[4], int *ping )
{
switch( packet->latency )
{
@@ -480,7 +486,7 @@ NetGraph_DrawDataUsage
===========
*/
void NetGraph_DrawDataUsage( int x, int y, int w )
static void NetGraph_DrawDataUsage( int x, int y, int w, int graphtype )
{
int a, i, h, lastvalidh = 0, ping;
int pingheight = net_graphheight->value - NETGRAPH_LERP_HEIGHT - 2;
@@ -535,7 +541,7 @@ void NetGraph_DrawDataUsage( int x, int y, int w )
if( NetGraph_AtEdge( a, w ))
NetGraph_DrawRect( &fill, color );
if( net_graph->value < 2 )
if( graphtype < 2 )
continue;
color[0] = color[1] = color[2] = color[3] = 255;
@@ -582,7 +588,7 @@ void NetGraph_DrawDataUsage( int x, int y, int w )
continue;
}
if( net_graph->value >= 2 )
if( graphtype >= 2 )
NetGraph_DrawHatches( x, y - net_graphheight->value - 1 );
}
@@ -592,11 +598,11 @@ NetGraph_GetScreenPos
===========
*/
void NetGraph_GetScreenPos( wrect_t *rect, int *w, int *x, int *y )
static void NetGraph_GetScreenPos( wrect_t *rect, int *w, int *x, int *y )
{
rect->left = rect->top = 0;
rect->right = glState.width;
rect->bottom = glState.height;
rect->right = refState.width;
rect->bottom = refState.height;
*w = Q_min( NET_TIMINGS, net_graphwidth->value );
if( rect->right < *w + 10 )
@@ -631,6 +637,8 @@ void SCR_DrawNetGraph( void )
float avg_ping;
int ping_count;
int w, x, y;
kbutton_t *in_graph;
int graphtype;
if( !host.allow_console )
return;
@@ -638,8 +646,20 @@ void SCR_DrawNetGraph( void )
if( cls.state != ca_active )
return;
if( !net_graph->value )
in_graph = clgame.dllFuncs.KB_Find( "in_graph" );
if( in_graph->state & 1 )
{
graphtype = 2;
}
else if( net_graph->value != 0.0f )
{
graphtype = (int)net_graph->value;
}
else
{
return;
}
if( net_scale->value <= 0 )
Cvar_SetValue( "net_scale", 0.1f );
@@ -648,24 +668,21 @@ void SCR_DrawNetGraph( void )
NetGraph_GetFrameData( &avg_ping, &ping_count );
NetGraph_DrawTextFields( x, y, w, rect, ping_count, avg_ping, packet_loss, packet_choke );
NetGraph_DrawTextFields( x, y, w, rect, ping_count, avg_ping, packet_loss, packet_choke, graphtype );
if( net_graph->value < 3 )
if( graphtype < 3 )
{
pglEnable( GL_BLEND );
pglDisable( GL_TEXTURE_2D );
pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
pglBlendFunc( GL_SRC_ALPHA, GL_ONE );
pglBegin( GL_QUADS ); // draw all the fills as a long solid sequence of quads for speedup reasons
ref.dllFuncs.GL_SetRenderMode( kRenderTransAdd );
ref.dllFuncs.GL_Bind( XASH_TEXTURE0, R_GetBuiltinTexture( REF_WHITE_TEXTURE ) );
ref.dllFuncs.Begin( TRI_QUADS ); // draw all the fills as a long solid sequence of quads for speedup reasons
// NOTE: fill colors without texture at this point
NetGraph_DrawDataUsage( x, y, w );
NetGraph_DrawDataUsage( x, y, w, graphtype );
NetGraph_DrawTimes( rect, x, w );
pglEnd();
pglColor4ub( 255, 255, 255, 255 );
pglEnable( GL_TEXTURE_2D );
pglDisable( GL_BLEND );
ref.dllFuncs.End();
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
ref.dllFuncs.GL_SetRenderMode( kRenderNormal );
}
}
@@ -680,4 +697,4 @@ void CL_InitNetgraph( void )
packet_loss = packet_choke = 0.0;
NetGraph_InitColors();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,7 @@ CL_PushPMStates
=============
*/
void CL_PushPMStates( void )
void GAME_EXPORT CL_PushPMStates( void )
{
if( clgame.pushed ) return;
clgame.oldphyscount = clgame.pmove->numphysent;
@@ -60,7 +60,7 @@ CL_PopPMStates
=============
*/
void CL_PopPMStates( void )
void GAME_EXPORT CL_PopPMStates( void )
{
if( !clgame.pushed ) return;
clgame.pmove->numphysent = clgame.oldphyscount;
@@ -74,7 +74,7 @@ CL_PushTraceBounds
=============
*/
void CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs )
void GAME_EXPORT CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs )
{
hullnum = bound( 0, hullnum, 3 );
VectorCopy( mins, clgame.pmove->player_mins[hullnum] );
@@ -87,7 +87,7 @@ CL_PopTraceBounds
=============
*/
void CL_PopTraceBounds( void )
void GAME_EXPORT CL_PopTraceBounds( void )
{
memcpy( clgame.pmove->player_mins, host.player_mins, sizeof( host.player_mins ));
memcpy( clgame.pmove->player_maxs, host.player_maxs, sizeof( host.player_maxs ));
@@ -159,7 +159,7 @@ void CL_SetIdealPitch( void )
top[0] = cl.simorg[0] + cosval * (i + 3.0f) * 12.0f;
top[1] = cl.simorg[1] + sinval * (i + 3.0f) * 12.0f;
top[2] = cl.simorg[2] + cl.viewheight[2];
bottom[0] = top[0];
bottom[1] = top[1];
bottom[2] = top[2] - 160.0f;
@@ -170,10 +170,10 @@ void CL_SetIdealPitch( void )
if( tr.fraction == 1.0f )
return; // near a dropoff
z[i] = top[2] + tr.fraction * (bottom[2] - top[2]);
}
dir = 0;
steps = 0;
@@ -186,16 +186,16 @@ void CL_SetIdealPitch( void )
if( dir && ( step-dir > ON_EPSILON || step-dir < -ON_EPSILON ))
return; // mixed changes
steps++;
steps++;
dir = step;
}
if( !dir )
{
cl.local.idealpitch = 0.0f;
return;
}
if( steps < 2 ) return;
cl.local.idealpitch = -dir * cl_idealpitchscale->value;
}
@@ -216,7 +216,7 @@ qboolean CL_PlayerTeleported( local_state_t *from, local_state_t *to )
VectorSubtract( to->playerstate.origin, from->playerstate.origin, delta );
// compute potential max movement in units per frame and compare with entity movement
maxlen = ( clgame.movevars.maxvelocity * ( 1.0 / GAME_FPS ));
maxlen = ( clgame.movevars.maxvelocity * ( 1.0f / GAME_FPS ));
len = VectorLength( delta );
return (len > maxlen);
@@ -264,7 +264,9 @@ void CL_CheckPredictionError( void )
// save for error interpolation
VectorCopy( delta, cl.local.prediction_error );
if( dist > MIN_CORRECTION_DISTANCE )
// GoldSrc checks for singleplayer
// we would check for local server
if( dist > MIN_CORRECTION_DISTANCE && !SV_Active() )
cls.correction_time = cl_smoothtime->value;
}
}
@@ -280,7 +282,7 @@ then with clipping against them.
This sets up the first phase.
=============
*/
void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient )
void GAME_EXPORT CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient )
{
entity_state_t *state;
predicted_player_t *player;
@@ -538,7 +540,7 @@ pmove must be setup with world and solid entity hulls before calling
(via CL_PredictMove)
===============
*/
void CL_SetSolidPlayers( int playernum )
void GAME_EXPORT CL_SetSolidPlayers( int playernum )
{
entity_state_t *state;
predicted_player_t *player;
@@ -594,7 +596,7 @@ CL_WaterEntity
=============
*/
int CL_WaterEntity( const float *rgflPos )
int GAME_EXPORT CL_WaterEntity( const float *rgflPos )
{
physent_t *pe;
hull_t *hull;
@@ -627,7 +629,7 @@ int CL_WaterEntity( const float *rgflPos )
if( FBitSet( pe->model->flags, MODEL_HAS_ORIGIN ) && !VectorIsNull( pe->angles ))
{
matrix4x4 matrix;
Matrix4x4_CreateFromEntity( matrix, pe->angles, offset, 1.0f );
Matrix4x4_VectorITransform( matrix, rgflPos, test );
}
@@ -655,7 +657,7 @@ pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags )
pmtrace_t tr;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = 2;
clgame.pmove->usehull = 2;
tr = PM_PlayerTraceExt( clgame.pmove, start, end, flags, clgame.pmove->numphysent, clgame.pmove->physents, -1, NULL );
clgame.pmove->usehull = old_usehull;
@@ -675,7 +677,7 @@ pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags )
static pmtrace_t tr;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = 2;
clgame.pmove->usehull = 2;
tr = PM_PlayerTraceExt( clgame.pmove, start, end, flags, clgame.pmove->numvisent, clgame.pmove->visents, -1, NULL );
clgame.pmove->usehull = old_usehull;
@@ -699,17 +701,17 @@ cl_entity_t *CL_GetWaterEntity( const float *rgflPos )
return CL_GetEntityByIndex( entnum );
}
int CL_TestLine( const vec3_t start, const vec3_t end, int flags )
int GAME_EXPORT CL_TestLine( const vec3_t start, const vec3_t end, int flags )
{
return PM_TestLineExt( clgame.pmove, clgame.pmove->physents, clgame.pmove->numphysent, start, end, flags );
}
static int pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace )
static int GAME_EXPORT pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace )
{
return PM_TestPlayerPosition( clgame.pmove, pos, ptrace, NULL );
}
static void pfnStuckTouch( int hitent, pmtrace_t *tr )
static void GAME_EXPORT pfnStuckTouch( int hitent, pmtrace_t *tr )
{
int i;
@@ -728,7 +730,7 @@ static void pfnStuckTouch( int hitent, pmtrace_t *tr )
clgame.pmove->touchindex[clgame.pmove->numtouch++] = *tr;
}
static int pfnPointContents( float *p, int *truecontents )
static int GAME_EXPORT pfnPointContents( float *p, int *truecontents )
{
int cont, truecont;
@@ -740,28 +742,28 @@ static int pfnPointContents( float *p, int *truecontents )
return cont;
}
static int pfnTruePointContents( float *p )
static int GAME_EXPORT pfnTruePointContents( float *p )
{
return PM_TruePointContents( clgame.pmove, p );
}
static int pfnHullPointContents( struct hull_s *hull, int num, float *p )
static int GAME_EXPORT pfnHullPointContents( struct hull_s *hull, int num, float *p )
{
return PM_HullPointContents( hull, num, p );
}
static pmtrace_t pfnPlayerTrace( float *start, float *end, int traceFlags, int ignore_pe )
static pmtrace_t GAME_EXPORT pfnPlayerTrace( float *start, float *end, int traceFlags, int ignore_pe )
{
return PM_PlayerTraceExt( clgame.pmove, start, end, traceFlags, clgame.pmove->numphysent, clgame.pmove->physents, ignore_pe, NULL );
}
static pmtrace_t *pfnTraceLine( float *start, float *end, int flags, int usehull, int ignore_pe )
pmtrace_t *PM_TraceLine( float *start, float *end, int flags, int usehull, int ignore_pe )
{
static pmtrace_t tr;
int old_usehull;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = usehull;
clgame.pmove->usehull = usehull;
switch( flags )
{
@@ -783,7 +785,7 @@ static hull_t *pfnHullForBsp( physent_t *pe, float *offset )
return PM_HullForBsp( pe, clgame.pmove, offset );
}
static float pfnTraceModel( physent_t *pe, float *start, float *end, trace_t *trace )
static float GAME_EXPORT pfnTraceModel( physent_t *pe, float *start, float *end, trace_t *trace )
{
int old_usehull;
vec3_t start_l, end_l;
@@ -838,9 +840,9 @@ static const char *pfnTraceTexture( int ground, float *vstart, float *vend )
pe = &clgame.pmove->physents[ground];
return PM_TraceTexture( pe, vstart, vend );
}
}
static void pfnPlaySound( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch )
static void GAME_EXPORT pfnPlaySound( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch )
{
if( !clgame.pmove->runfuncs )
return;
@@ -848,18 +850,18 @@ static void pfnPlaySound( int channel, const char *sample, float volume, float a
S_StartSound( NULL, clgame.pmove->player_index + 1, channel, S_RegisterSound( sample ), volume, attenuation, pitch, fFlags );
}
static void pfnPlaybackEventFull( int flags, int clientindex, word eventindex, float delay, float *origin,
static void GAME_EXPORT pfnPlaybackEventFull( int flags, int clientindex, word eventindex, float delay, float *origin,
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 )
{
CL_PlaybackEvent( flags, NULL, eventindex, delay, origin, angles, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2 );
}
static pmtrace_t pfnPlayerTraceEx( float *start, float *end, int traceFlags, pfnIgnore pmFilter )
static pmtrace_t GAME_EXPORT pfnPlayerTraceEx( float *start, float *end, int traceFlags, pfnIgnore pmFilter )
{
return PM_PlayerTraceExt( clgame.pmove, start, end, traceFlags, clgame.pmove->numphysent, clgame.pmove->physents, -1, pmFilter );
}
static int pfnTestPlayerPositionEx( float *pos, pmtrace_t *ptrace, pfnIgnore pmFilter )
static int GAME_EXPORT pfnTestPlayerPositionEx( float *pos, pmtrace_t *ptrace, pfnIgnore pmFilter )
{
return PM_TestPlayerPosition( clgame.pmove, pos, ptrace, pmFilter );
}
@@ -870,7 +872,7 @@ static pmtrace_t *pfnTraceLineEx( float *start, float *end, int flags, int usehu
int old_usehull;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = usehull;
clgame.pmove->usehull = usehull;
switch( flags )
{
@@ -887,17 +889,6 @@ static pmtrace_t *pfnTraceLineEx( float *start, float *end, int flags, int usehu
return &tr;
}
static struct msurface_s *pfnTraceSurface( int ground, float *vstart, float *vend )
{
physent_t *pe;
if( ground < 0 || ground >= clgame.pmove->numphysent )
return NULL; // bad ground
pe = &clgame.pmove->physents[ground];
return PM_TraceSurface( pe, vstart, vend );
}
/*
===============
CL_InitClientMove
@@ -928,7 +919,7 @@ void CL_InitClientMove( void )
// common utilities
clgame.pmove->PM_Info_ValueForKey = Info_ValueForKey;
clgame.pmove->PM_Particle = CL_Particle;
clgame.pmove->PM_Particle = CL_Particle; // ref should be initialized here already
clgame.pmove->PM_TestPlayerPosition = pfnTestPlayerPosition;
clgame.pmove->Con_NPrintf = Con_NPrintf;
clgame.pmove->Con_DPrintf = Con_DPrintf;
@@ -937,14 +928,14 @@ void CL_InitClientMove( void )
clgame.pmove->PM_StuckTouch = pfnStuckTouch;
clgame.pmove->PM_PointContents = pfnPointContents;
clgame.pmove->PM_TruePointContents = pfnTruePointContents;
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
clgame.pmove->PM_TraceLine = pfnTraceLine;
clgame.pmove->PM_TraceLine = PM_TraceLine;
clgame.pmove->RandomLong = COM_RandomLong;
clgame.pmove->RandomFloat = COM_RandomFloat;
clgame.pmove->PM_GetModelType = pfnGetModelType;
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
clgame.pmove->PM_HullForBsp = pfnHullForBsp;
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
clgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp;
clgame.pmove->PM_TraceModel = pfnTraceModel;
clgame.pmove->COM_FileSize = COM_FileSize;
clgame.pmove->COM_LoadFile = COM_LoadFile;
@@ -1030,7 +1021,7 @@ void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, q
VectorCopy( cd->vuser2, pmove->vuser2 );
VectorCopy( cd->vuser3, pmove->vuser3 );
VectorCopy( cd->vuser4, pmove->vuser4 );
pmove->cmd = *ucmd; // copy current cmds
pmove->cmd = *ucmd; // copy current cmds
Q_strncpy( pmove->physinfo, cls.physinfo, MAX_INFO_STRING );
}
@@ -1059,7 +1050,7 @@ void CL_FinishPMove( playermove_t *pmove, local_state_t *to )
VectorCopy( pmove->angles, ps->angles );
VectorCopy( pmove->basevelocity, ps->basevelocity );
VectorCopy( pmove->punchangle, cd->punchangle );
ps->oldbuttons = pmove->oldbuttons;
ps->oldbuttons = pmove->cmd.buttons;
ps->friction = pmove->friction;
ps->movetype = pmove->movetype;
ps->onground = pmove->onground;
@@ -1091,13 +1082,14 @@ Runs prediction code for user cmd
void CL_RunUsercmd( local_state_t *from, local_state_t *to, usercmd_t *u, qboolean runfuncs, double *time, unsigned int random_seed )
{
usercmd_t cmd;
local_state_t temp;
usercmd_t split;
memset( &temp, 0, sizeof( temp ));
if( u->msec > 50 )
{
local_state_t temp;
usercmd_t split;
memset( &temp, 0, sizeof( temp ));
split = *u;
split.msec /= 2;
CL_RunUsercmd( from, &temp, &split, runfuncs, time, random_seed );
@@ -1164,12 +1156,12 @@ Sets cl.predicted.origin and cl.predicted.angles
*/
void CL_PredictMovement( qboolean repredicting )
{
runcmd_t *to_cmd, *from_cmd;
runcmd_t *to_cmd = NULL, *from_cmd;
local_state_t *from = NULL, *to = NULL;
int current_command;
int current_command_mod;
uint current_command;
uint current_command_mod;
frame_t *frame = NULL;
int i, stoppoint;
uint i, stoppoint;
qboolean runfuncs;
double f = 1.0;
cl_entity_t *ent;
@@ -1238,10 +1230,6 @@ void CL_PredictMovement( qboolean repredicting )
if( to_cmd->senttime >= host.realtime )
break;
// now interpolate some fraction of the final frame
if( to_cmd->senttime != from_cmd->senttime )
f = (host.realtime - from_cmd->senttime) / (to_cmd->senttime - from_cmd->senttime) * 0.1;
from = to;
from_cmd = to_cmd;
}
@@ -1274,8 +1262,10 @@ void CL_PredictMovement( qboolean repredicting )
return;
}
f = bound( 0.0f, f, 1.0f );
f = 0.0; // FIXME: make work, do revision
// now interpolate some fraction of the final frame
if( to_cmd->senttime != from_cmd->senttime )
f = bound( 0.0, (host.realtime - from_cmd->senttime) / (to_cmd->senttime - from_cmd->senttime) * 0.1, 1.0 );
else f = 0.0;
if( CL_PlayerTeleported( from, to ))
{
@@ -1337,14 +1327,14 @@ void CL_PredictMovement( qboolean repredicting )
cls.correction_time -= host.frametime;
// Make sure smoothtime is postive
if( cl_smoothtime->value <= 0.0 )
if( cl_smoothtime->value <= 0.0f )
Cvar_DirectSet( cl_smoothtime, "0.1" );
// Clamp from 0 to cl_smoothtime.value
cls.correction_time = bound( 0.0, cls.correction_time, cl_smoothtime->value );
// Compute backward interpolation fraction along full correction
frac = 1.0 - cls.correction_time / cl_smoothtime->value;
frac = 1.0f - cls.correction_time / cl_smoothtime->value;
// Determine how much error we still have to make up for
VectorSubtract( cl.simorg, cl.local.lastorigin, delta );
@@ -1359,4 +1349,4 @@ void CL_PredictMovement( qboolean repredicting )
VectorCopy( cl.simorg, cl.local.lastorigin );
cl.local.repredicting = false;
}
}

View File

@@ -17,7 +17,6 @@ GNU General Public License for more details.
#include "client.h"
#include "net_encode.h"
#include "particledef.h"
#include "gl_local.h"
#include "cl_tent.h"
#include "shake.h"
#include "hltv.h"
@@ -86,7 +85,7 @@ static qboolean CL_QuakeEntityTeleported( cl_entity_t *ent, entity_state_t *news
VectorSubtract( newstate->origin, ent->prevstate.origin, delta );
// compute potential max movement in units per frame and compare with entity movement
maxlen = ( clgame.movevars.maxvelocity * ( 1.0 / GAME_FPS ));
maxlen = ( clgame.movevars.maxvelocity * ( 1.0f / GAME_FPS ));
len = VectorLength( delta );
return (len > maxlen);
@@ -225,7 +224,7 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
}
// multiplayer game?
if( cl.maxclients > 1 )
if( cl.maxclients > 1 )
{
// allow console in multiplayer games
host.allow_console = true;
@@ -303,13 +302,13 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
// get splash name
if( cls.demoplayback && ( cls.demonum != -1 ))
Cvar_Set( "cl_levelshot_name", va( "levelshots/%s_%s", cls.demoname, glState.wideScreen ? "16x9" : "4x3" ));
else Cvar_Set( "cl_levelshot_name", va( "levelshots/%s_%s", clgame.mapname, glState.wideScreen ? "16x9" : "4x3" ));
Cvar_Set( "cl_levelshot_name", va( "levelshots/%s_%s", cls.demoname, refState.wideScreen ? "16x9" : "4x3" ));
else Cvar_Set( "cl_levelshot_name", va( "levelshots/%s_%s", clgame.mapname, refState.wideScreen ? "16x9" : "4x3" ));
Cvar_SetValue( "scr_loading", 0.0f ); // reset progress bar
if(( cl_allow_levelshots->value && !cls.changelevel ) || cl.background )
{
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
Cvar_Set( "cl_levelshot_name", "*black" ); // render a black screen
cls.scrshot_request = scrshot_plaque; // request levelshot even if exist (check filetime)
}
@@ -350,11 +349,11 @@ static void CL_ParseQuakeClientData( sizebuf_t *msg )
// this is the frame update that this message corresponds to
i = cls.netchan.incoming_sequence;
cl.parsecount = i; // ack'd incoming messages.
cl.parsecountmod = cl.parsecount & CL_UPDATE_MASK; // index into window.
cl.parsecount = i; // ack'd incoming messages.
cl.parsecountmod = cl.parsecount & CL_UPDATE_MASK; // index into window.
frame = &cl.frames[cl.parsecountmod]; // frame at index.
frame->time = cl.mtime[0]; // mark network received time
frame->receivedtime = host.realtime; // time now that we are parsing.
frame->receivedtime = host.realtime; // time now that we are parsing.
memset( &frame->graphdata, 0, sizeof( netbandwidthgraph_t ));
memset( frame->flags, 0, sizeof( frame->flags ));
frame->first_entity = cls.next_client_entities;
@@ -449,7 +448,7 @@ void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits )
SetBits( bits, i << 8 );
}
if( FBitSet( bits, U_LONGENTITY ))
if( FBitSet( bits, U_LONGENTITY ))
newnum = MSG_ReadWord( msg );
else newnum = MSG_ReadByte( msg );
@@ -466,7 +465,7 @@ void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits )
if( ent->curstate.msg_time != cl.mtime[1] )
forcelink = true; // no previous frame to lerp from
else forcelink = false;
if( FBitSet( bits, U_MODEL ))
state->modelindex = MSG_ReadByte( msg );
else state->modelindex = ent->baseline.modelindex;
@@ -574,8 +573,8 @@ void CL_ParseQuakeParticle( sizebuf_t *msg )
{
int count, color;
vec3_t org, dir;
MSG_ReadVec3Coord( msg, org );
MSG_ReadVec3Coord( msg, org );
dir[0] = MSG_ReadChar( msg ) * 0.0625f;
dir[1] = MSG_ReadChar( msg ) * 0.0625f;
dir[2] = MSG_ReadChar( msg ) * 0.0625f;
@@ -598,12 +597,12 @@ void CL_ParseQuakeStaticSound( sizebuf_t *msg )
float vol, attn;
vec3_t org;
MSG_ReadVec3Coord( msg, org );
MSG_ReadVec3Coord( msg, org );
sound_num = MSG_ReadByte( msg );
vol = (float)MSG_ReadByte( msg ) / 255.0f;
attn = (float)MSG_ReadByte( msg ) / 64.0f;
S_StartSound( org, 0, CHAN_STATIC, cl.sound_index[sound_num], vol, attn, PITCH_NORM, 0 );
S_StartSound( org, 0, CHAN_STATIC, cl.sound_index[sound_num], vol, attn, PITCH_NORM, 0 );
}
/*
@@ -677,7 +676,7 @@ static void CL_ParseQuakeStaticEntity( sizebuf_t *msg )
if( ent->model != NULL )
{
// auto 'solid' faces
if( FBitSet( ent->model->flags, MODEL_TRANSPARENT ) && CL_IsQuakeCompatible( ))
if( FBitSet( ent->model->flags, MODEL_TRANSPARENT ) && Host_IsQuakeCompatible())
{
ent->curstate.rendermode = kRenderTransAlpha;
ent->curstate.renderamt = 255;
@@ -862,9 +861,7 @@ void CL_QuakeExecStuff( void )
if( !*text ) break;
host.com_ignorebracket = true;
text = COM_ParseFile( text, token );
host.com_ignorebracket = false;
text = _COM_ParseFileSafe( text, token, sizeof( token ), PFILE_IGNOREBRACKET, NULL );
if( !text ) break;
@@ -909,7 +906,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
// assume no entity/player update this packet
if( cls.state == ca_active )
{
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].choked = false;
}
else
@@ -932,7 +929,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
// end of message (align bits)
if( MSG_GetNumBitsLeft( msg ) < 8 )
break;
break;
cmd = MSG_ReadServerCmd( msg );
@@ -1130,4 +1127,4 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
// check deferred cmds
CL_QuakeExecStuff();
}
}

View File

@@ -15,7 +15,6 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "gl_local.h"
#include "studio.h"
/*
@@ -55,7 +54,7 @@ qboolean CL_CmpStudioTextures( int numtexs, mstudiotexture_t *p1, mstudiotexture
if( p1->index != p2->index )
return false;
}
}
return true;
}
@@ -78,7 +77,9 @@ byte *CL_CreateRawTextureFromPixels( texture_t *tx, size_t *size, int topcolor,
// fill header
if( !pin.name[0] ) Q_strncpy( pin.name, "#raw_remap_image.mdl", sizeof( pin.name ));
pin.flags = STUDIO_NF_COLORMAP; // just in case :-)
pin.index = (int)(tx + 1); // pointer to pixels
//pin.index = (int)(tx + 1); // pointer to pixels
// no more pointer-to-int-to-pointer casts
Image_SetMDLPointer( (byte*)((texture_t *)tx + 1) );
pin.width = tx->width;
pin.height = tx->height;
@@ -97,24 +98,25 @@ CL_DuplicateTexture
Dupliacte texture with remap pixels
====================
*/
void CL_DuplicateTexture( mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
void CL_DuplicateTexture( cl_entity_t *entity, model_t *model, mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
{
gl_texture_t *glt;
const char *name;
texture_t *tx = NULL;
char texname[128];
int i, size, index;
int i, index;
size_t size;
byte paletteBackup[768];
byte *raw, *pal;
// save off the real texture index
index = ptexture->index;
glt = R_GetTexture( index );
Q_snprintf( texname, sizeof( texname ), "#%i_%s", RI.currententity->curstate.number, glt->name + 1 );
name = ref.dllFuncs.GL_TextureName( index );
Q_snprintf( texname, sizeof( texname ), "#%i_%s", entity->curstate.number, name + 1 );
// search for pixels
for( i = 0; i < RI.currentmodel->numtextures; i++ )
for( i = 0; i < model->numtextures; i++ )
{
tx = RI.currentmodel->textures[i];
tx = model->textures[i];
if( tx->gl_texturenum == index )
break; // found
}
@@ -126,7 +128,7 @@ void CL_DuplicateTexture( mstudiotexture_t *ptexture, int topcolor, int bottomco
memcpy( paletteBackup, pal, 768 );
raw = CL_CreateRawTextureFromPixels( tx, &size, topcolor, bottomcolor );
ptexture->index = GL_LoadTexture( texname, raw, size, TF_FORCE_COLOR ); // do copy
ptexture->index = ref.dllFuncs.GL_LoadTexture( texname, raw, size, TF_FORCE_COLOR ); // do copy
// restore original palette
memcpy( pal, paletteBackup, 768 );
@@ -139,32 +141,33 @@ CL_UpdateStudioTexture
Update texture top and bottom colors
====================
*/
void CL_UpdateStudioTexture( mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
void CL_UpdateStudioTexture( cl_entity_t *entity, mstudiotexture_t *ptexture, int topcolor, int bottomcolor )
{
gl_texture_t *glt;
rgbdata_t *pic;
texture_t *tx = NULL;
char texname[128], name[128], mdlname[128];
int i, size, index;
const char *origtexname;
int i, index;
size_t size;
byte paletteBackup[768];
byte *raw, *pal;
// save off the real texture index
glt = R_GetTexture( ptexture->index );
origtexname = ref.dllFuncs.GL_TextureName( ptexture->index );
// build name of original texture
Q_strncpy( mdlname, RI.currentmodel->name, sizeof( mdlname ));
Q_strncpy( mdlname, entity->model->name, sizeof( mdlname ));
COM_FileBase( ptexture->name, name );
COM_StripExtension( mdlname );
Q_snprintf( texname, sizeof( texname ), "#%s/%s.mdl", mdlname, name );
index = GL_FindTexture( texname );
index = ref.dllFuncs.GL_FindTexture( texname );
if( !index ) return; // couldn't find texture
// search for pixels
for( i = 0; i < RI.currentmodel->numtextures; i++ )
for( i = 0; i < entity->model->numtextures; i++ )
{
tx = RI.currentmodel->textures[i];
tx = entity->model->textures[i];
if( tx->gl_texturenum == index )
break; // found
}
@@ -176,14 +179,14 @@ void CL_UpdateStudioTexture( mstudiotexture_t *ptexture, int topcolor, int botto
memcpy( paletteBackup, pal, 768 );
raw = CL_CreateRawTextureFromPixels( tx, &size, topcolor, bottomcolor );
pic = FS_LoadImage( glt->name, raw, size );
pic = FS_LoadImage( origtexname, raw, size );
if( !pic )
{
Con_DPrintf( S_ERROR "Couldn't update texture %s\n", glt->name );
Con_DPrintf( S_ERROR "Couldn't update texture %s\n", origtexname );
return;
}
index = GL_UpdateTextureInternal( glt->name, pic, 0 );
index = GL_UpdateTextureInternal( origtexname, pic, 0 );
FS_FreeImage( pic );
// restore original palette
@@ -199,21 +202,21 @@ CL_UpdateAliasTexture
Update texture top and bottom colors
====================
*/
void CL_UpdateAliasTexture( unsigned short *texture, int skinnum, int topcolor, int bottomcolor )
void CL_UpdateAliasTexture( cl_entity_t *entity, unsigned short *texture, int skinnum, int topcolor, int bottomcolor )
{
char texname[MAX_QPATH];
rgbdata_t skin, *pic;
texture_t *tx;
if( !texture || !RI.currentmodel->textures )
if( !texture || !entity->model->textures )
return; // no remapinfo in model
tx = RI.currentmodel->textures[skinnum];
tx = entity->model->textures[skinnum];
if( !tx ) return; // missing texture ?
if( *texture == 0 )
{
Q_snprintf( texname, sizeof( texname ), "%s:remap%i_%i", RI.currentmodel->name, skinnum, RI.currententity->index );
Q_snprintf( texname, sizeof( texname ), "%s:remap%i_%i", entity->model->name, skinnum, entity->index );
skin.width = tx->width;
skin.height = tx->height;
skin.depth = skin.numMips = 1;
@@ -228,7 +231,7 @@ void CL_UpdateAliasTexture( unsigned short *texture, int skinnum, int topcolor,
}
// and now we can remap with internal routines
GL_ProcessTexture( *texture, -1.0f, topcolor, bottomcolor );
ref.dllFuncs.GL_ProcessTexture( *texture, -1.0f, topcolor, bottomcolor );
}
/*
@@ -239,7 +242,7 @@ Allocate new remap info per entity
and make copy of remap textures
====================
*/
void CL_AllocRemapInfo( int topcolor, int bottomcolor )
void CL_AllocRemapInfo( cl_entity_t *entity, model_t *model, int topcolor, int bottomcolor )
{
remap_info_t *info;
studiohdr_t *phdr;
@@ -247,10 +250,10 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
mstudiotexture_t *src, *dst;
int i, size;
if( !RI.currententity ) return;
i = ( RI.currententity == &clgame.viewent ) ? clgame.maxEntities : RI.currententity->curstate.number;
if( !entity ) return;
i = ( entity == &clgame.viewent ) ? clgame.maxEntities : entity->curstate.number;
if( !RI.currentmodel || ( RI.currentmodel->type != mod_alias && RI.currentmodel->type != mod_studio ))
if( !model || ( model->type != mod_alias && model->type != mod_studio ))
{
// entity has changed model by another type, release remap info
if( clgame.remap_info[i] )
@@ -262,7 +265,7 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
}
// model doesn't contains remap textures
if( RI.currentmodel->numtextures <= 0 )
if( model->numtextures <= 0 )
{
// entity has changed model with no remap textures
if( clgame.remap_info[i] )
@@ -273,22 +276,22 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
return;
}
if( RI.currentmodel->type == mod_studio )
if( model->type == mod_studio )
{
phdr = (studiohdr_t *)Mod_StudioExtradata( RI.currentmodel );
phdr = (studiohdr_t *)Mod_StudioExtradata( model );
if( !phdr ) return; // bad model?
src = (mstudiotexture_t *)(((byte *)phdr) + phdr->textureindex);
dst = (clgame.remap_info[i] ? clgame.remap_info[i]->ptexture : NULL);
dst = (clgame.remap_info[i] ? clgame.remap_info[i]->ptexture : NULL);
// NOTE: we must copy all the structures 'mstudiotexture_t' for easy access when model is rendering
if( !CL_CmpStudioTextures( phdr->numtextures, src, dst ) || clgame.remap_info[i]->model != RI.currentmodel )
if( !CL_CmpStudioTextures( phdr->numtextures, src, dst ) || clgame.remap_info[i]->model != model )
{
// this code catches studiomodel change with another studiomodel with remap textures
// e.g. playermodel 'barney' with playermodel 'gordon'
if( clgame.remap_info[i] ) CL_FreeRemapInfo( clgame.remap_info[i] ); // free old info
size = sizeof( remap_info_t ) + ( sizeof( mstudiotexture_t ) * phdr->numtextures );
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, size );
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, size );
info->ptexture = (mstudiotexture_t *)(info + 1); // textures are immediately comes after remap_info
}
else
@@ -311,21 +314,21 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
for( i = 0; i < info->numtextures; i++ )
{
if( dst[i].flags & STUDIO_NF_COLORMAP )
CL_DuplicateTexture( &dst[i], topcolor, bottomcolor );
CL_DuplicateTexture( entity, model, &dst[i], topcolor, bottomcolor );
}
}
else if( RI.currentmodel->type == mod_alias )
else if( model->type == mod_alias )
{
ahdr = (aliashdr_t *)Mod_AliasExtradata( RI.currentmodel );
ahdr = (aliashdr_t *)Mod_AliasExtradata( model );
if( !ahdr ) return; // bad model?
// NOTE: we must copy all the structures 'mstudiotexture_t' for easy access when model is rendering
if( !clgame.remap_info[i] || clgame.remap_info[i]->model != RI.currentmodel )
if( !clgame.remap_info[i] || clgame.remap_info[i]->model != model )
{
// this code catches studiomodel change with another studiomodel with remap textures
// e.g. playermodel 'barney' with playermodel 'gordon'
if( clgame.remap_info[i] ) CL_FreeRemapInfo( clgame.remap_info[i] ); // free old info
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, sizeof( remap_info_t ));
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, sizeof( remap_info_t ));
}
else
{
@@ -333,10 +336,10 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
return;
}
info->numtextures = RI.currentmodel->numtextures;
info->numtextures = model->numtextures;
// alias remapping is easy
CL_UpdateRemapInfo( topcolor, bottomcolor );
CL_UpdateRemapInfo( entity, topcolor, bottomcolor );
}
else
{
@@ -344,7 +347,7 @@ void CL_AllocRemapInfo( int topcolor, int bottomcolor )
return;
}
info->model = RI.currentmodel;
info->model = model;
}
/*
@@ -354,12 +357,12 @@ CL_UpdateRemapInfo
Update all remaps per entity
====================
*/
void CL_UpdateRemapInfo( int topcolor, int bottomcolor )
void CL_UpdateRemapInfo( cl_entity_t *entity, int topcolor, int bottomcolor )
{
remap_info_t *info;
int i;
i = ( RI.currententity == &clgame.viewent ) ? clgame.maxEntities : RI.currententity->curstate.number;
i = ( entity == &clgame.viewent ) ? clgame.maxEntities : entity->curstate.number;
info = clgame.remap_info[i];
if( !info ) return; // no remap info
@@ -371,9 +374,9 @@ void CL_UpdateRemapInfo( int topcolor, int bottomcolor )
if( info->ptexture != NULL )
{
if( FBitSet( info->ptexture[i].flags, STUDIO_NF_COLORMAP ))
CL_UpdateStudioTexture( &info->ptexture[i], topcolor, bottomcolor );
CL_UpdateStudioTexture( entity, &info->ptexture[i], topcolor, bottomcolor );
}
else CL_UpdateAliasTexture( &info->textures[i], i, topcolor, bottomcolor );
else CL_UpdateAliasTexture( entity, &info->textures[i], i, topcolor, bottomcolor );
}
info->topcolor = topcolor;
@@ -399,14 +402,14 @@ void CL_FreeRemapInfo( remap_info_t *info )
if( info->ptexture != NULL )
{
if( FBitSet( info->ptexture[i].flags, STUDIO_NF_COLORMAP ))
GL_FreeTexture( info->ptexture[i].index );
ref.dllFuncs.GL_FreeTexture( info->ptexture[i].index );
}
if( info->textures[i] != 0 )
GL_FreeTexture( info->textures[i] );
ref.dllFuncs.GL_FreeTexture( info->textures[i] );
}
Mem_Free( info ); // release struct
Mem_Free( info ); // release struct
}
/*
@@ -425,9 +428,9 @@ void CL_ClearAllRemaps( void )
for( i = 0; i < clgame.maxRemapInfos; i++ )
{
if( clgame.remap_info[i] )
CL_FreeRemapInfo( clgame.remap_info[i] );
CL_FreeRemapInfo( clgame.remap_info[i] );
}
Mem_Free( clgame.remap_info );
}
clgame.remap_info = NULL;
}
}

346
engine/client/cl_render.c Normal file
View File

@@ -0,0 +1,346 @@
/*
cl_render.c - RenderAPI loader & implementation
Copyright (C) 2019 a1batross
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "common.h"
#include "client.h"
#include "library.h"
#include "platform/platform.h"
int R_FatPVS( const vec3_t org, float radius, byte *visbuffer, qboolean merge, qboolean fullvis )
{
return Mod_FatPVS( org, radius, visbuffer, world.visbytes, merge, fullvis );
}
lightstyle_t *CL_GetLightStyle( int number )
{
Assert( number >= 0 && number < MAX_LIGHTSTYLES );
return &cl.lightstyles[number];
}
const ref_overview_t *GL_GetOverviewParms( void )
{
return &clgame.overView;
}
static void *R_Mem_Alloc( size_t cb, const char *filename, const int fileline )
{
return _Mem_Alloc( cls.mempool, cb, true, filename, fileline );
}
static void R_Mem_Free( void *mem, const char *filename, const int fileline )
{
if( !mem ) return;
_Mem_Free( mem, filename, fileline );
}
/*
=========
pfnGetFilesList
=========
*/
static char **pfnGetFilesList( const char *pattern, int *numFiles, int gamedironly )
{
static search_t *t = NULL;
if( t ) Mem_Free( t ); // release prev search
t = FS_Search( pattern, true, gamedironly );
if( !t )
{
if( numFiles ) *numFiles = 0;
return NULL;
}
if( numFiles ) *numFiles = t->numfilenames;
return t->filenames;
}
static uint pfnFileBufferCRC32( const void *buffer, const int length )
{
uint modelCRC = 0;
if( !buffer || length <= 0 )
return modelCRC;
CRC32_Init( &modelCRC );
CRC32_ProcessBuffer( &modelCRC, buffer, length );
return CRC32_Final( modelCRC );
}
/*
=================
R_EnvShot
=================
*/
static void R_EnvShot( const float *vieworg, const char *name, qboolean skyshot, int shotsize )
{
static vec3_t viewPoint;
if( !COM_CheckString( name ))
return;
if( cls.scrshot_action != scrshot_inactive )
{
if( cls.scrshot_action != scrshot_skyshot && cls.scrshot_action != scrshot_envshot )
Con_Printf( S_ERROR "R_%sShot: subsystem is busy, try for next frame.\n", skyshot ? "Sky" : "Env" );
return;
}
cls.envshot_vieworg = NULL; // use client view
Q_strncpy( cls.shotname, name, sizeof( cls.shotname ));
if( vieworg )
{
// make sure what viewpoint don't temporare
VectorCopy( vieworg, viewPoint );
cls.envshot_vieworg = viewPoint;
cls.envshot_disable_vis = true;
}
// make request for envshot
if( skyshot ) cls.scrshot_action = scrshot_skyshot;
else cls.scrshot_action = scrshot_envshot;
// catch negative values
cls.envshot_viewsize = max( 0, shotsize );
}
/*
=============
CL_GenericHandle
=============
*/
const char *CL_GenericHandle( int fileindex )
{
if( fileindex < 0 || fileindex >= MAX_CUSTOM )
return 0;
return cl.files_precache[fileindex];
}
int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
{
switch( parm )
{
case PARM_BSP2_SUPPORTED:
#ifdef SUPPORT_BSP2_FORMAT
return 1;
#endif
return 0;
case PARM_SKY_SPHERE:
return FBitSet( world.flags, FWORLD_SKYSPHERE ) && !FBitSet( world.flags, FWORLD_CUSTOM_SKYBOX );
case PARAM_GAMEPAUSED:
return cl.paused;
case PARM_CLIENT_INGAME:
return CL_IsInGame();
case PARM_MAX_ENTITIES:
return clgame.maxEntities;
case PARM_FEATURES:
return host.features;
case PARM_MAP_HAS_DELUXE:
return FBitSet( world.flags, FWORLD_HAS_DELUXEMAP );
case PARM_CLIENT_ACTIVE:
return (cls.state == ca_active);
case PARM_DEDICATED_SERVER:
return (host.type == HOST_DEDICATED);
case PARM_WATER_ALPHA:
return FBitSet( world.flags, FWORLD_WATERALPHA );
case PARM_DELUXEDATA:
return *(int *)&world.deluxedata;
case PARM_SHADOWDATA:
return *(int *)&world.shadowdata;
default:
// indicates call from client.dll
if( checkRef )
{
return ref.dllFuncs.RefGetParm( parm, arg );
}
// call issued from ref_dll, check extensions here
else switch( parm )
{
case PARM_DEV_OVERVIEW:
return CL_IsDevOverviewMode();
case PARM_THIRDPERSON:
return CL_IsThirdPerson();
case PARM_QUAKE_COMPATIBLE:
return Host_IsQuakeCompatible();
case PARM_PLAYER_INDEX:
return cl.playernum + 1;
case PARM_VIEWENT_INDEX:
return cl.viewentity;
case PARM_CONNSTATE:
return (int)cls.state;
case PARM_PLAYING_DEMO:
return cls.demoplayback;
case PARM_WATER_LEVEL:
return cl.local.waterlevel;
case PARM_MAX_CLIENTS:
return cl.maxclients;
case PARM_LOCAL_HEALTH:
return cl.local.health;
case PARM_LOCAL_GAME:
return Host_IsLocalGame();
case PARM_NUMENTITIES:
return pfnNumberOfEntities();
case PARM_NUMMODELS:
return cl.nummodels;
}
}
return 0;
}
static int pfnRenderGetParm( int parm, int arg )
{
return CL_RenderGetParm( parm, arg, true );
}
static render_api_t gRenderAPI =
{
pfnRenderGetParm, // GL_RenderGetParm,
NULL, // R_GetDetailScaleForTexture,
NULL, // R_GetExtraParmsForTexture,
CL_GetLightStyle,
CL_GetDynamicLight,
CL_GetEntityLight,
LightToTexGamma,
NULL, // R_GetFrameTime,
NULL, // R_SetCurrentEntity,
NULL, // R_SetCurrentModel,
R_FatPVS,
R_StoreEfrags,
NULL, // GL_FindTexture,
NULL, // GL_TextureName,
NULL, // GL_TextureData,
NULL, // GL_LoadTexture,
NULL, // GL_CreateTexture,
NULL, // GL_LoadTextureArray,
NULL, // GL_CreateTextureArray,
NULL, // GL_FreeTexture,
NULL, // DrawSingleDecal,
NULL, // R_DecalSetupVerts,
NULL, // R_EntityRemoveDecals,
(void*)AVI_LoadVideo,
(void*)AVI_GetVideoInfo,
(void*)AVI_GetVideoFrameNumber,
(void*)AVI_GetVideoFrame,
NULL, // R_UploadStretchRaw,
(void*)AVI_FreeVideo,
(void*)AVI_IsActive,
S_StreamAviSamples,
NULL,
NULL,
NULL, // GL_Bind,
NULL, // GL_SelectTexture,
NULL, // GL_LoadTexMatrixExt,
NULL, // GL_LoadIdentityTexMatrix,
NULL, // GL_CleanUpTextureUnits,
NULL, // GL_TexGen,
NULL, // GL_TextureTarget,
NULL, // GL_SetTexCoordArrayMode,
NULL, // GL_GetProcAddress,
NULL, // GL_UpdateTexSize,
NULL,
NULL,
NULL, // CL_DrawParticlesExternal,
R_EnvShot,
pfnSPR_LoadExt,
NULL, // R_LightVec,
NULL, // R_StudioGetTexture,
GL_GetOverviewParms,
CL_GenericHandle,
COM_SaveFile,
NULL,
R_Mem_Alloc,
R_Mem_Free,
pfnGetFilesList,
pfnFileBufferCRC32,
COM_CompareFileTime,
Host_Error,
(void*)CL_ModelHandle,
pfnTime,
Cvar_Set,
S_FadeMusicVolume,
COM_SetRandomSeed,
};
static void R_FillRenderAPIFromRef( render_api_t *to, const ref_interface_t *from )
{
to->GetDetailScaleForTexture = from->GetDetailScaleForTexture;
to->GetExtraParmsForTexture = from->GetExtraParmsForTexture;
to->GetFrameTime = from->GetFrameTime;
to->R_SetCurrentEntity = from->R_SetCurrentEntity;
to->R_SetCurrentModel = from->R_SetCurrentModel;
to->GL_FindTexture = from->GL_FindTexture;
to->GL_TextureName = from->GL_TextureName;
to->GL_TextureData = from->GL_TextureData;
to->GL_LoadTexture = from->GL_LoadTexture;
to->GL_CreateTexture = from->GL_CreateTexture;
to->GL_LoadTextureArray = from->GL_LoadTextureArray;
to->GL_CreateTextureArray = from->GL_CreateTextureArray;
to->GL_FreeTexture = from->GL_FreeTexture;
to->DrawSingleDecal = from->DrawSingleDecal;
to->R_DecalSetupVerts = from->R_DecalSetupVerts;
to->R_EntityRemoveDecals = from->R_EntityRemoveDecals;
to->AVI_UploadRawFrame = from->AVI_UploadRawFrame;
to->GL_Bind = from->GL_Bind;
to->GL_SelectTexture = from->GL_SelectTexture;
to->GL_LoadTextureMatrix = from->GL_LoadTextureMatrix;
to->GL_TexMatrixIdentity = from->GL_TexMatrixIdentity;
to->GL_CleanUpTextureUnits = from->GL_CleanUpTextureUnits;
to->GL_TexGen = from->GL_TexGen;
to->GL_TextureTarget = from->GL_TextureTarget;
to->GL_TexCoordArrayMode = from->GL_TexCoordArrayMode;
to->GL_UpdateTexSize = from->GL_UpdateTexSize;
to->GL_DrawParticles = from->GL_DrawParticles;
to->LightVec = from->LightVec;
to->StudioGetTexture = from->StudioGetTexture;
to->GL_GetProcAddress = from->R_GetProcAddress;
}
/*
===============
R_InitRenderAPI
Initialize client external rendering
===============
*/
qboolean R_InitRenderAPI( void )
{
// make sure what render functions is cleared
memset( &clgame.drawFuncs, 0, sizeof( clgame.drawFuncs ));
// fill missing functions from renderer
R_FillRenderAPIFromRef( &gRenderAPI, &ref.dllFuncs );
if( clgame.dllFuncs.pfnGetRenderInterface )
{
if( clgame.dllFuncs.pfnGetRenderInterface( CL_RENDER_INTERFACE_VERSION, &gRenderAPI, &clgame.drawFuncs ))
{
Con_Reportf( "CL_LoadProgs: ^2initailized extended RenderAPI ^7ver. %i\n", CL_RENDER_INTERFACE_VERSION );
return true;
}
// make sure what render functions is cleared
memset( &clgame.drawFuncs, 0, sizeof( clgame.drawFuncs ));
return false; // just tell user about problems
}
// render interface is missed
return true;
}

View File

@@ -15,10 +15,10 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "gl_local.h"
#include "vgui_draw.h"
#include "qfont.h"
#include "input.h"
#include "library.h"
convar_t *scr_centertime;
convar_t *scr_loading;
@@ -27,8 +27,11 @@ convar_t *scr_viewsize;
convar_t *cl_testlights;
convar_t *cl_allow_levelshots;
convar_t *cl_levelshot_name;
convar_t *cl_envshot_size;
static convar_t *cl_envshot_size;
convar_t *v_dark;
static convar_t *net_speeds;
static convar_t *cl_showfps;
static convar_t *cl_showpos;
typedef struct
{
@@ -57,7 +60,7 @@ void SCR_DrawFPS( int height )
int offset;
if( cls.state != ca_active || !cl_showfps->value || cl.background )
return;
return;
switch( cls.scrshot_action )
{
@@ -96,10 +99,45 @@ void SCR_DrawFPS( int height )
Q_snprintf( fpsstring, sizeof( fpsstring ), "fps: ^1%4i min, ^3%4i cur, ^2%4i max", minfps, curfps, maxfps );
else Q_snprintf( fpsstring, sizeof( fpsstring ), "%4i fps", curfps );
MakeRGBA( color, 255, 255, 255, 255 );
}
}
Con_DrawStringLen( fpsstring, &offset, NULL );
Con_DrawString( glState.width - offset - 4, height, fpsstring, color );
Con_DrawString( refState.width - offset - 4, height, fpsstring, color );
}
/*
==============
SCR_DrawPos
Draw local player position, angles and velocity
==============
*/
void SCR_DrawPos( void )
{
static char msg[MAX_SYSPATH];
float speed;
cl_entity_t *ent;
rgba_t color;
if( cls.state != ca_active || !cl_showpos->value || cl.background )
return;
ent = CL_GetLocalPlayer();
speed = VectorLength( cl.simvel );
Q_snprintf( msg, MAX_SYSPATH,
"pos: %.2f %.2f %.2f\n"
"ang: %.2f %.2f %.2f\n"
"velocity: %.2f",
cl.simorg[0], cl.simorg[1], cl.simorg[2],
// should we use entity angles or viewangles?
// view isn't always bound to player
ent->angles[0], ent->angles[1], ent->angles[2],
speed );
MakeRGBA( color, 255, 255, 255, 255 );
Con_DrawString( refState.width / 2, 4, msg, color );
}
/*
@@ -145,10 +183,20 @@ void SCR_NetSpeeds( void )
if( cur_clfps > max_clfps ) max_clfps = cur_clfps;
}
Q_snprintf( msg, sizeof( msg ), "sv fps: ^1%4i min, ^3%4i cur, ^2%4i max\ncl fps: ^1%4i min, ^3%4i cur, ^2%4i max\nGame Time: %02d:%02d\nTotal received from server: %s\nTotal sent to server: %s\n",
min_svfps, cur_svfps, max_svfps, min_clfps, cur_clfps, max_clfps, (int)(time / 60.0f ), (int)fmod( time, 60.0f ), Q_memprint( cls.netchan.total_received ), Q_memprint( cls.netchan.total_sended ));
Q_snprintf( msg, sizeof( msg ),
"Updaterate: ^1%2i min, ^3%2i cur, ^2%2i max\n"
"Client FPS: ^1%i min, ^3%3i cur, ^2%3i max\n"
"Game Time: %02d:%02d\n"
"Total received from server: %s\n"
"Total sent to server: %s\n",
min_svfps, cur_svfps, max_svfps,
min_clfps, cur_clfps, max_clfps,
(int)(time / 60.0f ), (int)fmod( time, 60.0f ),
Q_memprint( cls.netchan.total_received ),
Q_memprint( cls.netchan.total_sended )
);
x = glState.width - 320;
x = refState.width - 320;
y = 384;
Con_DrawStringLen( NULL, NULL, &height );
@@ -181,13 +229,13 @@ void SCR_RSpeeds( void )
if( !host.allow_console )
return;
if( R_SpeedsMessage( msg, sizeof( msg )))
if( ref.dllFuncs.R_SpeedsMessage( msg, sizeof( msg )))
{
int x, y, height;
char *p, *start, *end;
rgba_t color;
x = glState.width - 340;
x = refState.width - 340;
y = 64;
Con_DrawStringLen( NULL, NULL, &height );
@@ -203,7 +251,7 @@ void SCR_RSpeeds( void )
y += height;
// handle '\n\n'
if( *p == '\n' )
if( *p == '\n' )
y += height;
if( end ) p = end + 1;
else break;
@@ -227,6 +275,37 @@ void SCR_MakeLevelShot( void )
Cbuf_AddText( "levelshot\n" );
}
/*
===============
VID_WriteOverviewScript
Create overview script file
===============
*/
void VID_WriteOverviewScript( void )
{
ref_overview_t *ov = &clgame.overView;
string filename;
file_t *f;
Q_snprintf( filename, sizeof( filename ), "overviews/%s.txt", clgame.mapname );
f = FS_Open( filename, "w", false );
if( !f ) return;
FS_Printf( f, "// overview description file for %s.bsp\n\n", clgame.mapname );
FS_Print( f, "global\n{\n" );
FS_Printf( f, "\tZOOM\t%.2f\n", ov->flZoom );
FS_Printf( f, "\tORIGIN\t%.2f\t%.2f\t%.2f\n", ov->origin[0], ov->origin[1], ov->origin[2] );
FS_Printf( f, "\tROTATED\t%i\n", ov->rotated ? 1 : 0 );
FS_Print( f, "}\n\nlayer\n{\n" );
FS_Printf( f, "\tIMAGE\t\"overviews/%s.bmp\"\n", clgame.mapname );
FS_Printf( f, "\tHEIGHT\t%.2f\n", ov->zFar ); // ???
FS_Print( f, "}\n" );
FS_Close( f );
}
/*
================
SCR_MakeScreenShot
@@ -246,25 +325,27 @@ void SCR_MakeScreenShot( void )
switch( cls.scrshot_action )
{
case scrshot_normal:
iRet = VID_ScreenShot( cls.shotname, VID_SCREENSHOT );
iRet = ref.dllFuncs.VID_ScreenShot( cls.shotname, VID_SCREENSHOT );
break;
case scrshot_snapshot:
iRet = VID_ScreenShot( cls.shotname, VID_SNAPSHOT );
iRet = ref.dllFuncs.VID_ScreenShot( cls.shotname, VID_SNAPSHOT );
break;
case scrshot_plaque:
iRet = VID_ScreenShot( cls.shotname, VID_LEVELSHOT );
iRet = ref.dllFuncs.VID_ScreenShot( cls.shotname, VID_LEVELSHOT );
break;
case scrshot_savegame:
iRet = VID_ScreenShot( cls.shotname, VID_MINISHOT );
iRet = ref.dllFuncs.VID_ScreenShot( cls.shotname, VID_MINISHOT );
break;
case scrshot_envshot:
iRet = VID_CubemapShot( cls.shotname, viewsize, cls.envshot_vieworg, false );
iRet = ref.dllFuncs.VID_CubemapShot( cls.shotname, viewsize, cls.envshot_vieworg, false );
break;
case scrshot_skyshot:
iRet = VID_CubemapShot( cls.shotname, viewsize, cls.envshot_vieworg, true );
iRet = ref.dllFuncs.VID_CubemapShot( cls.shotname, viewsize, cls.envshot_vieworg, true );
break;
case scrshot_mapshot:
iRet = VID_ScreenShot( cls.shotname, VID_MAPSHOT );
iRet = ref.dllFuncs.VID_ScreenShot( cls.shotname, VID_MAPSHOT );
if( iRet )
VID_WriteOverviewScript(); // store overview script too
break;
case scrshot_inactive:
return;
@@ -273,7 +354,7 @@ void SCR_MakeScreenShot( void )
// report
if( iRet )
{
// snapshots don't writes message about image
// snapshots don't writes message about image
if( cls.scrshot_action != scrshot_snapshot )
Con_Reportf( "Write %s\n", cls.shotname );
}
@@ -295,9 +376,9 @@ void SCR_DrawPlaque( void )
{
if(( cl_allow_levelshots->value && !cls.changelevel ) || cl.background )
{
int levelshot = GL_LoadTexture( cl_levelshot_name->string, NULL, 0, TF_IMAGE );
GL_SetRenderMode( kRenderNormal );
R_DrawStretchPic( 0, 0, glState.width, glState.height, 0, 0, 1, 1, levelshot );
int levelshot = ref.dllFuncs.GL_LoadTexture( cl_levelshot_name->string, NULL, 0, TF_IMAGE );
ref.dllFuncs.GL_SetRenderMode( kRenderNormal );
ref.dllFuncs.R_DrawStretchPic( 0, 0, refState.width, refState.height, 0, 0, 1, 1, levelshot );
if( !cl.background ) CL_DrawHUD( CL_LOADING );
}
}
@@ -309,17 +390,18 @@ SCR_BeginLoadingPlaque
*/
void SCR_BeginLoadingPlaque( qboolean is_background )
{
float oldclear;
float oldclear = 0;;
S_StopAllSounds( true );
cl.audio_prepped = false; // don't play ambients
cl.video_prepped = false;
oldclear = gl_clear->value;
if( !Host_IsDedicated() )
oldclear = gl_clear->value;
if( CL_IsInMenu( ) && !cls.changedemo && !is_background )
{
UI_SetActiveMenu( false );
if( cls.state == ca_disconnected )
if( cls.state == ca_disconnected && !(GameState->curstate == STATE_RUNFRAME && GameState->nextstate != STATE_RUNFRAME) )
SCR_UpdateScreen();
}
@@ -329,14 +411,19 @@ void SCR_BeginLoadingPlaque( qboolean is_background )
if( cls.key_dest == key_console )
return;
gl_clear->value = 0.0f;
if( !Host_IsDedicated() )
gl_clear->value = 0.0f;
if( is_background ) IN_MouseSavePos( );
cls.draw_changelevel = !is_background;
SCR_UpdateScreen();
cls.disable_screen = host.realtime;
cls.disable_servercount = cl.servercount;
cl.background = is_background; // set right state before svc_serverdata is came
gl_clear->value = oldclear;
if( !Host_IsDedicated() )
gl_clear->value = oldclear;
// SNDDMA_LockSound();
}
@@ -373,7 +460,7 @@ SCR_DirtyScreen
void SCR_DirtyScreen( void )
{
SCR_AddDirtyPoint( 0, 0 );
SCR_AddDirtyPoint( glState.width - 1, glState.height - 1 );
SCR_AddDirtyPoint( refState.width - 1, refState.height - 1 );
}
/*
@@ -422,18 +509,18 @@ void SCR_TileClear( void )
right = left + clgame.viewport[2] - 1;
if( clear.y1 < top )
{
{
// clear above view screen
i = clear.y2 < top-1 ? clear.y2 : top - 1;
R_DrawTileClear( clear.x1, clear.y1, clear.x2 - clear.x1 + 1, i - clear.y1 + 1 );
ref.dllFuncs.R_DrawTileClear( cls.tileImage, clear.x1, clear.y1, clear.x2 - clear.x1 + 1, i - clear.y1 + 1 );
clear.y1 = top;
}
if( clear.y2 > bottom )
{
{
// clear below view screen
i = clear.y1 > bottom + 1 ? clear.y1 : bottom + 1;
R_DrawTileClear( clear.x1, i, clear.x2 - clear.x1 + 1, clear.y2 - i + 1 );
ref.dllFuncs.R_DrawTileClear( cls.tileImage, clear.x1, i, clear.x2 - clear.x1 + 1, clear.y2 - i + 1 );
clear.y2 = bottom;
}
@@ -441,15 +528,15 @@ void SCR_TileClear( void )
{
// clear left of view screen
i = clear.x2 < left - 1 ? clear.x2 : left - 1;
R_DrawTileClear( clear.x1, clear.y1, i - clear.x1 + 1, clear.y2 - clear.y1 + 1 );
ref.dllFuncs.R_DrawTileClear( cls.tileImage, clear.x1, clear.y1, i - clear.x1 + 1, clear.y2 - clear.y1 + 1 );
clear.x1 = left;
}
if( clear.x2 > right )
{
{
// clear left of view screen
i = clear.x1 > right + 1 ? clear.x1 : right + 1;
R_DrawTileClear( i, clear.y1, clear.x2 - i + 1, clear.y2 - clear.y1 + 1 );
ref.dllFuncs.R_DrawTileClear( cls.tileImage, i, clear.y1, clear.x2 - i + 1, clear.y2 - clear.y1 + 1 );
clear.x2 = right;
}
}
@@ -501,7 +588,7 @@ qboolean SCR_LoadFixedWidthFont( const char *fontname )
if( !FS_FileExists( fontname, false ))
return false;
cls.creditsFont.hFontTexture = GL_LoadTexture( fontname, NULL, 0, TF_IMAGE|TF_KEEP_SOURCE );
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE|TF_KEEP_SOURCE );
R_GetTextureParms( &fontWidth, NULL, cls.creditsFont.hFontTexture );
cls.creditsFont.charHeight = clgame.scrInfo.iCharHeight = fontWidth / 16;
cls.creditsFont.type = FONT_FIXED;
@@ -524,7 +611,7 @@ qboolean SCR_LoadVariableWidthFont( const char *fontname )
{
int i, fontWidth;
byte *buffer;
size_t length;
fs_offset_t length;
qfont_t *src;
if( cls.creditsFont.valid )
@@ -533,13 +620,13 @@ qboolean SCR_LoadVariableWidthFont( const char *fontname )
if( !FS_FileExists( fontname, false ))
return false;
cls.creditsFont.hFontTexture = GL_LoadTexture( fontname, NULL, 0, TF_IMAGE );
cls.creditsFont.hFontTexture = ref.dllFuncs.GL_LoadTexture( fontname, NULL, 0, TF_IMAGE );
R_GetTextureParms( &fontWidth, NULL, cls.creditsFont.hFontTexture );
// half-life font with variable chars witdh
buffer = FS_LoadFile( fontname, &length, false );
// setup creditsfont
// setup creditsfont
if( buffer && length >= sizeof( qfont_t ))
{
src = (qfont_t *)buffer;
@@ -571,7 +658,18 @@ INTERNAL RESOURCE
*/
void SCR_LoadCreditsFont( void )
{
if( !SCR_LoadVariableWidthFont( "gfx.wad/creditsfont.fnt" ))
const char *path = "gfx/creditsfont.fnt";
dword crc;
// replace default gfx.wad textures by current charset's font
if( !CRC32_File( &crc, "gfx.wad" ) || crc == 0x49eb9f16 )
{
const char *path2 = va("creditsfont_%s.fnt", Cvar_VariableString( "con_charset" ) );
if( FS_FileExists( path2, false ) )
path = path2;
}
if( !SCR_LoadVariableWidthFont( path ))
{
if( !SCR_LoadFixedWidthFont( "gfx/conchars" ))
Con_DPrintf( S_ERROR "failed to load HUD font\n" );
@@ -631,24 +729,24 @@ void SCR_RegisterTextures( void )
// register gfx.wad images
if( FS_FileExists( "gfx/paused.lmp", false ))
cls.pauseIcon = GL_LoadTexture( "gfx/paused.lmp", NULL, 0, TF_IMAGE );
cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/paused.lmp", NULL, 0, TF_IMAGE );
else if( FS_FileExists( "gfx/pause.lmp", false ))
cls.pauseIcon = GL_LoadTexture( "gfx/pause.lmp", NULL, 0, TF_IMAGE );
cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/pause.lmp", NULL, 0, TF_IMAGE );
if( FS_FileExists( "gfx/lambda.lmp", false ))
{
if( cl_allow_levelshots->value )
cls.loadingBar = GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE );
else cls.loadingBar = GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE );
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE );
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE );
}
else if( FS_FileExists( "gfx/loading.lmp", false ))
{
if( cl_allow_levelshots->value )
cls.loadingBar = GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE );
else cls.loadingBar = GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE );
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE );
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE );
}
cls.tileImage = GL_LoadTexture( "gfx/backtile.lmp", NULL, 0, TF_NOMIPMAP );
cls.tileImage = ref.dllFuncs.GL_LoadTexture( "gfx/backtile.lmp", NULL, 0, TF_NOMIPMAP );
}
/*
@@ -683,18 +781,24 @@ SCR_VidInit
*/
void SCR_VidInit( void )
{
if( !ref.initialized ) // don't call VidInit too soon
return;
memset( &clgame.ds, 0, sizeof( clgame.ds )); // reset a draw state
memset( &gameui.ds, 0, sizeof( gameui.ds )); // reset a draw state
memset( &clgame.centerPrint, 0, sizeof( clgame.centerPrint ));
// update screen sizes for menu
gameui.globals->scrWidth = glState.width;
gameui.globals->scrHeight = glState.height;
if( gameui.globals )
{
gameui.globals->scrWidth = refState.width;
gameui.globals->scrHeight = refState.height;
}
VGui_Startup ();
VGui_Startup( NULL, refState.width, refState.height ); // initialized already, so pass NULL
CL_ClearSpriteTextures(); // now all hud sprites are invalid
// vid_state has changed
if( gameui.hInstance ) gameui.dllFuncs.pfnVidInit();
if( clgame.hInstance ) clgame.dllFuncs.pfnVidInit();
@@ -721,9 +825,11 @@ void SCR_Init( void )
cl_envshot_size = Cvar_Get( "cl_envshot_size", "256", FCVAR_ARCHIVE, "envshot size of cube side" );
v_dark = Cvar_Get( "v_dark", "0", 0, "starts level from dark screen" );
scr_viewsize = Cvar_Get( "viewsize", "120", FCVAR_ARCHIVE, "screen size" );
net_speeds = Cvar_Get( "net_speeds", "0", FCVAR_ARCHIVE, "show network packets" );
cl_showfps = Cvar_Get( "cl_showfps", "1", FCVAR_ARCHIVE, "show client fps" );
cl_showpos = Cvar_Get( "cl_showpos", "0", FCVAR_ARCHIVE, "show local player position and velocity" );
// register our commands
Cmd_AddCommand( "timerefresh", SCR_TimeRefresh_f, "turn quickly and print rendering statistcs" );
Cmd_AddCommand( "skyname", CL_SetSky_f, "set new skybox by basename" );
Cmd_AddCommand( "loadsky", CL_SetSky_f, "set new skybox by basename" );
Cmd_AddCommand( "viewpos", SCR_Viewpos_f, "prints current player origin" );
@@ -732,7 +838,7 @@ void SCR_Init( void )
if( !UI_LoadProgs( ))
{
Con_Printf( S_ERROR "can't initialize gameui.dll\n" ); // there is non fatal for us
Con_Printf( S_ERROR "can't initialize gameui DLL: %s\n", COM_GetLibraryError() ); // there is non fatal for us
host.allow_console = true; // we need console, because menu is missing
}
@@ -761,4 +867,4 @@ void SCR_Shutdown( void )
UI_UnloadProgs();
scr_init = false;
}
}

View File

@@ -20,7 +20,6 @@ GNU General Public License for more details.
#include "triangleapi.h"
#include "cl_tent.h"
#include "pm_local.h"
#include "gl_local.h"
#include "studio.h"
#include "wadfile.h" // acess decal size
#include "sound.h"
@@ -151,7 +150,7 @@ void CL_AddClientResources( void )
int i;
// don't request resources from localhost or in quake-compatibility mode
if( cl.maxclients <= 1 || CL_IsQuakeCompatible( ))
if( cl.maxclients <= 1 || Host_IsQuakeCompatible( ))
return;
// check sprites first
@@ -164,7 +163,7 @@ void CL_AddClientResources( void )
// then check sounds
for( i = 0; i < ARRAYSIZE( cl_player_shell_sounds ); i++ )
{
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_player_shell_sounds[i] );
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_player_shell_sounds[i] );
if( !FS_FileExists( filepath, false ))
CL_AddClientResource( cl_player_shell_sounds[i], t_sound );
@@ -172,7 +171,7 @@ void CL_AddClientResources( void )
for( i = 0; i < ARRAYSIZE( cl_weapon_shell_sounds ); i++ )
{
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_weapon_shell_sounds[i] );
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_weapon_shell_sounds[i] );
if( !FS_FileExists( filepath, false ))
CL_AddClientResource( cl_weapon_shell_sounds[i], t_sound );
@@ -180,7 +179,7 @@ void CL_AddClientResources( void )
for( i = 0; i < ARRAYSIZE( cl_explode_sounds ); i++ )
{
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_explode_sounds[i] );
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_explode_sounds[i] );
if( !FS_FileExists( filepath, false ))
CL_AddClientResource( cl_explode_sounds[i], t_sound );
@@ -189,7 +188,7 @@ void CL_AddClientResources( void )
#if 0 // ric sounds was precached by server-side
for( i = 0; i < ARRAYSIZE( cl_ricochet_sounds ); i++ )
{
Q_snprintf( filepath, sizeof( filepath ), "%s%s", DEFAULT_SOUNDPATH, cl_ricochet_sounds[i] );
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", cl_ricochet_sounds[i] );
if( !FS_FileExists( filepath, false ))
CL_AddClientResource( cl_ricochet_sounds[i], t_sound );
@@ -197,125 +196,6 @@ void CL_AddClientResources( void )
#endif
}
/*
===============
CL_FxBlend
===============
*/
int CL_FxBlend( cl_entity_t *e )
{
int blend = 0;
float offset, dist;
vec3_t tmp;
offset = ((int)e->index ) * 363.0f; // Use ent index to de-sync these fx
switch( e->curstate.renderfx )
{
case kRenderFxPulseSlowWide:
blend = e->curstate.renderamt + 0x40 * sin( cl.time * 2 + offset );
break;
case kRenderFxPulseFastWide:
blend = e->curstate.renderamt + 0x40 * sin( cl.time * 8 + offset );
break;
case kRenderFxPulseSlow:
blend = e->curstate.renderamt + 0x10 * sin( cl.time * 2 + offset );
break;
case kRenderFxPulseFast:
blend = e->curstate.renderamt + 0x10 * sin( cl.time * 8 + offset );
break;
case kRenderFxFadeSlow:
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt > 0 )
e->curstate.renderamt -= 1;
else e->curstate.renderamt = 0;
}
blend = e->curstate.renderamt;
break;
case kRenderFxFadeFast:
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt > 3 )
e->curstate.renderamt -= 4;
else e->curstate.renderamt = 0;
}
blend = e->curstate.renderamt;
break;
case kRenderFxSolidSlow:
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt < 255 )
e->curstate.renderamt += 1;
else e->curstate.renderamt = 255;
}
blend = e->curstate.renderamt;
break;
case kRenderFxSolidFast:
if( RP_NORMALPASS( ))
{
if( e->curstate.renderamt < 252 )
e->curstate.renderamt += 4;
else e->curstate.renderamt = 255;
}
blend = e->curstate.renderamt;
break;
case kRenderFxStrobeSlow:
blend = 20 * sin( cl.time * 4 + offset );
if( blend < 0 ) blend = 0;
else blend = e->curstate.renderamt;
break;
case kRenderFxStrobeFast:
blend = 20 * sin( cl.time * 16 + offset );
if( blend < 0 ) blend = 0;
else blend = e->curstate.renderamt;
break;
case kRenderFxStrobeFaster:
blend = 20 * sin( cl.time * 36 + offset );
if( blend < 0 ) blend = 0;
else blend = e->curstate.renderamt;
break;
case kRenderFxFlickerSlow:
blend = 20 * (sin( cl.time * 2 ) + sin( cl.time * 17 + offset ));
if( blend < 0 ) blend = 0;
else blend = e->curstate.renderamt;
break;
case kRenderFxFlickerFast:
blend = 20 * (sin( cl.time * 16 ) + sin( cl.time * 23 + offset ));
if( blend < 0 ) blend = 0;
else blend = e->curstate.renderamt;
break;
case kRenderFxHologram:
case kRenderFxDistort:
VectorCopy( e->origin, tmp );
VectorSubtract( tmp, RI.vieworg, tmp );
dist = DotProduct( tmp, RI.vforward );
// turn off distance fade
if( e->curstate.renderfx == kRenderFxDistort )
dist = 1;
if( dist <= 0 )
{
blend = 0;
}
else
{
e->curstate.renderamt = 180;
if( dist <= 100 ) blend = e->curstate.renderamt;
else blend = (int) ((1.0f - ( dist - 100 ) * ( 1.0f / 400.0f )) * e->curstate.renderamt );
blend += COM_RandomLong( -32, 31 );
}
break;
default:
blend = e->curstate.renderamt;
break;
}
blend = bound( 0, blend, 255 );
return blend;
}
/*
================
@@ -385,7 +265,7 @@ void CL_PrepareTEnt( TEMPENTITY *pTemp, model_t *pmodel )
// use these to set per-frame and termination conditions / actions
pTemp->entity.trivial_accept = modelHandle; // keep unchanged
pTemp->flags = FTENT_NONE;
pTemp->flags = FTENT_NONE;
pTemp->die = cl.time + 0.75f;
if( pmodel ) frameCount = pmodel->numframes;
@@ -442,15 +322,15 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
Q_snprintf( soundname, sizeof( soundname ), "debris/wood%i.wav", COM_RandomLong( 1, 4 ));
break;
case BOUNCE_SHRAP:
Q_snprintf( soundname, sizeof( soundname ), "%s", cl_ricochet_sounds[COM_RandomLong( 0, 4 )] );
Q_strncpy( soundname, cl_ricochet_sounds[COM_RandomLong( 0, 4 )], sizeof( soundname ) );
break;
case BOUNCE_SHOTSHELL:
Q_snprintf( soundname, sizeof( soundname ), "%s", cl_weapon_shell_sounds[COM_RandomLong( 0, 2 )] );
Q_strncpy( soundname, cl_weapon_shell_sounds[COM_RandomLong( 0, 2 )], sizeof( soundname ) );
isshellcasing = true; // shell casings have different playback parameters
fvol = 0.5f;
break;
case BOUNCE_SHELL:
Q_snprintf( soundname, sizeof( soundname ), "%s", cl_player_shell_sounds[COM_RandomLong( 0, 2 )] );
Q_strncpy( soundname, cl_player_shell_sounds[COM_RandomLong( 0, 2 )], sizeof( soundname ) );
isshellcasing = true; // shell casings have different playback parameters
break;
case BOUNCE_CONCRETE:
@@ -461,17 +341,17 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
}
zvel = abs( pTemp->entity.baseline.origin[2] );
// only play one out of every n
if( isshellcasing )
{
// play first bounce, then 1 out of 3
{
// play first bounce, then 1 out of 3
if( zvel < 200 && COM_RandomLong( 0, 3 ))
return;
}
else
{
if( COM_RandomLong( 0, 5 ))
if( COM_RandomLong( 0, 5 ))
return;
}
@@ -479,11 +359,11 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
{
int pitch;
sound_t handle;
if( isshellcasing )
fvol *= min ( 1.0f, ((float)zvel) / 350.0f );
else fvol *= min ( 1.0f, ((float)zvel) / 450.0f );
fvol *= min ( 1.0f, ((float)zvel) / 350.0f );
else fvol *= min ( 1.0f, ((float)zvel) / 450.0f );
if( !COM_RandomLong( 0, 3 ) && !isshellcasing )
pitch = COM_RandomLong( 95, 105 );
else pitch = PITCH_NORM;
@@ -519,10 +399,9 @@ int CL_TempEntAddEntity( cl_entity_t *pEntity )
VectorCopy( pEntity->origin, pEntity->curstate.origin );
VectorCopy( pEntity->angles, pEntity->latched.prevangles );
VectorCopy( pEntity->origin, pEntity->latched.prevorigin );
// add to list
if( CL_AddVisibleEntity( pEntity, ET_TEMPENTITY ))
r_stats.c_active_tents_count++;
CL_AddVisibleEntity( pEntity, ET_TEMPENTITY );
return 1;
}
@@ -624,7 +503,7 @@ TEMPENTITY *CL_TempEntAllocHigh( const vec3_t org, model_t *pmodel )
if( !cl_free_tents )
{
// no temporary ents free, so find the first active low-priority temp ent
// no temporary ents free, so find the first active low-priority temp ent
// and overwrite it.
CL_FreeLowPriorityTempEnt();
}
@@ -632,7 +511,7 @@ TEMPENTITY *CL_TempEntAllocHigh( const vec3_t org, model_t *pmodel )
if( !cl_free_tents )
{
// didn't find anything? The tent list is either full of high-priority tents
// or all tents in the list are still due to live for > 10 seconds.
// or all tents in the list are still due to live for > 10 seconds.
Con_DPrintf( "Couldn't alloc a high priority TENT!\n" );
return NULL;
}
@@ -670,8 +549,8 @@ CL_TempEntAlloc
custom tempentity allocation
==============
*/
TEMPENTITY *CL_TempEntAllocCustom( const vec3_t org, model_t *model, int high, void (*pfn)( TEMPENTITY*, float, float ))
*/
TEMPENTITY * GAME_EXPORT CL_TempEntAllocCustom( const vec3_t org, model_t *model, int high, void (*pfn)( TEMPENTITY*, float, float ))
{
TEMPENTITY *pTemp;
@@ -708,7 +587,7 @@ R_FizzEffect
Create a fizz effect
==============
*/
void R_FizzEffect( cl_entity_t *pent, int modelIndex, int density )
void GAME_EXPORT R_FizzEffect( cl_entity_t *pent, int modelIndex, int density )
{
TEMPENTITY *pTemp;
int i, width, depth, count;
@@ -771,7 +650,7 @@ R_Bubbles
Create bubbles
==============
*/
void R_Bubbles( const vec3_t mins, const vec3_t maxs, float height, int modelIndex, int count, float speed )
void GAME_EXPORT R_Bubbles( const vec3_t mins, const vec3_t maxs, float height, int modelIndex, int count, float speed )
{
TEMPENTITY *pTemp;
float sine, cosine;
@@ -797,12 +676,12 @@ void R_Bubbles( const vec3_t mins, const vec3_t maxs, float height, int modelInd
pTemp->y = origin[1];
angle = COM_RandomFloat( -M_PI, M_PI );
SinCos( angle, &sine, &cosine );
zspeed = COM_RandomLong( 80, 140 );
VectorSet( pTemp->entity.baseline.origin, speed * cosine, speed * sine, zspeed );
pTemp->die = cl.time + ((height - (origin[2] - mins[2])) / zspeed) - 0.1f;
pTemp->entity.curstate.frame = COM_RandomLong( 0, pTemp->frameMax );
// Set sprite scale
pTemp->entity.curstate.scale = 1.0f / COM_RandomFloat( 2.0f, 5.0f );
pTemp->entity.curstate.rendermode = kRenderTransAlpha;
@@ -817,7 +696,7 @@ R_BubbleTrail
Create bubble trail
==============
*/
void R_BubbleTrail( const vec3_t start, const vec3_t end, float height, int modelIndex, int count, float speed )
void GAME_EXPORT R_BubbleTrail( const vec3_t start, const vec3_t end, float height, int modelIndex, int count, float speed )
{
TEMPENTITY *pTemp;
float sine, cosine, zspeed;
@@ -862,7 +741,7 @@ R_AttachTentToPlayer
Attaches entity to player
==============
*/
void R_AttachTentToPlayer( int client, int modelIndex, float zoffset, float life )
void GAME_EXPORT R_AttachTentToPlayer( int client, int modelIndex, float zoffset, float life )
{
TEMPENTITY *pTemp;
vec3_t position;
@@ -888,7 +767,7 @@ void R_AttachTentToPlayer( int client, int modelIndex, float zoffset, float life
pTemp->entity.curstate.renderfx = kRenderFxNoDissipation;
pTemp->entity.curstate.framerate = 1;
pTemp->clientIndex = client;
pTemp->tentOffset[0] = 0;
pTemp->tentOffset[1] = 0;
@@ -918,7 +797,7 @@ R_KillAttachedTents
Detach entity from player
==============
*/
void R_KillAttachedTents( int client )
void GAME_EXPORT R_KillAttachedTents( int client )
{
int i;
@@ -936,7 +815,7 @@ void R_KillAttachedTents( int client )
// if it is attached to this client, set it to die instantly.
if( pTemp->clientIndex == client )
{
// good enough, it will die on next tent update.
// good enough, it will die on next tent update.
pTemp->die = cl.time;
}
}
@@ -949,7 +828,7 @@ R_RicochetSprite
Create ricochet sprite
==============
*/
void R_RicochetSprite( const vec3_t pos, model_t *pmodel, float duration, float scale )
void GAME_EXPORT R_RicochetSprite( const vec3_t pos, model_t *pmodel, float duration, float scale )
{
TEMPENTITY *pTemp;
@@ -975,7 +854,7 @@ R_RocketFlare
Create rocket flare
==============
*/
void R_RocketFlare( const vec3_t pos )
void GAME_EXPORT R_RocketFlare( const vec3_t pos )
{
TEMPENTITY *pTemp;
@@ -1001,7 +880,7 @@ R_MuzzleFlash
Do muzzleflash
==============
*/
void R_MuzzleFlash( const vec3_t pos, int type )
void GAME_EXPORT R_MuzzleFlash( const vec3_t pos, int type )
{
TEMPENTITY *pTemp;
int index;
@@ -1040,7 +919,7 @@ Create a high priority blood sprite
and some blood drops. This is high-priority tent
==============
*/
void R_BloodSprite( const vec3_t org, int colorIndex, int modelIndex, int modelIndex2, float size )
void GAME_EXPORT R_BloodSprite( const vec3_t org, int colorIndex, int modelIndex, int modelIndex2, float size )
{
model_t *pModel, *pModel2;
int impactindex;
@@ -1126,7 +1005,7 @@ R_BreakModel
Create a shards
==============
*/
void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float random, float life, int count, int modelIndex, char flags )
void GAME_EXPORT R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float random, float life, int count, int modelIndex, char flags )
{
TEMPENTITY *pTemp;
model_t *pmodel;
@@ -1147,7 +1026,7 @@ void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float
// limit to 100 pieces
if( count > 100 ) count = 100;
for( i = 0; i < count; i++ )
for( i = 0; i < count; i++ )
{
vec3_t vecSpot;
@@ -1169,7 +1048,7 @@ void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float
// keep track of break_type, so we know how to play sound on collision
pTemp->hitSound = type;
if( pmodel->type == mod_sprite )
pTemp->entity.curstate.frame = COM_RandomLong( 0, pTemp->frameMax );
else if( pmodel->type == mod_studio )
@@ -1177,7 +1056,7 @@ void R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t dir, float
pTemp->flags |= FTENT_COLLIDEWORLD | FTENT_FADEOUT | FTENT_SLOWGRAVITY;
if( COM_RandomLong( 0, 255 ) < 200 )
if( COM_RandomLong( 0, 255 ) < 200 )
{
pTemp->flags |= FTENT_ROTATE;
pTemp->entity.baseline.angles[0] = COM_RandomFloat( -256, 255 );
@@ -1298,10 +1177,10 @@ TEMPENTITY *R_DefaultSprite( const vec3_t pos, int spriteIndex, float framerate
===============
R_SparkShower
Create an animated moving sprite
Create an animated moving sprite
===============
*/
void R_SparkShower( const vec3_t pos )
void GAME_EXPORT R_SparkShower( const vec3_t pos )
{
TEMPENTITY *pTemp;
@@ -1323,7 +1202,7 @@ void R_SparkShower( const vec3_t pos )
===============
R_TempSprite
Create an animated moving sprite
Create an animated moving sprite
===============
*/
TEMPENTITY *R_TempSprite( vec3_t pos, const vec3_t dir, float scale, int modelIndex, int rendermode, int renderfx, float a, float life, int flags )
@@ -1364,7 +1243,7 @@ R_Sprite_Explode
apply params for exploding sprite
===============
*/
void R_Sprite_Explode( TEMPENTITY *pTemp, float scale, int flags )
void GAME_EXPORT R_Sprite_Explode( TEMPENTITY *pTemp, float scale, int flags )
{
if( !pTemp ) return;
@@ -1372,7 +1251,7 @@ void R_Sprite_Explode( TEMPENTITY *pTemp, float scale, int flags )
{
// solid sprite
pTemp->entity.curstate.rendermode = kRenderNormal;
pTemp->entity.curstate.renderamt = 255;
pTemp->entity.curstate.renderamt = 255;
}
else if( FBitSet( flags, TE_EXPLFLAG_DRAWALPHA ))
{
@@ -1406,7 +1285,7 @@ R_Sprite_Smoke
apply params for smoke sprite
===============
*/
void R_Sprite_Smoke( TEMPENTITY *pTemp, float scale )
void GAME_EXPORT R_Sprite_Smoke( TEMPENTITY *pTemp, float scale )
{
int iColor;
@@ -1430,7 +1309,7 @@ R_Spray
Throws a shower of sprites or models
===============
*/
void R_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread, int rendermode )
void GAME_EXPORT R_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread, int rendermode )
{
TEMPENTITY *pTemp;
float noise;
@@ -1496,7 +1375,7 @@ R_Sprite_Spray
Spray of alpha sprites
===============
*/
void R_Sprite_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread )
void GAME_EXPORT R_Sprite_Spray( const vec3_t pos, const vec3_t dir, int modelIndex, int count, int speed, int spread )
{
R_Spray( pos, dir, modelIndex, count, speed, spread, kRenderGlow );
}
@@ -1509,7 +1388,7 @@ Line of moving glow sprites with gravity,
fadeout, and collisions
===============
*/
void R_Sprite_Trail( int type, vec3_t start, vec3_t end, int modelIndex, int count, float life, float size, float amp, int renderamt, float speed )
void GAME_EXPORT R_Sprite_Trail( int type, vec3_t start, vec3_t end, int modelIndex, int count, float life, float size, float amp, int renderamt, float speed )
{
TEMPENTITY *pTemp;
vec3_t delta, dir;
@@ -1561,7 +1440,7 @@ R_FunnelSprite
Create a funnel effect with custom sprite
===============
*/
void R_FunnelSprite( const vec3_t org, int modelIndex, int reverse )
void GAME_EXPORT R_FunnelSprite( const vec3_t org, int modelIndex, int reverse )
{
TEMPENTITY *pTemp;
vec3_t dir, dest;
@@ -1623,7 +1502,7 @@ R_SparkEffect
Create a streaks + richochet sprite
===============
*/
void R_SparkEffect( const vec3_t pos, int count, int velocityMin, int velocityMax )
void GAME_EXPORT R_SparkEffect( const vec3_t pos, int count, int velocityMin, int velocityMax )
{
R_RicochetSprite( pos, cl_sprite_ricochet, 0.1f, COM_RandomFloat( 0.5f, 1.0f ));
R_SparkStreaks( pos, count, velocityMin, velocityMax );
@@ -1636,14 +1515,14 @@ R_RicochetSound
Make a random ricochet sound
==============
*/
void R_RicochetSound( const vec3_t pos )
void GAME_EXPORT R_RicochetSound( const vec3_t pos )
{
int iPitch = COM_RandomLong( 90, 105 );
float fvol = COM_RandomFloat( 0.7f, 0.9f );
char soundpath[32];
sound_t handle;
Q_snprintf( soundpath, sizeof( soundpath ), "%s", cl_ricochet_sounds[COM_RandomLong( 0, 4 )] );
Q_strncpy( soundpath, cl_ricochet_sounds[COM_RandomLong( 0, 4 )], sizeof( soundpath ) );
handle = S_RegisterSound( soundpath );
S_StartSound( pos, 0, CHAN_AUTO, handle, fvol, ATTN_NORM, iPitch, 0 );
@@ -1656,7 +1535,7 @@ R_Projectile
Create an projectile entity
==============
*/
void R_Projectile( const vec3_t origin, const vec3_t velocity, int modelIndex, int life, int owner, void (*hitcallback)( TEMPENTITY*, pmtrace_t* ))
void GAME_EXPORT R_Projectile( const vec3_t origin, const vec3_t velocity, int modelIndex, int life, int owner, void (*hitcallback)( TEMPENTITY*, pmtrace_t* ))
{
TEMPENTITY *pTemp;
model_t *pmodel;
@@ -1705,7 +1584,7 @@ R_TempSphereModel
Spherical shower of models, picks from set
==============
*/
void R_TempSphereModel( const vec3_t pos, float speed, float life, int count, int modelIndex )
void GAME_EXPORT R_TempSphereModel( const vec3_t pos, float speed, float life, int count, int modelIndex )
{
TEMPENTITY *pTemp;
int i;
@@ -1753,7 +1632,7 @@ R_Explosion
Create an explosion (scale is magnitude)
==============
*/
void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags )
void GAME_EXPORT R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags )
{
sound_t hSound;
@@ -1793,7 +1672,7 @@ void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags
if( !FBitSet( flags, TE_EXPLFLAG_NOSOUND ))
{
hSound = S_RegisterSound( va( "%s", cl_explode_sounds[COM_RandomLong( 0, 2 )] ));
hSound = S_RegisterSound( cl_explode_sounds[COM_RandomLong( 0, 2 )] );
S_StartSound( pos, 0, CHAN_STATIC, hSound, VOL_NORM, 0.3f, PITCH_NORM, 0 );
}
}
@@ -1805,7 +1684,7 @@ R_PlayerSprites
Create a particle smoke around player
==============
*/
void R_PlayerSprites( int client, int modelIndex, int count, int size )
void GAME_EXPORT R_PlayerSprites( int client, int modelIndex, int count, int size )
{
TEMPENTITY *pTemp;
cl_entity_t *pEnt;
@@ -1870,7 +1749,7 @@ R_FireField
Makes a field of fire
==============
*/
void R_FireField( float *org, int radius, int modelIndex, int count, int flags, float life )
void GAME_EXPORT R_FireField( float *org, int radius, int modelIndex, int count, int flags, float life )
{
TEMPENTITY *pTemp;
model_t *pmodel;
@@ -1945,7 +1824,7 @@ R_MultiGunshot
Client version of shotgun shot
==============
*/
void R_MultiGunshot( const vec3_t org, const vec3_t dir, const vec3_t noise, int count, int decalCount, int *decalIndices )
void GAME_EXPORT R_MultiGunshot( const vec3_t org, const vec3_t dir, const vec3_t noise, int count, int decalCount, int *decalIndices )
{
pmtrace_t trace;
vec3_t right, up;
@@ -2001,7 +1880,7 @@ R_Sprite_WallPuff
Create a wallpuff
==============
*/
void R_Sprite_WallPuff( TEMPENTITY *pTemp, float scale )
void GAME_EXPORT R_Sprite_WallPuff( TEMPENTITY *pTemp, float scale )
{
if( !pTemp ) return;
@@ -2013,6 +1892,8 @@ void R_Sprite_WallPuff( TEMPENTITY *pTemp, float scale )
pTemp->die = cl.time + 0.01f;
}
/*
==============
CL_ParseTempEntity
@@ -2024,7 +1905,7 @@ void CL_ParseTempEntity( sizebuf_t *msg )
{
sizebuf_t buf;
byte pbuf[256];
int iSize = MSG_ReadWord( msg );
int iSize;
int type, color, count, flags;
int decalIndex, modelIndex, entityIndex;
float scale, life, frameRate, vel, random;
@@ -2035,6 +1916,10 @@ void CL_ParseTempEntity( sizebuf_t *msg )
cl_entity_t *pEnt;
dlight_t *dl;
if( cls.legacymode )
iSize = MSG_ReadByte( msg );
else iSize = MSG_ReadWord( msg );
decalIndex = modelIndex = entityIndex = 0;
// parse user message into buffer
@@ -2520,7 +2405,7 @@ LIGHT STYLE MANAGEMENT
==============================================================
*/
#define STYLE_LERPING_THRESHOLD 3.0f // because we wan't interpolate fast sequences (like on\off)
/*
================
CL_ClearLightStyles
@@ -2691,7 +2576,7 @@ void CL_DecayLights( void )
dlight_t *dl;
float time;
int i;
time = cl.time - cl.oldtime;
for( i = 0, dl = cl_dlights; i < MAX_DLIGHTS; i++, dl++ )
@@ -2701,7 +2586,7 @@ void CL_DecayLights( void )
dl->radius -= time * dl->decay;
if( dl->radius < 0 ) dl->radius = 0;
if( dl->die < cl.time || !dl->radius )
if( dl->die < cl.time || !dl->radius )
memset( dl, 0, sizeof( *dl ));
}
@@ -2712,11 +2597,23 @@ void CL_DecayLights( void )
dl->radius -= time * dl->decay;
if( dl->radius < 0 ) dl->radius = 0;
if( dl->die < cl.time || !dl->radius )
if( dl->die < cl.time || !dl->radius )
memset( dl, 0, sizeof( *dl ));
}
}
dlight_t *CL_GetDynamicLight( int number )
{
Assert( number >= 0 && number < MAX_DLIGHTS );
return &cl_dlights[number];
}
dlight_t *CL_GetEntityLight( int number )
{
Assert( number >= 0 && number < MAX_ELIGHTS );
return &cl_elights[number];
}
/*
================
CL_UpdateFlashlight
@@ -2778,7 +2675,7 @@ void CL_UpdateFlashlight( cl_entity_t *ent )
else falloff = 500.0f / falloff;
falloff *= falloff;
// apply brigthness to dlight
// apply brigthness to dlight
dl->color.r = bound( 0, falloff * 255, 255 );
dl->color.g = bound( 0, falloff * 255, 255 );
dl->color.b = bound( 0, falloff * 255, 255 );
@@ -2801,7 +2698,7 @@ void CL_AddEntityEffects( cl_entity_t *ent )
if( FBitSet( ent->curstate.effects, EF_DIMLIGHT ))
{
if( ent->player && !CL_IsQuakeCompatible( ))
if( ent->player && !Host_IsQuakeCompatible( ))
{
CL_UpdateFlashlight( ent );
}
@@ -2813,10 +2710,10 @@ void CL_AddEntityEffects( cl_entity_t *ent )
VectorCopy( ent->origin, dl->origin );
dl->die = cl.time + 0.001;
}
}
}
if( FBitSet( ent->curstate.effects, EF_BRIGHTLIGHT ))
{
{
dlight_t *dl = CL_AllocDlight( ent->index );
dl->color.r = dl->color.g = dl->color.b = 250;
if( ent->player ) dl->radius = 400; // don't flickering
@@ -2948,7 +2845,7 @@ void CL_TestLights( void )
numLights = bound( 1, cl_testlights->value, MAX_DLIGHTS );
AngleVectors( cl.viewangles, forward, right, NULL );
for( i = 0; i < numLights; i++ )
{
dl = &cl_dlights[i];
@@ -2974,18 +2871,6 @@ DECAL MANAGEMENT
==============================================================
*/
/*
===============
CL_DecalShoot
normal temporary decal
===============
*/
void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags )
{
R_DecalShoot( textureIndex, entityIndex, modelIndex, pos, flags, 1.0f );
}
/*
===============
CL_FireCustomDecal
@@ -2993,9 +2878,21 @@ CL_FireCustomDecal
custom temporary decal
===============
*/
void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale )
void GAME_EXPORT CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale )
{
R_DecalShoot( textureIndex, entityIndex, modelIndex, pos, flags, scale );
ref.dllFuncs.R_DecalShoot( textureIndex, entityIndex, modelIndex, pos, flags, scale );
}
/*
===============
CL_DecalShoot
normal temporary decal
===============
*/
void GAME_EXPORT CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags )
{
CL_FireCustomDecal( textureIndex, entityIndex, modelIndex, pos, flags, 1.0f );
}
/*
@@ -3026,7 +2923,7 @@ void CL_PlayerDecal( int playernum, int customIndex, int entityIndex, float *pos
}
}
R_DecalShoot( textureIndex, entityIndex, 0, pos, FDECAL_CUSTOM, 1.0f );
CL_DecalShoot( textureIndex, entityIndex, 0, pos, FDECAL_CUSTOM );
}
/*
@@ -3036,7 +2933,7 @@ CL_DecalIndexFromName
get decal global index from decalname
===============
*/
int CL_DecalIndexFromName( const char *name )
int GAME_EXPORT CL_DecalIndexFromName( const char *name )
{
int i;
@@ -3059,14 +2956,14 @@ CL_DecalIndex
get texture index from decal global index
===============
*/
int CL_DecalIndex( int id )
int GAME_EXPORT CL_DecalIndex( int id )
{
id = bound( 0, id, MAX_DECALS - 1 );
if( cl.decal_index[id] == 0 )
{
Image_SetForceFlags( IL_LOAD_DECAL );
cl.decal_index[id] = GL_LoadTexture( host.draw_decals[id], NULL, 0, TF_DECAL );
cl.decal_index[id] = ref.dllFuncs.GL_LoadTexture( host.draw_decals[id], NULL, 0, TF_DECAL );
Image_ClearForceFlags();
}
@@ -3080,10 +2977,10 @@ CL_DecalRemoveAll
remove all decals with specified texture
===============
*/
void CL_DecalRemoveAll( int textureIndex )
void GAME_EXPORT CL_DecalRemoveAll( int textureIndex )
{
int id = bound( 0, textureIndex, MAX_DECALS - 1 );
R_DecalRemoveAll( cl.decal_index[id] );
int id = bound( 0, textureIndex, MAX_DECALS - 1 );
ref.dllFuncs.R_DecalRemoveAll( cl.decal_index[id] );
}
/*
@@ -3112,7 +3009,30 @@ void CL_ClearEfrags( void )
clgame.free_efrags[i].entnext = &clgame.free_efrags[i+1];
clgame.free_efrags[i].entnext = NULL;
}
/*
=======================
R_ClearStaticEntities
e.g. by demo request
=======================
*/
void CL_ClearStaticEntities( void )
{
int i;
if( host.type == HOST_DEDICATED )
return;
// clear out efrags in case the level hasn't been reloaded
for( i = 0; i < cl.worldmodel->numleafs; i++ )
cl.worldmodel->leafs[i+1].efrags = NULL;
clgame.numStatics = 0;
CL_ClearEfrags ();
}
/*
==============
CL_ClearEffects
@@ -3126,4 +3046,5 @@ void CL_ClearEffects( void )
CL_ClearViewBeams ();
CL_ClearParticles ();
CL_ClearLightStyles ();
}
}

View File

@@ -16,6 +16,8 @@ GNU General Public License for more details.
#ifndef CL_TENT_H
#define CL_TENT_H
#include "triangleapi.h"
// EfxAPI
struct particle_s *R_AllocParticle( void (*callback)( struct particle_s*, float ));
void R_Explosion( vec3_t pos, int model, float scale, float framerate, int flags );
@@ -87,6 +89,9 @@ void CL_DecalRemoveAll( int textureIndex );
int CL_DecalIndexFromName( const char *name );
int CL_DecalIndex( int id );
// RefAPI
struct particle_s *CL_AllocParticleFast( void );
// Beams
struct beam_s *R_BeamLightning( vec3_t start, vec3_t end, int modelIndex, float life, float width, float amplitude, float brightness, float speed );
struct beam_s *R_BeamEnts( int startEnt, int endEnt, int modelIndex, float life, float width, float amplitude, float brightness, float speed, int startFrame, float framerate, float r, float g, float b );
@@ -99,22 +104,18 @@ void R_BeamKill( int deadEntity );
// TriAPI
void TriBegin( int mode );
void TriTexCoord2f( float u, float v );
void TriVertex3fv( const float *v );
void TriVertex3f( float x, float y, float z );
int TriBoxInPVS( float *mins, float *maxs );
void TriRenderMode( int mode );
void TriColor4f( float r, float g, float b, float a );
int TriSpriteTexture( model_t *pSpriteModel, int frame );
void TriColor4fRendermode( float r, float g, float b, float a, int rendermode );
int TriWorldToScreen( float *world, float *screen );
void TriColor4ub( byte r, byte g, byte b, byte a );
void TriBrightness( float brightness );
void TriRenderMode( int mode );
void TriCullFace( int mode );
void TriEnd( void );
void TriCullFace( TRICULLSTYLE mode );
int TriWorldToScreen( const float *world, float *screen );
int TriBoxInPVS( float *mins, float *maxs );
void TriLightAtPoint( float *pos, float *value );
void TriColor4fRendermode( float r, float g, float b, float a, int rendermode );
int TriSpriteTexture( model_t *pSpriteModel, int frame );
extern model_t *cl_sprite_dot;
extern model_t *cl_sprite_shell;
#endif//CL_TENT_H
#endif//CL_TENT_H

View File

@@ -15,7 +15,6 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "gl_local.h"
/*
=================================================================
@@ -25,7 +24,7 @@ AVI PLAYING
=================================================================
*/
static long xres, yres;
static int xres, yres;
static float video_duration;
static float cin_time;
static int cin_frame;
@@ -85,9 +84,10 @@ void SCR_CreateStartupVids( void )
void SCR_CheckStartupVids( void )
{
int c = 0;
char *afile, *pfile;
byte *afile;
char *pfile;
string token;
if( Sys_CheckParm( "-nointro" ) || host_developer.value || cls.demonum != -1 || GameState->nextstate != STATE_RUNFRAME )
{
// don't run movies where we in developer-mode
@@ -102,9 +102,9 @@ void SCR_CheckStartupVids( void )
afile = FS_LoadFile( DEFAULT_VIDEOLIST_PATH, NULL, false );
if( !afile ) return; // something bad happens
pfile = afile;
pfile = (char *)afile;
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
{
Q_strncpy( cls.movies[c], token, sizeof( cls.movies[0] ));
@@ -122,7 +122,7 @@ void SCR_CheckStartupVids( void )
SCR_NextMovie ();
Cbuf_Execute();
}
/*
==================
SCR_RunCinematic
@@ -152,7 +152,7 @@ void SCR_RunCinematic( void )
return;
}
// advances cinematic time (ignores maxfps and host_framerate settings)
// advances cinematic time (ignores maxfps and host_framerate settings)
cin_time += host.realframetime;
// stop the video after it finishes
@@ -180,7 +180,7 @@ qboolean SCR_DrawCinematic( void )
qboolean redraw = false;
byte *frame = NULL;
if( !glw_state.initialized || cin_time <= 0.0f )
if( !ref.initialized || cin_time <= 0.0f )
return false;
if( cin_frame != last_frame )
@@ -190,11 +190,11 @@ qboolean SCR_DrawCinematic( void )
redraw = true;
}
R_DrawStretchRaw( 0, 0, glState.width, glState.height, xres, yres, frame, redraw );
ref.dllFuncs.R_DrawStretchRaw( 0, 0, refState.width, refState.height, xres, yres, frame, redraw );
return true;
}
/*
==================
SCR_PlayCinematic
@@ -238,11 +238,11 @@ qboolean SCR_PlayCinematic( const char *arg )
Con_FastClose();
cin_time = 0.0f;
cls.signon = 0;
return true;
}
long SCR_GetAudioChunk( char *rawdata, long length )
int SCR_GetAudioChunk( char *rawdata, int length )
{
int r;
@@ -258,7 +258,7 @@ wavdata_t *SCR_GetMovieInfo( void )
return &cin_audio;
return NULL;
}
/*
==================
SCR_StopCinematic
@@ -307,4 +307,4 @@ void SCR_FreeCinematic( void )
AVI_CloseVideo( cin_state );
AVI_Shutdown();
}
}

View File

@@ -17,9 +17,10 @@ GNU General Public License for more details.
#include "client.h"
#include "const.h"
#include "entity_types.h"
#include "gl_local.h"
#include "vgui_draw.h"
#include "sound.h"
#include "input.h" // touch
#include "platform/platform.h" // GL_UpdateSwapInterval
/*
===============
@@ -34,7 +35,7 @@ void V_CalcViewRect( void )
int sb_lines;
float size;
// intermission is always full screen
// intermission is always full screen
if( cl.intermission ) size = 120.0f;
else size = scr_viewsize->value;
@@ -44,7 +45,7 @@ void V_CalcViewRect( void )
sb_lines = 24; // no inventory
else sb_lines = 48;
if( scr_viewsize->value >= 100.0 )
if( scr_viewsize->value >= 100.0f )
{
full = true;
size = 100.0f;
@@ -57,19 +58,19 @@ void V_CalcViewRect( void )
sb_lines = 0;
full = true;
}
size /= 100.0;
size /= 100.0f;
clgame.viewport[2] = glState.width * size;
clgame.viewport[3] = glState.height * size;
clgame.viewport[2] = refState.width * size;
clgame.viewport[3] = refState.height * size;
if( clgame.viewport[3] > glState.height - sb_lines )
clgame.viewport[3] = glState.height - sb_lines;
if( clgame.viewport[3] > glState.height )
clgame.viewport[3] = glState.height;
if( clgame.viewport[3] > refState.height - sb_lines )
clgame.viewport[3] = refState.height - sb_lines;
if( clgame.viewport[3] > refState.height )
clgame.viewport[3] = refState.height;
clgame.viewport[0] = ( glState.width - clgame.viewport[2] ) / 2;
clgame.viewport[0] = ( refState.width - clgame.viewport[2] ) / 2;
if( full ) clgame.viewport[1] = 0;
else clgame.viewport[1] = ( glState.height - sb_lines - clgame.viewport[3] ) / 2;
else clgame.viewport[1] = ( refState.height - sb_lines - clgame.viewport[3] ) / 2;
}
@@ -113,8 +114,8 @@ void V_SetRefParams( ref_params_t *fd )
memset( fd, 0, sizeof( ref_params_t ));
// probably this is not needs
VectorCopy( RI.vieworg, fd->vieworg );
VectorCopy( RI.viewangles, fd->viewangles );
VectorCopy( refState.vieworg, fd->vieworg );
VectorCopy( refState.viewangles, fd->viewangles );
fd->frametime = host.frametime;
fd->time = cl.time;
@@ -183,7 +184,7 @@ void V_RefApplyOverview( ref_viewpass_t *rvp )
return;
// NOTE: Xash3D may use 16:9 or 16:10 aspects
aspect = (float)glState.width / (float)glState.height;
aspect = (float)refState.width / (float)refState.height;
size_x = fabs( 8192.0f / ov->flZoom );
size_y = fabs( 8192.0f / (ov->flZoom * aspect ));
@@ -216,7 +217,7 @@ void V_RefApplyOverview( ref_viewpass_t *rvp )
SetBits( rvp->flags, RF_DRAW_OVERVIEW );
Mod_SetOrthoBounds( mins, maxs );
ref.dllFuncs.GL_OrthoBounds( mins, maxs );
}
/*
@@ -254,7 +255,7 @@ void V_GetRefParams( ref_params_t *fd, ref_viewpass_t *rvp )
rvp->fov_y = V_CalcFov( &rvp->fov_x, clgame.viewport[2], clgame.viewport[3] );
// adjust FOV for widescreen
if( glState.wideScreen && r_adjust_fov->value )
if( refState.wideScreen && r_adjust_fov->value )
V_AdjustFov( &rvp->fov_x, &rvp->fov_y, clgame.viewport[2], clgame.viewport[3], false );
rvp->flags = 0;
@@ -273,7 +274,7 @@ V_PreRender
qboolean V_PreRender( void )
{
// too early
if( !glw_state.initialized )
if( !ref.initialized )
return false;
if( host.status == HOST_NOFOCUS )
@@ -292,8 +293,10 @@ qboolean V_PreRender( void )
}
return false;
}
R_BeginFrame( !cl.paused && ( cls.state == ca_active ));
ref.dllFuncs.R_BeginFrame( !cl.paused && ( cls.state == ca_active ));
GL_UpdateSwapInterval( );
return true;
}
@@ -312,15 +315,15 @@ void V_RenderView( void )
ref_viewpass_t rvp;
int viewnum = 0;
if( !cl.video_prepped || ( UI_IsVisible() && !cl.background ))
if( !cl.video_prepped || ( !ui_renderworld->value && UI_IsVisible() && !cl.background ))
return; // still loading
V_CalcViewRect (); // compute viewport rectangle
V_SetRefParams( &rp );
V_SetupViewModel ();
R_Set2DMode( false );
ref.dllFuncs.R_Set2DMode( false );
SCR_DirtyScreen();
GL_BackendStartFrame ();
ref.dllFuncs.GL_BackendStartFrame ();
do
{
@@ -330,11 +333,10 @@ void V_RenderView( void )
if( viewnum == 0 && FBitSet( rvp.flags, RF_ONLY_CLIENTDRAW ))
{
pglClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
pglClear( GL_COLOR_BUFFER_BIT );
ref.dllFuncs.R_ClearScreen();
}
R_RenderFrame( &rvp );
GL_RenderFrame( &rvp );
S_UpdateFrame( &rvp );
viewnum++;
@@ -342,7 +344,101 @@ void V_RenderView( void )
// draw debug triangles on a server
SV_DrawDebugTriangles ();
GL_BackendEndFrame ();
ref.dllFuncs.GL_BackendEndFrame ();
}
#define POINT_SIZE 16.0f
#define NODE_INTERVAL_X(x) (x * 16.0f)
#define NODE_INTERVAL_Y(x) (x * 16.0f)
void R_DrawLeafNode( float x, float y, float scale )
{
float downScale = scale * 0.25f;// * POINT_SIZE;
ref.dllFuncs.R_DrawStretchPic( x - downScale * 0.5f, y - downScale * 0.5f, downScale, downScale, 0, 0, 1, 1, R_GetBuiltinTexture( REF_PARTICLE_TEXTURE ) );
}
void R_DrawNodeConnection( float x, float y, float x2, float y2 )
{
ref.dllFuncs.Begin( TRI_LINES );
ref.dllFuncs.Vertex3f( x, y, 0 );
ref.dllFuncs.Vertex3f( x2, y2, 0 );
ref.dllFuncs.End( );
}
void R_ShowTree_r( mnode_t *node, float x, float y, float scale, int shownodes, mleaf_t *viewleaf )
{
float downScale = scale * 0.8f;
downScale = Q_max( downScale, 1.0f );
if( !node ) return;
world.recursion_level++;
if( node->contents < 0 )
{
mleaf_t *leaf = (mleaf_t *)node;
if( world.recursion_level > world.max_recursion )
world.max_recursion = world.recursion_level;
if( shownodes == 1 )
{
if( cl.worldmodel->leafs == leaf )
ref.dllFuncs.Color4f( 1.0f, 1.0f, 1.0f, 1.0f );
else if( viewleaf && viewleaf == leaf )
ref.dllFuncs.Color4f( 1.0f, 0.0f, 0.0f, 1.0f );
else ref.dllFuncs.Color4f( 0.0f, 1.0f, 0.0f, 1.0f );
R_DrawLeafNode( x, y, scale );
}
world.recursion_level--;
return;
}
if( shownodes == 1 )
{
ref.dllFuncs.Color4f( 0.0f, 0.0f, 1.0f, 1.0f );
R_DrawLeafNode( x, y, scale );
}
else if( shownodes == 2 )
{
R_DrawNodeConnection( x, y, x - scale, y + scale );
R_DrawNodeConnection( x, y, x + scale, y + scale );
}
R_ShowTree_r( node->children[1], x - scale, y + scale, downScale, shownodes, viewleaf );
R_ShowTree_r( node->children[0], x + scale, y + scale, downScale, shownodes, viewleaf );
world.recursion_level--;
}
void R_ShowTree( void )
{
float x = (float)((refState.width - (int)POINT_SIZE) >> 1);
float y = NODE_INTERVAL_Y(1.0f);
mleaf_t *viewleaf;
if( !cl.worldmodel || !CVAR_TO_BOOL( r_showtree ))
return;
world.recursion_level = 0;
viewleaf = Mod_PointInLeaf( refState.vieworg, cl.worldmodel->nodes );
//pglEnable( GL_BLEND );
//pglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
//pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
//pglLineWidth( 2.0f );
ref.dllFuncs.Color4f( 1, 0.7f, 0, 1.0f );
//pglDisable( GL_TEXTURE_2D );
R_ShowTree_r( cl.worldmodel->nodes, x, y, world.max_recursion * 3.5f, 2, viewleaf );
//pglEnable( GL_TEXTURE_2D );
//pglLineWidth( 1.0f );
R_ShowTree_r( cl.worldmodel->nodes, x, y, world.max_recursion * 3.5f, 1, viewleaf );
Con_NPrintf( 0, "max recursion %d\n", world.max_recursion );
}
/*
@@ -356,14 +452,14 @@ void V_PostRender( void )
static double oldtime;
qboolean draw_2d = false;
R_AllowFog( false );
R_Set2DMode( true );
ref.dllFuncs.R_AllowFog( false );
ref.dllFuncs.R_Set2DMode( true );
if( cls.state == ca_active && cls.signon == SIGNONS && cls.scrshot_action != scrshot_mapshot )
{
SCR_TileClear();
CL_DrawHUD( CL_ACTIVE );
VGui_Paint( true );
VGui_Paint();
}
switch( cls.scrshot_action )
@@ -379,21 +475,24 @@ void V_PostRender( void )
{
SCR_RSpeeds();
SCR_NetSpeeds();
SCR_DrawPos();
SCR_DrawNetGraph();
SV_DrawOrthoTriangles();
CL_DrawDemoRecording();
CL_DrawHUD( CL_CHANGELEVEL );
R_ShowTextures();
ref.dllFuncs.R_ShowTextures();
R_ShowTree();
Con_DrawConsole();
UI_UpdateMenu( host.realtime );
Con_DrawVersion();
Con_DrawDebug(); // must be last
Touch_Draw();
OSK_Draw();
S_ExtraUpdate();
}
SCR_MakeScreenShot();
R_AllowFog( true );
R_EndFrame();
}
ref.dllFuncs.R_AllowFog( true );
ref.dllFuncs.R_EndFrame();
}

View File

@@ -16,7 +16,8 @@ GNU General Public License for more details.
#ifndef CLIENT_H
#define CLIENT_H
#include "mathlib.h"
#include "xash3d_types.h"
#include "xash3d_mathlib.h"
#include "cdll_int.h"
#include "menu_int.h"
#include "cl_entity.h"
@@ -31,35 +32,13 @@ GNU General Public License for more details.
#include "netchan.h"
#include "net_api.h"
#include "world.h"
#define MAX_DEMOS 32
#define MAX_MOVIES 8
#define MAX_CDTRACKS 32
#define MAX_CLIENT_SPRITES 256 // SpriteTextures
#define MAX_EFRAGS 8192 // Arcane Dimensions required
#define MAX_REQUESTS 64
// screenshot types
#define VID_SCREENSHOT 0
#define VID_LEVELSHOT 1
#define VID_MINISHOT 2
#define VID_MAPSHOT 3 // special case for overview layer
#define VID_SNAPSHOT 4 // save screenshot into root dir and no gamma correction
#include "ref_common.h"
// client sprite types
#define SPR_CLIENT 0 // client sprite for temp-entities or user-textures
#define SPR_HUDSPRITE 1 // hud sprite
#define SPR_MAPSPRITE 2 // contain overview.bmp that diced into frames 128x128
typedef int sound_t;
typedef enum
{
DEMO_INACTIVE = 0,
DEMO_XASH3D,
DEMO_QUAKE1
} demo_mode;
//=============================================================================
typedef struct netbandwithgraph_s
{
@@ -116,7 +95,11 @@ typedef struct
#define ANGLE_MASK (ANGLE_BACKUP - 1)
#define CL_UPDATE_MASK (CL_UPDATE_BACKUP - 1)
#if XASH_LOW_MEMORY == 2
#define CL_UPDATE_BACKUP SINGLEPLAYER_BACKUP
#else
extern int CL_UPDATE_BACKUP;
#endif
#define SIGNONS 2 // signon messages to receive before connected
#define INVALID_HANDLE 0xFFFF // for XashXT cache system
@@ -124,10 +107,10 @@ extern int CL_UPDATE_BACKUP;
#define MIN_UPDATERATE 10.0f
#define MAX_UPDATERATE 102.0f
#define MIN_EX_INTERP 50.0f
#define MAX_EX_INTERP 100.0f
#define MIN_EX_INTERP 0.005f
#define MAX_EX_INTERP 0.1f
#define CL_MIN_RESEND_TIME 1.5f // mininum time gap (in seconds) before a subsequent connection request is sent.
#define CL_MIN_RESEND_TIME 1.5f // mininum time gap (in seconds) before a subsequent connection request is sent.
#define CL_MAX_RESEND_TIME 20.0f // max time. The cvar cl_resend is bounded by these.
#define cl_serverframetime() (cl.mtime[0] - cl.mtime[1])
@@ -166,13 +149,6 @@ typedef struct
float weaponstarttime;
} cl_local_data_t;
typedef struct
{
char name[MAX_OSPATH];
char modelname[MAX_OSPATH];
model_t *model;
} player_model_t;
typedef struct
{
qboolean bUsed;
@@ -204,7 +180,7 @@ typedef struct
// render a frame yet
int parsecount; // server message counter
int parsecountmod; // modulo with network window
qboolean video_prepped; // false if on new level or new ref dll
qboolean audio_prepped; // false if on new level or new snd dll
qboolean paused;
@@ -237,7 +213,6 @@ typedef struct
float timedelta; // floating delta between two updates
char serverinfo[MAX_SERVERINFO_STRING];
player_model_t player_models[MAX_CLIENTS]; // cache of player models
player_info_t players[MAX_CLIENTS]; // collected info about all other players include himself
double lastresourcecheck;
string downloadUrl;
@@ -293,6 +268,8 @@ typedef struct
short decal_index[MAX_DECALS];
model_t *worldmodel; // pointer to world
int lostpackets; // count lost packets and show dialog in menu
} client_t;
/*
@@ -303,16 +280,6 @@ of server connections
==================================================================
*/
typedef enum
{
ca_disconnected = 0,// not talking to a server
ca_connecting, // sending request packets to the server
ca_connected, // netchan_t established, waiting for svc_serverdata
ca_validate, // download resources, validating, auth on server
ca_active, // game views should be displayed
ca_cinematic, // playing a cinematic, not connected to a server
} connstate_t;
typedef enum
{
scrshot_inactive,
@@ -339,7 +306,7 @@ typedef struct
char name[32];
int number; // svc_ number
int size; // if size == -1, size come from first byte after svcnum
pfnUserMsgHook func; // user-defined function
pfnUserMsgHook func; // user-defined function
} cl_user_message_t;
typedef void (*pfnEventHook)( event_args_t *args );
@@ -378,7 +345,7 @@ typedef struct
qboolean adjust_size; // allow to adjust scale for fonts
int renderMode; // override kRenderMode from TriAPI
int cullMode; // override CULL FACE from TriAPI
TRICULLSTYLE cullMode; // override CULL FACE from TriAPI
// holds text color
rgba_t textColor;
@@ -446,16 +413,6 @@ typedef struct
float applied_angle;
} screen_shake_t;
typedef struct
{
unsigned short textures[MAX_SKINS];// alias textures
struct mstudiotex_s *ptexture; // array of textures with local copy of remapped textures
short numtextures; // textures count
short topcolor; // cached value
short bottomcolor; // cached value
model_t *model; // for catch model changes
} remap_info_t;
typedef enum
{
NET_REQUEST_CANCEL = 0, // request was cancelled for some reasons
@@ -480,7 +437,7 @@ typedef struct
void *hInstance; // pointer to client.dll
cldll_func_t dllFuncs; // dll exported funcs
render_interface_t drawFuncs; // custom renderer support
byte *mempool; // client edicts pool
poolhandle_t mempool; // client edicts pool
string mapname; // map name
string maptitle; // display map title
string itemspath; // path to items description for auto-complete func
@@ -530,13 +487,16 @@ typedef struct
efrag_t *free_efrags; // linked efrags
cl_entity_t viewent; // viewmodel
qboolean client_dll_uses_sdl;
} clgame_static_t;
typedef struct
{
void *hInstance; // pointer to client.dll
UI_FUNCTIONS dllFuncs; // dll exported funcs
byte *mempool; // client edicts pool
UI_EXTENDED_FUNCTIONS dllFuncs2; // fwgs extension
poolhandle_t mempool; // client edicts pool
cl_entity_t playermodel; // uiPlayerSetup drawing model
player_info_t playerinfo; // local playerinfo
@@ -548,9 +508,11 @@ typedef struct
ui_globalvars_t *globals;
qboolean drawLogo; // set to TRUE if logo.avi missed or corrupted
long logo_xres;
long logo_yres;
int logo_xres;
int logo_yres;
float logo_length;
qboolean use_text_api;
} gameui_static_t;
typedef struct
@@ -572,11 +534,11 @@ typedef struct
keydest_t key_dest;
byte *mempool; // client premamnent pool: edicts etc
poolhandle_t mempool; // client premamnent pool: edicts etc
netadr_t hltv_listen_address;
int signon; // 0 to SIGNONS, for the signon sequence.
int signon; // 0 to SIGNONS, for the signon sequence.
int quakePort; // a 16 bit value that allows quake servers
// to work around address translating routers
// g-cont. this port allow many copies of engine in multiplayer game
@@ -602,7 +564,7 @@ typedef struct
double packet_loss_recalc_time;
int starting_count; // message num readed bits
float nextcmdtime; // when can we send the next command packet?
float nextcmdtime; // when can we send the next command packet?
int lastoutgoingcommand; // sequence number of last outgoing command
int lastupdate_sequence; // prediction stuff
@@ -648,7 +610,7 @@ typedef struct
// demo recording info must be here, so it isn't clearing on level change
qboolean demorecording;
qboolean demoplayback;
int demoplayback;
qboolean demowaiting; // don't record until a non-delta message is received
qboolean timedemo;
string demoname; // for demo looping
@@ -657,6 +619,17 @@ typedef struct
file_t *demofile;
file_t *demoheader; // contain demo startup info in case we record a demo on this level
qboolean internetservers_wait; // internetservers is waiting for dns request
qboolean internetservers_pending; // internetservers is waiting for dns request
// legacy mode support
qboolean legacymode; // one-way 48 protocol compatibility
netadr_t legacyserver;
netadr_t legacyservers[MAX_LEGACY_SERVERS];
int legacyservercount;
int extensions;
netadr_t serveradr;
} client_static_t;
#ifdef __cplusplus
@@ -682,11 +655,10 @@ extern convar_t cl_allow_download;
extern convar_t cl_allow_upload;
extern convar_t cl_download_ingame;
extern convar_t *cl_nopred;
extern convar_t *cl_showfps;
extern convar_t *cl_envshot_size;
extern convar_t *cl_timeout;
extern convar_t *cl_nodelta;
extern convar_t *cl_interp;
extern convar_t *cl_nointerp;
extern convar_t *cl_showerror;
extern convar_t *cl_nosmooth;
extern convar_t *cl_smoothtime;
@@ -704,10 +676,14 @@ extern convar_t *cl_levelshot_name;
extern convar_t *cl_draw_beams;
extern convar_t *cl_clockreset;
extern convar_t *cl_fixtimerate;
extern convar_t *hud_scale;
extern convar_t *gl_showtextures;
extern convar_t *cl_bmodelinterp;
extern convar_t *cl_righthand;
extern convar_t *cl_lw; // local weapons
extern convar_t *cl_charset;
extern convar_t *cl_trace_messages;
extern convar_t *hud_utf8;
extern convar_t *cl_showevents;
extern convar_t *scr_centertime;
extern convar_t *scr_viewsize;
@@ -715,19 +691,24 @@ extern convar_t *scr_loading;
extern convar_t *v_dark; // start from dark
extern convar_t *net_graph;
extern convar_t *rate;
extern convar_t *m_ignore;
extern convar_t *r_showtree;
extern convar_t *ui_renderworld;
//=============================================================================
void CL_SetLightstyle( int style, const char* s, float f );
void CL_RunLightStyles( void );
void CL_DecayLights( void );
dlight_t *CL_GetDynamicLight( int number );
dlight_t *CL_GetEntityLight( int number );
//=================================================
//
// cl_cmds.c
//
void CL_Quit_f( void );
void CL_Quit_f( void ) NORETURN;
void CL_ScreenShot_f( void );
void CL_SnapShot_f( void );
void CL_PlayCDTrack_f( void );
@@ -737,7 +718,7 @@ void CL_SaveShot_f( void );
void CL_LevelShot_f( void );
void CL_SetSky_f( void );
void SCR_Viewpos_f( void );
void SCR_TimeRefresh_f( void );
void CL_WavePlayLen_f( void );
//
// cl_custom.c
@@ -757,6 +738,11 @@ void CL_ResetFrame( frame_t *frame );
void CL_WriteMessageHistory( void );
const char *CL_MsgInfo( int cmd );
//
// cl_efx.c
//
void CL_Particle( const vec3_t org, int color, float life, int zpos, int zvel );
//
// cl_main.c
//
@@ -765,7 +751,7 @@ void CL_SendCommand( void );
void CL_Disconnect_f( void );
void CL_ProcessFile( qboolean successfully_received, const char *filename );
void CL_WriteUsercmd( sizebuf_t *msg, int from, int to );
int CL_GetFragmentSize( void *unused );
int CL_GetFragmentSize( void *unused , fragsize_t mode );
qboolean CL_PrecacheResources( void );
void CL_SetupOverviewParams( void );
void CL_UpdateFrameLerp( void );
@@ -841,27 +827,43 @@ int CL_FindModelIndex( const char *m );
cl_entity_t *CL_GetLocalPlayer( void );
model_t *CL_LoadClientSprite( const char *filename );
model_t *CL_LoadModel( const char *modelname, int *index );
HSPRITE pfnSPR_Load( const char *szPicName );
HSPRITE EXPORT pfnSPR_Load( const char *szPicName );
HSPRITE pfnSPR_LoadExt( const char *szPicName, uint texFlags );
void PicAdjustSize( float *x, float *y, float *w, float *h );
int CL_GetScreenInfo( SCREENINFO *pscrinfo );
void CL_FillRGBA( int x, int y, int width, int height, int r, int g, int b, int a );
void CL_PlayerTrace( float *start, float *end, int traceFlags, int ignore_pe, pmtrace_t *tr );
void CL_PlayerTraceExt( float *start, float *end, int traceFlags, int (*pfnIgnore)( physent_t *pe ), pmtrace_t *tr );
void CL_SetTraceHull( int hull );
void CL_GetMousePosition( int *mx, int *my ); // TODO: move to input
cl_entity_t* CL_GetViewModel( void );
void pfnGetScreenFade( struct screenfade_s *fade );
physent_t *pfnGetPhysent( int idx );
struct msurface_s *pfnTraceSurface( int ground, float *vstart, float *vend );
movevars_t *pfnGetMoveVars( void );
_inline cl_entity_t *CL_EDICT_NUM( int n )
{
if( !clgame.entities )
{
Host_Error( "CL_EDICT_NUM: clgame.entities is NULL\n");
return NULL;
}
if(( n >= 0 ) && ( n < clgame.maxEntities ))
return clgame.entities + n;
Host_Error( "CL_EDICT_NUM: bad number %i\n", n );
return NULL;
return NULL;
}
//
// cl_parse.c
//
void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message );
void CL_ParseLegacyServerMessage( sizebuf_t *msg, qboolean normal_message );
void CL_LegacyPrecache_f( void );
void CL_ParseTempEntity( sizebuf_t *msg );
void CL_StartResourceDownloading( const char *pszMessage, qboolean bCustom );
qboolean CL_DispatchUserMessage( const char *pszName, int iSize, void *pbuf );
@@ -886,6 +888,7 @@ void SCR_MakeLevelShot( void );
void SCR_NetSpeeds( void );
void SCR_RSpeeds( void );
void SCR_DrawFPS( int height );
void SCR_DrawPos( void );
//
// cl_netgraph.c
@@ -935,14 +938,11 @@ void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient );
//
void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message );
//
// cl_studio.c
//
void CL_InitStudioAPI( void );
//
// cl_frame.c
//
struct channel_s;
struct rawchan_s;
int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta );
qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType );
void CL_ResetLatchedVars( cl_entity_t *ent, qboolean full_reset );
@@ -960,33 +960,44 @@ void CL_EmitEntities( void );
// cl_remap.c
//
remap_info_t *CL_GetRemapInfoForEntity( cl_entity_t *e );
void CL_AllocRemapInfo( int topcolor, int bottomcolor );
void CL_AllocRemapInfo( cl_entity_t *entity, model_t *model, int topcolor, int bottomcolor );
void CL_FreeRemapInfo( remap_info_t *info );
void R_StudioSetRemapColors( int top, int bottom );
void CL_UpdateRemapInfo( int topcolor, int bottomcolor );
void CL_UpdateRemapInfo( cl_entity_t *ent, int topcolor, int bottomcolor );
void CL_ClearAllRemaps( void );
//
// cl_render.c
//
qboolean R_InitRenderAPI( void );
int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef );
lightstyle_t *CL_GetLightStyle( int number );
int R_FatPVS( const vec3_t org, float radius, byte *visbuffer, qboolean merge, qboolean fullvis );
const ref_overview_t *GL_GetOverviewParms( void );
//
// cl_efrag.c
//
void R_StoreEfrags( efrag_t **ppefrag, int framecount );
void R_AddEfrags( cl_entity_t *ent );
void R_RemoveEfrags( cl_entity_t *ent );
//
// cl_tent.c
//
struct particle_s;
int CL_AddEntity( int entityType, cl_entity_t *pEnt );
void CL_WeaponAnim( int iAnim, int body );
void CL_ClearEffects( void );
void CL_ClearEfrags( void );
void CL_TestLights( void );
void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean trans_pass, float frametime );
void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale );
void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags );
void CL_PlayerDecal( int playerIndex, int textureIndex, int entityIndex, float *pos );
void R_FreeDeadParticles( struct particle_s **ppparticles );
void CL_AddClientResource( const char *filename, int type );
void CL_AddClientResources( void );
int CL_FxBlend( cl_entity_t *e );
void CL_InitParticles( void );
void CL_ClearParticles( void );
void CL_FreeParticles( void );
void CL_DrawParticles( double frametime );
void CL_DrawTracers( double frametime );
void CL_InitTempEnts( void );
void CL_ClearTempEnts( void );
void CL_FreeTempEnts( void );
@@ -994,12 +1005,13 @@ void CL_TempEntUpdate( void );
void CL_InitViewBeams( void );
void CL_ClearViewBeams( void );
void CL_FreeViewBeams( void );
void CL_DrawBeams( int fTrans );
void CL_AddCustomBeam( cl_entity_t *pEnvBeam );
cl_entity_t *R_BeamGetEntity( int index );
void CL_KillDeadBeams( cl_entity_t *pDeadEntity );
void CL_ParseViewBeam( sizebuf_t *msg, int beamType );
void CL_LoadClientSprites( void );
void CL_ReadPointFile_f( void );
void CL_DrawEFX( float time, qboolean fTrans );
void CL_ThinkParticle( double frametime, particle_t *p );
void CL_ReadLineFile_f( void );
void CL_RunLightStyles( void );
@@ -1007,7 +1019,7 @@ void CL_RunLightStyles( void );
// console.c
//
extern convar_t *con_fontsize;
qboolean Con_Visible( void );
int Con_Visible( void );
qboolean Con_FixedFont( void );
void Con_VidInit( void );
void Con_Shutdown( void );
@@ -1017,6 +1029,10 @@ void Con_DrawDebug( void );
void Con_RunConsole( void );
void Con_DrawConsole( void );
void Con_DrawVersion( void );
int Con_UtfProcessChar( int in );
int Con_UtfProcessCharForce( int in );
int Con_UtfMoveLeft( char *str, int pos );
int Con_UtfMoveRight( char *str, int pos, int length );
void Con_DrawStringLen( const char *pText, int *length, int *height );
int Con_DrawString( int x, int y, const char *string, rgba_t setColor );
int Con_DrawCharacter( int x, int y, int number, rgba_t color );
@@ -1029,13 +1045,18 @@ void Con_RestoreFont( void );
void Key_Console( int key );
void Key_Message( int key );
void Con_FastClose( void );
void Con_Bottom( void );
void Con_Top( void );
void Con_PageDown( int lines );
void Con_PageUp( int lines );
void Con_LoadHistory( void );
//
// s_main.c
//
void S_StreamRawSamples( int samples, int rate, int width, int channels, const byte *data );
void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float synctime );
void S_StartBackgroundTrack( const char *intro, const char *loop, long position, qboolean fullpath );
void S_StartBackgroundTrack( const char *intro, const char *loop, int position, qboolean fullpath );
void S_StopBackgroundTrack( void );
void S_StreamSetPause( int pause );
void S_StartStreaming( void );
@@ -1069,12 +1090,29 @@ qboolean UI_CreditsActive( void );
void UI_CharEvent( int key );
qboolean UI_MouseInRect( void );
qboolean UI_IsVisible( void );
void UI_ResetPing( void );
void UI_ShowUpdateDialog( qboolean preferStore );
void UI_ShowMessageBox( const char *text );
void UI_AddTouchButtonToList( const char *name, const char *texture, const char *command, unsigned char *color, int flags );
void UI_ConnectionProgress_Disconnect( void );
void UI_ConnectionProgress_Download( const char *pszFileName, const char *pszServerName, const char *pszServerPath, int iCurrent, int iTotal, const char *comment );
void UI_ConnectionProgress_DownloadEnd( void );
void UI_ConnectionProgress_Precache( void );
void UI_ConnectionProgress_Connect( const char *server );
void UI_ConnectionProgress_ChangeLevel( void );
void UI_ConnectionProgress_ParseServerInfo( const char *server );
void pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a );
void pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc );
//
// cl_mobile.c
//
qboolean Mobile_Init( void );
void Mobile_Shutdown( void );
//
// cl_video.c
//
@@ -1087,4 +1125,27 @@ void SCR_RunCinematic( void );
void SCR_StopCinematic( void );
void CL_PlayVideo_f( void );
#endif//CLIENT_H
//
// keys.c
//
int Key_IsDown( int keynum );
const char *Key_IsBind( int keynum );
void Key_Event( int key, int down );
void Key_Init( void );
void Key_WriteBindings( file_t *f );
const char *Key_GetBinding( int keynum );
void Key_SetBinding( int keynum, const char *binding );
void Key_ClearStates( void );
const char *Key_KeynumToString( int keynum );
int Key_StringToKeynum( const char *str );
int Key_GetKey( const char *binding );
void Key_EnumCmds_f( void );
void Key_SetKeyDest( int key_dest );
void Key_EnableTextInput( qboolean enable, qboolean force );
int Key_ToUpper( int key );
void OSK_Draw( void );
extern rgba_t g_color_table[8];
#endif//CLIENT_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More