Compare commits

...

3741 commits

Author SHA1 Message Date
smallmodel
cce81cabff
Implement multi-master queries and heartbeats (#717)
Some checks are pending
Build branch / build-all (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Implement multi-master server list query and multi-master heartbeats. The server list is fetched from multiple masters to improve redundancy, reliability and performance. This improves multiplayer availability by implementing support for using multiple masters.
- The server sends an heartbeat to all masters at once
- The client can query up to 4 masters in parallel depending on their rate
2025-04-27 22:14:08 +02:00
smallmodel
08a985d183
Format script grammar source files
Some checks failed
Build branch / build-all (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
2025-04-26 19:35:45 +02:00
smallmodel
816126b13a
Add ScriptVariable conditions from Ubertools into the script lexer
Those are Ubertools / F.A.K.K remnants that are valid in original mohaa script grammar
2025-04-26 19:10:08 +02:00
smallmodel
f2a6278daa
Fix stage being written past the limit (#716) 2025-04-26 16:39:25 +02:00
smallmodel
c1efc0e066
Set the minimum number to 30 for cl_maxpackets
Some checks failed
Build branch / build-all (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
20 is the bare minimum for players, any value below makes movements look jittery on a 20 fps server. 30 is the optimal value based on network variation and fps variations
2025-04-23 23:56:05 +02:00
smallmodel
236897cfcc
Set the server list socket as non-blocking
Some checks are pending
Build branch / build-all (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
This prevents the game from freezing when the connection is slow or if the master server is unreachable
2025-04-23 00:37:48 +02:00
smallmodel
73b4569c07
Add Com_InitGameSpy() for future use 2025-04-22 22:51:06 +02:00
smallmodel
25de66ed80
Fix wrong function name 2025-04-22 22:01:29 +02:00
smallmodel
a2bbf6cff8
Use functions that return master host information
This splits gamespy client-specific and server-specific code and add common gamespy code to provide more flexibility in the future
2025-04-22 21:40:34 +02:00
smallmodel
01367d0731
Use a more recent version of the gqueryreporting code
Some checks are pending
Build branch / build-all (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
2025-04-22 01:35:28 +02:00
smallmodel
fedc993e57
Initialize the player buffer list 2025-04-22 01:19:42 +02:00
smallmodel
b597240cfd
Link gcd_key to gcd_qr2
This is primarily used for clarity
2025-04-22 00:48:39 +02:00
smallmodel
127c9fe8f4
Uncomment WSACleanup()
The previous issue was because gqueryreporting was not calling SocketStartUp() as expected
2025-04-22 00:31:39 +02:00
smallmodel
ffc35fb5ab
Use the original gqueryreporting from GameSpy SDK
Potentially more stable and thoroughly tested
2025-04-22 00:27:00 +02:00
smallmodel
aa7639485e
Use __linux__ definition to check for linux 2025-04-22 00:25:29 +02:00
smallmodel
a4267d4f77
Initialize update list only for queries that are neither grouprooms or masterinfo 2025-04-21 22:31:41 +02:00
smallmodel
12880db557
Don't force HRTF if the speaker type is not "Headphones" 2025-04-21 21:26:33 +02:00
smallmodel
881d7f2f51
Don't refresh the server list if it's not ready
The server list UI refresh the server list for the first time when drawing. In mohaa (not Spearhead nor Breakthrough), refreshserverlist is also called by clicking "browse internet servers" which causes the list to be queried twice
2025-04-21 21:03:42 +02:00
smallmodel
93335978ea
Code formatting 2025-04-21 20:40:55 +02:00
smallmodel
64f62583ce
Set a more explicit version number
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 44s
Makes it easier to identify the currently running OPM version from the server list, useful for troubleshooting and checking if the server is up to date
2025-04-20 21:42:33 +02:00
smallmodel
5530d3051b
Fix missing spaces between product information in the logfile
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 1m16s
2025-04-19 21:36:58 +02:00
smallmodel
42326ec708
Fix timestamps printed twice on the same line (#714) 2025-04-19 21:35:53 +02:00
smallmodel
aa54e3c673
Use an epsilon value to check if float numbers are equal (#713) 2025-04-19 21:11:51 +02:00
smallmodel
5ce7f4faa5
Compile Windows ARM64 builds using Windows-11 ARM
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 44s
This allows to distribute the load across completely different hosts and also to make sure it compiles on ARM platforms
2025-04-19 14:16:54 +02:00
smallmodel
6d20a438db
Shorter paragraph
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 48s
2025-04-18 21:28:37 +02:00
smallmodel
7f662a93df
Update features.md 2025-04-18 21:20:02 +02:00
smallmodel
1758a0cd2e
Move whitelisted server commands to a dedicated source file 2025-04-18 18:49:12 +02:00
smallmodel
9b003b5428
Update OpenAL to version 1.24.3 2025-04-18 18:11:18 +02:00
smallmodel
db7fdd57e4
Add a section about other systems
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 1m18s
2025-04-17 23:34:49 +02:00
smallmodel
689da52ddf
Master server address update
This uplinks directly with 333networks instead of using a domain as an alias
2025-04-17 22:55:31 +02:00
smallmodel
2a1e2d7d6c
Check for valid scoreboard menu
Some checks failed
Build branch / build-all (push) Failing after 1m11s
CodeQL / Analyze (push) Has been cancelled
Under rare circumstances, the scoreboard menu can be NULL and would cause a crash. This was fixed in mohaab 2.30
2025-04-15 18:37:35 +02:00
smallmodel
cf8af91516
Remove macOS package cache due to permission errors
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 48s
2025-04-15 00:40:48 +02:00
smallmodel
c9ff941600
Implement Instant Action from Breakthrough (#712)
This adds a feature that makes it easy to join a populated low-ping server (matching criteria from configuration file). This feature has been available since MOHAA Breakthrough 2.30.
2025-04-15 00:31:34 +02:00
smallmodel
d389f89c49
Simplified the running documentation
Some checks failed
Build branch / build-all (push) Failing after 46s
CodeQL / Analyze (push) Has been cancelled
2025-04-12 22:49:15 +02:00
smallmodel
e05114806a
Add a simple install guide for Windows users 2025-04-12 22:35:05 +02:00
smallmodel
3074494131
Convert the game version to number once
Some checks failed
Build branch / build-all (push) Failing after 44s
CodeQL / Analyze (push) Has been cancelled
2025-04-04 22:53:06 +02:00
smallmodel
a9e161181c
Improve compiling documentation
Some checks failed
Build branch / build-all (push) Failing after 1m37s
CodeQL / Analyze (push) Has been cancelled
2025-04-01 22:43:58 +02:00
smallmodel
f9db0ab8f9
Fix an access violation that would occur when opening the logfile before com_version is created (#708) 2025-04-01 22:07:05 +02:00
smallmodel
94cc77b848
Set cmake version to 3.5 minimum for libmad 2025-04-01 21:33:16 +02:00
smallmodel
f16bec1e0a
Remove #pragma once from uimessage
Some checks failed
Build branch / build-all (push) Failing after 1m13s
CodeQL / Analyze (push) Has been cancelled
2025-03-24 22:16:53 +01:00
smallmodel
e2c24abf62
Move alext functions out of qal.h (#706)
qal.h should contain core/required functions. To get functions from extensions, alGetProcAddress should be used, so they can be optional
2025-03-24 22:16:43 +01:00
smallmodel
50e3aa1f61
Fix compilation errors with AL local headers (#705)
Some checks failed
Build branch / build-all (push) Failing after 48s
CodeQL / Analyze (push) Has been cancelled
* Remove alext inclusion as it's included by qal.h already

* Update local AL headers
2025-03-22 23:45:41 +01:00
Trung Lê
3c15588292
Update compiling.md (#704)
PowerPC64 LE run the game perfectly
2025-03-22 23:25:50 +01:00
Sébastien Noel
fdab158290
fix build on Debian mips64el (#700)
Some checks failed
Build branch / build-all (push) Failing after 59s
CodeQL / Analyze (push) Has been cancelled
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-03-19 15:26:26 +01:00
Sébastien Noel
921726e0b8
Fix a few typos (#699)
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-03-19 15:03:01 +01:00
Sébastien Noel
b5e49df180
fix build with shared jpeg library (#701) 2025-03-19 14:46:12 +01:00
smallmodel
49fd4acef8
Wrap WriteCallback around HAS_LIBCURL define
Some checks failed
Build branch / build-all (push) Failing after 48s
CodeQL / Analyze (push) Has been cancelled
2025-03-17 11:50:41 +01:00
smallmodel
73aa377264
Fix hit/kill notify being swapped (#698)
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 42s
2025-03-17 00:19:40 +01:00
smallmodel
74e909d17f
Add echo 2025-03-15 19:48:17 +01:00
smallmodel
4b3c150004
Add cg_cameraverticaldisplacement 2025-03-15 19:47:35 +01:00
smallmodel
5ee7948071
Add more sound-related commands 2025-03-15 19:43:23 +01:00
smallmodel
f653317e5b
Add the reason parameter to banaddr documentation
Some checks failed
Build branch / build-all (push) Failing after 57s
CodeQL / Analyze (push) Has been cancelled
2025-03-13 23:57:45 +01:00
smallmodel
de43299841
Add a note about updates 2025-03-13 23:57:08 +01:00
smallmodel
e6f5d76abe
Set the appropriate headers to use API versioning 2025-03-13 23:42:50 +01:00
smallmodel
fecd1eb505
Preallocate and set the maximum buffer size to receive the request 2025-03-13 23:37:20 +01:00
smallmodel
9536a8ec64
Specify a small timeout for each request 2025-03-13 22:41:01 +01:00
smallmodel
06a12246f5
Notify the request thread of shutdown only if it's waiting
This avoids a deadlock that would occur if notify_all() is called before the thread is waiting
2025-03-13 22:37:21 +01:00
smallmodel
456b660b2a
Improve the update checker so it can be opt-out (#696)
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 1m4s
* Add a cvar to enable/disable update checking

* Refactor update checker

This splits the thread part from the main part to clarify the code

* Move and update the configuration documentation, for a more general approach
2025-03-13 21:09:42 +01:00
smallmodel
5b81f6a977
Merge pull request #695 from smallmodel/update_fix
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 43s
Fix the update code
2025-03-13 00:13:38 +01:00
smallmodel
c854df8ffa
Don't start the update thread if it shouldn't be active or if the network doesn't work 2025-03-12 23:58:24 +01:00
smallmodel
22a34d8d68
Fix compile error when libcurl is not installed 2025-03-12 23:18:11 +01:00
smallmodel
0f8969e076
Merge pull request #693 from ysdragon/ban-kick-with-reason
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 44s
Kick/Ban with/no reason
2025-03-12 18:20:48 +01:00
ysdragon
f164e889cc
Add optional reason to kick/ban commands
And enhance `SV_IsBanned` to return ban reason and update `SV_DirectConnect` to display it
2025-03-12 07:30:40 +02:00
ysdragon
1e2a331518
Add reason field to serverBan structure with defined maximum length 2025-03-12 07:30:22 +02:00
smallmodel
158ff62aaa
Fix small typo
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 59s
2025-03-12 00:02:44 +01:00
smallmodel
79af8a46d1
Increase update thread sleep time
This prevents wasting time in scheduling the thread
2025-03-11 23:57:40 +01:00
smallmodel
200bf3229c
Merge pull request #692 from smallmodel/update_notification
Add a client-side update notification
2025-03-11 23:53:51 +01:00
smallmodel
e0b7d4cc60
Display a message box to the client when a new update is available 2025-03-11 23:37:51 +01:00
smallmodel
4fe11b5ea9
Always return false for CheckNewVersion() if libcurl is not used 2025-03-11 23:37:34 +01:00
smallmodel
0b590ab147
Add a way to create a message box 2025-03-11 23:32:22 +01:00
smallmodel
7a20bb4deb
Add a new method that return version numbers 2025-03-11 23:32:18 +01:00
smallmodel
c87c242098
Add a getter for m_font 2025-03-11 23:31:16 +01:00
smallmodel
eb92182230
Split OS builds between different workflow files
Some checks failed
Build branch / build-all (push) Failing after 43s
CodeQL / Analyze (push) Has been cancelled
2025-03-08 16:19:08 +01:00
smallmodel
5b9efaa2a0
Remove cpp-httplib
Some checks failed
Build branch / build-all (push) Failing after 23s
CodeQL / Analyze (push) Has been cancelled
2025-03-06 20:21:23 +01:00
smallmodel
58f7e6f1fe
Use cURL instead of cpp-httplib 2025-03-05 23:40:05 +01:00
smallmodel
9538dcb6e7
Print network name change
Some checks failed
Build branch / build-all (push) Failing after 26s
CodeQL / Analyze (push) Has been cancelled
2025-03-03 22:36:46 +01:00
smallmodel
0080f55ef8
Round to integer to avoid blurry text
Some checks failed
Build branch / build-all (push) Failing after 20s
CodeQL / Analyze (push) Has been cancelled
2025-03-02 14:12:54 +01:00
smallmodel
aac91e8763
Refactor and simplify Alias_ListSort 2025-03-02 13:55:44 +01:00
smallmodel
5c0adf9a28
Refactor Alias_FindRandomRange 2025-03-02 13:49:01 +01:00
smallmodel
9963a99868
Fix a stack overflow issue (#686)
The length check now include the null-terminated character
2025-03-02 13:40:36 +01:00
smallmodel
515a531abf
Use the length returned by Com_sprintf 2025-03-02 13:26:47 +01:00
smallmodel
d3d16ab7b6
Use the index of the entry in the player list, rather than the client number 2025-03-02 13:24:08 +01:00
smallmodel
d08027360f
Formatting 2025-03-01 23:34:24 +01:00
smallmodel
70f6ede7b8
Add GAMESPY_PORT environment variable
Some checks failed
Build branch / build-all (push) Failing after 17s
CodeQL / Analyze (push) Has been cancelled
2025-03-01 00:09:33 +01:00
smallmodel
c1c70a53be
Transition to idle after grouprooms or masterinfo requests are finished 2025-02-28 18:12:34 +01:00
smallmodel
f89bfba5dc
Replace tabs by spaces 2025-02-28 18:11:09 +01:00
smallmodel
c1a66bf9e7
Update README
Some checks failed
Build branch / build-all (push) Failing after 17s
CodeQL / Analyze (push) Has been cancelled
2025-02-24 23:08:13 +01:00
smallmodel
e98c725043
Fix player having no damage alpha in mohaas and mohaab (#678) 2025-02-24 22:11:41 +01:00
smallmodel
ad527a7033
Use ubuntu-22.04-arm OS for GitHub Actions to improve build time 2025-02-24 21:42:42 +01:00
smallmodel
59706d4698
Cache third-party packages to optimize the build time 2025-02-24 20:05:55 +01:00
smallmodel
7addef4f5f
Use Windows Server 2025 to compile Windows binaries
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2025-02-24 16:44:00 +01:00
smallmodel
08d0a378f8
Fix compilation fail when DEBUG_MEM is set (#677) 2025-02-24 13:38:33 +01:00
smallmodel
01381ed084
Add HTTP support and update checking
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-02-24 02:20:31 +01:00
smallmodel
2c72908f76
Use the correct allocator when archiving a con_set object
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
The default c++ allocator was be used to allocate an array of pointers, but then when destroying the array, Z_Free was called which would throw an error
2025-02-22 23:31:20 +01:00
smallmodel
32ba71693c
Remove some unnecessary endian swap 2025-02-22 22:56:57 +01:00
smallmodel
7fff3192a6
Fix server object mistakenly casted to int 2025-02-22 22:34:19 +01:00
smallmodel
83aa818c00
Don't add the same server twice 2025-02-22 22:24:19 +01:00
smallmodel
56d61bdef3
Implement support for parsing group rooms and master info 2025-02-22 22:13:23 +01:00
smallmodel
ebd86b32bd
Improve code clarity 2025-02-22 22:12:34 +01:00
smallmodel
08c718d232
Add support for server list encryption and tell the master server to return the server list encrypted 2025-02-22 20:39:10 +01:00
smallmodel
512831dea9
Properly unregister events from the level object
Some checks failed
Build branch / build-all (push) Failing after 18s
CodeQL / Analyze (push) Has been cancelled
Unregister() was mistakenly being called on the DM_Manager object when it should have been called on the level object, to unregister events like axiswin, allieswin, draw
2025-02-20 20:36:19 +01:00
smallmodel
a36bbb0cda
Remove useless qr fields
Some checks failed
Build branch / build-all (push) Failing after 39s
CodeQL / Analyze (push) Has been cancelled
2025-02-19 20:39:56 +01:00
smallmodel
8a9e0f0b01
Update master server address
It's now using master.openmohaa.org, which provides more flexibility for configuring the domain
2025-02-19 20:39:44 +01:00
smallmodel
076fd69131
Use the engine allocator to allocate/delete memory from the table of pointers 2025-02-19 20:11:07 +01:00
smallmodel
587f7f544e
Add REF_DLL for mem_blockalloc 2025-02-19 20:03:23 +01:00
smallmodel
178c486b83
Use NewEntry/DeleteEntry like con_set 2025-02-19 18:16:53 +01:00
smallmodel
ad1748b8be
Fix memory leaks (#668)
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-02-18 23:27:43 +01:00
smallmodel
004f88dae9
Use a better method for storing class lists
This prevents allocating a ClassDef just to act as a root list. The classlist would never be freed (memory leak)
2025-02-18 22:39:52 +01:00
smallmodel
97fe824b80
Clear subtitles for all nodes when deleting the alias list 2025-02-18 22:35:48 +01:00
smallmodel
758176dd32
Delete the waitTillSet when destroying the class 2025-02-18 21:52:35 +01:00
smallmodel
854c1980cc
Make EventQueueNode part of LightClass 2025-02-18 21:46:34 +01:00
smallmodel
840002b63a
Save and restore bots when needed
When the map was changing, it allocated an array of saved bots which would never be used due to the game module being freed, it caused a memory leaka
2025-02-18 21:35:23 +01:00
smallmodel
47a447dbb0
Remove all state scripts that were created
This fixes a memory leak that also occurs in the original game
2025-02-18 21:08:44 +01:00
smallmodel
a1d47cf64a
Add placement new/placement delete 2025-02-18 20:54:24 +01:00
smallmodel
a5bb4c1874
Free up debug strings when deallocating game-data
This fixes a memory leak, which also occurs in the original game
2025-02-18 20:43:03 +01:00
smallmodel
22b593215f
Implement stop, threadmove and moveoffset
Some checks failed
Build branch / build-all (push) Failing after 24s
CodeQL / Analyze (push) Has been cancelled
2025-02-15 14:39:54 +01:00
smallmodel
68181acec7
Implement Stop() 2025-02-15 14:39:39 +01:00
smallmodel
3af35fa610
Correctly parse the function name in ScriptDeprecatedAlt
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-02-15 00:51:19 +01:00
smallmodel
2c12d4f2de
Add a newline to ScriptDeprecatedAlt functions 2025-02-15 00:46:24 +01:00
smallmodel
bbac9c559c
Escape variable name 2025-02-14 23:54:15 +01:00
smallmodel
03eaa62902
Merge pull request #666 from ysdragon/fix-openbsd-compilation
Some checks failed
Build branch / build-all (push) Failing after 14s
CodeQL / Analyze (push) Has been cancelled
Fix compilation under OpenBSD
2025-02-08 23:33:58 +01:00
smallmodel
dcca5ed469
Merge branch 'ladder_getters' 2025-02-08 22:23:00 +01:00
smallmodel
2aa46f5a52
Add getters to get facing dir and angles for FuncLadder 2025-02-08 22:22:53 +01:00
smallmodel
ff3c27ab20
Fix assertion when the height is identical between vert0 and vert1 2025-02-08 20:28:46 +01:00
ysdragon
833408c663
Don't link against rt for musl and *BSD platforms 2025-02-08 04:03:24 +02:00
ysdragon
38d9f98221
Update gsPlatformThread.h to include pthread for OpenBSD 2025-02-08 03:49:24 +02:00
smallmodel
ac4b4266b4
Merge pull request #663 from richardradics/resolve-127-gamespy-deprecated-dialog
Some checks failed
Build branch / build-all (push) Failing after 14s
CodeQL / Analyze (push) Has been cancelled
feat: add GameSpy service unavailable dialog
2025-02-06 23:05:59 +01:00
smallmodel
b90bbd9dcf
Format document 2025-02-06 22:56:49 +01:00
smallmodel
e8f69e197c
Initialize variables from the class 2025-02-06 22:56:24 +01:00
smallmodel
9922a7095b
Activate the control and connect dialog's W_Deactivated after its creation
As the control is activated before, the connection should be done after the activation because ActivateControl() sends W_Activated to the UIFloatingWindow, which will cause ActivateControl() to be called again to activate the dialog's title bar button (and would deactivate the gamespy dialog)
2025-02-06 22:50:21 +01:00
smallmodel
3c836144e2
Move widget object creation from the constructor to FrameInitialized() 2025-02-06 22:41:50 +01:00
smallmodel
8c4a593fb0
Merge branch 'resolve-127-gamespy-deprecated-dialog' of https://github.com/richardradics/openmohaa into richardradics-resolve-127-gamespy-deprecated-dialog 2025-02-06 22:27:23 +01:00
smallmodel
0e282833e6
Merge pull request #665 from bulldozerecske/main
Updated FAQ
2025-02-06 22:19:26 +01:00
Bulldozer
54753caf94
Updated FAQ
Added 1 new FAQ and refined format.
2025-02-06 21:24:44 +01:00
Richard Radics
fcba3bed95 feat: add GameSpy service unavailable dialog
resolves #127
2025-02-05 23:12:05 +01:00
smallmodel
d348ac66de
Merge pull request #662 from richardradics/fix-545-loadgame-elapsed-logged
Some checks failed
Build branch / build-all (push) Failing after 14s
CodeQL / Analyze (push) Has been cancelled
fix: fix elapsed time and logged date in loadgame ui
2025-02-04 23:45:15 +01:00
Richard Radics
fd4f5e7d51 fix: fix elapsed time and logged date in loadgame ui
fixes #545
2025-02-04 22:14:52 +01:00
smallmodel
c77fcd2cbc
Clear the edict model when freeing the edict
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s
This fixes an issue where configstrings or game state chars would overflow when many models (such as actors with random headmodels/headskins) are spawned
2025-02-04 21:28:37 +01:00
smallmodel
ee385abfef
Update links to third-party libraries 2025-02-04 18:52:46 +01:00
smallmodel
49335ba8a8
Fix improper check of dir->path empty string
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 14s
2025-02-04 00:08:37 +01:00
smallmodel
8ac186ce17
Mark Archive() as override 2025-02-04 00:08:16 +01:00
smallmodel
ca2322a4da
Add recursive check in Com_Printf
This prevents recursive call to Com_Printf during localization and also remove localization errors
2025-02-04 00:03:30 +01:00
smallmodel
a1e7afac76
Prevent using a trick to spoof another name in 1.11 and below 2025-02-03 23:51:40 +01:00
smallmodel
2f75092d8b
Reserve console name for DMMessage 2025-02-03 23:42:38 +01:00
smallmodel
6f9e710ec9
Update events documentation
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s
2025-02-03 22:12:35 +01:00
smallmodel
0b12d160bb
Properly construct all objects that has been allocated with AddObjectAt() 2025-02-03 21:28:13 +01:00
smallmodel
330b45a1ed
Fix container object list not constructed when loading 2025-02-03 21:27:44 +01:00
smallmodel
5f0a0d0363
Update events documentation 2025-02-03 20:57:07 +01:00
smallmodel
ad01c2d966
Fix wrong flags getting checked for allowed weapons 2025-02-03 20:43:03 +01:00
smallmodel
fb5ed82401
Add events documentation 2025-02-03 20:24:35 +01:00
smallmodel
eaa7f10b36
Remove useless print 2025-02-03 20:24:26 +01:00
smallmodel
f2c8dbe57a
Merge pull request #661 from bulldozerecske/main
Updated FAQ
2025-02-03 20:05:24 +01:00
Bulldozer
447b0459aa
Merge branch 'openmoh:main' into main 2025-02-03 19:56:11 +01:00
Bulldozer
e31c64e42e
Updated FAQ
Added 2 additional issues and changed the layout.
2025-02-03 19:55:20 +01:00
smallmodel
32411b2a90
Rename player_damage to player_damaged.
The name was ambiguous. The delegate is triggered when the player gets hit (getting damaged), and not when the player damages someone else. The name properly matches the action.
2025-02-03 19:35:04 +01:00
smallmodel
32f850556e
Set the self object when triggering the delegate 2025-02-03 19:33:41 +01:00
smallmodel
fd94f53e25
Add a delegate for player text messages
self = the player who sent the message
first parameter = the text
second parameter = is team message?
2025-02-03 19:32:14 +01:00
smallmodel
4aa7e06a56
Make ev optional for Trigger() 2025-02-03 19:23:54 +01:00
smallmodel
033b76af14
Allow the self object to be specified 2025-02-03 19:22:29 +01:00
smallmodel
e37a5f4d06
Add "isBot" to check whether or not the player is a bot
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 14s
2025-02-02 21:02:06 +01:00
smallmodel
58e12e0141
Reset delegates on restart 2025-02-02 19:35:01 +01:00
smallmodel
147678b0f0
Merge pull request #660 from smallmodel/scriptdelegate
Implement and use delegates
2025-02-02 19:28:14 +01:00
smallmodel
e6cbd00871
Add script delegates matching common scripted events 2025-02-02 19:18:55 +01:00
smallmodel
1eb7458af9
Add event_subscribe and event_unsubscribe scripting commands 2025-02-02 19:14:07 +01:00
smallmodel
38cf5b82b2
Copy the list of registered delegates to execute them 2025-02-02 17:07:03 +01:00
smallmodel
a5c59c4b77
Use maxDataSize when copying Event 2025-02-02 16:50:07 +01:00
smallmodel
d190cc6e40
Use SafeAddFirst 2025-02-02 16:35:27 +01:00
smallmodel
8234ce1e5f
Add pragma once 2025-02-02 16:20:14 +01:00
smallmodel
e962e4e1f5
Use an int instead of a size_t 2025-02-02 16:03:40 +01:00
smallmodel
ee970a3fce
Remove PlayerBot class and use delegates instead 2025-02-02 16:02:56 +01:00
smallmodel
9242faaa49
Add delegate for stufftext 2025-02-02 16:02:22 +01:00
smallmodel
b813f7ee56
Add delegates related for kill/damage 2025-02-02 16:02:11 +01:00
smallmodel
7f64ef05d5
Mark Event getter methods as const 2025-02-02 16:01:41 +01:00
smallmodel
9cb593c9e4
Add support for event subscription (delegates) 2025-02-02 15:58:04 +01:00
smallmodel
cfb343d262
Add str move constructor/assignment
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 13s
2025-02-01 15:52:58 +01:00
smallmodel
9c811c2318
Mark getter methods as const for ScriptThreadLabel 2025-02-01 15:46:08 +01:00
smallmodel
7b97ad6e2f
Add move constructor for ContainerClass and refactor it
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 23s
2025-01-31 22:53:31 +01:00
smallmodel
fdea2a2e92
Free the object list when moving the container 2025-01-31 22:46:35 +01:00
smallmodel
aa0085b57d
Improve the Container class by using move constructor on reallocation when possible
This greatly optimize memory and speed by moving objects instead of copying objects
2025-01-31 22:38:00 +01:00
smallmodel
3fa489c0f9
Add move constructor for SafePtr 2025-01-31 22:22:00 +01:00
smallmodel
fbee409f47
Swap code with event pointer 2025-01-31 20:49:44 +01:00
smallmodel
7a8aa4eb84
Add placement new/delete for LightClass 2025-01-31 20:45:18 +01:00
smallmodel
d4bbaa41c3
Format safeptr source file 2025-01-31 20:45:11 +01:00
smallmodel
bb23fe159f
Fix copy constructor not using a const object 2025-01-31 20:27:37 +01:00
smallmodel
b1a02389f6
Define REF_DLL 2025-01-31 20:22:03 +01:00
smallmodel
f10ddcaa17
Update bot documentation 2025-01-31 20:21:56 +01:00
smallmodel
77f0ce0673
Merge pull request #658 from bulldozerecske/patch-2
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
Create Frequently Asked Questions (FAQ)
2025-01-30 21:18:39 +01:00
smallmodel
7fc486757d
Merge branch 'main' into bulldozerecske-patch-2 2025-01-30 21:06:50 +01:00
smallmodel
dfc3fdb88b
Link to the FAQ 2025-01-30 21:05:02 +01:00
smallmodel
3769bd2a68
Translate instant messages when printing to console
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-01-29 20:00:55 +01:00
Bulldozer
80d1b3b204
Create Frequently Asked Questions (FAQ)
This document will be suitable for answering issues that have user-related solutions.
2025-01-29 10:12:09 +01:00
smallmodel
e66fd28831
Fix incompatible functions in renderergl2
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2025-01-28 21:52:58 +01:00
smallmodel
1cabf5c31e
Merge pull request #657 from smallmodel/bulletholes_fix
Bulletholes fix
2025-01-28 20:26:43 +01:00
smallmodel
8341f8cb6a
Fix bullet hole sometimes not playing 2025-01-28 20:24:14 +01:00
smallmodel
1fc36fce9b
Fix multiple bullet hole effects unnecessarily spawning 2025-01-28 20:03:02 +01:00
smallmodel
33dbb07559
Export game name and shortversion as information clients/servers can see 2025-01-28 19:30:17 +01:00
smallmodel
e510c50a24
Set minimum and maximum for effect variables
Some checks failed
Build branch / build-all (push) Failing after 1m39s
CodeQL / Analyze (push) Has been cancelled
2025-01-27 00:44:17 +01:00
smallmodel
c345035e12
Add Cvar_CheckRange exports 2025-01-27 00:13:01 +01:00
smallmodel
9bb4789b32
Add terrain flags
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s
2025-01-25 16:40:41 +01:00
smallmodel
7e26814cfa
Use a signed integer to display the score
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s
2025-01-24 21:39:09 +01:00
smallmodel
33855cfbee
Implement add, subtract, scale, append and bitset
Some checks failed
Build branch / build-all (push) Failing after 17s
CodeQL / Analyze (push) Has been cancelled
2025-01-23 01:09:33 +01:00
smallmodel
98bb3e0366
Fix Com_SanitizeName infinite loop 2025-01-23 01:09:18 +01:00
smallmodel
52744fb784
Whitelist cg_3rd_person 2025-01-22 21:35:27 +01:00
smallmodel
08e5208835
Add "append" as allowed command 2025-01-22 21:35:09 +01:00
smallmodel
187079842f
Add cg_cheats to check if cheats are enabled 2025-01-22 21:26:29 +01:00
smallmodel
ef2c5d2df6
Check and verify that selected player models are valid
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
If the player model or the player german model is not valid, they will be reset to the default value. If the server doesn't have one or more of these models, force model feature will not work
2025-01-22 20:52:05 +01:00
smallmodel
92a0a9c197
Cache all models inside the models/player directory
Some player models are missing from precache scripts. This caches all models inside the player directory to avoid a short hitch when a player spawns with a non-cached model
2025-01-22 20:29:27 +01:00
smallmodel
90e46f535c
Add a random number next to the default name
Some checks failed
Build branch / build-all (push) Failing after 17s
CodeQL / Analyze (push) Has been cancelled
2025-01-21 23:26:21 +01:00
smallmodel
02fc573e31
Apply client and server config tweaks when loading the original config 2025-01-21 22:56:05 +01:00
smallmodel
b8c7223da7
Allow "name" to be changed by server
Players often get their name changed due to them having an empty or duplicate name
2025-01-21 22:55:00 +01:00
smallmodel
7b53e25dd5
Set the default rate to 25000 (xDSL) 2025-01-21 22:08:54 +01:00
smallmodel
f8f9d2f65c
Use MAX_PATHNODES rather than a constant number 2025-01-21 20:56:26 +01:00
smallmodel
19e12701f3
Fix HUD scaling for spectator text, and vote text on 4K 2025-01-21 20:15:43 +01:00
smallmodel
24c7311162
Also save the valid ground trace when stepping
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 45s
2025-01-20 22:33:14 +01:00
smallmodel
599914934c
Update documentation 2025-01-20 12:17:48 +01:00
smallmodel
8fdc66d138
Allow axis players to select kar98 sniper on 2.0 and above by choosing german panzer skins
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s
2025-01-19 19:16:28 +01:00
smallmodel
83caae7586
Fix terrain tessellation when there is insufficient tris in renderergl2 2025-01-19 17:32:14 +01:00
smallmodel
1f599e62c6
Clear numLightmaps in renderergl2 2025-01-19 17:31:50 +01:00
smallmodel
4e174fd5bf
Fix cheats mistakenly being disabled when loading a saved game, when developer mode is enabled
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 21s
2025-01-19 16:08:28 +01:00
smallmodel
edf3560dd5
Don't load lightmaps on on Permedia 2 2025-01-19 15:21:11 +01:00
smallmodel
7452bf39fb
Always initialize numLightmaps when loading lightmaps
This fixes an issue where the number of lightmaps is kept from the previous map if the new map has no lightmaps
2025-01-19 15:19:27 +01:00
smallmodel
c2bac6d1ef
Prevent lightmapIndex from going below LIGHTMAP_2D 2025-01-19 15:16:35 +01:00
smallmodel
47cd8ccfc8
Force vertex light when using permedia 2 2025-01-19 15:07:50 +01:00
smallmodel
ec6cab28a5
Don't apply kick fireback on older versions of the game
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s
2025-01-19 14:45:20 +01:00
smallmodel
45de1067bd
Fix localtime_r parameter
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 14s
2025-01-19 01:41:26 +01:00
smallmodel
7ab04b0bcb
Fix IsEntity() and SimpleEntity() improperly returning true when the listener is NULL
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s
2025-01-18 15:43:20 +01:00
smallmodel
1a71d44b43
Safely check if other is NULL when triggering
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2025-01-18 13:23:30 +01:00
smallmodel
1ea273fba0
Clear the top stack result when self is NULL 2025-01-18 13:02:05 +01:00
smallmodel
591be6c2fd
Create a new node if the load index is outside the node count
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-01-17 21:49:17 +01:00
smallmodel
6b02457190
Properly correct the opcode in OP_LOAD_STORE_SELF_VAR when self is NULL 2025-01-17 16:49:38 +01:00
smallmodel
87e5b6d41e
Clear the top variable when the event is not valid too 2025-01-17 16:21:13 +01:00
smallmodel
7f0c506fea
Add a comment about the spawn behavior in OG
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 22s
2025-01-16 23:59:04 +01:00
smallmodel
539c2df378
Check for valid event on listener and print an error if the command cannot be executed 2025-01-16 23:25:26 +01:00
smallmodel
4399e2ab31
Merge pull request #634 from smallmodel/bot_player_association_rework
Bot player association rework
2025-01-16 22:29:05 +01:00
smallmodel
210eeff481
Remove controllers that don't have an associated entity
This prevents crashes when the entity was removed (potentially by a mod)
2025-01-16 22:28:37 +01:00
smallmodel
95e72dd339
Use the number of controllers to get the number of spawned bots 2025-01-16 22:27:51 +01:00
smallmodel
a6d9369204
Remove DM player in destructor rather than in a manual function call 2025-01-16 22:17:14 +01:00
smallmodel
ab80045329
Properly check if the number of tris is sufficient for tessellation
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s
2025-01-15 21:38:49 +01:00
smallmodel
94aaeac194
Check for the vehicle owner
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 19s
2025-01-15 20:16:58 +01:00
smallmodel
4bec5cef01
Reduce telefrag bounds 2025-01-15 18:42:34 +01:00
smallmodel
1500d213e7
Fix wrong pointer being deleted 2025-01-15 18:29:56 +01:00
smallmodel
2dbe61789d
Don't use the target list if the world is NULL 2025-01-15 18:29:35 +01:00
smallmodel
3f9bed938e
Fix NULL string checking 2025-01-15 18:03:37 +01:00
smallmodel
619d27da81
Add getentity 2025-01-15 18:00:04 +01:00
smallmodel
bfd0f6e744
Fix the platform dependant compile error
Some checks failed
Build branch / build-all (push) Failing after 18s
CodeQL / Analyze (push) Has been cancelled
2025-01-14 00:08:34 +01:00
smallmodel
6d71cabbda
Export FS_FOpenFile 2025-01-13 23:22:33 +01:00
smallmodel
317664f88c
Throw an error if the player is dead in EndLevel() 2025-01-13 20:51:28 +01:00
smallmodel
e7cddd47a5
Fix incorrect map name and spawnpoint when a spawnpoint ('$') is specified, causing crash 2025-01-13 20:45:53 +01:00
smallmodel
393dfae33e
Give starting ammo at the next frame 2025-01-13 20:27:07 +01:00
DraGoN
c69ea0e4d8
Fixed parameter order in localtime_rand gmtime_r for FreeBSD, OpenBSD, and NetBSD
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-01-13 19:21:56 +01:00
smallmodel
59fdcf0ae9
Add debian 11 and 12
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s
2025-01-12 20:29:53 +01:00
smallmodel
f22ea9eb21
Link against rt
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 21s
2025-01-11 23:50:33 +01:00
smallmodel
752588ffcd
Update OpenAL to version 1.24.2 2025-01-11 16:35:02 +01:00
smallmodel
a0f6d7d361
Initialize met_comment to false 2025-01-11 15:20:41 +01:00
smallmodel
1b5232c2d0
Fix compile errors
Some checks failed
Build branch / build-all (push) Failing after 18s
CodeQL / Analyze (push) Has been cancelled
2025-01-09 23:17:39 +01:00
smallmodel
089e68e85e
Add a cvar to opt out for logfile timestamps 2025-01-09 23:08:15 +01:00
smallmodel
a9ec7cff4f
Write the time before each message printed in the logfile 2025-01-09 22:23:02 +01:00
smallmodel
63c2b3642c
Print the version when opening the logfile 2025-01-09 21:42:12 +01:00
smallmodel
5e04124211
Fix accuracy being 0.0 in the stats screen 2025-01-09 21:30:40 +01:00
smallmodel
bbfd4ac280
Bump version number 2025-01-09 20:38:18 +01:00
smallmodel
28fd0ba201
Use spline as the default source resampler for OpenAL
This makes sounds feel stronger, the spline resampler has slightly louder high frequencies
2025-01-09 20:36:15 +01:00
smallmodel
305c026f4e
Import alGetStringiSOFT 2025-01-09 20:29:30 +01:00
smallmodel
b836042a02
Merge pull request #614 from smallmodel/localization_fix
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 1m39s
Localization fix
2025-01-08 22:53:44 +01:00
smallmodel
ec95b6bfbe
Fix localization not working properly 2025-01-08 22:52:47 +01:00
smallmodel
6049ecfc6e
Localize dmbox and gmbox 2025-01-08 21:26:47 +01:00
smallmodel
6a31381c8e
Format localization source files 2025-01-08 21:26:41 +01:00
smallmodel
7f8bcf8075
Don't read localization.txt file twice 2025-01-08 21:07:13 +01:00
smallmodel
b84a47ad3f
Localization files should be sorted case-insensitive 2025-01-08 21:04:09 +01:00
smallmodel
f91d0c1693
Add missing EV_CanSeeNoEnts
The `canseenoents` was accidentally missing from the Entity's response list, some scripts rely on it
2025-01-08 20:52:24 +01:00
smallmodel
cd65424b00
Fix an infinite loop when setting up path for Vehicle 2025-01-08 20:32:34 +01:00
smallmodel
944e0f24ae
Merge pull request #606 from ysdragon/freebsd-support
FreeBSD support
2025-01-08 19:07:32 +01:00
smallmodel
d396a45e64
Annoying MSVC focus mistake 2025-01-08 18:55:54 +01:00
smallmodel
c0d5ebaaf3
Merge branch 'main' into freebsd-support 2025-01-08 18:55:50 +01:00
smallmodel
c3b42cc297
Merge branch 'main' into freebsd-support 2025-01-08 18:50:34 +01:00
smallmodel
4f32d436bb
Disable OpenAL limiter 2025-01-08 18:45:05 +01:00
smallmodel
4268a875fa
Revert commit b95241dcfe 2025-01-08 17:56:44 +01:00
ysdragon
2ec2ef8bbf
Update sys CMake configuration to link execinfo for BSD variants 2025-01-08 11:27:09 +02:00
ysdragon
7ba29029e1
Add support for additional BSD platforms in platform detection 2025-01-08 11:26:54 +02:00
smallmodel
bbdbe62930
Let SetOwner() assign the edict's ownerNum
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s
2025-01-07 21:41:49 +01:00
smallmodel
b95241dcfe
Rotate audio listener by +90 degrees forward
This fixes wrong spatialization of 3D sources with HRTF
2025-01-07 20:49:25 +01:00
smallmodel
8cc1cd6f2c
Install audio libraries for CodeQL
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2025-01-07 01:19:20 +01:00
smallmodel
f7947b3fe3
Add playerbot_strategy source files 2025-01-07 01:03:35 +01:00
smallmodel
4c06dd7107
Make UColor constant 2025-01-07 00:40:11 +01:00
smallmodel
d6db83805d
Make chat message colors brighter 2025-01-07 00:39:45 +01:00
smallmodel
25f4d0199d
Use const UColor pointer 2025-01-07 00:32:03 +01:00
smallmodel
3bcd5cf308
Add UColor copy constructor 2025-01-07 00:26:40 +01:00
smallmodel
ce38cf9040
Add missing newline for the health pickup message 2025-01-07 00:09:44 +01:00
smallmodel
adc2704da0
Improve code clarity 2025-01-07 00:09:28 +01:00
smallmodel
f999d87f68
Set the subtitle regardless of g_subtitle if the alias indicate it's forced
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 1m12s
2025-01-06 13:37:19 +01:00
smallmodel
7f8446ab82
If random alias name is NULL, use one from global aliases 2025-01-06 13:32:50 +01:00
smallmodel
4d2b61a766
Server-side subtitles must only work on single-player mode 2025-01-06 13:29:12 +01:00
smallmodel
1f3661238a
Check for valid player 0 before setting subtitle 2025-01-06 13:26:29 +01:00
smallmodel
5f236d4d42
Fix projectiles having an unassigned weapon owner
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 1m43s
This fixes weapons that shoot projectiles not being taken into account for being the preferred weapon
2025-01-05 23:57:08 +01:00
smallmodel
8fb3856ea6
Add a centerprint message when joining a team that is full 2025-01-05 20:19:52 +01:00
smallmodel
418985f90b
Fix animation not looping in the same state 2025-01-05 20:02:50 +01:00
smallmodel
2c738fa28e
Fix occasional errors related to SV_FindIndex
Some maps (and mods) declare many sounds, sounds with the same name would be present more than once because the case was taken into account
2025-01-05 19:54:32 +01:00
smallmodel
8a8ac2e3d1
Fix newline in win message 2025-01-05 18:36:45 +01:00
smallmodel
cf65fd890d
Fix incorrect number of wins in the scoreboard 2025-01-05 18:20:00 +01:00
smallmodel
6a86fc8067
Fix num voters when calling vote 2025-01-05 17:50:06 +01:00
smallmodel
528039f80b
Don't sanitize semicolon 2025-01-05 17:49:27 +01:00
smallmodel
b5875ae890
Allow the same torso animation to play again
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s
This allows replaying the same torso animation, like when activating a new weapon of the same weapon class
2025-01-05 02:29:02 +01:00
smallmodel
8801834804
Don't restart the legs animation from the beginning in the same state
This prevent walking silently by switching weapons indefinitely
2025-01-05 02:20:59 +01:00
smallmodel
a14a2c9684
Fix inconsistent torso animation cross-blending 2025-01-05 02:10:01 +01:00
smallmodel
269e73168e
Fix an issue where animations (legs) would not loop 2025-01-05 02:00:49 +01:00
smallmodel
19eec6305b
Use "idle" anim when in noclip mode 2025-01-04 21:15:32 +01:00
smallmodel
9930d50f99
Fix inconsistent player animation debug print 2025-01-04 20:37:15 +01:00
smallmodel
9427137dbd
Properly increment the packet number before sending the gamespy reply
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 32s
Some programs parse the packet number and stop working properly if the packet number is an incorrect value
2025-01-04 19:43:47 +01:00
smallmodel
c10fd17d19
Bump patch number 2025-01-04 18:01:52 +01:00
smallmodel
3c26b98b65
Generate checksum with noncompat protocol 2025-01-04 17:55:33 +01:00
smallmodel
6e357459e6
Fix fragments being sent too fast
This prevented players with low connection speed unable to connect due to UDP packets being lost. The rate of connecting clients will be properly taken into account
2025-01-04 17:55:11 +01:00
smallmodel
fe42511c54
Changed the color of UIListBox elements
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-01-03 22:08:59 +01:00
smallmodel
32f507ce15
Fix pulldown menu container using the wrong foreground color 2025-01-03 22:08:26 +01:00
smallmodel
efeda23627
Fix player losing part torso animation during pain
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 39s
2025-01-02 18:04:32 +01:00
smallmodel
465d462756
Automatically adjust the FOV depending on the aspect ratio 2025-01-02 15:52:45 +01:00
smallmodel
df22895b94
Fix compile error 2025-01-02 15:30:34 +01:00
smallmodel
6b2160c876
Add putaway getter for Weapon
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2025-01-02 14:27:39 +01:00
smallmodel
088b44e2cc
Don't use the same weapon and add getters for the newActiveWeapon 2025-01-02 14:27:31 +01:00
smallmodel
3f299610fc
Also try to find weapon by name in useWeapon() 2025-01-02 13:33:04 +01:00
smallmodel
713e361d85
Fix DM box position with resolutions above 1920x1080
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 14s
2025-01-02 01:46:34 +01:00
smallmodel
869075f47b
Disable audio virtualization on special audio sources such as music and ambient sounds
This prevents the music from being muffled by HRTF virtualization
2025-01-01 23:58:48 +01:00
smallmodel
a067c58b3d
Add EV_ScriptThread_FileClose2 to call fclose() without getting the return value 2025-01-01 23:38:49 +01:00
smallmodel
b16aaa5adc
Use a scripted object to store the C file handle for file functions
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 15s
2025-01-01 12:40:59 +01:00
smallmodel
f4a412cc24
Fix reverb toggle at runtime even if reverb is unimplemented
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2024-12-31 13:04:33 +01:00
smallmodel
d83ad43b0b
Fix FPS model not being set correctly to match the world model
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 3m46s
2024-12-30 20:24:49 +01:00
smallmodel
aa9847cf90
Use clean Radix sort code from ioquake3 to sort draw surfaces 2024-12-30 19:18:54 +01:00
smallmodel
18a3658935
Ignore fast path if the drawsurf is a sprite 2024-12-30 19:18:20 +01:00
smallmodel
716a574abe
Clean up terrain when shutting the Ref down 2024-12-30 18:51:10 +01:00
smallmodel
e0dee12578
Clamp LOD terrain values 2024-12-30 16:16:17 +01:00
smallmodel
04b1e88077
Clamp r_subdivisions value 2024-12-30 16:13:50 +01:00
smallmodel
51a2f7d479
Use an enumeration for weapon commands and a function to get the weapon command
This improves clarity for using weapon commands. Also the mask was incorrect for protocol above version 8 (mohaas and mohaab)
2024-12-30 00:55:29 +01:00
smallmodel
2656000ce4
Print chat message from the game module instead of the server 2024-12-29 18:46:40 +01:00
smallmodel
4ec10af1fd
Fix private message not working 2024-12-29 15:43:41 +01:00
smallmodel
78cd0cf28b
Prevent firing weapon if there is a weapon command
This prevent tricks like firing and dropping weapon to shoot silently
2024-12-29 13:45:18 +01:00
smallmodel
3e9d2bf89a
Fix incompatible type being used for shadertext
Some checks failed
Build branch / build-all (push) Failing after 17s
CodeQL / Analyze (push) Has been cancelled
2024-12-27 17:33:29 +01:00
smallmodel
ebe9795bba
Select a random player skin when the bot dies
Some checks failed
Build branch / build-all (push) Failing after 17s
CodeQL / Analyze (push) Has been cancelled
2024-12-25 15:08:57 +01:00
smallmodel
3f2c2f7aa4
Spectate the next player in mohaa 1.0 (instead of random) when pressing use in spectator 2024-12-25 15:08:00 +01:00
smallmodel
583c2720e2
Fix Info_RemoveKey not correctly removing the key 2024-12-25 15:00:32 +01:00
smallmodel
47d6843b70
Fix player model list never initialized 2024-12-25 14:50:11 +01:00
smallmodel
25fd01c46b
Automatically switch to another weapon when the current weapon has no ammo
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 22s
2024-12-24 20:19:08 +01:00
smallmodel
963b2a2bbd
Add getters for Sentient inventory and ammo inventory 2024-12-24 20:04:59 +01:00
smallmodel
7274ceb0ff
Make the bot melee when it is near the player 2024-12-24 19:53:20 +01:00
smallmodel
cb1c3c0b1c
Remove call to SV_WriteDownloadToClient() when sending snapshots, as it's already called when sending download messages 2024-12-24 18:42:05 +01:00
smallmodel
da5c35ec2b
Prevent connecting clients from receiving snapshots and CG messages while connecting
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2024-12-24 18:30:08 +01:00
smallmodel
515beeafa7
Fix wrong fov clamping
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 19s
2024-12-23 22:57:26 +01:00
smallmodel
37f5f64ef3
Update features.md 2024-12-23 22:55:17 +01:00
smallmodel
85c401496a
Add a client-game variable for customizing the FOV client-side 2024-12-23 22:53:31 +01:00
smallmodel
07f7c557ce
Move TargetArch.cmake to misc/cmake 2024-12-23 22:34:50 +01:00
smallmodel
31278fba92
Make sure to bind to the renderer FBO when drawing
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2024-12-22 22:41:54 +01:00
smallmodel
a32a9e8ae8
Update documentation about bots 2024-12-22 22:07:24 +01:00
smallmodel
70dc1820db
Update README 2024-12-22 21:53:19 +01:00
smallmodel
a760cb75a3
Use RE_AddPolyToScene2 for poly like beams 2024-12-22 20:27:59 +01:00
smallmodel
1d0b912f75
Make sure to check if the sprite is valid 2024-12-22 19:57:14 +01:00
smallmodel
439e0718ce
Fix sprite rendering causing crashes 2024-12-22 19:16:27 +01:00
smallmodel
4c57ba6ef3
Fix currentStaticModel assignment 2024-12-22 19:03:11 +01:00
smallmodel
b4bae40da8
Fix BSP minimum and maximum version on GL2 2024-12-22 19:00:15 +01:00
smallmodel
e04cbd57ea
Fix most shader errors, light rendering
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s
2024-12-21 22:49:38 +01:00
smallmodel
66664b7b46
Add tr_vis 2024-12-21 21:43:29 +01:00
smallmodel
546b90d75f
Add basic 3D GL2 rendering with static models and terrain 2024-12-21 17:04:31 +01:00
smallmodel
14e83a52a4
Add terrain rendering 2024-12-21 14:01:11 +01:00
smallmodel
dc9fec9d03
Load JPEG file first before TGA
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 28s
2024-12-20 23:35:14 +01:00
smallmodel
6d21d52d3e
Define USE_INTERNAL_JPEG macro for renderer when using the internal JPEG 2024-12-20 23:31:03 +01:00
smallmodel
3afb87486b
Add basic support for mohaa shaders for GL2 2024-12-20 23:21:28 +01:00
smallmodel
d0c0a55e6d
Fix drawing elements with color 2024-12-20 23:20:30 +01:00
smallmodel
1919b0efcb
Fix Cvar_SetValue not set for ref imports 2024-12-20 23:11:37 +01:00
smallmodel
954d096261
Fix font rendering 2024-12-20 21:53:33 +01:00
smallmodel
7e150c7a8a
Implement used draw functions 2024-12-20 21:27:10 +01:00
smallmodel
77646bda78
Implement RB_Stream draw surfaces 2024-12-20 21:21:10 +01:00
smallmodel
e6848a3ab0
Fix the window sizer losing focus when rapidly dragging the mouse
This would lead to annoyances when trying to resize the window as the window sizer would lose focus
2024-12-20 20:13:05 +01:00
smallmodel
011f49616b
Fix the improper focus and activation of pulldown menus 2024-12-20 19:35:27 +01:00
smallmodel
e1be3c0fd1
Call G_SetClientConfigString() instead to properly set the team configstring 2024-12-20 19:13:17 +01:00
smallmodel
3d950764a2
Add minimal renderergl2 implementation
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
This implementation should just let the game run without crashing, the renderer doesn't show anything yet
2024-12-20 01:23:00 +01:00
smallmodel
fe16f999d8
Use ri.Printf to print instead of the Com_* functions 2024-12-19 22:40:38 +01:00
smallmodel
390c1d3f3d
Move tiki_mesh inclusion to renderercommon CMakeLists 2024-12-19 21:18:54 +01:00
smallmodel
49b5c29c11
Format renderergl1 source files 2024-12-19 21:13:39 +01:00
smallmodel
f86b495cc6
Set all common renderer imports and add openmohaa imports after ioquake3 imports for more clarity 2024-12-19 20:09:52 +01:00
smallmodel
a4d0a96ce5
Clear the camera jitter when ending the remote control 2024-12-19 19:52:29 +01:00
smallmodel
9d4ea75a18
Increase the number of aliases that can be found
Previously, 64 aliases could be chosen for random search, it was incremented to 128 since 2.0, however it should have been increased in Breakthrough as well, because there are aliases with more than 128 elements
2024-12-19 19:19:12 +01:00
smallmodel
38427fa3c5
Add support for compiling both opengl1 and opengl2 when they're built as shared libraries
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 26s
renderercommon is now used, which will appropriately use opengl1 when building static libraries, or compile both opengl1/opengl2 modules when building shared libraries
2024-12-18 23:24:04 +01:00
smallmodel
7d369dec74
Don't render static mesh if there is no static xyz 2024-12-18 19:44:48 +01:00
smallmodel
58bef33bc7
Don't check if the TIKI model exists when initializing a static model
In later version like 2.0 and above, the TIKI model can be registered before static models which would prevent static xyz to be initialized
2024-12-18 19:41:28 +01:00
smallmodel
bd021b109c
Fix a terrible mistake in TIKI_FindTiki with uninitialized variable
This was using an uninitialized buffer to find the cached TIKI, in most configurations it always returned false, but when compiled with GCC it would return true
2024-12-18 19:31:21 +01:00
smallmodel
7e15c2ac1b
Update features.md
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 27s
2024-12-17 23:03:58 +01:00
smallmodel
3b1b994152
Fix temporary spawn spots being incorrectly ignored 2024-12-17 22:54:46 +01:00
smallmodel
4e69d7a78a
Remove redundant code 2024-12-17 22:50:25 +01:00
smallmodel
16166a36b5
Fix spawnpoint metric for objective-based matches 2024-12-17 22:48:10 +01:00
smallmodel
bcbe7cd870
Fix spawn point metric functions not counting the last player 2024-12-17 22:45:43 +01:00
smallmodel
8dba91fbcc
Reopen doors to the other side when blocked 2024-12-17 22:17:02 +01:00
smallmodel
29fe5780e9
Only post the EV_MoveDone event if it's not pending when done moving
There are some situations where EV_MoveDone is posted again through a call to G_PushMove(), this avoids the mover unexpectedly and immediately moving to the new location
2024-12-17 22:15:53 +01:00
smallmodel
12686c0ab1
Format mover source file 2024-12-17 22:02:35 +01:00
smallmodel
a21d712f54
Reopen the door to the other side if it's blocked 2024-12-17 21:30:48 +01:00
smallmodel
2c7d18b331
Initialize client persistent in G_InitClientPersistant 2024-12-17 21:16:45 +01:00
smallmodel
e353673005
Fix player deaths (or total kills) being added twice in round-based matches 2024-12-17 21:11:34 +01:00
smallmodel
6b36bec8e9
Allow custom game ports other than 12203 to be specified through GAME_PORT environment variable 2024-12-17 19:29:17 +01:00
smallmodel
1be50cdddf
Clear the attack time during reaction time 2024-12-17 14:01:13 +01:00
smallmodel
869b257bf8
Add a slight random response time before attacking
Some checks failed
Build branch / build-all (push) Failing after 56s
CodeQL / Analyze (push) Has been cancelled
It's a way to make the fight less difficult between bots and players
2024-12-16 23:05:35 +01:00
smallmodel
f165ebf9a3
Refactor G_ExitLevel 2024-12-16 23:03:15 +01:00
smallmodel
a6c168c289
Count from 0 instead of CS_OBJECTIVES for more clarity 2024-12-16 22:13:26 +01:00
smallmodel
0057a8273c
Initialize the total map time 2024-12-16 21:17:36 +01:00
smallmodel
876829a742
Properly aim the enemy
The bot wasn't aiming properly at the enemy because the bot was aiming from the centroid. It also caused issues when the enemy was crouching
2024-12-16 19:45:42 +01:00
smallmodel
f4519325ce
Speed up bot rotation 2024-12-16 19:41:01 +01:00
smallmodel
932367d061
Append "demo" to the keywords if fs_restrict is enabled
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
2024-12-15 21:32:34 +01:00
smallmodel
79643d963e
Correctly parse the name of the players returned by the serverstatus command 2024-12-15 21:32:23 +01:00
smallmodel
872b3f5d70
Improve bot movement when stuck 2024-12-15 21:10:48 +01:00
smallmodel
ac4138a763
Declare PID functions
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2024-12-15 00:20:31 +01:00
smallmodel
0765537d29
Improve bot attack state
This should stop bot aiming forever behind walls and getting stuck to a wall
2024-12-14 23:32:17 +01:00
smallmodel
f2f9ba9f83
Fix emulated death message incorrectly having a '?' at the beginning of each message on base game 2024-12-14 22:14:55 +01:00
smallmodel
20c1fab815
Don't set the frame number if the renderer function doesn't exist 2024-12-14 22:13:11 +01:00
smallmodel
d3fb1331f8
Fix NDEBUG check 2024-12-14 20:09:33 +01:00
smallmodel
13eafb9bf1
Update server doc 2024-12-14 19:53:28 +01:00
smallmodel
1ef61a6e3d
Use the PID file in non-debug builds
The PID file is used to check if openmohaa cleanly exited, and in case it didn't, the user is prompted to start in safe mode
2024-12-14 19:40:49 +01:00
smallmodel
0fb80a4ab5
Use unnamedsoldier.cfg config file if the openmohaa config file doesn't exist 2024-12-14 19:38:52 +01:00
smallmodel
981b12b63d
Return a rounded number in G_GetAngle
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 18s
There are scripts that compare the returned angle with an exact value and sometimes G_GetAngle return a value with a tiny fraction difference
2024-12-13 23:55:34 +01:00
smallmodel
508ee871b9
Add a small offset for checking if the player can get off ladder
This compensates with the difference with floating-point precision between architectures
2024-12-13 23:30:01 +01:00
smallmodel
c293a52f7a
Fix MASK_LADDER mask 2024-12-13 22:54:00 +01:00
smallmodel
acf2dd0ad1
Use an integer when waiting
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 26s
Since the expected time is in milliseconds, it's best to use an integer instead. Floating-point numbers lose precision as they get larger, especially when the level's current time is long (e.g., over 24 hours). This loss of precision could cause scripts to wait unsuccessfully with small numbers, causing unexpected behaviors
2024-12-13 22:17:43 +01:00
smallmodel
32bee2602c
Rename mods to home 2024-12-13 20:37:13 +01:00
smallmodel
d5ec17ec26
Allow subtitles to be set from stufftext 2024-12-13 19:24:58 +01:00
Bulldozer
e53c6b55bf
Update getting_started_installation.md
Spearhead was mentioned instead of Breakthrough.
2024-12-13 18:55:17 +01:00
smallmodel
85da9fabdd
Fix incorrect event/return value for ScriptOrigin::GetAngleEvent
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2024-12-12 23:50:42 +01:00
smallmodel
e15440af5e
Clear the view velocity when PMF_NO_MOVE is set 2024-12-12 22:52:28 +01:00
smallmodel
26c2225a24
Remove rate assertion 2024-12-12 22:45:44 +01:00
smallmodel
cd06dc0535
Don't validate facet if there is an invalid border plane
The check was missing, which would cause a crash during collision test
2024-12-12 22:37:09 +01:00
smallmodel
1b8ef411ee
Increase the value of MAX_PATCH_PLANES
Some checks failed
Build branch / build-all (push) Failing after 17s
CodeQL / Analyze (push) Has been cancelled
2024-12-11 23:20:27 +01:00
smallmodel
95466b810f
Prevent an infinite loop in ProcessPendingEvents() when an entity is being deleted in thinks 2024-12-11 21:55:31 +01:00
smallmodel
0a41f3bb76
Indicate when processing events 2024-12-11 21:55:22 +01:00
smallmodel
9b247a746c
Add health check script to check for the state of the mohaa server 2024-12-11 20:19:34 +01:00
smallmodel
fcdde53774
Use home instead of mods
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2024-12-11 00:57:31 +01:00
smallmodel
279cfb364b
Change the homepath instead of the game directory
Otherwise, clients would look for cgamex86.dll module that is inside the fs_game directory
2024-12-11 00:42:54 +01:00
smallmodel
3dcb2cad64
Fix typo 2024-12-10 23:07:57 +01:00
smallmodel
a199188ede
Add more stuff to build dev/server containers 2024-12-10 22:54:32 +01:00
smallmodel
8a84436d1b
Fix Cmd_TokenizeString2 incorrectly ignoring extended ascii characters
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2024-12-09 22:33:36 +01:00
smallmodel
231553f574
Fix round not ending when the clock reached 0:00
The wrong variable was being checked to end the round
2024-12-09 22:14:57 +01:00
smallmodel
37466cdffb
Fix wrong condition for checking entity 2024-12-09 22:02:48 +01:00
smallmodel
3cc417151d
Fix newlines for G_PrintToAllClients 2024-12-09 21:42:45 +01:00
smallmodel
d26718a711
Fix teamkill kick warning not working 2024-12-09 21:32:38 +01:00
smallmodel
0644bc2967
Don't execute old commands from previous map when initializing cgame 2024-12-09 21:27:08 +01:00
smallmodel
a2e4f1dc25
Use the server frametime when parsing baseline entities from the game state 2024-12-09 19:34:19 +01:00
smallmodel
9c952ab49d
Set the map name from the server 2024-12-09 19:33:05 +01:00
smallmodel
aa52fe73a5
Restart the file system when connected and when the local server has no paks 2024-12-09 19:31:58 +01:00
smallmodel
fee6390281
Update README 2024-12-09 18:55:36 +01:00
smallmodel
835ddb1de3
Set the compass scale to 0.55 by default on the base game 2024-12-09 18:08:00 +01:00
smallmodel
b58f031bcc
Remove unused cg variables
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s
2024-12-08 20:09:23 +01:00
smallmodel
3897a44ce6
Bump the version number 2024-12-08 19:58:59 +01:00
smallmodel
1ec88142b9
Put the value of the working directory in quotes 2024-12-08 19:46:36 +01:00
smallmodel
70a5dde726
Correctly handle long strings in chat and game message box 2024-12-08 19:22:25 +01:00
smallmodel
f684349c18
Make sure to pop the loading screen on error
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 16s
This fixes the client getting stuck in the loading screen due to a drop error
2024-12-08 18:47:10 +01:00
smallmodel
a08a9a4f10
Remove TOKEN_NUMBER (unused)
Some maps use #xx to indicate an identifier, so remove this token to avoid errors
2024-12-08 18:24:33 +01:00
smallmodel
f719b87e69
Handle identifiers that are present after strings, by marking strings as identifier 2024-12-08 18:15:26 +01:00
smallmodel
af1cbea966
Also make players non-solid in a vehicle slot 2024-12-08 17:19:39 +01:00
smallmodel
f3f53947bc
Call the switch label only is the primary turret is valid 2024-12-08 16:43:58 +01:00
smallmodel
f0cc34cccf
Correctly parse identifiers starting with a number and containing non-numeric characters 2024-12-08 16:19:57 +01:00
smallmodel
c4a1175ad0
Clear the invulnerable override when loading 2024-12-08 15:53:37 +01:00
smallmodel
333c452f44
Sanitize the name with a maximum buffer size limit 2024-12-08 12:51:14 +01:00
smallmodel
5801af34bb
Don't execute newconfig.cfg
This prevents graphic settings from being overridden by the configuration file previously generated by the original game
2024-12-08 12:43:05 +01:00
smallmodel
da0c36cc88
Also show the port of clients in status 2024-12-08 12:40:21 +01:00
smallmodel
d8d98ade6a
Set the default sound quality to 44 Hz 2024-12-08 12:37:59 +01:00
smallmodel
c3157ad4d7
Use DebugPrintf for errors that are relevant to developers
Some checks failed
Build branch / build-all (push) Failing after 16s
CodeQL / Analyze (push) Has been cancelled
2024-12-06 20:36:12 +01:00
smallmodel
6f686cb7fa
Check if the renderer is loaded instead of checking if it's registered
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 43s
2024-12-06 00:45:18 +01:00
smallmodel
39981643a8
Fix incorrect count when unloading sgl fonts 2024-12-06 00:45:12 +01:00
smallmodel
28bdd1b2b3
Made the renderer modular and loadable
This removes coupling between the renderer and UI/client functions. An option USE_RENDERER_DLOPEN was added to specify whether a renderer module should be compiled and loaded, instead of integrating the renderer into the executable directly. This opens the door for a new renderer
2024-12-06 00:15:19 +01:00
smallmodel
35f40e949b
Properly clear UI resources when shutting down the UI 2024-12-05 23:31:38 +01:00
smallmodel
115b7b82aa
Correctly handle the scenario where multiple architectures are specified
Each target will produce a single binary having multiple architectures, instead of having a binary per architecture. The suffix for each binary will be `multiarch`. This makes it easier for the end-user to install and use. This also helps the transition between Intel and Apple Silicon hardware
2024-12-05 21:12:19 +01:00
smallmodel
d7c0ee47fe
Check if the skel is valid before freeing it 2024-12-05 00:42:50 +01:00
smallmodel
0559d643b7
Use TIKI_DPrintf instead of Skel_DPrintf 2024-12-05 00:42:31 +01:00
smallmodel
8446a655bb
Print an error when the skel file extension is unknown 2024-12-04 22:33:42 +01:00
smallmodel
01d098dab5
Clear the number of uses of the skel cache when registering a new skeleton 2024-12-04 22:33:28 +01:00
smallmodel
b6dd3914be
Correctly free skels when freeing TIKIs
This fixes a potential memory leak that would occur when the first skelcache's skel is NULL
2024-12-04 22:30:26 +01:00
smallmodel
c2e45710ad
Improve code clarity 2024-12-04 22:15:01 +01:00
smallmodel
5da24a8ab5
Update mac runner OS to macos-15 2024-12-04 19:37:45 +01:00
smallmodel
ac6b274a4f
Use MAP_SIZE instead of MAX_MAP_BOUNDS
This fixes collision being incorrect on big maps
2024-12-04 19:22:56 +01:00
smallmodel
f703ee2f26
Add a section about installing official patches and improve clarity 2024-12-03 23:09:43 +01:00
smallmodel
70b8f9868e
Use GameFront for links to demos 2024-12-03 22:29:53 +01:00
smallmodel
c69bafeb3f
Add a section about cleaning up the game directory 2024-12-03 21:07:18 +01:00
smallmodel
f7c8c745c4
Don't return a slash at the end for directory name 2024-12-02 21:08:42 +01:00
smallmodel
861338b0fc
Add support for smaller lightmaps
Large lightmap can be disabled for very low-end hardware. A BSP file with a smaller lightmap (_sml.bsp) will be used instead of the standard one if the map supports it
2024-12-02 20:36:45 +01:00
smallmodel
499fe44bde
Call R_RegisterShaderNoMip for the crosshair
This prevents the crosshair texture from being altered by the texture quality settings
2024-12-02 19:00:43 +01:00
smallmodel
ba74943844
Fix picmip adjustment 2024-12-02 18:59:48 +01:00
smallmodel
21f631e733
Compile SDL input/client and SDL OpenGL independently
This decouple the renderer from the client part of SDL (input), and only uses SDL for OpenGL
2024-12-01 22:23:28 +01:00
smallmodel
b5c32a41de
Check for tabs alongside spaces in the lexer between expressions and variables
This fixes a compile error in some scripts that use tabs instead of spaces between expressions
2024-12-01 20:36:30 +01:00
smallmodel
c9373cbc97
Comment out ABI compatibility checks 2024-12-01 20:34:38 +01:00
smallmodel
b5a73384d3
Exclude the slash at the beginning of each file for FS_ListFilteredFiles 2024-12-01 20:33:51 +01:00
smallmodel
4f699f3b58
Add support to compile renderergl2 (currently unimplemented) 2024-12-01 19:21:07 +01:00
smallmodel
4ea598d76b
Reimplement SkipBracedSection 2024-12-01 17:53:51 +01:00
smallmodel
7e6b0a1c2b
Remove SMP and render thread code, as they're unused 2024-12-01 16:32:19 +01:00
smallmodel
d884512a76
Update renderergl2 from upstream ioq3 2024-12-01 15:41:48 +01:00
smallmodel
71450fb36e
Move renderer to renderergl1 2024-12-01 15:30:23 +01:00
smallmodel
4775f29194
Fix build warnings and errors 2024-11-30 23:36:37 +01:00
smallmodel
d5d5c7a55d
Use bits per sample rather than bytes as there are 4-bit sounds 2024-11-30 23:23:49 +01:00
smallmodel
aa74934ae0
Fix huddraw scaling with high resolutions 2024-11-30 23:21:20 +01:00
smallmodel
0534482c22
Fix a small mistake where it uses vidWidth rather than vidHeight 2024-11-30 23:08:23 +01:00
smallmodel
6fe1e86b31
Automatically scale UI elements for high resolutions
This fixes UI elements being tiny on high resolutions like 4K. Now most UI elements will scale automatically with resolutions above 1920x1080.
2024-11-30 22:40:00 +01:00
smallmodel
47983481c9
Use UI definitions instead of cls.glconfig for UI code to get the resolution 2024-11-30 13:54:50 +01:00
smallmodel
383bc60ddb
Update OpenAL to 1.24.1 2024-11-30 00:40:41 +01:00
smallmodel
d834f08cad
Update compiling.md with current version of tools to use 2024-11-30 00:40:35 +01:00
smallmodel
387ccd5cc3
Bump the minimum CMake version to 3.12 2024-11-30 00:36:33 +01:00
smallmodel
0fb775cd60
Only set the infoclient if it's a teammate player that can be sent to other clients 2024-11-29 23:45:52 +01:00
smallmodel
f31ea39331
Add about tweaking the build 2024-11-29 23:00:57 +01:00
smallmodel
56cc3fff53
Use a single variable to disable modern DMA 2024-11-29 22:53:04 +01:00
smallmodel
5f33a617ab
Allow linking directly against system OpenAL library 2024-11-29 22:03:39 +01:00
smallmodel
b3da62f77e
Don't use an offset for constArrayValue
This is risky and a bad practice to offset a pointer. This also fixes the compiler warning
2024-11-29 21:58:07 +01:00
smallmodel
f1e5d02169
Fix insecure printf format 2024-11-29 21:48:56 +01:00
smallmodel
7cad7a4bd0
Fix printf format specifiers 2024-11-29 21:34:41 +01:00
smallmodel
83a874e4fd
Add an option for CMake to specify when targeting the local system 2024-11-29 20:59:47 +01:00
Joey Riches
6eab2ddd57
CMake: Support lib extension on unix
Some distros install to lib64 instead of lib, respect the lib extension
otherwise some {f,c}game gets installed to lib64 and other libs get
installed to lib.
2024-11-28 00:49:00 +01:00
smallmodel
d944b4a21e
Fix wrong command name for ForceDropHealth 2024-11-27 22:40:40 +01:00
smallmodel
58f0245e83
Only add entries for servers that were queried successfully 2024-11-27 22:12:55 +01:00
smallmodel
2f8382f100
Initialize m_bMumble 2024-11-27 21:15:49 +01:00
smallmodel
167bd45a6a
Make the AI rarely play the standidentify animation (pointing finger to the player) 2024-11-27 21:14:51 +01:00
smallmodel
1e9decf193
Add support for IMA-ADPCM sounds (4-bit)
Sounds such as sea waves (mohaa m3l1a) and subpen (mohaas flughafen) will be played accordingly. This uses OpenAL extensions such as AL_EXT_IMA4 and SOFT features such as AL_SOFT_block_alignment
2024-11-27 20:37:56 +01:00
smallmodel
459e13dc76
Allow pusher to teleport
This fixes an issue where teamslaves (bind elements) would not be in sync with the pusher
2024-11-27 14:36:16 +01:00
smallmodel
94e3d95d6c
Update getting_started_installation.md 2024-11-27 14:35:07 +01:00
smallmodel
eeb9139024
Fix incorrect delta for FaceEnemyOrMotion
The AI would not consistently aim at the enemy while covering
2024-11-27 11:57:05 +01:00
smallmodel
486b6f40e5
Don't play sound if the parameter is not specified 2024-11-26 22:47:55 +01:00
smallmodel
d3fdaa060a
Fix bad parameters passed to CG_AnimationDebugMessage 2024-11-26 19:21:18 +01:00
smallmodel
766258e84b
Archive instances of SmokeGrenade
This was mistakenly missing and fixes smoke grenade explosions disappearing after loading from save
2024-11-26 18:38:34 +01:00
smallmodel
8213bf41a8
Fix player having no inventory or dying when respawning immediately after getting killed 2024-11-26 00:53:38 +01:00
smallmodel
8843a8ee15
Remove owner assert
The owner can be NULL so there is no reason to assert on this
2024-11-26 00:36:47 +01:00
smallmodel
6bb09256c5
Teleport the player back to (0,0,0) origin if out of map bounds 2024-11-25 22:32:08 +01:00
smallmodel
b2e6e1b56f
Comment out the Illegal XYZ coordinates message to avoid spamming the console 2024-11-25 22:30:44 +01:00
smallmodel
6b402e5215
Format g_phys source file 2024-11-25 22:21:51 +01:00
smallmodel
04baf673dc
Set MAX_MAP_BOUNDS to 8192 2024-11-25 22:12:47 +01:00
smallmodel
10b7651eff
Use getters for max fire movement and zoom movement 2024-11-25 22:12:29 +01:00
smallmodel
4f76d7291f
Fix typo 2024-11-25 21:02:52 +01:00
smallmodel
1c2be68253
Update getting started (installation) 2024-11-25 20:36:42 +01:00
smallmodel
6c9d6940cc
Disable sv_floodProtect by default 2024-11-25 19:35:37 +01:00
smallmodel
b719455b78
Add the missing newline for iprintln functions 2024-11-25 19:18:15 +01:00
smallmodel
db16c8bea4
Localize player IPrint string 2024-11-25 19:09:02 +01:00
smallmodel
abdaecb28d
Update README 2024-11-25 19:08:03 +01:00
smallmodel
586da44c30
Remove what's Working documentation as everything is implemented 2024-11-24 18:03:15 +01:00
smallmodel
3956e03557
Use Ubuntu 22.04 as the runner OS for linux, to use a lower GLIBC version 2024-11-24 16:31:38 +01:00
ysdragon
8d0b7b77c6 Check for libc and link against execinfo lib for musl libc 2024-11-24 16:04:30 +01:00
ysdragon
23ad991743 Use nullptr instead 2024-11-24 16:04:30 +01:00
smallmodel
4493b2c42e
Prevent integer overflow when interpolating verts 2024-11-24 15:58:18 +01:00
smallmodel
8b6b1597d7
Check for bHitPerson in MV0, MV1 and MV2
This checks if the sentient being hit is dead, and skip it when moving the vehicle so the vehicle doesn't get stuck for when a sentient is dying
2024-11-23 22:58:51 +01:00
smallmodel
dddedba721
Update getting_started_running.md 2024-11-23 21:14:42 +01:00
smallmodel
be34870a18
Copy the channel origin to the sound entity origin when loading
If the channel had a valid entity at the time of saving, make sure to restore the origin
2024-11-23 21:12:58 +01:00
smallmodel
4d4b9288c6
Don't update the streamed channel if the source status AL_INITIAL
This can occur when starting a new sound without playing it, which can happen when reloading the sound system while all sounds are paused (game paused)
2024-11-23 18:42:27 +01:00
smallmodel
fc9be91124
Update OpenAL to 1.24.0
PowerPC will remain on 1.23.1 until the compile issue is resolved
2024-11-23 17:24:05 +01:00
smallmodel
0d24c620fb
Update GCC to version 14 2024-11-23 16:08:25 +01:00
smallmodel
89140f775e
Archive entities at the order they were created
This fixes an issue where turrets would Think() before the base they are mounted on (like tanks), which means the turret would set its origin before the base (tank) does. This issue also occurs on the original game
2024-11-23 15:19:05 +01:00
smallmodel
de6718b511
Include a new section on how to obtain demos online 2024-11-22 21:03:54 +01:00
smallmodel
5c094f9c8a
More clarity 2024-11-22 20:57:26 +01:00
smallmodel
e2f4d8cd6b
Use explicit constants when checking g_gametype 2024-11-22 19:44:53 +01:00
smallmodel
04da76167c
Set the correct face mode for when the AI is facing a entity that allows AI to face
This fixes a mistake where AI would turn away from the player if the player approaches too much
2024-11-22 18:52:36 +01:00
smallmodel
90639cee36
Fix incorrect effect being spawned for MakeEffect CGM 2024-11-22 18:18:27 +01:00
smallmodel
ecfdcca4d5
Update README 2024-11-21 22:07:11 +01:00
smallmodel
3790f057e1
Fix an infinite loop in BulletAttack
This would be caused by an entity that is inside another entity, like 2 actors at the same location
2024-11-21 20:41:57 +01:00
smallmodel
44d8adcfb0
Set the eyePos when loading from save
Server uses the playerState's vEyePos as the position, to add entities to snapshots, so make sure it's initialized before the next snapshot is sent
2024-11-21 20:26:12 +01:00
smallmodel
64f877ae80
Use the correct convention for installing the project
On Win32:
- Binaries and libraries will be installed by default in <PREFIX>/bin
- The prefix is set to `Program Files/openmohaa` by default

On Unix:
- Binaries and libraries will be installed by default in <PREFIX>/lib/openmohaa
- Shared data will be installed in <PREFIX>/share/applications, <PREFIX>/share/metainfo and <PREFIX>/share/icons
- The prefix is set to `/usr/local` by default
2024-11-21 19:49:43 +01:00
smallmodel
2ce8450a7e
Use fprintf to stderr 2024-11-21 01:14:08 +01:00
smallmodel
7e7b3ab280
Fix PDB files mistakenly not included 2024-11-21 00:13:37 +01:00
smallmodel
48c2d026e6
Fix ActorPath not archiving path properly
It was mistakenly archiving the first path multiple times instead of the whole path array. This lead to AI strangely moving after loading from save
2024-11-20 23:32:37 +01:00
smallmodel
ad825f5114
Reimplement noise functions 2024-11-20 23:02:22 +01:00
smallmodel
120a486aea
Use CMake installation directory
This removes the use of the DESTINATION parameter from install() command and instead rely on default values.
The shared build action file was modified to package installed files in a single folder
2024-11-20 22:50:49 +01:00
Joey Riches
864cdf1fc6
CMake: Add uninstall target
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake

Useful when for testing system-wide installation with linux
2024-11-20 18:01:30 +01:00
Joey Riches
f1c12e0649
misc: Add linux assets
Add a .desktop file, this is used by application launchers in order to
find and execute applications, this should be installed to
`/usr/share/applications/org.openmoh.openmohaa.desktop`.

Add appstream metainfo, this provides metainfo that is used by Software
Centers for discoverability, this should be installed to
`/usr/share/metainfo/org.openmoh.openmohaa.metainfo.xml`.

This will open the door to getting OpenMoHAA packaged up by various
linux distros.
2024-11-20 16:40:01 +01:00
smallmodel
58d8a73269
Don't abort() on interrupt or on program termination 2024-11-20 12:46:04 +01:00
smallmodel
c788d57c52
Use abort() rather than doing a segfault 2024-11-19 23:15:01 +01:00
smallmodel
50eda4156a
Don't remove the weapon if it has no start ammo
Instead, prevent sentients from picking up weapons if they get no ammo from it and they already have that weapon. Instead, just let the weapon be picked up as a new weapon
2024-11-19 22:44:04 +01:00
smallmodel
1e609a4b2f
Ignore bullet tracers in 1.11 and below
Before 2.0, the tracer frequency is set on almost all weapons. This has some artifacts on multiplayer, the tracer doesn't look adjusted in first-person view
2024-11-19 22:24:50 +01:00
smallmodel
a0e2162dd7
Fix 1.11 servers filtered out 2024-11-19 22:16:55 +01:00
smallmodel
01dfbcdbfe
Properly print the backtrace and generate a core dump on both Windows/Unix 2024-11-19 21:45:49 +01:00
smallmodel
862af012cb
Fix infinite loop while getting the number of lines in objectives 2024-11-19 20:26:23 +01:00
smallmodel
d83374d38c
Set the default compass scale to 0.5 for the base game 2024-11-19 19:44:55 +01:00
smallmodel
05e14f6364
Adjust the objectives menu accordingly depending on the game message box which depends on the compass scale 2024-11-19 19:41:46 +01:00
smallmodel
6bc621462c
Use CL_FontStringWidth instead of uie.FontStringWidth 2024-11-19 19:17:16 +01:00
smallmodel
acb08b89f7
Fix constant for screenOrg 2024-11-18 22:03:58 +01:00
smallmodel
2107523eda
Use MAX_CLIENTS - 1 instead of 63 2024-11-18 21:57:02 +01:00
smallmodel
2662174eba
Fix radar clients not blinking when talking 2024-11-18 21:22:50 +01:00
smallmodel
59d03ff6f0
Return a virtual scale with the correct ratio if scale variable is set
This prevents the widget from being stretched out on widescreen, currently only the compass uses scalecvar
2024-11-18 21:13:43 +01:00
smallmodel
05d304dfc3
Set ignoredFiles only if ignore_files was specified
This fixes a crash that would occur due to a NULL string
2024-11-18 20:38:03 +01:00
smallmodel
614ed6e632
Use the vartree for flags, rather than copying the flags to a signed int value 2024-11-18 19:47:54 +01:00
smallmodel
eb938c872d
Make varnode endian-independant
This fixes terrain rendering incorrectly on big-endian architectures by using bit operation. The `flags` field in the union always matched the first byte of the variance float value instead of the least significant byte
2024-11-18 19:44:00 +01:00
smallmodel
46e1aa979b
Use ARRAY_LEN instead of sizeof 2024-11-18 18:46:14 +01:00
smallmodel
ec5acb4d98
Fix bad glDepthRange 2024-11-17 22:59:49 +01:00
smallmodel
b237222761
Update features.md 2024-11-17 22:27:20 +01:00
smallmodel
652df1a5af
Prevent players with SVF_NOCLIENT to use objects 2024-11-17 22:10:03 +01:00
smallmodel
69621335db
Put the target extension version in the version string 2024-11-17 21:31:45 +01:00
smallmodel
7b58fbec8a
Fix comparison operator for char 2024-11-17 21:25:54 +01:00
smallmodel
aeb8aa8e55
Don't send a voice chat message if the entity is not sent to clients 2024-11-17 20:28:03 +01:00
smallmodel
e74e113199
Fix voice message always being sent to enemies in team message 2024-11-17 20:26:40 +01:00
smallmodel
953091cdc8
Move and rename macros to snd_local_new.h 2024-11-17 19:11:59 +01:00
smallmodel
5819145af8
Synchronize the entity time with the channel time when loading
This prevents the channel from stopping immediately during respatialization, the entity time may be updated quite some time after loading
2024-11-17 18:46:21 +01:00
smallmodel
154464cda1
Set the server huddraw elements on single-player mode
This fixes huddraw elements not being archived properly when the map starts
2024-11-17 18:26:00 +01:00
smallmodel
2342f08a79
Print the new damage when g_showbullettrace is turned on 2024-11-17 18:02:57 +01:00
smallmodel
16711a33ef
Fix bulletthroughwood and bulletthroughmetal not being archived correctly
This caused issues on some single-player maps where bullet would go through walls
2024-11-17 18:02:35 +01:00
smallmodel
cea0d95fee
Set the pitch to default when setting a new SFX
This fixes channels having an incorrect pitch when starting the sound under some circumstances
2024-11-17 17:12:36 +01:00
smallmodel
989ec9574c
Fix too high farVal for glDepthRange 2024-11-17 16:46:21 +01:00
smallmodel
b0b82f0252
Fix incorrect start trace for Actor::DontFaceWall()
This fixes AI not turning from wall
2024-11-17 16:36:45 +01:00
smallmodel
80ddba1013
Fix constant string for "officer" disguise type
This fixes the officer think not working at all
2024-11-17 16:36:19 +01:00
smallmodel
23f776d3c7
Fix typo 2024-11-17 14:32:44 +01:00
smallmodel
880acf9120
Make com_target_game and com_target_demo write-protected (can only be set at startup) 2024-11-17 14:28:00 +01:00
smallmodel
598110477e
Archive the m_bAlwaysAway variable 2024-11-16 22:35:55 +01:00
smallmodel
ffdfbc3c7d
Fix the bullet stopping after the first entity 2024-11-16 21:57:12 +01:00
smallmodel
a7dc8b3493
Don't archive r_fastsky variable
This prevents this setting to be altered by mods forever
2024-11-16 21:36:56 +01:00
smallmodel
67d8cad64d
Allow sound files from OS disk in pure mode 2024-11-16 21:34:19 +01:00
smallmodel
b007842fb4
Fix pure checksums not matching the server 2024-11-16 21:32:53 +01:00
smallmodel
2c4b5fc9ba
Rename the type variable to currentType so it doesn't take precedence over the type member
This fixes an issue where it was the type variable that was being set, rather than the type member
2024-11-16 20:07:26 +01:00
smallmodel
e96a3f4f59
Use c_str() instead of accessing m_data
c_str() will always return a valid string even if empty
2024-11-16 19:27:48 +01:00
smallmodel
8eded28efc
Fix the typename in the error message for incompatible types 2024-11-16 19:22:01 +01:00
smallmodel
b68bb4cee7
Fix integer overflow in wait command that would cause infinite loop in stock scripts
It was causing a rare infinite loop in anim/stand.scr where it waits for 9999999 if the actor is unarmed and medic
2024-11-16 19:10:26 +01:00
smallmodel
824cfd789c
Properly save and restore entity's children solidity 2024-11-16 18:19:45 +01:00
smallmodel
a0b80a9096
Fix string not usable for targetname 2024-11-16 18:17:19 +01:00
smallmodel
857d25825b
Remove tmvolume like other commands when shutting down OpenAL 2024-11-16 16:57:59 +01:00
smallmodel
735832829d
Don't drop the weapon if it has no ammo 2024-11-16 00:29:44 +01:00
smallmodel
5703161166
Fix grenade dropping no ammo
This makes the weapon drop at least 1 ammo clip
2024-11-16 00:29:13 +01:00
smallmodel
d85455e9ec
Don't export referenced paks if download is disabled on the server 2024-11-15 21:00:20 +01:00
smallmodel
f6c9de4286
Use com_basegame instead of BASEGAME macro 2024-11-15 20:58:46 +01:00
smallmodel
a598cbf0dc
Update running documentation 2024-11-14 20:25:26 +01:00
smallmodel
67b285924c
Prefix OpenAL with debug prints 2024-11-14 19:49:22 +01:00
smallmodel
0c206beb45
Expect a SimpleEntity rather than an Entity
The specified path in FollowPath can be a Waypoint which is a subclass of SimpleEntity
2024-11-14 19:46:16 +01:00
smallmodel
9a6472210c
Use a separate user-data location for the demo version 2024-11-13 23:15:31 +01:00
smallmodel
7576d1241d
Add hardware requirements for non-x86 architectures 2024-11-13 21:49:43 +01:00
smallmodel
fb2f3bddaa
Fix the intermission screen (mission failed/success) not hiding immediately on the base game 2024-11-13 20:01:05 +01:00
smallmodel
96ca9c20e4
Rework fade sequence and make it work 2024-11-13 19:40:31 +01:00
smallmodel
d01fa33e46
Use 0.31 for Breakthrough demo
This makes the Breakthrough demo client compatible with Breakthrough demo servers
2024-11-13 00:07:07 +01:00
smallmodel
ab84a6ea58
Add support for the demo version of the game
This allows the demo version of the game to be used, both for playing on demo servers, or for hosting a demo server
2024-11-12 23:09:37 +01:00
smallmodel
b0a683c188
Don't localize if the localization hasn't been initialized 2024-11-12 23:09:32 +01:00
smallmodel
e5ef61c5d2
Abort decal loading if a shader cannot be found while loading 2024-11-12 23:00:38 +01:00
smallmodel
02af9a763d
Better support for older BSP versions 2024-11-12 20:56:26 +01:00
smallmodel
132903a843
Use different fields for protocol version 6 and 8 2024-11-12 20:56:02 +01:00
smallmodel
fe862badf6
Add printdeathmsg from moh 2.0 and above 2024-11-12 18:37:17 +01:00
smallmodel
1ad5964c2f
Implement stoploopsound from moh 2.0 and above 2024-11-12 18:21:24 +01:00
smallmodel
851a16e18c
Fix the bullet tracer scale 2024-11-12 00:09:29 +01:00
smallmodel
763a79cb74
Fix angle when in turret 2024-11-11 23:48:39 +01:00
smallmodel
c9ccb0efaf
Check for Sentient instead of Player 2024-11-11 23:48:19 +01:00
smallmodel
9e060d11b6
Allow user-created variables 2024-11-11 20:58:37 +01:00
smallmodel
50fdbaf152
Use CVAR_RESETSTRING instead of CVAR_SERVER_CREATED 2024-11-11 20:36:03 +01:00
smallmodel
ccca958ec5
Get the grid1 on each iteration in case it has been reallocated
This fixes a very rare crash that would occur when loading a world map
2024-11-11 19:48:49 +01:00
smallmodel
dd37ba2741
Properly archive clients 2024-11-11 19:06:05 +01:00
smallmodel
81b49236a5
Use proper types for playerState_t structure 2024-11-11 19:00:36 +01:00
smallmodel
894e1d7d66
Properly cleanup the existing owner from targets 2024-11-11 18:37:29 +01:00
smallmodel
9d83d58756
Create path only if the target is a SplinePath 2024-11-11 18:28:56 +01:00
smallmodel
54b9a0c340
Fix incorrect SKB offsets 2024-11-11 18:28:42 +01:00
smallmodel
2cf380c15d
Add scale field for skel header 2024-11-11 18:12:50 +01:00
smallmodel
d400d8927d
Fix archive data between 64-bit and 32-bit architectures 2024-11-11 17:52:24 +01:00
smallmodel
fef30ff3d5
Clear the splinepath entity flag when destroying 2024-11-11 17:35:41 +01:00
smallmodel
4023c9d863
Fix isOpen event, must return true if it's not closed 2024-11-11 16:40:43 +01:00
smallmodel
7bcb91bbb5
Don't allocate the mark if the number of allocated polys is insufficient
There was a very rare occurrence where it would hang trying to find a free mark poly, when the number of specified polys was more than the number of allocated polys. This bug also occurs in the original game
2024-11-11 15:14:20 +01:00
smallmodel
5edee7d12e
Add tmvolume from Spearhead and Breakthrough 2024-11-11 14:24:57 +01:00
smallmodel
51c7e27bc1
Fix the switch label not being archived 2024-11-11 14:05:14 +01:00
smallmodel
f400190531
Fix the switch label called incorrectly for VehicleTurretGunTandem 2024-11-11 14:04:51 +01:00
smallmodel
8732e368b6
Clear the last command angles when loading 2024-11-11 13:49:33 +01:00
smallmodel
7e4da514f6
Update features.md 2024-11-10 22:14:03 +01:00
smallmodel
9a55939b42
Fix weapon selection 2024-11-10 22:10:34 +01:00
smallmodel
cd89d2c0b4
Don't execute reloadmap if the server is not running 2024-11-10 22:10:24 +01:00
smallmodel
661b08a7fa
Don't set g_shownpc to 1 when developer is set 2024-11-10 21:47:58 +01:00
smallmodel
d27f928e2d
Update features.md 2024-11-10 20:58:46 +01:00
smallmodel
079555e43a
Fix VehicleTurretGun sound 2024-11-10 19:29:33 +01:00
smallmodel
fcc4e94655
Continue traveling if the bullet trace goes backwards 2024-11-10 19:02:59 +01:00
smallmodel
c5721f8a2c
Fix variable name starting with multiple consecutive numbers 2024-11-10 17:55:54 +01:00
smallmodel
e5acee55ea
Restore old behavior of "angle" event of the ScriptOrigin class on previous versions (below 2.30) 2024-11-10 17:42:37 +01:00
smallmodel
d3f3b9b51c
Don't allow lean in single-player in the base game 2024-11-10 17:01:56 +01:00
smallmodel
48e9db8966
Don't reload the state table when archiving
This fixes multiple issues where the player could end on an incorrect move type after loading from save, like getting out of the ladder
2024-11-10 16:50:23 +01:00
smallmodel
67486f1e49
Clear the player velocity on intermission 2024-11-10 16:17:03 +01:00
smallmodel
923a6de394
Clear the velocity when both walking and frozen 2024-11-10 16:07:55 +01:00
smallmodel
de0e4954f8
Call G_MoveClientToIntermission() instead of setting the immobile flag 2024-11-10 15:53:06 +01:00
smallmodel
1ef1bad9ae
Add network profiling tool from Spearhead and Breakthrough
Profiling can be enabled with `cl_netprofile` and `sv_netprofile`, the overlay can be shown using `cl_netprofileoverlay` and `sv_netprofileoverlay` and the server can dump network profile using the `netprofiledump` command
2024-11-09 21:38:16 +01:00
smallmodel
23a035e2ca
Use a default value for maxlen and bVirtualScale for Print 2024-11-09 19:38:15 +01:00
smallmodel
ec73268f94
Reorder methods 2024-11-09 19:21:24 +01:00
smallmodel
2b06cc690e
Add reloadmap server command from Breakthrough 2024-11-09 16:03:08 +01:00
smallmodel
7afc2427ac
Finish DrawBoundingBox() entity implementation 2024-11-09 15:51:27 +01:00
smallmodel
f3bbcba4f0
Set blue horizontal lines for debug bbox 2024-11-09 15:16:46 +01:00
smallmodel
0dca08a66a
Fix actor position on a turret 2024-11-09 14:35:52 +01:00
smallmodel
f646151ce2
Set medium difficulty by default 2024-11-09 13:27:24 +01:00
smallmodel
2e0e5db260
Implement bindweap 2024-11-09 00:27:42 +01:00
smallmodel
f34aad03cd
Add script owner implementation 2024-11-09 00:18:59 +01:00
smallmodel
332d209f62
Check if the turret's vehicle entity is valid 2024-11-08 22:31:49 +01:00
smallmodel
888e35466b
Drop error if the Script cannot load the file 2024-11-08 22:28:33 +01:00
smallmodel
1f69fce10e
Don't check for CONTENTS_BBOX on the base game for large bullets passing through entities
Some mods have tanks with mounted turrets and this would cause issues as the bullet would hit the tank instead
2024-11-08 22:06:51 +01:00
smallmodel
ac3eb58671
Return 4 from getconnstate even if it's deprecated 2024-11-08 21:46:25 +01:00
smallmodel
14f3e2faf9
Add a comment about driver solidity 2024-11-08 21:26:23 +01:00
smallmodel
a528e916c2
Add the owner when starting a thread from trigger_multipleall if the activator is a projectile 2024-11-08 21:26:09 +01:00
smallmodel
e6f83bc1d6
Fix the exit position for the base game 2024-11-08 20:46:45 +01:00
smallmodel
841a8d2b4a
Remove clientState_t from g_local.h (shouldn't be defined here) 2024-11-08 20:37:22 +01:00
smallmodel
a51c250a31
Add ScriptDeprecated macros 2024-11-08 19:33:15 +01:00
smallmodel
c2291e92c4
Add Anim_AngularDelta 2024-11-08 19:32:53 +01:00
smallmodel
b8cc3313b1
Check for valid tiki in PF functions 2024-11-08 19:26:37 +01:00
smallmodel
d1fca3e499
Check for valid skeletor 2024-11-08 19:24:07 +01:00
smallmodel
66b882346f
Clear the animation delta when the animation is invalid 2024-11-08 19:13:56 +01:00
smallmodel
b38fedb18c
Make the vehicle path drive from TurretMove
This fixes the issue where the AB41 can't be controlled
2024-11-07 20:23:24 +01:00
smallmodel
e6559c6ae6
Fire the turret only when attackleft is pressed 2024-11-07 20:02:49 +01:00
smallmodel
772aad79d7
Disable cubemap-based lighting due to rendering artifacts/bugs occurring 2024-11-07 19:37:12 +01:00
smallmodel
3e84dbe6ac
Initialize skipFade 2024-11-06 18:53:43 +01:00
smallmodel
381f2b02f5
Add a paragraph about which release should be downloaded 2024-11-05 22:53:54 +01:00
smallmodel
f347102ecb
Add the skipFade parameter in bsptransition so the fade can be skipped
Useful for scripts that are using fadeout during cinematics and then transitioning to the nextmap, like in e2l2 where vehicles explode at the end of the mission
2024-11-05 22:37:33 +01:00
smallmodel
f5d2fdbcad
Return an empty string if the channel is neither playing nor paused
It was only checking if the channel was playing. This was an issue because, in the main menu the music is paused, which means saving from main menu would not save the music filename
2024-11-05 22:16:15 +01:00
smallmodel
ab037f1890
Properly center the window 2024-11-05 22:03:43 +01:00
smallmodel
a933c78d93
Explosions must not kill the window immediately 2024-11-05 22:02:30 +01:00
smallmodel
d08f539e6d
Correctly initialize the window object 2024-11-05 22:02:08 +01:00
smallmodel
caea6e6bba
Return a reference to a const str for the result of Target() 2024-11-05 21:58:19 +01:00
smallmodel
6970e2d00c
Properly check entity sight against passOwnerNum 2024-11-05 21:48:43 +01:00
smallmodel
af084542c4
Don't set the leadside 2024-11-05 21:48:14 +01:00
smallmodel
9f728580b6
Fix Y normal for the output color from cube being mistakenly used twice
This improves the overall lighting from cubemap
2024-11-05 20:31:56 +01:00
smallmodel
c25d0b668a
Only check if m_bVisible is non-zero 2024-11-05 20:30:30 +01:00
smallmodel
1e29fd7d2b
Refactor SetScript/SetThread 2024-11-05 19:52:13 +01:00
smallmodel
67f822d492
Process label of type 'none'
A none variable should be considered valid, it will just clear the label
2024-11-05 18:43:28 +01:00
smallmodel
effbbd6c62
Support long subtitles 2024-11-05 01:14:21 +01:00
smallmodel
db802d1a4c
Update the running documentation 2024-11-04 22:56:06 +01:00
smallmodel
fba40370af
Only create launchers for the standalone game 2024-11-04 22:52:49 +01:00
smallmodel
fc0ca18632
Add missing QUAKED comments 2024-11-04 21:32:16 +01:00
smallmodel
059b0ba34f
Override respondTo method for TriggerEntity
This makes TriggerEntity respond to any object that is a subclass of Entity. This is useful for scripts wanting script_model to touch triggers for cinematic purposes (for example, the bike crash gag at the end of e2l2)
2024-11-04 21:22:09 +01:00
smallmodel
e833b08a8e
Fix G_GetAngle returning the wrong angle (was flipped) 2024-11-04 20:37:28 +01:00
smallmodel
afc431c413
Add a basic launcher 2024-11-04 01:00:53 +01:00
smallmodel
81e407a924
Add EXE_EXT 2024-11-03 21:45:27 +01:00
smallmodel
1f232efdf3
Add the push velocity when jumping from a valid ground entity 2024-11-03 20:34:49 +01:00
smallmodel
94e1830895
Don't jump when on top of another sentient 2024-11-03 20:32:17 +01:00
smallmodel
406f804ef8
Don't jump when inside a vehicle or turret 2024-11-03 20:30:37 +01:00
smallmodel
437f20dfb9
Set the view angles when archiving 2024-11-03 20:21:01 +01:00
smallmodel
ff4438bce9
Properly load the statemap file and get the pain conditions when archiving 2024-11-03 20:12:14 +01:00
smallmodel
5cb343730b
Rename Conditions to m_conditions 2024-11-03 20:06:31 +01:00
smallmodel
dacaaa2cef
Add missing variables from archive 2024-11-03 20:02:55 +01:00
smallmodel
2e6e20cf09
Set the m_bHasJumped value when jumping 2024-11-03 20:01:21 +01:00
smallmodel
2da379bade
Fix typo for nodropweapons 2024-11-03 19:30:56 +01:00
smallmodel
cf8f755f6c
Make comment more clear 2024-11-03 19:23:11 +01:00
smallmodel
8114003c84
Add screenshot/levelshot allowed stuff commands 2024-11-03 18:54:34 +01:00
smallmodel
bb47ba468c
Fix game.skill and game.detail missing getters 2024-11-03 18:51:27 +01:00
smallmodel
b97c47ab32
Cast to clock_t before left-shift 2024-11-03 18:40:18 +01:00
smallmodel
9042ea320c
Refactor UI_RegisterLoadResource 2024-11-03 18:38:12 +01:00
smallmodel
98e725ef7b
Fix EV_StatsUpdater_UpdateStats missing parameter declaration 2024-11-03 18:28:00 +01:00
smallmodel
05b2d3529e
Implement UI_EndLoadResource 2024-11-03 18:27:41 +01:00
smallmodel
00dbc74269
Use MAX_WEAPON_ANIM_SLOTS instead of a constant 2024-11-03 15:36:55 +01:00
smallmodel
8addeedf5e
Fix event parameters being incorrectly archived 2024-11-03 15:33:14 +01:00
smallmodel
bc834b021c
Use and draw the marker material when specified
This is used by the fuse stopwatch hud
2024-11-03 15:09:47 +01:00
smallmodel
6bac4bd57a
Add assertions to check for valid squad mates 2024-11-03 15:09:27 +01:00
smallmodel
51324aa8e9
Archive the ProjectileTarget ID
The ID was missing during save, this caused issues with projectile generators when looking for a local target
2024-11-03 01:51:17 +01:00
smallmodel
7d1d92980a
Disable the charge life when set to 0 2024-11-03 01:40:34 +01:00
smallmodel
3d42197f50
Initialize the minlife field 2024-11-03 01:26:30 +01:00
smallmodel
8a774c02dc
Call G_BeginIntermission() instead of G_MissionFailed() when calling missionfailed 2024-11-03 00:41:26 +01:00
smallmodel
a644e8a09c
Check for GT_SINGLE_PLAYER instead of 0 2024-11-03 00:40:59 +01:00
smallmodel
6f51427c7c
Add a function to count the number of valid clients 2024-11-03 00:34:33 +01:00
smallmodel
62bcf58d83
Call G_RestartLevelWithDelay instead in G_MissionFailed 2024-11-03 00:33:33 +01:00
smallmodel
f40f206161
Don't add the owner velocity by default
This fixes an issue where AI would throw grenades incorrectly
2024-11-03 00:21:27 +01:00
smallmodel
1235f42143
Set the grenade mode when tossing a grenade with the specified speed 2024-11-03 00:20:47 +01:00
smallmodel
1016bfa1ad
Fix calcgrenadetoss2 not pointing to the correct method 2024-11-03 00:19:31 +01:00
smallmodel
f9ce111784
Set the targetname for projectiles 2024-11-02 22:38:45 +01:00
smallmodel
4c057faf73
Add a newline for warnings 2024-11-02 21:51:19 +01:00
smallmodel
4f16179c09
getmins/getmaxs are getters instead of returns 2024-11-02 21:46:55 +01:00
smallmodel
6991c9f9f7
Fix save comment not having the proper string 2024-11-02 21:22:24 +01:00
smallmodel
6e6dac0b74
Proper formatting 2024-11-02 20:56:32 +01:00
smallmodel
23f9c1a1e6
Only set the effect angles from the supplied angles if the spawnthing doesn't have angle set 2024-11-02 20:14:30 +01:00
smallmodel
e4b2c863d8
Fix angles not being set correctly from the base 2024-11-02 20:13:23 +01:00
smallmodel
ae16994289
Fix amplitude mistakenly being set instead of the base 2024-11-02 19:46:32 +01:00
smallmodel
b8b17bb0c9
Implement VSS wind 2024-11-02 19:12:09 +01:00
smallmodel
3098fc98d3
Don't change the velocity for VSS, this was a mistake 2024-11-02 19:01:05 +01:00
smallmodel
f3ecfd04da
Use macro flags rather than constant values 2024-11-02 18:41:56 +01:00
smallmodel
0796fab24b
Fix VSS sources not lerping at all 2024-11-02 18:06:56 +01:00
smallmodel
0fda31b430
Fix radial velocity/circle effects not properly applying 2024-11-02 17:52:33 +01:00
smallmodel
84a2b4be76
Use cg_effect_physicsrate instead of a constant value 2024-11-02 17:51:44 +01:00
smallmodel
5269fbb1fa
Don't set the accel flag for swarm FX 2024-11-02 17:26:08 +01:00
smallmodel
f23dfa091e
Fix wrong flag used for checking for PMF_NO_HUD 2024-11-02 13:48:03 +01:00
smallmodel
32c3964474
Fix the source line having the entire file 2024-11-01 00:11:09 +01:00
smallmodel
6ff92f0a7e
Process the ubersound folder differently depending on the target version
- On 1.11 and below, the ubersound folder is parsed either only in dedicated server mode or in client-only mode
- On 2.0 and above, alias are cleared and the ubersound folder is always parsed in multiplayer on both client and server
2024-10-31 23:57:18 +01:00
smallmodel
c795b2390e
Add a ScriptMaster constructor 2024-10-31 23:55:12 +01:00
smallmodel
ce7005103c
Handle the case where a vector is given for the face command 2024-10-31 23:51:36 +01:00
smallmodel
1a18878f26
Parse unary operators last when calling events 2024-10-31 22:16:20 +01:00
smallmodel
1e036a7689
Clear the torso and legs state when the movement type is set to portable turret 2024-10-31 19:49:05 +01:00
smallmodel
858b27b809
Handle the case where the legs or the torso state is NULL 2024-10-31 19:48:30 +01:00
smallmodel
b4841a878b
Only set the first found mark time and alpha fade 2024-10-31 19:37:42 +01:00
smallmodel
4565b6a9a8
Add cg_addhud and cg_removehud as whitelisted stuff commands 2024-10-31 01:45:37 +01:00
smallmodel
9ffb407d11
Fix incorrect/uninitialized token returned when there is a macro 2024-10-31 01:31:41 +01:00
smallmodel
0f3ffa267a
Parse const array elements properly 2024-10-31 01:22:38 +01:00
smallmodel
74c8aa95f5
Properly ignore single-digits 2024-10-30 23:21:14 +01:00
smallmodel
4853235d86
Don't parse the token as a variable if the identifier only contains number
This fixes an issue where floats would be parsed as a variable after brackets
2024-10-30 22:42:55 +01:00
smallmodel
0d01ea939d
Fix whole script file being printed sometimes on error 2024-10-30 21:25:15 +01:00
smallmodel
5ba6c006c2
Fix compile error 2024-10-30 00:23:42 +01:00
smallmodel
22e7d1e2e4
Only put animation definitions that exist, rather than setting a NULL animation definition
This fixes issues when searching animations by name
2024-10-29 22:27:22 +01:00
smallmodel
c650af7b55
Fix stack corruption due to an improper assignment to the alias 2024-10-29 21:37:31 +01:00
smallmodel
2ce5e498ab
Use CurrentScriptThread() when getting the current script class
So if the current thread is NULL, it will properly throw an exception
2024-10-29 21:11:44 +01:00
smallmodel
d3212c55a0
Properly parse and cache ubersounds, and don't cache resources that must be always loaded to avoid filling up sound indexes 2024-10-29 21:02:16 +01:00
smallmodel
becf9f5d8c
Cache the source position to improve the source search time
This greatly reduces the time to compile big scripts
2024-10-29 20:26:51 +01:00
smallmodel
9cd8133068
Fix the directory prefix when using filters for FS_ListFilteredFiles 2024-10-29 20:25:25 +01:00
smallmodel
48fa5c0ce6
Parse all scr files inside the ubersound folder 2024-10-28 23:29:04 +01:00
smallmodel
6fc7199719
Register server sounds in multiplayer 2024-10-28 23:28:05 +01:00
smallmodel
9e04f94625
Check if the entity is valid after processing pending events during spawn 2024-10-28 23:14:46 +01:00
smallmodel
c9b844b9ea
Count the number of loaded anims and don't return a valid animation definition if there are no loaded animations 2024-10-28 22:57:52 +01:00
smallmodel
497058d7f4
Make the driver nonsolid while moving 2024-10-28 22:30:52 +01:00
smallmodel
a509dd4692
Fix vehicle exit position when targeting the base game
The base game always uses, when specified, the exit position
2024-10-28 22:25:49 +01:00
smallmodel
8fdfffab36
Keep the mouse cursor position when the client disconnects 2024-10-28 21:13:47 +01:00
smallmodel
aa118bceb3
Set the door speed based on the door type 2024-10-28 20:59:58 +01:00
smallmodel
4da50a78d5
Merge pull request #483 from smallmodel/marks_fix
Fix mark fragments being randomly culled or missing, especially on moving brush models
2024-10-28 20:59:28 +01:00
smallmodel
4d27a6daa3
Fix incorrect vert dist 2024-10-28 20:55:03 +01:00
smallmodel
b6f8997a01
Make the mark object local to the entity 2024-10-28 20:47:01 +01:00
smallmodel
568efd4742
Fix the link to the build branch 2024-10-28 19:05:16 +01:00
smallmodel
bf68808eae
Set the skel index for each updated entity so poses only update when needed
This fixes poses being updated even if they don't need update (no frame changed), which resulted in some performance loss and some rare accuracy issues when AI fire weapons
2024-10-28 00:55:37 +01:00
smallmodel
5cbd2dd988
Use true/false rather than qtrue/qfalse 2024-10-28 00:45:21 +01:00
smallmodel
92b4ae2702
Use ANIM_WEIGHT_NONE instead of 0 2024-10-27 22:16:04 +01:00
smallmodel
a8cdf0b5ad
Don't update the upper animation if the think state is attack/grenade/killed/pain 2024-10-27 21:48:13 +01:00
smallmodel
e8dfa0206b
Use a macro constant for movement/action skan blend frames 2024-10-27 21:39:16 +01:00
smallmodel
afe1ba47cf
Decrease the time tolerance between frames to make animations smoother 2024-10-27 19:37:56 +01:00
smallmodel
2afa9adceb
Add a link to mp-navigation for bots 2024-10-27 18:19:58 +01:00
smallmodel
ef32200c8d
Target older macOS versions 2024-10-27 17:45:23 +01:00
smallmodel
dae7795478
Add NDEBUG compile definition on non-debug builds 2024-10-27 17:45:20 +01:00
smallmodel
7c96b68623
Specify the home directory location for macOS 2024-10-27 15:16:01 +01:00
smallmodel
558e69dba8
Archive the vehicle name
This was missing and this allows the torso state to the modheight to set the bounding box height. Before that, it did not recognize the turret so the modheight was still set to stand. It caused issues when trying to get out a vehicle turret, like the flak88 in e1l1 (the player wasn't able to get out of the turret)
2024-10-27 14:27:44 +01:00
smallmodel
da7cd03f09
Increase packed animation time precision
This tries to fix some client commands replaying
2024-10-27 13:42:42 +01:00
smallmodel
6934e5cff8
Check for valid target list in GetScriptTarget() 2024-10-27 12:16:19 +01:00
smallmodel
c7cdde7bc2
Check if the target list is valid before adding the entity 2024-10-26 22:42:21 +02:00
smallmodel
940ac789b9
Change the current fov only if the fov is currently the selected fov
This prevents the player from modifying the fov while zooming
2024-10-26 22:42:18 +02:00
smallmodel
3d46bae1d0
Stop the triggered music when the server is restarted 2024-10-26 15:07:47 +02:00
smallmodel
16bedf7e86
Warp the sample offset for small streams so it doesn't get past the stream size 2024-10-26 15:07:09 +02:00
KevDoy
2ee531511b
Add: Instructions for installing GOG binaries on *nix 2024-10-26 14:58:34 +02:00
smallmodel
0ad5222946
Use the correct stopwatch for explosives 2024-10-26 13:34:33 +02:00
smallmodel
2b4aef4ea6
Add a newline to Cmd_Stuff
Next commands weren't correctly appended
2024-10-26 13:28:49 +02:00
smallmodel
679cf4b7ec
Correctly remove "prespawn"/"spawn" waittill when loading from save 2024-10-26 13:27:32 +02:00
smallmodel
a993b8d352
Specify "Fixed" instead of "Added" as it's a bug that was fixed 2024-10-26 00:34:50 +02:00
smallmodel
b7403347bb
Ignore the first responder if it's disabled so the UI doesn't get blocked by it 2024-10-26 00:30:42 +02:00
smallmodel
bf978256e9
Add changes from upstream, like pipefile, random number seed 2024-10-25 22:33:02 +02:00
smallmodel
9bd25e9734
Combine mouse movement events in event queue 2024-10-25 22:08:24 +02:00
smallmodel
e7499cca04
Also halt the secondary server list if it exists, when canceling refresh 2024-10-25 22:07:23 +02:00
smallmodel
e2d6156b5a
Apply the hidden visibility for all functions only on macOS
The backtrace still prints the name of functions regardless of the visibility on macOS
2024-10-25 22:01:49 +02:00
smallmodel
31cb6216c9
Use a volatile variable to prevent the function from being entirely optimized 2024-10-25 21:06:30 +02:00
smallmodel
e75f5bbbfc
Version number typo 2024-10-25 21:01:01 +02:00
smallmodel
69cc87212a
Bumped the version number to 0.80.0 due to the number of changes and the completeness 2024-10-25 20:49:23 +02:00
smallmodel
3c1500002b
Implement the destructor for the World class to free up the target list 2024-10-25 20:44:00 +02:00
smallmodel
b2287f3d83
Avoid using nextSnap if the prediction is disabled in the next snap
This prevent blinking issues like flashing arms
2024-10-24 21:56:44 +02:00
smallmodel
005a278210
Use CF_CAMERA_ANGLES_TURRETMODE 2024-10-24 21:08:52 +02:00
smallmodel
976e2ae022
Remove useless GetSentientOwner() 2024-10-24 21:08:44 +02:00
smallmodel
8fe87e1067
Handle turret camera flags which has no interpolation 2024-10-24 21:08:26 +02:00
smallmodel
d142ded9ad
Add RF_FRAMELERP flag to ref entity 2024-10-24 21:08:04 +02:00
smallmodel
090f362bb6
Declare g_allowvote as a serverinfo variable 2024-10-23 23:10:22 +02:00
smallmodel
ff3c25cc07
Add cg_allowvote 2024-10-23 23:09:39 +02:00
smallmodel
ed22a51a72
Only allow breakthrough clients when targeting mohaab 2024-10-23 22:22:09 +02:00
smallmodel
9e0c11a970
Reset scoreboard values like the objective and the picture when initializing a new game 2024-10-23 21:04:23 +02:00
smallmodel
edb52a8448
Properly move items in the map rotation list 2024-10-23 20:52:22 +02:00
smallmodel
afb08e0ea9
Prevent adding duplicate maps in the rotation list 2024-10-23 20:49:00 +02:00
smallmodel
8758ba6cb1
Fix the map not starting after applying the rotation list 2024-10-23 20:42:03 +02:00
smallmodel
e6a9968d23
Remove useless assertion 2024-10-23 20:25:17 +02:00
smallmodel
fcd2d2e668
Use the correct weapon selection menu 2024-10-23 20:15:29 +02:00
smallmodel
991c8869d1
Properly draw circles 2024-10-23 20:10:34 +02:00
smallmodel
aef9dc1704
Add feature to show static models culling with r_showcull 2024-10-23 20:07:17 +02:00
smallmodel
848cf7ac01
Fix AddPointToBounds not properly setting the max bounds 2024-10-23 20:03:07 +02:00
smallmodel
de1d3b6ef4
Don't reset the client structure on single-player 2024-10-22 22:36:46 +02:00
smallmodel
29f8ff8d71
Set the new frame radius
This fixes an issue when culling static models as it uses the radius and the radius wasn't initialized
2024-10-22 22:26:55 +02:00
smallmodel
b641a1040c
Fix incorrect cull point height (should be squared) 2024-10-22 22:25:59 +02:00
smallmodel
83acdeb16e
Allow activation of the game menu so it can be focused 2024-10-22 22:06:19 +02:00
smallmodel
aa2d73a1c8
Correctly copy frame bounds 2024-10-22 21:56:35 +02:00
smallmodel
b7a643aa59
Fix AI wrongly aiming at the wrong direction 2024-10-22 21:51:03 +02:00
smallmodel
3d454c90cb
Rework the target list, use a container instead of an hash set so the target list gets archived correctly
This fixes an issue when loading from a save. A variable referencing target list container would have random entities in it, which would cause errors and crashes when trying to do an action on the array of entities
2024-10-22 20:05:53 +02:00
smallmodel
590b3f5cbb
Fix class ID for throbbing box classes 2024-10-22 00:48:11 +02:00
smallmodel
f87e6d5938
Fix barrel jitter
This fixes barrel objects improperly jittering back and forth, sometimes forever
2024-10-21 22:12:13 +02:00
smallmodel
901e81cdf5
Format barrels source file 2024-10-21 21:59:12 +02:00
smallmodel
d2ed2f5e95
Correct the gamma with the proper destination resolution when resampling 2024-10-21 21:37:08 +02:00
smallmodel
c580ccdee1
Only print a warning instead of dropping when the next snapshot is out of range 2024-10-21 21:26:07 +02:00
smallmodel
8ecbe1dd79
Set the script origin local angles and angles when setting the angle
This fixes the issue where a ScriptOrigin would rotate in the wrong direction
2024-10-21 20:27:52 +02:00
smallmodel
64696c7645
Return the angle using the forward vector 2024-10-21 20:24:47 +02:00
smallmodel
ff0dcbd786
Add G_GetAngle 2024-10-21 20:24:33 +02:00
smallmodel
a3e5d62c96
Increase the precision of the delta animation time 2024-10-21 19:54:25 +02:00
smallmodel
267e2f4b15
Add a workaround against inactivity timer for mods that handle spectating 2024-10-21 19:25:52 +02:00
smallmodel
d52bf52e6a
Add BUTTON_ANY flag when moving mouse 2024-10-21 19:22:54 +02:00
smallmodel
f5391bbfa0
Use BUTTON_ANY to check for input rather than BUTTON_MOUSE 2024-10-21 19:03:19 +02:00
smallmodel
a218106c8b
Reset the number of songs when freeing all songs
This fixes an issue where songs from previous maps get played on maps without a music file
2024-10-21 18:40:42 +02:00
smallmodel
8f54f4b806
When loading from save, set the edict model directly rather than loading and resetting animations 2024-10-20 23:25:42 +02:00
smallmodel
78b2637c66
Don't replay animation for new snapshot entities
This prevent cannons effects from replaying due to it being shown when the player exits the cannon
2024-10-20 23:18:00 +02:00
smallmodel
4b25e24a13
Fix issues when using turret while charging a grenade or using the mine detector 2024-10-20 22:42:44 +02:00
smallmodel
aa0c704655
Instead of resetting the state, prevent using the turret if the player is charging 2024-10-20 22:42:05 +02:00
smallmodel
4da099d15c
Add GetChargeFraction() 2024-10-20 22:41:21 +02:00
smallmodel
0bb11d76bd
Remove accidental print 2024-10-20 22:22:36 +02:00
smallmodel
c146452570
Attempt to fix animation time going back and forth 2024-10-20 22:21:27 +02:00
smallmodel
ed05983a57
Use ceiling for the packed anim time
This is an attempt to fix an issue where the animation time would deviate from 1 bit and would go back and forth
2024-10-20 22:19:57 +02:00
smallmodel
909dc96c2f
Use a separate CG_InterpolateAnimParms function for animation 2024-10-20 22:18:40 +02:00
smallmodel
863a6293e7
Don't draw the lensflare in UI 2024-10-20 19:12:42 +02:00
smallmodel
7a49f6fc8b
Fix the fuse stopwatch 2024-10-20 18:55:27 +02:00
smallmodel
c1433a6d9e
Use the correct stopwatch type for when the sticky bomb gets wet 2024-10-20 18:54:36 +02:00
smallmodel
374b8b9ae7
Add fuse stopwatch 2024-10-20 18:52:50 +02:00
smallmodel
e2f5c80afc
Stop charging the weapon when using turret 2024-10-20 18:46:23 +02:00
smallmodel
29911380d1
Use the weapon owner rather than the last successful hit entity 2024-10-20 01:00:55 +02:00
smallmodel
405a4bfe28
Fix debug line delay not working properly 2024-10-20 00:55:08 +02:00
smallmodel
87e41f0c21
Set the model before anything else 2024-10-19 22:44:07 +02:00
smallmodel
dce2bcca7c
Initialize bModelSet 2024-10-19 22:41:32 +02:00
smallmodel
00421a7666
Process client events with the correct order
Effects that are using commanddelay were not working at all, this fixes the processing of delayed events so they get processed sequentially and at the correct time
2024-10-19 22:38:46 +02:00
smallmodel
fd426926e9
Set all alpha color channel in the current static model to prevent vertices from hiding randomly 2024-10-19 21:54:08 +02:00
smallmodel
d83634f8a2
Allow to specify a model when spawning an entity 2024-10-19 21:40:23 +02:00
smallmodel
6efac1c0f7
Don't set animation 2024-10-19 21:27:03 +02:00
smallmodel
3a68ca7f4b
Handle static shader data and entity surface values for when deforming vertexes 2024-10-19 20:45:50 +02:00
smallmodel
8898919fd3
Correctly parse lightingSpecular parameters 2024-10-19 20:45:24 +02:00
smallmodel
40834380cf
Check if the snap is valid before getting the client number 2024-10-19 20:39:57 +02:00
smallmodel
18abf3854d
Use normals for deform vertexes
This fixes the issue where some ocean shaders would look inconsistent
2024-10-19 20:33:57 +02:00
smallmodel
6d0b4f8cb7
Fix PVS sound overflow 2024-10-18 23:50:52 +02:00
smallmodel
fc1f795e83
Use ULightGreen color on SH/BT for dm messages 2024-10-18 23:19:09 +02:00
smallmodel
ef09f136d4
Fix sound indexes not erased correctly 2024-10-18 23:15:59 +02:00
smallmodel
6136bbd019
Set g_netoptimize to 1 when spawning server 2024-10-18 23:05:53 +02:00
smallmodel
5136aa4886
Properly handle and delete unused non visible entity sounds to free up sound indexes 2024-10-18 23:01:27 +02:00
smallmodel
1a3122bef3
Fix pointer to integer warning 2024-10-18 22:14:45 +02:00
smallmodel
23d7db814c
Use an unsigned integer for the column size
This fixes compile warnings
2024-10-18 22:03:41 +02:00
smallmodel
3174ca5da9
Explicitly mark overridden methods 2024-10-18 22:02:27 +02:00
smallmodel
6a107419e3
Only change the maxclients when the map is different
It fixes an issue where on restart, only the number of snapshot entities was changed without the memory being reallocated for it
2024-10-18 20:26:27 +02:00
smallmodel
6d69a8033f
Initialize the radar 2024-10-18 20:12:47 +02:00
smallmodel
bb9ccdd3b9
Make the bot move slowly when aiming with a semi-auto to improve the spread of their weapon 2024-10-18 20:03:39 +02:00
smallmodel
5b3ce85695
Add a method to get the spread factor 2024-10-18 19:52:49 +02:00
KevDoy
84c5bfa777
Add Open MoHAA Text Logos
Add a logo and update the README file to use the new logo

---------

Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2024-10-18 19:26:01 +02:00
smallmodel
d9166478e5
Set the weapon animation back to idle when finished animating
This fixes an issue that also occur in OG, where some weapons would constantly replay the same sounds (often reload/rechamber) when the weapon entity is removed then added to the client snapshot
2024-10-17 17:50:33 +02:00
smallmodel
373fe45b50
Add an example for using bots 2024-10-17 16:33:26 +02:00
smallmodel
cd83091101
Update the ubuntu version for publishing tags 2024-10-17 16:00:06 +02:00
smallmodel
631abd2b0f
Update section about bots 2024-10-17 15:59:03 +02:00
smallmodel
02df233205
Refactor UploadCompressed 2024-10-17 15:17:20 +02:00
Jesse Mitchell
11e9d0f9ba
[macOS / Compiler Fix] Alter offset for Mouse Buttons
Fix the mouse buttons code and alter how the mouseButton check works
2024-10-17 01:24:22 +02:00
smallmodel
35fea91268
Download and install ninja on Windows, from the official ninja-build GitHub repository
This greatly reduces the compile time on Windows
2024-10-16 22:33:08 +02:00
smallmodel
6f3d79ae1b
Use multi-config generators and specify the build type in the --config when using the cmake command instead of using CMAKE_BUILD_TYPE. Also build third-party libraries in Release mode 2024-10-16 22:04:33 +02:00
smallmodel
32da07ea80
Cache Linux apt packages
This avoid overloading servers by downloading the same set of packages multiple times
2024-10-16 20:35:19 +02:00
smallmodel
e9a76f933b
Cast to int32 rather than uint32 when writing the packed velocity
This fixes an issue where the integer could overflow, on some platforms like ARM the integer would be 0
2024-10-16 19:52:47 +02:00
smallmodel
6b6adf1147
Copy second and third triangles, this was forgotten 2024-10-16 18:28:41 +02:00
smallmodel
6413e770e1
Update compiling doc 2024-10-15 23:46:21 +02:00
smallmodel
7d1067108b
Swap the archive type on big endian architectures 2024-10-15 23:38:39 +02:00
smallmodel
e00ebda641
Disable compression for big endian systems 2024-10-15 23:33:00 +02:00
smallmodel
2b6fc0602a
Avoid misaligned memory access 2024-10-15 23:18:14 +02:00
smallmodel
53c09b5342
Correctly swap skeletons for CPUs that don't support misaligned memory access 2024-10-15 23:10:04 +02:00
smallmodel
d78d8abb9f
Correctly load SKB models on big endian architectures 2024-10-15 23:07:58 +02:00
smallmodel
f6b459b408
Correctly copy long/short taking into account memory overlaps 2024-10-15 22:49:23 +02:00
smallmodel
581585a47c
Prevent clearing the event command list if the event system is not initialized
This fixes the issue where the game could crash (especially in optimized release) due to a memory corruption, because the event command list was deconstructed earlier
2024-10-15 20:52:53 +02:00
smallmodel
ddbdcc91dd
Don't use an offset for the reverse table 2024-10-15 19:22:54 +02:00
smallmodel
8f8b75e0aa
Set symbols visibility to hidden by default
This fixes an issue where shared libraries would use functions from in the executable because they have the same name, which would cause memory corruption
2024-10-14 20:36:06 +02:00
smallmodel
2e673a6bc9
Delete posted events when canceling 2024-10-13 23:49:52 +02:00
smallmodel
8c2b92d151
Remove player from turret when deleted 2024-10-13 23:22:13 +02:00
smallmodel
032fb9b5ba
Make sure to delete all conditional objects
This fixes the issue where memory would be leaked by conditionals
2024-10-13 22:09:38 +02:00
smallmodel
b1c5d6c62a
Increase the backtrace size to 64 2024-10-13 11:32:20 +02:00
smallmodel
037af5d728
Don't access the removed node 2024-10-13 11:32:11 +02:00
Leszek Godlewski
61a2b6a837
Don't call into the OAL channel in S_OPENAL_GetMusicFilename if QAL init failed
Prevent a crash upon vid_restart
2024-10-13 00:25:17 +02:00
smallmodel
13698a9590
MINS and MAXS must be signed values 2024-10-12 01:16:31 +02:00
smallmodel
4f2907ef77
Remove LADDER_HAND_HEIGHT (useless) 2024-10-12 01:16:04 +02:00
smallmodel
8667d11c52
Prevent SV_DropClient() from being called recursively if the client is dropped by a kick or timeout and has too many reliable commands 2024-10-11 22:55:24 +02:00
smallmodel
24309095ff
Rework bot save/load:
- Only save and restore the userinfo
- Restore bots when the server spawns
- Read client session data like real players
2024-10-11 22:54:40 +02:00
smallmodel
d5a90ded17
Add a comment about primary weapon selection on map change 2024-10-11 21:51:52 +02:00
smallmodel
9d744367ac
Add firstTime parameter for bots 2024-10-11 21:46:49 +02:00
smallmodel
46a46a9536
Remove unnecessary code 2024-10-10 22:29:17 +02:00
smallmodel
224c1df553
Test against entities with BSP solidity when testing client visibility 2024-10-10 21:38:51 +02:00
smallmodel
bcea5af30f
Remove unused sound index that were used for non visible players 2024-10-10 21:22:59 +02:00
smallmodel
211ce09c0b
Don't create sound index for non visible players if net optimization is disabled 2024-10-10 21:22:35 +02:00
smallmodel
1e41a2595d
Leave 1 second minimum between each call to RefindPath() 2024-10-10 20:27:52 +02:00
smallmodel
36a080b3a9
Call InitModelList() once
This fixes an issue where the model list would get initialized each frame
2024-10-10 20:11:12 +02:00
smallmodel
a3050f6c64
Avoid using too much performance to update the loading screen, especially on low-end PCs 2024-10-10 19:48:23 +02:00
smallmodel
be5deddc1d
Make indexes and coordinates 16-bytes aligned 2024-10-10 19:10:12 +02:00
smallmodel
36f9bdb88c
Use intptr_t instead of size_t because intptr_t can hold a pointer which is not always the case for size_t 2024-10-10 19:07:20 +02:00
smallmodel
1a33e9a15b
Add BotRotation class to handle bot turning 2024-10-09 21:21:19 +02:00
smallmodel
4157a49c7e
Remove useless include 2024-10-09 21:21:13 +02:00
smallmodel
f27be7314e
Add a BotMovement class for managing bot movements 2024-10-09 20:46:39 +02:00
smallmodel
a425038fa6
Set macOS rpath to @executable_path 2024-10-09 19:38:32 +02:00
smallmodel
0b07858bfc
Refactor PlayerBot to use a separate controller class, alongside classes that manage bots 2024-10-08 22:17:22 +02:00
smallmodel
7dbf1d7bf5
Add a method to get the ladder 2024-10-08 21:52:49 +02:00
smallmodel
34c44ab2cf
Add a method to get the max fire movement 2024-10-08 21:52:43 +02:00
smallmodel
5ec106642d
Fix node cover mask 2024-10-08 21:00:01 +02:00
smallmodel
dcd9ce91a8
Use the raw integer value of the squared distance when comparing nodes 2024-10-08 20:42:22 +02:00
smallmodel
a05fbfe69b
Fix incorrect value of AI_CONCEALMENT_MASK 2024-10-08 20:38:34 +02:00
smallmodel
feb76f4fb4
Allow entities other than SimpleActor for finding covers and sniper nodes 2024-10-08 20:31:50 +02:00
smallmodel
d467b68187
Add node editing support, with a way to dynamically load, remove and modify nodes while editing 2024-10-08 20:25:33 +02:00
smallmodel
de18fa2860
Refactor Entity::FovCheck 2024-10-08 20:14:10 +02:00
smallmodel
58f6c719a9
Add code to select current node in view and draw it for editing later 2024-10-08 01:14:40 +02:00
smallmodel
b2fa21a111
Format navigation source file 2024-10-07 23:52:39 +02:00
smallmodel
f94099e350
Don't link nodes that can't be reached with an high fall height 2024-10-07 23:49:39 +02:00
smallmodel
e2f11879d5
MAXS_Z is 94 2024-10-07 23:05:37 +02:00
Sébastien Noel
aa15b3ea7f
Allow to build against system libs instead of bundled copy 2024-10-07 20:51:23 +02:00
smallmodel
1624d10a01
Don't check for bots for smoothclients 2024-10-07 00:51:01 +02:00
smallmodel
0d53adf9bd
Rework bot spawning
- Add a sv_sharedbots to specify if real client slots should be used
- Removed m_bSpawnBot from level, bots are spawned directly in G_BotBegin instead
- sv_numbots can be used to directly configure the number of bots to spawn
- Fix the way bots spawn/unspawn on-demand
- Documented g_bot functions
2024-10-06 22:57:39 +02:00
smallmodel
295c267c31
Automatically join a team if the bot was put in spectator, and automatically select a primary weapon if none was selected 2024-10-06 22:57:31 +02:00
smallmodel
d4b3f7378e
Don't update the new path check time when there is a new move 2024-10-06 22:29:55 +02:00
smallmodel
a503e18966
Make the bot move to the enemy only if it was seen 2024-10-06 22:29:29 +02:00
smallmodel
b1f7d641fc
Use game.maxclients for the maximum number of bots 2024-10-06 21:44:10 +02:00
smallmodel
5019d1e4f9
Spawn bots after the server has spawned 2024-10-06 21:43:42 +02:00
smallmodel
2aa0205872
Clear client persistent to avoid leaking data 2024-10-06 21:01:05 +02:00
smallmodel
a7befa8882
When a client disconnects, delete the entity on the next frame if the function is called while in thinks 2024-10-06 21:00:40 +02:00
smallmodel
a5058c7bab
Call Delete() instead of deleting the item as it could cause issues if the item is being deleted while iterating over edicts 2024-10-06 19:57:03 +02:00
smallmodel
f5558d106e
Don't set the last radar time if the entity number is above the max number of clients 2024-10-06 19:19:44 +02:00
smallmodel
d19328230c
Allow more bots to be spawned alongside the minimum number of players 2024-10-06 18:50:42 +02:00
smallmodel
b77464386c
Count actual clients that aren't spectating 2024-10-06 18:46:23 +02:00
smallmodel
9119319429
Avoid unbalancing teams when removing bots 2024-10-06 18:46:02 +02:00
smallmodel
d3d85fded0
Add TEAM_MAX 2024-10-06 18:37:31 +02:00
smallmodel
9b9642df8f
Add a very tiny offset off the facing dir as a workaround the 1 bit difference between 32-bit and 64-bit
In 64-bit, some windings are off by 1 bit (float values) compared to 32-bit, which causes issue on some maps like `dm/mp_stadt_dm` where the player would get stuck climbing up because of the blocking patch at the top
2024-10-06 17:33:48 +02:00
smallmodel
e564a97b05
Check if the delta is exactly 16 2024-10-06 17:31:02 +02:00
smallmodel
a150cb5c6e
Also check for liberation game type when the team is dead 2024-10-06 16:58:20 +02:00
smallmodel
afd7943b62
Fix incorrect teams and controllers for TOW objectives 2024-10-06 15:20:45 +02:00
smallmodel
09eb130b6d
Update curiosity and MoveDone() 2024-10-06 14:24:32 +02:00
smallmodel
5869ba06bc
Update the attack time when moving 2024-10-06 01:13:12 +02:00
smallmodel
b6c2638c1b
Make curiosity random 2024-10-06 01:01:03 +02:00
smallmodel
16b0f0d625
Use random() in CuriousSound() 2024-10-06 00:53:31 +02:00
smallmodel
9293930628
Make bots jump off ladder
They don't support ladders yet
2024-10-05 23:59:32 +02:00
smallmodel
46935b165c
Fix MoveDone() not checking for height, also return false when temporarily getting away 2024-10-05 23:57:02 +02:00
smallmodel
c0dd08f6e0
Set an higher firing sound in MP 2024-10-05 21:24:45 +02:00
smallmodel
1fde1647e8
Use the proper enum for BroadcastAIEvent 2024-10-05 21:24:29 +02:00
smallmodel
7ef006ccca
Fix nodes improperly connecting to other nodes that are below the ground 2024-10-05 21:15:37 +02:00
smallmodel
fd69d6b42c
Allow the bot to get out if stuck while falling 2024-10-05 20:46:16 +02:00
smallmodel
627f66fb5b
Add basic pathnode editing feature 2024-10-05 20:45:56 +02:00
smallmodel
8451c11916
Add a feature to dynamically create a master class for development 2024-10-05 20:17:11 +02:00
smallmodel
6bbbbcfb05
Allow spawning a simple entity 2024-10-05 20:15:50 +02:00
smallmodel
63465278a5
When there is no free player start spot, try to find a random player s tart one 2024-10-05 20:15:40 +02:00
smallmodel
2980771deb
Fix path node connection, use the target node num 2024-10-05 20:13:03 +02:00
smallmodel
1169b84c2f
Make sure the entity is valid before checking for the bad place team 2024-10-05 20:12:37 +02:00
smallmodel
355491a950
Reduce the bot attack time to avoid the bot getting stuck 2024-10-05 14:47:09 +02:00
smallmodel
7caa0adbab
Toggle use button and don't use if the door is open 2024-10-05 14:46:44 +02:00
smallmodel
8acc51c489
Correctly add/remove bots 2024-10-05 13:54:53 +02:00
smallmodel
732fd98593
Make the bot strafe when attacking 2024-10-05 13:43:09 +02:00
smallmodel
21a610d22c
Fix NoticeEvent ignoring other players on FFA 2024-10-05 11:56:08 +02:00
smallmodel
a379e6efbf
Don't use Ninja on Windows because of chocolatey servers causing troubles 2024-10-05 00:39:23 +02:00
smallmodel
b1e1b6cc68
Properly aim at the last enemy position with some randomness applied 2024-10-04 22:10:51 +02:00
smallmodel
da86e0ce34
Fix bot incorrectly jumping 2024-10-04 21:23:49 +02:00
smallmodel
6ca12eb0de
Fix bot sometimes being stuck respawning between team spawn intervals 2024-10-04 20:27:28 +02:00
smallmodel
a25442368b
Make the bot jump more to avoid getting stuck 2024-10-04 20:25:05 +02:00
smallmodel
e7e95d47a5
Prevent others from picking up the health item if their future health will be full 2024-10-04 19:59:09 +02:00
smallmodel
292fe8eab4
Stop moving if there is a maximum fire movement so the weapon can be fired 2024-10-04 19:48:09 +02:00
smallmodel
272a401189
Make the bot jump even if the path is not valid to get out of spawns with no path nodes 2024-10-04 19:03:33 +02:00
smallmodel
592e3f47e9
Handle curiosity sounds better by getting the owner of concerned entities and ignoring team mates 2024-10-03 22:54:25 +02:00
smallmodel
cabf1a9043
Make AI path more random 2024-10-03 22:23:46 +02:00
smallmodel
e623541861
Improve the way bots turn, make it smoother 2024-10-03 21:57:29 +02:00
smallmodel
b74b6f8c1d
Use the last attacker origin instead of the last death position 2024-10-03 21:33:12 +02:00
smallmodel
11abdd451f
Fix incorrect dir for PathSearch::FindPathAway 2024-10-03 21:27:30 +02:00
smallmodel
1c3596b1f9
Add more conditions to check for valid enemies when attacking 2024-10-03 20:45:23 +02:00
smallmodel
1e73333fbe
Make bot path more random when idle 2024-10-03 20:22:54 +02:00
smallmodel
6eb49f567a
Made tempaway path better 2024-10-03 20:10:33 +02:00
smallmodel
0120e7e4a5
Add liberation messages 2024-10-03 19:06:03 +02:00
smallmodel
10e4d3db11
Check if the activeItem is within the configstring range to avoid leaking data 2024-10-03 19:05:56 +02:00
smallmodel
0b34d2dbb8
Fix ammo bits being incorrect 2024-10-02 23:04:30 +02:00
smallmodel
be1ef1de0e
Try respawning when the player should respawn
This fixes an issue where bots wouldn't respawn with `sv_team_spawn_interval` set
2024-10-02 22:18:07 +02:00
smallmodel
ef45c988c6
Fix player spectating often not spectating the next alive player 2024-10-02 22:16:58 +02:00
smallmodel
3ecdee1b89
Make bots play a taunt when they get a kill 2024-10-02 21:54:56 +02:00
smallmodel
c7561b1f6d
Send the GotKill event to the attacker when killed 2024-10-02 21:50:59 +02:00
smallmodel
50a3df8dff
Fix the instant message maximum number on AA and SH/BT 2024-10-02 21:49:20 +02:00
smallmodel
dfde4a58de
Improve bot movements
- Do random movements if the path cannot be found
- Reset the movement if the bot is really blocked
- Set an higher fall height
2024-10-02 21:29:38 +02:00
smallmodel
090ba308d8
Clear bot buttons after spawning
This fixes a rare occurrence where the bot would fire and reload after spawning
2024-10-02 20:14:24 +02:00
smallmodel
e01e989c22
Check if the snap is valid when notifying for hit/kill
The game would crash otherwise, this is also an issue in the original game
2024-10-02 20:10:29 +02:00
smallmodel
a9b4af98fc
Make bots use random player models 2024-10-02 19:42:03 +02:00
smallmodel
30f5442728
Limit bot vision distance to the farplane 2024-10-02 19:41:25 +02:00
smallmodel
123ca2812a
Define and use DEFAULT_SFX_NUMBER_PLAYING 2024-10-02 19:02:20 +02:00
smallmodel
95435ea512
Improve bot movement
- The bot will immediately move upon spawning
- If blocked, the block will move randomly to get out
- There is now only 1/5 chance the bot will go to the location where they died
2024-10-02 18:34:45 +02:00
smallmodel
db625baadd
Set the healrate to 0 (instant) by default on protocol 8 and below (vanilla AA) 2024-10-02 18:12:10 +02:00
smallmodel
200a80aa02
Automatically choose a primary weapon for bots 2024-10-02 17:02:59 +02:00
smallmodel
0472a93c3f
Ignore kills when telefragging
This fixes an issue (that also occur on OG) where telefrags would also count towards teamkills
2024-10-02 17:02:48 +02:00
smallmodel
9b70e646dc
Add "auto" to automatically choose a primary weapon 2024-10-02 16:52:22 +02:00
smallmodel
388ab210a7
Fix incorrect obituary hit location 2024-10-02 16:42:10 +02:00
smallmodel
15e8a71249
Fix bot userinfo accumulating with previous bot userinfo 2024-10-02 15:59:41 +02:00
smallmodel
dfd04f0d41
Reset the player state when using a turret
This prevents the player from using the turret + hold their weapon to crouch and become impossible to hit
2024-10-02 14:50:11 +02:00
smallmodel
88ac49c0c9
Set the correct flag when the player is using a turret 2024-10-02 14:35:37 +02:00
smallmodel
7d6ff3e6a4
Format bg source files 2024-10-02 14:09:36 +02:00
smallmodel
c68fbfacb9
Set the EF_PLAYER_IN_MENU flag when the player is talking 2024-10-02 14:09:27 +02:00
smallmodel
8e51c7ca3b
Fix VEHICLE_TYPE state condition not returning the vehicle type
This fixes player lacking animation when using heavy weapons like the granatwerfer
2024-10-02 14:09:07 +02:00
smallmodel
33064f8392
Set a default minimum delay between text messages 2024-10-02 13:31:45 +02:00
smallmodel
40141465b5
Add a section about flood protection 2024-10-02 13:29:58 +02:00
smallmodel
13d855c2e7
Use Cmd_Argv() to check for dmmessage 2024-10-02 13:07:04 +02:00
smallmodel
2f8b6a2009
Satisfy stufftext tests 2024-10-02 12:27:57 +02:00
smallmodel
23e56e767f
Increase sphere light limit
Some servers have a lot of objects in maps, causing all spheres to be used
2024-10-02 12:18:58 +02:00
smallmodel
ce5b954c4d
Use the target game version when sending the version to the server, instead of the global project version
The non-dedicated server version of MOH: Breakthrough (standalone executable) rejects clients that have a version of 2.30 or below, or a version of 2.50 or above (0.1 difference), which prevents playing LAN sessions of Breakthrough. To solve this issue, the client now sends a version value that is within the allowed version range for the target game
2024-10-01 23:36:05 +02:00
smallmodel
a0c20663a0
Don't make the player not solid in a vehicle slot
This fixes player not taking hits from explosions
2024-10-01 23:25:01 +02:00
smallmodel
56f850b59d
Don't add the same world surface more than once
This fixes an issue where shaders like water, ocean would look strange or completely black, due to them blending against each other multiple times
2024-10-01 20:51:56 +02:00
smallmodel
253d4e2c4d
Fix jammed door message printed on the first client 2024-10-01 20:26:17 +02:00
smallmodel
6fef42d6e0
Localize the jammed door message 2024-10-01 20:25:51 +02:00
smallmodel
d6a00a5984
Fix IsOpen event not being used
Some multiplayer and single-player scripts rely on it
2024-10-01 20:24:12 +02:00
smallmodel
26a1e24e3a
Fix TIKI_ParseAnimations incorrectly swallowing the full animation file when the map doesn't match
This fixes missing animations
2024-10-01 19:53:33 +02:00
smallmodel
6103efa8cc
Don't set the entity angles immediately during glue
The game expects objects to glue and keep their initial angles/origin
2024-10-01 19:03:17 +02:00
smallmodel
9a7ba0786c
Set the correct number of bits for the large bullet flag in 2.0 and above
This fixes the issue where there the client (in spearhead protocol mode) would read 2 bits instead of the 1 bit the server sent, which would cause a parse error
2024-10-01 18:52:39 +02:00
smallmodel
935efaeb3a
Fix sound event being posted with incorrect arguments
The argument wouldn't contain "wait" when necessary, which would cause scripts to be stuck forever waiting for sound to be done
2024-10-01 18:09:56 +02:00
smallmodel
020a6d8b66
Fix stupid compile error mistake 2024-09-30 22:39:33 +02:00
smallmodel
9dea8fc41e
Fix wrong pointer type passed to strncmp 2024-09-30 21:59:14 +02:00
smallmodel
3a7e249edf
Refactored svflags and use the correct entity server flags 2024-09-30 19:58:41 +02:00
smallmodel
c406aaf74f
Add a feature that prevents teams from being uneven 2024-09-29 19:00:19 +02:00
smallmodel
83938471ca
Set the blue component of the temp model entity
This fixes particles having an incorrect color sometimes
2024-09-29 15:41:35 +02:00
smallmodel
db6ff8901b
Set the render effect of skyportal and skyentity when adding them to the snapshot
This fixes the issue where some entities like effects would be visible through the sky
2024-09-29 15:27:54 +02:00
smallmodel
737ee3af64
Specify the compiler to use globally for macOS 2024-09-29 14:46:42 +02:00
smallmodel
9ea40f31e4
Clear all entities on registration 2024-09-29 13:30:56 +02:00
smallmodel
27bd6f4b1c
Merge pull request #379 from smallmodel/me/throbbingbox
Fix the destroyed model of specific throbbing boxes
2024-09-29 13:09:09 +02:00
smallmodel
b9e9137f90
Fix the spelling for the default explosive sound 2024-09-29 13:03:10 +02:00
smallmodel
bee0bbbe90
Initialize the effect and destroyed model for the specific ThrobbingBox explosive classes 2024-09-29 13:02:56 +02:00
smallmodel
277ca0c951
Handle bigger offsets in sample_ms_offset()
This fixes an issue where when the offset was big enough, the value would overflow and start again from 0
2024-09-29 12:34:07 +02:00
smallmodel
8aa059dd21
When paused, keep in sync with the server time (#371)
This fixes an issue where a temporary lag would occur when starting a single-player map, or when pausing/unpausing the game
2024-09-29 00:10:52 +02:00
smallmodel
c39bdd246a
Correctly load DDS file on bigendian architectures 2024-09-28 20:56:55 +02:00
smallmodel
9823af9159
Fix light grid offsets endianness 2024-09-28 20:45:04 +02:00
smallmodel
9ee0e0a3c9
Correctly copy data on big-endian (#365) 2024-09-28 20:09:42 +02:00
smallmodel
bf184fb719
Use #pragma once instead of #ifndef 2024-09-27 20:19:11 +02:00
smallmodel
94f308c50f
Draw a black outline for game messages and death messages when targeting mohta or mohtt 2024-09-27 20:01:48 +02:00
smallmodel
bfa0ef64ec
Fix the letterbox not transitioning smoothly
This fixes the letterbox being shown immediately
2024-09-27 19:35:30 +02:00
smallmodel
98fc0a8cb9
Fix the letterbox not correctly rendering
When a letterbox was active, it was covering the entire screen
2024-09-27 19:33:39 +02:00
smallmodel
facabc09f5
Don't set the label shader if the specified material name is considered empty (#364)
For labels linking to a variable for the shader, this prevents the label from still being rendered, drawing the tiled square grid (notexture)
2024-09-27 18:30:03 +02:00
smallmodel
51afcd7b96 Fix loading screen being incorrectly displayed
This fixes an issue where some part of the loading screen would not be drawn correctly, due to the screen being updated recursively through UI_Update()
2024-09-27 17:59:03 +02:00
smallmodel
340f1bb287
Put chat first in game and add a statement for disabling text messages 2024-09-26 22:13:33 +02:00
smallmodel
40c8479448
Update server configuration documentation 2024-09-26 20:48:26 +02:00
smallmodel
27e2063bf9
Add server configuration documentation 2024-09-26 20:30:37 +02:00
smallmodel
e43f0a9285
Add a new feature to enable/disable instant messages and text chat with a variable to set the minimum delay between messages 2024-09-26 19:29:56 +02:00
smallmodel
a977cbdd26
Update README 2024-09-26 19:27:11 +02:00
smallmodel
dbc536c6c2
Fix voice chat time not working on FFA 2024-09-26 19:10:01 +02:00
smallmodel
97c9075503
Fix a small mistake in normal calculations for MM_ClipVelocity2D
Same error as commit c76dda1523. This fixes an issue where AI would run too slowly, like the crate guy in the intro of e1l1, the crate guy was too slow that it ran through the intro vehicle
2024-09-26 18:20:25 +02:00
smallmodel
290e45062d
Set the server time before calling ge->RunFrame() in SV_SpawnServer()
This fixes an issue where some scripts wouldn't be initialized in time, like those that set AI animations. For example this caused an issue with the plane passenger in e2l1, where the animation would get reset due to a very specific chain of events
2024-09-26 01:18:11 +02:00
smallmodel
fc6bffe683
Don't post event when loading save game 2024-09-26 01:01:27 +02:00
smallmodel
1fb8327ca9
Don't let the frame msec go below 0 2024-09-25 22:14:27 +02:00
smallmodel
36208de902
Fix spawn time delta 2024-09-25 22:12:29 +02:00
smallmodel
5403577642
Fix the return value of FS_Seek
It returns a negative value on failure, so handle that properly
2024-09-25 21:04:55 +02:00
smallmodel
c76dda1523
Fix a small mistake in normal calculations for MM_ClipVelocity
This leaded to some occasional errors in AI movement, like in e3l2 where the medic gets stuck while going down the stairs
2024-09-25 20:22:42 +02:00
smallmodel
b5034e5b12
Fix the m_iSaySlot being mistakenly used for the weight cross blend, the specified slot parameter must be used instead
This fixes #266 where some AIs would lack speech animation
2024-09-25 20:04:58 +02:00
smallmodel
b039333922
Call AnimName() to get the current animation name 2024-09-25 19:48:06 +02:00
smallmodel
b504e0d109
Call CurrentAnim() to retrieve the animation index 2024-09-25 19:47:43 +02:00
smallmodel
0692b9dcdb
Fix events sometimes not being posted to entities
Fixes #253
2024-09-25 19:41:21 +02:00
smallmodel
085b72154f
Use a more modern implementation of minizip from ioquake3 2024-09-24 22:25:33 +02:00
smallmodel
4f99c0fa98
Merge branch 'me_main' 2024-09-24 20:11:44 +02:00
smallmodel
b38b71eb44
Small mistake fix 2024-09-24 20:11:34 +02:00
smallmodel
639da1a4b8
Remove unused variables 2024-09-24 20:09:39 +02:00
smallmodel
f2d27aae3f
Update getting_started_running.md 2024-09-24 20:06:37 +02:00
smallmodel
931876ac77
Remove lidbad-0.15.1b 2024-09-24 20:03:30 +02:00
smallmodel
e5f62a9188
Update features.md 2024-09-24 20:02:41 +02:00
smallmodel
3fb699979c
Fix small equality mistake (expected assignment) 2024-09-23 22:44:11 +02:00
smallmodel
85f15a1f28
Delete spawnthings when their last temp model is freed
This fixes:
- Losing FPS in a match with a lot of players, due to a massive amount of emitters getting spawned every time a weapon fires
- Memory leaks due to emitters staying in memory forever after being spawned
2024-09-23 19:29:07 +02:00
smallmodel
758017b638
If the temp model being removed is the head one, use its sibling 2024-09-23 19:16:31 +02:00
smallmodel
724d1db9b8
Properly clear parents of orphaned entities 2024-09-22 21:38:35 +02:00
smallmodel
00421fbee6
Fix the link to the branch build workflow 2024-09-22 20:18:40 +02:00
smallmodel
2510bab41f
Change the order of the target os for more clarity 2024-09-22 20:16:51 +02:00
smallmodel
c6675f2013
Remove special features code to avoid any confusion 2024-09-22 20:06:31 +02:00
smallmodel
1fd6c2bd52
Merge pull request #360 from pryon/UINotepad-fixes
UINotepad fixes and improvements
2024-09-22 19:35:52 +02:00
smallmodel
8f355fe188
Add Voip code from ioq3 2024-09-22 16:50:44 +02:00
smallmodel
dbd10a281b
call CL_ShutdownInput() 2024-09-22 16:39:30 +02:00
smallmodel
d57ea3695b
Add VOIP code for cl_input 2024-09-22 16:38:00 +02:00
smallmodel
8dd74b7789
Get rid of the code that sends next fragments from clients 2024-09-22 16:35:12 +02:00
smallmodel
36c00f146d
Improve gamepad support 2024-09-22 16:19:55 +02:00
SmileTheory
aba9f25744
Fix frame_msec possibly being zero in cl_input.c.
This fixes a mouse freezing bug.
2024-09-22 16:14:01 +02:00
smallmodel
dacfa6ae55
Made common source file a C file as it should be 2024-09-22 16:03:02 +02:00
smallmodel
f53fba082a
Improve memory for debugging purposes 2024-09-22 15:45:29 +02:00
smallmodel
764b95f617
Set a better name for binaries to properly distinguish the name of the architecture 2024-09-22 14:56:02 +02:00
smallmodel
3237b3564e
Update getting started running 2024-09-22 14:23:51 +02:00
Zack Middleton
985731f543
Fix command line variables not being set correctly
+seta, +sets, and +setu were ignored because Com_AddStartupCommands
thought Com_StartupVariable handled it.

+set didn't allow value to be multiple tokens which due to Unix shell
unintuitively removing quotes causes the variable to only be set to
the first token. This could be worked around by escaping quotes

    ioq3ded +set g_motd \"hello world\"

but it doesn't match behavior of other start up commands (which now
includes seta, sets, and setu) that use all tokens.
2024-09-22 13:47:55 +02:00
Thilo Schulz
7c28efe9cd
Fix bug where Com_StartupVariable would set CVAR_USER_CREATED on already existing cvars 2024-09-22 13:36:23 +02:00
smallmodel
5b567f4cba
Fix music volume not restored when the map restarts after the intermission 2024-09-22 01:39:40 +02:00
smallmodel
78918eb59d
Correctly process statements with a semicolon 2024-09-22 01:23:23 +02:00
smallmodel
1848506f09
Properly pass the size of the path buffer into Q_strncpyz 2024-09-21 23:09:16 +02:00
smallmodel
ce0004a296
Use unsafe version of strcpy as the buffer length is unknown 2024-09-21 23:08:52 +02:00
smallmodel
e85d3f2a19
Pass the correct size to Q_strncpyz 2024-09-21 22:50:53 +02:00
smallmodel
4e5a0a30bf
Fix subtitle being incorrect due to the size of the pointer (and not the size of the string) being passed to Q_strncpyz 2024-09-21 21:09:12 +02:00
pryon
9ab37e54b4 Fix CodeQL printf argument type warning 2024-09-21 20:59:27 +02:00
smallmodel
0bd15172b1
Use Ninja generator for faster builds and set compiler/flags in environment variables directly to reduce copy-pasted parameters 2024-09-21 20:34:45 +02:00
pryon
fe0e5c1d9c Fix bug when multiple lines are joined together after copy-pasting text 2024-09-21 20:08:11 +02:00
pryon
5128d88722 Fix bug when deleting multiple lines doesn't actually remove everything selected 2024-09-21 20:04:57 +02:00
pryon
173ca3e58e Fix assertion failures on str operations 2024-09-21 20:02:58 +02:00
pryon
2a13fca737 Fix an off-by-one bug when selection points are determined 2024-09-21 20:01:03 +02:00
pryon
b3a9f4423b Fix crash when saving a file with no contents or with no name 2024-09-21 19:52:20 +02:00
pryon
62c24826e6 Silence some localization error console spam messages
This helps to reduce the number of `LOCALIZATION ERROR` messages in the console for strings that couldn't be translated anyway
2024-09-21 19:49:43 +02:00
pryon
a3d2c2c044 Properly free uipopup_describe instances 2024-09-21 19:46:32 +02:00
pryon
72409622ef Stop activating controls when their vertical scrollbar is hovered over
This fixes the annoyance of open windows (console, notepad) losing focus just by simply moving the mouse around
2024-09-21 19:43:18 +02:00
pryon
c8a2de8235 Implement FS_FileTime for proper retrieval of file date/size info in FilePicker 2024-09-21 19:37:50 +02:00
pryon
6b91846b0c Reimplement Sys_ListFiles and Sys_ListFilteredFiles
They had several bugs, like showing the current and parent directory entires twice, not seeing files but only directories, etc.
2024-09-21 19:36:13 +02:00
pryon
92190220aa Implement clipboard functionality 2024-09-21 19:32:23 +02:00
smallmodel
705d30d125
Add ninja/cmake/clang to the list of packages to install 2024-09-21 19:18:35 +02:00
pryon
c316dc7b00 Fix incorrect line width calculation when tabs are present 2024-09-21 19:17:25 +02:00
smallmodel
529dc29d08
Remove CMake parallel build setting 2024-09-21 19:15:26 +02:00
smallmodel
91e760bf5f
Use a more recent version of ubuntu image for linux 2024-09-21 18:50:10 +02:00
smallmodel
61e24499bf
Cross-compile macOS binaries with single hosted runner image 2024-09-21 18:44:23 +02:00
smallmodel
75621651e5
Add arm64 to valid OSX architectures 2024-09-21 18:30:37 +02:00
smallmodel
3973b95746
Build MacOS binaries from GitHub Action 2024-09-20 23:09:07 +02:00
smallmodel
f9d264058b
Use safe version of sprintf and strcpy 2024-09-20 23:08:53 +02:00
smallmodel
a69d9d4483
Fix compilation errors for MacOS, and add support for MacOS 2024-09-20 21:31:27 +02:00
smallmodel
8b19d00086
Remove the last OpenAL linking as it's already linked before 2024-09-20 21:29:15 +02:00
smallmodel
1156d4f881
Replaced (u)int64_t with long long to avoid constructor conflicts with some compilers 2024-09-20 21:28:36 +02:00
smallmodel
08c5186426
Use stdlib.h as malloc.h is deprecated 2024-09-20 21:27:53 +02:00
smallmodel
61b4a817f3
Move alloca include directive to q_platform.h due to difference between platforms 2024-09-20 20:52:41 +02:00
smallmodel
13710904ba
Update getting started installation 2024-09-20 18:45:15 +02:00
smallmodel
015ebb650e
Clean up ClassDef class 2024-09-19 22:50:33 +02:00
smallmodel
17d623bf85
Add more clarity + check the length of the const_str enumeration and the length of the const string array to make sure they both match 2024-09-19 21:23:19 +02:00
smallmodel
0049348de5
Update features documentation 2024-09-19 21:06:22 +02:00
smallmodel
20d11f5f97
Add max_amount parameter to the EV_Sentient_GiveAmmo documentation 2024-09-19 21:02:04 +02:00
smallmodel
047a7bb949
Deprecate r_forceClampToEdge in favor of automatic detection
This avoids setting the variable manually to fix sky seams and weird graphical artifacts. Now, it's detected automatically
2024-09-19 21:00:22 +02:00
smallmodel
52c79f7f77
Make crates correctly fall 2024-09-19 20:49:33 +02:00
smallmodel
c97bc2e977
Add more clarity in crateobject.cpp 2024-09-19 20:38:31 +02:00
smallmodel
78d564cc04
Fix CrateThink stopping when it shouldn't 2024-09-19 20:34:04 +02:00
smallmodel
e27c0716c4
Allow more stufftext commands when the local server is running
Those stufftext commands are primarily used by single-player maps and briefings
2024-09-19 20:14:15 +02:00
smallmodel
35d037daff
small detail change 2024-09-19 20:00:53 +02:00
smallmodel
f055162ac0
Adjust the quick message DM console rectangle to avoid seeing characters 2024-09-19 19:46:27 +02:00
smallmodel
f2e32c737b
Fix the gap in the console between the bottom line and the text 2024-09-19 19:46:07 +02:00
smallmodel
205709271b
Add fixes from upstream ioq3 2024-09-19 19:24:31 +02:00
smallmodel
3e70a9fab8
Fix mistakes that lead to compilation errors 2024-09-19 19:19:58 +02:00
smallmodel
733c6c96f0
Merge pull request #359 from twolife/spelling
Fix a few typos
2024-09-19 17:44:08 +02:00
Sébastien Noel
a010e648ee Fix a few typos 2024-09-19 10:52:47 +02:00
smallmodel
1c7b561aa9
Filter stufftext commands
This works by allowing the stufftext server command to be executed if the statement only contains whitelisted commands and variables
2024-09-18 23:51:39 +02:00
smallmodel
75a71d35ec
Avoid calling isspace with a character that has a value below 0 2024-09-18 23:04:01 +02:00
smallmodel
7c0f0672bd
Add r_vidmode1024 and r_vidmodemax so the display resolution can be changed in Spearhead and Breakthrough 2024-09-18 22:59:30 +02:00
smallmodel
8fc6b6e3c3
Correctly handle quick message and message mode for the chat window
This fixes the chat window not being put in quick message mode at all when intended, now it also correctly handle team/private message modes
2024-09-18 22:14:16 +02:00
smallmodel
6c2c8ca2b7
Don't archive s_openaldevice and s_openaldriver 2024-09-18 22:10:33 +02:00
smallmodel
1b6bdd07e7
Disable function keys for UI
This fixes the issue where menus like the message mode can't be toggled
2024-09-18 21:51:35 +02:00
smallmodel
539688dd3d
Reduced the delay to 33 ms (30 fps) to update the loading bar
This makes the loading bar smoother
2024-09-18 20:56:13 +02:00
smallmodel
08e09c3b4c
Avoid setting variables with the same value
This prevents the console from being spammed with constant variable change when `developer` is set to 2
2024-09-18 20:55:02 +02:00
smallmodel
4259053c7e
Expose methods for basic DMA (when OpenAL is unavailable) 2024-09-18 20:49:38 +02:00
smallmodel
c221cfd493
Reorganize workflows and use multiple environments for different release stages 2024-09-18 20:33:30 +02:00
smallmodel
41298b53d4
Add PRODUCT_VERSION_STAGE variable to define the stage of the software through builds 2024-09-18 18:13:57 +02:00
smallmodel
ddcd05adc6
Cancel other CodeQL actions on newer pushes 2024-09-18 17:10:25 +02:00
smallmodel
a28cd64c7a
Update implementation documentation again 2024-09-18 00:30:38 +02:00
smallmodel
38e62fef18
Update the implementation documentation with the current state 2024-09-18 00:26:51 +02:00
smallmodel
3f139f463b
Remove stub print 2024-09-18 00:19:05 +02:00
smallmodel
0597191319
Implement SkelVec3::IsUnit 2024-09-18 00:18:08 +02:00
smallmodel
f4c8b0c21f
Initialize the cube build info
This should fix lighting being too dark or incorrect in some places
2024-09-17 22:22:42 +02:00
smallmodel
bba7031f3d
Add more clarity to code 2024-09-17 22:20:20 +02:00
smallmodel
4785913e02
compare_light_intensities should compare intensity as integers directly 2024-09-17 21:31:50 +02:00
smallmodel
a6808d1f6a
Fix incorrect light color for point lights and spot lights, also handle negative point light intensity
This fixes lighting from sphere being computed incorrectly for entities, making entities often look black or having strange lighting color
2024-09-17 21:27:14 +02:00
smallmodel
7188e9832a
Fix leaf iteration 2024-09-17 20:51:00 +02:00
smallmodel
0cce0c81fb
Prevent world values from being overridden by entities 2024-09-17 20:32:39 +02:00
smallmodel
a60baa03e0
Add MAX_SPHERE_LIGHTS 2024-09-17 20:06:35 +02:00
smallmodel
b0c8dafb33
Correctly compute colors for static model in vertex lit texture 2024-09-17 20:02:37 +02:00
smallmodel
b672fc8b29
Add #if, #if_not and #else shader statements 2024-09-17 20:00:24 +02:00
smallmodel
eac69f659f
For dot/oneminusdot, shader needs normal 2024-09-17 20:00:00 +02:00
smallmodel
d9ab65154c
Fix incorrect lighting grid blend 2024-09-17 00:27:01 +02:00
smallmodel
c120aed8bb
Fix incorrect static model grid lighting 2024-09-16 22:11:58 +02:00
smallmodel
ecdbe3d959
Don't check lightmap for RB_StageIteratorVertexLitTextureUnfogged to be used 2024-09-16 22:01:04 +02:00
smallmodel
96d10fb8b0
Mark r_light_nolight as cheat 2024-09-16 20:50:02 +02:00
smallmodel
2ab826268d
Clear the legs state during the torso evaluation when the movecontrol is not legs
The legs state won't be stuck anymore waiting for an empty animation. This could happen under special circumstances, when the torso evaluation sets the movecontrol to non-legs (clears the legs anim) and then back to legs in subsequent iterations.
Fixes #105, the issue cannot be exploited anymore for land-sharking
2024-09-16 20:20:19 +02:00
smallmodel
c3e3f368e0
use cheats rather than sv_cheats to check if the client is connected to a cheat server 2024-09-16 18:59:36 +02:00
smallmodel
f35582489d
Fix support for british, russian and italian voices in Spearhead and Breakthrough 2024-09-16 18:09:56 +02:00
smallmodel
9acea3484d
Play zing sounds only if the location if the zing is valid
This fixes a potential crash where uninitialized position would be passed to the sound system
2024-09-16 17:39:15 +02:00
smallmodel
a72da9b73e
Fix incorrect terrain height for poly
This caused decals to float in the air when they were placed on the terrain
2024-09-15 23:49:42 +02:00
smallmodel
df53d35967
Fix real dynamic lighting algorithm for both terrain and patch
This fixes #356 where real dynamic lighting would look completely wrong, making it look like there are graphical artifacts on surfaces
2024-09-15 21:23:17 +02:00
smallmodel
e5e7421d3c
Fix terrain lightmap when there is a dynamic light map
This fixes terrain having a completely wrong lightmap texture coordinates for dynamic lighting
2024-09-15 21:21:38 +02:00
smallmodel
6ff25d00fc
Use lightmap offset for grid surface when a dlightmap is specified 2024-09-15 21:15:01 +02:00
smallmodel
4a5b0b3105
Fix y lightmap position when allocating a new lightmap block
See the issue with dynamic lights: #356
2024-09-15 19:39:22 +02:00
smallmodel
d05d964432
Fix NaN lmapStep for terrain patches 2024-09-15 19:34:25 +02:00
smallmodel
daa4a67b49
Reuse dlightmap in R_CheckDlightSurface and R_CheckDlightTerrain 2024-09-15 19:34:06 +02:00
smallmodel
9c0224911c
Reset the number of dynamic lights when calculating the real terrain lighting
This fixes a crash that can occur when there is only the terrain that can be lit with dlights
2024-09-15 12:02:05 +02:00
smallmodel
ef5759cff5
Don't execute commands during the intro 2024-09-15 01:21:20 +02:00
smallmodel
77292fb9ab
First person spectator fix (not working yet) 2024-09-15 01:21:17 +02:00
smallmodel
6fb9ab078e
Implement RE_DrawBackground_DrawPixels 2024-09-15 01:12:00 +02:00
smallmodel
844a72e0f3
Add DrawPixels and PixelZoom 2024-09-15 01:11:52 +02:00
smallmodel
46e9046629
Implement VehicleHalfTrack 2024-09-15 01:03:37 +02:00
smallmodel
e5af60787e
Partially implement GetZone/IsInZone 2024-09-15 00:42:35 +02:00
smallmodel
4b0696a187
Implement remaining methods of ClientGameCommandManager 2024-09-15 00:42:22 +02:00
smallmodel
a6377fedab
Remove useless code 2024-09-14 23:36:19 +02:00
smallmodel
2f884e6d55
Call Key_GetCatcher/Key_SetCatcher instead of modifying the variable directly 2024-09-14 23:32:24 +02:00
smallmodel
28f8c65771
Key_SetCatcher() must use cls.keyCatchers 2024-09-14 23:30:30 +02:00
smallmodel
b509ef5ab4
Deactivate the mouse only when loading 2024-09-14 23:29:30 +02:00
smallmodel
9f48dabaec
Play the game's intro when starting 2024-09-14 22:59:27 +02:00
smallmodel
5b0224ae3c
Implement support for playing movies
Videos like briefings and intro are now played correctly
2024-09-14 22:58:43 +02:00
smallmodel
c3ef267d6d
Implement movie audio in OpenAL code 2024-09-14 21:55:15 +02:00
smallmodel
fe9b298705
Export cl_movieaudio 2024-09-14 21:53:19 +02:00
smallmodel
0b106cf47e
Print errors only when developer mode is set 2024-09-14 13:21:08 +02:00
smallmodel
9b417c9b26
Add EV_Client_ForceFeedback (unused) 2024-09-14 13:20:55 +02:00
smallmodel
37d5458c4c
Partially implement cinematic support for reading RoQ files (no audio yet) 2024-09-13 23:00:31 +02:00
smallmodel
77d48cb104
Don't call UI_ClearBackground in cinematic mode 2024-09-13 22:58:37 +02:00
smallmodel
a25200741a
Finis the loading screen if it's the default 2024-09-13 22:23:53 +02:00
smallmodel
d04a32920a
Fix an incorrect parameter value passed to FS_Read when reading the DCL file 2024-09-13 21:49:45 +02:00
smallmodel
792b676c11
Set the number of brush models
The level marks system depends on the number of brush models and leafs, having a number that doesn't match what was saved would cause a crash
2024-09-13 21:47:57 +02:00
smallmodel
690a7a7557
Format cl_ui file 2024-09-13 21:36:23 +02:00
smallmodel
e128c93ad9
Declare CL_FinishedStartStage 2024-09-13 21:25:41 +02:00
smallmodel
39add5ccec
Fix incorrect parsing of music volumes 2024-09-13 20:01:01 +02:00
smallmodel
a1a89cba34
Allow dynamic adjustment for the size of status columns in SVC_Status 2024-09-13 19:50:29 +02:00
smallmodel
2d696cf500
Also use the port when connecting to a server 2024-09-13 19:07:06 +02:00
smallmodel
45fe0bc8b7
Add an IP column
See #353 where servers would appear twice
2024-09-13 19:06:38 +02:00
smallmodel
9fc4c67187
Fix a crash when insep is 0 2024-09-13 19:05:30 +02:00
smallmodel
34aeab5f77
Fix the game type string being empty
(see #353 for the game type)
2024-09-13 18:34:43 +02:00
smallmodel
b510452260
Remove useless comment 2024-09-12 23:48:46 +02:00
smallmodel
89b8d5a67b
Use source files in renderercommon 2024-09-12 23:46:13 +02:00
smallmodel
500e3a3b2c
Add support for JPEG screenshots 2024-09-12 23:33:39 +02:00
smallmodel
47e575ed9a
define USE_INTERNAL_JPEG for compatible JPEG struct size 2024-09-12 23:33:21 +02:00
smallmodel
10b30d74e7
Implement sample_volume() 2024-09-12 22:23:27 +02:00
smallmodel
1ba4c6b7ad
Remove useless comment 2024-09-12 22:18:09 +02:00
smallmodel
eb899be95e
Implement RE_GetGraphicsInfo 2024-09-12 21:40:07 +02:00
smallmodel
6d993af419
Fix compiler warning 2024-09-12 21:09:07 +02:00
smallmodel
a136cccbe1
Implement R_CraterTerrain 2024-09-12 21:02:04 +02:00
smallmodel
2b43ebfca4
Add ter_crater command 2024-09-12 20:43:24 +02:00
smallmodel
06f4980ee1
Implement ghost textures with particles 2024-09-12 20:09:05 +02:00
smallmodel
6cdf5b7b7e
Process .gst files 2024-09-12 19:44:36 +02:00
smallmodel
117b9a5579
Add declarations for GHOST functions 2024-09-12 19:42:41 +02:00
smallmodel
9475be8f6f
Remove entityNumIndexes/staticModelNumIndexes from declaration as it causes compilation issue on some compilers 2024-09-11 23:41:47 +02:00
smallmodel
41ca1797f9
Implement basic GHOST methods and functions 2024-09-11 23:21:50 +02:00
smallmodel
e56ae3d266
Update features.md 2024-09-11 21:07:55 +02:00
smallmodel
735ffaf80b
Implement swipe 2024-09-11 19:57:45 +02:00
smallmodel
ed52d1c648
Implement R_FastDlightTerrain 2024-09-11 19:19:38 +02:00
smallmodel
78fa90c59b
Move RB_StaticMesh to tr_model.cpp for info world tris 2024-09-11 19:03:41 +02:00
smallmodel
548a3efe5a
Implement R_InfoWorldTris_f and R_PrintInfoWorldtris 2024-09-11 18:57:50 +02:00
smallmodel
18a12eeba3
Fix loop breaking instead of continuing 2024-09-11 18:51:05 +02:00
smallmodel
83d486ceeb
Add missing declarations 2024-09-11 18:48:47 +02:00
smallmodel
d898c0f995
Implement R_PrintInfoStaticModels 2024-09-11 18:45:17 +02:00
smallmodel
02faf6f8c1
Implement R_Sky_ChangeFrustum 2024-09-11 18:27:19 +02:00
smallmodel
3478bbddf2
Implement RB_ComputeShadowVolume 2024-09-11 18:02:39 +02:00
smallmodel
fd1ee31e1e
Remove useless comment 2024-09-11 17:56:26 +02:00
smallmodel
4a565f0985
Declare R_GetLightingGridValueFast 2024-09-11 00:23:43 +02:00
smallmodel
c68f23cdaf
Fix compilation warnings 2024-09-11 00:21:31 +02:00
smallmodel
e386eb00ef
Implement all lighting functions 2024-09-11 00:12:13 +02:00
smallmodel
662d048bf4
Implement R_AddLightGridSurfacesToScene 2024-09-10 20:42:05 +02:00
smallmodel
d9e3cc2188
Add a way to draw the skeleton for debugging purposes 2024-09-10 20:16:56 +02:00
smallmodel
a586f13af8
Remove CL_GamespyServers_f as there is an existing implementation 2024-09-10 19:58:28 +02:00
smallmodel
37820c1673
Generate QKey 2024-09-10 19:57:25 +02:00
smallmodel
8a2e4ca470
Add Com_RandomBytes and Com_IsVoipTarget 2024-09-10 19:54:25 +02:00
smallmodel
3a5da64c6f
Make radar clients speak on mohaas/mohaab 2024-09-10 19:50:43 +02:00
smallmodel
9c018a2330
Implement CGM_FENCEPOST 2024-09-10 19:40:53 +02:00
smallmodel
0840cdd83a
Restore the old behavior where the bullet would hit all entities in sight. Only works when targeting mohaa version 1.x
Fixes #348. Since 2.0, bullet trace stops after the first hit entity even if it's a trigger, which can be an issue on some SP maps.
2024-09-10 19:01:34 +02:00
smallmodel
e972747969
Update documentation
This adds an example for using fs_homepath
2024-09-09 23:59:06 +02:00
smallmodel
e151c6eb15
Update documentation 2024-09-09 23:38:37 +02:00
smallmodel
603444a69f
Fix an issue where the remaining time would reach 0:00 and the match would never end
See #287, this occurred when the fraglimit was defined.
2024-09-09 22:25:54 +02:00
smallmodel
999e0fd721
Implement test emitter 2024-09-09 21:48:40 +02:00
smallmodel
47131dec44
Fix wrong special effects count 2024-09-09 21:43:20 +02:00
smallmodel
6adad053d9
Explicitly disable looping when setting the sample loop count to a value other than 0
This fixes a rare occurrence where some sounds would loop forever
2024-09-09 00:15:39 +02:00
smallmodel
725561b655
Fix the usage of memory, strings, constant and parameters 2024-09-08 23:54:47 +02:00
smallmodel
b84fbf452e
Pass a vec4_t to GL_SetFogColor() rather than a vec3_t 2024-09-08 23:49:48 +02:00
smallmodel
eb7af2bce9
Implement basic test emitter functions 2024-09-08 23:33:55 +02:00
smallmodel
7c57c4b131
Fix wrong secondary ammo type being picked up 2024-09-08 20:20:58 +02:00
smallmodel
4460466cb3
Implement RE_SetRenderTime 2024-09-08 19:43:37 +02:00
smallmodel
eea19d733d
Add R_UpdateGhostTextures (unimplemented) 2024-09-08 19:43:29 +02:00
smallmodel
abc97dcab3
Implement R_AddTerrainMarkSurfaces and RE_AddTerrainMarkToScene 2024-09-08 19:40:00 +02:00
smallmodel
065c791a10
Implement CG_ResetEffectCommandCvars 2024-09-08 19:29:40 +02:00
smallmodel
6b902e7f5d
Remove "unimplemented" comment 2024-09-08 18:49:45 +02:00
smallmodel
df0cb87b35
Implement CG_AddLightShow (cg_acidtrip) 2024-09-08 18:48:15 +02:00
smallmodel
0b9687fea4
Implement functions for printing content types, surface properties and surface types 2024-09-08 18:39:39 +02:00
smallmodel
99fbe092bc
Use correct names for surface flags 2024-09-08 18:34:02 +02:00
smallmodel
7a7849ae83
Remove comment 2024-09-08 18:25:10 +02:00
smallmodel
47830bb330
Update version number 2024-09-08 18:24:59 +02:00
smallmodel
0dfb1a3a2a
Use Com_DPrintf for TIKI/alias warnings/errors
This prevent the console from getting spammed with developer errors in production
2024-09-08 18:22:12 +02:00
smallmodel
e2e1ab0275
Fix status command column length breaking some programs 2024-09-08 18:09:54 +02:00
smallmodel
4249cacf2f
Support token dollar in variable name
This fixes mods like trapshooting not working because of a '$' in a variable name
2024-09-08 18:03:43 +02:00
smallmodel
4e3ec52673
Fix a crash due to NULL string being appended 2024-09-08 18:02:57 +02:00
smallmodel
98991a4a7a
Fix file ordering with uppercase/lowercase file names 2024-09-08 17:59:30 +02:00
smallmodel
bca6d656b6
Fix bad verts value passed to CG_AddFragmentToScene 2024-09-08 17:53:35 +02:00
smallmodel
ffc3580d43
Implement CG_CheckCaptureKey 2024-09-08 16:31:19 +02:00
smallmodel
c18cdc78ea
Fix Cgame key catching 2024-09-08 15:48:46 +02:00
smallmodel
77ecc73631
Implement lens flare / sun flares
Some maps like mohdm1 have a sun flares, now when you look up the sky towards the sun direction, you will see the flare of the sun
2024-09-08 15:31:18 +02:00
smallmodel
3834f51d74
Fix GetNamedWidget() always returning the last valid widget
This is problematic when doing different logic when a widget doesn't exist, for example when loading a map, if the continue button doesn't exist then the game should continue automatically
2024-09-08 15:06:43 +02:00
smallmodel
86ddec3f76
Clear the world to prevent crashes 2024-09-08 14:59:10 +02:00
smallmodel
4d12bcb184
Export s_sun 2024-09-08 00:52:03 +02:00
smallmodel
7d93723382
Update getting started doc 2024-09-07 23:58:56 +02:00
smallmodel
8e1a52bbb7
Implement VIS debugging 2024-09-07 23:58:50 +02:00
smallmodel
cd9b1a741f
Match CG_PermanentMark parameters
This fixes #355
2024-09-07 23:57:17 +02:00
smallmodel
cefe331e0c
Remove useless surface flags 2024-09-07 23:51:52 +02:00
smallmodel
14d1fae54a
Implement all treadmark functions 2024-09-06 22:10:22 +02:00
smallmodel
a1601be7a6
Implement code to make tread mark decals 2024-09-05 23:54:01 +02:00
smallmodel
a2ebeb11e3
Update features.md 2024-09-05 23:10:50 +02:00
smallmodel
b7f0f32878
Fix DCL signature on big-endian architectures 2024-09-05 01:14:42 +02:00
smallmodel
58e39add5b
Implemented treadmarks update functions 2024-09-05 01:04:53 +02:00
smallmodel
61725c95df
Add MASK_TREADMARKS 2024-09-05 00:43:36 +02:00
smallmodel
71a1df661a
Fix current mark's alpha component not updating properly 2024-09-04 21:54:49 +02:00
smallmodel
9eed0eab5f
Implement CG_PermanentMark 2024-09-04 21:51:42 +02:00
smallmodel
e42b6fe0a9
Fix current mark not updating if it has a rotation 2024-09-04 21:51:16 +02:00
smallmodel
b1e640ad1d
Implement CG_PermanentMark 2024-09-04 21:41:16 +02:00
smallmodel
2fc091fdf7
Skip loading if the file length is less than the dcl header length 2024-09-04 20:56:41 +02:00
smallmodel
47ba241e7d
Fix file being closed but still used afterwards 2024-09-04 20:50:22 +02:00
smallmodel
c0d37c504a
Fix infinite loop in R_TerrainHeightForPoly 2024-09-04 20:46:10 +02:00
smallmodel
1e0195f6e3
Add variables that will be used in unimplemented functions 2024-09-04 20:29:29 +02:00
smallmodel
e806c1ddf1
Move MAX_MARK values to tr_types_new.h 2024-09-04 20:23:20 +02:00
smallmodel
78f0072c59
Update the SFX datasize when downsampling
This fixes #349 where the size of the AL buffer didn't match the real downsampled size, which would cause AL to read way past of end of the data buffer
2024-09-04 20:12:46 +02:00
smallmodel
1022ce531a
Fix AL buffers having sound data past end of the sound buffer 2024-09-04 20:10:56 +02:00
smallmodel
7f08a7bca8
Remove register keyword as it's deprecated since C++17 2024-09-04 20:10:21 +02:00
smallmodel
4123bef60d
Implement R_ApplyLevelDecal 2024-09-04 20:05:48 +02:00
smallmodel
c6464efa07
Implement level mark loading and updating 2024-09-04 00:02:07 +02:00
smallmodel
0a9075748e
Fix OpenAL binary name on ARM64 2024-09-02 20:38:38 +02:00
smallmodel
3733761696
Fix the reloading sound in 2.0, the behavior is different in 2.0 and 2.30 2024-09-02 19:52:32 +02:00
smallmodel
cde7cbc3a3
Implement G_ClientDrawTags 2024-09-02 19:52:32 +02:00
smallmodel
e927da56cf
Fix GetTagPositionAndOrientation() returning wrong tag axis and position 2024-09-02 19:52:31 +02:00
smallmodel
3b8bffe39c
Fix variable misspelling 2024-09-02 19:52:31 +02:00
smallmodel
19da377064
Implement G_ObfuscationForSmokeSprites
This is used so the player can throw a smoke grenade and hide behind it for AI
2024-09-02 19:52:30 +02:00
smallmodel
4d1380b5c4
Implement G_ClientDoBlends and FindIntermissionPoint 2024-09-02 19:52:30 +02:00
smallmodel
25c2904d66
Implement RE_MapVersion and RE_PrintBSPFileSizes 2024-09-02 19:52:30 +02:00
smallmodel
53565663d9
Add old welcome code (commented out) for when a player becomes spectator 2024-09-02 01:01:55 +02:00
smallmodel
76f0e17987
Fix bullet trace end being out of bounds, causing clients to have a strange bullet trace 2024-09-02 00:42:29 +02:00
smallmodel
5052449e38
Fix invisible bullet tracers 2024-09-02 00:25:07 +02:00
smallmodel
a539da3200
Clear velocity and avelocity in MoveDone
This fixes objects rotating forever like the radio tower in m1l3a
2024-09-02 00:06:12 +02:00
smallmodel
fb875501f0
Fix UI library forcing latched variables
This caused issues when setting render variables
2024-09-01 23:34:57 +02:00
smallmodel
89d805ab92
Fix the FireDelay always returning for FIRE_PRIMARY 2024-09-01 20:42:19 +02:00
smallmodel
7852929da3
Fix the music replaying when loading from save after it ended 2024-09-01 20:38:11 +02:00
smallmodel
595e6fcb8b
Fix AI firing forever in mohaa 2024-09-01 20:36:54 +02:00
smallmodel
a9792bd4c3
Add comments above all actor.cpp methods 2024-09-01 20:21:44 +02:00
smallmodel
c19bc7e7a2
Add comments about new additions from 2.0 and above 2024-09-01 20:04:10 +02:00
smallmodel
3e980ed371
Unset the script goal once the AI reached the point 2024-09-01 19:38:05 +02:00
smallmodel
a9a7c7fdb8
Adjust area portal when closing before broadcasting ai events 2024-09-01 18:49:41 +02:00
smallmodel
5baf5bccf2
Notify scripts when door has closed/opened 2024-09-01 18:43:38 +02:00
smallmodel
981d72ac5a
Add assertions to check for invalid path distance 2024-09-01 18:28:01 +02:00
smallmodel
a9b8cdce64
Only print the long word error in debug mode 2024-09-01 18:10:16 +02:00
smallmodel
f3222fc36a
Set AI angles only if they don't have an enemy, otherwise let the AI set their angles
This prevented actors from attacking correctly because the AI cover target state expects the AI to 100% stare at the enemy and the vehicle would keep changing the AI angles
2024-09-01 17:16:09 +02:00
smallmodel
e5aee8d206
Fix the MG42 fire delay being too slow by default for AIs 2024-09-01 16:51:41 +02:00
smallmodel
96d16bcbc1
Correctly check the max yaw offset in AI_CanTarget()
This caused AI to exit turrets immediately
2024-09-01 16:46:24 +02:00
smallmodel
010a5ffc74
Mark entities as missing until they are received
This fixes a bug where the plane sound in t1l1 would stop immediately because the entity isn't received at this point
2024-09-01 16:21:56 +02:00
smallmodel
bed9bbbd05
Update classes documentation 2024-08-31 22:13:21 +02:00
smallmodel
5cc168111c
Fix class not dumping properly 2024-08-31 22:10:44 +02:00
smallmodel
bdec6aab07
Fix calls to class dumping functions 2024-08-31 22:09:50 +02:00
smallmodel
56cbab8661
Fix NumEventCommands() returning an incorrect result 2024-08-31 21:42:07 +02:00
smallmodel
29c3bece4e
Prevent players to use developer commands like lod or view 2024-08-31 21:32:55 +02:00
smallmodel
dc24a4a067
Stop spawning if there is no entity 0 (could only happen in multiplayer) 2024-08-31 21:32:42 +02:00
smallmodel
c4683e2417
Don't execute entity events from the console if the client isn't running
This prevent the server from executing console commands for the first player
2024-08-31 21:18:35 +02:00
smallmodel
11f5870a8b
Add ioq3 server fixes and improvement
- Add a rate limit to protect against DoS attacks
- Better IPv6 support
2024-08-31 21:04:10 +02:00
smallmodel
9de71e3529
Correctly check if the AI either can see or can shoot to find the enemy
The AI would get stuck trying to cover otherwise
2024-08-31 18:06:02 +02:00
smallmodel
81866d96e0
Make flesh impacts properly work 2024-08-31 18:02:07 +02:00
smallmodel
70fcc70348
Fix AI turret placement
The AI was too much off from the turret
2024-08-31 17:34:10 +02:00
smallmodel
1911f04079
Fix strange AI turret target angles
The turret sometimes turned extremely fast or ignored the max yaw offset
2024-08-31 17:22:28 +02:00
smallmodel
b7288ba3f4
Don't affect the frameMsec with timescale as it causes issues with physics (like vehicles) 2024-08-31 16:50:10 +02:00
smallmodel
be655e2b9c
Fix the height of huddraw elements not being archived properly
A wrong variable was specified
2024-08-31 16:38:58 +02:00
smallmodel
915269e017
Fix the actor stuck targeting an enemy with really low threat (behind walls, not visible)
This fixes the actor being stuck aiming even if the player is near them
2024-08-31 16:24:59 +02:00
smallmodel
6071b5303c
Remove useless NET_Sleep and make sure frameMsec doesn't go below 1 2024-08-31 16:18:28 +02:00
smallmodel
e59a24ded3
Fix actors enemy not being able to be set if enemy switch is disabled 2024-08-31 16:17:37 +02:00
smallmodel
2239efa439
Fix sample_offset() returning a wrong value with looping sounds
The returned offset will now be the correct when the stream has been re-read from the beginning due to the sound looping
2024-08-30 21:12:39 +02:00
smallmodel
99fcec9f26
Initialize bStartedGame 2024-08-30 18:56:01 +02:00
smallmodel
2fe4e85543
Fix path goal end anim script never reaching
The end anim script should be executed below a certain speed (1/4 below normal speed).
This fixes a bug in e3l4 where the game would never continue past the first bunker. The actor would get stuck after collecting supplies for the first bunker at the beginning because it stopped too far away from the target origin
2024-08-30 00:44:14 +02:00
smallmodel
68f2635c06
Should be DotProduct2D 2024-08-29 23:31:46 +02:00
smallmodel
0147677412
Calculate sr/cr only if right or up is specified 2024-08-29 21:37:10 +02:00
smallmodel
89133bf05d
Fix looping sounds not stopped when stopping all sounds
This fixes an issue where some random looping sound (like footsteps) would be heard after restarting or when loading a saved game
2024-08-29 19:29:16 +02:00
smallmodel
7a0a671f18
Use the correct value when comparing the sound awareness multiplied by the range factor 2024-08-28 00:41:53 +02:00
smallmodel
c7d1f42edb
Use centroid when broadcasting new AI event 2024-08-28 00:40:57 +02:00
smallmodel
2b9d31fe7f
Normalize angles to fix interpolation issues on client
See #342
2024-08-27 15:24:31 +02:00
smallmodel
1f71bb714d
Fix sounds unexpectedly getting marked as streamed when they are not
This fixes #345 where a crash occurred because of a NULL buffer, as streamed sounds don't have a memory buffer
2024-08-27 12:47:58 +02:00
smallmodel
6b21f7e92e
Fix the turret firedelay behavior on mohaa base 2024-08-27 01:34:51 +02:00
smallmodel
8b5074b6ac
Fix Dot/Texcoords calc
This caused some shaders such as headlights beam on the opeltruck being weirdly rendered
2024-08-27 01:07:51 +02:00
smallmodel
7f7d797fce
Fix vehicles getting blocked by sentients dying 2024-08-27 00:36:03 +02:00
smallmodel
0b3aad5ad2
Fix entnum comparison (must be greater than or equal to the squadmate's entnum) 2024-08-27 00:09:13 +02:00
smallmodel
ad88215b85
Cleaned up actor_runandshoot.cpp 2024-08-26 23:45:41 +02:00
smallmodel
ccb1465e17
Use a raw pointer instead of the str object
Original game checks for the NUL character using the line buffer (`c_str()`) directly instead of the str object's operator[], as this would cause an assertion failure because the str's length ignore the NUL character
2024-08-26 23:09:55 +02:00
smallmodel
fde4d8d54f
Update README and bug report 2024-08-26 22:11:14 +02:00
smallmodel
37db2e8acc
Update issue templates 2024-08-26 22:04:30 +02:00
smallmodel
9413eb0d58
Update issue templates 2024-08-26 21:58:10 +02:00
smallmodel
06d2eaf409
Fix doors opening and closing indefinitely by actors 2024-08-26 19:04:49 +02:00
smallmodel
444ce284ae
Spawn a trigger field even if the TOGGLE flag is set
This fixes Actors not being able to open doors
2024-08-26 18:55:10 +02:00
smallmodel
a150c1b18b
Fix animation delta repeating when getting delta of the same frame
This fixes actors moving too much and strangely
2024-08-26 18:18:20 +02:00
smallmodel
194e898d90
Ignore bad SFX for 3D loop sounds 2024-08-26 13:22:40 +02:00
smallmodel
0b1a20dcff
Properly save and restore sound position, also fix loopsounds not playing properly 2024-08-26 01:29:42 +02:00
smallmodel
93e7561cb3
Fix Actor::EventSoundDone() using the wrong parameter for the sfxName, causing the SoundDone event to be sent immediately 2024-08-26 01:05:58 +02:00
smallmodel
6ab654264b
Cleaned up Entity::ProcessSoundEvent() 2024-08-26 01:05:13 +02:00
smallmodel
7023184892
Fix subdivisions endianness
See #332
2024-08-26 00:45:21 +02:00
smallmodel
07f13d1ae9
Force the soundtrack to be sent again 2024-08-26 00:08:29 +02:00
smallmodel
ac22b1cfbf
Use an higher fragment size when sending a message to the loopback 2024-08-25 23:41:03 +02:00
smallmodel
e70cdfb898
Improve code readability 2024-08-25 22:01:03 +02:00
smallmodel
022181fcfd
Remove processed buffers after half of the queued buffers has been processed 2024-08-25 16:49:24 +02:00
smallmodel
e021289d36
Fix the turret setting incorrect angles 2024-08-24 19:23:11 +02:00
smallmodel
91b80a8e21
Fix the sound system not restarting when modifying the speaker type to 0 2024-08-24 19:19:55 +02:00
smallmodel
322ca2b42e
Fix the loop protection not working when multiple scripts are executed
This fix will apply the protection globally
2024-08-24 18:50:04 +02:00
smallmodel
d399ffd609
Set the correct sound velocity 2024-08-24 18:18:20 +02:00
smallmodel
bf2626f804
Set the pitch before playing the sound 2024-08-24 17:53:13 +02:00
smallmodel
00f27ac02d
Fix improper sound distance values 2024-08-24 17:35:35 +02:00
smallmodel
5134aed352
Mark the functions as inline to optimize function calls 2024-08-24 17:35:02 +02:00
smallmodel
b457a84ed9
Fix AL_DISTANCE_MODEL value type, it must be an integer 2024-08-24 16:39:43 +02:00
smallmodel
8188d46ee7
Fix SetLittleLong() writing past end of bytes buffer
(even though the union was still 4-bytes because of the integer)
2024-08-24 15:10:12 +02:00
smallmodel
d64e88451f
Fix compiler warnings
Note that in Dismiss(), checking for `this` is not necessary (original code was generated by the compiler)
2024-08-24 15:08:42 +02:00
smallmodel
c70c578194
Ignore ALC_OUTPUT_MODE_SOFT if unavailable 2024-08-24 14:51:58 +02:00
smallmodel
54ceff5107
Process the value of s_speaker_type 2024-08-24 14:25:25 +02:00
smallmodel
3b94904ea8
Update getting started 2024-08-24 12:01:37 +02:00
smallmodel
1c8b4a1922
Update the documentation to reflect the current state of the project 2024-08-24 01:03:36 +02:00
smallmodel
32b0b2dfac
Fix camera angles changing too much when switching between linked turrets 2024-08-24 00:40:23 +02:00
smallmodel
6506577787
Add shader flags with tcMod rotate
This fixes vehicle wheels rotating forever. Wheels now rotate consistently depending on the vehicle speed
2024-08-24 00:35:39 +02:00
smallmodel
56775399d3
Fix 3D sounds not being attached to an entity when specified 2024-08-23 23:38:52 +02:00
smallmodel
d6d40975e5
Add more file debug print 2024-08-23 23:32:46 +02:00
smallmodel
e3936f52a2
Move Com_SwapSaveStruct to a better place 2024-08-23 22:39:14 +02:00
smallmodel
53d5dd1e40
Differentiate saves from mohaa, mohta and mohtt
Fixes #339 where Spearhead and Breakthrough would also display saves from mohaa
2024-08-23 22:25:43 +02:00
smallmodel
b2ef0fd6e3
Swap the save game struct on big endian architectures 2024-08-23 21:09:12 +02:00
smallmodel
8832fbe55d
Fix entities loopsound incorrectly having the streamed value at the end of the name, causing some sounds unable to load 2024-08-23 21:03:02 +02:00
smallmodel
b5ffe756d6
Fix buffers unnecessarily being unqueued after source has stopped 2024-08-23 20:38:41 +02:00
smallmodel
01a0173a2f
Take all branches into account for GitHub actions 2024-08-23 19:52:30 +02:00
smallmodel
7bebb2adab
Statically link the CRT runtime in soft-oal 2024-08-23 19:51:47 +02:00
smallmodel
8c41576daa
Remove assertion as sounds can be streamed at any time 2024-08-23 12:13:17 +02:00
smallmodel
a529b37f25
Show some AL errors on developer mode only 2024-08-23 12:07:28 +02:00
smallmodel
f84ed6b794
Fix crash when loading from save, caused by incorrect client-game state size
Closes #343
2024-08-23 11:48:50 +02:00
smallmodel
9526a92fc1
Use same parameters as oal to build OpenAL 2024-08-22 17:13:43 +02:00
smallmodel
5e60b89a0d
Fix linux compile error 2024-08-22 16:13:03 +02:00
smallmodel
e46625a52c
Added more verbosity 2024-08-22 15:39:28 +02:00
smallmodel
037cb0f5cb
Fix OpenAL64.dll name on Win32 and Win64 2024-08-22 15:18:20 +02:00
smallmodel
f67a7c6621
List available devices and use Generic Software if Generic Hardware is the default 2024-08-22 13:30:04 +02:00
smallmodel
4839a2026b
Fix string casting 2024-08-22 12:43:18 +02:00
smallmodel
219dbbb5b7
Open the default device by passing in the default device name instead of NULL 2024-08-22 12:39:14 +02:00
smallmodel
d78de51bc2
Bump version number 2024-08-21 19:02:23 +02:00
smallmodel
faa50352e0
Remove explicit USE_SOUND_NEW as OpenAL is the default 2024-08-21 18:53:57 +02:00
smallmodel
f2b49f7ccb
Fix wrong parameters 2024-08-21 18:48:16 +02:00
smallmodel
13911b051a
Use OpenAL by default 2024-08-21 18:35:06 +02:00
smallmodel
694167d352
Merge pull request #341 from runlevel5/fix-compilation-errors
Fix compilation error [WIP]
2024-08-20 17:02:20 +02:00
Trung Lê
3b2e4ff9c1
Revert to original code 2024-08-21 00:18:38 +10:00
Trung Lê
16e0dc17a8
Add implicit conversion from const-qualified pointer types to non-const-qualified var 2024-08-21 00:13:04 +10:00
Trung Lê
1f4b7718e8
Refactoring gameExport_s::ReadLevel() and gameExport_s::WriteLevel() 2024-08-20 23:41:43 +10:00
smallmodel
8c59d6020e
Backported ioquake3 fixes for https://www.cvedetails.com/cve/CVE-2017-11721/ (Buffer overflow) 2024-08-18 13:35:59 +02:00
smallmodel
377b0896c2
Fix drivable vehicle not having the death waittill after loading from save
This caused some vehicles to be destroyed immediately after being handled from script (like the halftrack in t2l1)
2024-08-18 12:03:01 +02:00
smallmodel
a399fdf6cf
Removed useless comments 2024-08-17 21:07:25 +02:00
smallmodel
783c24d6f7
Fix sound never playing from entities that are not sent to clients 2024-08-17 17:24:17 +02:00
smallmodel
1254146223
Fix streamed sound stopping before end 2024-08-17 11:09:35 +02:00
smallmodel
f776d842d1
Don't load sound immediately if they must be streamed
This removes more hiccups
2024-08-14 19:08:20 +02:00
smallmodel
74acf35a89
Merge branch 'main' into features/oal-streaming 2024-08-13 21:07:27 +02:00
smallmodel
81b8fe3f61
Use a pointer to an array instead of accessing the tiki mesh field directly to avoid loop badly optimized due to the compiler thinking there can be only 1 element
This fixes #337
2024-08-13 20:55:12 +02:00
smallmodel
679bfb90ea
Fix accessing 8th leaves element before finishing the loop
This caused the 8th element to be taken into account when enabling optimizations with GCC (invalid pointer to the leaf)
2024-08-13 20:41:53 +02:00
smallmodel
deb18c53b7
Implement streaming support for OpenAL
See #333, and #324
2024-08-12 20:26:17 +02:00
smallmodel
bbb7aa3771
Updated CodeQL actions to use newer version of steps 2024-08-12 18:23:03 +02:00
smallmodel
eb04e26823
Use the new libmad version as it seems stable enough 2024-08-09 20:33:59 +02:00
smallmodel
3af24ee0ea
Exclude new sound CPP files directly when not using the new sound system instead of using #ifdef 2024-08-09 20:30:35 +02:00
smallmodel
513fe7773f
Don't append a '\' at the beginning during autocompletion 2024-08-08 20:44:00 +02:00
smallmodel
9150d1cc44
Fix lighting grid being incorrect
It fixes #321 where impacts like bullets would have an incorrect color (like red, green...)
2024-08-08 20:31:19 +02:00
smallmodel
e19b72647e
Use qglGenTextures to guarantee the uniqueness of the texture number 2024-08-08 19:07:09 +02:00
smallmodel
d809975882
Use Q_snprintf because itoa is non-standard 2024-08-07 22:27:02 +02:00
smallmodel
7b92d99afa
Fix compile error 2024-08-07 22:24:52 +02:00
smallmodel
b463c905cf
Free up unused images
This fixes #93 where the game would hit `MAX_DRAWIMAGES` after loading a few maps
2024-08-07 21:11:16 +02:00
smallmodel
7f8a0c9931
Fix the image texture number not properly matching the image
It caused issues with textures being messed up sometimes, after multiple maps were loaded
2024-08-07 21:10:04 +02:00
smallmodel
53d812666c
Remove FIXME section 2024-08-07 21:02:48 +02:00
smallmodel
7b59f07181
Allow precaching image manually with r_precacheimages 2024-08-07 20:01:38 +02:00
smallmodel
d22dea5e8e
Count renderer memory 2024-08-07 19:57:09 +02:00
smallmodel
8817467216
Implement trace obfuscation 2024-08-06 22:58:16 +02:00
smallmodel
236afa7c3f
Implement obfuscation mapping setup
The implementation reads all obfuscation csv and return a list of visual obfuscations
2024-08-06 20:21:00 +02:00
smallmodel
cd6ec5e3a7
Fix streamed sound, use 2D instead with properly implemented panning 2024-08-06 18:43:15 +02:00
smallmodel
434aaf3eaf
Initialize last animation time 2024-08-05 23:41:17 +02:00
smallmodel
5b80ea20c7
Fix filename case sensitivity on Linux
This fixes #334 where some sounds wouldn't play because some scripts reference sounds without respecting the case
2024-08-05 21:11:49 +02:00
smallmodel
1d60405eaa
Fix heap corruption when taking screenshots with non-standard resolutions like 1366x768 2024-08-05 19:48:23 +02:00
smallmodel
64f4f59165
Fix vid_restart and snd_restart resetting the sound system (experimental sound system only)
This fixes #335 where one of those commands would clear all active sounds as well as the triggered music, and the soundtrack
2024-08-05 19:21:38 +02:00
smallmodel
192f9ac514
Added S_CurrentSoundtrack() 2024-08-05 19:14:30 +02:00
smallmodel
279b1413ec
Clear the active music when stopping the triggered music 2024-08-05 19:09:29 +02:00
smallmodel
9c5297882c
Renamed CHANNEL_FLAG_PLAYABLE to CHANNEL_FLAG_PLAY_DEFERRED 2024-08-05 18:49:41 +02:00
smallmodel
a6d508d791
Fix sounds replaying when unpausing
This caused some sounds to play again when saving
2024-08-05 18:49:16 +02:00
smallmodel
6b3402c631
Fix actor accuracy being crazy, killing the player easily 2024-08-05 18:43:56 +02:00
smallmodel
d5da32b8a9
Fix AI damage 2024-08-05 18:43:40 +02:00
smallmodel
39b3ed3d44
Fix part blend mult being incorrectly archived
This may have been the cause of animations not properly playing and the player being unable to climb on ladders
2024-08-03 18:40:27 +02:00
smallmodel
f8b97405ff
Fix infinite loop in DownSampleWav when s_khz is less than 44 kHz
This fixes #330 where `s_khz` below 44 (the usual sample rate of mohaa wav files) would cause an infinite loop due to improper usage of the `ii` variable in the loop where another variable would be accidentally incremented instead
2024-07-30 20:59:48 +02:00
smallmodel
1d4fe357c8
Fix ShaderForShaderNum incorrectly swapping the shader num 2024-07-29 21:39:24 +02:00
smallmodel
c7900b6048
Fix static model index endianness 2024-07-29 21:13:18 +02:00
smallmodel
6e3f959684
Fix header version incorrectly parsed 2024-07-29 20:32:21 +02:00
smallmodel
eb9a3b1bbf
R_UnpackTerraPatch: no need to get little-endian values as values are already swapped by R_SwapTerraPatch
See #332
2024-07-29 19:04:29 +02:00
smallmodel
391450f090
Swap bsp header on big-endian architectures
See #332 where the lump's offset and length are incorrect on big-endian architectures
2024-07-29 19:03:26 +02:00
smallmodel
f804476fbc
Add soft-oal to the build 2024-07-28 19:55:20 +02:00
smallmodel
60e4fa7005
Handle shader picmip and fix shaders not rendered properly with force32bit (alpha channel was ignored) 2024-07-28 19:25:24 +02:00
smallmodel
c13f9dc9a8
Increase MAX_IMAGE_ANIMATIONS
This fixes emitters not playing correctly
2024-07-28 19:12:08 +02:00
smallmodel
f213943b2d
Fix RB_SetGL2D 2024-07-28 19:02:06 +02:00
smallmodel
5159a534bb
Fix animated images playing at the same time for all entities 2024-07-28 19:01:34 +02:00
smallmodel
c7a4e705cb
Fix libmad still producing shared libraries 2024-07-28 18:51:15 +02:00
smallmodel
864ea08393
Fix special characters not being handled properly
This fixes characters (signed character below 0) being replaced by '?' in UI text elements, like in the console
2024-07-27 23:41:12 +02:00
smallmodel
ebfb6d1846
Fix inwardsphere not being used
This fixes emitters looking incorrect, like `animate/adamspark.tik`, for the explosion of electric panels
2024-07-27 23:20:30 +02:00
smallmodel
6b89ec615a
Set damage angles only for mohaa 1.0-1.11 2024-07-27 19:45:18 +02:00
smallmodel
af432e6d3f
Allow pain if the current time is above the allowed next pain time 2024-07-27 19:37:05 +02:00
smallmodel
44c17409a7
Allow pain if the player dies 2024-07-27 19:33:39 +02:00
smallmodel
0f48c39bc1
Add more resilience against null entity in G_FixEntityPosition 2024-07-27 19:05:45 +02:00
smallmodel
572e6652cc
Fix followpath not working under special circumstances
This fixes an issue where some planes (like the final bomber plane in t3l2) would not fly and look stuck
2024-07-27 19:05:05 +02:00
smallmodel
fecb601fc4
Clear velocity only if it's not ignored 2024-07-27 18:17:10 +02:00
smallmodel
7b238e9d34
Set new orders appropriately 2024-07-27 18:13:31 +02:00
smallmodel
73c8ff11b3
Call CurrentScriptThread() to get the current script, so it can throw an exception if the current thread is NULL 2024-07-27 18:03:41 +02:00
smallmodel
682dc89067
Add ignorevelocity argument for followpath 2024-07-27 17:54:48 +02:00
smallmodel
ee514710c5
Add Emscripten implementation from ioquake3 upstream 2024-07-26 23:57:50 +02:00
James Darpinian
2d15696a5e
Add .vscode and baseq3 to gitignore 2024-07-26 23:03:40 +02:00
Alan Zhao
769d06b0f0
Use nanosleep(2) instead of usleep(3)
usleep(3) was declared obsolete in POSIX.1-2001 and removed in
POSIX.1-2008 and nanosleep(2) was recommended to be used instead.
2024-07-26 23:03:09 +02:00
smallmodel
dcb0369e10
Fix actions deprecation warnings 2024-07-26 22:08:46 +02:00
smallmodel
1b35d3ce05
Fix angular delta being wrong
This fixes animated characters being sometimes badly positioned, like actors in the plane in t1l1
2024-07-25 21:46:33 +02:00
smallmodel
31d254cb9f
Use ceil() and set the delta appropriately if time1 is after team2 2024-07-25 21:43:19 +02:00
smallmodel
bf4780bbdb
From now, load streamed sound into memory as deferred loading is currently unsupported 2024-07-25 19:49:34 +02:00
smallmodel
5af8e127f8
Added NULL sound flag 2024-07-25 19:04:08 +02:00
smallmodel
016e062fef
Fix UIReggedMaterial::ReregisterMaterial and UIReggedMaterial::GetMaterial
ReregisterMaterial() must register the material if it was registered before, and GetMaterial() must register the material if it hasn't been registered and return it
2024-07-24 21:10:46 +02:00
smallmodel
c093122764
Made code C++ compatible so UI_LoadResource() can be used 2024-07-24 20:07:22 +02:00
smallmodel
11ec6270da
Made OpenAL package required 2024-07-24 19:57:22 +02:00
smallmodel
81df55310b
Fix medals always being awarded
This fixes #316
2024-07-23 19:53:40 +02:00
smallmodel
e5fb85ad08
Fix material not refreshing when it already has a shader.
This fixes #329 where the material (matching quick.tga) would be loaded only once without being able to change
2024-07-23 19:06:48 +02:00
smallmodel
c5ef60040a
Fix sounds not being resumed properly after loading from save 2024-07-22 20:44:00 +02:00
smallmodel
757b4849f8
Add a fix to load the music from save
This commit implements code to get/set sample offset in an OpenAL channel and saves the music filename/offset into the file. This only works by using the experimental sound system, so it partially fixes #327
2024-07-22 20:13:03 +02:00
smallmodel
2198bdec21
Added stub variables and functions for loading 2024-07-22 19:15:52 +02:00
smallmodel
8bd377ce85
Fix the save system taking a screenshot of the whole UI menu instead of just the 3D view
This fixes #328 where the save would have a screenshot of the save menu
2024-07-22 19:00:50 +02:00
smallmodel
89eae68318
Fixed parameter mistake
(Why didn't you tell anything about that, MSVC?)
2024-07-20 22:09:03 +02:00
smallmodel
d1e94f3934
Fix saveshot not executed when saving
This fixes #273 where the loadsave menu wouldn't show the screenshot
2024-07-20 16:07:02 +02:00
smallmodel
fc0a995c66
Added code to save image with custom resolution to a file 2024-07-20 16:04:04 +02:00
smallmodel
eee0eaac4a
Process the "!" (not) syntax for enabledcvar
This fixes #265 where the mine detector icon wouldn't appear because it wants SP mode
2024-07-17 23:55:11 +02:00
smallmodel
535da856a4
When returning a cvar value, use the latched string if present 2024-07-17 23:43:00 +02:00
smallmodel
422bf647a7
Save the client-game state into the archive file (feature from moh spearhead 2.0)
This saves cgame data such as emitters and vss sources
2024-07-15 23:45:32 +02:00
smallmodel
93cd470659
Fix broken cgame state saving 2024-07-15 23:44:11 +02:00
smallmodel
81b86d61da
Fix read-only cvar being improperly archived
This caused cvars like `paused` being wrongly restored. If the `paused` value is 1 or above, like when saving from the menu, the game would get stuck loading the level because it's paused, no frame could be executed.
It also fixes cvars like `sv_fps`, `g_playermodel` not being archived when they should.
Fixes #326
2024-07-15 20:39:22 +02:00
smallmodel
eac8580f64
Add libmad 0.16.4
This new version introduces patches against crashes and exploits. CMake is also fully supported and platforms are properly detected so architecture specific optimizations are used.

To use it, USE_SOUND_NEW must be non-zero when configuring the project
2024-07-11 23:04:04 +02:00
smallmodel
d56498e622
Adds CHANNEL_NONE case statement even if there is nothing to do 2024-07-11 22:04:03 +02:00
smallmodel
551fccb761
Fixes wrong handle being compared for uniqueness
This should fix invisible models (fixes #322)
2024-07-02 22:47:41 +02:00
smallmodel
5317b8424f
Prevents the player from walking
This fixes #275
2024-07-02 22:16:13 +02:00
smallmodel
5816391e9b
Fixes loopsound not properly working (not playing, or not being 3D) 2024-07-02 20:25:08 +02:00
smallmodel
543c00037a
Implements sample playback rate 2024-07-02 20:10:54 +02:00
smallmodel
d5f435ee90
Makes loops work as they should 2024-07-02 20:01:01 +02:00
smallmodel
02e2e92d36
Uses linear sound distance model 2024-07-02 19:30:29 +02:00
smallmodel
040f8db0ef
Fixes wrong sound volume and pitch 2024-07-02 19:10:48 +02:00
smallmodel
14927df9fa
Moves MAX_SUBTITLES to `q_shared.h| 2024-07-02 19:03:27 +02:00
smallmodel
dca9709b12
Fixes MASK_PLAYERSOLID incorrectly using CONTENTS_WEAPONCLIP instead of CONTENTS_PLAYERCLIP for invisible player collision
This fixes #317, fixes #319 and fixes #320 where the player would bypass clip/playerclip
2024-07-02 18:51:53 +02:00
smallmodel
d6571820fe
Fixes g_pVert/g_pTris being freed even when they are NULL 2024-07-02 18:46:27 +02:00
smallmodel
a0d3333ebb
Fixes chan->bufferdata not being set to NULL when released 2024-07-02 18:45:51 +02:00
smallmodel
9615fafc1e
Fixes incorrect usage of DotProduct result in an integer 2024-07-01 19:03:21 +02:00
smallmodel
5fc2425f3a
Set the mindist/maxdist for 3D sounds 2024-07-01 18:52:04 +02:00
smallmodel
63445c4fc1
Added a note to use the experimental openal-based sound system 2024-07-01 18:20:22 +02:00
smallmodel
eefe8ee2d1
Allow 3D / pan with streamed or MP3 sounds 2024-07-01 18:17:04 +02:00
smallmodel
edb1cb0ebe
Renamed SFX_FLAG_NO_DATA to SFX_FLAG_STREAMED 2024-07-01 18:05:24 +02:00
smallmodel
140242a761
Fixes MP3 files like dialog improperly working 2024-07-01 18:00:20 +02:00
smallmodel
ae13be0c37
Fixes OpenAL errors 2024-07-01 17:39:47 +02:00
smallmodel
74ff3b920e
Fixes OpenAL 2D origin 2024-07-01 17:39:32 +02:00
smallmodel
2cd6b981f1
Puts the volume gain constant in a variable 2024-07-01 16:46:54 +02:00
smallmodel
f866dcbcfc
Adds triggered music support
This allows the main menu music to play, as well as single-player musics
2024-07-01 16:10:42 +02:00
smallmodel
0d394a7e67
Fixes strings printing on the same line 2024-07-01 14:15:58 +02:00
smallmodel
7059f32ecc
Don't timeout if the client hosts the game 2024-07-01 01:09:39 +02:00
smallmodel
87baa69d7c
Fixes incorrect lighting color normalization
This fixes #314 where mark colors would have their values warped back to 0, making holes blue
2024-07-01 00:20:33 +02:00
smallmodel
408c901342
Fixes skyboxSpeed using an integer rather than a float
This fixes #313 where the skybox would be misplaced
2024-07-01 00:19:50 +02:00
smallmodel
d709dda87a
Use shader's distance range instead of the portal range 2024-06-30 23:57:32 +02:00
smallmodel
cda6225659
Adds a workaround against a bit that was lost on x86 with FP87.
This fixes #312 where a rounding error caused facets to be removed due to windings points being outside of the epsilon
2024-06-23 17:26:07 +02:00
smallmodel
563182c14c
Added FloatRoundedBitError() (currently unused) 2024-06-23 17:25:23 +02:00
smallmodel
303ed30a38
Don't remove the facet is there is no border planeCM_PlaneEqual 2024-06-23 17:19:52 +02:00
smallmodel
0a6c745ffb
Use VectorNormalize() instead of VectorNormalize2() 2024-06-23 17:10:58 +02:00
smallmodel
9d654faa3d
As m_BlockedPaths is an array of pathway_ref, the proper delete call must be used 2024-06-23 00:24:20 +02:00
smallmodel
9407b64fe3
Q_strncpyz: don't copy if the src is the same as the dest 2024-06-23 00:18:22 +02:00
smallmodel
1f0f5764a8
Added PathInfo() constructor initialization 2024-06-22 21:41:28 +02:00
smallmodel
13197acb3a
Uses a signed char instead of a char for opcode stack offset. On some platforms like ARM, char is unsigned by default
This fixes #311 where a memory corruption that occurred in ARM was caused because of insufficient ScriptVM stack size. The stack size was incorrectly calculated because the stack offset was using unsigned values instead of signed in ARM.
2024-06-22 19:18:08 +02:00
smallmodel
2f48ca6adb
Adds assertion check to check if top stack is out of bounds 2024-06-22 19:03:27 +02:00
smallmodel
01d938b5ba
Fixes some variables being uninitialized 2024-06-22 19:03:04 +02:00
smallmodel
186d7a12e5
typo 2024-06-22 16:51:20 +02:00
smallmodel
5192d36f81
Fixes gametype incorrectly checked in G_InitWorldSession 2024-06-22 16:43:03 +02:00
smallmodel
dfb6c37c9e
Don't copy the server name if it's from the same string address 2024-06-22 16:42:39 +02:00
smallmodel
cb208b9ad2
Initialize the message buffer to avoid leaking private data 2024-06-22 16:39:26 +02:00
smallmodel
e4d20c3fa1
Initialize explosion flash 2024-06-22 16:39:08 +02:00
smallmodel
0b747bf1c5
Use memmove rather than strcpy for removing key values 2024-06-22 16:39:00 +02:00
smallmodel
e207715b5e
Initialize m_iLastTiresUpdate 2024-06-22 16:12:29 +02:00
smallmodel
bef1b456e1
Initialize all Ammo members 2024-06-22 16:11:03 +02:00
smallmodel
11349f9ad5
Fixes the source pos access for ENUM_if_statement (out of bounds index) 2024-06-22 16:08:33 +02:00
smallmodel
2a485a6b69
Fixes the endianness when loading LOD from file 2024-06-22 15:34:38 +02:00
smallmodel
f41e92de6e
Fixes possible memory corruption when generating a LOD curve 2024-06-22 15:34:00 +02:00
smallmodel
835c0b0d9a
Adds constants for LOD curve values 2024-06-22 15:30:59 +02:00
smallmodel
d9dc34f06d
Checks for AGEN_TIKI_DIST_FADE and AGEN_ONE_MINUS_TIKI_DIST_FADE for static models 2024-06-21 22:02:59 +02:00
smallmodel
907ff36018
Fixes r_showstaticbboxes freezing the game 2024-06-21 21:49:13 +02:00
smallmodel
64626a767c
Fixes entities not being rendered after number 1023
This fixes #310 where some static models would not be rendered, making it look like there are invisible walls.
2024-06-21 21:48:55 +02:00
smallmodel
a7df73073d
Adds a condition to check if static model poly can be rendered 2024-06-21 20:54:14 +02:00
smallmodel
40492daecd
Avoid creating a new sound index when there is no active client 2024-06-16 23:20:30 +02:00
smallmodel
a5691d7779
Allows clients to join a single-player game 2024-06-16 20:48:34 +02:00
smallmodel
d1ecd4a3c8
Don't initialize client persistant data during autosave 2024-06-16 18:19:11 +02:00
smallmodel
5482b31c66
Reads the sv_privatePassword value 2024-06-16 18:18:14 +02:00
smallmodel
15f2f6c798
Renamed g_session functions 2024-06-16 18:16:14 +02:00
smallmodel
46b3f4eb5e
Adds differentMap parameter for G_ClientConnect, it clears the selected DM weapon.
On each map change, the player gets asked for the primary weapon like in 2.0 and above
2024-06-16 18:14:26 +02:00
smallmodel
f5aadbb788
If the loopSound has no origin, make it local
This should fix #309
2024-06-15 16:38:02 +02:00
smallmodel
bbb54ea36d
Uses LoopSounds() parameters instead of just the alias 2024-06-15 16:33:02 +02:00
smallmodel
d7a5eb5d2f
Use LEVEL_WIDE_MIN_DIST instead of 10000 constant 2024-06-15 16:26:35 +02:00
smallmodel
cc716c3fa4
Don't process loopsound yet when spawning 2024-06-15 16:22:34 +02:00
smallmodel
141574a0d7
Ignore mouse events when paused 2024-06-15 16:22:21 +02:00
smallmodel
2df8ed10d0
Improves timeout checking, properly show the timeout menu and shutdown the server 2024-06-15 14:56:30 +02:00
smallmodel
40e3977664
Continue using entities even when attached to a turret, in 1.11 and below for backwards compatibility!
Fixes #140 where the MG42 objective in m1l1 would not trigger
2024-06-15 00:16:29 +02:00
smallmodel
7ddee0100e
Implements CG_BodyFallSound() 2024-06-14 22:24:55 +02:00
smallmodel
6b869c4c0d
Use an enumeration instead of raw values 2024-06-14 21:39:54 +02:00
smallmodel
91497d8fa7
Implements Player::EventTestAnim() 2024-06-14 21:20:15 +02:00
smallmodel
85bf56ae03
Call SetWeight() rather than setting it manually 2024-06-14 21:19:04 +02:00
smallmodel
84d702838d
Implemented Player::MeasureLandmineDistances()
This makes minedetector actually detect mines, especially on `e1l2`
2024-06-13 23:58:31 +02:00
smallmodel
fd3a36f162
Fixed melee sometimes not making the hit sound 2024-06-13 23:30:19 +02:00
smallmodel
10e3192f85
Fixed MASK_PLAYERSOLID being wrong 2024-06-13 23:24:11 +02:00
smallmodel
de874874e4
Use an enum for setup case rather than raw values 2024-06-13 23:11:28 +02:00
smallmodel
72e315bce1
Using an enum channelType_e rather than raw values for bone channel types 2024-06-13 23:04:33 +02:00
smallmodel
02ef85e390
Removed GetChannelTypeFromName(), was useless 2024-06-13 21:28:49 +02:00
smallmodel
aeba0e0f6f
Set the real limit of MAX_SKELETOR_CHANNELS 2024-06-13 21:26:59 +02:00
smallmodel
f8fa944054
Some refactoring, + implemented SetLocalFromGlobal() 2024-06-13 21:26:51 +02:00
smallmodel
1d50fa088a
Don't dealloc if there is no frame in the channel 2024-06-13 21:26:29 +02:00
smallmodel
546ded324e
Made ChannelNames() method public 2024-06-13 21:25:45 +02:00
smallmodel
332a635031
Use MAX_GLOBAL_FROM_LOCAL 2024-06-13 21:25:02 +02:00
smallmodel
de02c868a2
Fixed bullet tracers being incorrect
This should fix almost immobile bullet tracers on t1l1
2024-06-11 23:46:50 +02:00
smallmodel
a74b966b7c
Update fog when changing whether or not the terrain must be rendered 2024-06-11 23:44:02 +02:00
smallmodel
ca4b1ebdee
Don't render terrain when refdef.render_terrain is set to false 2024-06-11 23:37:45 +02:00
smallmodel
42c20ac008
Portal sky mustn't cause entity surface to be r-eadded
This fixes an issue where an entity would get re-added with a really lower LOD. Fixes #307
2024-06-11 23:35:18 +02:00
smallmodel
a26e5b74c2
Use armhf and armel suffix to distinguish between ARM variants 2024-06-11 22:09:31 +02:00
smallmodel
ee5faedaf9
Removed the value of LittleSwap/BigSwap on little-endian/big-endian 2024-06-11 21:25:38 +02:00
smallmodel
874b034698
Corrected some compilation warnings 2024-06-11 21:24:01 +02:00
smallmodel
dfb2cb6bbf
Fixed buffer overrun 2024-06-11 21:19:15 +02:00
smallmodel
fb15f0f2b3
Fixed a tiny mistake that prevented morphs from working correctly
Actors now have a working dynamic facial expression (moving eyes/mouth/brown...)
2024-06-11 00:12:59 +02:00
smallmodel
4d231fbc50
Call LocalChannel instead of GetLocalFromGlobal 2024-06-11 00:05:28 +02:00
smallmodel
dd85118a9c
Don't pack channels when reading encoded frames from mohsh and above (they're already packed in the animation file) 2024-06-11 00:01:55 +02:00
smallmodel
531340627d
Call LocalChannel() instead 2024-06-10 23:53:42 +02:00
smallmodel
6b6e5291dd
Fixed EYES_up length 2024-06-10 23:40:50 +02:00
smallmodel
79b0e6998d
Fixed implementations 2024-06-10 23:40:34 +02:00
smallmodel
445814b144
Fixed skeletor_c::ChannelNames return value 2024-06-10 22:15:10 +02:00
smallmodel
ebb3173322
Added skeletorMorphCache_t as an alias to int 2024-06-10 22:06:47 +02:00
smallmodel
c16f2029b1
Implemented skeletor_c::ChannelNames() 2024-06-10 22:06:35 +02:00
smallmodel
abefdd772c
DecodeFrameValue should only return a float value 2024-06-10 22:06:25 +02:00
smallmodel
e550d244df
Reimplemented skelChannelList_s::LocalChannel 2024-06-10 22:05:39 +02:00
smallmodel
84cc66ad48
Merge pull request #306 from pryon/UINotepad
Implement UINotepad
2024-06-10 18:31:34 +02:00
pryon
fa5a97031d Fix assignment of a temporary to a non-const reference error on GCC 2024-06-10 14:43:40 +02:00
pryon
6e454cdfb3 Fix subtle bugs and refactor in UIWindowManager 2024-06-10 14:26:38 +02:00
pryon
52f43a3aa6 Document OPM fix for center-justified UINotepad statusbar 2024-06-10 14:25:30 +02:00
pryon
907aa21ba8 Fix UIPopupMenu crashes caused by dereferencing already freed instance 2024-06-10 14:24:39 +02:00
pryon
ac01ad6751 Take over va() memory safety fix from ioquake3 2024-06-10 14:19:29 +02:00
pryon
c84702b490 Fix file picker crash on AA 2024-06-10 14:18:49 +02:00
pryon
edd2a9d8f6 UIMultiLineEdit::Draw documentation 2024-06-10 14:17:35 +02:00
pryon
a19c7afce0 Add placeholders for handling clipboard operations in UIMultiLineEdit
Actual clipboard functionality will be added later
2024-06-10 14:15:06 +02:00
pryon
849f1ee7d1 Fix several bugs in UIMultiLineEdit
These are necessary so that UINotepad can actually be used for editing text
2024-06-10 14:13:21 +02:00
pryon
c60c2c09e1 Fix incorrect TAB character width calculation and refactor logic 2024-06-10 14:06:30 +02:00
pryon
3254b3f044 Send SE_CHAR events (CharEvent) for ENTER, TAB and ESCAPE keys
So that UINotepad registers them as valid keypresses when typing
2024-06-10 14:04:55 +02:00
pryon
9a35d34fc3 Implement UINotepad
Also fix several original game bugs within, some cosmetical, some memory corrupting
2024-06-10 14:02:10 +02:00
pryon
4da5e26cdc Move CTRL macro to q_shared.h 2024-06-10 13:59:10 +02:00
smallmodel
8a28ad0c36
Fixed explosion effects on protocol below 2.0 2024-06-09 20:16:14 +02:00
smallmodel
e08b2fe382
Added cg_target_game 2024-06-09 20:10:30 +02:00
smallmodel
8b16e94829
Fixed grenade bounce sound overly playing 2024-06-09 19:56:41 +02:00
smallmodel
618223f01b
Ignore NumShaders in protocol version 8 and below 2024-06-09 19:32:15 +02:00
smallmodel
13c63d3e1f
Fixed wrong condition with msg broadcast visibility 2024-06-09 18:51:39 +02:00
smallmodel
8e0aa5185b
Fixed CGM endianness 2024-06-09 18:48:22 +02:00
smallmodel
2b01f092b3
Fixed german model always being set to german_wehrmacht_soldier 2024-06-09 18:23:06 +02:00
smallmodel
1fd238567e
Fixed animation loading endian 2024-06-09 17:55:57 +02:00
smallmodel
cb59edc963
Handle script exceptions in G_ServerSpawned 2024-06-09 16:56:42 +02:00
smallmodel
0ce70b9f8f
Improved/fixed archive support for big-endian platforms 2024-06-09 16:53:50 +02:00
smallmodel
57175cfa5c
Simplified the decompression algorithm and fixed it for big-endian 2024-06-09 16:45:10 +02:00
smallmodel
8aacdcefb8
Fixed lz77 endianness 2024-06-09 14:14:11 +02:00
smallmodel
69766ae87a
Added SwapValue 2024-06-09 13:19:31 +02:00
smallmodel
d3d2082e41
Removed useless print 2024-06-09 13:08:01 +02:00
smallmodel
de621f6acb
Made short3 implementation endianness independant
This fixes scripts not working properly as script variables key are using short3
2024-06-09 00:59:23 +02:00
smallmodel
a7c5067475
Fixed the execution of a method on the correct class 2024-06-09 00:07:11 +02:00
smallmodel
7282426736
Improved the networking code for big-endian architectures 2024-06-09 00:02:00 +02:00
smallmodel
0333fd86f8
MSG_DeltaNeeded_ver_15 was never called 2024-06-08 21:52:28 +02:00
smallmodel
ab91ade685
Explicitly use signed char for patch xy because some platforms use unsigned char by default 2024-06-08 19:56:24 +02:00
smallmodel
005afcd53d
Simplified CM_PickTerrainSquareMode 2024-06-08 19:20:27 +02:00
smallmodel
c1604c0c8c
Handle animation file endianness 2024-06-08 14:59:52 +02:00
smallmodel
5155c10136
Fixed scripts not working on big-endian architectures 2024-06-08 14:40:35 +02:00
smallmodel
28c6e3b398
Properly swap terrain patches for rendering on big-endian architectures 2024-06-08 12:48:36 +02:00
smallmodel
41244095b1
CMod_LoadTerrainIndexes: big-endian compatibility 2024-06-08 12:47:18 +02:00
smallmodel
a5535fa789
Make sure to initialize the widget's command handler to NULL.
This should fix #305
2024-06-08 01:40:36 +02:00
smallmodel
6796a8b3fe
Properly swap terrain patch values on big-endian systems 2024-06-08 01:08:58 +02:00
smallmodel
819dffcb86
Added MAX_TERRAIN_VARNODES 2024-06-08 01:05:47 +02:00
smallmodel
b54db17069
Added unsigned swaps 2024-06-08 01:03:08 +02:00
smallmodel
e27f2443e8
Fixed skel loading on big-endian systems 2024-06-08 00:53:39 +02:00
smallmodel
a1e0bc5d7c
Implemented TIKI_SwapSkel (used on Big-Endian systems) 2024-06-08 00:40:52 +02:00
smallmodel
28ea95b9ff
Added scale field 2024-06-08 00:08:54 +02:00
smallmodel
e3b9e48d8c
Added TIKI_SKEL_LOD_INDEXES 2024-06-07 22:38:45 +02:00
smallmodel
026b6b2562
Ignore endianness on skd/skb header signature, as it's a string 2024-06-07 22:08:46 +02:00
smallmodel
0fa380ecff
Correctly read the BSP checksum on big-endian systems 2024-06-07 22:01:24 +02:00
smallmodel
ebd885f053
Fixed Subclient not having the correct client name 2024-06-07 20:36:55 +02:00
smallmodel
74ccb03e54
Reduced compilation warnings 2024-06-07 20:34:13 +02:00
smallmodel
50264c4968
Make sure to cast the float number to int when using it in the format specifier 2024-06-07 20:25:47 +02:00
smallmodel
be222b64a1
Fixed one tiny instruction mistake that could cause issues with dynamic lights on terrains 2024-06-07 20:20:19 +02:00
smallmodel
db7ae4ffef
Properly clear the color values 2024-06-07 19:57:14 +02:00
smallmodel
884a76db4c
Drop error instead of throwing an exception to meet non-throwing exception specification 2024-06-07 19:55:33 +02:00
smallmodel
18e5c6e714
Use unsigned format specifier to match MAX_VOTEOPTIONS_BUFFER_LENGTH's type 2024-06-07 19:49:51 +02:00
smallmodel
468341b7d0
Explicitly mark as override 2024-06-07 19:49:29 +02:00
smallmodel
e03b976ffd
Added missing header on scriptclass.cpp source file 2024-06-07 19:42:10 +02:00
smallmodel
34ea099d87
Define _FILE_OFFSET_BITS to 64 due to a bug in readdir() affecting 32-bit architectures
readdir() would return NULL, setting errno to EOVERFLOW, unable to load pk3 files
2024-06-06 22:18:23 +02:00
smallmodel
5f2827e2ab
Added hardware requirements 2024-06-05 22:32:36 +02:00
smallmodel
1d887b4655
Fixed leaf light being incorrectly reassigned 2024-06-05 21:21:35 +02:00
smallmodel
6250380f61
Added PowerPC into the build system 2024-06-05 21:13:33 +02:00
smallmodel
6bb475abe7
Fixed PowerPC platform support with proper checks for endianness and ppc64 2024-06-05 21:13:06 +02:00
smallmodel
31ea951357
Fixed SkelMorphGetXyz implementation 2024-06-05 00:43:08 +02:00
smallmodel
091c8b4d12
Optimized channel data memory and performance (feature from moh 2.0 and above) 2024-06-05 00:40:43 +02:00
smallmodel
c4523db991
Added GetBoneChannelType 2024-06-04 23:48:29 +02:00
smallmodel
2b66672d2d
Added MAX_GLOBAL_FROM_LOCAL constant and implemented skelChannelList_s::GlobalChannel and skelChannelList_s::LocalChannel 2024-06-04 21:06:43 +02:00
smallmodel
77de0b78ba
First test if the entity has morphs before proceeding to loop through vertices 2024-06-04 20:20:40 +02:00
smallmodel
0181fbcfa0
Use the weight's bone index if there is no morph 2024-06-04 19:52:32 +02:00
smallmodel
e1f2433c36
Fixed sky portal rendering
This fixes #260
2024-06-03 21:36:58 +02:00
smallmodel
c753dcafd8
SurfIsOffscreen: use raw surface values rather than tess values 2024-06-03 21:36:35 +02:00
smallmodel
57ac7d8c19
Removed code that is already present in CG_SetupFog() and CG_SetupPortalSky() 2024-06-03 21:36:12 +02:00
smallmodel
d64ef13b79
Fixed script_skyorigin never being sent to clients 2024-06-03 21:34:48 +02:00
smallmodel
911e87c6ec
physics_off: Don't reset the physics in 1.0 in Single-player mode
This fixes #303 in m4l2 where the player doesn't have their gun holstered in the truck
2024-06-03 20:29:41 +02:00
smallmodel
b75c7b64f1
Still allow crouch when glued in 1.0 and in Single-player mode
This fixes #303 where the player is standing in the truck in m4l2
2024-06-03 20:28:39 +02:00
smallmodel
135b519dd8
Reduced actor's change of getting curious 2024-06-02 23:47:06 +02:00
smallmodel
b7a0607d52
Using parameters that take the entity rather than raw values 2024-06-02 19:55:42 +02:00
smallmodel
2ee1a2099d
Ignore map name case sensitivity when parsing map-specific animations 2024-06-02 19:46:14 +02:00
smallmodel
7fe7e74fe2
Replaced all stricmp calls with Q_stricmp 2024-06-02 19:44:06 +02:00
smallmodel
0a3a23af41
Using AI_EVENT_MAX to check for max ai events 2024-05-29 23:54:48 +02:00
smallmodel
e89262ed3b
Fixed TIKI_ParseAnimations improperly returning, even when a map was specified, causing parsing issues 2024-05-28 21:38:17 +02:00
smallmodel
21fda4cabd
Removed redundant code 2024-05-28 21:31:28 +02:00
smallmodel
a85694b548
Fixed incorrect method for EV_ScriptThread_Showmenu.
This fixes #302 where screen text with the mission date would never be shown.
2024-05-28 20:49:09 +02:00
smallmodel
16464c5a68
Removed zone events from entity
This fixes a conflict where some scripts would store stuff in a variable named `zone` in an entity
2024-05-27 23:28:12 +02:00
smallmodel
85c8769512
Fixed incorrect usage of the grid lighting
This fixes some entities being invisible when `r_fastentlight` is set to 1, due to the alpha color being 0 (cast from int to char for each color value). Fixes #299
2024-05-20 13:11:48 +02:00
smallmodel
c3abbd9014
Added assertion checks 2024-05-20 13:10:12 +02:00
smallmodel
98239050d8
Correctly archive the active weapon (safe pointer)
This fixes the player sometimes being holstered after loading from a save (closes #270)
2024-05-12 23:55:11 +02:00
smallmodel
dc7caf04a8
Fixed MoveTo not working on waypoints.
This fixes an issue where objects using waypoint (like elevators) would move at `(0 0 0)`. Closes #298
2024-05-12 23:40:11 +02:00
smallmodel
db01f72adc
Reimplemented ScriptVariable::entityValue
Some script events don't check if it's an actual entity, it would cause crashes.
E3L3 would crash after the player got out of the AB41: the AB41 was targetting a VehiclePoint and vehicles_thinkers.scr script set the `self.collisionent` to `self.target` which caused a crash as `VehiclePoint` doesn't inherit from `Entity`
2024-05-01 20:41:57 +02:00
smallmodel
170b4b0972
Fixed ScriptAimedStrafingGunfire aimTarget never set nor used
This fixes the gunfire incorrectly damaging things it shouldn't damage.

For example, the sniper3 balcony AI on e3l1:
The bomber caused this AI to fall before initialization (by damaging them when it shouldn't), the AI became nonsolid. After initialization, the AI had enemy enabled, however it remained nonsolid because of the balcony fall. It was constantly shooting at the player and it was unkillable because it was nonsolid.
The mission wasn't able to be completed because of this issue.
2024-05-01 20:18:52 +02:00
smallmodel
ff6e81d44f
Fixed CL_GetSnapshot sometimes wrongfully assigning parents multiple times and displaying errors
This should fix #170
2024-05-01 18:55:25 +02:00
smallmodel
88bc0e1e85
Reimplemented MSG_SetBroadcastVisible() and MSG_SetBroadcastAll() 2024-05-01 18:36:27 +02:00
smallmodel
c5b46529b0
Check the client if it has a valid entity for MSG_SetBroadcastVisible() 2024-05-01 18:24:44 +02:00
smallmodel
e5dbfba55e
Fixed an issue where scripts would get compiled every time they are executed, causing a performance issue 2024-05-01 17:54:45 +02:00
smallmodel
daa7aceecf
Fixed sighttrace not properly passing entities
This fixes the issue where some scripts (like e2l3's BattleHouse) expect sighttrace to ignore entities (fixes #202)
2024-05-01 17:43:04 +02:00
smallmodel
35681e7a1f
Added MASK_IGNORE_ENTS 2024-05-01 17:42:02 +02:00
smallmodel
d4dfde3340
Trigger must not be effective when being damaged if it does not take damage
This fixes issue with vehicles damaging triggers by touching them (like the ClickItemTrigger on m5l3 with tanks)
2024-04-30 20:26:08 +02:00
smallmodel
05a6b43e08
Check for __APPLE__ to detect MacOS 2024-04-30 19:25:02 +02:00
smallmodel
16f775c78c
Fixed ScriptSlave path with 2 equal points
This fixes the script slave moving infinitely and not sending movedone notifications as it would never advance to the next path. e3l4's outro is now fixed because of that (was stuck).
2024-04-29 23:42:05 +02:00
smallmodel
af919dadca
Simplified code for g_showflypath 2024-04-29 20:04:21 +02:00
smallmodel
41c322ec81
Refactored ScriptSlave::FollowingPath and ScriptSlave::SetupPath with bugfixes 2024-04-29 19:59:16 +02:00
smallmodel
ac8c18250d
If the actor is an american, always call ThinkHoldGun_TurretGun() without checking for enemy 2024-04-28 20:39:54 +02:00
smallmodel
4b05c400b2
Round to integer for vectoyaw()
This fixes Actor never finishing TurnTo as the DesiredYaw was set to a very precise value
2024-04-28 19:29:54 +02:00
smallmodel
cc85d0c100
Bumped version number 2024-04-22 23:40:00 +02:00
smallmodel
56dce21538
Fixed an invalid access to lighting sphere leaves
It was causing crashes on some occasions
2024-04-22 23:39:07 +02:00
smallmodel
3cd5acf3aa
Fixed issue with case-sensitive variables.
normal/return commands are case-insensitive
getter/setter commands are case-sensitive
2024-04-22 20:10:01 +02:00
smallmodel
48fc5a72b8
Fixed some setters and getters being inverted 2024-04-22 19:59:20 +02:00
smallmodel
26c3375112
When there is no enter_boneindex for turret slot, use the boneindex instead
This fixes #208
2024-04-22 18:28:56 +02:00
smallmodel
e89543710c
Check for max use angle when using the vehicle 2024-04-22 18:04:14 +02:00
smallmodel
ee48193f15
Added notagaxis
Fixes #222
2024-04-22 17:21:26 +02:00
smallmodel
6d10ed27c5
Fixed preferred weapon not showing on stats screen
Fixes #271
2024-04-22 16:48:24 +02:00
smallmodel
19c68aa25d
Ignore player collision if the actor is already nonsolid
This fixes #277 where the vehicle could get stuck due to the actor being solid afterwards
2024-04-21 20:33:31 +02:00
smallmodel
5ee7cb16bb
for ANIM_MODE_SCRIPTED and ANIM_MODE_NOCLIP, set the yaw based on the angular delta 2024-04-21 20:28:54 +02:00
smallmodel
4630a1f386
Fixed wrong return values for Vehicle::EventCanUse
It fixes Modello being hardly usable on maps like e3l2
2024-04-21 19:40:33 +02:00
smallmodel
06dab5d8b0
Refactored ScriptThread::EventPointsWithinDist for more clarity 2024-04-21 19:39:39 +02:00
smallmodel
054201bea9
Fixed character assertion fail when the character was a value below 0 2024-04-21 19:07:08 +02:00
smallmodel
f39a4c0bc7
Fixed projectile explosion origin.
This fixes exploder triggers sometimes never being triggered (fixes #294)
2024-04-21 17:47:39 +02:00
smallmodel
0e20d7e880
Fixed arm/arm64 binary loading on Windows
(fixes #295)
2024-04-14 23:03:46 +02:00
smallmodel
927f4bb4bd
Marked overridden virtual methods 2024-04-11 00:30:00 +02:00
smallmodel
f9901787b5
Removed "touch" unregistration 2024-04-11 00:26:45 +02:00
smallmodel
6731f56aea
Fixed m_PrevCodePos usage 2024-04-10 23:42:09 +02:00
smallmodel
d6870ecbee
Added trigger_sideduse from 2.30 2024-04-10 21:44:03 +02:00
smallmodel
eea8c42268
Added GetOwner event 2024-04-10 21:37:49 +02:00
smallmodel
99647e677a
Do projectile vulnerability for vehicles 2024-04-10 00:22:35 +02:00
smallmodel
a5d637dbb3
Added GetOwner() 2024-04-10 00:21:23 +02:00
smallmodel
048a973290
Added GetProjectileHitsRemaining 2024-04-10 00:20:32 +02:00
smallmodel
fa80e0bd75
Implemented FencePost 2024-04-10 00:05:00 +02:00
smallmodel
a23de7b361
Made Killed() a virtual method 2024-04-09 23:54:08 +02:00
smallmodel
dc60cb45b2
Fixed scripts using syntax like $self 2024-04-09 23:22:54 +02:00
smallmodel
2bf1144a14
Removed unused source files 2024-04-09 22:41:41 +02:00
smallmodel
ab5efa5a64
Fixed sentient being improperly attached/detached from/to the turret
This fixes #255
2024-04-09 00:12:02 +02:00
smallmodel
ccc98e4c62
Implemented missing ThrobbingBox_Stickybomb() 2024-04-08 23:38:51 +02:00
smallmodel
52424f63f0
Make ThrowObject::Throw throws an exception when the owner and targetent is NULL, also use centroid if the target entity is not a sentient 2024-04-08 21:52:48 +02:00
smallmodel
881df7193b
Fixed ThrowObject not usable when spawned from script.
This fixes #218
2024-04-08 21:47:24 +02:00
smallmodel
e859bba61d
Added a forgotten call to SetupNextCycle when turning on the projectile generator and fixed the uninitialized delay before beginning the cycle.
This fixes artillery system not working on t2l3, t2l4, e1l1... (fixes #224)
2024-04-08 21:33:59 +02:00
smallmodel
e3beec985e
When parsing and compiling a script, return the length in an output parameter instead so the method can return a boolean to indicate success.
This fixes #221 where a script with no code would fail.
2024-04-08 21:04:26 +02:00
smallmodel
9eec50d69f
Fixed script model animation issues, especially when they're looping
This fixes #220.
2024-04-08 20:52:58 +02:00
smallmodel
5a8cc83e6e
Fixed MM stepping
This fixes actors being slow and it also fixes actors going under the map
2024-03-31 22:52:30 +02:00
smallmodel
724aeb22ed
Fixed MM_SlideMove() velocity clip and interaction 2024-03-31 22:15:19 +02:00
smallmodel
6fdc756b59
Set terrain rendering settings to max detail by default 2024-03-17 22:38:44 +01:00
smallmodel
25418b7857
Ammo name must be case-insensitive
This fixes some maps like t1l3 where the player would have a pistol with 6 bullets and no ammo
2024-03-06 23:49:37 +01:00
smallmodel
b4de0b53e4
Special items must not be archived in persistent data 2024-03-06 19:43:37 +01:00
smallmodel
cacf1ca1b7
Set the unarmed flag when archiving persistent data 2024-03-06 19:35:15 +01:00
smallmodel
98c61529b9
Archive the weapon clip amount in persistent data 2024-03-06 19:33:48 +01:00
smallmodel
6675a491be
Fixed the model name when archiving persistant data
This fixes a crash when the next mission map is loaded and then saving/loading afterwards (fixes #237)
2024-03-06 19:29:07 +01:00
smallmodel
b6485ad7db
Configstring optimization so that there is only one occurence of a configstring index in pending server commands
This fixes configstring overflow in big maps like t1l2 (fixes #289)
2024-03-06 18:54:32 +01:00
smallmodel
9f5df368d1
Fixed infinite player team spectate 2024-03-05 23:30:25 +01:00
smallmodel
e970e29953
Use a constant expression for clarity 2024-03-05 22:59:12 +01:00
smallmodel
9fb559bdb1
Added an assertion check for lastRadarTime 2024-03-05 22:52:19 +01:00
smallmodel
61e9146385
Moved con_set entry to the header file
This fixes compilation issue with GCC (fixes #288)
2024-03-05 18:30:31 +01:00
smallmodel
897c2322b9
Archive the target list
This fixes crashes related to scripts using entities by target name
2024-03-04 23:35:22 +01:00
smallmodel
7b8be9fed1
Added ArchiveObject() that accepts a SafePtr 2024-03-04 23:34:31 +01:00
smallmodel
cebb351505
Added and implemented TargetList 2024-03-04 23:08:22 +01:00
smallmodel
b4bce3431b
Archive LightClass object pointer instead of a Class object pointer 2024-03-04 22:51:29 +01:00
smallmodel
c6e3dfdbe6
Fixed velocity clip (sliding along plane)
This fixes the issue where vehicles would not be moving precisely where it should be moving (incorrect clipping of the velocity). For example, the minesweeper tank in e1l2 kept getting stuck because it didn't move appropriately (fixes #261)
2024-03-04 22:40:49 +01:00
smallmodel
22d2790735
Fixed vehicle stepping 2024-03-04 22:27:00 +01:00
smallmodel
5d3b76b249
Cleaned up SetMoveInfo() / SetCEMoveInfo() 2024-03-04 22:26:56 +01:00
smallmodel
7b07be1502
use double instead of float 2024-03-04 22:25:31 +01:00
smallmodel
3acb796b59
Call VectorNormalize() directly in Vector::normalize() 2024-03-04 20:07:06 +01:00
smallmodel
25bbc1793d
Fixed AngleNormalize360 2024-03-04 20:06:35 +01:00
smallmodel
63456beeb0
Code clarity 2024-03-03 22:47:31 +01:00
smallmodel
2e32395cf2
VectorNormalize optimization 2024-03-03 19:51:56 +01:00
smallmodel
d04ed0aace
Made M_PI double 2024-03-03 19:46:32 +01:00
smallmodel
302f06f8d2
Clear the variable if the field cannot be found 2024-03-03 18:54:22 +01:00
smallmodel
4cf4ca2943
Fixed crash on pSoundAlias 2024-03-03 18:53:22 +01:00
smallmodel
fe35e02ed4
Fixed weapon pickup logic, like player picking up the weapon indefinitely when reaching max ammo 2024-03-03 18:09:19 +01:00
smallmodel
5fa1b98d34
Fixed vert Z coord not matching average height
This caused issue where verts would never be merged. This should fix #232
2024-03-03 17:52:29 +01:00
smallmodel
bebe117487
Formatted document 2024-03-03 17:34:01 +01:00
smallmodel
26495fe0f8
Refactored R_TerraTriNeighbor 2024-03-03 17:33:35 +01:00
smallmodel
4c4ac9f90e
Added more assertions for consistency 2024-03-03 16:24:09 +01:00
smallmodel
bf5fdb8f06
Fixed improper fence masks
This fixes #284, fixes #280
2024-03-02 15:29:25 +01:00
smallmodel
01e68fd5ee
Fixed turret gun never being killed
This fixes #231
2024-03-02 15:29:08 +01:00
smallmodel
e930b5481a
Mark the trigger as dead after kill 2024-03-02 15:27:35 +01:00
smallmodel
9bd4d40f09
Formatted document 2024-03-02 15:00:56 +01:00
smallmodel
40035f4df3
Fixed multi-shaders snow 2024-03-02 14:23:32 +01:00
smallmodel
a7b3fdd70b
Added getConfigStringIdNormalized client game import to normalize config strings 2024-03-02 14:06:32 +01:00
smallmodel
b77af7fced
Implemented R_GetLightingForDecal 2024-03-01 22:59:06 +01:00
smallmodel
52c89f1de3
Fixed comparison operator 2024-03-01 22:31:33 +01:00
smallmodel
e7cd70b8ee
Enable cg_rain by default 2024-03-01 22:19:18 +01:00
smallmodel
e06ee0f26a
Bounce backwards check 2024-02-28 23:40:41 +01:00
smallmodel
76c9e4e048
Fixed pickup message appearing twice 2024-02-28 23:33:10 +01:00
smallmodel
06d8ddbfc7
Fixed AI firing multiple bullets when it should fire one
This fixes AI killing the player almost instantly
2024-02-28 22:56:05 +01:00
smallmodel
8b9840d37f
Implemented Game::Archive() 2024-02-28 22:52:44 +01:00
smallmodel
960469be77
Implemented MakePrimitive() 2024-02-28 22:52:25 +01:00
smallmodel
77ef0f3579
Implemented game.detail and game.skill 2024-02-28 22:21:53 +01:00
smallmodel
07c840a4a9
Don't assert for NULL owner 2024-02-28 22:10:18 +01:00
smallmodel
35a8c4edfa
g_droppeditemlife: make sure the value is non-null 2024-02-28 22:10:07 +01:00
smallmodel
36af9e6589
Fixed a very boring mistake ignored by MSVC 2024-02-27 00:02:20 +01:00
smallmodel
ea14ab5664
Implemented special func 2024-02-26 23:25:39 +01:00
smallmodel
1ed8538745
Bounds check clarity 2024-02-26 20:23:31 +01:00
smallmodel
12e36b987a
Use G_DebugRotatedBBox when drawing the entity's bounding box 2024-02-26 19:56:35 +01:00
smallmodel
8324c599de
Implemented G_DebugRotatedBBox 2024-02-26 19:56:23 +01:00
smallmodel
d972c85fba
Formatted debuglines source file 2024-02-26 19:33:52 +01:00
smallmodel
d8b9abe7f5
Fixed call to GunTarget()
It was specifying the position in the boolean parameter which lead to wrong results
2024-02-26 19:21:12 +01:00
smallmodel
4f868d9585
Fixed a collision bug with fence masks 2024-02-26 19:19:38 +01:00
smallmodel
e27ac45f44
Don't load TGA without alpha for collision 2024-02-26 19:08:21 +01:00
smallmodel
58d0e43f78
Use MASK_USE instead of MASK_SOLID 2024-02-26 17:37:38 +01:00
smallmodel
a6c1cbfd50
Added MASK_USE 2024-02-26 16:34:31 +01:00
smallmodel
e32222884d
Fixed DisguiseSalute never finishing animation 2024-02-26 15:53:38 +01:00
smallmodel
49a7a1f8ff
minimum visibility is 0.999 and not 1.0 2024-02-26 15:53:17 +01:00
smallmodel
e5275c0f05
Fixed MASK_TRANSITION being wrong 2024-02-25 21:26:08 +01:00
smallmodel
c391605f61
Fixed AI attacking the disguised player
This fixes #203
2024-02-25 20:10:02 +01:00
smallmodel
73c9e6f1d8
Ignore disabled ennemies 2024-02-25 19:16:07 +01:00
smallmodel
2d6ac6f0be
Fixed weapon melee AI broadcast 2024-02-25 19:15:41 +01:00
smallmodel
57870103a6
Fixed TriggerVehicle not responding to VehicleCollisionEntity 2024-02-25 18:54:42 +01:00
smallmodel
64604b5c44
Disable non-pvs sound in single-player
This fixes #267 where configstrings are full
2024-02-25 18:43:42 +01:00
smallmodel
9960884e3c
Initialize watchFadeTime 2024-02-23 23:53:27 +01:00
smallmodel
593982d586
Added assertion test 2024-02-23 23:53:18 +01:00
smallmodel
f229c1c5a8
Fixed player health in SP 2024-02-23 23:21:44 +01:00
smallmodel
35e9f9982c
Preallocate arguments for sp/dm commands 2024-02-23 23:19:59 +01:00
smallmodel
a0cb46d4a1
Formatting 2024-02-23 23:09:57 +01:00
smallmodel
e8a48184b9
Set the ground entity number to the glue master 2024-02-23 23:09:29 +01:00
smallmodel
d2aa26248f
Don't allow ducking when physics are off
This fixes #251
2024-02-23 23:02:29 +01:00
smallmodel
0f1de72ae6
Initialize the ground entity number 2024-02-23 22:51:08 +01:00
smallmodel
efaea69c09
Don't evaluate state when immobile 2024-02-23 21:12:38 +01:00
smallmodel
a67dbff603
Reset state to STAND when the player has no physics 2024-02-23 21:12:23 +01:00
smallmodel
35e6435382
Reimplemented DropInventoryItems from 2.30 2024-02-22 23:12:04 +01:00
smallmodel
7a2735885f
Send information about sentient's team
This fixes #259
2024-02-22 22:50:36 +01:00
smallmodel
cc721a3db6
Lexer fixes for integer
This fixes map loading issues (fixes #258)
2024-02-22 21:36:31 +01:00
smallmodel
1a5cac2c6a
Implemented all parm methods
This fixes, #249 and fixes #217
2024-02-22 20:44:15 +01:00
smallmodel
ef08f1c8f3
Fixed turret fire issues 2024-02-22 20:21:53 +01:00
smallmodel
8919890dbe
Fixed entity collision for vehicles
This fixes vehicle not properly handling damage triggers (fixes #223, fixes #240)
2024-02-22 19:59:28 +01:00
smallmodel
cf6335d180
Fixed VehicleTouched not handling damage properly if there is no driver 2024-02-22 18:29:31 +01:00
smallmodel
a86a707e4a
Added more variables to initialize 2024-02-22 18:29:16 +01:00
smallmodel
9d61993878
Archive name_index 2024-02-21 20:59:41 +01:00
smallmodel
6eb20a3524
Added PostSpawn for ammo
This fixed ammo being spawned in the air without falling (fixes #244)
2024-02-21 20:59:28 +01:00
smallmodel
7314543c88
Fixed snow bullet hit effect
This fixes #246
2024-02-21 20:17:01 +01:00
smallmodel
bb4b10d752
Use result from Cvar_InfoString_Big for CS_SYSTEMINFO 2024-02-21 20:13:24 +01:00
smallmodel
416c568c51
Make CVAR_ROM variables appear first in info strings 2024-02-21 20:13:08 +01:00
smallmodel
65d3a51a17
Use '\n' instead of 10 2024-02-21 20:12:14 +01:00
smallmodel
e55f5902d5
Avoid using constant values 2024-02-21 20:12:05 +01:00
smallmodel
b0180383df
Fixed FFA scores
This fixes #242
2024-02-21 19:37:49 +01:00
smallmodel
61f0fc665f
Fixed MG42 reload anim name 2024-02-20 23:29:47 +01:00
smallmodel
b0c1d79132
Fixed AI mg42 fire delay 2024-02-20 23:29:38 +01:00
smallmodel
7945c2ca66
Fixed target's m_Team accidentally being overwritten
This causes NPC to look invulnerable (fixes #238)
2024-02-20 22:57:02 +01:00
smallmodel
8b2b1a9a47
S_AddLoopingSound: ignore null sfx handle 2024-02-20 22:42:54 +01:00
smallmodel
b76f9a9a6c
Fixed skel_entity_cache initialization 2024-02-20 22:42:34 +01:00
smallmodel
8af5da5fca
tiki assert check 2024-02-20 20:45:05 +01:00
smallmodel
cbe6d85bcd
Added multiple cache per entity 2024-02-20 20:44:55 +01:00
smallmodel
6b6e2c947c
Fixed vNorm not being initializing causing crashes on rare occasions
This should fix #169
2024-02-20 19:53:08 +01:00
smallmodel
66fcc2cd14
Cleaned up VSS_AddRepulsion 2024-02-20 19:52:11 +01:00
smallmodel
af829772f9
Cleaned up VSS_CalcRepulsionForces and fixed vss index 2024-02-20 18:54:59 +01:00
smallmodel
7b6a558fe5
Check for valid turret gun in P_UserAim
When the player dies, it gets detached from turret can would cause crash (#216)
2024-02-19 23:41:57 +01:00
smallmodel
4122ee4168
Fixed RunAndShoot state crash due to NULL moving patrol node
(#214)
2024-02-19 23:25:39 +01:00
smallmodel
b77f62ab58
Load/Save SimpleArchivedEntity
This fixes #213 where elevator wouldn't go up because of missing waypoint
2024-02-19 23:23:15 +01:00
smallmodel
783bf1b63c
Archive ignorevelocity member 2024-02-19 23:22:53 +01:00
smallmodel
a0728b4a8a
Using MASK_CLICKITEM mask for ClickItemAttack 2024-02-19 23:10:14 +01:00
smallmodel
ea6e865cc8
Added MASK_CLICKITEM 2024-02-19 19:59:14 +01:00
smallmodel
1da4113110
Added FuncLadder archive method
This fixes bug where ladder would get unusable after loading from save game (see #211)
2024-02-19 19:36:46 +01:00
smallmodel
7956746b65
Fixed inward sphere argument: the argument should be optional
See #209
2024-02-19 19:34:11 +01:00
smallmodel
10a8d13ade
Added missing variables to archive 2024-02-18 23:27:15 +01:00
smallmodel
65b47a2b3a
Fixed AnimDone never being called
This fixes maps like e1l2 never starting because it waits for an anim to finish
2024-02-18 21:54:18 +01:00
smallmodel
46cc00d669
Set m_fMaxSpeed 2024-02-18 21:53:33 +01:00
smallmodel
5521cf9ab3
Fixed m_fMaxSpeed being always set to 250 2024-02-18 20:10:18 +01:00
smallmodel
a770df1e0b
Fixed path not found spam 2024-02-18 15:47:07 +01:00
smallmodel
03943a23ac
Fixed badplace and run and shoot think never working 2024-02-17 20:10:00 +01:00
smallmodel
685dc0336a
Corrected loop ordering 2024-02-17 00:05:39 +01:00
smallmodel
776012fedf
Health must have a targetname by default in 2.0 and above 2024-02-16 23:52:25 +01:00
smallmodel
6ba9f2655c
Call PostSpawn after constructing the health instance 2024-02-16 23:51:34 +01:00
smallmodel
8a3b62e93f
Fixed targetname error 2024-02-16 23:50:57 +01:00
smallmodel
bd999a6d9c
Fixed Trace's pass_entities parameter (didn't properly ignore entities) 2024-02-15 23:48:23 +01:00
smallmodel
f46078965d
info_null must inherits from Listener instead of Entity
This fixes Level::AllocEdict issues on some maps that use it a lot (like t2l4) #206
2024-02-15 21:15:37 +01:00
smallmodel
60f6bb17e3
Fixed AI parameters not fixing AI parameters 2024-02-15 20:40:55 +01:00
smallmodel
fdf1dac618
Wrong condition for SetDesiredYawDest (should set only if values are non-zero) 2024-02-15 20:23:50 +01:00
smallmodel
373a35acf0
Fixed target trigger being triggered by itself 2024-02-15 20:23:17 +01:00
smallmodel
abfdac59ba
Make aiMaxDeviation only supported on 2.0 and above 2024-02-15 00:21:01 +01:00
smallmodel
efc1354dcb
Fixed entity monitoring always used 2024-02-14 20:58:19 +01:00
smallmodel
c9f2603692
Don't suppress below 2.0 2024-02-14 20:48:11 +01:00
smallmodel
aab24260e2
FriendlyInLineOfFire should return false below 2.0 2024-02-14 20:47:54 +01:00
smallmodel
e450156bf7
Fixed path goal movement 2024-02-14 20:46:43 +01:00
smallmodel
1533c02a41
Fixed cover hide 2024-02-14 20:32:57 +01:00
smallmodel
c4855029a9
Fixed motion facing 2024-02-14 20:32:40 +01:00
smallmodel
4fa457118f
Fixed CanMovePathWithLeash() not returning the correct result 2024-02-14 20:06:35 +01:00
smallmodel
33b403d6eb
Fixed MASK_CANSEE 2024-02-14 19:58:29 +01:00
smallmodel
a5c6654dcb
Fixed m_fMaxDistanceSquared initialization value 2024-02-14 19:22:19 +01:00
smallmodel
07ec6adecb
Fixed ViewJitter never being removed 2024-02-14 18:40:34 +01:00
smallmodel
ceb901e9ca
Fixed disconnected menu not being pushed properly 2024-02-14 18:32:06 +01:00
smallmodel
651b86b066
Added comment for more clarity 2024-02-13 18:23:23 +01:00
smallmodel
a4003dd61c
Only execute anim/suppress.scr if targeting 2.0 and above 2024-02-13 18:16:52 +01:00
smallmodel
5e461786f9
Added a comment about FriendlyInLineOfFire 2024-02-13 18:15:54 +01:00
smallmodel
45108c6f4b
Fixed curious' finished animation global function
This fixes AI being permanently stuck in a curious animation
2024-02-13 17:38:11 +01:00
smallmodel
bc0d373dcd
Fixed AI getting blocked because of an obstacle 2024-02-13 17:37:28 +01:00
smallmodel
0f37a8f6ea
Fixed m_fLeashSquared initialization 2024-02-13 16:42:54 +01:00
smallmodel
03ceaf82ce
Fixed AngleMod() being inaccurate
This caused issues with Actor never finishing turning (because it expected the desired yaw to be at the exact same angle rounded by 0.001)
2024-02-13 16:23:47 +01:00
smallmodel
1e5e5e24f6
Fixed entity monitoring never printing 2024-02-13 16:23:06 +01:00
smallmodel
eb993dbd43
Fixed grenade toss location and wall facing 2024-02-13 16:22:56 +01:00
smallmodel
4f5abb3412
Fixed int conversion when printing the awareness 2024-02-13 16:22:39 +01:00
smallmodel
6418d79d76
Call PostThink() in Think_Alarm() 2024-02-13 16:22:18 +01:00
smallmodel
796a3a711f
Fixed animation delta over time 2024-02-13 01:01:51 +01:00
smallmodel
0ef743d945
Forgot newline 2024-02-13 01:01:39 +01:00
smallmodel
7c33f98ae9
Use m_fFollowRelativeYaw 2024-02-13 00:57:37 +01:00
smallmodel
51ba1e2951
Properly use identity / identitylighting when cgen isn't explicitly specified 2024-02-12 23:47:07 +01:00
smallmodel
0b16d599d5
Added UseCount for image_t 2024-02-12 22:11:15 +01:00
smallmodel
3b2223ad22
image validity check 2024-02-12 22:11:00 +01:00
smallmodel
186583148a
Use proper values for GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T 2024-02-12 22:10:00 +01:00
smallmodel
5475624b7f
Added DDS support + handle compressed textures correctly 2024-02-12 20:19:33 +01:00
smallmodel
d5be69239a
Added GL 1.3 functions 2024-02-12 20:18:52 +01:00
smallmodel
304645d720
Ignore CGEN_BAD stages 2024-02-12 19:50:32 +01:00
smallmodel
0591152f99
Added ifCvar / ifCvarnot support 2024-02-12 17:18:51 +01:00
smallmodel
74e8a38c00
When idle, limit the turret's pitch to the max idle pitch 2024-02-12 16:59:20 +01:00
smallmodel
5cadab46ab
Fixed fence mask being incorrectly specified as transparent rather than opaque 2024-02-12 16:49:27 +01:00
smallmodel
1577927d99
Ignore collision if the brush has a trace content and the trace content wasn't specified in the trace flags 2024-02-12 16:48:58 +01:00
smallmodel
5a0aeb2f88
Fixed last fire time being incorrectly set in the future 2024-02-12 15:12:55 +01:00
smallmodel
7a1f7773bf
Use sin/cos instead of sinf/cosf (accuracy) 2024-02-12 15:05:33 +01:00
smallmodel
b0e597cf55
Fixed vehicle collision orientation 2024-02-12 15:02:55 +01:00
smallmodel
c40d073d7a
Refactored CM_CheckTerrainTriSphere 2024-02-12 14:17:04 +01:00
smallmodel
dd8b3f607a
Fixed terrain tri sphere collision not returning correct results with small objects 2024-02-12 13:36:56 +01:00
smallmodel
5cc599984d
Fixed bullet hit effect for glass 2024-02-12 00:29:52 +01:00
smallmodel
b95b8c4c20
Fixed water bullet effect 2024-02-12 00:17:30 +01:00
smallmodel
3e190ca4b3
Added MASK_SHOT_FLUID (there are so many masks) 2024-02-12 00:02:28 +01:00
smallmodel
3853d1ef39
Properly map the CGM message depending on the protocol version 2024-02-11 23:38:24 +01:00
smallmodel
bf700186d0
Fixed bounce velocity reduction 2024-02-11 23:31:26 +01:00
smallmodel
ca7cacfdcc
Add a debug line when bouncing if enabled (for AI) 2024-02-11 23:27:21 +01:00
smallmodel
b893f4f89f
Properly stop if on ground 2024-02-11 23:20:52 +01:00
smallmodel
109686aca2
Reduce the velocity when bouncing 2024-02-11 23:14:08 +01:00
smallmodel
6840df4eca
backoff value should be 1.4 for bounce and 1.6 for Gib 2024-02-11 23:11:11 +01:00
smallmodel
ed3f212bd8
Also check for slide with bounce movetype 2024-02-11 23:10:21 +01:00
smallmodel
e1f2a51f2b
Only move angles if there is an angular velocity 2024-02-11 23:07:32 +01:00
smallmodel
d3870309fb
Fixed MASK_MONSTERSOLID 2024-02-11 22:56:44 +01:00
smallmodel
1fa2031f11
When a player is inside a vehicle, use the vehicle's health for the health stat 2024-02-08 20:41:33 +01:00
smallmodel
1d765125c7
Fixed facets and planes being badly initialized 2024-02-08 20:35:11 +01:00
smallmodel
5aa70d91f3
Fixed patch subdivisions 2024-02-07 23:44:59 +01:00
smallmodel
f018c2c15a
Ignore shaders for surface starting with the name "material" 2024-02-07 23:36:04 +01:00
smallmodel
1b8ad12b25
Call RefreshMaterial() instead of ReregisterMaterial() 2024-02-07 23:33:12 +01:00
smallmodel
078aa01895
Reimplemented RefreshMaterial() 2024-02-07 23:33:02 +01:00
smallmodel
f0aad4bb21
Don't mark the driver slot as unused by default 2024-02-07 22:51:50 +01:00
smallmodel
8fe054b063
Fixed door open direction 2024-02-06 23:32:33 +01:00
smallmodel
ac63e6c627
Rotate the client when blocked, and make sure the checked's velocity doesn't reach the push move speed 2024-02-06 23:31:48 +01:00
smallmodel
434a48af7d
Initialize m_iNumShotsFired 2024-02-06 22:57:37 +01:00
smallmodel
c5dcf96717
Implemented all RB_Calc functions 2024-02-06 22:54:48 +01:00
smallmodel
84791c42bc
Implemented RB_CalcSunReflectionTexCoords 2024-02-06 22:23:26 +01:00
smallmodel
e032a1a627
Implemented all tcMod values 2024-02-06 22:16:20 +01:00
smallmodel
1f2b5dcc86
Added and fixed all missing tcMod parameters 2024-02-06 20:07:39 +01:00
smallmodel
8bd30ffb22
Added rate tmod variable 2024-02-06 19:59:14 +01:00
smallmodel
fbf67fccc3
Added TMOD enum values from AA 1.11 2024-02-06 19:55:21 +01:00
smallmodel
b848ee0fac
Added rotateStart and rotateCoef for rotate tcMod 2024-02-06 19:48:55 +01:00
smallmodel
4a39e5411f
Fixed patch collision in position test 2024-02-05 23:46:43 +01:00
smallmodel
336ba6181e
Don't allocate planes / facets if there are none 2024-02-05 23:25:41 +01:00
smallmodel
c9aedf242d
Fixed scoreboard sending incorrect data for spectators 2024-02-05 21:03:10 +01:00
smallmodel
500c70016f
Don't crossblend with new weapons 2024-02-05 20:13:23 +01:00
smallmodel
cf1dbf07c7
Corrected MASK_CLICK tracemask (especially for patches surface) 2024-02-04 20:46:05 +01:00
smallmodel
13ec3435b4
Fixed rain num shaders 2024-02-04 19:36:56 +01:00
smallmodel
fce0f7b357
Better rain handlijng 2024-02-04 19:36:34 +01:00
smallmodel
0fabdc8c44
Added current objective index 2024-02-04 19:25:03 +01:00
smallmodel
2174f2ff85
For "delete" and "remove", use Listener::ScriptRemove 2024-02-04 19:09:08 +01:00
smallmodel
ac40373c09
Use RemoveVehicleSoundEntities() to remove sound entities 2024-02-04 19:08:37 +01:00
smallmodel
d5908bd75c
Fixed frag grenade spelling in SP 2024-02-04 16:30:31 +01:00
smallmodel
8cf3be3526
If in thinks, don't delete the object immediately 2024-02-04 16:30:22 +01:00
smallmodel
0290fa3351
Set default animation on the attached model if the tag was not found 2024-02-04 16:30:02 +01:00
smallmodel
937f3993ec
Removed unusable FX in 1.11 and below 2024-02-04 16:10:49 +01:00
smallmodel
d501285057
Play pain animation only in 2.0 and above 2024-02-04 15:47:48 +01:00
smallmodel
0ed92943de
Fixed commands not being executed properly on a specific type of array of listeners 2024-02-03 23:22:06 +01:00
smallmodel
56044dd8f8
HideMouse doesn't take parameters 2024-02-03 23:19:55 +01:00
smallmodel
e8109076f4
Assign shaders to surfaces that don't have a shader assigned 2024-02-03 23:03:41 +01:00
smallmodel
0a31ab7558
Use the correct view model animation for the kar98 mortar 2024-02-03 21:23:59 +01:00
smallmodel
e73be7ef5c
Smoke grenades don't exist in vanilla Allied Assault 2024-02-03 21:19:04 +01:00
smallmodel
aa209e0aaf
Fixed plane distance not being copied correctly with terrain square mode 5 or 6 2024-02-03 21:09:26 +01:00
smallmodel
570dddddd8
Formatted cm_terrain source files 2024-02-03 21:07:49 +01:00
smallmodel
534176423e
Fixed trace error with Vehicle Hit(MV2) 2024-02-02 23:05:55 +01:00
smallmodel
ca2c2fb8fe
Use floating-point operation in CalculateBoxPoints() 2024-02-02 23:05:18 +01:00
smallmodel
4388b7b187
AI_ThinkActive() must be used if the owner is an Actor 2024-02-02 19:26:11 +01:00
smallmodel
368f94ce3b
Fixed spline improperly returning the number of points when appending 2024-02-02 19:23:09 +01:00
smallmodel
e7fd0f7419
Merge pull request #138 from ysdragon/dev
Fixed compilation using Clang 16+
2024-01-31 20:43:30 +01:00
DraGoN
92f7c3633f
Fixed compilation using Clang 16+ 2024-01-30 22:54:13 +00:00
smallmodel
bf27caa61e
Fixed vehicle lacking gravity 2024-01-29 22:55:48 +01:00
smallmodel
808916029e
Formatted scriptthread source file 2024-01-29 00:03:51 +01:00
smallmodel
5f3ee10bc0
Fixed Linux compilation error because of stupid CL accepting anything 2024-01-29 00:01:39 +01:00
smallmodel
45f50cfe25
Fixed array variable being case-sensitive 2024-01-28 23:53:02 +01:00
smallmodel
42c0605abf
Fixed game message printing possible random characters if the string is empty 2024-01-28 23:33:59 +01:00
smallmodel
f83839e01b
Fixed crash with WhatIs command if the entity doesn't have a model 2024-01-28 23:32:43 +01:00
smallmodel
24dbc1ce4e
Use C vectors 2024-01-28 23:29:56 +01:00
smallmodel
d8505eff2b
Fixed label parameters being incorrectly case-sensitive 2024-01-28 23:17:00 +01:00
smallmodel
bca71ade85
Added automatic addition of idle animation when there is none (from 2.30 code) 2024-01-28 23:16:47 +01:00
smallmodel
7518d7b418
Reworked FS_CanonicalFilename 2024-01-28 20:41:17 +01:00
smallmodel
3f8aeac7e6
Exported WriteSkelmodel 2024-01-28 20:27:58 +01:00
smallmodel
c4a9a87929
Added TIKI_AddDefaultIdleAnim 2024-01-28 20:24:17 +01:00
smallmodel
7eca455795
Set the idle skelmodel and increase the number of skels 2024-01-28 20:24:04 +01:00
smallmodel
cb9ac23b23
Added TIKI_AllocAnim 2024-01-28 20:23:05 +01:00
smallmodel
4a66a41f91
Added idle skel and number of skeletons 2024-01-28 20:19:14 +01:00
smallmodel
665c35d089
Added TIKI array max values 2024-01-28 20:18:09 +01:00
smallmodel
0a634c633b
Fixed crash when loading MP3 in OpenAL 2024-01-28 19:41:31 +01:00
smallmodel
eb70b30e7a
Fixed an issue with the lexer (space before thhe dot) 2024-01-28 19:40:32 +01:00
smallmodel
8d188073b4
When pushing a menu, the max motion time must be taken from the head menu 2024-01-27 21:26:37 +01:00
smallmodel
ceea855c6f
Also play Widget motion if there is a fade sequence 2024-01-27 21:26:11 +01:00
smallmodel
9b7f192dce
Corrected marks not working on entities like doors 2024-01-27 21:14:13 +01:00
smallmodel
23a866f6f8
Implemented R_GetInlineModelBounds 2024-01-27 20:53:17 +01:00
smallmodel
946a7a406c
Fixed client not quitting when dedicated is set to 1 2024-01-27 20:45:56 +01:00
smallmodel
e209290073
Fixed cSpline using wrong positions 2024-01-25 21:55:21 +01:00
smallmodel
2c441ee541
Fixed vehicle sound entity using bad sound prefix 2024-01-25 21:55:03 +01:00
smallmodel
dd768ec9ef
Formatted VehicleSoundEntity source files 2024-01-25 21:54:44 +01:00
smallmodel
adaeaea596
Fixed other code that makes the game crash when length is 0 2024-01-25 19:48:34 +01:00
smallmodel
5a44740592
Fixed invalid event name causing crashes 2024-01-24 21:52:22 +01:00
smallmodel
97a0bd90ec
Set default values for sv_invulnerabletime and sv_team_spawn_interval depending on the target protocol 2024-01-24 20:37:43 +01:00
smallmodel
92ee1d9caf
Reset location print after sending it 2024-01-24 20:19:22 +01:00
smallmodel
9ab28dc7da
Fixed objective maps appearing twice 2024-01-23 22:42:27 +01:00
smallmodel
840501c8dd
Fixed waffenss skin name 2024-01-23 00:04:41 +01:00
smallmodel
ef4b79b1f5
Fixed pm_flags being wrong on Allied Assault 2024-01-22 23:53:25 +01:00
smallmodel
b6b35079ef
Fixed crouch height bounding box 2024-01-22 23:53:13 +01:00
smallmodel
b8e8aead93
Fixed issues with multiple consecutive dollars
This fixes the issue with scripts, like `m6l1c` that accidentally use double dollars for targetnames, like `$$player`
2024-01-22 22:20:25 +01:00
smallmodel
dd378db4d0
Avoid the use of fabs() for dot product 2024-01-22 00:08:27 +01:00
smallmodel
cc048f5099
Fixed some sounds being improperly replaced 2024-01-21 23:50:15 +01:00
smallmodel
ac02afaae6
Don't spam the console with OpenAL errors 2024-01-21 23:48:49 +01:00
smallmodel
bff58ae615
Removed trace.startsolid check 2024-01-21 23:30:48 +01:00
smallmodel
748934edcd
Fixed incorrect box in brush testing 2024-01-21 23:30:38 +01:00
smallmodel
d9fb375812
Fixed collision issues due to steps 2024-01-21 20:46:15 +01:00
smallmodel
55582a85ab
Fixed entityNum callback 2024-01-18 20:39:04 +01:00
smallmodel
9255c5259d
Fixed spawnpoint issues 2024-01-18 20:23:41 +01:00
smallmodel
f1e2a45520
Don't crash if the length is 0 2024-01-18 20:05:57 +01:00
smallmodel
cb9e69238c
Initialize buffer to 0 (integer) 2024-01-17 23:15:38 +01:00
smallmodel
56b2971dee
Fixed AL positioning and volume 2024-01-17 20:44:32 +01:00
smallmodel
ad917d96c8
Use roundf() for more clarity 2024-01-17 19:33:07 +01:00
smallmodel
1fd7bd3fa5
Fixed MP3 loading and improperly configured channels 2024-01-16 20:54:41 +01:00
smallmodel
1234bd89c7
Fixed wrong configstring for the soundtrack 2024-01-16 20:54:10 +01:00
smallmodel
187ee87f10
Make sure to initialize new sound system 2024-01-16 20:28:13 +01:00
smallmodel
5ae88b816d
Initialize pSoundAlias to NULL 2024-01-16 20:27:56 +01:00
smallmodel
3418691f88
Added S_NeedFullRestart and S_ReLoad 2024-01-16 20:27:43 +01:00
smallmodel
4e8a51db81
Fixed Wav not loading properly 2024-01-16 20:27:32 +01:00
smallmodel
2629ef17c3
Made snd_codec c++ aware 2024-01-16 20:27:20 +01:00
smallmodel
9b63625c2b
Add snd_codec 2024-01-16 20:27:10 +01:00
smallmodel
970d72cf07
Implemented snd_openal_new.cpp 2024-01-15 23:04:25 +01:00
smallmodel
d88870bc04
Added more exports 2024-01-15 23:04:13 +01:00
smallmodel
9b35e13923
Added qalGetSourceiv / qalGetBufferfv 2024-01-15 23:04:01 +01:00
smallmodel
032eb11cfb
Implemented various methods 2024-01-12 00:04:36 +01:00
smallmodel
9ea7b77231
Added channel flags and loopsound flags 2024-01-12 00:04:20 +01:00
smallmodel
318dc18891
Added MAX_OPENAL_POSITION_CHANNELS 2024-01-10 23:03:03 +01:00
smallmodel
8d327cd0a0
Added more SFX flags and exports 2024-01-10 23:02:30 +01:00
smallmodel
d3de937ee0
Added FS_CorrectCase 2024-01-10 19:45:53 +01:00
smallmodel
3be1673eb9
Added boolean sound DMA variables 2024-01-10 19:32:44 +01:00
smallmodel
13f23ace76
Added macros for more clarity 2024-01-09 23:30:29 +01:00
smallmodel
26c50f15dc
Added s_volume and sfx exports + added load_sfx_info() declaration 2024-01-09 23:28:28 +01:00
smallmodel
46aa58d0cd
Made qal.h C++ aware 2024-01-09 23:28:01 +01:00
smallmodel
aac9dd40de
Add USE_OPENAL=1 definition when USE_SOUND_NEW is defined 2024-01-09 23:27:51 +01:00
smallmodel
71dba1b7dc
Added snd_info.cpp 2024-01-08 23:25:48 +01:00
smallmodel
8b85e4e075
Export number_of_sfx_infos and sfx_infos 2024-01-08 23:25:41 +01:00
smallmodel
028489d673
Implemented snd_mem_new.c 2024-01-08 23:15:12 +01:00
smallmodel
5c4c14a17d
Added SFX flags 2024-01-08 23:15:09 +01:00
smallmodel
2e10a96d11
Crosshair must always be shown in 1.11 and below regardless of the property 2024-01-08 23:05:21 +01:00
smallmodel
09ad42ba47
Fixed players not being able to use while firing, below 2.0 2024-01-08 22:56:26 +01:00
smallmodel
88ccaee5cc
Implemented C++ sound DMA 2024-01-08 20:07:26 +01:00
smallmodel
e936a0b995
Added more declarations 2024-01-08 20:03:25 +01:00
smallmodel
ff5b0b7607
Added snd_mem_new.c 2024-01-08 19:43:47 +01:00
smallmodel
edd2fd5e63
Renamed aarch64 to arm64 2024-01-08 18:37:33 +01:00
smallmodel
08d97e0277
Added snd_miles source files 2024-01-07 23:50:02 +01:00
smallmodel
21d0675035
Using vec3_t instead of a pointer to float 2024-01-07 23:42:32 +01:00
smallmodel
1dfb81917c
Added public driver functions 2024-01-07 23:38:57 +01:00
smallmodel
af8c92f090
Added public OPENAL driver declarations 2024-01-07 23:36:32 +01:00
smallmodel
04e0242422
Added source files for OpenAL FAKK (unimplemented) 2024-01-07 20:10:53 +01:00
pryon
110ffc3a01
Implement UIField (#90)
* Implement UIField

* Formatting and naming fixes

- Ran clang-format on previously modified files
- Replaced ifdef guards with `#pragma once`
- Changed wording in comments above OPM-only changes for easier searchability
2024-01-04 23:51:16 +01:00
smallmodel
6b4a8bd627
Fixed jumpstart modheight not working on AA 2024-01-02 23:32:06 +01:00
smallmodel
0d851fdb68
Players now get correct weapons depending on the target game version 2024-01-02 18:38:21 +01:00
smallmodel
5064f2c16d
Added g_target_game 2024-01-02 18:30:46 +01:00
smallmodel
ac46d0eef0
Added sv_minplayers variable 2024-01-02 18:14:13 +01:00
smallmodel
70c71b69ee
Added a feature to let each team have their own objective location 2024-01-02 00:52:25 +01:00
smallmodel
4487113c58
Fixed dlight image name 2024-01-01 23:52:38 +01:00
smallmodel
983f5b9ca4
Fixed UI sounds 2024-01-01 23:17:09 +01:00
smallmodel
13612d3de9
r_fastdlights is not a cheat-protected cvar 2024-01-01 22:52:08 +01:00
smallmodel
6317ca7183
Fixed the origin of cone emitters 2024-01-01 22:33:05 +01:00
smallmodel
2b96aac1c8
PointToSelectionPoint: the p parameter must be a constant 2024-01-01 21:57:49 +01:00
smallmodel
a6b75aefa4
Implemented UIMultiLineEdit 2024-01-01 20:34:50 +01:00
smallmodel
7dc72b435e
Formatted multiline edit source file 2024-01-01 15:57:44 +01:00
smallmodel
5a586f4700
Implemented UIHorizScroll 2024-01-01 15:45:40 +01:00
smallmodel
ef50a5f2cd
Prepared UIHorizScroll for implementation 2024-01-01 15:01:23 +01:00
smallmodel
c2c3f6aa1b
Implemented miniconsole 2024-01-01 14:53:16 +01:00
smallmodel
9c8ca98e68
Added anisotropic filtering 2024-01-01 14:25:02 +01:00
smallmodel
3a18c9f327
Fixed PrintJustified virtual parameter 2024-01-01 01:53:23 +01:00
smallmodel
9438f6497d
Added partial implementations 2024-01-01 01:50:10 +01:00
smallmodel
5c3c3f8e70
Finished View3D implementation (implemented PrintSound, LocationPrint, DrawSubtitleOverlay, and CenterPrint) 2024-01-01 01:42:44 +01:00
smallmodel
3d3c99cd22
Formatted cl_uiview3d source files 2024-01-01 00:32:31 +01:00
smallmodel
b3464e620e
Updated features implementation 2023-12-31 23:43:30 +01:00
smallmodel
72a38b0b68
Implemented UIDialog 2023-12-31 23:43:22 +01:00
smallmodel
46e7f29820
Fixed dialog bad cancel command 2023-12-31 23:43:05 +01:00
smallmodel
cb36015a38
Updated features implementation 2023-12-31 23:15:22 +01:00
smallmodel
66cb10a3bf
Added a fix that reset the viewangles if it is NaN 2023-12-31 23:14:22 +01:00
smallmodel
bfdd99a028
Added m_parent to get values from parent 2023-12-31 23:13:24 +01:00
smallmodel
63ef75222e
Added isVirtual and getVirtualScale 2023-12-31 23:12:40 +01:00
smallmodel
072ba0a38f
Fixed fullbright light not setting the colors correctly 2023-12-31 22:15:19 +01:00
smallmodel
576869bda0
Fixed UIFakkLabel::Draw() implementation 2023-12-31 22:02:59 +01:00
smallmodel
0d556b1b40
Implemented cl_invrender 2023-12-31 22:02:47 +01:00
smallmodel
0cd217b484
Fixed RB_Sphere_SetupGlobals() setting up sphere in leafs when there is no world loaded 2023-12-31 21:53:13 +01:00
smallmodel
907255837e
Added INV_ALIGN_NONE 2023-12-31 15:35:00 +01:00
smallmodel
ebf33349a3
Added EV_ClearInvItemReference declaration 2023-12-31 15:34:53 +01:00
smallmodel
ea6920b711
Added CL_Key_ForceCommand 2023-12-31 15:34:45 +01:00
smallmodel
53a47d470a
Implemented cl_inv 2023-12-31 14:19:57 +01:00
smallmodel
7fe7b6ce79
Formatted cl_inv* source files 2023-12-31 13:32:46 +01:00
smallmodel
0110704abd
Fixed after a map change when setting sv_maxclients 2023-12-31 01:17:16 +01:00
smallmodel
aca23fc62f
Fixed call vote button not working 2023-12-31 01:01:38 +01:00
smallmodel
c0a284927e
Fixed vote item name being empty 2023-12-31 00:53:26 +01:00
smallmodel
2d911c37a4
Added vote commands for cgame 2023-12-31 00:39:43 +01:00
smallmodel
1e7af27227
Fixed DM map selection having the incorrect map path 2023-12-31 00:38:41 +01:00
smallmodel
06678a8b0a
Added UI_MultiplayerMainMenuWidgetsUpdate from mohaas/mohaab 2023-12-31 00:38:22 +01:00
smallmodel
e1706610c4
Fixed versions for mohaas server 2023-12-30 23:52:25 +01:00
smallmodel
7bb940d819
Implemented LAN game list 2023-12-30 23:03:56 +01:00
smallmodel
b4e0120428
Using ioquake3 code for IPv6 support and network fixes 2023-12-30 23:03:49 +01:00
smallmodel
db1013d926
Use clc.connectStartTime instead of clc.connectTime 2023-12-30 22:59:57 +01:00
smallmodel
759dacd345
Added com_gamename 2023-12-30 21:36:54 +01:00
smallmodel
903fd28953
set cls.bNewLocalServerInfo to tell when there are new local servers 2023-12-30 21:10:27 +01:00
smallmodel
6c520babf0
Make sure to register the material for each GetMaterial() call 2023-12-30 21:09:23 +01:00
smallmodel
9bb2fda6df
Fixed events declaration 2023-12-30 19:50:15 +01:00
smallmodel
d48b37ece1
Implemented UIGlobalGameList 2023-12-30 19:18:59 +01:00
smallmodel
f4164e84e1
Made fields and methods protected instead of private 2023-12-30 19:18:54 +01:00
smallmodel
33aabadaf5
Implemented FAKK Load game class 2023-12-30 19:09:48 +01:00
smallmodel
e815fda908
Fixed save's comment being set to the filename 2023-12-30 19:09:31 +01:00
smallmodel
fe04adee1d
Formatted source files 2023-12-30 17:36:01 +01:00
smallmodel
115647a8c0
Use ApplyPlayerModel/GetPlayerModel from mohaab 2.40 2023-12-30 17:23:30 +01:00
smallmodel
ddd70eadf6
Exported PM_FilenameToDisplayname and PM_DisplaynameT 2023-12-30 17:23:11 +01:00
smallmodel
319e00214e
Refactored DeactivateCurrentSmart 2023-12-30 17:11:25 +01:00
smallmodel
6bdcfc2b6f
Fixed PassEventToWidget improperly passing events to widgets not matching the name 2023-12-30 17:11:12 +01:00
smallmodel
ae0a2238da
Set mouse position with player model 2023-12-30 16:55:06 +01:00
smallmodel
a69f9fe88b
Implemented UI player model picker 2023-12-30 16:54:57 +01:00
smallmodel
696b57f990
Formatted uWinMan source file 2023-12-30 16:54:46 +01:00
smallmodel
998c1b78c7
Added all picker models from mohaa 1.0 up to mohaab 2.40 2023-12-30 14:10:06 +01:00
smallmodel
8c207f094d
Implemented PMPickerItem and added name parameter to FileSelected/FileChosen methods 2023-12-30 02:22:41 +01:00
smallmodel
09c9c0ef51
Added UI map rotation from BT 2.40 2023-12-30 01:59:03 +01:00
smallmodel
8cd571c96c
Implemented all UIListBox methods and implemented Draw() from BT 2.40 2023-12-30 01:50:12 +01:00
smallmodel
979af2925d
Fixed hide commands and show commands not executing properly 2023-12-30 01:09:11 +01:00
smallmodel
f092eab842
Added InsertItem() and setCurrentItem() for UIListBox 2023-12-30 00:03:21 +01:00
smallmodel
3d4832ca85
Formatted uilistbox source files 2023-12-30 00:01:14 +01:00
smallmodel
b120fc6f2f
Fixed sorting being wrong 2023-12-29 23:03:08 +01:00
smallmodel
c299ad92aa
Improver UI_DMMapSelect_f for SH/BT 2023-12-29 22:06:49 +01:00
smallmodel
956cd59385
Implemented MP map picker 2023-12-29 22:06:36 +01:00
smallmodel
acbd802790
Make COM_IsMapValid always return true from now 2023-12-29 21:59:23 +01:00
smallmodel
c4bcecf5e0
Added COM_IsMapValid 2023-12-29 21:24:23 +01:00
smallmodel
09949251ac
Implemented cl_uisoundpicker 2023-12-29 20:23:42 +01:00
smallmodel
43218f1685
Use a const str& reference 2023-12-29 20:19:28 +01:00
smallmodel
eb7d01b3e7
Implemented cl_uimaprunner 2023-12-29 20:18:04 +01:00
smallmodel
c58e6d58b4
Filter "_sml" maps for maplist 2023-12-29 20:05:36 +01:00
smallmodel
3a892e1a47
Implemented file picker class 2023-12-29 20:05:29 +01:00
smallmodel
5bb487e1fa
Set default parameter for fontname 2023-12-29 20:04:57 +01:00
smallmodel
4ae091be4b
Added a slash at the end of the scripts folder name 2023-12-29 19:56:34 +01:00
smallmodel
7654ab6be6
FS_ListFilteredFiles: Fixed subdirectory listing and added support for searching multiple extensions 2023-12-29 19:56:23 +01:00
smallmodel
193cc9dc10
Added FS_FileTime (unimplemented) 2023-12-29 18:59:06 +01:00
smallmodel
a6d268e1a1
Added subdirectory and directory search support for FS_ListFilteredFiles 2023-12-29 18:27:41 +01:00
smallmodel
7822e94e61
Formatted picker source files 2023-12-29 14:38:55 +01:00
smallmodel
eb663fdbc1
Fixed a crash due to subtitle when there is no player 2023-12-28 21:08:07 +01:00
smallmodel
c738a40c05
Fixed links 2023-12-28 21:03:58 +01:00
smallmodel
2ca3443b7f
Moved Playing with bots section to getting_started_running.md doc 2023-12-28 21:02:05 +01:00
smallmodel
06be4c03fa
Use htmlpreview to open the g_allclasses.html file 2023-12-28 20:59:43 +01:00
smallmodel
32d77f4a7d
Split README into multiple docs 2023-12-28 20:54:05 +01:00
smallmodel
d217b1d561
Fixed some events having wrong parameters for documentation 2023-12-28 20:50:47 +01:00
smallmodel
0167f0a3a4
Using Added in OPM comments 2023-12-28 20:35:33 +01:00
smallmodel
4304ad0faa
Fixed weapon attachment not correcting properly 2023-12-28 19:16:54 +01:00
smallmodel
3be17376e4
Fixed wrong landmine defuse direction 2023-12-28 18:55:43 +01:00
smallmodel
0b4fd4c17e
Fixed isabandoned returning 1 if the player has a landmine 2023-12-28 18:53:32 +01:00
smallmodel
66c4499b2e
Fixed ScriptThreadLabel::Execute with other/owner param 2023-12-28 18:30:15 +01:00
smallmodel
cde13177a4
Don't set the ground entity in Entity::droptofloor 2023-12-28 18:22:10 +01:00
smallmodel
9fce2575ab
Commented out the code that makes triggers only respond to killed/activate messages 2023-12-28 18:21:58 +01:00
smallmodel
8f8e92c8c3
Don't cound the number of shots if the owner is the world 2023-12-28 17:47:18 +01:00
smallmodel
8683d317fe
Set origin2 and player's num shots fired when placing landmine 2023-12-28 17:45:53 +01:00
smallmodel
1178c619bc
Fixed variables not being restored properly 2023-12-28 17:31:36 +01:00
smallmodel
2fa568eb01
CL_KeyEvent must not handle GUI mouse events, as it's the job of the UIWindowManager 2023-12-28 17:26:32 +01:00
smallmodel
d62242d653
use PRINT_WARNING instead of PRINT_DEVELOPER when an image couldn't be found 2023-12-28 17:25:51 +01:00
smallmodel
991bf2f1f5
Fixed m_firstResponder being nulled out in UIWindowManager::getFirstResponder() 2023-12-28 17:21:56 +01:00
smallmodel
2f241343ff
Don't accept the bind for null and pause keys 2023-12-28 17:21:32 +01:00
smallmodel
035de09c15
Formatted cl_keys.cpp source file 2023-12-28 17:21:02 +01:00
smallmodel
d3a4407391
Make sure to not service a view event if the first responder is NULL 2023-12-28 13:04:29 +01:00
smallmodel
395c16ce24
Fixed bind label selection 2023-12-28 12:50:40 +01:00
smallmodel
f7accc01ad
Fixed bind selection and highlight 2023-12-28 12:47:27 +01:00
smallmodel
3733154e63
Fixed alternate binding not working properly 2023-12-28 01:29:46 +01:00
smallmodel
2ef95ddba9
Fixed improper binding and text location 2023-12-28 01:29:33 +01:00
smallmodel
043f8cba22
Implemented UIFakkBindList and UIFakkBindListLabel 2023-12-28 01:12:43 +01:00
smallmodel
09ab172630
Added UIBindButton events 2023-12-28 01:12:19 +01:00
smallmodel
c23a182bec
Added bindlistener events 2023-12-28 01:11:17 +01:00
smallmodel
c321470382
Implemented CL_LoadBind 2023-12-27 22:53:49 +01:00
smallmodel
932bdd402c
Implemented UIBindButton 2023-12-27 22:47:01 +01:00
smallmodel
3692671f49
Implemented bind_t and bindlistener 2023-12-27 20:19:58 +01:00
smallmodel
1cd4c35a79
Bumped version number 2023-12-27 18:54:57 +01:00
smallmodel
c0f7a48649
Formatted ui source files 2023-12-27 18:54:20 +01:00
smallmodel
c1258f160b
Do not clear sv_fps cvar when restarting/switching map 2023-12-27 18:43:37 +01:00
smallmodel
bdb9feb7c5
Updated README 2023-12-27 18:18:45 +01:00
smallmodel
830cbe7af2
Fixed issues with animation when sv_fps was above 20 2023-12-27 18:04:41 +01:00
smallmodel
4eb83c0766
Fixed weapon attachments not being detached 2023-12-27 16:29:00 +01:00
smallmodel
210f2fef77
Formatted source file 2023-12-27 16:28:28 +01:00
smallmodel
d19a6160d2
Call SetWeaponAnim() instead of NewAnim() for weapon animation 2023-12-27 16:25:37 +01:00
smallmodel
cd773cf73f
Set last active weapon only if the weapon is not an inventory item 2023-12-27 16:13:12 +01:00
smallmodel
f3b9a10f7a
Detach weapons already attached to the attach tag only if the current weapon attach tag is valid 2023-12-27 15:54:55 +01:00
smallmodel
709283ff33
Fixed MAX_ACTIVE_WEAPONS check (out of bounds) 2023-12-27 15:49:33 +01:00
smallmodel
fae261d7da
UI game message fix 2023-12-27 15:43:28 +01:00
smallmodel
6b5e527b6b
Fixed callvote line breaks 2023-12-27 15:38:17 +01:00
smallmodel
b7005a310e
Fixed callvote still executing kick with an invalid player 2023-12-27 15:14:08 +01:00
smallmodel
edd25b9264
Readded support for supporting configstrings in multiple chunks 2023-12-27 15:13:42 +01:00
smallmodel
65a8b03ee4
Fixed infinite loop in SV_SendConfigstring when sending multiple chunks 2023-12-27 15:13:17 +01:00
smallmodel
0044ec0ac0
Increased MAX_CMD_LINE for testing purposes 2023-12-27 15:11:17 +01:00
smallmodel
73111d854d
Fixed an infinite loop bug when selecting the previous/next weapon 2023-12-27 14:07:57 +01:00
smallmodel
065ab98175
Added a comment in CondMinChargeTime about the crash fix 2023-12-27 14:07:34 +01:00
smallmodel
cbeaeba828
Use IsSubclassOfWeapon() and IsSubclassOfPlayer() 2023-12-27 14:06:22 +01:00
smallmodel
7af2a9444e
Updated paragraph about bug reports 2023-12-26 18:40:54 +01:00
smallmodel
f476f3690a
Another README update 2023-12-26 12:22:37 +01:00
smallmodel
fae02da4b1
Updated README 2023-12-26 12:14:38 +01:00
smallmodel
b0e4e29ce3
Merge pull request #88 from pryon/misc-fixes
Misc fixes
2023-12-20 19:34:26 +01:00
pryon
11f7728b9d Move strdup'd string cleanup to uipopup_describe's dtor 2023-12-20 17:52:02 +01:00
pryon
7510b05d25 Properly free memory allocated by strdup calls 2023-12-18 19:56:26 +01:00
pryon
e467f91262 Fix pulldown menu labels showing raw cvar values 2023-12-18 17:49:01 +01:00
pryon
b03afb899d Add thirdparties dir and generated parser/lexer files to .gitignore 2023-12-18 17:46:52 +01:00
pryon
ec71ff3c3c
Implement UIPopupMenu (#87)
* Implement UIPopupMenu

* Use `std::fmax` for floats
2023-12-17 22:51:18 +01:00
smallmodel
02ce50ace2
Treat "not all control paths return a value" warning as an error 2023-12-07 18:32:10 +01:00
smallmodel
4a4a552a05
Fixed crash due to corrupted stack values 2023-12-07 18:04:57 +01:00
pryon
5b3615d262
Implement UIPulldownMenuContainer (#86)
* Implement UIPulldownMenuContainer

* Review suggestions:
 - remove unnecessary extern declarations
 - add comment about a possible memleak
2023-12-05 23:27:27 +01:00
pryon
2821488c93
Implement UIPulldownMenu (#85)
* Implement UIPulldownMenu

* Remove unnecessary value-type member initialization
2023-12-05 19:50:41 +01:00
smallmodel
9814887b10
Don't execute Git if the source directory is not a working Git repo 2023-11-29 19:04:24 +01:00
smallmodel
3f86381541
Only allow builds on branches (and not tags), as tags are built during the deployment 2023-11-29 18:18:30 +01:00
smallmodel
7736966dc1
Fixed the README 2023-11-29 18:17:14 +01:00
smallmodel
60faa9dd9b
Updated the version number 2023-11-29 17:57:47 +01:00
smallmodel
75f8f86f86
Fixed compilation error on some compilers 2023-11-29 00:08:35 +01:00
smallmodel
0ee1307e75
Fixed missing m_Thread archive 2023-11-28 20:26:40 +01:00
smallmodel
f0c38305b5
Fixed defaultEntry having a NULL value even if there are elements 2023-11-28 20:13:55 +01:00
smallmodel
e07dda6991
Fixed defaultEntry not being initialized after archiving 2023-11-28 20:10:23 +01:00
smallmodel
b10ce9a426
Added GetKey() / SetKey() in con_set's Entry, so ScriptVariable can override it and set the key appropriately 2023-11-28 19:50:19 +01:00
smallmodel
2ac2800ecb
Only archive used variables on the local VM stack 2023-11-28 19:14:09 +01:00
smallmodel
e59200a7de
Fixed cSpline archiving bad values 2023-11-27 20:35:23 +01:00
smallmodel
a7902a8837
Added FollowPathRelativeYaw and NormalAngles 2023-11-27 20:30:36 +01:00
smallmodel
615726cc75
Added FollowPathRelativeYaw 2023-11-27 20:22:37 +01:00
smallmodel
839abf6076
Added missing variables to archive 2023-11-27 20:20:00 +01:00
smallmodel
c7c8d4580d
Added missed archived variables and using a ScriptThreadLabel instead of an event for the killed handler 2023-11-27 20:07:57 +01:00
smallmodel
2cc47e10f9
Added missing iNextLandTime archived variable 2023-11-27 20:06:19 +01:00
smallmodel
8fc5dacebf
Removed bBindChilds unused variable + added more variables to archive 2023-11-27 20:06:05 +01:00
smallmodel
cb23f3bb70
Added missing weapon_class archived variable 2023-11-27 20:05:36 +01:00
smallmodel
d7350d8629
Added Clear() method in ScriptThreadLabel 2023-11-27 20:05:21 +01:00
smallmodel
ac6b5ef1f7
Fixed wrong area portal writing 2023-11-27 19:37:29 +01:00
smallmodel
7fdd26c59e
Added m_fHealRate archived variable 2023-11-27 19:37:26 +01:00
smallmodel
fad555308b
Archive ScriptVM and ScriptThread appropriately 2023-11-27 19:30:40 +01:00
smallmodel
969255c48e
Fixed areaPortals being broken after reading from archive 2023-11-26 20:44:21 +01:00
smallmodel
433305617c
IsAlive: check if the given listener is an actual entity 2023-11-26 20:38:14 +01:00
smallmodel
5418d84c7e
Fixed m_fpsTiki being uninitialized when archiving 2023-11-26 20:36:23 +01:00
smallmodel
cca37e3dfe
Added and using SAVEGAME_STRUCT_VERSION 2023-11-26 20:33:07 +01:00
smallmodel
0e9d83ee14
Added a check to debug the total of archived items 2023-11-26 20:31:58 +01:00
smallmodel
ecbf7f6caa
Fixed Archive method not calling parent class archive method 2023-11-26 20:00:12 +01:00
smallmodel
5a3638fa68
Better for loop clarity 2023-11-26 19:55:07 +01:00
smallmodel
111088b540
Formatted document 2023-11-26 19:54:07 +01:00
smallmodel
ba1703ebf0
When loading an entity from archive, set the model only if the entity allows model to be archived 2023-11-26 19:49:51 +01:00
smallmodel
825df20a72
Fixed game being stuck on mission stats screen in single-player 2023-11-26 19:30:54 +01:00
smallmodel
0a42fd79d2
Clear radar on cgame shutdown 2023-11-26 19:30:28 +01:00
smallmodel
e50a041c12
SimpleEntity subclass flags name now starts with ECF_ prefix 2023-11-16 23:17:06 +01:00
smallmodel
ce0e9fe77e
Added portable turret anim blends + fixed anim blends 2023-11-16 23:03:04 +01:00
smallmodel
5105dcce04
Updated version patch number 2023-11-15 23:17:37 +01:00
smallmodel
58b4a9a676
Added bullet alpha (from moh 2.0 and above) 2023-11-15 21:02:34 +01:00
smallmodel
1146c834fb
Fixed bad bullet coords being sent 2023-11-15 21:02:23 +01:00
smallmodel
9068264132
Make sure to remove the view model and detach the player when the turret gun is being removed 2023-11-15 20:42:16 +01:00
smallmodel
59ac8ea437
Clear the partial immobile flag when initializing the player's physics 2023-11-15 20:41:41 +01:00
smallmodel
afafacaeec
Fixed bullet tracer issues with multiple bullets 2023-11-15 20:41:35 +01:00
smallmodel
baf451d2a2
Cleaned up bg_public 2023-11-15 20:39:09 +01:00
smallmodel
d588012168
Don't use ANIM_MASK 2023-11-15 19:45:58 +01:00
smallmodel
a3ed25cb2e
Use WEAPON_CLASS_ITEM1 instead of raw 256 constant value 2023-11-15 19:36:29 +01:00
smallmodel
c399f45841
Weapon::SetItemSlot() fixed missing bitwise negate 2023-11-15 19:36:09 +01:00
smallmodel
6a6eeae4ee
Updated README 2023-11-14 18:53:40 +01:00
smallmodel
65f36505d1
Updated README 2023-11-14 18:05:50 +01:00
smallmodel
b852980842
Fixed bullet tracer speed 2023-11-14 17:55:08 +01:00
smallmodel
d351ced78b
Added comment for sv_pure 2023-11-14 17:54:53 +01:00
smallmodel
4cd45c63c4
Return fs_gamedir in FS_GetCurrentGameDir() 2023-11-14 17:39:12 +01:00
smallmodel
de16a72aed
Using droperror instead of print 2023-11-14 17:31:49 +01:00
smallmodel
4b29c63fc9
Added ioq3 features like bans 2023-11-14 17:30:17 +01:00
smallmodel
770e832592
Added Com_strCompare and player name completion 2023-11-14 17:17:36 +01:00
smallmodel
14f9acdb57
Fixed "spin" event name 2023-11-14 14:09:52 +01:00
smallmodel
573a6f5bd5
Updated README 2023-11-14 14:06:57 +01:00
smallmodel
8c64b7aa89
Clear charge start time on respawn 2023-11-14 14:06:39 +01:00
smallmodel
8d49f8935c
Added mode parm for IS_WEAPONCLASS_READY_TO_FIRE
This fixes issues with animation being stuck on secondary grenade charge
2023-11-14 14:04:37 +01:00
smallmodel
ff8ec63e95
Call IsRepeatType() instead of checking the animFlags 2023-11-14 14:03:23 +01:00
smallmodel
771ee1b5a9
Forward-declare Event and Listener to omit some warnings 2023-11-14 01:08:09 +01:00
smallmodel
096692fec8
Fixed usage of 2D vector array 2023-11-14 01:07:23 +01:00
smallmodel
d29454b44d
Use %zu instead of %d 2023-11-14 01:06:52 +01:00
smallmodel
30a1ccb2e2
Made stateString const char* 2023-11-14 01:04:22 +01:00
smallmodel
ea1b411cc0
Forward-declare skelHeaderGame_s and skelAnimFrame_s to omit some warnings 2023-11-14 01:02:27 +01:00
smallmodel
7794ee8aea
Mark Archive() method 'override' 2023-11-14 00:54:20 +01:00
smallmodel
99a9022b53
Fixed Italian player not switching to the Breda weapon after spawning 2023-11-14 00:50:35 +01:00
smallmodel
1255964e6b
Added a fix that prevent players from equipping weapons from the other team 2023-11-14 00:49:32 +01:00
smallmodel
37de859bee
Fixed field var breaking code position on exception 2023-11-14 00:16:09 +01:00
smallmodel
990aa5cdb2
Initialize m_iBadPlaceIndex to 0 2023-11-14 00:06:26 +01:00
smallmodel
befcedcf58
Fixed OPCODE_STORE_FIELD_REF incorrectly not skipping field on exception
It would cause invalid opcode afterwards.
2023-11-14 00:06:23 +01:00
smallmodel
eeb697570d
Fixed collapse index still being processed with SKB files (would cause crashes) 2023-11-14 00:04:42 +01:00
smallmodel
6410567e9a
Initialize obfuscation mapping (still unimplemented) 2023-11-13 23:44:04 +01:00
smallmodel
bde7242cc7
Added more screenshots 2023-11-13 23:31:22 +01:00
smallmodel
e8aad97975
Fixed alignment issue on ARM CPUs 2023-11-13 23:28:42 +01:00
smallmodel
0662359776
Implemented DamageEvent() / EventGetActivator()
For example, the script in the training map waittill damage on the crate's trigger for bullets, DamageEvent() will unregister the damage event
2023-11-13 22:20:16 +01:00
smallmodel
5568d160ab
Fixed uninitialized shader variable in CG_DrawCrosshair() 2023-11-13 22:18:38 +01:00
smallmodel
defa297a56
Fixed debug lines being always drawn 2023-11-13 20:39:03 +01:00
smallmodel
782c37c4fe
Updated version number 2023-11-13 20:38:49 +01:00
smallmodel
6f03c88ad5
Formatted playerbot source file 2023-11-13 20:33:06 +01:00
smallmodel
3ec980c8ec
Fixed bots being blocked 2023-11-13 20:31:50 +01:00
smallmodel
c0a50eb2ff
Fixed infinite spectator switch loop 2023-11-13 20:31:41 +01:00
smallmodel
f73e4b6f22
Check if the turret is valid before detaching remote owner 2023-11-13 20:30:51 +01:00
smallmodel
096972827e
Fixed half of archived entities being deleted during restart 2023-11-13 19:35:46 +01:00
smallmodel
08c040d4ea
Reset smoke sprites during restart 2023-11-13 19:34:13 +01:00
smallmodel
6d8b6b5f29
Fixed objectives text 2023-11-13 19:25:52 +01:00
smallmodel
410f1c0ed8
Only include listener.h when compiling C++ 2023-11-13 18:36:20 +01:00
smallmodel
cb73cfd57b
Fixed "unknown game mode" error 2023-11-13 18:23:26 +01:00
smallmodel
8cb8a7f370
Fixed objectives being wrong 2023-11-13 18:23:15 +01:00
smallmodel
8c893acfff
Don't spawn the initial player if the game isn't single-player 2023-11-13 18:23:01 +01:00
smallmodel
e453d1fa17
Added "none" for teamwin argument 2023-11-13 18:22:35 +01:00
smallmodel
a7301ed7b6
Fixed teamwin not working on TOW and Liberation 2023-11-13 18:21:08 +01:00
smallmodel
42ebfd5394
Added ScriptSimpleStrafingGunfire and ScriptAimedStrafingGunfire from moh 2.0 and above 2023-11-13 17:46:33 +01:00
smallmodel
cdf2f84b14
Added ScriptModelRealDamage class 2023-11-13 16:33:11 +01:00
smallmodel
2592aeab8b
Fixed improper bullet path on wood and metal 2023-11-13 01:21:08 +01:00
smallmodel
34d4225ea0
Trigger must have CONTENTS_CLAYPIDGEON content mask set if it has DAMAGE spawnflag set when setting the model 2023-11-13 01:20:19 +01:00
smallmodel
17dcb4b00e
Entity's clipmask must be MASK_SOLID 2023-11-13 00:58:33 +01:00
smallmodel
eb1d096539
Fixed vehicle turret gun indefinitely shaking 2023-11-13 00:35:55 +01:00
smallmodel
05c74655be
Fixed SimpleActor::SetPath not setting path correctly 2023-11-13 00:35:32 +01:00
smallmodel
3e0e0ba3b1
Fixed FindCover() wrong algorithm 2023-11-13 00:35:11 +01:00
smallmodel
f90b6cd18c
Fixed State_Turret_Wait() not checking if enemy can shoot, and fixed last enemy visible time not being set 2023-11-13 00:34:26 +01:00
smallmodel
f0ecfcb708
Updated README 2023-11-12 21:51:09 +01:00
pryon
177702d027
Implement UISlider (#79)
* Implement UISlider

* Use proper enum type for the left and right arrow key constants
2023-11-12 16:39:22 +00:00
pryon
64429232f8
Add missing virtual calls to UIList methods (#80)
* Add missing virtual calls to UIList methods

* Add missing virtual call in UICheckBox::Draw
2023-11-12 16:39:04 +00:00
smallmodel
d6b7fecb69
Refactored navigation with moh 2.0 features 2023-11-09 23:44:53 +01:00
smallmodel
51a0ee56aa
Refactored FindNearestSniperNode() 2023-11-09 21:55:28 +01:00
smallmodel
2ed369568c
Fixed AllocPathNode() and FreePathNode() not working as intended 2023-11-09 21:10:43 +01:00
smallmodel
e5b7e16d1a
Added AI_CONCEALMENT_MASK and use AI_LOW_WALL_ARC 2023-11-09 21:10:20 +01:00
smallmodel
4a9f676d5d
Tidied up FindPathX methods 2023-11-09 21:01:30 +01:00
smallmodel
0e0da3d767
Added MASK_CORNER_NODE 2023-11-09 21:01:03 +01:00
smallmodel
343ce4a6a7
Using vec3_t type for start/end/position 2023-11-09 19:58:46 +01:00
smallmodel
df8b854cb7
Cleaned up GeneratePath methods 2023-11-09 19:52:53 +01:00
smallmodel
831dc770d8
Added droptofloor() 2023-11-09 19:37:25 +01:00
smallmodel
8a9285c64f
Cleaned up navigate source files and added low-wall arc 2023-11-09 19:31:20 +01:00
smallmodel
7e4e06b09d
Fixed FinishReloading not working properly 2023-11-08 22:24:07 +01:00
smallmodel
96748b3fbc
Fixed vote's last text position 2023-11-07 23:06:11 +01:00
smallmodel
f1325048e9
Fixed crosshair's endpos friend test 2023-11-07 23:05:54 +01:00
smallmodel
deee21eb68
Fixed vote string alignment position 2023-11-07 23:02:07 +01:00
smallmodel
2f43e5c5ea
Fixed crosshair friend icon on mohaa 1.11 2023-11-07 23:01:49 +01:00
smallmodel
4766067edb
Fixed crosshair incorrectly hiding 2023-11-07 22:54:05 +01:00
smallmodel
bc54f22639
Crosshair is now handled by the cgame module 2023-11-07 22:44:13 +01:00
smallmodel
20c8c87e79
Draw vote and crosshair 2023-11-07 22:43:13 +01:00
smallmodel
3a5dcd6a3c
Increased MAX_BUFFERS 2023-11-07 22:34:04 +01:00
smallmodel
a5ba02c2bb
Added crosshair variables 2023-11-07 19:30:46 +01:00
smallmodel
e1554efc08
Fixed paused icon location 2023-11-07 19:20:52 +01:00
smallmodel
9d652dd41b
Unpause if the game module doesn't allow pausing 2023-11-07 19:20:40 +01:00
smallmodel
22eadf2c08
Removed code that prevent pausing in debug builds 2023-11-07 19:20:26 +01:00
smallmodel
d3f1b62208
Added pause command 2023-11-07 19:20:07 +01:00
smallmodel
affc28ab79
Removed win32/unix folders (unused) 2023-11-07 18:57:34 +01:00
smallmodel
41be7f44ab
Added comment 2023-11-06 20:45:57 +01:00
smallmodel
646c1f0f16
Fixed lightorigin and attach offset being badly calculated 2023-11-06 19:58:36 +01:00
smallmodel
3cea097b48
Added EV_Turret_SetMaxUseAngle and EV_Turret_SetStartYaw to TurretGun's event responses 2023-11-06 19:41:34 +01:00
smallmodel
786d72575e
Fixed buggy sky rendering 2023-11-06 19:32:49 +01:00
smallmodel
6d9a794aaf
Fixed assertion failed when numskins equals MAX_TIKI_SHADER 2023-11-06 19:17:03 +01:00
smallmodel
9e69df1e94
Check for valid model and anim num in **TIKI_Anim_NameForNum()** 2023-11-06 19:09:06 +01:00
smallmodel
72d4bb0206
Added more checks to avoid crashes 2023-11-06 18:59:18 +01:00
smallmodel
f68e06a949
Use MAX_TIKI_ALIASES instead of the constant number (4095) 2023-11-06 18:30:11 +01:00
smallmodel
f4da539d95
Use vec3_t type for coordinates/angles 2023-11-06 18:11:12 +01:00
smallmodel
17af75a9bb
Formatted TIKI source files 2023-11-06 18:08:53 +01:00
smallmodel
dcbb39d640
Formatted skeletor source files 2023-11-06 17:58:58 +01:00
smallmodel
d0ba1df4e0
G_BroadcastAIEvent: ignore non-actor and non-bots 2023-11-05 21:02:07 +01:00
smallmodel
2b92869683
Moved eAIEvent enum to entity.h 2023-11-05 21:00:41 +01:00
smallmodel
379a4b0ce4
Fixed AI not being able to open doors 2023-11-05 20:58:37 +01:00
smallmodel
d4c7d4a7e1
Avoid broadcasting to AI if the entity has notarget set 2023-11-05 20:58:25 +01:00
smallmodel
dcac24c9e2
Fixed EventStopAtEnd() incorrectly stopping the vehicle 2023-11-05 20:39:04 +01:00
smallmodel
753589d840
Made TriggerSave only trigger once 2023-11-05 20:37:37 +01:00
smallmodel
382903c9e1
Added cSpline() constructor (sets points to 0) 2023-11-05 20:09:39 +01:00
smallmodel
f29fec0b31
Formatted spline source file 2023-11-05 19:09:29 +01:00
smallmodel
f9dc37d60a
Fixed HudPrint using argument 0 instead of 1 for the message 2023-11-04 19:02:24 +01:00
smallmodel
c5e48c67bb
Return "unarmed" for item prefix/name that cannot be found 2023-11-04 19:02:08 +01:00
smallmodel
cc62ebcffc
Don't display an error for viewmodelanim fps tiki 2023-11-04 19:01:48 +01:00
smallmodel
0f36504959
Implemented vote options for cgame module 2023-11-04 18:43:10 +01:00
smallmodel
1fb8e25209
Use PRId64 and PRIu64 format specifier for sprintf in str with 64-bit int constructor 2023-11-04 00:41:06 +01:00
smallmodel
260876b1a2
Always print messages to console regardless of whether or not it's a game message / death message 2023-11-04 00:23:49 +01:00
smallmodel
e4fc074f09
Formatted cl_ui source files 2023-11-04 00:22:35 +01:00
smallmodel
7899e5161e
Add a newline at the end of dmmessage errors 2023-11-04 00:20:27 +01:00
smallmodel
95603b1142
Convert chat prefix for localization 2023-11-04 00:08:53 +01:00
smallmodel
bf8e0eb812
Other player was not receiving the private message 2023-11-04 00:05:18 +01:00
smallmodel
0c04ffc1e8
Added and implemented InfoLandmark 2023-11-03 22:10:14 +01:00
smallmodel
bd86acf118
EV_REMOVE should be -9.0 2023-11-03 22:07:43 +01:00
smallmodel
6caa16444e
Return an str for battle language instead of const char* 2023-11-03 22:00:49 +01:00
smallmodel
94d4cbeb82
Enhanced Player's dmmessage implementation (say + voice) 2023-11-03 21:56:31 +01:00
smallmodel
b31f4bc00c
Added and implemented CG_xxxVote functions 2023-11-03 21:28:46 +01:00
smallmodel
cf0808e119
Added client vote options code (partially implemented) 2023-11-03 21:09:18 +01:00
smallmodel
92333909fd
Fixed commands being executed twice 2023-11-03 20:40:45 +01:00
smallmodel
9c68af92be
Added more console commands to initialize 2023-11-02 20:23:45 +01:00
smallmodel
bc5d7f5e93
Added "reloadmap" console command from moh 2.0 and above 2023-11-02 20:20:58 +01:00
smallmodel
f2ba9a88be
Reimplemented G_ScriptCmd() 2023-11-02 20:15:08 +01:00
smallmodel
81b711364e
Use Event::Exists() instead of getting it, to see if an event exists 2023-11-02 20:14:34 +01:00
smallmodel
554e0c7fac
Formatted gamecmds source files 2023-11-02 20:07:29 +01:00
smallmodel
bd2c1c387b
Added Event::Exists() to check if a given command name exists 2023-11-02 20:05:59 +01:00
smallmodel
f19edac9ca
Fixed audio spatialization
The yaw was inverted specifically for the Miles Sound System. But as the engine was never using Miles, the yaw mustn't be inverted
2023-11-02 19:57:46 +01:00
smallmodel
1698f6d1bf
The return value of an event must be the first value 2023-11-02 19:53:26 +01:00
smallmodel
2c3180813a
Fixed improper path lookahead 2023-11-02 19:33:10 +01:00
smallmodel
a262fe5d9d
Removed pAnimThread assert as it can be NULL 2023-11-02 19:11:44 +01:00
smallmodel
a69249ee22
Fixed an issue where PathAvoidsSquadMates() would set bad coordinates for path 2023-11-02 19:11:29 +01:00
smallmodel
393c2a81d1
Check for indice bounds 2023-11-01 23:06:14 +01:00
smallmodel
3a6be342ce
Added new ScriptModel functions from mohaas 2.0 and above 2023-11-01 22:35:07 +01:00
smallmodel
6616bfe53e
Formatted document 2023-11-01 22:21:09 +01:00
smallmodel
bafe60f48f
Move must fail if the Actor wants to become a runner but the idle think state is neither Runner nor Patrol 2023-11-01 20:16:44 +01:00
smallmodel
e306c415f0
Only move the client if there is no turret or if the turret doesn't allow user's aim 2023-11-01 20:15:44 +01:00
smallmodel
56a8c8d48d
Set parm.owner, prevent to trigger non-use trigger with EV_USE, set projectile owner 2023-11-01 20:10:57 +01:00
smallmodel
421f1d39a4
SV_HitEntity must return true if something was hit 2023-11-01 20:09:46 +01:00
smallmodel
7c655944a5
Convert fields name to lower 2023-11-01 19:16:01 +01:00
smallmodel
0a27f37dc0
Set the last entity network time
This fixes Actor sometimes stuck on idle state
2023-11-01 18:03:29 +01:00
smallmodel
4695932ea1
Added StoppedNotify()
This fixes scripts waiting for another executing script which fixes Actor being stuck on some animations
2023-11-01 17:31:46 +01:00
smallmodel
7fe7a12167
In CreateThreadInternal and CreateScriptInternal, use GetScriptClass() directly from ScriptThread 2023-11-01 16:53:31 +01:00
smallmodel
f9487b0ba3
Ignore CR in source line 2023-11-01 16:53:09 +01:00
smallmodel
7c5c34741c
Added more script trace and initialize state to STATE_EXECUTION in ScriptVM constructor 2023-11-01 16:52:30 +01:00
smallmodel
d09459f4bf
Made Unpause() more explicit 2023-10-31 23:24:11 +01:00
smallmodel
c0c6598151
Actor::WeaponSound() was not properly working 2023-10-31 23:23:29 +01:00
smallmodel
f52fcc6f0e
Process the parent of each entity correctly 2023-10-31 23:22:43 +01:00
smallmodel
2e9ef64bd2
g_timescripts misspell 2023-10-31 23:21:55 +01:00
smallmodel
ff3ee39830
Fixed field name not showing in the exception message 2023-10-31 20:39:28 +01:00
smallmodel
abd757f3bc
Actor health must be above to 0 for NPC to count 2023-10-30 23:01:43 +01:00
smallmodel
c741591a36
Syntax clarity 2023-10-30 23:00:21 +01:00
smallmodel
78c481d725
Added g_shownpc support 2023-10-30 23:00:07 +01:00
smallmodel
b2ece37819
Added G_ClientDrawTags() 2023-10-30 22:59:39 +01:00
smallmodel
a557b29ecf
Removed useless SetDirty() call in ScriptMaster::SetTime() 2023-10-30 22:59:25 +01:00
smallmodel
1184843318
Set dirty timer in SetTime() 2023-10-30 22:59:04 +01:00
smallmodel
dd1f8bd92a
Compare with STATE_RUNNING instead 2023-10-30 22:46:59 +01:00
smallmodel
220c82954c
Don't execute script thread now if paused 2023-10-30 22:46:50 +01:00
smallmodel
8879bacb1d
Fixed Think_Curious() and LookAtCuriosity() small mistakes 2023-10-30 22:04:09 +01:00
smallmodel
5824022745
Added ScriptRemove 2023-10-30 22:03:37 +01:00
smallmodel
3ecb5bd06a
Fixed WaitExecuteThreadInternal() waiting on the group instead of the thread 2023-10-30 21:59:47 +01:00
smallmodel
7de31a776b
Added a check to avoid freeing a model that is used more than once 2023-10-29 20:40:37 +01:00
smallmodel
503320d13f
Added modelOnly parameter to CG_ProcessConfigString + added votes 2023-10-29 20:40:07 +01:00
smallmodel
bd263c5d22
Added condition to check for null model/animation and for out of bound animnum in TIKI_Frame_Commands() 2023-10-29 20:21:58 +01:00
smallmodel
b0201aef5d
Set number of arguments when constructing a new Event 2023-10-29 20:20:56 +01:00
smallmodel
31014808c8
Added and using AI_COVER_MASK 2023-10-29 20:20:19 +01:00
smallmodel
0906124867
Use CurrentThink() to get the current think 2023-10-28 00:01:57 +02:00
smallmodel
43bb5ce653
Fixed BroadcastEvent not returning true with 1 processed listener + Fixed UnregisterTarget not removing the name 2023-10-27 21:03:07 +02:00
smallmodel
7e66483b1a
Added g_timescripts var 2023-10-27 21:02:25 +02:00
smallmodel
f96b606a1a
Fixed ScriptThread timing 2023-10-27 21:02:18 +02:00
smallmodel
30d26c3e44
Fixed register/unregistration 2023-10-27 20:42:01 +02:00
smallmodel
57e450a745
Thread state fix 2023-10-27 20:41:47 +02:00
smallmodel
24297bf396
Added timescript in ScriptMaster::ExecuteRunning() 2023-10-27 20:02:21 +02:00
smallmodel
481cd760a9
Added ScriptTrace/GetSourcePos 2023-10-27 20:00:48 +02:00
smallmodel
6d6043775e
Use const unsigned char* for sourcepos 2023-10-27 19:59:29 +02:00
smallmodel
bb97ec8933
Added GetSourceAt() with code pos 2023-10-27 19:59:15 +02:00
smallmodel
dc028b87e4
Added const unsigned char* hashcode 2023-10-27 19:58:38 +02:00
smallmodel
0d1b7a9c8a
Added int64 support 2023-10-27 19:58:29 +02:00
smallmodel
a6e602af1d
Renamed variables in ScriptClass::RemoveThread for more clarification 2023-10-26 20:18:50 +02:00
smallmodel
04a6012e5d
Renamed thread parameters 2023-10-26 20:17:53 +02:00
smallmodel
0f7691c722
Reordered NotifyDelete switch statement for more clarity 2023-10-26 20:17:42 +02:00
smallmodel
f01a0a17c1
Added script traces 2023-10-26 20:13:07 +02:00
smallmodel
b291ab92b6
Fixed script class being always created even when a thread was started in the same group 2023-10-26 20:08:09 +02:00
smallmodel
fb4bf4fcaa
Fixed wrong value() for GetGameScript in CreateScriptInternal() 2023-10-26 20:07:49 +02:00
smallmodel
98816156d7
Delete created scriptclass / thread when there is an exception, in ScriptThreadLabel::Create() 2023-10-26 19:58:26 +02:00
smallmodel
92bfb4c426
Fixed clarity of conditions in Animate::UseSyncTime() 2023-10-26 19:57:39 +02:00
smallmodel
cac883c4a0
Drop error to main menu if an hard script exception was encountered while executing running scripts 2023-10-24 23:18:44 +02:00
smallmodel
5a4fb90c96
Fixed THINKSTATE_ATTACK animation inside ChangeAnim() + weight should be 2.0 for ChangeMotionAnim() 2023-10-24 23:16:45 +02:00
smallmodel
c4f9eb65ae
Use SetWeight() and SetOnceType() instead of setting the frameinfo directly 2023-10-24 22:55:46 +02:00
smallmodel
9f5557b33c
Initialize bHasThrowTarget 2023-10-24 22:55:22 +02:00
smallmodel
4d876fdf5d
Fixed wrong state being ended in EndState() 2023-10-24 21:35:49 +02:00
smallmodel
978666c946
AssertValidSquad() in DisbandSquadMate() 2023-10-24 21:35:16 +02:00
smallmodel
9b9fa696e8
Added Waypoint and TempWaypoint constructor to set the SimpleEntity subclass type 2023-10-24 20:37:41 +02:00
smallmodel
088b22073c
Formatted document 2023-10-24 20:36:53 +02:00
smallmodel
4f9831faa4
Formatted document 2023-10-24 20:27:18 +02:00
smallmodel
3373caa939
DebugNearestStartNode() should return a node only if node_count is higher than 0 2023-10-24 19:37:48 +02:00
smallmodel
dc1be17b2a
Added badPlaceTeam 2023-10-24 19:35:42 +02:00
smallmodel
64a3b04181
Fixed CM_SightTraceThroughBrush() implementation 2023-10-24 19:29:38 +02:00
smallmodel
57e1920b9c
G_SightTrace: only return true if the result is true 2023-10-24 19:29:20 +02:00
smallmodel
ddb6236eb9
simplified delta subtraction 2023-10-23 22:55:35 +02:00
smallmodel
4e4af590e5
Added m_pAnimThread assertion check 2023-10-23 22:55:09 +02:00
smallmodel
a249f6b29b
Fixed parm.previousthread not being actually set to the previous executing thread 2023-10-23 19:31:01 +02:00
smallmodel
7787729b24
Fixed standidentify scr file 2023-10-23 19:26:57 +02:00
smallmodel
45c8c704af
Fixed ai_debugpath having an infinite line 2023-10-23 18:58:16 +02:00
smallmodel
31fde1ad94
Unreachable node fix 2023-10-23 18:57:56 +02:00
smallmodel
bfb0fbd656
Fixed vision_distance being used even if it's 0 2023-10-23 18:57:44 +02:00
smallmodel
8afb7457c2
Fixed FindPotentialCover never setting found nodes 2023-10-23 17:28:52 +02:00
smallmodel
0ae1c8f771
Fixed origin_ratio uninitialized 2023-10-23 17:28:36 +02:00
smallmodel
6ff046ae29
When spawning pathnodes, use archived instance of pathnodes 2023-10-23 17:17:56 +02:00
smallmodel
6f9f845bb2
Set m_LoadIndex to 0 when loading archived nodes 2023-10-23 17:16:54 +02:00
smallmodel
00033c3a70
SPAWNFLAG_DETAIL must be 0x1000 2023-10-23 15:56:27 +02:00
smallmodel
acf71610df
Don't inhibit pathnodes 2023-10-23 15:56:14 +02:00
smallmodel
86e9ae343a
Don't move to patorl current node with m_bPatrolWaitTrigger 2023-10-23 15:55:58 +02:00
smallmodel
9bbd546d4c
Replaced glbs with g_local 2023-10-23 15:54:48 +02:00
smallmodel
31f2573b28
Fixed animations not playing correctly 2023-10-23 14:46:44 +02:00
smallmodel
4d7fcb77c2
Use ANIM_WEIGHT_MOTION enum 2023-10-23 14:46:17 +02:00
smallmodel
da02a8c73a
Fixed frame delta being wrong 2023-10-23 14:46:01 +02:00
smallmodel
dd0b4505a6
Fixed bad pathing 2023-10-23 12:39:09 +02:00
smallmodel
eaff26216a
Added MASK_ACTORPATH 2023-10-23 12:23:47 +02:00
smallmodel
e850dd1963
Make sure to prevent to transition to curious if curious isn't enabled (moh 2.30 feature) 2023-10-23 11:59:06 +02:00
smallmodel
cf61ae0332
Fixed crash when driver's client is null 2023-10-22 21:16:07 +02:00
smallmodel
5cffe3fb05
Fixed infinite loop with ai_debugpath 2023-10-22 21:15:58 +02:00
smallmodel
b996918d3b
Formatted navigate source files 2023-10-22 21:06:43 +02:00
smallmodel
4a9f9a45c2
Fixed infinite loop in SimpleActor::ShortenPathToAvoidSquadMates() 2023-10-22 21:03:39 +02:00
smallmodel
3a75772005
Fixed g_mmove algorithm 2023-10-22 21:03:25 +02:00
smallmodel
c196e31c6c
Formatted g_mmove.cpp 2023-10-22 20:25:54 +02:00
smallmodel
60ceff5ae0
Initialize is_paused member variable 2023-10-22 20:16:46 +02:00
smallmodel
34a4a0c892
HandleKilled() didn't handle the last param 2023-10-22 20:16:36 +02:00
smallmodel
2a3c42d47b
Fixed MINS/MAXS bounding box (especially for Actor) 2023-10-22 20:16:22 +02:00
smallmodel
0b1f796e0a
Fixed format string 2023-10-22 20:16:10 +02:00
smallmodel
766d4d23bf
Incremented MAX_LOOPBACK otherwise the client would drop the gamestate while loading 2023-10-22 19:47:43 +02:00
smallmodel
6860a1e992
Crash fix 2023-10-22 19:45:48 +02:00
smallmodel
70c628d759
Finalized actor_turret 2023-10-22 17:30:37 +02:00
smallmodel
6eff8bc273
Finalized actor_weaponless 2023-10-22 16:34:15 +02:00
smallmodel
0b1e8cdbf3
Finalized actor_runner 2023-10-22 16:28:06 +02:00
smallmodel
6f58b34f87
Finalized actor_patrol 2023-10-22 16:26:28 +02:00
smallmodel
adf081ba3c
Finalized actor_pain 2023-10-22 16:23:33 +02:00
smallmodel
6d4a9fde3f
Finalized actor_noclip 2023-10-22 16:20:29 +02:00
smallmodel
5a5cc4ea17
Finalized actor_machinegunner 2023-10-22 16:14:52 +02:00
smallmodel
69df583508
Finalized actor_killed 2023-10-22 15:45:08 +02:00
smallmodel
18506d9932
Finalized actor_idle 2023-10-22 15:42:36 +02:00
smallmodel
f076e7609e
Finalized actor_grenade 2023-10-22 15:41:19 +02:00
smallmodel
0b0d053044
Implemented Projectile::SetMartyr 2023-10-22 15:41:13 +02:00
smallmodel
ce7dfdd986
Fixed/finalized actor_dog 2023-10-22 15:03:12 +02:00
smallmodel
50e589f27c
Finalized actor_disguise 2023-10-22 14:56:41 +02:00
smallmodel
e904dafa38
Finalized actor_curious 2023-10-22 14:29:02 +02:00
smallmodel
6a210fa212
Finalized actor_cover source file 2023-10-21 17:18:49 +02:00
smallmodel
ae33155ed3
Added cover states 2023-10-21 17:18:03 +02:00
smallmodel
d3d44001ef
Fixed CanSee implementation 2023-10-21 16:50:26 +02:00
smallmodel
c2aec1ff57
Use named enums for actor states 2023-10-20 23:28:01 +02:00
smallmodel
d5f08fe950
Added more states for turret 2023-10-20 23:25:39 +02:00
smallmodel
bdf4df9fd0
Finished actor_curious 2023-10-20 23:03:27 +02:00
smallmodel
7481b0939e
Finished actor_balcony 2023-10-20 23:03:17 +02:00
smallmodel
346e59f18a
Finished actor_animcurious 2023-10-20 23:03:10 +02:00
smallmodel
4725aad3e9
Added more states 2023-10-20 23:02:53 +02:00
smallmodel
59fd1bfdb2
Fixed anim API 2023-10-19 23:15:57 +02:00
smallmodel
7546d91580
Fixed anim state 2023-10-19 23:15:45 +02:00
smallmodel
c81df27470
Fixed alarm state 2023-10-19 23:15:36 +02:00
smallmodel
bd6232d913
Added more actor state enums 2023-10-19 23:15:23 +02:00
smallmodel
7f6b73e60f
Set client's server id acknowledge 2023-10-19 20:20:40 +02:00
smallmodel
e3562f9e56
Added serverIdAcknowledge 2023-10-19 20:20:07 +02:00
smallmodel
40141c55de
Fixed infinite loop in ShortenPathToAvoidSquadMates 2023-10-19 20:19:52 +02:00
smallmodel
a6f6cbd9b5
Fixed a crash in FindCornerNodeForExactPath 2023-10-19 20:19:43 +02:00
smallmodel
e9ffb4b9b5
Removed print code that causes crash 2023-10-19 20:19:33 +02:00
smallmodel
1f0418a9cd
Fixed TIKI_LoadSetupCaseHeader() not using case value properly 2023-10-19 19:47:06 +02:00
smallmodel
e76837b42c
Fixed TIKI_GetHeadSkin() wrongly using headmodels 2023-10-19 19:46:12 +02:00
smallmodel
87be7068c9
Added MAX_SKELMODELS 2023-10-19 19:45:56 +02:00
smallmodel
49cb5af265
Shortened GetRandomHeadModel() and GetRandomHeadSkin() 2023-10-19 19:36:32 +02:00
smallmodel
f0fe93429f
Fixed headmodels/headskins never working 2023-10-19 19:36:07 +02:00
smallmodel
c2461f1219
tiki nullity check 2023-10-19 19:35:48 +02:00
smallmodel
f82b6b75ff
Fixed DetectSmokeGrenades and LookAt crash 2023-10-18 20:00:32 +02:00
smallmodel
3486b590eb
Fixed division by zero error when getting a random smoke sprite 2023-10-18 19:57:31 +02:00
smallmodel
5730af672c
Fixed event return type 2023-10-18 19:53:04 +02:00
smallmodel
4daff05142
Fixed some methods not working as intended 2023-10-18 19:45:31 +02:00
smallmodel
e930768c67
Implemented OpenActorStats and WriteActorStats 2023-10-18 19:34:35 +02:00
smallmodel
6f03e388bf
Finished actor source file implementation from moh 2.0 and above 2023-10-18 19:23:55 +02:00
smallmodel
9b340e03c5
Added MASK_LOOK trace mask 2023-10-18 19:20:53 +02:00
smallmodel
d5b61fe5cc
Pathing fixes, leash fixes 2023-10-17 23:38:33 +02:00
smallmodel
5b46e48a17
Fixed grenade code (path, give), path leash, gun target 2023-10-17 20:38:58 +02:00
smallmodel
585221f7cc
Added more eActorState_Turret values 2023-10-17 20:38:03 +02:00
smallmodel
77eb7a5259
Added position and forward parameters to Sentient::GunTarget() 2023-10-17 19:45:22 +02:00
smallmodel
77bfc4b599
Added bDesperate parameter to DecideToThrowGrenade 2023-10-17 19:44:48 +02:00
smallmodel
95bbfba1b8
Added MASK_GRENADEPATH 2023-10-17 18:03:29 +02:00
smallmodel
844a50dfd8
Added more comments in DoUse 2023-10-17 17:51:29 +02:00
smallmodel
cd2fea5262
Implemented some but not all features from mohaas and mohaab + lighter implementations + fixed implementations 2023-10-16 23:42:30 +02:00
smallmodel
79d8b4bb0b
Fixed wrong value for THINKSTATE_BADPLACE 2023-10-16 23:32:59 +02:00
smallmodel
531825545d
Added MASK_AI_CANSEE 2023-10-16 23:32:46 +02:00
smallmodel
daab5b9238
Fixed compile error 2023-10-16 00:31:50 +02:00
smallmodel
ce59e5e6a7
Fixed mismatched anim methods up to Actor::EventSetSayAnim 2023-10-16 00:29:41 +02:00
smallmodel
ea0c4b5060
Implemented actor_runandshoot 2023-10-15 21:53:40 +02:00
smallmodel
9b9908b660
Formatted actor_badplace source file 2023-10-15 20:53:20 +02:00
smallmodel
101894be37
Renamed THINKLEVEL_NORMAL to THINKLEVEL_IDLE 2023-10-15 20:52:06 +02:00
smallmodel
3e314251f2
Implemented actor_badplace 2023-10-15 20:51:11 +02:00
smallmodel
1995c75006
Added eActorState with reserved enums for m_State values 2023-10-15 20:44:44 +02:00
pryon
ff85986c44
Fully implement UIList (#78) 2023-10-15 20:23:58 +02:00
smallmodel
9131297d43
Implemented Actor::Archive from mohaas/mohaab 2023-10-15 20:06:37 +02:00
smallmodel
301f3091d1
Fixed whole SimpleActor implementation 2023-10-15 19:52:19 +02:00
smallmodel
b59bd449d4
Removed useless Clear() in GetScriptValue() 2023-10-15 19:52:02 +02:00
smallmodel
5e510ef0e2
Fixed ActorPath algorithm 2023-10-15 17:52:00 +02:00
smallmodel
c7c3fcd0e0
Use a const float* for PathDelta() 2023-10-15 17:50:28 +02:00
smallmodel
a5532ad67b
Fixed Actor Enemy system 2023-10-15 17:11:20 +02:00
smallmodel
290cd5501c
Obfuscation should be 0 by default 2023-10-15 16:12:01 +02:00
smallmodel
8d1b1410cd
Fixed EventSetAimTarget, MoveXX methods and implemented DetectSmokeGrenades 2023-10-15 15:08:01 +02:00
smallmodel
df9aead324
In EventSetMood, check for Bored/Nervous/Curious/Alert 2023-10-15 14:03:44 +02:00
smallmodel
851fd240d3
Fixed StartAnimation() constant value 2023-10-15 14:01:48 +02:00
smallmodel
2da03c89d1
Fixed MovePath/MovePathGoal 2023-10-15 14:01:13 +02:00
smallmodel
89cd12d2c1
Fixed CurrentPathDir and CurrentPathGoal return value 2023-10-15 13:43:49 +02:00
smallmodel
e21d2a0adb
Fixed compile errors 2023-10-14 21:53:17 +02:00
smallmodel
2fad64b08a
Reimplemented some methods, added some flags and moved methods to the correct source file 2023-10-14 21:21:45 +02:00
smallmodel
97fd147fbe
Fixed SetDesiredYawDir/SetDesiredYawDest 2023-10-14 21:20:59 +02:00
smallmodel
0f01f6af11
Reimplemented actor CanSee/CanShoot/EnemyInFOV 2023-10-14 20:33:50 +02:00
smallmodel
a9892c88be
Fixed WithinDistance/DistanceTo const and implemented AreasConnected 2023-10-14 20:26:38 +02:00
smallmodel
f1d76a042d
Added WithinFarplaneDistance 2023-10-14 20:23:35 +02:00
smallmodel
77d4e5d051
Fixed MASK_CANSEE value 2023-10-14 20:23:24 +02:00
smallmodel
7041acfd51
Added visual obfuscation feature (not implemented yet) 2023-10-14 19:56:06 +02:00
smallmodel
b27bfbe189
Formatted g_public source file 2023-10-14 19:12:57 +02:00
smallmodel
1c10e7a63d
Fixed G_ObfuscationForSmokeSprites parameters 2023-10-14 19:11:48 +02:00
smallmodel
0a7c324d48
setOriginEvent: clear 4th origin history and update bad places. + handle ANIM_MODE_ATTACHED when moving 2023-10-14 18:59:35 +02:00
smallmodel
c81d247fbb
Reimplemented Actor::UpdateBoneControllers 2023-10-14 18:40:53 +02:00
smallmodel
82294b7b2e
Correctly implemented GetMoveInfo 2023-10-14 15:02:07 +02:00
smallmodel
d80f55d5bf
Added MASK_MOVEINFO 2023-10-14 14:33:55 +02:00
smallmodel
7930cda277
Added and use eAnimMode enum 2023-10-14 14:18:56 +02:00
smallmodel
7870db7202
Made m_groundPlaneNormal a vec3_t 2023-10-14 14:08:52 +02:00
smallmodel
407538fd85
Moved MINS/MAXS to bg_pmove 2023-10-14 13:31:19 +02:00
smallmodel
1a293420c0
Fixed voicetype event 2023-10-14 13:30:35 +02:00
smallmodel
1e94cdd8ca
Added AI_EVENT_BADPLACE 2023-10-14 01:16:50 +02:00
smallmodel
7a2311d6e6
Added BadPlace and RunAndShoot state initialization 2023-10-14 01:06:47 +02:00
smallmodel
e686937ae9
Added actor_runandshoot source file 2023-10-14 00:54:52 +02:00
smallmodel
8dca8988fe
InitRunAndShoot spelling 2023-10-14 00:54:47 +02:00
smallmodel
c890ac5944
Added actor_badplace source file 2023-10-14 00:45:51 +02:00
smallmodel
56e52fda80
Implemented Actor::Landed 2023-10-14 00:44:59 +02:00
smallmodel
e7786b3192
Added DBCS methods for UIFont 2023-10-13 23:22:13 +02:00
smallmodel
4cc3a84e98
Make the driver non-solid instead of the tank if it's a player 2023-10-13 21:31:47 +02:00
smallmodel
6e0b048ae7
End remote control for all linked turrets (this removes the user camera) 2023-10-13 21:16:56 +02:00
smallmodel
115786798d
Remove the user camera when ending the remote control 2023-10-13 21:16:37 +02:00
smallmodel
376db9e9e6
Fixed turret's user camera not being removed when the turret is removed 2023-10-13 21:15:40 +02:00
smallmodel
8abdb80e85
Fixed crashes when spectating, and fixed spectate not working properly under some conditions 2023-10-13 21:15:02 +02:00
smallmodel
656f212608
Fixed tank's driver not being able to remote control the turret under some circumstances 2023-10-13 21:09:47 +02:00
smallmodel
60e07cc4ff
Fixed wrong const string values 2023-10-13 19:57:21 +02:00
smallmodel
e132c0a015
Player camera view fix
- Add PMF_DAMAGE_ANGLES when camera show quakes
- Fixed spectating angles
- Fixed a crash that can occur if current_torso is NULL
2023-10-13 19:52:12 +02:00
smallmodel
8e63526f2a
Camera must calculate m_bShowquakes manually, only if protocol is below version 15 2023-10-13 19:33:32 +02:00
smallmodel
a5b7c774c1
Added more clarity for PMF_DAMAGE_ANGLES 2023-10-13 19:33:03 +02:00
smallmodel
130a5bb8c4
Fixed indentation 2023-10-13 19:14:42 +02:00
smallmodel
3802dd9984
Added Camera::ShowQuakes() 2023-10-13 19:14:37 +02:00
smallmodel
7d37397222
Formatted camera source files 2023-10-13 19:11:51 +02:00
smallmodel
932454d7b2
Removed MASK_DAMAGEMODEL, using MASK_SOLID instead 2023-10-13 19:11:14 +02:00
smallmodel
5d2e6c46aa
Use MASK_SOLID instead of MASK_DAMAGEMODEL 2023-10-13 19:07:44 +02:00
smallmodel
38089195be
Set default fov to 80 and initialize fov fadetime, follow fade time and showquakes fields 2023-10-13 19:07:23 +02:00
smallmodel
85a6c1d145
Implemented Get/SetNationality, IsOnFloor, EventAnimScript_Attached, VirtualEyePosition and FriendlyInLineOfFire 2023-10-12 23:20:57 +02:00
smallmodel
85d034b7fb
Added eActorNationality enum from mohaab 2023-10-12 23:16:18 +02:00
smallmodel
82b5468fb4
Implemented Actor destructor 2023-10-12 21:31:22 +02:00
smallmodel
89759c44af
Moved some methods to inline + added EV_NoAnimLerp 2023-10-12 21:30:53 +02:00
smallmodel
6f66a1d1c3
Moved Container::Archive to archive.h source file to avoid compilation errors 2023-10-12 20:45:49 +02:00
smallmodel
d4bac185f6
Added next enemy time field from moh 2.0 and above 2023-10-12 20:36:08 +02:00
smallmodel
658bba576e
Moved methods 2023-10-12 20:35:57 +02:00
smallmodel
31f3c25b18
Implemented Archive with only arc parameter 2023-10-12 20:30:17 +02:00
smallmodel
4a1f149051
Formatted actor source files 2023-10-12 20:18:22 +02:00
smallmodel
c55a78b8b4
Moved location of actor methods 2023-10-12 20:17:18 +02:00
smallmodel
3dbf957304
Include scriptthread 2023-10-12 20:06:00 +02:00
smallmodel
8f98f49f1b
Renamed source file 2023-10-12 20:05:10 +02:00
smallmodel
0a8322960b
Added methods from moh 2.0 and above 2023-10-12 19:57:46 +02:00
smallmodel
63d73c6f86
Added EF_NO_LERP entity flag 2023-10-12 19:57:41 +02:00
smallmodel
f8cbbe78a2
Reordered methods 2023-10-12 19:54:00 +02:00
smallmodel
2bb09503c6
Added SimpleActor destructor (it deletes the anim thread) 2023-10-12 19:45:16 +02:00
smallmodel
ba313decd1
Formatted simpleactor source files 2023-10-12 19:44:17 +02:00
smallmodel
0d6847c76c
Initialize new member fields 2023-10-12 19:42:20 +02:00
smallmodel
7b721c7849
Added fields and methods from mohaas and mohaab 2023-10-12 19:21:41 +02:00
smallmodel
1fb073fd6a
Added IsDisabled() 2023-10-12 19:04:47 +02:00
smallmodel
484272aed4
Added OpenActorStats and WriteActorStats (unimplemented) 2023-10-12 18:58:04 +02:00
smallmodel
57422ce793
Formatted actor source files 2023-10-12 18:19:22 +02:00
smallmodel
ba855cd064
Added events moved actor methods to the correct source files 2023-10-11 22:49:06 +02:00
smallmodel
39ac9f7de6
Added more const strings from 2.0 and above 2023-10-11 19:31:31 +02:00
smallmodel
4368035da4
Remove the weapon from owner when being destroyed 2023-10-09 19:32:08 +02:00
smallmodel
4391912ee3
Implemented Door::ShowInfo, correctly implemented Door::FieldTouched + minor fixes 2023-10-08 20:56:15 +02:00
smallmodel
fc17536f55
Use CONTENTS_WEAPONCLIP for stickybomb when using it 2023-10-08 20:45:34 +02:00
smallmodel
3bae4338c3
Updated README 2023-10-08 20:22:10 +02:00
smallmodel
f59bdd6b9f
Fully implemented ProjectileGenerator classes + Fixed ThrobbingBox code 2023-10-08 20:21:00 +02:00
smallmodel
03f3676b00
Use correct values for fields 2023-10-08 19:13:16 +02:00
smallmodel
e0d7079745
Implemented VehicleWheelsX4 2023-10-08 19:11:23 +02:00
smallmodel
b7f421481f
Implemented VehicleWheelsX2 2023-10-08 18:52:09 +02:00
smallmodel
3506cb3f94
Fixed vlink's origin being incorrectly set 2023-10-08 18:28:01 +02:00
pryon
7280acee42
Implement UICheckBox (#77)
* Implement UICheckBox

* Remove UICheckBox destructor and unnecessary `str` initializations
2023-10-08 18:03:14 +02:00
smallmodel
d757fa6306
Renamed world.cpp and world.h to worldspawn.cpp and worldspawn.h 2023-10-08 00:08:47 +02:00
smallmodel
475fc92629
Fixed str() being passed as an instance for variadic arguments 2023-10-07 23:50:16 +02:00
smallmodel
f24303dd78
Use a correct implementation for fSign() 2023-10-07 23:49:49 +02:00
smallmodel
180a20f561
Made wheel_s a struct 2023-10-07 21:56:43 +02:00
smallmodel
2e5ca5b9dc
Return an empty string if the item name is not in the prefix list 2023-10-07 14:19:42 +02:00
smallmodel
decee20fd8
Fixed GetSentientOwner() not returning the owner if not remote controlled 2023-10-06 22:33:59 +02:00
smallmodel
3d9a60c415
Turn off vehicle sound entities when the tank is idle 2023-10-06 22:12:19 +02:00
smallmodel
a4a7002867
ScriptSlave::SetModelEvent: Corrected the case where the model is invalid 2023-10-06 20:18:18 +02:00
smallmodel
96c9a014e6
When getting string from event, store it in an str to avoid potential undefined behavior due to str destruction 2023-10-06 20:13:31 +02:00
smallmodel
11b4471be9
Remove linked turrets of the tandem turret being destroyed 2023-10-06 19:55:36 +02:00
smallmodel
17aea205f7
m_HeadTurret must be initialized to self, fixed SwitchToLinkedTurret() never working, and made IsActiveTurret() return correctly 2023-10-06 19:47:59 +02:00
smallmodel
739f54ed87
Use EV_TakeDamage on pTurret instead, and process all pending events 2023-10-06 19:46:47 +02:00
smallmodel
01be5bee72
Ignore user control when in autopilot 2023-10-04 20:13:00 +02:00
smallmodel
dfcf0da710
Added vehicle waittills 2023-10-04 19:17:57 +02:00
smallmodel
f47fb87d1b
Fixed vehicle path not working properly 2023-10-04 19:17:48 +02:00
smallmodel
bd639ba936
Added "info_vehiclepoint" class ID for VehiclePoint 2023-10-04 19:17:26 +02:00
smallmodel
e784e62a4e
Fixed damage event method
- Don't damage if health is already 0 or below
- Check for immunity
- Error if attacker or inflictor is NULL
- Don't apply velocity for vehicles
- Set the minimum mass to 20 and momentum to 1000
- Still process pain when in godmode
2023-10-04 00:33:27 +02:00
smallmodel
e4425dcbf8
Make sure to check if vehicle or turret is valid before locking 2023-10-04 00:25:55 +02:00
smallmodel
0dcffe8771
Fixed means of death strings 2023-10-03 18:40:38 +02:00
smallmodel
2b27f6c452
Formatted document 2023-10-03 18:35:06 +02:00
smallmodel
3ba3c728bc
By default, a Vehicle must be removed on death 2023-10-03 18:32:31 +02:00
smallmodel
7193198af2
Set the owner for SmokeGrenades 2023-10-03 18:32:09 +02:00
smallmodel
6691afd160
Use the correct clipmask for VehicleCollisionEntity 2023-10-03 18:30:35 +02:00
smallmodel
59fb220197
Added setOwner/getOwner 2023-10-03 18:30:19 +02:00
smallmodel
ff7651d4c8
Fixed a crash when a window breaks on mohaa mode 2023-10-03 18:04:12 +02:00
smallmodel
b02abb1f18
Fixed issue when the string is escaped with a newline 2023-10-03 17:54:23 +02:00
smallmodel
9f42da4686
Hide tempmodel when it is outside of the min/max distance range 2023-10-03 17:04:26 +02:00
smallmodel
58e3056374
Fixed coordinates displaying twice in the console 2023-10-03 17:02:36 +02:00
smallmodel
3142865fef
Added MacOS support 2023-10-03 17:02:23 +02:00
smallmodel
06e3497a57
Fixed issues with tempmodel origin 2023-10-03 17:02:07 +02:00
smallmodel
e49833737d
Fixed label showing when stat alpha is 0 2023-10-03 12:21:24 +02:00
smallmodel
7eedc5fef8
Fixed Rend_SetColor() with m_local_alpha 2023-10-03 01:51:31 +02:00
smallmodel
c442942022
Using text outlines 2023-10-03 01:49:59 +02:00
smallmodel
2c2652ed1d
Fixed outline color 2023-10-03 01:41:35 +02:00
smallmodel
97bcc07aab
Made m_bOutlinedText a protected member 2023-10-03 00:54:45 +02:00
smallmodel
001704b22e
Implemented LayoutPlayerStatAlpha and LayoutStatbarShader_Marker 2023-10-03 00:48:41 +02:00
smallmodel
f1d9cd93ce
Added events from moh 2.0 and above 2023-10-02 21:13:48 +02:00
smallmodel
49aa2aa858
Implemented UILabel from moh 2.0 and above 2023-10-02 21:11:48 +02:00
smallmodel
6274d9a1e9
Added UI_StartLocalSoundDialog, UI_FadeSound and UI_StopAll imports 2023-10-02 21:11:32 +02:00
smallmodel
5fa9d91401
Added S_StartLocalSoundChannel 2023-10-02 21:11:16 +02:00
smallmodel
9acb803ffe
Implemented getMaxWidthIndex and PrintOutlinedJustified from moh 2.0 2023-10-02 20:38:48 +02:00
smallmodel
105924bca3
Formatted document 2023-10-02 20:18:24 +02:00
smallmodel
5f12be2037
Formatted source files 2023-10-02 19:18:25 +02:00
smallmodel
13931c40cb
Added playerstatalpha and statbar_shader_marker from 2.0 2023-10-02 19:16:12 +02:00
smallmodel
ada5d614c5
Added comments about versions 2023-10-02 18:49:46 +02:00
smallmodel
7323d51219
Emitter fixes 2023-10-02 18:47:02 +02:00
smallmodel
f5071f2667
Fixed out of temp model warning spam 2023-10-02 18:46:45 +02:00
smallmodel
0ca0a81644
Fixed DriverUse and FindExitPosition 2023-10-02 18:46:31 +02:00
smallmodel
e1bd69b467
Added SetVehicle / GetTurret / SetTurret 2023-10-02 18:09:55 +02:00
smallmodel
b17494519e
Tempmodel fixes 2023-10-02 13:41:00 +02:00
smallmodel
13555f505c
newEnt's parent entity must be ENTITYNUM_NONE in AddTempModels() 2023-10-02 12:45:51 +02:00
smallmodel
2a65f53084
TagSpawnLinked must initialize the spawnthing origin to the entity's origin 2023-10-02 12:45:34 +02:00
smallmodel
71fe83083e
Fixed crash when trying to play non pvs sound with a null alias 2023-10-02 12:13:22 +02:00
smallmodel
0ddb5c859f
Fixed CalculateAnimationData using wrong angles for vehicle suspension movement 2023-10-02 12:07:59 +02:00
smallmodel
f7b12d5108
Removed unused events 2023-10-02 12:07:26 +02:00
smallmodel
baa8f4334b
Implemented CG_ClientCommands 2023-10-02 12:07:12 +02:00
smallmodel
24a211b190
Formatted document 2023-10-02 11:56:35 +02:00
smallmodel
6e82f254b7
Formatted document 2023-10-02 11:51:08 +02:00
smallmodel
fbfedcf8d6
Fixed vehicle suspensions 2023-10-02 02:15:56 +02:00
smallmodel
5b06a0c2a4
Small code reduction 2023-10-02 02:15:12 +02:00
smallmodel
f3204b0845
Fixed animation playing sometimes not being correct 2023-10-02 02:13:42 +02:00
smallmodel
334314a137
Fixed crash when the owner is NULL 2023-10-02 01:45:19 +02:00
smallmodel
8ecc8122b8
Fixed tank turning too fast 2023-10-02 01:11:09 +02:00
smallmodel
eb9a119dfe
Fixed MoveVehicle not moving correctly 2023-10-02 00:46:37 +02:00
smallmodel
313ece62f7
Fixed turret not turning properly 2023-10-02 00:16:12 +02:00
smallmodel
5799bcceb2
Fixed buffer overflow for szBlah 2023-10-02 00:07:54 +02:00
smallmodel
61e7571388
Added a crash fix in AttachDriverSlot() 2023-10-02 00:07:44 +02:00
smallmodel
6cfd99e40a
Fixed AttachPassengerSlot not attaching correctly and call DriverAdded() after attaching the driver 2023-10-02 00:07:30 +02:00
smallmodel
b3bdd9d563
Enabled UpdateNormals() 2023-10-01 23:09:55 +02:00
smallmodel
5bec3d8471
sv_maxclients must be initialized to 1 by default 2023-10-01 23:09:26 +02:00
smallmodel
711e46ecfb
Added commented code that prevent playing mohaa maps in mohaas/mohaab 2023-10-01 23:08:07 +02:00
smallmodel
ddd127352f
Initialize svs.numSnapshotEntities in SV_ChangeMaxClients 2023-10-01 23:07:38 +02:00
smallmodel
784fd825bb
Formatted level source file 2023-10-01 22:49:10 +02:00
smallmodel
673a42242d
Formatted source files 2023-10-01 22:47:25 +02:00
smallmodel
3317345d92
Use a const string for target name 2023-10-01 22:45:41 +02:00
smallmodel
7958ba38d8
Fixed angles being wrong when the vehicle starts + fixed turret slot initial angles, use MAX_CORNERS instead of MAX_SOUND_ENTITIES and fixed UpdateNormals() angles 2023-10-01 21:16:50 +02:00
smallmodel
2dd7e0c03f
use a vec3_t for VehicleTurretGun::SetBaseOrientation and use GetTagBarrel() for m_iBarrelTag 2023-10-01 21:15:37 +02:00
smallmodel
b94f021567
Refactored setModel() 2023-10-01 21:00:32 +02:00
smallmodel
cf50c5b535
Measure SpawnInternal time 2023-10-01 21:00:11 +02:00
smallmodel
1b71169565
Removed non-fgame module code (as g_spawn is only used for fgame) 2023-10-01 20:57:28 +02:00
smallmodel
30f2b9d5ed
Formatted document 2023-10-01 20:56:51 +02:00
smallmodel
999d6a449b
Fixed toPitch() with zero coordinates 2023-10-01 14:46:06 +02:00
smallmodel
a65aa2a0d0
Fixed CrossProduct being wrong due to parameters being modified while doing the operation 2023-10-01 14:45:24 +02:00
smallmodel
36fc0b6e8a
Formatted document 2023-10-01 14:21:23 +02:00
smallmodel
f97362cdb1
Added MASK_VEHICLE_TIRES 2023-10-01 14:11:49 +02:00
smallmodel
6398484459
Fixed Vehicle::Postthink ignoring g_vehicle 2023-10-01 13:43:42 +02:00
smallmodel
07e8c6feaa
Fully implemented cMoveGrid 2023-10-01 13:42:16 +02:00
smallmodel
faf351a496
SurfIsOffScreen must only process faces + removed assertion 2023-10-01 11:36:54 +02:00
smallmodel
cd9315852e
Fixed num not being set when writing to memory archiver in commandthing_t::ArchiveToMemory 2023-09-30 11:57:04 +02:00
smallmodel
8c8487231a
Fixed P_DeleteViewModel when the viewmodel is NULL 2023-09-27 23:55:27 +02:00
smallmodel
65ebdf0862
Commented out UpdateNormals() till a solution is found 2023-09-27 23:51:12 +02:00
smallmodel
9704362501
Initialize m_bAnimMove 2023-09-27 23:49:23 +02:00
smallmodel
f0e87cd85a
Prefixed TIKI import functions 2023-09-27 23:21:34 +02:00
smallmodel
f6e6bf1d6b
Implemented SlidePush, MoveVehicle and Postthink 2023-09-27 23:20:09 +02:00
smallmodel
4b4e8f806b
Fixed vlink angles in Postthink 2023-09-27 23:17:14 +02:00
smallmodel
4141cee13f
Added MASK_MOVEVEHICLE 2023-09-27 20:22:33 +02:00
smallmodel
b2ee346f68
Formatted documents 2023-09-27 20:10:16 +02:00
smallmodel
2220f1ff05
Fixed vehicle move code 2023-09-27 20:01:08 +02:00
smallmodel
7ba48dd666
Made code lighter 2023-09-27 19:35:24 +02:00
smallmodel
2a48e2fd27
Formatted document 2023-09-27 19:24:41 +02:00
smallmodel
63a24c4448
Reimplemented a few methods (from moh 2.0 and above) 2023-09-26 23:51:12 +02:00
smallmodel
787df3362b
Fixed v_angle not being set in SetViewAngles + floor view angles 2023-09-26 20:51:25 +02:00
smallmodel
5ad0f60ee3
G_TestEntityPosition must check for sentient instead of player 2023-09-26 20:50:00 +02:00
smallmodel
d42f92361a
Fixed slot notsolid/solid for bound entities, for player and for weapons 2023-09-26 20:49:00 +02:00
smallmodel
0693db3ef5
Fixed Vehicle::VehicleDestroyed 2023-09-26 20:33:23 +02:00
smallmodel
fafb0e2793
Initialize max speed in EventDriveInternal and use cVehicleSpline instead of cSpline<4, 512> 2023-09-26 20:31:13 +02:00
smallmodel
0a4819d172
Using FindExitPosition() when detaching from driver, turret or passenger 2023-09-26 20:27:59 +02:00
smallmodel
ee03f32a3e
FindExitPosition() must return a boolean value 2023-09-26 20:14:39 +02:00
smallmodel
f4e01917a2
Set turrets target name on initialization + Fixed DetachTurretSlot exit angles + use FindExitPosition() in AttachTurretSlot() 2023-09-26 20:08:25 +02:00
smallmodel
eed9b36c9f
Added GetRawRemoteOwner() 2023-09-26 20:06:31 +02:00
smallmodel
055192c2a8
Implemented Vehicle::AutoPilot from moh >= 2.0 and above 2023-09-26 19:44:03 +02:00
smallmodel
cca39108dc
Added cVehicleSpline as an alias to cSpline<4, 512> 2023-09-26 19:43:42 +02:00
smallmodel
b1bbd5e366
Implemented mohaas/mohaab methods 2023-09-25 23:17:20 +02:00
smallmodel
afb718f01f
Removed vm, using m_bAnimMove instead 2023-09-25 21:18:43 +02:00
smallmodel
653b4e0ab7
Added methods, events and fields from moh 2.0 and above 2023-09-24 23:47:28 +02:00
smallmodel
c3d228a9f5
Fixed float vote options 2023-09-24 23:37:26 +02:00
smallmodel
15e10caca0
Fixed useless statement 2023-09-24 23:37:18 +02:00
smallmodel
46efa85441
Fixed switch/case no default value 2023-09-24 23:37:03 +02:00
smallmodel
bb42456653
Marked overridden methods as "override" 2023-09-24 23:36:30 +02:00
smallmodel
38bf80aa52
Export EV_Turret_SetMaxUseAngle 2023-09-24 23:20:43 +02:00
smallmodel
c5c2aa5348
Fully implemented VehicleTank 2023-09-24 19:14:50 +02:00
smallmodel
1e67aeb667
Added AnimMoveVehicle 2023-09-24 18:42:23 +02:00
smallmodel
9ac7bccba5
Added GetUserViewAngles / SetUserViewAngles 2023-09-24 18:42:13 +02:00
smallmodel
610b82cfb7
Added Vehicle::DriverAdded and NUM_VEHICLE_TIRES 2023-09-24 17:47:31 +02:00
smallmodel
c8144539d0
Fully implemented VehicleTurretGun 2023-09-24 17:19:23 +02:00
smallmodel
60f83597ee
Added HasVehicle() virtual method 2023-09-24 16:38:06 +02:00
smallmodel
46c0c6085d
Fixed GetMuzzlePosition using wrong parameters 2023-09-24 16:37:50 +02:00
smallmodel
36d4c4af61
Added MASK_TRANSPARENT 2023-09-24 16:37:36 +02:00
smallmodel
7406c3dc23
Implemented basic VehicleTurretGun methods 2023-09-24 01:14:35 +02:00
smallmodel
24bb15ce29
Renamed SOUND_STATE to SOUND_STATE_TURRET to avoid conflict with Vehicle's SOUND_STATE 2023-09-24 01:07:22 +02:00
smallmodel
f3ad05dc85
Added GetVehicle 2023-09-24 00:27:51 +02:00
smallmodel
bbae3223cb
Fixed virtual methods 2023-09-23 23:13:34 +02:00
smallmodel
8cedb24d31
Using m_SwitchLabel 2023-09-23 23:13:21 +02:00
smallmodel
528414dfef
Added new fields from moh >= 2.0 2023-09-23 22:34:08 +02:00
smallmodel
6e1c58e343
Implemented VehicleTurretGunTandem 2023-09-23 21:42:40 +02:00
smallmodel
002e935193
Fixed match start time being wrong and fixed AllowRespawn() 2023-09-23 19:49:44 +02:00
smallmodel
e26d7d346a
IsReady() should also check for dead 2023-09-23 19:38:17 +02:00
smallmodel
5d917f2578
Made IsDead() const 2023-09-23 19:38:04 +02:00
smallmodel
8aecff1879
Added CTeamSpawnClock and ported fixes from moh >= 2.0 2023-09-23 19:37:55 +02:00
smallmodel
718672119e
Fixed roundactive being wrongly set to false 2023-09-23 18:37:33 +02:00
smallmodel
6ec7482662
Implemented FixedTurret 2023-09-23 18:30:59 +02:00
smallmodel
5f3ea7c634
Removed m_countdown 2023-09-23 18:30:45 +02:00
smallmodel
1c813a59d0
Added m_bRoundActive and RoundActive() 2023-09-23 18:30:19 +02:00
smallmodel
a66236fc3d
Added QUAKED sections 2023-09-23 17:58:14 +02:00
smallmodel
ef9b7022df
Added World::Archive 2023-09-22 21:04:18 +02:00
smallmodel
ad7efce855
VehicleTankTandem 2023-09-20 20:57:58 +02:00
smallmodel
78a9990c3a
Implemented DrivableVehicleTandem 2023-09-20 20:57:35 +02:00
smallmodel
422b9eb6c0
Added DamageModel from moh 2.0 2023-09-20 00:02:38 +02:00
smallmodel
703eb271f9
Added MASK_DAMAGEMODEL 2023-09-20 00:01:12 +02:00
smallmodel
2aca32c44a
Added "isopen" door event + Renamed Door's class ID to "NormalDoor" 2023-09-19 21:24:00 +02:00
smallmodel
56c30bddb1
Added DrivableVehicleTandem 2023-09-19 21:15:55 +02:00
smallmodel
1179b50ad1
Added VehicleTankTandem 2023-09-19 21:12:57 +02:00
smallmodel
6ad44441a6
Made UpdateTurretSlot a virtual method 2023-09-19 21:12:31 +02:00
smallmodel
2455c09475
Added VehicleTurretGunTandem + more methods from moh 2.40 2023-09-19 21:02:22 +02:00
smallmodel
7a1e07e72a
Made ApplyFireKickback() and ReadyToFire() virtual 2023-09-19 21:01:41 +02:00
smallmodel
aa8e95885a
Formatted document 2023-09-19 21:01:18 +02:00
smallmodel
54bae94ad9
Use Weapon::SetItemSlot when updating stats, instead of setting weapon_class manually 2023-09-19 20:18:27 +02:00
smallmodel
98b7e01069
Implemented Weapon::SetItemSlot 2023-09-19 20:18:13 +02:00
smallmodel
12c7707bc3
Unused variable removal 2023-09-19 20:08:53 +02:00
smallmodel
a8a2c7e345
Use result from GetVAngles() in Player::GetViewangles() event 2023-09-19 20:08:35 +02:00
smallmodel
6c7542ec0c
Fixed weapon muzzle position 2023-09-18 23:45:17 +02:00
smallmodel
5ec56cbe77
Implemented turret code from mohaas/mohaab 2.40 2023-09-18 23:36:03 +02:00
smallmodel
6b79770783
Fixed HashCode for command_t (must be case-insensitive) 2023-09-18 23:35:11 +02:00
smallmodel
e125a83625
Added MASK_GUNTARGET 2023-09-18 23:34:46 +02:00
smallmodel
d05b47e996
Fixed SetupVoteOptions not checking length for -1 2023-09-18 23:34:24 +02:00
smallmodel
e1093d0c0c
Using vec3_t instead of Vector for Weapon::GetMuzzlePosition() 2023-09-18 21:19:08 +02:00
smallmodel
25690648d6
Fixed inventory item having wrong weapon class set, and added support for portable turret 2023-09-17 19:54:45 +02:00
smallmodel
5c3c4f6288
Added and implemented CarryableTurret and PortableTurret 2023-09-17 19:48:20 +02:00
smallmodel
9dec5e9e54
Added fields from mohaas/mohaab 2023-09-17 19:47:02 +02:00
smallmodel
ae1fa808da
Export DPrintf2 and DebugPrintf for server 2023-09-17 19:34:19 +02:00
smallmodel
ed6839dc99
Export DebugPrintf for client 2023-09-17 19:34:10 +02:00
smallmodel
e95d71da0d
Added Com_DPrintf2 and Com_DebugPrintf 2023-09-17 19:33:17 +02:00
smallmodel
128c8f3c06
Added Sys_DebugPrint 2023-09-17 19:31:37 +02:00
smallmodel
04f61a1af7
Added UI_PrintConsole() and UI_PrintDeveloperConsole() declarations 2023-09-17 19:29:59 +02:00
smallmodel
974e86b698
Fixed weapon being detached even if the holster tag is an empty string 2023-09-17 19:08:11 +02:00
smallmodel
12c03384b2
Fixed item being removed incorrectly 2023-09-17 19:07:46 +02:00
smallmodel
99ba912d7b
Fixed radius in Level::GetNearestBadPlace() 2023-09-17 17:12:04 +02:00
smallmodel
7607932216
Added MASK_CARRYABLETURRET 2023-09-17 17:11:44 +02:00
smallmodel
acc9c241a3
Added const specifier for Weapon::IsCarryableTurret() 2023-09-17 16:27:58 +02:00
smallmodel
5f5055f4fc
Added Sentient::SetHolsteredByCode 2023-09-17 16:27:18 +02:00
smallmodel
fc3749e008
Added Event() constructor that accepts another event and the number of arguments 2023-09-17 16:26:48 +02:00
smallmodel
155734370c
Using Archive algorithm from mohaas/mohaab 2023-09-14 00:19:55 +02:00
smallmodel
1095e3d509
call arc.Close() after checking if it was Loading 2023-09-14 00:19:17 +02:00
smallmodel
f7bfa47f2e
Made ScriptVariable classes part of LightClass 2023-09-13 23:51:33 +02:00
smallmodel
9f6ef14ea1
GetCompiledScript should remain unused 2023-09-13 21:32:58 +02:00
smallmodel
15de08556e
Formatted document 2023-09-13 19:46:39 +02:00
smallmodel
e7dfa8fcfe
Fixed command buffer not being able to hold the last character 2023-09-13 00:07:51 +02:00
smallmodel
7a67dc5dfd
Implemented bad places 2023-09-13 00:00:42 +02:00
smallmodel
7eb8ef42b7
Update smoke sprites and bad places every frame 2023-09-12 23:59:51 +02:00
smallmodel
c9c7a4beed
Implemented PathSearch::UpdatePathwaysForBadPlace 2023-09-12 23:59:38 +02:00
smallmodel
bcf3aad1b2
Added PointToSegmentDistanceSquared 2023-09-12 23:35:22 +02:00
smallmodel
ad75363028
Added more variables to archive for Level 2023-09-12 21:48:08 +02:00
smallmodel
f4ec3939a5
Weapon::Shoot(): process default value in switch/case for firemode 2023-09-12 21:47:51 +02:00
smallmodel
aead97d29d
Implemented landmarks from mohaab 2023-09-12 21:39:19 +02:00
smallmodel
f468305a2c
Level::Init(): Remove archived entities, reset health queue, initialize vote and free landmarks 2023-09-12 20:37:01 +02:00
smallmodel
a962f469eb
Added health queue 2023-09-12 20:33:49 +02:00
smallmodel
63e025cc02
Fixed 1022 characters command limit for SV_SendServerCommand (must be MAX_STRING_CHARS) 2023-09-12 20:14:58 +02:00
smallmodel
b2d332f152
SV_GameSendServerCommand: Allocate the buffer dynamically on stack
This fixes long commands not being sent
2023-09-12 20:13:37 +02:00
smallmodel
e160cf240c
Fixed vote not working properly 2023-09-12 20:12:09 +02:00
smallmodel
19a4f70c44
Made ExecuteConsoleCommand accept a const char* instead 2023-09-12 00:19:08 +02:00
smallmodel
dcca3901d5
Initialize more Level variables 2023-09-12 00:18:09 +02:00
smallmodel
0ee4ffbfbc
Implemented vote system (from mohaas/mohaab) 2023-09-12 00:07:10 +02:00
smallmodel
776bc781cd
Added ExecuteConsoleCommand() game import 2023-09-11 21:41:39 +02:00
smallmodel
b1bb79e19f
Added Player::HasVotedYes() and Player::HasVotedNo() 2023-09-11 21:28:05 +02:00
smallmodel
76c69b7bd1
Implemented Player::CallVote from mohaas/mohaab 2023-09-11 20:45:30 +02:00
smallmodel
15a25a412f
Removed m_voteCommand and added m_nextVoteTime 2023-09-11 20:45:07 +02:00
smallmodel
b511d89dcc
Fixed farplane entity dist check when it is 0 2023-09-11 00:06:21 +02:00
smallmodel
9512ae7aeb
Added TurretGun methods from mohaas/mohaab 2023-09-11 00:02:10 +02:00
smallmodel
5db086e470
Made GetMuzzlePosition a virtual method 2023-09-10 23:54:30 +02:00
smallmodel
d63f668291
Updated README 2023-09-09 23:24:29 +02:00
smallmodel
35c72a9570
Added more packages to install in docker images 2023-09-09 23:14:16 +02:00
smallmodel
b29f62ddd4
Fixed EventSetTurret crashing when the listener is NULL 2023-09-09 20:58:58 +02:00
smallmodel
525dc17573
Ignore NULL tiki
This fixes frequent crashes with NULL models
2023-09-09 20:53:59 +02:00
smallmodel
4d8ed24833
Fixed TIKI_ParseAnimations incorrectly returning 2023-09-09 20:49:08 +02:00
smallmodel
aa15d996e0
Removed AnimOnce 2023-09-09 20:41:36 +02:00
smallmodel
0ec846945d
Use edict->tiki instead of calling gi.modeltiki (which can crash because of an empty model string) 2023-09-09 20:41:03 +02:00
smallmodel
03ff158e76
Fixed crash when setting actor's patrol node 2023-09-09 20:02:02 +02:00
smallmodel
b3371b2d63
Fixed static models collapse array being wrong
This would cause static models to disappear
2023-09-09 17:56:47 +02:00
smallmodel
ed64d03bf5
Fixed dlclose() not working when compiled by GCC 2023-09-09 17:54:04 +02:00
smallmodel
3d936dede1
Don't change the protocol when in special game 2023-09-09 16:46:51 +02:00
smallmodel
33e9c5b1ea
Formatted source files 2023-09-09 16:46:42 +02:00
smallmodel
078c90bbc9
Create a ScriptThread directly rather than calling Director.CreateScriptThread
This avoids exception when called by ScriptThreadLabel::Execute(). Because Execute() doesn't have try/catch, the program would crash.
2023-09-09 16:42:15 +02:00
smallmodel
2caf2cad5a
Fixed improper usage of alloca()
alloca() can cause a stack overflow when it is called multiple times
2023-09-07 20:20:18 +02:00
smallmodel
5dec21dd43
Include <utility> for std::move 2023-09-07 20:01:07 +02:00
smallmodel
36aa9bd802
Don't replace Z_Malloc, Z_TagMalloc and Z_Free in debug memory mode 2023-09-07 19:48:08 +02:00
smallmodel
bed2f15a72
Initialize more members for UIWidget
m_scaleCvar was not initialized to NULL, which could cause crashes
fadeSequence was not initialized
2023-09-07 19:32:35 +02:00
smallmodel
f949f1e88d
Fixed offset of block in Free() with _DEBUG_MEMBLOCK 2023-09-07 19:31:17 +02:00
smallmodel
8af202bd5f
Fixed compilation errors with DEBUG_MEMORY on Linux because of CRT 2023-09-07 19:29:24 +02:00
smallmodel
67556a88f1
Fixed errors when compiling with DEBUG_MEMORY 2023-09-07 19:06:06 +02:00
smallmodel
4f8573784d
Removed con_set inheritance from con_arrayset 2023-09-07 18:58:27 +02:00
smallmodel
c5a46be23e
Optimized calls to Event() (avoid allocating a new Event when it can be reused) 2023-09-07 18:22:07 +02:00
smallmodel
47a3c0bf55
Optimized event name
Use a static char*, instead of an allocated str
2023-09-07 18:05:49 +02:00
smallmodel
e8d2a2a461
Instantiate AnimationEvent on stack rather than dynamically allocating it. Optimized cmd name for client commands 2023-09-07 17:33:35 +02:00
smallmodel
7b72a3fba4
Fixed MemArchiver improperly working 2023-09-06 23:34:16 +02:00
smallmodel
dda79e7f27
Moved some tempmodels code to cg_tempmodels.cpp and implemented FreeSomeTempModels() 2023-09-06 23:25:48 +02:00
smallmodel
9a104566ba
Added MemArchive feature from mohaas/mohaab 2023-09-06 23:11:43 +02:00
smallmodel
b4d8982341
Implemented CG_ArchiveVSSGlobals() 2023-09-06 20:54:58 +02:00
smallmodel
5ea3fc28f7
Added FS_ListFilteredFiles, FS_FreeFileList, R_GetModelName and R_GetShaderName to client game imports 2023-09-06 20:31:50 +02:00
smallmodel
0bbf39660e
Added R_GetShaderName and R_GetModelName 2023-09-06 20:31:28 +02:00
smallmodel
791f38762b
Added MemArchiver::ArchiveSize 2023-09-06 19:58:19 +02:00
smallmodel
c296b909c7
Fixed iTagR initialization 2023-09-06 00:00:50 +02:00
smallmodel
9c7a54f8fc
Added and implemented MemArchiver class 2023-09-05 23:57:51 +02:00
smallmodel
4289eab72b
Don't define MemArchiver in cg_archive.h 2023-09-05 23:57:18 +02:00
smallmodel
7b0dbc7445
Save the client game state in SV_ArchiveLevelFile 2023-09-05 20:33:02 +02:00
smallmodel
02db904336
Made CG_SaveStateToBuffer and CG_LoadStateToBuffer use a size_t 2023-09-05 20:31:24 +02:00
smallmodel
55140fee3a
Replaced #ifdef CLIENT with #ifndef DEDICATED 2023-09-05 20:22:01 +02:00
smallmodel
96d881a1f1
Made ui_public.h compilable to C code 2023-09-05 20:18:05 +02:00
smallmodel
260a95c05e
Added S_SaveData (unimplemented) 2023-09-05 20:17:51 +02:00
smallmodel
99d633587f
Renamed S_StopAllSounds to S_StopAllSounds2 2023-09-05 20:17:38 +02:00
smallmodel
cf2f0256a2
Moved UI_SetupFiles to ui_public.h 2023-09-05 20:00:54 +02:00
smallmodel
dae8e8dfbd
Fixed archive not always archiving soundsystemsavegame_t 2023-09-05 19:53:57 +02:00
smallmodel
6d2d35e82d
Fixed compile errors on newer versions of clang 2023-09-05 19:39:57 +02:00
smallmodel
5e23a6b640
Added DEBUG_MEM_BLOCK cmake definition to debug MEM_BlockAlloc code 2023-09-04 22:19:01 +02:00
smallmodel
f2ec502dc2
Fixed str allocation 2023-09-04 22:06:13 +02:00
smallmodel
be04f31256
Replaced eventInfo_t with DataNode
DataNode is now used only at initialization time and is destroyed after initialization
2023-09-04 21:38:58 +02:00
smallmodel
85dd881c97
Removed usage of HeapAlloc/HeapFree 2023-09-04 21:24:48 +02:00
smallmodel
0ef2dccd90
Don't replace cgi.Malloc and cgi.Free with malloc/free 2023-09-04 21:24:17 +02:00
smallmodel
000ec39c81
Added non-pvs landing sound 2023-09-03 22:13:03 +02:00
smallmodel
3160c6ee0b
Added _client_sound
Replaced SoundThisFrame by ClientSound
Process client commands with animation events that start with `_client_`
2023-09-03 22:12:45 +02:00
smallmodel
9da403e534
Increased MAX_NONPVS_SOUNDS 2023-09-03 22:11:26 +02:00
smallmodel
f19c3408e1
Fixed footonground using right foot 2023-09-03 00:07:40 +02:00
smallmodel
38c0e09e8a
Call UpdateFootsteps() even on multiplayer 2023-09-03 00:07:17 +02:00
smallmodel
2be4f7cdaf
Fixed EV_Client_Landing event name 2023-09-03 00:07:06 +02:00
smallmodel
cd48272fbb
Implemented server-side footstep simulation 2023-09-02 23:53:46 +02:00
smallmodel
a5a146bb02
Added and using Entity::PlayNonPvsSound 2023-09-02 23:51:37 +02:00
smallmodel
c901bcf321
Call Sys_PrintBackTrace() directly from Sys_SigHandler() 2023-09-01 22:53:08 +02:00
smallmodel
8f3142e532
Display the header/footer before printing the backtrace 2023-09-01 22:52:52 +02:00
smallmodel
88438d6db4
Removed signal handlers from g_main.cpp as it's handled by the main app directly 2023-09-01 22:49:58 +02:00
smallmodel
7348734070
Fixed m_bFootOnGround values being set incorrectly 2023-09-01 22:49:53 +02:00
smallmodel
a99a4a3a2b
Clear the top value of a return command, if the listener is NULL 2023-08-30 23:34:29 +02:00
smallmodel
7bc8c3ab5b
Fixed crate overlapping warning (when crates are actually not overlapping) 2023-08-30 23:33:42 +02:00
smallmodel
2a58fbdd22
Formatted document 2023-08-30 23:33:00 +02:00
smallmodel
d102f5a88a
set EV_LINKDOORS to -6.0f instead of -5.0f 2023-08-30 23:32:36 +02:00
smallmodel
8227f7125b
Added SetDoorType and ShowInfo 2023-08-30 23:29:23 +02:00
smallmodel
673535dc08
Clear aliases in CL_Vid_Restart_f 2023-08-30 21:54:15 +02:00
smallmodel
9750489d07
Don't play sound if current_entity is NULL 2023-08-30 21:54:01 +02:00
smallmodel
53c6224ed0
Set ENGINE_VERSION to 3.0 2023-08-30 21:53:40 +02:00
smallmodel
f84794acbe
Added sv_pure support from ioq3 and mohaas/mohaab 2023-08-30 20:35:47 +02:00
smallmodel
9e535e509a
Fixed snapshot ignoring "snaps" value from client 2023-08-30 19:59:45 +02:00
smallmodel
489210424f
Fixed SVC_Status infinite loop with names longer than 16 2023-08-30 19:36:38 +02:00
smallmodel
394abbdb6f
Fixed IPv6 not working with connect command 2023-08-30 19:36:17 +02:00
smallmodel
5fdeb92429
Readded openmohaa to version string 2023-08-30 01:08:09 +02:00
smallmodel
11cc39e41b
Fixed pain animation playing indefinitely 2023-08-30 01:07:52 +02:00
smallmodel
b3d5851fdc
Fixed optimization not working when a player is visible near a wall 2023-08-30 01:07:32 +02:00
smallmodel
5c25839bab
Added a feature that plays sound to clients not seeing entities (like not seeing other players) 2023-08-29 22:05:48 +02:00
smallmodel
fbd314b447
Fixed pitch being used instead of volume 2023-08-29 22:04:18 +02:00
smallmodel
86888a32d4
Added SV_ClientSound 2023-08-29 21:55:24 +02:00
smallmodel
37c2d22b10
Added Frame_Commands_Client 2023-08-29 20:25:11 +02:00
smallmodel
19758ef75d
Fixed entity optimization
Added a feature to always optimize players who don't see another player
2023-08-29 20:01:51 +02:00
smallmodel
519ccc90f7
Added sv_netoptimize_vistime 2023-08-29 20:00:27 +02:00
smallmodel
b592d15d1f
Added netoptimize enum types 2023-08-29 20:00:13 +02:00
smallmodel
78d70a892c
Fixed leanAngle being never 0 2023-08-29 20:00:03 +02:00
smallmodel
dbcf4c1800
Use GT_SINGLE_PLAYER instead of comparing non-zero 2023-08-29 18:48:36 +02:00
smallmodel
cbd4630b3c
SV_MasterHeartbeat: Use MAX_HEARTBEAT_TIME instead of the constant 2023-08-29 18:48:09 +02:00
smallmodel
92fdfe3f35
Moved MIN_HEARTBEAT_TIME and MAX_HEARTBEAT_TIME to sv_gqueryreporting.h 2023-08-29 18:45:46 +02:00
smallmodel
8b563e5232
Fixed heartbeat being always sent every frame 2023-08-29 08:17:23 +02:00
smallmodel
aeb4875fa5
Commented out call to WSACleanup() (as it is already handled by the engine) 2023-08-29 01:08:33 +02:00
smallmodel
5ebb9c61f9
Removed call to NET_Init (already called from main()) 2023-08-29 01:08:09 +02:00
smallmodel
c0e5b8fe15
Entities visibility enhancement
Implemented SV_WorldTrace(), SV_ClientIsVisibleTrace(), EntityDistCheck() and SV_ClientIsVisible()
Entities also will be hidden when:
- Their parent are not sent to clients
- They don't have a model
- They are behind t he farplane
- Clients can't see eachother with sv_netoptimize
2023-08-29 00:44:33 +02:00
smallmodel
f852efea7d
Added cvars 2023-08-29 00:04:07 +02:00
smallmodel
664ae905bb
Fixed lastRadarTime and lastVisCheckTime fields 2023-08-29 00:03:44 +02:00
smallmodel
243b0fd109
Added sv_netprofile, sv_netprofileoverlay, sv_netoptimize and g_netoptimize 2023-08-29 00:03:28 +02:00
smallmodel
43b0944403
Added centroid in entityShared_t and removed currentOrigin 2023-08-29 00:03:07 +02:00
smallmodel
ecc3c9f7b4
Renamed SVF_HIDEOWNER to SVF_SENT 2023-08-28 23:00:58 +02:00
smallmodel
296249b203
Fixed wrong SVF flags 2023-08-28 22:13:16 +02:00
smallmodel
8c1145bb9f
Clear all unsupported farplane fields in protocol below version 15 2023-08-28 20:59:02 +02:00
smallmodel
7ad18a68f8
Rendering fog fixes
Fixed wrong fog flag being used (must be GLS_FOG) in RB_SetupFog().
R_SetupFrustum():
- Use skybox farplane and farplane bias
- RB_SetupFog() is now the only function who handle fog activation

RE_RenderScene():
- Set renderTerrain, skybox_farplane and farplane_bias parameters
- Set color overrides
- Use farclip when necessary

RB_StageIteratorLightmappedMultitextureUnfogged(): Fixed issue with fog being reset
2023-08-28 20:50:32 +02:00
smallmodel
99ba396c24
Make sure to not error out if the map checksum isn't used. Also fixed cg.farclipOverride, must be -1 if the server is a mohaa server 2023-08-28 20:46:48 +02:00
smallmodel
f88e9960f2
Use the map's checksum only if the server has sv_mapChecksum exported 2023-08-28 20:45:10 +02:00
smallmodel
b53466ea0d
Fixed cheats variable being improperly configured 2023-08-28 20:44:33 +02:00
smallmodel
2afda6a470
Check the map checksum in CG_GameStateReceived 2023-08-28 20:29:18 +02:00
smallmodel
acc8081ef2
Added checksum return parameter in CL_CM_LoadMap for cgame 2023-08-28 20:28:59 +02:00
smallmodel
7433677ead
CG_Init(): clear fog overrides 2023-08-28 20:22:43 +02:00
smallmodel
4132f7efe6
Fixed farplane
Animated farplane is cleared when setting the farplane
Fixed farclip_override and farplane_color_override being mixed up
2023-08-28 20:22:06 +02:00
smallmodel
56e0f5797e
Don't iterate the sky when tr.farclip is set 2023-08-28 19:52:12 +02:00
smallmodel
54c142ce78
Flag mistake, now using GLS_MULTITEXTURE_ENV instead of GLS_FOG_WHITE 2023-08-28 19:46:31 +02:00
smallmodel
c106aeef2b
Clear fog when drawing 2D window 2023-08-28 19:45:54 +02:00
smallmodel
66bde85807
Added GLS_COLOR_MASK and GLS_FOG_BITS 2023-08-28 19:45:40 +02:00
smallmodel
08363511a7
farclip must be an integer 2023-08-28 18:36:03 +02:00
smallmodel
d6b93b712c
Fixed sound location when in camera view + subtract refdef viewangles when PMF_DAMAGE_ANGLES is set 2023-08-28 18:35:47 +02:00
smallmodel
a85d6d0f4c
Added PMF_DAMAGE_ANGLES for mohaas/mohaab 2023-08-28 18:34:50 +02:00
smallmodel
2c1f341099
Initialize cg.farplaneColorOverride values to -1 2023-08-28 17:53:47 +02:00
smallmodel
52bb709ca5
Implemented CG_SetupFog() and CG_SetupPortalSky()
CG_SetupFog() must be called by CG_CalcViewValues()
CG_SetupPortalSky() must be called in CG_DrawActiveFrame()
2023-08-28 17:53:35 +02:00
smallmodel
24ea958748
Added R_ClearRealDlights() declaration 2023-08-28 17:45:11 +02:00
smallmodel
b6143ce54c
Better fog rendering
Implemented RB_SetupFog()
2023-08-28 17:36:57 +02:00
smallmodel
463ea7d34b
Using viewParms.isPortalSky 2023-08-28 17:36:34 +02:00
smallmodel
1015302a7f
Remove GLS_FOG_ENABLED if stateBits has GLS_FOG_WHITE 2023-08-28 17:36:19 +02:00
smallmodel
c73f5917f8
Removed image->UseCount 2023-08-28 17:36:01 +02:00
smallmodel
9315cfa488
Added mohaas/mohaab variables 2023-08-28 17:35:54 +02:00
smallmodel
0f58b5780a
Fixed fall damage on mohaas/mohaab
Use a percentage of the health instead
2023-08-28 15:49:28 +02:00
smallmodel
edd5f07d48
Added healrate support (from mohaas) 2023-08-28 15:49:07 +02:00
smallmodel
a7f258f2b1
Fixed health not healing with the healrate 2023-08-28 15:48:12 +02:00
smallmodel
65dcb72cba
Fixed AmmoPickup not sending a message to the player 2023-08-28 15:41:06 +02:00
smallmodel
4885c536c8
Fixed wrong RB_CHECKOVERFLOW call (maybe #67) 2023-08-28 15:20:31 +02:00
smallmodel
b6204dab78
Added LOD support 2023-08-28 02:32:33 +02:00
smallmodel
5b5951483a
Added GetLodCutoff() and GetToolLodCutoff() 2023-08-28 02:26:36 +02:00
smallmodel
194d53569f
Added foliage AFunc 2023-08-28 00:51:43 +02:00
smallmodel
5e8b54be7e
Added new cvars from mohaas/mohaab 2023-08-27 23:24:06 +02:00
smallmodel
8dc91e413e
Commented out GLS_MULTITEXTURE_ENV since it was removed in mohaas 2023-08-27 23:18:48 +02:00
smallmodel
57cf513b39
Added $bumpmap and normalmap (from mohaab) 2023-08-27 23:18:32 +02:00
smallmodel
bb1326860b
Added normalmap fields 2023-08-27 23:18:21 +02:00
smallmodel
136838e40b
Fixed R_ColorShiftLightingBytes()
The lighting bytes must use tr.overbrightShift instead of tr.overbrightBits.
This makes the rendering more colorful
2023-08-27 22:18:09 +02:00
smallmodel
30d9483504
Decreased SHADERNUM and STATICMODEL shift values
When the number of shaders reached >1023, some surfaces started to be have random shaders started on them
The number of sorted shaders in a single game can now be up to 2048
2023-08-27 22:17:16 +02:00
smallmodel
05d3c50866
Stage fixes
Initialize animation phase to 0
Made CollapseMultitexture() work for more shaders
2023-08-27 22:15:08 +02:00
smallmodel
d5e93d863a
Set ps.walking in CG_TransitionSnapshot() instead 2023-08-27 19:53:29 +02:00
smallmodel
d3f93aae15
Interpolate fLeanAngle #66 2023-08-27 19:32:38 +02:00
smallmodel
963e4aa7ec
Restore saved Cgame state if the server is different (clear it otherwise) 2023-08-27 19:31:45 +02:00
smallmodel
5a250ea247
Fill cent->snapShotTime 2023-08-27 19:30:08 +02:00
smallmodel
bc8d8aafc0
Fixed the viewmodel not being normal when no prediction is active 2023-08-27 19:14:23 +02:00
smallmodel
f67ab4ec7f
Fixed HUD being hidden when in camera (like MG42) 2023-08-27 18:56:37 +02:00
smallmodel
cf9af20fbd
Console history and wheel scroll
Implemented KeyEvent() for both UIConsole and UIDMConsole
Added a call to AddHistory() in UIConsole::KeyEnter()
2023-08-27 18:55:49 +02:00
smallmodel
3be2a3eb79
Made m_caret a size_t 2023-08-27 18:49:39 +02:00
smallmodel
7dfd18f4fb
setTopItem(): don't set value below 0 2023-08-27 18:40:58 +02:00
smallmodel
05fc960338
Implemented getCount(), getPosition() and setPosition()
Fixed IteratePrev() being wrong
2023-08-27 18:40:38 +02:00
smallmodel
21d41ce14b
Use facfont-20 for objective font 2023-08-27 17:48:18 +02:00
smallmodel
1562ba3f97
Fixed CG_ImpactMark being wrong with fSScale and fTScale 2023-08-27 17:48:10 +02:00
smallmodel
2798e73707
Fixed CG_CastFootShadow not working if only one of the red/green/blue channels was below 0.01 2023-08-27 17:47:49 +02:00
smallmodel
89aeee4269
TIKI_LoadSetupCase: reworked case integer values 2023-08-27 17:29:04 +02:00
smallmodel
d50302fa41
Fixed tiki radius being wrong 2023-08-27 17:28:25 +02:00
smallmodel
8efae54450
Removed zero vectors assert in ProjectPointOnPlane(), it was removed since F.A.K.K 2 2023-08-27 17:13:12 +02:00
smallmodel
2785a72789
Fixed R_GatherLightSources crash 2023-08-27 17:01:53 +02:00
smallmodel
ac55a44761
Implemented CG_CastFootShadow, CG_CastSimpleFeetShadow
Reimplemented CG_EntityShadow
2023-08-27 17:01:40 +02:00
smallmodel
42f1a286a8
Added MASK_FOOTSHADOW 2023-08-27 16:33:51 +02:00
smallmodel
241fa5d485
Fixed backtrace always showing 0x0 2023-08-26 21:16:48 +02:00
smallmodel
e87f9c5710
Removed calls to NET_Init() as this function is already called from main() 2023-08-26 21:14:35 +02:00
smallmodel
c95a6ee3fd
Cleaned code up 2023-08-26 21:13:14 +02:00
smallmodel
10b954cb1a
Added MAX_KEYVALUES_LENGTH 2023-08-26 21:12:32 +02:00
smallmodel
cf7914b6f8
Fixed compiler warning about void* to int 2023-08-26 20:23:00 +02:00
smallmodel
e58e048f00
Added comment 2023-08-26 20:22:39 +02:00
smallmodel
b92cd8a64f
Fixed player info for SVC_Status
Fixed "protocol" always returning 17 for SVC_Info
Fixed server not processing gamespy queries (not appearing in the master list)
2023-08-26 18:18:30 +02:00
smallmodel
317aead26d
Replaced 1350 with MAX_INFO_STRING
Fixed wrong gamespy query being processed
2023-08-26 18:17:55 +02:00
smallmodel
e93780c66c
Fixed players_callback always returning players when there are none
Fixed gcd_think() crashing if it wasn't initialized
2023-08-26 18:17:28 +02:00
smallmodel
af8990acf0
Added SV_ProcessGamespyQueries() declaration 2023-08-26 18:16:35 +02:00
smallmodel
e41dcf03ad
Added CVAR_SERVERINFO flag to "protocol"
Removed CVAR_SERVERINFO flag from "com_protocol" (useless)
2023-08-26 18:15:39 +02:00
smallmodel
0209e8f782
Fixed call to GSICancelAvailableCheck() causing socket 0 (STDIN) to be closed, any read() afterwards would hang 2023-08-26 16:18:57 +02:00
smallmodel
50d935171e
Updated README 2023-08-25 23:25:04 +02:00
smallmodel
86ee9089e9
Include cg_radar.h 2023-08-25 23:22:44 +02:00
smallmodel
ba6fe112bb
Using Sys_LoadDll to load modules. Sys_LoadDll uses the binary path instead of the current working directory 2023-08-25 23:00:05 +02:00
smallmodel
15860a7795
Windows NT and Linux being both multi-user system, the homepath now defaults to %APPDATA%\openmohaa (Windows NT) and ~/openmohaa (unix) 2023-08-25 22:58:55 +02:00
smallmodel
78b3ad8075
As modules concern all 3 versions of the game, they're now installed in the root directory 2023-08-25 22:57:31 +02:00
smallmodel
f61bda330e
Set homepath to "openmohaa" (win32) and ".openmohaa" (unix) 2023-08-25 22:55:27 +02:00
smallmodel
5c9fceea2c
Use sizeof sockaddr_in instead of 16 2023-08-25 22:55:22 +02:00
smallmodel
32cceebc47
Use the Git abbreviated commit hash for the product version 2023-08-24 23:33:29 +02:00
smallmodel
9d921df733
Added Git abbreviated commit hash 2023-08-24 23:33:19 +02:00
smallmodel
428f8c183d
Put the extension before the platform string 2023-08-24 23:33:07 +02:00
smallmodel
45aae54b32
Renamed "Base" to "Allied Assault" 2023-08-24 23:32:40 +02:00
smallmodel
d9ca73bc4c
Updated README 2023-08-24 23:20:01 +02:00
smallmodel
c2e24da9bd
Initialize tracerspeed to 1 (this fixes turret bullets on mohaas/mohaab) 2023-08-24 23:19:49 +02:00
smallmodel
c6ae5ed551
Added gamespy cd key authorization code (mohaas/mohaab only) 2023-08-24 23:19:21 +02:00
smallmodel
0f86a5ee8a
Fixed "gamename" on mohaab
Use GS_GetCurrentGameName() and GS_GetCurrentGameVersion() in basic_callback
Using DF_ALLOW_LEAN_MOVEMENT instead of raw dmflags
2023-08-23 23:50:40 +02:00
smallmodel
803e53869b
Set qr_custom_handler to NULL instead of 0 2023-08-23 23:49:25 +02:00
smallmodel
a4fc25cca8
Increased the version number 2023-08-23 23:48:58 +02:00
smallmodel
28fbcf5628
Removed player printf destructor
Remove EF_PLAYER entflags from the Player destructor
2023-08-21 23:44:33 +02:00
smallmodel
3ea73febe4
Fixed spectate num 2023-08-21 23:33:23 +02:00
smallmodel
9eb3b3e1c3
Fixed infinite loop in SetPlayerSpectate() 2023-08-21 21:38:44 +02:00
smallmodel
48e1c39320
Fixed crash due do bad wrong delete after new[]
Fixed crash in ActorPath::ReFindPath when m_path is renewed
2023-08-21 21:38:32 +02:00
smallmodel
fe38c7650f
Updated the version number 2023-08-21 00:31:14 +02:00
smallmodel
5e2f5010f8
Fixed demo recording with different protocols 2023-08-21 00:20:04 +02:00
smallmodel
efce4703ca
Initialize demo_protocols from the com_protocol integer value 2023-08-21 00:19:46 +02:00
smallmodel
94ab4a5ac5
Moved MSG_ReadServerFrameTime and MSG_WriteServerFrameTime to qcommon/msg.cpp 2023-08-21 00:09:00 +02:00
smallmodel
58321be1ce
sv_fps must have CVAR_SAVEGAME and CVAR_SERVERINFO 2023-08-21 00:08:08 +02:00
smallmodel
20282ffa56
Fixed +speed having inverted up/down 2023-08-20 14:44:46 +02:00
smallmodel
ff4987cc81
Added more screenshots 2023-08-20 14:29:50 +02:00
smallmodel
80a22ca2ed
Fixed pm error 2023-08-20 14:13:34 +02:00
smallmodel
51ca0a06a7
Fixed death message color on mohaas/mohaab 2023-08-20 14:11:34 +02:00
smallmodel
010794418c
Fixed GetSpectateFollowOrientation using forward rather than right 2023-08-20 14:02:55 +02:00
smallmodel
51b5b2571a
Set lean info per game for Pmove 2023-08-20 14:02:33 +02:00
smallmodel
182a677337
Script: use AngleVector rather than AngleVectorsLeft for angles methods 2023-08-20 14:02:04 +02:00
smallmodel
17f6c25bc7
Fixed leaning values in mohaas/mohaab 2023-08-20 13:54:25 +02:00
smallmodel
31d19cb0f6
Fixed score entries on FFA gametype 2023-08-20 13:27:09 +02:00
smallmodel
6c65bba279
Fixed MSG_WritePackedAnimTime not writing the animation time sometimes 2023-08-20 02:33:08 +02:00
smallmodel
8ae15be0de
Create AnimationEvent with predefined args 2023-08-20 02:32:10 +02:00
smallmodel
11fb5ee2af
Fixed removebot never working 2023-08-20 02:23:49 +02:00
smallmodel
b68992e55e
Added numArgs parameter 2023-08-20 02:23:41 +02:00
smallmodel
007a7681eb
G_ClientDisconnect should print differently on mohaas/mohaab 2023-08-20 02:23:29 +02:00
smallmodel
7d4cdac52c
Use WaitTillAllowed for waitTillTimeout, waitTillAny and WaitTillAnyTimeout 2023-08-20 01:46:38 +02:00
smallmodel
916f38e1b2
"roundstart" misspell 2023-08-20 01:43:59 +02:00
smallmodel
39ae88a2ab
Remove "roundstart" waittill after the round has started 2023-08-20 01:43:37 +02:00
DJs3000
24f82e8e36
Add new arch (#61)
* Update q_platform.h

add e2k arch

* Update TargetArch.cmake

add e2k arch
2023-08-19 21:59:26 +00:00
smallmodel
247d09a09d
Fixed strip on windows 2023-08-19 23:29:23 +02:00
smallmodel
030b291af1
Fixed library locations 2023-08-19 23:29:19 +02:00
smallmodel
9d0a5faed3
Fixed errors 2023-08-19 23:23:36 +02:00
smallmodel
261b15851f
Fixed string() when no SDL 2023-08-19 23:10:48 +02:00
smallmodel
2929bd82a5
Removed func_expr as it's not used 2023-08-19 23:08:00 +02:00
smallmodel
4939927975
Fixed length decrease with an higher value 2023-08-19 23:07:47 +02:00
smallmodel
f9ef6733b9
Fixed errors on CMake 3.5 2023-08-19 23:07:12 +02:00
smallmodel
de08fe7ca3
Fixed linux compile error 2023-08-19 21:21:41 +02:00
smallmodel
482536ff1c
Added g_bot.h file 2023-08-19 21:21:32 +02:00
smallmodel
3089cc8bc3
Avoid assigning the token to an str 2023-08-19 21:17:52 +02:00
smallmodel
a307450e17
Made sourceLine argument optional to avoid string allocation 2023-08-19 21:12:03 +02:00
smallmodel
50cfc7e5ad
Added STRING_VIEWMODELANIM_DONE 2023-08-19 21:06:25 +02:00
smallmodel
5b82cc4f11
Made Event::ErrorInternal const
Fixed ProcessEvent() not handling exceptions
2023-08-19 21:00:04 +02:00
smallmodel
a83a76da95
Create an event with the argument count 2023-08-19 20:49:39 +02:00
smallmodel
2e4759ab1f
Using m_RunLabel instead of trying to get the game script everytime 2023-08-19 20:49:20 +02:00
smallmodel
af056d7646
Create an event with pcmd->num_args 2023-08-19 20:49:03 +02:00
smallmodel
46e57f0a1f
Added maxDataSize so the event can be preallocated 2023-08-19 20:48:46 +02:00
smallmodel
fe5473bc85
Added Set and SetScript with const_str
Fixed try/catch
2023-08-19 20:48:03 +02:00
smallmodel
1a03288144
SetFastData: Move the ScriptVariable instead of copying it 2023-08-19 20:47:36 +02:00
smallmodel
0c2326480b
Avoid reallocation if the assigned ScriptVariable is the same as the other ScriptVariable 2023-08-19 20:47:14 +02:00
smallmodel
24f3b3bc93
Added anyValue union field 2023-08-19 20:46:42 +02:00
smallmodel
459aa89ca2
Check if sourceLength is -1 instead 2023-08-19 20:46:24 +02:00
smallmodel
ec8eaacc69
Fixed "vstr" in the nextmap argument 2023-08-19 19:49:28 +02:00
smallmodel
84f55f627e
Updated README 2023-08-19 19:41:53 +02:00
smallmodel
a30f78e834
Prevent sv_maxbots + sv_maxclients from reaching MAX_CLIENTS 2023-08-19 19:35:20 +02:00
smallmodel
d22cda594f
Fixed TeamHitScoreLimit() (should use m_teamwins) 2023-08-19 19:34:57 +02:00
smallmodel
8cfa909b73
Reset bots on CleanUp
Fixed issues with WaitTill registration
2023-08-19 18:22:01 +02:00
smallmodel
86a6dd020f
Check for WaitTillAllowed instead 2023-08-19 18:21:32 +02:00
smallmodel
556133fa11
Use STRING_ROUNDSTART instead of "roundstart" 2023-08-19 18:20:26 +02:00
smallmodel
4001de1dde
Implemented WaitTillAllowed for all classes 2023-08-19 18:10:38 +02:00
smallmodel
7a57a25c58
Reworked the bot system 2023-08-19 17:58:54 +02:00
smallmodel
d95cdcc142
Moved bot functions to g_bot.cpp 2023-08-19 16:03:42 +02:00
smallmodel
d2a967e577
Don't use the explicit class name to access Entry_allocator 2023-08-19 15:48:50 +02:00
smallmodel
84adaa07e0
Removed reverse_label_list (use label_list enumeration instead) 2023-08-19 15:48:29 +02:00
smallmodel
2efeb7e972
Don't call Unregister with "delete" and "remove" in the destructor as UnregisterAll() will already do it
Don't call CancelPendingEvents() if the event system hasn't started
2023-08-19 15:39:59 +02:00
smallmodel
b9655e3f19
Fixed memory leaks: free all memory allocated by the game module 2023-08-19 15:24:37 +02:00
smallmodel
dce004ef13
Don't FreeAll() when destructing the block allocator, because it could be executed before containers destruction 2023-08-19 15:24:12 +02:00
smallmodel
b9f1530eec
G_ShutdownGame: shutdown events and deallocate game data 2023-08-19 15:23:48 +02:00
smallmodel
9b15b27f28
Removed CRT check debug flag 2023-08-19 13:36:54 +02:00
smallmodel
ff2e64a742
Fixed a tiny mistake present in all mohaa versions, with a possible overflow in client index in PF_centerprintf and PF_locationprintf 2023-08-19 13:36:12 +02:00
smallmodel
4e38b803fb
Fixed G_Random/G_CRandom 2023-08-19 13:32:32 +02:00
smallmodel
9825e1e6f2
Formatted source files 2023-08-19 03:02:30 +02:00
smallmodel
b278f2eafa
Var integer access fix 2023-08-19 03:00:19 +02:00
smallmodel
25912079db
Return NULL for ulist::GetPosition 2023-08-19 03:00:07 +02:00
smallmodel
b1753df1ed
Reworked con_set and con_arrayset so that they have their own Entry class 2023-08-19 02:56:51 +02:00
smallmodel
03143d1341
Added a compilation flag to debug memory 2023-08-19 02:19:09 +02:00
smallmodel
843b49d56b
Allow operator new and operator delete to be called when debugging memory 2023-08-19 02:19:01 +02:00
smallmodel
00644e7605
Alloc() and Free() will call malloc directly when debugging memory 2023-08-19 02:18:41 +02:00
smallmodel
93814bd05b
Fixed Skel_Alloc and Skel_Free macros when debugging memory 2023-08-19 02:18:11 +02:00
smallmodel
438ed2c0ea
Added a way to debug CRT heap (currently only on Windows with MSVC) 2023-08-19 02:17:45 +02:00
smallmodel
0310475957
Don't make "addbot", "removebot" and "bot" public commands 2023-08-19 02:17:12 +02:00
smallmodel
435bfe1271
Initialize angular_delta to 0 2023-08-19 01:38:38 +02:00
smallmodel
7ca532f0e4
FL_ANIMATE is 0x100000 2023-08-19 01:38:25 +02:00
smallmodel
8c3997f13b
Implemented Projectile::Think from mohaas/mohaab 2023-08-19 01:32:54 +02:00
smallmodel
d8ae1ce6b9
Added NULL to the end of SmokeGrenade event responses 2023-08-19 01:32:33 +02:00
smallmodel
5cb1e5de84
Fixed Vector_DotProduct returning wrong values 2023-08-19 01:02:18 +02:00
smallmodel
7fd2aff17b
Fixed entity trace with no valid trace 2023-08-19 00:58:06 +02:00
smallmodel
b9f3ee867b
Fixed switch label with "default" case 2023-08-19 00:57:29 +02:00
smallmodel
f16b992a97
Fixed assignments with case-insensitive event names 2023-08-19 00:57:19 +02:00
smallmodel
9ba5710412
Fixed variable comparison operators with VARIABLE_CHAR 2023-08-19 00:57:02 +02:00
smallmodel
7e6854f96b
Fixed EventPointsWithinDist taking the wrong argument number for the distance 2023-08-19 00:35:48 +02:00
smallmodel
aa25ef6c68
Removed EV_Player_UseHeld as there is already EV_GetUseHeld 2023-08-19 00:35:32 +02:00
smallmodel
9db1076603
Fixed VM_StepSlideMove using wrong start/end for gi.trace 2023-08-19 00:35:10 +02:00
smallmodel
7b39218af5
Fixed MASK_VEHICLE 2023-08-19 00:34:56 +02:00
smallmodel
ba5b2adf94
Fixed rcon command not working 2023-08-19 00:34:47 +02:00
smallmodel
ded7d941ea
Call SetAngles(ev) when setting the angles 2023-08-19 00:34:27 +02:00
smallmodel
09ed4e4a1d
Fixed grammar priorities of the unuary and complement 2023-08-19 00:34:14 +02:00
smallmodel
9b3aaa0f87
Using string+5 rather than string+(4+1) 2023-08-19 00:33:55 +02:00
smallmodel
a274325f43
Fixed wrong bounce sound 2023-08-18 15:30:18 +02:00
smallmodel
b0da0b8321
Removed nomonsters
Removed some serverinfo cvars
2023-08-18 15:25:26 +02:00
smallmodel
a241ea20fa
Removed nomonsters 2023-08-18 15:25:17 +02:00
smallmodel
f8d5a5ecd2
Fixed TeamWin with the axis team 2023-08-18 15:13:47 +02:00
smallmodel
f20b47ebc0
Fixed newlines when printing the teamwin 2023-08-18 15:10:35 +02:00
smallmodel
de10ab8df3
Fixed "is preparing for deployment" message location on mohaas/mohaab 2023-08-18 15:10:23 +02:00
smallmodel
47c7c5a5e3
Renamed centerprint to stringToPrint 2023-08-18 15:10:10 +02:00
smallmodel
80ada3225d
Fixed centerprint not working as intended 2023-08-18 15:09:32 +02:00
smallmodel
a1745829b2
Added product extension, as breakthrough clients rely on the extension word (like "Spearhead") to set g_servertype variable 2023-08-18 14:54:17 +02:00
smallmodel
b2853465ed
Capitalize first letter in PRODUCT_EXTENSION 2023-08-18 14:53:39 +02:00
smallmodel
c89091b4cd
Send gamever and serverType in SVC_Info 2023-08-18 14:53:26 +02:00
smallmodel
e5beb0d9b9
Explicitly use GT_SINGLE_PLAYER 2023-08-18 14:53:12 +02:00
smallmodel
80ab513d76
Fixed size() returning 0 when the type is VARIABLE_NONE (must return -1) 2023-08-18 14:14:32 +02:00
smallmodel
854136d85b
Fixed spelling mistake 2023-08-18 14:14:11 +02:00
smallmodel
25c417187b
Removed flex/bison source files from build
Flex/Bison must be used to generate those files
2023-08-18 01:46:16 +02:00
smallmodel
e3e9328ba3
Fixed small mistake when comparing with nextTime 2023-08-18 01:46:00 +02:00
smallmodel
3cc0c41b7b
Added ScriptArrayHolder constructor 2023-08-18 01:42:10 +02:00
smallmodel
697013bbbf
Fixed grammar priorities with const array 2023-08-18 01:18:18 +02:00
smallmodel
0080d4b9a8
Using ScriptError 2023-08-18 01:18:07 +02:00
smallmodel
8c391ef880
set cvar_modifiedFlags to the difference between flags 2023-08-18 01:09:24 +02:00
smallmodel
e6d3ca32f4
In CheckEndMatch, don't put any flag in cvars 2023-08-18 01:09:09 +02:00
smallmodel
fab78f933e
Using SHORT2ANGLE for ucmd angles 2023-08-17 22:44:27 +02:00
smallmodel
5cd7d89e72
Fixed wrong sv flags being used 2023-08-17 22:38:25 +02:00
smallmodel
15e8146306
Don't hide the HUD when in turret or vehicle 2023-08-17 22:38:09 +02:00
smallmodel
250f1d090e
Fixed SanitizeName 2023-08-17 22:37:35 +02:00
smallmodel
03c5864034
Fixed secondarycharge animation 2023-08-17 22:37:09 +02:00
smallmodel
07b7f10912
Fixed UnlimitedAmmo() behavior (use the behavior from mohaas/mohaab) 2023-08-17 21:31:22 +02:00
smallmodel
0e1837db31
Fixed smoke and rifle grenade max ammo 2023-08-17 21:30:57 +02:00
smallmodel
070fe17473
G_PushEntity: use cylinder 2023-08-17 21:30:34 +02:00
smallmodel
ba607a0aad
Ignore the owner of the passEnt entity 2023-08-17 21:30:21 +02:00
smallmodel
2b38a0f48e
Fixed wrong opcode for method event 2023-08-17 21:29:55 +02:00
smallmodel
a1fb3b283c
Remove clipmask flags for physics_on if it has second parameter specified 2023-08-17 20:13:58 +02:00
smallmodel
12e85aba45
Also check if the groundentity has no movetype 2023-08-17 20:05:30 +02:00
smallmodel
44fe18fef1
Added MASK_SCRIPT_SLAVE 2023-08-17 20:04:58 +02:00
smallmodel
28de2543ec
Removed listenerVars as it can cause issues 2023-08-17 19:51:53 +02:00
smallmodel
4435984b81
Renamed label to m_Thread 2023-08-17 19:29:03 +02:00
smallmodel
1435489a43
Fixed floats with negative values 2023-08-17 19:17:16 +02:00
smallmodel
3d20b3a232
Using MASK_SHOT_TRIG for BulletAttack, so it touches triggers 2023-08-17 19:17:02 +02:00
smallmodel
97543622bf
Added MASK_SHOT_TRIG
Fixed MASK_SHOT values
2023-08-17 19:16:49 +02:00
smallmodel
a9374f068b
Added a check to avoid packed from being out of bounds in MSG_PackCoord() 2023-08-17 18:24:50 +02:00
smallmodel
d80e9d80e7
Fixed getcvar returning wrong values sometimes 2023-08-17 18:24:30 +02:00
smallmodel
4f757445c4
Set vehicle to be in godmode if the player is in godmode 2023-08-17 18:24:20 +02:00
smallmodel
2749ab92b2
trigger_hurt inherits from Trigger and not TriggerUse 2023-08-17 18:23:53 +02:00
smallmodel
011bee9f33
Implemented MSG_HandleCGMBufferOverflow
Fixed CGM buffer error for non-connected clients
2023-08-17 18:23:24 +02:00
smallmodel
1b86e60548
Implemented all mohaas/mohaab features like animated farplanes, skybox speed/farplane, etc. 2023-08-17 17:39:54 +02:00
smallmodel
23e01fc1a7
Make sure to set m_data.containerValue when copying the value 2023-08-17 17:39:26 +02:00
smallmodel
2c9c80d7bc
Don't set the targetname if world doesn't exist
Prevent world from being retargeted
2023-08-17 17:39:12 +02:00
smallmodel
5146b1f36b
Made SetTargetName virtual functions 2023-08-17 17:37:43 +02:00
smallmodel
bc81fe78b2
Check if the ent is inside the hit entity (this fixes trigger_hurt issues in mp_stadt_dm 2023-08-17 16:10:29 +02:00
smallmodel
4de1b7c73b
When showing entities number, add maxs.z offset 2023-08-17 16:09:46 +02:00
smallmodel
3c8c4e9f97
Call SetSize() directly from setModel() 2023-08-17 16:09:29 +02:00
smallmodel
c366c10530
Fixed level/parm/game vars being overwritten 2023-08-17 16:09:09 +02:00
smallmodel
6f5106803d
Made firstLeafBrush and firstLeafSurface as intptr_t, as sometimes it's an offset to an unrelated memory location (in 64-bit, it could be a very far away memory location) 2023-08-17 16:08:40 +02:00
smallmodel
55a6b7956a
Changed event priorities 2023-08-17 16:07:51 +02:00
smallmodel
911d1f1706
Fixed OP_STORE_FIELD and OP_STORE_FIELD_REF 2023-08-17 16:07:38 +02:00
smallmodel
56fba733f3
Always cast targetlist to const array value, so the iteration remains untouched 2023-08-17 03:18:41 +02:00
smallmodel
a3c65ef7e4
Fixed containerValue allocation (mustn't allocate a new one) 2023-08-17 03:18:19 +02:00
smallmodel
73bc196592
Fixed cmd execution while iterating over a target list 2023-08-17 03:04:01 +02:00
smallmodel
8487099264
Fixed crash due to improper ScriptPointer usage 2023-08-17 03:03:40 +02:00
smallmodel
bdcd0dbd56
Fixed EventEnd copying and adding pointer value 2023-08-17 03:03:26 +02:00
smallmodel
3c2600648c
Fixed "immediateremove" wrong spelling 2023-08-17 03:03:08 +02:00
smallmodel
f1abfeced6
Fixed grammar for if/while/for statements with a single line and a semi-colon 2023-08-17 02:59:54 +02:00
smallmodel
99bce5a11a
Fixed identifiers like "break_formation" being treated as "break" and "_formation" separately 2023-08-17 01:08:37 +02:00
smallmodel
ab5a3604bf
Fixed grammar like "$(value).field"
Fixed newline in if statements
Fixed if/else being ambiguous
2023-08-17 01:05:55 +02:00
smallmodel
fab7d8539c
Fixed an extremely nasty bug with libmad: mad.h defines SIZEOF_INT to 4, libmad c files don't include this mad.h file, which mean libmad c files will use 8-bytes int, and snd_codec_mp3.c will use 4-bytes int 2023-08-16 20:53:20 +02:00
smallmodel
0347a5ca0b
Renamed MAX_CHANNELS to MAX_SKELETOR_CHANNELS to avoid conflict with sound channels (MAX_CHANNELS) 2023-08-16 20:51:19 +02:00
smallmodel
42ad1cb41c
Removed libmad from includes 2023-08-16 20:50:26 +02:00
smallmodel
64e3c18fb9
Removed assertion (not present in mohaa) 2023-08-16 19:22:10 +02:00
smallmodel
7e113359b3
Fixed crash with healrate 2023-08-16 19:14:05 +02:00
smallmodel
467802c466
Fixed crash when loading savegame 2023-08-16 19:13:52 +02:00
smallmodel
ce1b3aaee9
Fixed ArchiveAliases
Archive PathSearch
2023-08-16 19:13:38 +02:00
smallmodel
1a53bdd584
Implemented PathSearch::ArchiveDynamic 2023-08-16 18:48:38 +02:00
smallmodel
5521e7654d
Fixed number of script classes being replaced by the number of threads, causing archive read to go wrong 2023-08-16 18:29:36 +02:00
smallmodel
73716dd624
Fixed silly mistake in the container archive function 2023-08-16 18:29:06 +02:00
smallmodel
840d23dcac
Fixed sizeof(index) 2023-08-16 18:28:50 +02:00
smallmodel
525a0c7c82
Renamed and moved soundSystem_t to snd_local_new.h 2023-08-16 18:14:06 +02:00
smallmodel
46c35057fb
Made omohserver an interface 2023-08-16 18:13:47 +02:00
smallmodel
6d03b9763a
Using S_LoadData 2023-08-16 18:13:30 +02:00
smallmodel
9eaecb0a2a
Fixed a crash when loading a script, on non-MSVC binaries 2023-08-16 16:07:42 +02:00
smallmodel
c274af839e
Updated README 2023-08-16 13:27:29 +02:00
smallmodel
f9232840e4
Fixed sprint not working 2023-08-16 13:17:01 +02:00
smallmodel
3ea40fda82
Fixed runspeed values 2023-08-16 13:16:56 +02:00
smallmodel
c357c2614a
Added DEBUG_DROP_ASSERT CMake definition 2023-08-16 13:16:04 +02:00
smallmodel
efed6d0eac
Fixed script developer printf 2023-08-16 02:43:22 +02:00
smallmodel
244220f031
Fixed spawnpoint issues due to trace mask 2023-08-16 02:37:57 +02:00
smallmodel
7ce87575bc
Added MASK_PLAYERSTART 2023-08-16 02:37:25 +02:00
smallmodel
401cfeda65
Make sure to not call CanSeeEnemy() if the enemy is NULL 2023-08-16 02:31:30 +02:00
smallmodel
a45a8c7742
Fixed sentient linking/unlinking 2023-08-16 02:31:12 +02:00
smallmodel
c80b360918
Fixed "ignoreclock" event name 2023-08-16 02:22:39 +02:00
smallmodel
8514ef6ef8
Fixed Objective::SetText event parameter 2023-08-16 02:18:23 +02:00
smallmodel
9b1dc34ea1
Fixed score data for mohaas/mohaab 2023-08-16 02:08:00 +02:00
smallmodel
f5490321e7
Set default explosion to "fx/fx_explosion.tik" 2023-08-16 02:04:28 +02:00
smallmodel
1f4393e3b2
Call DM_Team::AddKills when the player got killed 2023-08-16 01:32:53 +02:00
smallmodel
8aa6a16a27
Export g_TOWObjectiveMan 2023-08-16 01:32:07 +02:00
smallmodel
286f553a54
Fixed uninitialized variable 2023-08-16 01:06:51 +02:00
smallmodel
f0ec50e37b
Implemented UIRadar::Draw() 2023-08-16 00:45:40 +02:00
smallmodel
c1ee0332e3
Fixed parameter of Draw_StretchPic2 2023-08-16 00:45:26 +02:00
smallmodel
d2737f2b40
Fixed CL_UnpackNonPVSClient not unpacking the clientNum 2023-08-16 00:45:12 +02:00
smallmodel
0d501ec38a
Fixed CG_SameTeam always returning true 2023-08-16 00:44:44 +02:00
smallmodel
d39e6421fe
Call CG_UpdateRadarClient() in CG_AddCEntity 2023-08-16 00:44:30 +02:00
smallmodel
c2125947ab
Removed R_RegisterSkin 2023-08-16 00:20:16 +02:00
smallmodel
953a33a6ff
Call CG_InitRadar and restore saved cgame state 2023-08-16 00:20:10 +02:00
smallmodel
883e7884c4
Updated README 2023-08-16 00:19:30 +02:00
smallmodel
508903c3b1
Moved console_spam_filter to Com_Init 2023-08-16 00:08:35 +02:00
smallmodel
9116063d3f
Added CL_RestoreSavedCgameState and CL_RestoreSavedCgameState 2023-08-16 00:08:24 +02:00
smallmodel
e2a0d2d01e
Fixed function parameter 2023-08-16 00:07:45 +02:00
smallmodel
5343949254
Implemented Draw_StretchPic2 2023-08-15 23:52:22 +02:00
smallmodel
c17454b124
Renamed bValid to teamShader 2023-08-15 23:24:23 +02:00
smallmodel
4f8dc5dc2a
Added radar variables 2023-08-15 22:47:11 +02:00
smallmodel
0fea47bb69
Added Draw_StretchPic2 2023-08-15 22:44:37 +02:00
smallmodel
47665fcd70
Added CL_ReadNonPVSClient and CL_UnpackNonPVSClient 2023-08-15 22:22:35 +02:00
smallmodel
968b073338
Implemented client-game radar code 2023-08-15 22:21:44 +02:00
smallmodel
03582bb59a
Added radars and radarShaders in cg_t 2023-08-15 22:21:24 +02:00
smallmodel
149d3ce2fc
Added CL_InitRadar 2023-08-15 22:21:01 +02:00
smallmodel
fe5e151d89
Added YawToAxis 2023-08-15 22:20:33 +02:00
smallmodel
06a7341eda
Moved radarUnpacked_t from server.h to q_shared.h 2023-08-15 22:20:25 +02:00
smallmodel
456ed42e14
Implemented the radar system for non-pvs clients 2023-08-15 19:29:12 +02:00
smallmodel
2337f93df8
Added console_spam_filter 2023-08-15 19:28:38 +02:00
smallmodel
ad675b05ac
Better wording 2023-08-15 18:09:22 +02:00
smallmodel
44f6de9524
Added riscv and riscv64 2023-08-15 16:45:13 +02:00
smallmodel
e25605b898
Updated README 2023-08-15 16:02:02 +02:00
smallmodel
919d14e329
Fixed README 2023-08-15 15:24:56 +02:00
smallmodel
8fc64cd1b1
Using libsdl-org/setup-sdl Github Actions 2023-08-15 15:16:00 +02:00
smallmodel
028a7d6125
Setup SDL for CodeQL 2023-08-15 13:35:16 +02:00
smallmodel
60b9a6e2e0
renamed to playerstart.h 2023-08-15 13:16:36 +02:00
smallmodel
9ad515335a
Added g_utils.h 2023-08-15 13:04:18 +02:00
pryon
7593ea53f9
Fix generated executable/lib names missing the -dbg postfix on Visual Studio (#55)
* Fix generated executable/lib names missing the -dbg postfix on Visual Studio

* Spaces to tabs
2023-08-15 10:57:36 +00:00
smallmodel
07374ba1ed
Compilation errors fixes 2023-08-15 12:47:49 +02:00
smallmodel
2deba01a5f
Updated the README 2023-08-15 01:42:49 +02:00
smallmodel
3daee90b5b
Moved functions from game.cpp/game.h to where they should be (g_main, g_utils) 2023-08-15 01:41:35 +02:00
smallmodel
c4ba60afbd
Added TRANS_BSP to G_BeginIntermission 2023-08-15 01:38:55 +02:00
smallmodel
81e9ce10cd
Fixed warning spam if the default value is different 2023-08-15 01:27:54 +02:00
smallmodel
c4738966fe
Using g_utils.cpp from fakk 2023-08-15 01:27:35 +02:00
smallmodel
0eedc4e2f8
Fixed compilation warnings 2023-08-15 01:26:58 +02:00
smallmodel
14f9368575
Implemented all setters/getters
7 remaining important methods to implement
2023-08-15 00:24:07 +02:00
smallmodel
394546dee7
Added means of death strings 2023-08-14 23:37:14 +02:00
smallmodel
e86e5c0d80
Renamed MOD_MINE to MOD_LANDMINE
Added MOD_AAGUN
2023-08-14 23:37:05 +02:00
smallmodel
e0b5a62c4f
Allow obj maps to be loaded in any game types 2023-08-14 20:44:46 +02:00
smallmodel
7fb42cf655
Fixed message printing on mohaas/mohaab 2023-08-14 20:44:28 +02:00
smallmodel
819f6bcf71
Using DM_Manager::CheckEndMatch() algorithm from mohaab 2.40 2023-08-14 20:35:23 +02:00
smallmodel
ad47f8855b
Implemented TOW Entities 2023-08-14 19:54:50 +02:00
smallmodel
a50102ef52
Changed CONTROLLER_BOTH to CONTROLLER_DRAW
Added GetObjectiveIndex()
2023-08-14 19:53:35 +02:00
smallmodel
0b2a0634f5
Moved eController to Entities.h 2023-08-14 19:21:17 +02:00
smallmodel
8ea32fee31
Added Entities with all classes, methods and events (unimplemented) 2023-08-14 19:20:53 +02:00
smallmodel
f0571385d5
Export events for AISpawnPoint 2023-08-14 19:00:16 +02:00
smallmodel
83318af532
Export EV_Weapon_SetProjectile 2023-08-14 17:43:28 +02:00
smallmodel
860c9b33ef
Made AddObjective and SetCurrentObjective static 2023-08-14 15:02:25 +02:00
smallmodel
ecbd6ae282
Renamed WITH_CLIENT to BUILD_NO_CLIENT 2023-08-14 13:31:42 +02:00
smallmodel
3ec799d150
Compiled parser 2023-08-14 03:15:48 +02:00
smallmodel
72715c1a85
Fixed CL_Disconnect being passed with arguments 2023-08-14 03:15:42 +02:00
smallmodel
16d262f6ee
Fixed floats being interpreted as integers sometimes 2023-08-14 03:09:38 +02:00
smallmodel
49850940d6
Using objective flags enumeration 2023-08-14 02:39:32 +02:00
smallmodel
e634fb5022
Using objective flags enum 2023-08-14 02:34:06 +02:00
smallmodel
c0726f0634
Added objective status and flags enum 2023-08-14 02:33:59 +02:00
smallmodel
91dc3e5884
Fixed configstring index because of denormalization 2023-08-14 02:24:48 +02:00
smallmodel
ba2c3ed5fd
Fixed lean on protocols before 2.0 2023-08-14 02:12:30 +02:00
smallmodel
161f7e3313
Fixed wrong current objective
Added support for objective location per team
2023-08-14 02:11:26 +02:00
smallmodel
f2f7afadef
Don't resend the game state if the serverId is the same as the restarted server Id 2023-08-14 01:57:02 +02:00
smallmodel
0898bffb43
Fixed getboundkey1/getboundkey2 crashing when the key is null 2023-08-14 01:56:43 +02:00
smallmodel
99dc7bf7f2
Fixed CL_MapLoading always flushing 2023-08-14 01:56:25 +02:00
smallmodel
64acea9018
Call SV_CheckSaveGame in Com_Frame 2023-08-14 01:27:25 +02:00
smallmodel
8e05347ba0
Moved CL_FinishedIntro and SV_CheckSaveGame to qcommon.h 2023-08-14 01:27:13 +02:00
smallmodel
07e90d37ee
Fixed bad angle 2023-08-14 00:22:25 +02:00
smallmodel
71bd04e5b2
Fixed weapon bullet trace
Fixed projectile being always removed in single-player mode
2023-08-14 00:22:05 +02:00
smallmodel
95510279ed
Fixed trigger having no contents when a model is set 2023-08-14 00:21:44 +02:00
smallmodel
f1502833b2
Fixed primary/secondary attacks not working 2023-08-13 23:21:11 +02:00
smallmodel
e6448697d3
Let cg cleanup temp models
Fixed server restart
2023-08-13 23:20:51 +02:00
smallmodel
5a96d6dd96
Added snd_local_new for new local functions 2023-08-13 23:20:15 +02:00
smallmodel
8d6b3d0bd8
Added cg_archive and cg_radar (unimplemented) 2023-08-13 23:20:00 +02:00
smallmodel
1fd0cd097f
Fixed the objective index 2023-08-13 22:08:10 +02:00
smallmodel
421126db38
Optimized ScriptVM::EventGoto 2023-08-13 22:07:33 +02:00
smallmodel
7258a2e972
Fixed CG_DrawObjectives stack overflow 2023-08-13 22:07:19 +02:00
smallmodel
df66ab0339
Fixed EmitField bug
Clear the previous opcode when a new label is emitted
2023-08-13 21:55:22 +02:00
smallmodel
c49d0c7afa
Fixed iprintln(bold) not working properly with multiple arguments 2023-08-13 20:22:39 +02:00
smallmodel
421b3d6375
Fixed crouch on mohaa and mohaas/mohaab 2023-08-13 20:20:36 +02:00
smallmodel
11ef489225
Added basic implementation of sound callback
Implemented S_IsSoundPlaying
2023-08-13 20:20:17 +02:00
smallmodel
e1da6797c5
Using S_FLAG_DO_CALLBACK 2023-08-13 20:19:51 +02:00
smallmodel
430c7d1a57
Fixed ScriptCheck always failing regardless of the g_scriptcheck value 2023-08-13 20:19:40 +02:00
smallmodel
d3794c0dd9
Fixed bad event when using '$' key 2023-08-13 20:19:26 +02:00
smallmodel
eef1368083
using g_gametype variable directly instead of using Cvar_VariableValue 2023-08-13 20:19:03 +02:00
smallmodel
6dfefa04f5
Fixed SV_AllowSaveGame always returning true 2023-08-13 20:18:46 +02:00
smallmodel
8b17d81545
Fixed variables improperly used on stack under some circumstances 2023-08-13 20:17:59 +02:00
smallmodel
ec58ca0f13
Added S_FLAG_DO_CALLBACK 2023-08-13 20:17:33 +02:00
smallmodel
3fd87f90a2
Fixed objectives not showing properly 2023-08-13 20:17:23 +02:00
smallmodel
9f268b0f6a
Using Director.Pause() instead 2023-08-13 17:59:59 +02:00
smallmodel
f857116f75
Fixed script crashes 2023-08-13 17:59:49 +02:00
smallmodel
ea78d96bc3
Fixed disabled view model animation
Fixed pmove viewheight
2023-08-13 17:59:41 +02:00
smallmodel
0be9e69833
Added protocol for pmove_t for PM_CheckDuck 2023-08-13 17:59:21 +02:00
smallmodel
8171641e3a
Fixed "dmmessage" not being logged (it's a bug in all versions of mohaas/mohaab) 2023-08-13 16:13:08 +02:00
smallmodel
ee6014a30f
Fixed Player::CondCheckMovementSpeed returning wrong value (expects it to return true if below the weapon's max fire movement) 2023-08-13 16:11:59 +02:00
smallmodel
16c22a3ee5
Added "idle0", "idle1", "idle2" view model animations
Fixed respawn time after death
Fixed Sentient not switching to the primary weapon when spawning
Fixed weapon select not showing
Initialize all Player variables
Remove projectiles when switching teams
Set viewmodelanim to disabled when reaching the weapon's max fire movement
2023-08-13 16:11:25 +02:00
smallmodel
571e48fecf
Call Weapon::Charge in Sentient::ChargeWeapon
Don't charge again if sentient is already charging weapon
2023-08-13 16:07:46 +02:00
smallmodel
973d7c5f34
Implemented Weapon::Charge
Cancel overcooked events in Weapon::ReleaseFire
2023-08-13 16:07:11 +02:00
smallmodel
a1c5ca288a
Renamed m_iOwnerTeam to m_iTeam
Implemented SetFuse, ArcToTarget, BecomeBomb, and DieInwater
Fixed projectile life being wrong when charging
2023-08-13 16:06:49 +02:00
smallmodel
e330d00565
Added dmmessage monitoring 2023-08-13 14:19:14 +02:00
smallmodel
6feeb21e21
Fixed uninitialized angular delta variable 2023-08-13 14:19:05 +02:00
smallmodel
bb5cf24d5f
Fixed "isabandoned" mispelling 2023-08-13 03:34:28 +02:00
smallmodel
0dda70cca1
Fixed event parameters being wrong 2023-08-13 03:34:19 +02:00
smallmodel
5e83e03e33
Major grammar/lexer/compiler fixes 2023-08-13 03:34:09 +02:00
smallmodel
d2b3f6c12b
Added stub yacc / lex 2023-08-12 20:00:12 +02:00
smallmodel
f5af33b181
Major script engine fixes 2023-08-12 19:59:40 +02:00
smallmodel
0da1ed8764
Fixed canseenoents having the wrong name 2023-08-12 19:59:17 +02:00
smallmodel
8aa6f29c4c
Added all script functions from mohaas/mohaab 2023-08-12 14:02:43 +02:00
smallmodel
1b7a4442d3
Added no_fade parameter to G_BeginIntermission 2023-08-12 14:00:14 +02:00
smallmodel
a163df993c
Added MOD_MINE_EXPLOSION 2023-08-12 13:59:56 +02:00
smallmodel
2787007b9d
Cleaned up class 2023-08-12 03:10:10 +02:00
smallmodel
cea2c178b5
Fixed header 2023-08-12 03:05:06 +02:00
smallmodel
77a9cd5a9a
Call Director.Unpause() to execute running scripts 2023-08-12 03:04:31 +02:00
smallmodel
ec3259271e
Removed THREAD_CONTEXT_SWITCH 2023-08-12 03:03:34 +02:00
smallmodel
ae02abba3b
Cleaned up ScriptMaster 2023-08-12 03:03:26 +02:00
smallmodel
bf960f6f32
Cleaned up ScriptThread 2023-08-12 02:40:30 +02:00
smallmodel
66a1087099
Moved ScriptMaster methods here 2023-08-12 02:40:03 +02:00
smallmodel
c1a431f857
Added all mohaas/mohaab features (SetWeaponIdleState, PingForMines, ForceLandmineMeasure, ForceDropWeapon and ForceDropHealth)
Set m_fDamageMultipliers depending on whether or not g_realismmode is set
Minor fixes in the sentient constructor
2023-08-12 00:49:07 +02:00
smallmodel
dac5279a59
Archive is_paused and angular_delta 2023-08-12 00:47:39 +02:00
smallmodel
a175ea27d7
Cleanup weapon class
Added ShowInfo, SetItemSlot and SetIdleState
2023-08-12 00:10:47 +02:00
smallmodel
ddac42e21e
Call Weapon::GetZoom() instead 2023-08-11 23:54:43 +02:00
smallmodel
34535ad415
Moved AnimationEvent from Animate to a separate source file 2023-08-11 21:48:25 +02:00
smallmodel
c0597e441c
Moved AnimationEvent from Animate to a separate source file
Implemented whole animate class from mohaas/mohaab
2023-08-11 21:30:47 +02:00
smallmodel
04b66684dd
Added a function to get an animation's angular delta over time 2023-08-11 21:11:16 +02:00
smallmodel
244a2e66f9
Added TIKI_Anim_DeltaOverTime 2023-08-11 21:10:29 +02:00
smallmodel
55b737e730
Set global channel from local to -1 2023-08-11 21:10:14 +02:00
smallmodel
059dacf2a7
Added GetAngularDeltaOverTime() to return the animation's angular delta over time 2023-08-11 21:09:47 +02:00
smallmodel
41f7003747
Fixed SetPlayerView, SetupView, PlayerAngles
UpdateStats changes:
- Added support for allied and axis objective locations
- Vehicle health
- Healrate
- Secondary ammo
2023-08-11 03:13:36 +02:00
smallmodel
64ba900511
Use GetRemoteOwner() properly 2023-08-11 03:09:33 +02:00
smallmodel
e371b4bbd3
Replaced unused stats 2023-08-11 03:09:19 +02:00
smallmodel
aa44150525
Added some mohaas/mohaab methods (stubs) 2023-08-11 03:09:10 +02:00
smallmodel
3572be718a
Use usercmd_s instead of usercmd_t 2023-08-11 03:08:56 +02:00
smallmodel
a56d74814b
Try to play pain animation in DamageFeedback 2023-08-11 01:58:22 +02:00
smallmodel
8d41b58635
Using hitloc enum instead of macros 2023-08-11 01:34:21 +02:00
smallmodel
e80f326ee6
Proper implementation of DamageFeedback 2023-08-11 01:21:50 +02:00
smallmodel
c5bd64912a
Added MOVETYPE_PORTABLE_TURRET 2023-08-11 01:21:29 +02:00
smallmodel
8a808b616e
Apply fall damage differently on mohaas/mohaab
Ignore world effects if no-cliping
2023-08-11 00:54:15 +02:00
smallmodel
91bb2f2e0b
Enable god mode for the vehicle the player is in 2023-08-11 00:48:09 +02:00
smallmodel
aa4e6a0651
Removed SpawnDamageEffect
DoUse: Call RemoveFromVehiclesAndTurretsInternal() directly
Use G_PMDrawTrace if sv_drawtrace is above 1
Set allow lean while moving
Disable movement prediction if player is glued onto something
Multiply the speed by the weapon movement speed
Added Teamkill warn and kick
Added support for invulnerability, sprint and team spawn
Added support for heal rate
Added talk icon
2023-08-11 00:43:40 +02:00
smallmodel
8e9ff2b289
Added G_PMDrawTrace 2023-08-11 00:13:29 +02:00
smallmodel
d53ab8540e
Fixed Unix compilation warnings/errors 2023-08-10 23:06:03 +02:00
smallmodel
7b133e5b2f
Fixed const param 2023-08-10 23:04:47 +02:00
smallmodel
2b72959935
Call Obituary if there is also an inflictor
Clear pain animation when killed
Increment team kills count when a teammate was killed
2023-08-10 21:38:37 +02:00
smallmodel
82d0b62631
Implemented EndAnim_Pain 2023-08-10 21:37:53 +02:00
smallmodel
7205e27c8c
Using death messages implementation from mohaas/mohaab 2023-08-10 21:26:28 +02:00
smallmodel
c8d1248d86
Added MOD_MINE means of death 2023-08-10 21:26:07 +02:00
smallmodel
845e4556ef
Added g_obituarylocation (openmohaa-specific parameter) 2023-08-10 21:23:10 +02:00
smallmodel
a92bfbde40
Fixed variable names 2023-08-10 21:22:50 +02:00
smallmodel
999b6409b3
Fixed InitEdict, InitHealth
InitModel: IT/SC skins support, and voiceType fix
Respawn: Set invulnerability
2023-08-10 20:14:34 +02:00
smallmodel
0ae0be4047
Added more ammo to initialize
Added stopwatch parameter for mohaas/mohaab
Initialize mine variables in InitState
2023-08-10 19:36:14 +02:00
smallmodel
fc7029c271
Added stopwatch type 2023-08-10 19:32:21 +02:00
smallmodel
307ee117bd
Initialize invulnerability
Set the player view accordingly when choosing a spawn point
Don't set m_fDamageMultipliers in realism mode
Score isn't processed in single-player anymore
2023-08-10 19:14:51 +02:00
smallmodel
087d28eb9a
Added GT_TOW and GT_LIBERATION for SelectSpawnPoint() 2023-08-10 19:11:39 +02:00
smallmodel
1deea345bc
Renamed team to teamnum 2023-08-10 18:49:57 +02:00
smallmodel
e0fa706f6c
Implemented EquipWeapons, Stats, TickTeamSpawn, UserSelectWeapon, AllowTeamRespawn and EventKillAxis 2023-08-10 18:48:46 +02:00
smallmodel
cf794d2b95
Added DF_OLD_SNIPER and DF_DISALLOW_KAR98_MORTAR 2023-08-10 18:42:13 +02:00
smallmodel
391e82bb92
Formatted source files 2023-08-10 18:41:49 +02:00
smallmodel
83a44b3158
Implemented RemoveFromVehiclesAndTurretsInternal 2023-08-10 17:01:55 +02:00
smallmodel
8cd0e6c5bf
Added FixedTurret, PortableTurret and CarryableTurret (unimplemented) 2023-08-10 17:01:43 +02:00
smallmodel
619ab00035
Added player-specific methods 2023-08-10 17:01:19 +02:00
smallmodel
4ded5c3380
Added EV_Weapon_SetAmmoClipSize declaration 2023-08-10 17:00:51 +02:00
smallmodel
85fa2185f8
Added DetachRemoteOwner 2023-08-10 17:00:38 +02:00
smallmodel
ab39259bbe
Moved vote options stuff to bg_voteoptions.h 2023-08-10 17:00:17 +02:00
smallmodel
9bf2065d18
Implemented battle language methods and GetTeamDialogPrefix/GetNationalityPrefix 2023-08-10 14:18:40 +02:00
smallmodel
ceb121d588
Added MASK_BATTLELANGUAGE 2023-08-10 14:14:50 +02:00
smallmodel
e7dbc25ca0
Made entity parameter a constant instance 2023-08-10 14:14:39 +02:00
smallmodel
7386784765
Renamed clientPersistant_t to client_persistant_t
Named client_peristant_t fields correctly
2023-08-10 13:34:04 +02:00
smallmodel
9062952539
Implemented GiveNewWeaponsCheat, GetSpectateFollowOrientation, EnsurePlayerHasAllowedWeapons, SetPlayerSpectateRandom, RetrieveVoteOptions and GetNationalityPrefix
mohaas/mohaab fixes
2023-08-10 13:31:35 +02:00
smallmodel
9f0a479c3b
added playerAnimSlot_t enum 2023-08-10 13:30:32 +02:00
smallmodel
517b9296dc
Using sv_walkspeedmult instead of sv_walkspeed 2023-08-10 12:09:07 +02:00
smallmodel
3ca09613e1
Fixed string constants 2023-08-10 12:08:53 +02:00
smallmodel
ba931cbedf
Added all mohaas/mohaab cvars 2023-08-10 12:04:45 +02:00
smallmodel
090b354b23
Added all mohaas/mohaab events, methods (partially implemented) 2023-08-10 03:56:13 +02:00
smallmodel
dd30bfde15
Set protocol from com_protocol 2023-08-10 03:55:50 +02:00
smallmodel
477735cb3d
Cleanup player class
Added all mohaas/mohaab methods (partially implemented)
2023-08-10 03:46:28 +02:00
smallmodel
38599f2181
Added more cvars 2023-08-10 03:45:38 +02:00
smallmodel
bd794fb286
Cleanup Level 2023-08-10 03:10:51 +02:00
smallmodel
ce34b78113
Added CL_LV_ConvertString
Only CL messages are localized now (see comment)
2023-08-10 02:42:57 +02:00
smallmodel
b8a87dc6ea
Using dm_manager.h instead of dm_team.h 2023-08-10 02:31:48 +02:00
smallmodel
7bdc30936c
Added G_SetClientConfigString 2023-08-10 02:31:09 +02:00
smallmodel
9e635a7207
Rearranged DM_Manager
Moved dm_team.cpp code to dm_manager.cpp
2023-08-10 02:31:01 +02:00
smallmodel
e5626378ef
Added m_bIgnoreClock 2023-08-10 01:42:24 +02:00
smallmodel
73921c116d
Made FireWeapon and EventUseWeaponClass virtual methods 2023-08-10 01:42:06 +02:00
smallmodel
d4b98ef9dd
Added sprint, invulnerable and team spawn variables 2023-08-10 01:41:03 +02:00
smallmodel
40318f052a
Set GAMEVERSION to OPENMOHAA 2023-08-09 23:49:47 +02:00
smallmodel
a130f45c62
Added GetViewAngles, SetFov and GetFov
Removed SwingAngles
2023-08-09 23:49:38 +02:00
smallmodel
e687d97660
Fixed compile errors 2023-08-09 23:48:37 +02:00
smallmodel
e4a0406fc2
Removed Player::PlayerDone
Using Player::DeadBody with the event parameter
2023-08-09 23:11:39 +02:00
smallmodel
ef18c389be
Cleanup entity class
Added new parameter for CanSee
Added Entity::SafeSolid and Entity::Sink
2023-08-09 23:09:09 +02:00
smallmodel
85099801ab
Call Player::DeadBody() with the event function instead 2023-08-09 22:09:04 +02:00
smallmodel
3472657f92
Added MASK_SAFESOLID 2023-08-09 22:08:37 +02:00
smallmodel
c197513ff3
Fixed mismatched endif 2023-08-09 21:00:56 +02:00
smallmodel
9dca77c2cf
Fixed setModel() virtual function 2023-08-09 20:58:36 +02:00
smallmodel
f08a7fa21e
Removed Player::useWeapon 2023-08-09 20:58:07 +02:00
smallmodel
2df56c810d
Set Entity's entnum directly 2023-08-09 20:57:53 +02:00
smallmodel
8c6098f730
Removed SimpleEntity::SetTargetViewAngles() 2023-08-09 20:57:45 +02:00
smallmodel
1462d4f8d9
Removed StunAttack (useless) 2023-08-09 20:57:26 +02:00
smallmodel
5bd49304d7
Cleaned up SimpleEntity 2023-08-09 20:57:17 +02:00
smallmodel
f52d648d6f
Added InteractObject and ThrowObject 2023-08-09 20:49:43 +02:00
smallmodel
987af7eb81
Cleaned up Sentient class
Moved combat stuff to sentient_combat.cpp
Formatted source files
2023-08-09 19:45:39 +02:00
smallmodel
f313b6a058
Formatted item source files 2023-08-09 16:54:38 +02:00
smallmodel
99b989bb63
Added DynItem
Removed unused features
Added remaining mohaa functions
2023-08-09 16:37:08 +02:00
smallmodel
7ebbba6ce5
Made Class::warning and Class::error const methods 2023-08-09 01:53:45 +02:00
smallmodel
c2a6db15a6
Reordered and removed useless functions 2023-08-09 01:32:23 +02:00
smallmodel
aa58bcf948
Using const_str for trigger 2023-08-09 00:54:06 +02:00
smallmodel
fa5b030522
Cleaned up trigger source file 2023-08-09 00:42:09 +02:00
smallmodel
3e44049abf
Removed unused trigger features 2023-08-08 23:51:46 +02:00
smallmodel
94c501e71b
Formatted document 2023-08-08 23:46:45 +02:00
smallmodel
484b2a8900
Implemented TriggerAll 2023-08-08 23:35:01 +02:00
smallmodel
e8ff4fb9a7
Fixed wrong TRIGGER_DAMAGE value 2023-08-08 23:06:28 +02:00
smallmodel
b89e10fd5c
Reordered conditions 2023-08-08 22:40:23 +02:00
smallmodel
d86ea606eb
Formatted source files 2023-08-04 00:21:19 +02:00
smallmodel
2135be12b8
Implemented all unimplemented conditions 2023-08-04 00:20:28 +02:00
smallmodel
ae5d51f2e9
Reworked the player class
Added player_animation.cpp and player_conditionals.cpp
Renamed conditions functions and moved them to player_conditionals.cpp
2023-08-04 00:04:29 +02:00
smallmodel
6eaf25ff80
Using const for CurrentAnim() and CurrentTime() 2023-08-04 00:03:55 +02:00
smallmodel
17c371c15e
Added Entity::BlocksAIMovement 2023-08-03 21:44:16 +02:00
smallmodel
13febc125e
Renamed weapon to dm_primary 2023-08-03 21:44:05 +02:00
smallmodel
b0f26acc18
Fixed max movement time 2023-08-03 21:43:50 +02:00
smallmodel
8ffa5f15e6
Implemented BulletAttack from mohaas/mohaab
Added more explosion effects
2023-08-03 21:43:38 +02:00
smallmodel
f6bcc1ab86
Increased MAX_WEAPONS to 64 2023-08-03 20:14:33 +02:00
smallmodel
a4d6442526
Call BulletAttack_Stat instead of putting everything in BulletAttack
Fixed some BulletAttack bugs
2023-08-02 23:09:18 +02:00
smallmodel
b7fac3a5b0
Added BulletAttack_Stat 2023-08-02 21:58:47 +02:00
smallmodel
64ebf3ed05
Implemented all landmine related functions 2023-08-02 21:50:11 +02:00
smallmodel
9933612607
Added ScriptVariableList::VariableExists 2023-08-02 21:49:03 +02:00
smallmodel
22ff072b54
Made findKeyValue and findKeyEntry const 2023-08-02 21:48:54 +02:00
smallmodel
73b0a84ad0
Added MASK_LANDMINE_PLACE 2023-08-02 21:05:49 +02:00
smallmodel
7b03f953bf
Added Level::RoundStarted 2023-08-02 21:02:19 +02:00
smallmodel
367d6ff6fc
Added and implemented TriggerNoDamage, TriggerEntity and TriggerLandmine 2023-08-02 21:00:16 +02:00
smallmodel
ca61fde54b
Added ScriptThreadLabel::Execute() with safeptr listener, and optionally another listener 2023-08-02 20:59:54 +02:00
smallmodel
f739588c73
Cleaned up Player class from all unused action anim
Added all mohaas/mohaab fields
Added m_sDmPrimary to get the player's primary weapon
2023-08-02 20:59:19 +02:00
smallmodel
ce02d782c4
Removed Player::FindEnemyInFOV and Player::FindEnemyInFOVFromTagWithOffset (unused) 2023-08-02 20:59:15 +02:00
smallmodel
a498b11e20
Added MASK_LANDMINE 2023-08-02 20:56:19 +02:00
smallmodel
ffa5a91cd2
Added Landmine and Defuse fire types for Shoot
Added GetUseCrosshair()
2023-08-02 19:53:14 +02:00
smallmodel
ae680ffd5d
Added Landmine functions from mohaab
Added more parameters for BulletAttack and FakeBulletAttack from mohaas/mohaab
2023-08-02 19:52:04 +02:00
smallmodel
4c17d12fc6
Added new fire types
Added GetFireAnim()
Using m_sTagBarrel rather than an hardcoded tag name
2023-08-01 21:18:35 +02:00
smallmodel
0259f1a251
Reworked Weapon::ReadyToFire and Weapon::PickupWeapon with mohaas/mohaab features 2023-08-01 20:36:52 +02:00
smallmodel
04708aeb67
Fixed CurrentFrame() not found error 2023-08-01 19:59:32 +02:00
smallmodel
a47eb1653e
Override animation functions from entity 2023-08-01 19:59:19 +02:00
smallmodel
10fda39430
Added animation functions 2023-08-01 19:59:05 +02:00
smallmodel
b2be03cce3
Initialize all weapon vars, including mohaas/mohaab variables 2023-08-01 19:31:25 +02:00
smallmodel
84ecf838d4
Optimized G_Command_ProcessFile a little bit 2023-08-01 19:31:08 +02:00
smallmodel
c115796137
Optimized GetValue() so it moves value instead of copying it 2023-08-01 19:30:28 +02:00
smallmodel
7e054c8beb
Implemented all mohaas/mohaab events 2023-07-31 23:41:53 +02:00
smallmodel
e8df36998e
Added mohaas/mohaab variables 2023-07-31 23:41:45 +02:00
smallmodel
0cc558f757
Added overcooked field 2023-07-31 23:41:01 +02:00
smallmodel
5c9bc074f4
Removed fov variable (was useless) 2023-07-31 23:40:39 +02:00
smallmodel
d89175ebc8
Added "always" parameter for alias registration 2023-07-30 23:02:13 +02:00
smallmodel
727eb71995
Added all mohaas/mohaab entity events 2023-07-30 21:21:00 +02:00
smallmodel
3d48c00902
Added g_realismmode 2023-07-30 20:21:18 +02:00
smallmodel
963318264c
Added SV_HitEntity from mohaab 2023-07-30 20:21:08 +02:00
smallmodel
d9123799d6
Added CONTENTS_CLAYPIDGEON 2023-07-30 19:48:43 +02:00
smallmodel
6562bcb164
Added mohaas/mohaab weapon events (unimplemented) 2023-07-30 19:41:11 +02:00
smallmodel
4fa8af3b30
Smoke system implementation from mohaas/mohaab 2023-07-30 16:09:54 +02:00
smallmodel
3f4be4f8ef
Added MASK_SMOKE_SPRITE 2023-07-30 16:09:36 +02:00
smallmodel
09c7badf4f
Added g_debugsmoke cvar 2023-07-30 16:09:22 +02:00
smallmodel
7b9b371cf6
Added RotatePointAroundAxis 2023-07-30 15:42:59 +02:00
smallmodel
25e44e7a45
Added stub source files from mohaas/mohaab 2023-07-30 14:28:58 +02:00
smallmodel
51374729d3
Clear g_iInThinks each frame
Display the memory usage if the g_showmem cvar is set
2023-07-30 14:27:15 +02:00
smallmodel
5a19f7f574
Added LightClass 2023-07-30 14:26:52 +02:00
smallmodel
40ac8a1557
Added watchstring from mohaab 2023-07-30 14:09:22 +02:00
smallmodel
ca42a3e08e
Implemented View3D::DrawLetterbox, View3D::DrawFades, View3D::DrawSoundOverlay, View3D::ClearCenterPrint, View3D::UpdateCenterPrint, View3D::UpdateLocationPrint, View3D::LetterboxActive, View3D::InitSubtitle 2023-07-30 11:47:20 +02:00
smallmodel
3a04357b71
Fixed enum values and enum names 2023-07-30 11:40:50 +02:00
smallmodel
078223c1b6
Centerprint when screenshotting 2023-07-30 11:40:33 +02:00
smallmodel
3fe7cbf725
Fixed vertex colors spam 2023-07-30 11:38:59 +02:00
smallmodel
d6059e42ba
Export sound_overlay for View3D 2023-07-30 11:38:41 +02:00
smallmodel
02c1fbe4fc
Export LV_ConvertString to ref 2023-07-30 11:38:31 +02:00
smallmodel
6f8fee47f2
Using const char* for LV_ConvertString 2023-07-30 11:38:18 +02:00
smallmodel
6c247b300e
Updated README 2023-07-30 11:37:41 +02:00
smallmodel
3627760748
Removed parent entity not found message in CG_GetOrigin 2023-07-30 01:10:26 +02:00
smallmodel
f3affb3d4c
Implemented DontLocalize and FadeSequence from mohaas 2023-07-30 00:56:54 +02:00
smallmodel
a86ed01ba3
Fixed shader tiling being bad with virtual scaling on mohaas/mohaab 2023-07-29 23:18:31 +02:00
smallmodel
d40755eb7c
Added MouseAwayCommand. (this fixes main menu with items staying hovered in mohaas/mohaab) 2023-07-29 23:18:22 +02:00
smallmodel
ce7599cb02
Set column padding 2023-07-29 22:31:16 +02:00
smallmodel
68bf89c522
Fixed entity axis index crash (was using i instead of j) 2023-07-29 21:26:28 +02:00
smallmodel
0c5b57ee05
Fixed MASK_SURF_TYPE not matching all surfaces 2023-07-29 21:25:39 +02:00
smallmodel
69a10da52c
Version number increment 2023-07-29 19:57:16 +02:00
smallmodel
ab534623c4
Fixed crash due to trace.allSolid not being initialized 2023-07-29 19:56:54 +02:00
smallmodel
ae4ea14b35
Fixed crash related to backEnd.currentEntity being null 2023-07-29 19:56:36 +02:00
smallmodel
ea3c48af02
Fixed double-click not working 2023-07-29 19:41:29 +02:00
smallmodel
9df0c023ed
Fixed the server list
Fully implemented the server list
Added support for mohaas/mohaab server list
2023-07-29 19:31:16 +02:00
smallmodel
a5259ebc05
Using MASTER_SERVER_HOST macro 2023-07-29 19:30:39 +02:00
smallmodel
add59ad12a
Implemented UIListBase::TrySelectItem and UIListBase::KeyEvent 2023-07-29 19:30:22 +02:00
smallmodel
53eecb4d4c
Fixed compare function being wrong 2023-07-29 19:29:52 +02:00
smallmodel
77fb47451c
Added game_version cvar so it shows on the UI on mohaas/mohaab 2023-07-29 19:29:38 +02:00
smallmodel
80ae39c2a7
Fixed mouse wheel not working 2023-07-29 19:29:13 +02:00
smallmodel
118ce0d550
Implemented all unimplemented functions/methods 2023-07-29 00:47:05 +02:00
smallmodel
dfd9afceba
Added Cvar_VariableFloatValue 2023-07-28 22:34:29 +02:00
smallmodel
6f7eb93645
Export UI_SetReturnMenuToCurrent() 2023-07-28 22:34:22 +02:00
smallmodel
a5268cbd24
Implemented FAKKServerListItem class
Implemented UIFAKKServerList::RefreshServerList, UIFAKKServerList::RefreshLANServerList, UIFAKKServerList::NewServerList, UIFAKKServerList::ServerCompareFunction and UIFAKKServerList::SortByColumn
2023-07-28 21:51:37 +02:00
smallmodel
c732ed66b2
Set default alpha to 1.0 2023-07-28 21:45:19 +02:00
smallmodel
10981f706f
Added functions to get game key, game name and game ID 2023-07-28 21:45:07 +02:00
smallmodel
d61218d7e2
Fixed const parameters 2023-07-28 21:44:43 +02:00
smallmodel
615032bc25
Fixed cross-platform errors 2023-07-27 23:13:57 +02:00
smallmodel
ea70be07a2
Added FAKKServerListItem class (with unimplemented methods) 2023-07-27 23:02:39 +02:00
smallmodel
1884d3d23c
Using a const char* for ServerListAuxUpdate 2023-07-27 23:00:27 +02:00
smallmodel
3f036cca5e
Added GameSpy server list 2023-07-27 22:43:51 +02:00
smallmodel
3e02fe340b
Implemented UIFAKKServerList's constructor 2023-07-27 22:43:41 +02:00
smallmodel
50d62f1505
Exported EV_UIListBase_ItemDoubleClicked and EV_UIListBase_ItemSelected 2023-07-27 22:43:24 +02:00
smallmodel
60511ace99
Set maximum parallel job to 1 when publishing a new release 2023-07-25 23:59:20 +02:00
smallmodel
aef54d05ae
Incremented version number 2023-07-25 23:27:07 +02:00
smallmodel
15633626fe
Implemented R_GatherLightSources, R_CheckAddLightToList and R_InsertLightIntoList 2023-07-25 22:01:28 +02:00
smallmodel
d43b60c818
Don't lean while moving if alwaysAllowLean is not set 2023-07-25 20:59:52 +02:00
smallmodel
7941524aad
Set alwaysAllowLean depending on the game version and the dmflags 2023-07-25 20:59:34 +02:00
smallmodel
3aa4a6157c
Added PMF_NO_LEAN pmflags
Added alwaysAllowLean pmove_t field from mohta
2023-07-25 20:59:04 +02:00
smallmodel
fc9cf41557
Implemented R_GetLightingGridValue (better lighting) 2023-07-25 20:03:07 +02:00
smallmodel
527131e513
R_LoadLightGrid: Set light grid size depending on the map version 2023-07-25 20:02:56 +02:00
smallmodel
b79163f998
Fixed sqrt non-constant expression 2023-07-25 18:46:05 +02:00
smallmodel
121aaa164a
Implemented sphere light 2023-07-24 20:18:14 +02:00
smallmodel
2522559a04
Implemented R_SphereInLeafs 2023-07-24 20:14:23 +02:00
smallmodel
cf61471b2d
Added MAX_REAL_LIGHTS 2023-07-24 20:14:16 +02:00
smallmodel
9ebdc6a238
Replaced 2 with RDF_HUD 2023-07-24 20:13:43 +02:00
smallmodel
0c65f5dab3
Incremented version number 2023-07-24 11:47:09 +02:00
smallmodel
12d6b064ec
Increased tempmodel count 2023-07-23 19:24:07 +02:00
smallmodel
9de676a86b
Set the correct special effect for CG_Splash 2023-07-23 19:21:53 +02:00
smallmodel
087d0047b3
Implemented AGEN_DIST_FADE, AGEN_ONE_MINUS_DIST_FADE, AGEN_TIKI_DIST_FADE, AGEN_ONE_MINUS_TIKI_DIST_FADE and AGEN_HEIGHT_FADE 2023-07-23 19:08:57 +02:00
smallmodel
d6952b8915
Implemented RB_CalcAlphaFromHeightFade 2023-07-23 18:43:35 +02:00
smallmodel
396e543b74
Removed tess.numVertexes check from RB_CheckOverflow 2023-07-23 18:21:09 +02:00
smallmodel
fa3479cc96
Fixed entities with RF_DONTDRAW being drawn 2023-07-23 18:19:26 +02:00
smallmodel
0e27ebb3e4
Fixed modelanim skyorigin 2023-07-23 18:19:08 +02:00
smallmodel
cd3e9bec03
Don't draw NODRAW surface 2023-07-23 15:07:20 +02:00
smallmodel
6082e0abe1
Workaround to fix crash on mohaa fx 2023-07-23 13:46:32 +02:00
smallmodel
23cf561405
Fixed infinite loop in VSS_CalcRepulsionForces 2023-07-23 13:46:15 +02:00
smallmodel
a6c7f7d4e0
Fixed animation map 2023-07-23 13:44:30 +02:00
smallmodel
74f230077d
Fixed ClientGameCommandManager::BeginTagSpawnLinked incorrectly working
Implemented ClientGameCommandManager::IsBlockCommand
Support for T_WAVE in ClientGameCommandManager::UpdateEmitter
2023-07-22 21:34:18 +02:00
smallmodel
c2cc57fa6b
Made model check case-insensitive (this fixes thing like recaching, and this fixes cgame crashing with m_spawnthing being null during model parsing) 2023-07-22 21:27:56 +02:00
smallmodel
7b1ab5fea6
Fixed wrong emitter being used
Free temp model if it has no dlight and no model name
2023-07-22 20:36:11 +02:00
smallmodel
3161f28da6
Initialize pEvent to 0 2023-07-22 20:06:16 +02:00
smallmodel
403e98fba6
Implemented ClientGameCommandManager::BeginTagSpawnLinked 2023-07-22 17:45:27 +02:00
smallmodel
3e657679a0
Replaced calls to SpawnTempModel by calls to SpawnEffect call
Set m_spawnthing to m_localemitter if the current SFX is null
2023-07-22 17:35:06 +02:00
smallmodel
7c2cdd52b0
Using SFX enum to spawn SFX 2023-07-22 17:35:02 +02:00
smallmodel
6c46c5d5c0
Fixed life_random not working 2023-07-22 15:49:44 +02:00
smallmodel
930784bdf3
Don't initialize the spawnthing if there is a current SFX 2023-07-22 15:33:31 +02:00
smallmodel
92efd2a4bb
Using RF_FLAGS_NOT_INHERITED for CG_AttachEyeEntity 2023-07-22 15:23:12 +02:00
smallmodel
751283aeb5
AllocateTempModel will just return null if there are no free tempmodels
Removed timealive parameter
Using T_SPHERE instead of T_INWARDSPHERE
Using T2_RELATIVEANGLES
2023-07-22 15:22:54 +02:00
smallmodel
e97250875c
Added relative angles from mohta
Calling SpawnEffect instead of SpawnTempModel
2023-07-22 15:21:57 +02:00
smallmodel
c5f853aa1f
Added relative angles from mohta 2023-07-22 15:20:51 +02:00
smallmodel
00c07b4e10
Implemented CG_AttachEyeEntity and CG_UpdateForceModels, which fixes turrets, and entity attachment to player 2023-07-21 23:43:57 +02:00
smallmodel
783cefacf9
Fixed surfaces crash 2023-07-21 23:42:09 +02:00
smallmodel
832067d967
Fixed (a little bit) R_RealDlightPatch 2023-07-21 23:36:02 +02:00
smallmodel
8e60786307
Added Q_clamp_int and Q_clamp_float 2023-07-21 23:35:44 +02:00
smallmodel
7172f480eb
Added "wrongver" connectionless packet command response
Fixed disconnect not returning to main menu
Implemented CL_AbnormalDisconnect
Removed CL_Disconnect parameter
Using short version for version when connecting
2023-07-21 20:37:45 +02:00
smallmodel
b1c732eeb9
Fixed MSG string reading functions returning bad strings 2023-07-21 20:35:41 +02:00
smallmodel
4aad275e3b
Removed buffer from Message_Key 2023-07-21 20:35:26 +02:00
smallmodel
2a34e54000
Fixed MSG_ReadGameStateChar not returning correctly 2023-07-21 20:35:13 +02:00
smallmodel
f725192d7d
Removed float warning 2023-07-21 20:34:59 +02:00
smallmodel
3682d3b799
Export UI_FocusMenuIfExists 2023-07-21 20:34:50 +02:00
smallmodel
24b22392ff
Removed CL_Disconnect parameter 2023-07-21 20:34:42 +02:00
smallmodel
035ed1fe24
Added com_target_version and removed CL_Disconnect parameter 2023-07-21 20:32:58 +02:00
smallmodel
129e3bfe6e
Removed comment 2023-07-21 20:32:43 +02:00
smallmodel
134873cc51
Removed CL_Disconnect parameter
Added com_target_version
2023-07-21 20:32:33 +02:00
smallmodel
d3bda17814
Fixed vertice steps 2023-07-21 20:30:44 +02:00
smallmodel
29c321d2cc
Added S_TriggeredMusic_PlayIntroMusic 2023-07-21 20:30:11 +02:00
smallmodel
7106396b3e
Implemented R_RecursiveDlightPatch, R_RealDlightPatch and R_RealDlightTerrain 2023-07-20 23:59:52 +02:00
smallmodel
ea7ee996a0
Make sure to zero out value at index 3 of static normal and xyz 2023-07-20 23:59:27 +02:00
smallmodel
a2808a0dbf
Fixed dlightmap being wrong 2023-07-20 23:58:33 +02:00
smallmodel
d0a8ac91a7
ParseFace: skip if surface shader has nodraw flags 2023-07-20 23:58:17 +02:00
smallmodel
58b88201dd
Using LIGHTMAP_SIZE instead of a constant value 2023-07-19 22:41:14 +02:00
smallmodel
eceef48267
Made lightmap_buffer access self-explanatory 2023-07-19 22:40:58 +02:00
smallmodel
f32d32f720
Made lightmap_buffer variable 1D 2023-07-19 22:40:40 +02:00
smallmodel
c269a4f034
Fixed missing semicolon 2023-07-19 20:59:04 +02:00
smallmodel
9189538410
Fixed LIGHTMAP_SIZE usage 2023-07-19 20:37:05 +02:00
smallmodel
00b028b381
Fixed texture env
Fixed wrong dlight image being used
2023-07-19 20:30:43 +02:00
smallmodel
7d309553cc
Fixed dlight byte 2023-07-19 20:30:22 +02:00
smallmodel
8c7dd5fad6
Set DLIGHT_SIZE to 32 instead of 16 2023-07-19 20:21:06 +02:00
smallmodel
a5ff63cd01
Fixed env values 2023-07-19 20:20:16 +02:00
smallmodel
5e55e72b5c
Set tess.dlightMap to 0 in RB_AddQuadStampExt
Clear dynamic light bits when surface is a sky or has nodlight set
2023-07-19 20:19:54 +02:00
smallmodel
01fbba74ef
Code cleanup 2023-07-19 00:40:25 +02:00
smallmodel
c7de9048e5
Fixed index mistake 2023-07-19 00:40:14 +02:00
smallmodel
6faded773c
Removed (int) useless cast 2023-07-19 00:39:54 +02:00
smallmodel
ca4e55fad8
Using LIGHTMAP_SIZE 2023-07-19 00:08:49 +02:00
smallmodel
bcf58f90d6
Implemented R_RealDlightFace and R_DlightSample 2023-07-18 22:31:55 +02:00
smallmodel
3f8db539af
Fixed lightmap vecs loading 2023-07-18 22:31:45 +02:00
smallmodel
e181e00807
Added R_FastDlightTerrain
implemented R_DlightTerrain
Fixed R_DlightSurface (this fixes issues with dynamic lighting)
2023-07-18 21:39:14 +02:00
smallmodel
22fdf36cc6
Added reallight functions, unimplemented 2023-07-18 21:19:16 +02:00
smallmodel
415a5e60da
Fixed uninitialized variables 2023-07-18 21:19:01 +02:00
smallmodel
7828cddc2a
Implemented DrawStatCircle, DrawStatNeedle, DrawStatRotator DrawStatSpinner and StatCircleTexCoord. The compass HUD is now fully functional 2023-07-18 20:50:40 +02:00
smallmodel
83a6493024
Export ui_health_start and ui_health_end 2023-07-18 20:49:33 +02:00
smallmodel
e763d2b17d
Added cl_uiradar 2023-07-18 00:10:56 +02:00
smallmodel
ae8d26ce18
Use crandom() instead of random() 2023-07-18 00:09:02 +02:00
smallmodel
1438c052b4
Rearranged include files 2023-07-18 00:08:30 +02:00
smallmodel
8489059ea8
Implemented R_TessellateMarkFragments, and R_AddMarkFragmentsToTerrain 2023-07-17 23:28:06 +02:00
smallmodel
2866bfdd04
Fix for DrawStretchRaw and const params 2023-07-17 20:44:09 +02:00
smallmodel
52f60e647d
Implemented R_MarkFragmentsForInlineModel and R_BoxSurfacesForBModel_r 2023-07-17 20:09:00 +02:00
smallmodel
66213821c5
Using const parameters for BoxOnPlaneSide 2023-07-17 20:08:26 +02:00
smallmodel
baee33e07f
Added chrono stuff for C++ 2023-07-17 19:28:55 +02:00
smallmodel
800ccaf020
Fixed animation crossblend not working correctly 2023-07-17 19:24:53 +02:00
smallmodel
7e526ca9a5
Fixed scrambled string errors with accents 2023-07-17 19:13:05 +02:00
smallmodel
b07784d884
Merge branch 'main' of github.com:openmoh/openmohaa 2023-07-17 00:25:21 +02:00
pryon
6891d297d2
Implement R_CountTikiLodTris (#48)
* Implement R_CountTikiLodTris

* Fix several bugs in R_DrawDebugNumber and a buffer overrun in R_DebugLine
2023-07-17 00:24:56 +02:00
smallmodel
69c2ea4614
Using font system from SH/BT to support different code pages 2023-07-17 00:24:04 +02:00
smallmodel
7515c99195
Fixed string being wrong if there is a char above 128 (like accents), causing network glitches 2023-07-17 00:22:15 +02:00
smallmodel
70463db037
Fixed normals being corrupted/uninitialized and causing weird artifacts, such as strange water lines in some maps 2023-07-15 21:21:27 +02:00
smallmodel
2015fbda4d
Initialize fragment iIndex to 0 2023-07-15 20:50:58 +02:00
smallmodel
f227fcdcaa
Implemented most mark functions 2023-07-15 20:41:52 +02:00
smallmodel
3a27275cb2
Implemented CG_GetBrushEntitiesInBounds 2023-07-15 20:41:27 +02:00
smallmodel
c05403d5d3
Set fov sin/cos
Implemented CG_FrustumCullSphere (from BT code)
2023-07-15 20:41:14 +02:00
smallmodel
89b2c9be9d
Added fov sin/cos variables 2023-07-15 20:40:26 +02:00
smallmodel
e288272c4a
Added CG_FrustumCullSphere and CG_GetBrushEntitiesInBounds 2023-07-15 20:19:08 +02:00
smallmodel
fc362fbe6b
Made pointBuffer const 2023-07-15 20:18:47 +02:00
smallmodel
113e3c3d87
Added CG_GetBrushEntitiesInBounds 2023-07-15 20:18:33 +02:00
smallmodel
1ae812af96
Added CG_FrustumCullSphere 2023-07-15 20:18:20 +02:00
smallmodel
f66ce78a56
Using const for pointBuffer 2023-07-15 20:18:08 +02:00
smallmodel
9882a20a95
Added iIndex in markFragment_t 2023-07-15 20:17:52 +02:00
smallmodel
7458077346
Added more marks variables and struct fields
Reimplemented CG_InitMarks, CG_AllocMark
Implemented CG_FreeMarkPoly, CG_FreeMarkObj, CG_FreeBestMarkObj
2023-07-12 23:53:30 +02:00
smallmodel
483df8ef87
Implemented CG_MakeBulletHoleSound 2023-07-10 23:58:05 +02:00
smallmodel
6318a606e8
Fixed MASK_SHOT value 2023-07-10 23:49:54 +02:00
smallmodel
608b8bec30
Implemented CG_CheckMakeMarkOnEntity, CG_InitTestTreadMark
Added CG_AssembleFinalMarks
2023-07-10 23:28:17 +02:00
smallmodel
ac8f34a40c
Implemented CG_MakeBubbleTrail, CG_BulletTracerEffect and CG_AddBulletImpacts 2023-07-10 23:08:27 +02:00
smallmodel
7cc687e110
Fixed beam const vec3_t parameter 2023-07-10 23:07:57 +02:00
smallmodel
819fe53eaa
Implemented CG_MakeBulletTracerInternal 2023-07-10 21:11:01 +02:00
smallmodel
e0a4661ec0
Added CONTENTS_FLUID 2023-07-10 21:10:33 +02:00
smallmodel
8b83b8e5bb
Replaced vec_t with vec3_t 2023-07-10 21:10:23 +02:00
smallmodel
a2e7a4b4a6
CG_ImpactMark parameters modification 2023-07-10 21:09:56 +02:00
smallmodel
f164bc638b
Put variables in CG_MakeBulletTracerInternal 2023-07-09 23:36:21 +02:00
smallmodel
68df65994a
Name fix 2023-07-09 21:48:37 +02:00
smallmodel
2dc43f9104
Fixed wrong view model animations for mohta and mohtt weapons 2023-07-09 21:24:57 +02:00
smallmodel
b8ff6d0f21
Updated README with better screenshots 2023-07-09 21:16:42 +02:00
smallmodel
7063469585
Added death dm flags to increase the duration of the decay time 2023-07-09 21:16:28 +02:00
smallmodel
84f785a872
Fixed TIKI autosteps flags (this fixes footsteps) 2023-07-09 20:36:42 +02:00
smallmodel
d7700ea1c2
Call ReregisterMaterial instead of RefreshMaterial 2023-07-09 20:15:47 +02:00
smallmodel
4e4e82c874
Fixed bad fog 2023-07-09 20:12:45 +02:00
smallmodel
0c57ec27e6
Added nodepthwrite, nodepthmask, nocolorwrite and nocolormask
Removed FixRenderCommandList from SortNewShader
Fixed shader.sort being wrongly SS_BLEND0 (this fixes issues when seeing through translucent textures like water)
2023-07-09 19:40:12 +02:00
smallmodel
bc249844bf
Added GLS_COLOR_NOMASK 2023-07-09 19:39:00 +02:00
smallmodel
7da3432b8c
Implemented RE_RefreshShaderNoMip 2023-07-09 18:15:21 +02:00
smallmodel
e8ecd1ca9e
Implemented R_RefreshImageFile 2023-07-09 18:15:04 +02:00
smallmodel
ec21e2e4d0
Added flags parameter for DrawTris 2023-07-09 17:48:31 +02:00
smallmodel
83d8fcb0e6
Reimplemented Autosprite2Deform, this fixes trees sprite rendering 2023-07-09 16:36:35 +02:00
smallmodel
dc2b99fb58
Fixed fog extrafrustums above 1 (caused issues with culling) 2023-07-09 15:37:24 +02:00
smallmodel
0f05f8356f
Support r_showcull debugging, as well as r_showstaticlod and r_showstaticbboxes 2023-07-09 15:14:11 +02:00
smallmodel
34a426adf1
Implemented R_DrawDebugNumber 2023-07-09 15:13:39 +02:00
smallmodel
f4790a0e50
Added R_CountTikiLodTris (unimplemented) 2023-07-09 15:13:24 +02:00
smallmodel
e943b95025
Implemented R_DrawDebugLines and R_DrawDebugStrings 2023-07-09 14:38:22 +02:00
smallmodel
981610b13f
Declared R_DrawFloatingString 2023-07-09 14:37:57 +02:00
smallmodel
50098b3aed
Implemented R_DebugRotatedBBox 2023-07-09 14:37:43 +02:00
smallmodel
e3f1705065
Implemented RB_CalcFlapVertexes and RB_CalcEnvironmentTexCoords2 2023-07-09 13:47:42 +02:00
smallmodel
25d526ade5
Moved "flap" above "normal" 2023-07-09 13:47:05 +02:00
Zack Middleton
9c0d66c9f2
Don't list mod directories at Windows drive root
The mod list on Windows would search the root of the drive if
fs_basepath, fs_homepath, fs_steampath, or fs_gogpath are blank ("")
(which is usually the case).

The issue is in the low-level Sys_ListFiles() but it only affects the
mod menu, on Windows. It cannot be abused by console commands to
list system files outside of the virtual filesystem.

---

If a directory at the root of the drive of the working directory
contained a pk3 file, the directory was listed in the mods menu. The
virtual filesystem doesn't add blank directory names to the search path
so it cannot load mods from the drive root. (Unless of course you set a
fs_*path cvar to "C:\".)

Sys_ListFiles() with blank directory caused Windows to use "\*" for the
search path and "\" prefix means root of drive. Unix opendir("") failed
so nothing was listed for blank directory.

Sys_ListFilteredFiles() with blank directory _and_ specifying subdirs
could access any directory (on Windows and Unix-like) but no code uses
this or makes it accessible.

These functions are only used for initializing the virtual filesystem
and listing mods. They are not accessible by anything else such as a
console command. Only the mods menu, on Windows, is affected.
2023-07-06 19:46:01 +02:00
smallmodel
db216a56bf
Improved the README file 2023-07-06 18:32:14 +02:00
smallmodel
8a46597820
Added a new constructor that accepts numArgs as parameters
(this fixes bad script commands)
2023-07-05 21:42:36 +02:00
smallmodel
75572eb1b9
Fixed testthread crashing the game when the label parameter is unspecified 2023-07-05 21:41:43 +02:00
smallmodel
f930d39a42
Used clang-format on cgame module 2023-07-05 21:24:23 +02:00
smallmodel
13828994fb
Used clang-format on gamespy files 2023-07-05 21:24:14 +02:00
smallmodel
68d48d9889
Used clang-format on some common files 2023-07-05 21:24:02 +02:00
smallmodel
37d8938e91
Updated clang-format 2023-07-05 21:05:33 +02:00
smallmodel
5333c7ff4a
Removed empty line before opening braces 2023-07-05 20:52:55 +02:00
smallmodel
4d3fe0fd73
Added .clang-format (currently experimental) 2023-07-05 20:51:05 +02:00
smallmodel
61650a22fd
Removed TODO/CHANGELOG as they are no longer accurate 2023-07-05 19:33:38 +02:00
OM
7a6d6070dc
Removed MAX_TEAMNAME (useless) 2023-07-05 18:36:49 +02:00
OM
51116b933d Fixed code_pos being wrong after loadTop/storeTop 2023-07-04 23:16:35 +02:00
OM
4263b2843a Fixed code_pos not being incremented in EmitField 2023-07-04 23:15:45 +02:00
OM
fd871d6c8f avoid incrementing m_CodePos in OP_STORE_STRING and OP_STORE_VECTOR as fetchOpcodeValue() already does that 2023-07-04 23:06:33 +02:00
OM
1776ac2344 Fixed configstring not sending after post-loading 2023-07-04 23:06:02 +02:00
OM
b0b80dda6f Added single-player note 2023-07-04 20:06:52 +02:00
OM
b5dd79287a Fixed colors segmentation fault (because it was grabbing 4 bytes instead of 3 thanks to unsigned int*) 2023-07-02 21:22:15 +02:00
OM
d4fb368dab Increased version number 2023-07-02 21:21:42 +02:00
OM
53e6391c54 GitHub actions now run on different branches 2023-07-02 20:14:25 +02:00
OM
805a101978 Removed commented-out lines 2023-07-02 20:12:33 +02:00
OM
837fb40732 Completely removed TARGET_GAME_TYPE detection 2023-07-02 20:10:53 +02:00
OM
668f74ffc0 Set the game name depending on com_target_game 2023-07-02 20:10:38 +02:00
OM
d3a4b3e53d Removed extension from full product name 2023-07-02 20:08:37 +02:00
OM
087f1d38f5 Replaced TARGET_GAME_VERSION with com_version->string 2023-07-02 20:08:18 +02:00
OM
6e1fbbaddc Removed com_gamename as it was useless 2023-07-02 20:07:59 +02:00
OM
17b63e56ca Set PROTOCOL_VERSION to 17 by default 2023-07-02 20:07:30 +02:00
OM
4841d8026f Allow gamespy to run on the 3 different games at runtime 2023-07-02 20:07:15 +02:00
OM
942bc9e523 Removed TARGET_GAME_TYPE definition 2023-07-02 20:06:35 +02:00
OM
08fec1a8c5 Removed -DTARGET_GAME_TYPE parameter 2023-07-02 20:05:50 +02:00
OM
41cfac1ec4 Updated the README file 2023-07-02 19:47:41 +02:00
OM
4d75c9ad05 Don't produce TT builds as expansions can be switched at runtime 2023-07-02 19:43:46 +02:00
OM
96f72c0bb8 Denormalize configstrings when sending the game state 2023-07-02 19:42:03 +02:00
OM
a3755ff308 Set GAME_API_VERSION to 15 2023-07-02 19:41:46 +02:00
OM
87b238e6de Renamed gameImport to game_import_t, and gameExport_t to game_export_t 2023-07-02 19:22:17 +02:00
OM
7db4d1a3f4 Newline fix 2023-07-02 19:18:37 +02:00
OM
7b34f064d0 Moved gi.protocol to a new variable called g_protocol 2023-07-02 19:17:15 +02:00
OM
36dce22071 Moved cgi.protocol to a new variable called cg_protocol instead, due to issues like GetCGameAPI being loaded before having client imports (cgi) 2023-07-02 19:16:48 +02:00
OM
fa69717bed Using "main" for loading DLLs as they are now combined 2023-07-02 19:15:35 +02:00
OM
174d3f7447 Send the correct CGM number depending on the protocol used 2023-07-02 18:32:26 +02:00
OM
b6a44fe810 Send fog info depending on the protocol used 2023-07-02 18:31:58 +02:00
OM
b9c5a4d5ba Write server frametime depending on the protocol used 2023-07-02 18:31:43 +02:00
OM
b67b3863ba Added view model anim normalization 2023-07-02 18:31:18 +02:00
OM
1947c30d3d Export MSG_IsProtocolVersion15 2023-07-02 18:30:52 +02:00
OM
9d3fa377df Set breakthrough clientType if maintt is the target 2023-07-02 18:29:42 +02:00
OM
9603f8e38a Parse the fog info depending on the game version 2023-07-01 21:20:15 +02:00
OM
cb95284d0c Draw spectator view depending on the protocol version 2023-07-01 21:18:58 +02:00
OM
00b926db29 Init the client game export for scores and CG message 2023-07-01 21:18:30 +02:00
OM
cf009a4628 Parse CG message based on game protocol version 2023-07-01 21:17:59 +02:00
OM
e456964be4 Parse the scores based on the game version 2023-07-01 21:17:42 +02:00
OM
8418da422c Stopwatch: checking protocol at runtime instead 2023-07-01 21:17:30 +02:00
OM
0f0fbb7b0d Merge branch 'main' into features/universal-client 2023-07-01 20:52:39 +02:00
OM
8a7cb7fb24 Merge branch 'main' of github.com:openmoh/openmohaa 2023-07-01 20:52:18 +02:00
pryon
ca468b9407
Implement RB_SurfaceMarkFragment (#47)
Looks good
Btw it won't be possible to make a common function, because like others `RB_Surface*`, both functions use a different struct (even if some of the fields have the same name between structures)
2023-07-01 20:51:14 +02:00
OM
7eac426e31 Added net_pm_flags field for denormalized pm_flags (depending on the target game) 2023-06-29 22:16:46 +02:00
OM
e33a562c04 CG_PlayerTeamIcon: Removed TARGET_GAME_PROTOCOL check 2023-06-29 21:29:57 +02:00
OM
dbfa741a06 Unified configstrings and player state flags (they will be normalized by the client/server instead) 2023-06-29 21:29:38 +02:00
OM
f1aecd3939 Removed compile-time TARGET_GAME_PROTOCOL check (use runtime detection instead) 2023-06-29 21:29:14 +02:00
OM
e8a9eb775e Added protocol/targetGame variables 2023-06-29 21:28:43 +02:00
OM
a4d71bb150 Added bg_compat.cpp 2023-06-29 21:28:19 +02:00
OM
3def146e90 Get normalized playerstate flags and configstring when receiving them 2023-06-29 21:28:08 +02:00
OM
906f9cb89d Denormalize player state flags when sending them to client 2023-06-29 21:27:45 +02:00
OM
cbe6354d2d Denormalize configstring when sending it to the client 2023-06-29 21:27:19 +02:00
OM
931c3147f8 Initialize targetGame and protocol in imports 2023-06-29 21:26:34 +02:00
OM
f02cc7942d Added bg_compat to translate configstrings and playerstate flags for target games 2023-06-29 21:26:02 +02:00
OM
75aeba31c6 Added com_target_game startup variable
FS_Startup now uses `fs_basegame` variable for mainta/maintt
2023-06-29 21:25:26 +02:00
OM
ff0474a483 Adding specific bg_x files manually 2023-06-29 21:24:11 +02:00
OM
7e18d51550 Added Com_InitHunkMemory 2023-06-28 22:48:28 +02:00
OM
ba4680d510 Added defines for each moh games 2023-06-28 22:48:10 +02:00
OM
c83bbd6a58 Disabled pak files checking because it was causing trouble between languages 2023-06-27 21:05:38 +02:00
1037 changed files with 320731 additions and 325415 deletions

90
.clang-format Normal file
View file

@ -0,0 +1,90 @@
---
Language: Cpp
Standard: c++17
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Left
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: false
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: True
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterClass: true
AfterEnum: false
AfterExternBlock: false
AfterFunction: true
AfterNamespace: true
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: false
SplitEmptyRecord: false
BreakArrays: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: Always
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
ColumnLimit: 120
CompactNamespaces: false
Cpp11BracedListStyle: true
EmptyLineBeforeAccessModifier: Always
IndentAccessModifiers: false
IndentCaseBlocks: true
IndentCaseLabels: false
IndentExternBlock: Indent
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentRequiresClause: true
IndentWidth: 4
InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
LineEnding: LF
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PackConstructorInitializers: Never
PointerAlignment: Right
QualifierAlignment: Left
ReferenceAlignment: Left
ReflowComments: false
RequiresClausePosition: WithFollowing
SeparateDefinitionBlocks: Always
SortIncludes: false
SortUsingDeclarations: Lexicographic
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeParens: ControlStatements
SpacesInAngles: Never
UseTab: Never

39
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots (OPTIONAL)**
If applicable, add screenshots to help explain your problem.
**Logs**
- Paste the output of the console window in a text file, and attach the text file.
- If applicable (`logfile` set to 2), attach the `qconsole.log` file. On Windows, it can be found in **%APPDATA%\...\qconsole.log** and on Linux, it can be found on the home directory **~/.openmohaa/.../qconsole.log**.
**Version information (please complete the following information):**
- OS: [e.g. `Debian`]
- OS Version [e.g `12`]
- OpenMoHAA Version: [e.g `0.70.0-alpha+0.0b1a20dcf win_msvc64-x86_64-debug`, can be found below **Common Initialization** in the console, or by typing `version`]
**Dump (OPTIONAL)**
You can include a core dump generated by the OS (`.dmp` file). If you compiled OpenMoHAA yourself, also add all output openmohaa binaries (except libopenal and libSDL).
**Additional context (OPTIONAL)**
Add any other context about the problem here.

17
.github/workflows/branches-build.yml vendored Normal file
View file

@ -0,0 +1,17 @@
name: Build branch
on:
push:
branches:
- '**'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-all:
uses: ./.github/workflows/shared-build.yml
with:
environment: "testing"

View file

@ -1,222 +0,0 @@
name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
build-platform-linux:
strategy:
matrix:
architecture: [
{name: 'amd64', triple: 'x86_64-linux-gnu'},
{name: 'i686', triple: 'i686-linux-gnu'},
{name: 'aarch64', triple: 'aarch64-linux-gnu'},
{name: 'armhf', triple: 'arm-linux-gnueabihf'}
]
name: "Building for platform linux-${{matrix.architecture.name}}"
runs-on: ubuntu-22.04
# container:
# image: ubuntu:22.04
# volumes:
# - ${{github.workspace}}:${{github.workspace}}
#
# steps:
# - name: Install required packages
# run: apt update && apt install -y clang-15 cmake ninja-build flex bison git
#
# - name: Install required cross-platform packages (${{ matrix.architecture.triple }})
# if: matrix.architecture.name != 'amd64'
# run: apt install -y gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }}
steps:
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_BUILD_PARALLEL_LEVEL=$(($(nproc) * 16))" >> $GITHUB_ENV
# echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Install required packages
run: |
sudo apt update && sudo apt install -y flex bison
- name: Install required cross-platform packages (${{ matrix.architecture.triple }})
if: matrix.architecture.name != 'amd64'
run: sudo apt install -y gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }}
- name: Install dependencies
working-directory: ${{github.workspace}}
run: |
echo Using triple: ${{ matrix.architecture.triple }}
mkdir -p thirdparties && cd thirdparties
git clone --depth 1 --single-branch --branch SDL2 https://github.com/libsdl-org/SDL.git
cmake -B SDL-build \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }} \
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }} \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL-install' \
./SDL
cmake --build SDL-build --config Release
cmake --install SDL-build
- uses: actions/checkout@v3
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }} \
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }} \
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL-install/lib/cmake/SDL2' \
-DWITH_CLIENT=1" >> $GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=0 ./source
cmake -B ./buildtt ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=2 ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cmake --build ${{github.workspace}}/buildtt --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd "${{github.workspace}}/build"
ctest -C ${{env.BUILD_TYPE}}
cd "${{github.workspace}}/buildtt"
ctest -C ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cmake --install ${{github.workspace}}/buildtt --config ${{env.BUILD_TYPE}}
cp '${{github.workspace}}/thirdparties/SDL-install/lib/libSDL2.so' '${{github.workspace}}/install'
- uses: actions/upload-artifact@v3
with:
name: out-linux-${{matrix.architecture.name}}
if-no-files-found: error
path:
${{github.workspace}}/install
build-platform-windows:
strategy:
matrix:
architecture: [
{name: 'x64', config: 'x64' },
{name: 'x86', config: 'Win32' },
{name: 'arm64', config: 'ARM64' }
]
name: "Building for platform windows-${{matrix.architecture.name}}"
runs-on: windows-2022
steps:
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_BUILD_PARALLEL_LEVEL=$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors * 16)" >> $GITHUB_ENV
- name: Install required packages
working-directory: ${{github.workspace}}
run: |
mkdir thirdparties && cd thirdparties
git clone --depth 1 --single-branch --branch SDL2 https://github.com/libsdl-org/SDL.git
cmake -B SDL-build -A ${{ matrix.architecture.config }} -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL-install' ./SDL
cmake --build SDL-build --config Release --parallel
cmake --install SDL-build
git clone --depth 1 --single-branch --branch v2.5.25 https://github.com/lexxmark/winflexbison.git
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' ./winflexbison
cmake --build winflexbison-build --config Release --parallel
cmake --install winflexbison-build
- uses: actions/checkout@v3
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=-A ${{ matrix.architecture.config }} `
--log-level=VERBOSE `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
-DCMAKE_C_COMPILER=clang `
-DCMAKE_CXX_COMPILER=clang++ `
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL-install/cmake' `
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
-DWITH_CLIENT=1".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=0 ./source
cmake -B ./buildtt ${{ env.CMAKE_PARAM }} -DTARGET_GAME_TYPE=2 ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cmake --build ${{github.workspace}}/buildtt --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd "${{github.workspace}}/build"
ctest -C ${{env.BUILD_TYPE}}
cd "${{github.workspace}}/buildtt"
ctest -C ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cmake --install ${{github.workspace}}/buildtt --config ${{env.BUILD_TYPE}}
Copy-Item "${{github.workspace}}/thirdparties/SDL-install/bin/*.dll" -Destination "${{github.workspace}}/install"
- uses: actions/upload-artifact@v3
with:
name: out-windows-${{matrix.architecture.name}}
if-no-files-found: error
path: |
${{github.workspace}}/install
!${{github.workspace}}/install/**/*.pdb
- uses: actions/upload-artifact@v3
with:
name: out-windows-${{matrix.architecture.name}}-pdb
if-no-files-found: error
path: |
${{github.workspace}}/install

View file

@ -20,6 +20,10 @@ on:
schedule:
- cron: '42 8 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
@ -41,11 +45,24 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Install required packages
with:
packages: libopenal-dev libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
version: "0.1"
# Setup SDL
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
version: sdl2-latest
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -59,7 +76,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@ -72,6 +89,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

246
.github/workflows/shared-build-linux.yml vendored Normal file
View file

@ -0,0 +1,246 @@
##########################
#
# Linux
# Ubuntu 22.04
#
# Using this version instead of 24.04 to use a lower GLIBC version (2.34).
# ARM is used for more efficiency, and x64 is used for legacy architectures like PowerPC.
##########################
name: Linux build workflow
on:
workflow_call:
inputs:
environment:
required: true
type: string
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
jobs:
build:
strategy:
matrix:
architecture: [
{name: 'amd64', os: "ubuntu-22.04-arm", package: 'x86-64-linux-gnu', triple: 'x86_64-linux-gnu', arch_option: 'linux-x86_64'},
{name: 'i686', os: "ubuntu-22.04-arm", package: 'i686-linux-gnu', triple: 'i686-linux-gnu', arch_option: 'linux-x86'},
{name: 'arm64', os: "ubuntu-22.04-arm", package: 'aarch64-linux-gnu', triple: 'aarch64-linux-gnu', arch_option: 'linux-aarch64'},
{name: 'armhf', os: "ubuntu-22.04-arm", package: 'arm-linux-gnueabihf', triple: 'arm-linux-gnueabihf', arch_option: 'linux-armv4'},
{name: 'powerpc', os: "ubuntu-22.04", package: 'powerpc-linux-gnu', triple: 'powerpc-linux-gnu', arch_option: 'linux-ppc'},
{name: 'ppc64', os: "ubuntu-22.04", package: 'powerpc64-linux-gnu', triple: 'powerpc64-linux-gnu', arch_option: 'linux-ppc64'},
{name: 'ppc64el', os: "ubuntu-22.04-arm", package: 'powerpc64le-linux-gnu', triple: 'powerpc64le-linux-gnu', arch_option: 'linux-ppc64le'}
]
name: "Building for platform linux-${{matrix.architecture.name}}"
runs-on: ${{ matrix.architecture.os }}
environment: ${{ inputs.environment }}
env:
wolfssl-version: 'v5.7.6-stable'
curl-version: '8_12_1'
openal-soft-branch: '1.24.3'
steps:
###
# Packages
###
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Install required packages
with:
packages: flex bison ninja-build cmake clang libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
version: "${{ runner.os }}-${{ runner.arch }}-v1"
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "HOST_TRIPLE=$(gcc -dumpmachine)" >> $GITHUB_ENV
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Install required cross-platform packages (${{ matrix.architecture.package }})
if: env.HOST_TRIPLE != matrix.architecture.triple
with:
packages: gcc-12-${{ matrix.architecture.package }} g++-12-${{ matrix.architecture.package }}
version: "${{ runner.os }}-${{ runner.arch }}-v1"
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "CFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
echo "CXXFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
###
# SDL
###
# Setup SDL
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
version: 2-latest
build-type: Release
# Workaround for when changing the runner OS version
cmake-arguments: "-DCACHE_OS_VERSION=Ubuntu_22.04"
###
# OpenAL
###
- name: Cache OpenAL
id: cache-openal-soft
uses: actions/cache@v4
with:
path: 'thirdparties/soft-oal/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
# soft-oal setup
- name: Checkout soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '${{ env.openal-soft-branch }}'
- name: Configure and install soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build \
-DALSOFT_UTILS=OFF \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# WolfSSL
###
- name: Cache WolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: 'thirdparties/wolfssl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-wolfssl-${{ env.wolfssl-version }}-v1
# WolfSSL setup
- name: Checkout WolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'wolfssl/wolfssl'
path: 'thirdparties/wolfssl'
ref: '${{ env.wolfssl-version }}'
# WolfSSL build
- name: Configure and install wolfssl
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/wolfssl
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/wolfssl/install' \
-DCMAKE_C_FLAGS="$CFLAGS -fPIC" \
-DCMAKE_CXX_FLAGS="$CFLAGS -fPIC" \
-DBUILD_SHARED_LIBS=OFF -DWOLFSSL_OPENSSLEXTRA=ON -DWOLFSSL_ASM=OFF -DWOLFSSL_EXAMPLES=OFF -DWOLFSSL_CURL=ON
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# cURL
###
- name: Cache cURL
id: cache-curl
uses: actions/cache@v4
with:
path: 'thirdparties/curl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
# cURL setup
- name: Checkout cURL
if: steps.cache-curl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'curl/curl'
path: 'thirdparties/curl'
ref: 'curl-${{ env.curl-version }}'
# cURL build
- name: Configure and install curl
if: steps.cache-curl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/curl
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' \
-DCURL_USE_LIBPSL=OFF \
-DCURL_USE_WOLFSSL=ON \
-DCURL_ZLIB="" \
-DCURL_BROTLI="" \
-DCURL_ZSTD="" \
-DCMAKE_SHARED_LINKER_FLAGS="-lm" \
-DWolfSSL_ROOT='${{github.workspace}}/thirdparties/wolfssl/install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# Project
###
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' \
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' \
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd "${{github.workspace}}/build"
ctest -C ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Copy libraries
mkdir ${{github.workspace}}/package
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.so.0 '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/curl/install/lib*/libcurl.so.4 '${{github.workspace}}/package/'
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
###
# Artifacts
###
- uses: actions/upload-artifact@v4
with:
name: out-linux-${{matrix.architecture.name}}
if-no-files-found: error
path:
${{github.workspace}}/package

239
.github/workflows/shared-build-macos.yml vendored Normal file
View file

@ -0,0 +1,239 @@
##########################
#
# Apple macOS
# macOS 15
#
# This version is used as the OS, as it's faster than other versions.
##########################
name: MacOS build workflow
on:
workflow_call:
inputs:
environment:
required: true
type: string
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
jobs:
build:
strategy:
matrix:
architecture: [
#{name: 'x86_64', triple: 'x86_64-apple-macos10.8'},
#{name: 'arm64', triple: 'arm64-apple-macos11'}
#{name: 'x86_64', build_name: 'x86_64'},
#{name: 'arm64', build_name: 'arm64'},
# Compile into an universal binary
{name: 'multiarch(arm64-x86_64)', build_name: 'arm64;x86_64' }
]
name: "Building for platform macos-${{matrix.architecture.name}}"
runs-on: "macos-15"
env:
openal-soft-branch: '1.24.3'
wolfssl-version: 'v5.7.6-stable'
curl-version: '8_12_1'
steps:
###
# Packages
###
- name: Install required packages
run: |
brew install git flex bison ninja cmake llvm perl
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV
###
# SDL
###
# Setup SDL
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
version: 2-latest
build-type: Release
cmake-arguments: "-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}'
-DCMAKE_VERBOSE_MAKEFILE=on"
###
# OpenAL
###
- name: Cache OpenAL
id: cache-openal-soft
uses: actions/cache@v4
with:
path: 'thirdparties/soft-oal/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
# soft-oal setup
# Use GCC instead of Clang because of missing SSE intrinsics
# It also doesn't enable altivec support on PowerPC by default
- name: Checkout soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '${{ env.openal-soft-branch }}'
# soft-oal build
- name: Configure and install soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
-DCMAKE_VERBOSE_MAKEFILE=on
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# WolfSSL
###
# FIXME: Figure out how to compile WolfSSL cross-architecture
#
# - name: Cache WolfSSL
# id: cache-wolfssl
# uses: actions/cache@v4
# with:
# path: 'thirdparties/wolfssl_install'
# key: ${{ runner.os }}-${{ matrix.architecture.name }}-wolfssl-${{ env.wolfssl-version }}-v1
#
# # WolfSSL setup
# - name: Checkout WolfSSL
# if: steps.cache-wolfssl.outputs.cache-hit != 'true'
# uses: actions/checkout@v4
# with:
# repository: 'wolfssl/wolfssl'
# path: 'thirdparties/wolfssl'
# ref: '${{ env.wolfssl-version }}'
#
# # WolfSSL build
# - name: Configure and install wolfssl
# if: steps.cache-wolfssl.outputs.cache-hit != 'true'
# working-directory: ${{github.workspace}}/thirdparties/wolfssl
# run: |
# cmake -B ./build \
# -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/wolfssl_install' \
# -DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
# -DBUILD_SHARED_LIBS=OFF -DWOLFSSL_OPENSSLEXTRA=ON -DWOLFSSL_ASM=OFF -DWOLFSSL_EXAMPLES=OFF -DWOLFSSL_CURL=ON
# cmake --build ./build --config Release --parallel
# cmake --install ./build --config Release
###
# cURL
###
- name: Cache cURL
id: cache-curl
uses: actions/cache@v4
with:
path: 'thirdparties/curl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
# cURL setup
- name: Checkout cURL
if: steps.cache-curl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'curl/curl'
path: 'thirdparties/curl'
ref: 'curl-${{ env.curl-version }}'
# cURL build
- name: Configure and install curl
if: steps.cache-curl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/curl
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
-DCURL_USE_LIBPSL=OFF \
-DCURL_USE_WOLFSSL=OFF \
-DCURL_USE_LIBSSH2=OFF \
-DUSE_LIBIDN2=OFF \
-DUSE_NGHTTP2=OFF \
-DCURL_ENABLE_SSL=OFF \
-DCURL_ZLIB="" \
-DCURL_BROTLI="" \
-DCURL_ZSTD="" \
-DWolfSSL_ROOT='${{github.workspace}}/thirdparties/wolfssl_install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# Project
###
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DCMAKE_VERBOSE_MAKEFILE=on \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal/install' \
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include/AL' \
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' \
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd "${{github.workspace}}/build"
ctest -C ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Create hard-link and copy symbolic links
mkdir ${{github.workspace}}/package
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.0.dylib '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.1.dylib '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/curl/install/lib*/libcurl.4.dylib '${{github.workspace}}/package/'
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
###
# Artifacts
###
- uses: actions/upload-artifact@v4
with:
name: out-macos-${{matrix.architecture.name}}
if-no-files-found: error
path:
${{github.workspace}}/package

View file

@ -0,0 +1,259 @@
##########################
#
# Microsoft Windows
# Windows Server 2025
#
##########################
name: Windows build workflow
on:
workflow_call:
inputs:
environment:
required: true
type: string
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
jobs:
build:
strategy:
matrix:
architecture: [
{name: 'x64', os: 'windows-2025', config: 'x64', toolset: 'x64', arch_option: 'VC-WIN64A' },
{name: 'x86', os: 'windows-2025', config: 'Win32', toolset: 'x64_x86', arch_option: 'VC-WIN32' },
{name: 'arm64', os: 'windows-11-arm', config: 'ARM64', toolset: 'x64_arm64', arch_option: 'VC-WIN64-ARM' }
]
name: "Building for platform windows-${{matrix.architecture.name}}"
runs-on: ${{ matrix.architecture.os }}
environment: ${{ inputs.environment }}
env:
flexbison-branch: 'v2.5.25'
wolfssl-version: 'v5.7.6-stable'
curl-version: '8_12_1'
openal-soft-branch: '1.24.3'
steps:
###
# Packages
###
- name: Cache Flex/Bison
id: cache-flexbison
uses: actions/cache@v4
with:
path: 'thirdparties/winflexbison-install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-flexbison-${{ env.flexbison-branch }}-v1
- name: Install Flex/Bison
if: steps.cache-flexbison.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}
run: |
mkdir thirdparties && cd thirdparties
git clone --depth 1 --single-branch --branch ${{ env.flexbison-branch }} https://github.com/lexxmark/winflexbison.git
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' ./winflexbison
cmake --build winflexbison-build --config Release --parallel
cmake --install winflexbison-build --config Release
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $env:GITHUB_ENV
echo "CC=cl.exe" >> $env:GITHUB_ENV
echo "CXX=cl.exe" >> $env:GITHUB_ENV
pushd "$($env:PROGRAMFILES)\Microsoft Visual Studio\*\*\VC\Auxiliary\Build"
cmd /c "vcvarsall.bat ${{ matrix.architecture.toolset }} & set" | ForEach-Object {
if ($_ -match "=") {
# Split into key=value
$var = $_.split("=", 2);
echo "$($var[0])=$($var[1])" >> $env:GITHUB_ENV
}
}
popd
- name: Cache Required Packages
id: cache-required-packages
uses: actions/cache@v4
with:
path: 'C:\Packages'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-required-packages-v1
- name: Install required packages
if: steps.cache-required-packages.outputs.cache-hit != 'true'
run: |
$DownloadPath="$($env:USERPROFILE)\Downloads"
if ("${{ matrix.architecture.config }}" -ieq "ARM64") {
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-winarm64.zip" -OutFile "$DownloadPath\ninja-win.zip"
} else {
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$DownloadPath\ninja-win.zip"
}
Expand-Archive -Path "$DownloadPath\ninja-win.zip" -DestinationPath "C:\Packages\ninja"
Invoke-WebRequest "https://download.qt.io/official_releases/jom/jom.zip" -OutFile "$DownloadPath\jom.zip"
Expand-Archive -Path "$DownloadPath\jom.zip" -DestinationPath "C:\Packages\jom"
- name: Setup required packages path
run: |
$env:PATH += ";C:\Packages\ninja;C:\Packages\jom;"
echo "PATH=$($env:PATH)" >> $env:GITHUB_ENV
###
# SDL
###
# Setup SDL
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
version: 2-latest
build-type: Release
cmake-arguments: ""
###
# OpenAL
###
- name: Cache OpenAL
id: cache-openal-soft
uses: actions/cache@v4
with:
path: 'thirdparties/soft-oal/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
# soft-oal setup
- name: Checkout soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '${{ env.openal-soft-branch }}'
# soft-oal build
# Statically link the CRT runtime into OAL as a workaround to prevent crashes
- name: Configure and install soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' `
-DALSOFT_BUILD_ROUTER=OFF `
-DALSOFT_REQUIRE_WINMM=ON `
-DALSOFT_REQUIRE_DSOUND=ON `
-DALSOFT_REQUIRE_WASAPI=ON `
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_C_FLAGS_MINSIZEREL="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_MINSIZEREL="/MT /O1 /Ob1 /DNDEBUG" `
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG"
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
# Unfortunately soft-oal produces a binary called OpenAL32 even in 64-bit
if (("x64", "ARM64") -icontains "${{ matrix.architecture.config }}") { Rename-Item -Path '.\install\bin\OpenAL32.dll' -NewName 'OpenAL64.dll' }
###
# cURL
#
# Uses Schannel as SSL backend, native CAs are used
###
- name: Cache cURL
id: cache-curl
uses: actions/cache@v4
with:
path: 'thirdparties/curl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
# cURL setup
- name: Checkout cURL
if: steps.cache-curl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'curl/curl'
path: 'thirdparties/curl'
ref: 'curl-${{ env.curl-version }}'
# cURL build
- name: Configure and install curl
if: steps.cache-curl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/curl
run: |
cmake -B ./build `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' `
-DCURL_USE_LIBPSL=OFF `
-DCURL_USE_SCHANNEL=ON
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# Project
###
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM= `
--log-level=VERBOSE `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' `
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' `
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' `
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd "${{github.workspace}}/build"
ctest -C ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
New-Item -ItemType Directory '${{github.workspace}}/package'
Copy-Item '${{steps.sdl.outputs.prefix}}/bin/*.dll' -Destination '${{github.workspace}}/package'
Copy-Item '${{github.workspace}}/thirdparties/soft-oal/install/bin/*.dll' -Destination '${{github.workspace}}/package'
Copy-Item '${{github.workspace}}/thirdparties/curl/install/bin/*.dll' -Destination '${{github.workspace}}/package'
if (Test-Path ${{github.workspace}}/install/bin) { Copy-Item '${{github.workspace}}/install/bin/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
if (Test-Path ${{github.workspace}}/install/lib) { Copy-Item '${{github.workspace}}/install/lib/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
###
# Artifact
###
- uses: actions/upload-artifact@v4
with:
name: out-windows-${{matrix.architecture.name}}
if-no-files-found: error
path: |
${{github.workspace}}/package
!${{github.workspace}}/package/**/*.pdb
- uses: actions/upload-artifact@v4
with:
name: out-windows-${{matrix.architecture.name}}-pdb
if-no-files-found: error
path: |
${{github.workspace}}/package

24
.github/workflows/shared-build.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Shared build workflow
on:
workflow_call:
inputs:
environment:
required: true
type: string
jobs:
build-platform-linux:
uses: ./.github/workflows/shared-build-linux.yml
with:
environment: ${{inputs.environment}}
build-platform-windows:
uses: ./.github/workflows/shared-build-windows.yml
with:
environment: ${{inputs.environment}}
build-platform-macos:
uses: ./.github/workflows/shared-build-macos.yml
with:
environment: ${{inputs.environment}}

View file

@ -6,7 +6,7 @@ on:
- "v*.*.*"
env:
RELEASE_TYPE: ${{ vars.RELEASE_TYPE || 'test' }}
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
RELEASE_IS_PRERELEASE: ${{ vars.RELEASE_IS_PRELEASE }}
permissions:
@ -14,44 +14,55 @@ permissions:
jobs:
build-all:
uses: ./.github/workflows/build-cmake.yml
uses: ./.github/workflows/shared-build.yml
with:
environment: "release"
deploy_all:
strategy:
# Set the maximum number of parallel jobs to 1, to avoid a race-condition
# while creating a new release
max-parallel: 1
matrix:
target_os: [
'linux-amd64',
'linux-i686',
'linux-aarch64',
'linux-arm64',
'linux-armhf',
'linux-powerpc',
'linux-ppc64',
'linux-ppc64el',
'windows-x64',
'windows-x86',
'windows-x64-pdb',
'windows-x86',
'windows-x86-pdb',
'windows-arm64',
'windows-arm64-pdb'
'windows-arm64-pdb',
#'macos-x86_64',
#'macos-arm64',
'macos-multiarch(arm64-x86_64)',
]
runs-on: ubuntu-22.04
environment: release
runs-on: ubuntu-24.04
environment: "release"
needs: [build-all]
env:
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}-${{matrix.target_os}}
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: 'out-${{matrix.target_os}}'
path: ${{github.workspace}}/${{matrix.target_os}}
- name: Zip
working-directory: ${{github.workspace}}/${{matrix.target_os}}
run: zip -r ../${{ env.RELEASE_NAME }}.zip ./
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
run: zip -r "../${{ env.RELEASE_NAME }}.zip" ./
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: '${{github.ref_name}}-${{env.RELEASE_TYPE}}'
name: '${{github.ref_name}}-${{env.RELEASE_STAGE}}'
prerelease: ${{env.RELEASE_IS_PRERELEASE}}
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.zip

5
.gitignore vendored
View file

@ -5,6 +5,8 @@ Makefile.local
*.swp
*tags
*~
/.vscode/
/baseq3
# OS X
####################
@ -44,5 +46,6 @@ profile
*.suo
.vs
out
code_unfinished/*
thirdparties/
code/parser/generated/*

View file

@ -1,13 +0,0 @@
=== Patch 1.12 ===
>>> Client :
- Added GFX features such as bloom, SSAO & FXAA
- Added support of .vision files
- Added support of custom weapons and view model animations
>>> Game :
- Added more scripting functions
- Lot more..
THIS CHANGELOG IS NOT COMPLETED YET.

View file

@ -1,77 +1,164 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.12)
project(openmohaa)
include(TargetArch.cmake)
include(misc/cmake/TargetArch.cmake)
target_architecture(TARGET_ARCH)
list(LENGTH TARGET_ARCH TARGET_ARCH_COUNT)
if(TARGET_GAME_TYPE)
if(TARGET_GAME_TYPE EQUAL 1)
# Build for Team Assault (Spearhead)
set(TARGET_BASE_SUFFIX "ta")
elseif(TARGET_GAME_TYPE EQUAL 2)
# Build for Team Tactics (Breakthrough)
set(TARGET_BASE_SUFFIX "tt")
else()
set(TARGET_BASE_SUFFIX)
message(SEND_ERROR "Invalid game type. Game type can be 0, 1 or 2")
endif()
else()
set(TARGET_BASE_SUFFIX)
set(TARGET_GAME_TYPE 0)
set(USE_INTERNAL_LIBS ON)
if(USE_SYSTEM_LIBS)
set(USE_INTERNAL_LIBS OFF)
endif()
set(TARGET_BASE_GAME "main${TARGET_BASE_SUFFIX}")
option(USE_INTERNAL_JPEG "If set, use bundled libjpeg." ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_MAD "If set, use bundled libmad." ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_ZLIB "If set, use bundled zlib." ${USE_INTERNAL_LIBS})
option(USE_RENDERER_DLOPEN "Whether to compile the renderer as separate pluggable modules" OFF)
option(TARGET_LOCAL_SYSTEM "Indicate that the project will be compiled and installed for the local system" OFF)
if(TARGET_GAME_TYPE)
message(SEND_ERROR "TARGET_GAME_TYPE is now unsupported, it is now done at runtime.")
endif()
set(TARGET_BASE_GAME "./")
set(CMAKE_DEBUG_POSTFIX "-dbg")
#
# Microsoft compiler specific parameters
#
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Treat no return type as error
add_compile_options(/we4715)
endif()
#
# Clang and GCC specific parameters
#
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wno-comment)
# Treat no return type as error
add_compile_options(-Werror=return-type)
endif()
#
# Clang specific parameters
#
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Ignore warnings for code like 'assert("Assert string")'
add_compile_options(-Wno-pointer-bool-conversion)
endif()
IF("${TARGET_ARCH}" STREQUAL "i386")
#
# GCC specific parameters
#
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Add this option on gcc to prevent functions from having the STB_GNU_UNIQUE binding
# Otherwise, it would prevent libraries from being unloaded
# which will cause undefined behavior and crashes due to memory corruption
add_compile_options(-fno-gnu-unique)
endif()
if(DEBUG_MEMORY)
add_definitions(-D_DEBUG_MEM)
endif()
if("${TARGET_ARCH}" STREQUAL "i386")
set(TARGET_ARCH_SUFFIX "x86")
ELSE()
else()
set(TARGET_ARCH_SUFFIX ${TARGET_ARCH})
ENDIF()
endif()
message(STATUS "Architecture detected: ${TARGET_ARCH}, suffix set to ${TARGET_ARCH_SUFFIX}")
message(STATUS "Architecture detected: ${TARGET_ARCH}")
IF(WIN32)
if(TARGET_LOCAL_SYSTEM)
add_definitions(-DTARGET_LOCAL_SYSTEM)
# As it targets the local system, no need to know about the architecture used
set(TARGET_BIN_SUFFIX "")
message(STATUS "Binary suffix will not be used as the local system is the target")
elseif(${TARGET_ARCH_COUNT} GREATER 1)
add_definitions(-DTARGET_MULTIPLE_ARCHITECTURES)
set(TARGET_BIN_SUFFIX ".multiarch")
message(STATUS "Multiple architectures were specified, suffix set to 'multiarch'.")
else()
set(TARGET_BIN_SUFFIX ".${TARGET_ARCH}")
message(STATUS "Binary suffix set to '${TARGET_ARCH_SUFFIX}'.")
endif()
if(WIN32)
set(TARGET_PLATFORM_PREFIX "")
message(STATUS "Using Win32 naming convention")
ELSEIF(UNIX)
elseif(UNIX)
set(TARGET_PLATFORM_PREFIX "")
message(STATUS "Using Unix naming convention")
ELSE()
else()
set(TARGET_PLATFORM_PREFIX "")
ENDIF()
endif()
IF(CMAKE_BUILD_TYPE MATCHES Debug)
set(TARGET_CONFIG_SUFFIX "-dbg")
add_definitions(-D_DEBUG)
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_definitions(_DEBUG)
# NOTE: The following may mess up function importation
#if(UNIX)
# # Enable all exports so all functions name can be seen during executable crash
# set(CMAKE_ENABLE_EXPORTS ON)
# message(STATUS "Enabling exports on Unix for backtrace")
#endif()
ELSE()
set(TARGET_CONFIG_SUFFIX "")
ENDIF()
else()
# Non-debug builds
add_compile_definitions(NDEBUG)
endif()
if(APPLE)
# macOS doesn't search the executable path by default
# so, locate libraries like SDL in the executable path
set(CMAKE_INSTALL_RPATH "@executable_path")
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
# Set the visibility to hidden on macOS to prevent shared libraries from
# using functions in the executable
# it's ok to hide them because the backtrace on macOS will still print the name of the functions
add_compile_options(-fvisibility=hidden)
endif()
endif()
#
# Setup the installation directory
#
if(WIN32)
# By default, both DLLs and EXEs are in the same directory
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR bin)
set(BIN_INSTALL_SUBDIR ".")
set(LIB_INSTALL_SUBDIR ".")
else()
# Unix
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR lib${CMAKE_LIB_SUFFIX})
set(BIN_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
set(LIB_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
endif()
# By default, put both binaries and shared libraries in the same directory
# the game uses internal shared libraries that must be in the same folder as the binaries
set(CMAKE_INSTALL_BINDIR ${CMAKE_DEFAULT_INSTALL_RUNTIME_DIR} CACHE PATH "Binary dir")
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Library dir")
include(GNUInstallDirs)
#
# Common stuff
#
add_subdirectory("code/qcommon")
add_subdirectory("code/gamespy")
#
# Application
#
add_subdirectory("code/sys")
##
## Server app
##
add_subdirectory("code/server")
add_executable(omohaaded "code/null/null_client.c" "code/null/null_input.c" "code/null/null_snddma.c")
@ -81,55 +168,105 @@ target_compile_features(omohaaded PUBLIC c_variadic_macros)
target_link_libraries(omohaaded PRIVATE omohserver)
target_link_libraries(omohaaded PRIVATE syslib)
target_link_libraries(omohaaded PRIVATE qcommon qcommon_standalone)
# Gamespy dependency
# Add the gamespy dependency
target_include_directories(omohaaded PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server")
set_target_properties(omohaaded PROPERTIES OUTPUT_NAME "omohaaded${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}${TARGET_CONFIG_SUFFIX}")
set_target_properties(omohaaded PROPERTIES OUTPUT_NAME "omohaaded${TARGET_BIN_SUFFIX}")
set_target_properties(omohaaded PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
INSTALL(TARGETS omohaaded DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
if (MSVC)
target_link_options(omohaaded PRIVATE "/MANIFEST:NO")
INSTALL(FILES $<TARGET_PDB_FILE:omohaaded> DESTINATION "./" OPTIONAL)
INSTALL(FILES $<TARGET_PDB_FILE:omohaaded> DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
endif()
INSTALL(TARGETS omohaaded DESTINATION "./")
if (WITH_CLIENT)
if (NOT BUILD_NO_CLIENT)
##
## Client app
##
option(NO_MODERN_DMA "Use older sound-system" FALSE)
add_subdirectory("code/renderer")
add_subdirectory("code/sdl")
add_subdirectory("code/client")
#include("code/renderergl2/glsl/shaders.cmake")
#file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderercommon/*.c" "code/renderergl2/*.c" "code/renderergl2/*.cpp")
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_subs.c")
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_model.c")
add_subdirectory("code/renderercommon")
add_subdirectory("code/sdl")
add_executable(openmohaa "misc/dummy.c")
target_link_libraries(openmohaa PRIVATE syslib)
target_link_libraries(openmohaa PRIVATE omohserver)
target_link_libraries(openmohaa PRIVATE omohclient)
target_link_libraries(openmohaa PRIVATE omohrenderer omohsdl)
target_link_libraries(openmohaa PRIVATE omohrenderer)
target_link_libraries(openmohaa PRIVATE qcommon qcommon_standalone)
### Gamespy dependency
target_include_directories(openmohaa PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server" "code/client" "code/uilib" "code/jpeg-8c")
set_target_properties(openmohaa PROPERTIES OUTPUT_NAME "openmohaa${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}${TARGET_CONFIG_SUFFIX}")
# Add the gamespy dependency
target_include_directories(openmohaa PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server" "code/client" "code/uilib")
set_target_properties(openmohaa PROPERTIES OUTPUT_NAME "openmohaa${TARGET_BIN_SUFFIX}")
set_target_properties(openmohaa PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
target_link_libraries(openmohaa PRIVATE jpeg8)
if (USE_OPENAL)
# Try to use OpenAL
find_package(OpenAL)
if (OPENAL_FOUND)
target_compile_definitions(openmohaa PRIVATE USE_OPENAL=1)
target_include_directories(openmohaa PRIVATE ${OPENAL_INCLUDE_DIR})
target_link_libraries(openmohaa PRIVATE ${OPENAL_LIBRARY})
endif()
if(USE_INTERNAL_JPEG)
target_include_directories(openmohaa PUBLIC "code/jpeg-8c")
target_link_libraries(openmohaa PRIVATE jpeg8)
else()
find_package(JPEG REQUIRED)
target_include_directories(openmohaa PUBLIC ${JPEG_INCLUDE_DIRS})
target_link_libraries(openmohaa PRIVATE ${JPEG_LIBRARIES})
endif()
INSTALL(TARGETS openmohaa DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
if (MSVC)
target_link_options(openmohaa PRIVATE "/MANIFEST:NO")
INSTALL(FILES $<TARGET_PDB_FILE:openmohaa> DESTINATION "./" OPTIONAL)
INSTALL(FILES $<TARGET_PDB_FILE:openmohaa> DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
endif()
INSTALL(TARGETS openmohaa DESTINATION "./")
if(UNIX AND NOT APPLE)
#
# Desktop entries installation on Unix
#
set(TARGET_ARCH ${TARGET_BIN_SUFFIX})
# Configure the .desktop entries with the arch suffix
configure_file(
misc/linux/org.openmoh.openmohaa.desktop.in
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop
@ONLY
)
configure_file(
misc/linux/org.openmoh.openmohaab.desktop.in
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop
@ONLY
)
configure_file(
misc/linux/org.openmoh.openmohaas.desktop.in
${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop
@ONLY
)
# Install .desktop entries
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaa.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES misc/linux/org.openmoh.openmohaa.metainfo.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
install(FILES misc/openmohaa.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/symbolic/apps/ RENAME org.openmoh.openmohaa.svg)
endif()
endif()
#
# Launcher
#
add_subdirectory(code/Launcher)
#
# uninstall target
#
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()

126
README.md
View file

@ -1,111 +1,63 @@
# OpenMoHAA
/ _ \ _ __ ___ _ __ | \/ |/ _ \| | | | / \ / \
| | | | '_ \ / _ \ '_ \| |\/| | | | | |_| | / _ \ / _ \
| |_| | |_) | __/ | | | | | | |_| | _ |/ ___ \ / ___ \
\___/| .__/ \___|_| |_|_| |_|\___/|_| |_/_/ \_\/_/ \_\
|_|
[![Build](https://github.com/openmoh/openmohaa/actions/workflows/branches-build.yml/badge.svg?branch=main)](https://github.com/openmoh/openmohaa/actions/workflows/branches-build.yml) [![Release](https://img.shields.io/github/v/release/openmoh/openmohaa)](https://github.com/openmoh/openmohaa/releases) [![Downloads](https://img.shields.io/github/downloads/openmoh/openmohaa/total)](https://github.com/openmoh/openmohaa/releases)
![License](https://img.shields.io/github/license/openmoh/openmohaa) ![Commits](https://img.shields.io/github/commit-activity/t/openmoh/openmohaa)
## Discord
![Discord](https://img.shields.io/discord/596049712579215361?logo=discord&logoColor=white&color=5865F2)
[![Discord Banner 1](https://discordapp.com/api/guilds/596049712579215361/widget.png?style=banner2)](https://discord.gg/NYtH58R)
![logo](misc/openmohaa-text-sm.png)
## Current State
## Intro
[![Build](https://github.com/openmoh/openmohaa/actions/workflows/build-cmake.yml/badge.svg)](https://github.com/openmoh/openmohaa/actions/workflows/build-cmake.yml)
The main goal of OpenMoHAA is to ensure the future and continuity of **Medal of Honor: Allied Assault** (including Spearhead and Breakthrough expansions) on all platforms/architectures by providing new patches/features. Thanks to the ioquake3 project and the F.A.K.K SDK, OpenMoHAA has already reached more than half of its goal: an open-source version of MoH:AA (based on version 2.40) that is fully compatible with both the original game and expansions, in terms of network protocol, assets, and scripts. OpenMoHAA is compatible with both MOH:AA servers and clients (Spearhead and Breakthrough included).
OpenMoHAA is still in its early days.
## Getting started
### Server
- [Downloading and installing OpenMoHAA](docs/getting_started_installation.md)
- [Running OpenMoHAA and using expansion assets](docs/getting_started_running.md)
- [Game configuration](docs/configuration.md)
The server version can successfully be built.
Some stuff are not working as intended, such as Actor or Vehicle. These systems are both almost fully implemented, but not really in stable state.
If you encounter any issues, please refer to the [FAQ](docs/faq.md) for possible solutions.
Overall the server part and the game module are almost fully implemented, but the stability may vary, there may be some minor bugs and crashes.
## Current state
### Client
### Single-player
The client version of OpenMoHAA is partially implemented and not stable currently. The cgame module is partially implemented as well, but is compatible with the original MOH:AA game. Credits to **Heavy Metal: F.A.K.K. 2**'s SDK for the cgame module.
The entire single-player campaign should work (Allied Assault, Spearhead and Breakthrough). If you encounter any bug, please create a new [GitHub issue](https://github.com/openmoh/openmohaa/issues) describing them.
Here is the current working state for each part of the engine:
### Multiplayer
| Part name | Full | Almost | Half | Early | Bad | Not working | Comment |
|-------------------------|------|--------|------|-------|-----|-------------|-------------------------------------------------------------------|
| Audio | | | | | x | | Very basic implementation from Quake III |
| CG Module | | x | | | | | Missing FX, Marks and decals |
| Client | | | x | | | | Missing GameSpy, server list, binds, map picker, ... |
| Collision | x | | | | | | |
| Model/TIKI/Skeletor | x | | | | | | |
| Renderer | | | | x | | | Missing ghost, marks, sphere lights, sky portal, sun flare, swipe |
| Server | | x | | | | | Probably a few bugs remaining |
| Server module (fgame) | | x | | | | | Actor, vehicle, and few gameplay bugs |
| UI | | | | x | | | Has core features only (menu, widgets, console, hud, urc loading) |
The Multiplayer part is almost fully stable, all game modes including `Tug-of-War` from Medal of Honor: Spearhead, and `Liberation` from Medal of Honor: Breakthrough are implemented and are working as intended. Mods like `Freeze-Tag` are working as well.
NOTE: Both client and server version can be compiled to target **Medal of Honor: Spearhead** and **Medal of Honor: Breakthrough**.
OpenMoHAA can be used to [host](docs/getting_started_installation.md#server) a mohaa/mohaas/mohaab server and players can use OpenMoHAA to [play](docs/getting_started_installation.md#client) on any server. If some bugs/strange behavior occurs, the best way to report them is by [creating a new issue](https://github.com/openmoh/openmohaa/issues) on the [OpenMoHAA GitHub](https://github.com/openmoh/openmohaa) project with the steps to reproduce (with eventually the problematic mods).
## Running
One of the big multiplayer features are bots. They were introduced for testing and for entertainment purposes so players can have fun alone. See [Configuring bots](docs/configuration/server.md#bots) in the dedicated server configuration documentation to set them up.
Backup existing mohaa files, **cgamex86.dll** and **gamex86.dll** (set their extension to **.bak**)
## Features
a) extract archive to your MOHAA installation directory.
- [List of new features](docs/features.md)
- [Scripting](docs/scripting.md)
-or-
## Reporting issues
b) Copy all pak*.pk3 files and the sound/ directory from your **MOHAA/main** directory into openmohaa's 'main' directory.
If you encounter a bug, report it by creating a new [issue](https://github.com/openmoh/openmohaa/issues). Make sure to select the `Bug report` template and fill in the appropriate fields.
If you have problems running the game :
You may need to install Microsoft Visual C++ 2015/2017/2019/2022 Redistributable from
https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170
You can now start a local OpenMOHAA server or play on a server.
If you need help or have a problem, you can head over to the [discussions](https://github.com/openmoh/openmohaa/discussions) or join the OpenMoHAA Discord server (the link is at the bottom of this README).
## Compiling
OpenMoHAA supports both x86 and x64 architectures, and although the target platform is Windows, it still can be compiled for other platforms, and even other architectures.
These are the tools required for all platforms :
- CMake >= 3.5
- Flex and Bison (currently not used)
- A C++11 compiler is required.
The installation directory can be set to MOHAA directory.
The client build can be built by adding `-DWITH_CLIENT=1` to the CMake command line. This will compile the cgame module and the full app with rendering, ui and sound suppport, alongside the dedicated server version.
To compile for either Spearhead or Breakthrough, append `-DTARGET_GAME_TYPE=x` where x can be 1 for Team Assault (Spearhead), and 2 for Team Tactics (Breakthrough). 2 is recommended because Team Tactics can connect to both Spearhead and Breakthrough servers.
### Linux
These are the tools required on Unix :
- Clang >= 3.3 or GCC >= 4.8.1
**clang-3.5** and **gcc-4.8.5** should work (tested on Ubuntu 16.04). Use the latest possible version of those compilers.
SDL2 library is required (libsdl2-dev).
1 line install command with latest clang version : `sudo apt-get install -y ninja-build cmake make clang-15 lld-15 flex bison libsdl2-dev`
Example with **CMake**, **clang-15** and **ninja-build** installed:
```sh
mkdir .cmake && cd .cmake
cmake -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15 -DWITH_CLIENT=1 -G Ninja
```
### Windows
Visual Studio (2019 or 2022) is generally preferred.
- See [Compiling OpenMoHAA](docs/compiling.md)
## Screenshots
| | |
|---------------------------------------------------------------------|---------------------------------------------------------------------------|
| ![](docs/images/opm_53_tt_1.png "Playing on a Breakthrough server") | ![](docs/images/opm_50b_1.png) |
| ![](docs/images/opm_50b_2.png) | ![](docs/images/opm-arm_53_tt_1.png "OpenMoHAA on Raspberry") |
| | |
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| ![](docs/images/v0.60.0-x86_64/mohdm1_1.png) | ![](docs/images/v0.60.0-x86_64/training_1.png) |
| ![](docs/images/v0.60.0-x86_64/flughafen_1.png) | ![](docs/images/v0.60.0-x86_64/flughafen_2.png) |
| ![](docs/images/v0.60.0-x86_64/mohdm2_1.png "Playing Freeze-Tag mode with bots") | ![](docs/images/v0.60.0-x86_64/training_3.png "Single-Player training") |
*More screenshots [here](docs/images)*
## Third party
@ -113,20 +65,14 @@ Visual Studio (2019 or 2022) is generally preferred.
http://www.libsdl.org/
download Source code, compile
### OpenAL
https://www.openal.org/ download OpenAL soft source
run cmake on OpenAL, compile
https://www.openal.org/
### LibMAD
http://www.underbit.com/products/mad/
download source code, compile
### cURL
https://curl.se/
@ -143,8 +89,14 @@ https://xiph.org/vorbis/
https://opus-codec.org/
## URLs and communities
## Communities
### URLs
- https://github.com/openmoh/openmohaa/
- https://mohaaaa.co.uk/AAAAMOHAA/index.php
- https://x-null.net/
### Discord
[![Discord Banner 1](https://discordapp.com/api/guilds/596049712579215361/widget.png?style=banner2)](https://discord.gg/NYtH58R)

View file

@ -1,25 +0,0 @@
//// //// //// //// ////
/// OpenMoHAA - TODO ///
//// //// //// //// ////
================
= Server code =
================
1) Fix some crashes
================
= Client =
================
2) Better client/sound implementation
3) Better renderer implementation (light, fog)
4) Better cgame implementation (using FAKK2)
5) UI implementation (unfortunately, the mohaa UI is fully based on FAKK 2 sources but isn't available anywhere)
================
= Game code =
================
6) Finish the vehicle implementation
--- Open Beta ---
7) Actors/SinglePlayer
8) SH/BT features (there are not much things to implement I guess)
--- Release ---

21
cmake_uninstall.cmake.in Normal file
View file

@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()

View file

@ -1,8 +1,40 @@
#ifndef AL_AL_H
#define AL_AL_H
#if defined(__cplusplus)
/* NOLINTBEGIN */
#ifdef __cplusplus
extern "C" {
#ifdef _MSVC_LANG
#define AL_CPLUSPLUS _MSVC_LANG
#else
#define AL_CPLUSPLUS __cplusplus
#endif
#ifndef AL_DISABLE_NOEXCEPT
#if AL_CPLUSPLUS >= 201103L
#define AL_API_NOEXCEPT noexcept
#else
#define AL_API_NOEXCEPT
#endif
#if AL_CPLUSPLUS >= 201703L
#define AL_API_NOEXCEPT17 noexcept
#else
#define AL_API_NOEXCEPT17
#endif
#else /* AL_DISABLE_NOEXCEPT */
#define AL_API_NOEXCEPT
#define AL_API_NOEXCEPT17
#endif
#undef AL_CPLUSPLUS
#else /* __cplusplus */
#define AL_API_NOEXCEPT
#define AL_API_NOEXCEPT17
#endif
#ifndef AL_API
@ -15,14 +47,14 @@ extern "C" {
#endif
#endif
#if defined(_WIN32)
#ifdef _WIN32
#define AL_APIENTRY __cdecl
#else
#define AL_APIENTRY
#endif
/** Deprecated macro. */
/* Deprecated macros. */
#define OPENAL
#define ALAPI AL_API
#define ALAPIENTRY AL_APIENTRY
@ -30,7 +62,7 @@ extern "C" {
#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
/** Supported AL version. */
/* Supported AL versions. */
#define AL_VERSION_1_0
#define AL_VERSION_1_1
@ -40,43 +72,43 @@ typedef char ALboolean;
/** character */
typedef char ALchar;
/** signed 8-bit 2's complement integer */
/** signed 8-bit integer */
typedef signed char ALbyte;
/** unsigned 8-bit integer */
typedef unsigned char ALubyte;
/** signed 16-bit 2's complement integer */
/** signed 16-bit integer */
typedef short ALshort;
/** unsigned 16-bit integer */
typedef unsigned short ALushort;
/** signed 32-bit 2's complement integer */
/** signed 32-bit integer */
typedef int ALint;
/** unsigned 32-bit integer */
typedef unsigned int ALuint;
/** non-negative 32-bit binary integer size */
/** non-negative 32-bit integer size */
typedef int ALsizei;
/** enumerated 32-bit value */
/** 32-bit enumeration value */
typedef int ALenum;
/** 32-bit IEEE754 floating-point */
/** 32-bit IEEE-754 floating-point */
typedef float ALfloat;
/** 64-bit IEEE754 floating-point */
/** 64-bit IEEE-754 floating-point */
typedef double ALdouble;
/** void type (for opaque pointers only) */
/** void type (opaque pointers only) */
typedef void ALvoid;
/* Enumerant values begin at column 50. No tabs. */
/* Enumeration values begin at column 50. Do not use tabs. */
/** "no distance model" or "no buffer" */
/** No distance model or no buffer */
#define AL_NONE 0
/** Boolean False. */
@ -89,10 +121,10 @@ typedef void ALvoid;
/**
* Relative source.
* Type: ALboolean
* Range: [AL_TRUE, AL_FALSE]
* Range: [AL_FALSE, AL_TRUE]
* Default: AL_FALSE
*
* Specifies if the Source has relative coordinates.
* Specifies if the source uses relative coordinates.
*/
#define AL_SOURCE_RELATIVE 0x202
@ -103,7 +135,8 @@ typedef void ALvoid;
* Range: [0 - 360]
* Default: 360
*
* The angle covered by the inner cone, where the source will not attenuate.
* The angle covered by the inner cone, the area within which the source will
* not be attenuated by direction.
*/
#define AL_CONE_INNER_ANGLE 0x1001
@ -112,8 +145,8 @@ typedef void ALvoid;
* Range: [0 - 360]
* Default: 360
*
* The angle covered by the outer cone, where the source will be fully
* attenuated.
* The angle covered by the outer cone, the area outside of which the source
* will be fully attenuated by direction.
*/
#define AL_CONE_OUTER_ANGLE 0x1002
@ -123,7 +156,7 @@ typedef void ALvoid;
* Range: [0.5 - 2.0]
* Default: 1.0
*
* A multiplier for the frequency (sample rate) of the source's buffer.
* A multiplier for the sample rate of the source's buffer.
*/
#define AL_PITCH 0x1003
@ -134,12 +167,12 @@ typedef void ALvoid;
*
* The source or listener location in three dimensional space.
*
* OpenAL, like OpenGL, uses a right handed coordinate system, where in a
* frontal default view X (thumb) points right, Y points up (index finger), and
* Z points towards the viewer/camera (middle finger).
* OpenAL uses a right handed coordinate system, like OpenGL, where with a
* default view, X points right (thumb), Y points up (index finger), and Z
* points towards the viewer/camera (middle finger).
*
* To switch from a left handed coordinate system, flip the sign on the Z
* coordinate.
* To change from or to a left handed coordinate system, negate the Z
* component.
*/
#define AL_POSITION 0x1004
@ -148,8 +181,11 @@ typedef void ALvoid;
* Type: ALfloat[3], ALint[3]
* Default: {0, 0, 0}
*
* Specifies the current direction in local space.
* A zero-length vector specifies an omni-directional source (cone is ignored).
* Specifies the current direction in local space. A zero-length vector
* specifies an omni-directional source (cone is ignored).
*
* To change from or to a left handed coordinate system, negate the Z
* component.
*/
#define AL_DIRECTION 0x1005
@ -158,26 +194,30 @@ typedef void ALvoid;
* Type: ALfloat[3], ALint[3]
* Default: {0, 0, 0}
*
* Specifies the current velocity in local space.
* Specifies the current velocity, relative to the position.
*
* To change from or to a left handed coordinate system, negate the Z
* component.
*/
#define AL_VELOCITY 0x1006
/**
* Source looping.
* Type: ALboolean
* Range: [AL_TRUE, AL_FALSE]
* Range: [AL_FALSE, AL_TRUE]
* Default: AL_FALSE
*
* Specifies whether source is looping.
* Specifies whether source playback loops.
*/
#define AL_LOOPING 0x1007
/**
* Source buffer.
* Type: ALuint
* Range: any valid Buffer.
* Type: ALuint
* Range: any valid Buffer ID
* Default: AL_NONE
*
* Specifies the buffer to provide sound samples.
* Specifies the buffer to provide sound samples for a source.
*/
#define AL_BUFFER 0x1009
@ -186,12 +226,12 @@ typedef void ALvoid;
* Type: ALfloat
* Range: [0.0 - ]
*
* A value of 1.0 means unattenuated. Each division by 2 equals an attenuation
* of about -6dB. Each multiplicaton by 2 equals an amplification of about
* +6dB.
* For sources, an initial linear gain value (before attenuation is applied).
* For the listener, an output linear gain adjustment.
*
* A value of 0.0 is meaningless with respect to a logarithmic scale; it is
* silent.
* A value of 1.0 means unattenuated. Each division by 2 equals an attenuation
* of about -6dB. Each multiplication by 2 equals an amplification of about
* +6dB.
*/
#define AL_GAIN 0x100A
@ -200,8 +240,8 @@ typedef void ALvoid;
* Type: ALfloat
* Range: [0.0 - 1.0]
*
* The minimum gain allowed for a source, after distance and cone attenation is
* applied (if applicable).
* The minimum gain allowed for a source, after distance and cone attenuation
* are applied (if applicable).
*/
#define AL_MIN_GAIN 0x100D
@ -210,31 +250,33 @@ typedef void ALvoid;
* Type: ALfloat
* Range: [0.0 - 1.0]
*
* The maximum gain allowed for a source, after distance and cone attenation is
* applied (if applicable).
* The maximum gain allowed for a source, after distance and cone attenuation
* are applied (if applicable).
*/
#define AL_MAX_GAIN 0x100E
/**
* Listener orientation.
* Type: ALfloat[6]
* Type: ALfloat[6]
* Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0}
*
* Effectively two three dimensional vectors. The first vector is the front (or
* "at") and the second is the top (or "up").
* "at") and the second is the top (or "up"). Both vectors are relative to the
* listener position.
*
* Both vectors are in local space.
* To change from or to a left handed coordinate system, negate the Z
* component of both vectors.
*/
#define AL_ORIENTATION 0x100F
/**
* Source state (query only).
* Type: ALint
* Type: ALenum
* Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED]
*/
#define AL_SOURCE_STATE 0x1010
/** Source state value. */
/* Source state values. */
#define AL_INITIAL 0x1011
#define AL_PLAYING 0x1012
#define AL_PAUSED 0x1013
@ -267,9 +309,9 @@ typedef void ALvoid;
* Range: [0.0 - ]
* Default: 1.0
*
* The distance in units that no attenuation occurs.
* The distance in units that no distance attenuation occurs.
*
* At 0.0, no distance attenuation ever occurs on non-linear attenuation models.
* At 0.0, no distance attenuation occurs with non-linear attenuation models.
*/
#define AL_REFERENCE_DISTANCE 0x1020
@ -292,7 +334,7 @@ typedef void ALvoid;
* Default: 0.0
*
* The gain attenuation applied when the listener is outside of the source's
* outer cone.
* outer cone angle.
*/
#define AL_CONE_OUTER_GAIN 0x1022
@ -300,7 +342,7 @@ typedef void ALvoid;
* Source maximum distance.
* Type: ALfloat
* Range: [0.0 - ]
* Default: +inf
* Default: FLT_MAX
*
* The distance above which the source is not attenuated any further with a
* clamped distance model, or where attenuation reaches 0.0 gain for linear
@ -308,16 +350,16 @@ typedef void ALvoid;
*/
#define AL_MAX_DISTANCE 0x1023
/** Source buffer position, in seconds */
/** Source buffer offset, in seconds */
#define AL_SEC_OFFSET 0x1024
/** Source buffer position, in sample frames */
/** Source buffer offset, in sample frames */
#define AL_SAMPLE_OFFSET 0x1025
/** Source buffer position, in bytes */
/** Source buffer offset, in bytes */
#define AL_BYTE_OFFSET 0x1026
/**
* Source type (query only).
* Type: ALint
* Type: ALenum
* Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED]
*
* A Source is Static if a Buffer has been attached using AL_BUFFER.
@ -330,31 +372,30 @@ typedef void ALvoid;
*/
#define AL_SOURCE_TYPE 0x1027
/** Source type value. */
/* Source type values. */
#define AL_STATIC 0x1028
#define AL_STREAMING 0x1029
#define AL_UNDETERMINED 0x1030
/** Buffer format specifier. */
/** Unsigned 8-bit mono buffer format. */
#define AL_FORMAT_MONO8 0x1100
/** Signed 16-bit mono buffer format. */
#define AL_FORMAT_MONO16 0x1101
/** Unsigned 8-bit stereo buffer format. */
#define AL_FORMAT_STEREO8 0x1102
/** Signed 16-bit stereo buffer format. */
#define AL_FORMAT_STEREO16 0x1103
/** Buffer frequency (query only). */
/** Buffer frequency/sample rate (query only). */
#define AL_FREQUENCY 0x2001
/** Buffer bits per sample (query only). */
#define AL_BITS 0x2002
/** Buffer channel count (query only). */
#define AL_CHANNELS 0x2003
/** Buffer data size (query only). */
/** Buffer data size in bytes (query only). */
#define AL_SIZE 0x2004
/**
* Buffer state.
*
* Not for public use.
*/
/* Buffer state. Not for public use. */
#define AL_UNUSED 0x2010
#define AL_PENDING 0x2011
#define AL_PROCESSED 0x2012
@ -363,32 +404,31 @@ typedef void ALvoid;
/** No error. */
#define AL_NO_ERROR 0
/** Invalid name paramater passed to AL call. */
/** Invalid name (ID) passed to an AL call. */
#define AL_INVALID_NAME 0xA001
/** Invalid enum parameter passed to AL call. */
/** Invalid enumeration passed to AL call. */
#define AL_INVALID_ENUM 0xA002
/** Invalid value parameter passed to AL call. */
/** Invalid value passed to AL call. */
#define AL_INVALID_VALUE 0xA003
/** Illegal AL call. */
#define AL_INVALID_OPERATION 0xA004
/** Not enough memory. */
/** Not enough memory to execute the AL call. */
#define AL_OUT_OF_MEMORY 0xA005
/** Context string: Vendor ID. */
/** Context string: Vendor name. */
#define AL_VENDOR 0xB001
/** Context string: Version. */
#define AL_VERSION 0xB002
/** Context string: Renderer ID. */
/** Context string: Renderer name. */
#define AL_RENDERER 0xB003
/** Context string: Space-separated extension list. */
#define AL_EXTENSIONS 0xB004
/**
* Doppler scale.
* Type: ALfloat
@ -398,7 +438,6 @@ typedef void ALvoid;
* Scale for source and listener velocities.
*/
#define AL_DOPPLER_FACTOR 0xC000
AL_API void AL_APIENTRY alDopplerFactor(ALfloat value);
/**
* Doppler velocity (deprecated).
@ -406,7 +445,6 @@ AL_API void AL_APIENTRY alDopplerFactor(ALfloat value);
* A multiplier applied to the Speed of Sound.
*/
#define AL_DOPPLER_VELOCITY 0xC001
AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value);
/**
* Speed of Sound, in units per second.
@ -415,14 +453,13 @@ AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value);
* Default: 343.3
*
* The speed at which sound waves are assumed to travel, when calculating the
* doppler effect.
* doppler effect from source and listener velocities.
*/
#define AL_SPEED_OF_SOUND 0xC003
AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value);
/**
* Distance attenuation model.
* Type: ALint
* Type: ALenum
* Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED,
* AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED,
* AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED]
@ -439,9 +476,8 @@ AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value);
* distance calculated is clamped between the reference and max distances.
*/
#define AL_DISTANCE_MODEL 0xD000
AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel);
/** Distance model value. */
/* Distance model values. */
#define AL_INVERSE_DISTANCE 0xD001
#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
#define AL_LINEAR_DISTANCE 0xD003
@ -449,208 +485,223 @@ AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel);
#define AL_EXPONENT_DISTANCE 0xD005
#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
/** Renderer State management. */
AL_API void AL_APIENTRY alEnable(ALenum capability);
AL_API void AL_APIENTRY alDisable(ALenum capability);
AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability);
#ifndef AL_NO_PROTOTYPES
/* Renderer State management. */
AL_API void AL_APIENTRY alEnable(ALenum capability) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alDisable(ALenum capability) AL_API_NOEXCEPT;
AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability) AL_API_NOEXCEPT;
/** State retrieval. */
AL_API const ALchar* AL_APIENTRY alGetString(ALenum param);
AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values);
AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values);
AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values);
AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param);
AL_API ALint AL_APIENTRY alGetInteger(ALenum param);
AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param);
AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param);
/* Context state setting. */
AL_API void AL_APIENTRY alDopplerFactor(ALfloat value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel) AL_API_NOEXCEPT;
/* Context state retrieval. */
AL_API const ALchar* AL_APIENTRY alGetString(ALenum param) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values) AL_API_NOEXCEPT;
AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param) AL_API_NOEXCEPT;
AL_API ALint AL_APIENTRY alGetInteger(ALenum param) AL_API_NOEXCEPT;
AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param) AL_API_NOEXCEPT;
AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param) AL_API_NOEXCEPT;
/**
* Error retrieval.
*
* Obtain the first error generated in the AL context since the last check.
* Obtain the first error generated in the AL context since the last call to
* this function.
*/
AL_API ALenum AL_APIENTRY alGetError(void);
AL_API ALenum AL_APIENTRY alGetError(void) AL_API_NOEXCEPT;
/** Query for the presence of an extension on the AL context. */
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname) AL_API_NOEXCEPT;
/**
* Extension support.
*
* Query for the presence of an extension, and obtain any appropriate function
* pointers and enum values.
* Retrieve the address of a function. The returned function may be context-
* specific.
*/
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname);
AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname);
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename);
AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname) AL_API_NOEXCEPT;
/**
* Retrieve the value of an enum. The returned value may be context-specific.
*/
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename) AL_API_NOEXCEPT;
/** Set Listener parameters */
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value);
AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values);
AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value);
AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3);
AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values);
/* Set listener parameters. */
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values) AL_API_NOEXCEPT;
/** Get Listener parameters */
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value);
AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value);
AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3);
AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values);
/* Get listener parameters. */
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values) AL_API_NOEXCEPT;
/** Create Source objects. */
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources);
/** Delete Source objects. */
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources);
/** Verify a handle is a valid Source. */
AL_API ALboolean AL_APIENTRY alIsSource(ALuint source);
/** Create source objects. */
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources) AL_API_NOEXCEPT;
/** Delete source objects. */
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
/** Verify an ID is for a valid source. */
AL_API ALboolean AL_APIENTRY alIsSource(ALuint source) AL_API_NOEXCEPT;
/** Set Source parameters. */
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value);
AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values);
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value);
AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values);
/* Set source parameters. */
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT;
/** Get Source parameters. */
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value);
AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value);
AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values);
/* Get source parameters. */
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT;
/** Play, replay, or resume (if paused) a list of Sources */
AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources);
/** Stop a list of Sources */
AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources);
/** Rewind a list of Sources */
AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources);
/** Pause a list of Sources */
AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources);
/** Play, restart, or resume a source, setting its state to AL_PLAYING. */
AL_API void AL_APIENTRY alSourcePlay(ALuint source) AL_API_NOEXCEPT;
/** Stop a source, setting its state to AL_STOPPED if playing or paused. */
AL_API void AL_APIENTRY alSourceStop(ALuint source) AL_API_NOEXCEPT;
/** Rewind a source, setting its state to AL_INITIAL. */
AL_API void AL_APIENTRY alSourceRewind(ALuint source) AL_API_NOEXCEPT;
/** Pause a source, setting its state to AL_PAUSED if playing. */
AL_API void AL_APIENTRY alSourcePause(ALuint source) AL_API_NOEXCEPT;
/** Play, replay, or resume a Source */
AL_API void AL_APIENTRY alSourcePlay(ALuint source);
/** Stop a Source */
AL_API void AL_APIENTRY alSourceStop(ALuint source);
/** Rewind a Source (set playback postiton to beginning) */
AL_API void AL_APIENTRY alSourceRewind(ALuint source);
/** Pause a Source */
AL_API void AL_APIENTRY alSourcePause(ALuint source);
/** Play, restart, or resume a list of sources atomically. */
AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
/** Stop a list of sources atomically. */
AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
/** Rewind a list of sources atomically. */
AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
/** Pause a list of sources atomically. */
AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
/** Queue buffers onto a source */
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers);
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT;
/** Unqueue processed buffers from a source */
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers);
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT;
/** Create Buffer objects */
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers);
/** Delete Buffer objects */
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers);
/** Verify a handle is a valid Buffer */
AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer);
/** Create buffer objects */
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers) AL_API_NOEXCEPT;
/** Delete buffer objects */
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT;
/** Verify an ID is a valid buffer (including the NULL buffer) */
AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer) AL_API_NOEXCEPT;
/** Specifies the data to be copied into a buffer */
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
/**
* Copies data into the buffer, interpreting it using the specified format and
* samplerate.
*/
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT;
/** Set Buffer parameters, */
AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value);
AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values);
AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value);
AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values);
/* Set buffer parameters. */
AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT;
/** Get Buffer parameters. */
AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value);
AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values);
AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value);
AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values);
/* Get buffer parameters. */
AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT;
#endif /* AL_NO_PROTOTYPES */
/** Pointer-to-function type, useful for dynamically getting AL entry points. */
typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability);
typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability);
typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability);
typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param);
typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values);
typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values);
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param);
typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param);
typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param);
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param);
typedef ALenum (AL_APIENTRY *LPALGETERROR)(void);
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname);
typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname);
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename);
typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value);
typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values);
typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value);
typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3);
typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values);
typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value);
typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value);
typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3);
typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources);
typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources);
typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value);
typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values);
typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value);
typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values);
typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value);
typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value);
typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources);
typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source);
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers);
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers);
typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers);
typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers);
typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer);
typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value);
typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values);
typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value);
typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values);
typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value);
typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values);
typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value);
typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values);
typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value);
typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value);
typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value);
typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel);
/* Pointer-to-function types, useful for storing dynamically loaded AL entry
* points.
*/
typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability) AL_API_NOEXCEPT17;
typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param) AL_API_NOEXCEPT17;
typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param) AL_API_NOEXCEPT17;
typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param) AL_API_NOEXCEPT17;
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param) AL_API_NOEXCEPT17;
typedef ALenum (AL_APIENTRY *LPALGETERROR)(void) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname) AL_API_NOEXCEPT17;
typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname) AL_API_NOEXCEPT17;
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel) AL_API_NOEXCEPT17;
#if defined(__cplusplus)
#ifdef __cplusplus
} /* extern "C" */
#endif
/* NOLINTEND */
#endif /* AL_AL_H */

View file

@ -1,8 +1,40 @@
#ifndef AL_ALC_H
#define AL_ALC_H
#if defined(__cplusplus)
/* NOLINTBEGIN */
#ifdef __cplusplus
extern "C" {
#ifdef _MSVC_LANG
#define ALC_CPLUSPLUS _MSVC_LANG
#else
#define ALC_CPLUSPLUS __cplusplus
#endif
#ifndef AL_DISABLE_NOEXCEPT
#if ALC_CPLUSPLUS >= 201103L
#define ALC_API_NOEXCEPT noexcept
#else
#define ALC_API_NOEXCEPT
#endif
#if ALC_CPLUSPLUS >= 201703L
#define ALC_API_NOEXCEPT17 noexcept
#else
#define ALC_API_NOEXCEPT17
#endif
#else /* AL_DISABLE_NOEXCEPT */
#define ALC_API_NOEXCEPT
#define ALC_API_NOEXCEPT17
#endif
#undef ALC_CPLUSPLUS
#else /* __cplusplus */
#define ALC_API_NOEXCEPT
#define ALC_API_NOEXCEPT17
#endif
#ifndef ALC_API
@ -15,14 +47,14 @@ extern "C" {
#endif
#endif
#if defined(_WIN32)
#ifdef _WIN32
#define ALC_APIENTRY __cdecl
#else
#define ALC_APIENTRY
#endif
/** Deprecated macro. */
/* Deprecated macros. */
#define ALCAPI ALC_API
#define ALCAPIENTRY ALC_APIENTRY
#define ALC_INVALID 0
@ -31,9 +63,9 @@ extern "C" {
#define ALC_VERSION_0_1 1
/** Opaque device handle */
typedef struct ALCdevice_struct ALCdevice;
typedef struct ALCdevice ALCdevice;
/** Opaque context handle */
typedef struct ALCcontext_struct ALCcontext;
typedef struct ALCcontext ALCcontext;
/** 8-bit boolean */
typedef char ALCboolean;
@ -41,41 +73,41 @@ typedef char ALCboolean;
/** character */
typedef char ALCchar;
/** signed 8-bit 2's complement integer */
/** signed 8-bit integer */
typedef signed char ALCbyte;
/** unsigned 8-bit integer */
typedef unsigned char ALCubyte;
/** signed 16-bit 2's complement integer */
/** signed 16-bit integer */
typedef short ALCshort;
/** unsigned 16-bit integer */
typedef unsigned short ALCushort;
/** signed 32-bit 2's complement integer */
/** signed 32-bit integer */
typedef int ALCint;
/** unsigned 32-bit integer */
typedef unsigned int ALCuint;
/** non-negative 32-bit binary integer size */
/** non-negative 32-bit integer size */
typedef int ALCsizei;
/** enumerated 32-bit value */
/** 32-bit enumeration value */
typedef int ALCenum;
/** 32-bit IEEE754 floating-point */
/** 32-bit IEEE-754 floating-point */
typedef float ALCfloat;
/** 64-bit IEEE754 floating-point */
/** 64-bit IEEE-754 floating-point */
typedef double ALCdouble;
/** void type (for opaque pointers only) */
typedef void ALCvoid;
/* Enumerant values begin at column 50. No tabs. */
/* Enumeration values begin at column 50. Do not use tabs. */
/** Boolean False. */
#define ALC_FALSE 0
@ -89,7 +121,7 @@ typedef void ALCvoid;
/** Context attribute: <int> Hz. */
#define ALC_REFRESH 0x1008
/** Context attribute: AL_TRUE or AL_FALSE. */
/** Context attribute: AL_TRUE or AL_FALSE synchronous context? */
#define ALC_SYNC 0x1009
/** Context attribute: <int> requested Mono (3D) Sources. */
@ -107,30 +139,32 @@ typedef void ALCvoid;
/** Invalid context handle. */
#define ALC_INVALID_CONTEXT 0xA002
/** Invalid enum parameter passed to an ALC call. */
/** Invalid enumeration passed to an ALC call. */
#define ALC_INVALID_ENUM 0xA003
/** Invalid value parameter passed to an ALC call. */
/** Invalid value passed to an ALC call. */
#define ALC_INVALID_VALUE 0xA004
/** Out of memory. */
#define ALC_OUT_OF_MEMORY 0xA005
/** Runtime ALC version. */
/** Runtime ALC major version. */
#define ALC_MAJOR_VERSION 0x1000
/** Runtime ALC minor version. */
#define ALC_MINOR_VERSION 0x1001
/** Context attribute list properties. */
/** Context attribute list size. */
#define ALC_ATTRIBUTES_SIZE 0x1002
/** Context attribute list properties. */
#define ALC_ALL_ATTRIBUTES 0x1003
/** String for the default device specifier. */
#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
/**
* String for the given device's specifier.
* Device specifier string.
*
* If device handle is NULL, it is instead a null-char separated list of
* If device handle is NULL, it is instead a null-character separated list of
* strings of known device specifiers (list ends with an empty string).
*/
#define ALC_DEVICE_SPECIFIER 0x1005
@ -141,9 +175,9 @@ typedef void ALCvoid;
/** Capture extension */
#define ALC_EXT_CAPTURE 1
/**
* String for the given capture device's specifier.
* Capture device specifier string.
*
* If device handle is NULL, it is instead a null-char separated list of
* If device handle is NULL, it is instead a null-character separated list of
* strings of known capture device specifiers (list ends with an empty string).
*/
#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
@ -158,80 +192,116 @@ typedef void ALCvoid;
/** String for the default extended device specifier. */
#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
/**
* String for the given extended device's specifier.
* Device's extended specifier string.
*
* If device handle is NULL, it is instead a null-char separated list of
* If device handle is NULL, it is instead a null-character separated list of
* strings of known extended device specifiers (list ends with an empty string).
*/
#define ALC_ALL_DEVICES_SPECIFIER 0x1013
/** Context management. */
ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist);
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
#ifndef ALC_NO_PROTOTYPES
/* Context management. */
/** Device management. */
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
/** Create and attach a context to the given device. */
ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist) ALC_API_NOEXCEPT;
/**
* Makes the given context the active process-wide context. Passing NULL clears
* the active context.
*/
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context) ALC_API_NOEXCEPT;
/** Resumes processing updates for the given context. */
ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context) ALC_API_NOEXCEPT;
/** Suspends updates for the given context. */
ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context) ALC_API_NOEXCEPT;
/** Remove a context from its device and destroys it. */
ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context) ALC_API_NOEXCEPT;
/** Returns the currently active context. */
ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void) ALC_API_NOEXCEPT;
/** Returns the device that a particular context is attached to. */
ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context) ALC_API_NOEXCEPT;
/* Device management. */
/** Opens the named playback device. */
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) ALC_API_NOEXCEPT;
/** Closes the given playback device. */
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device) ALC_API_NOEXCEPT;
/* Error support. */
/** Obtain the most recent Device error. */
ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device) ALC_API_NOEXCEPT;
/* Extension support. */
/**
* Error support.
*
* Obtain the most recent Device error.
* Query for the presence of an extension on the device. Pass a NULL device to
* query a device-inspecific extension.
*/
ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname) ALC_API_NOEXCEPT;
/**
* Retrieve the address of a function. Given a non-NULL device, the returned
* function may be device-specific.
*/
ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname) ALC_API_NOEXCEPT;
/**
* Retrieve the value of an enum. Given a non-NULL device, the returned value
* may be device-specific.
*/
ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname) ALC_API_NOEXCEPT;
/* Query functions. */
/** Returns information about the device, and error strings. */
ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param) ALC_API_NOEXCEPT;
/** Returns information about the device and the version of OpenAL. */
ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values) ALC_API_NOEXCEPT;
/* Capture functions. */
/**
* Extension support.
*
* Query for the presence of an extension, and obtain any appropriate
* function pointers and enum values.
* Opens the named capture device with the given frequency, format, and buffer
* size.
*/
ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize) ALC_API_NOEXCEPT;
/** Closes the given capture device. */
ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device) ALC_API_NOEXCEPT;
/** Starts capturing samples into the device buffer. */
ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device) ALC_API_NOEXCEPT;
/** Stops capturing samples. Samples in the device buffer remain available. */
ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device) ALC_API_NOEXCEPT;
/** Reads samples from the device buffer. */
ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) ALC_API_NOEXCEPT;
#endif /* ALC_NO_PROTOTYPES */
/** Query function. */
ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
/* Pointer-to-function types, useful for storing dynamically loaded ALC entry
* points.
*/
typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist) ALC_API_NOEXCEPT17;
typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void) ALC_API_NOEXCEPT17;
typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context) ALC_API_NOEXCEPT17;
typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename) ALC_API_NOEXCEPT17;
typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device) ALC_API_NOEXCEPT17;
typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device) ALC_API_NOEXCEPT17;
typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname) ALC_API_NOEXCEPT17;
typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname) ALC_API_NOEXCEPT17;
typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname) ALC_API_NOEXCEPT17;
typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values) ALC_API_NOEXCEPT17;
typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize) ALC_API_NOEXCEPT17;
typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) ALC_API_NOEXCEPT17;
/** Capture function. */
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
/** Pointer-to-function type, useful for dynamically getting ALC entry points. */
typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
#if defined(__cplusplus)
}
#ifdef __cplusplus
} /* extern "C" */
#endif
/* NOLINTEND */
#endif /* AL_ALC_H */

View file

@ -1,38 +1,22 @@
/**
* OpenAL cross platform audio library
* Copyright (C) 2008 by authors.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#ifndef AL_ALEXT_H
#define AL_ALEXT_H
/* NOLINTBEGIN */
#include <stddef.h>
/* Define int64_t and uint64_t types */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(_WIN32) && defined(__GNUC__)
/* Define int64 and uint64 types */
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
#include <stdint.h>
typedef int64_t _alsoft_int64_t;
typedef uint64_t _alsoft_uint64_t;
#elif defined(_WIN32)
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef __int64 _alsoft_int64_t;
typedef unsigned __int64 _alsoft_uint64_t;
#else
/* Fallback if nothing above works */
#include <inttypes.h>
#include <stdint.h>
typedef int64_t _alsoft_int64_t;
typedef uint64_t _alsoft_uint64_t;
#endif
#include "alc.h"
@ -42,6 +26,8 @@ typedef unsigned __int64 uint64_t;
extern "C" {
#endif
struct _GUID;
#ifndef AL_LOKI_IMA_ADPCM_format
#define AL_LOKI_IMA_ADPCM_format 1
#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000
@ -97,6 +83,31 @@ extern "C" {
#ifndef AL_EXT_MCFORMATS
#define AL_EXT_MCFORMATS 1
/* Provides support for surround sound buffer formats with 8, 16, and 32-bit
* samples.
*
* QUAD8: Unsigned 8-bit, Quadraphonic (Front Left, Front Right, Rear Left,
* Rear Right).
* QUAD16: Signed 16-bit, Quadraphonic.
* QUAD32: 32-bit float, Quadraphonic.
* REAR8: Unsigned 8-bit, Rear Stereo (Rear Left, Rear Right).
* REAR16: Signed 16-bit, Rear Stereo.
* REAR32: 32-bit float, Rear Stereo.
* 51CHN8: Unsigned 8-bit, 5.1 Surround (Front Left, Front Right, Front Center,
* LFE, Side Left, Side Right). Note that some audio systems may label
* 5.1's Side channels as Rear or Surround; they are equivalent for the
* purposes of this extension.
* 51CHN16: Signed 16-bit, 5.1 Surround.
* 51CHN32: 32-bit float, 5.1 Surround.
* 61CHN8: Unsigned 8-bit, 6.1 Surround (Front Left, Front Right, Front Center,
* LFE, Rear Center, Side Left, Side Right).
* 61CHN16: Signed 16-bit, 6.1 Surround.
* 61CHN32: 32-bit float, 6.1 Surround.
* 71CHN8: Unsigned 8-bit, 7.1 Surround (Front Left, Front Right, Front Center,
* LFE, Rear Left, Rear Right, Side Left, Side Right).
* 71CHN16: Signed 16-bit, 7.1 Surround.
* 71CHN32: 32-bit float, 7.1 Surround.
*/
#define AL_FORMAT_QUAD8 0x1204
#define AL_FORMAT_QUAD16 0x1205
#define AL_FORMAT_QUAD32 0x1206
@ -133,9 +144,9 @@ extern "C" {
#ifndef AL_EXT_STATIC_BUFFER
#define AL_EXT_STATIC_BUFFER 1
typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei);
typedef void (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALuint,ALenum,ALvoid*,ALsizei,ALsizei) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq);
void AL_APIENTRY alBufferDataStatic(const ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) AL_API_NOEXCEPT;
#endif
#endif
@ -151,11 +162,11 @@ AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format,
#ifndef ALC_EXT_thread_local_context
#define ALC_EXT_thread_local_context 1
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context);
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void);
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context) ALC_API_NOEXCEPT17;
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void) ALC_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context);
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context) ALC_API_NOEXCEPT;
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void) ALC_API_NOEXCEPT;
#endif
#endif
@ -168,9 +179,9 @@ ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
#define AL_SOFT_buffer_sub_data 1
#define AL_BYTE_RW_OFFSETS_SOFT 0x1031
#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032
typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei);
typedef void (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length);
AL_API void AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length) AL_API_NOEXCEPT;
#endif
#endif
@ -187,12 +198,12 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const
#define AL_FOLDBACK_EVENT_STOP 0x4113
#define AL_FOLDBACK_MODE_MONO 0x4101
#define AL_FOLDBACK_MODE_STEREO 0x4102
typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei);
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK);
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void);
typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback);
AL_API void AL_APIENTRY alRequestFoldbackStop(void);
AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alRequestFoldbackStop(void) AL_API_NOEXCEPT;
#endif
#endif
@ -255,15 +266,15 @@ AL_API void AL_APIENTRY alRequestFoldbackStop(void);
#define AL_SAMPLE_LENGTH_SOFT 0x200A
#define AL_SEC_LENGTH_SOFT 0x200B
typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*);
typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*);
typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*);
typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum);
typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data);
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format);
AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data) AL_API_NOEXCEPT;
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format) AL_API_NOEXCEPT;
#endif
#endif
@ -294,13 +305,13 @@ AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format);
#define ALC_6POINT1_SOFT 0x1505
#define ALC_7POINT1_SOFT 0x1506
typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*);
typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum);
typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei);
typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*) ALC_API_NOEXCEPT17;
typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei) ALC_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName);
ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type);
ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName) AL_API_NOEXCEPT;
ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type) AL_API_NOEXCEPT;
ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) AL_API_NOEXCEPT;
#endif
#endif
@ -318,38 +329,764 @@ ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffe
#define AL_SOFT_source_latency 1
#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200
#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201
typedef int64_t ALint64SOFT;
typedef uint64_t ALuint64SOFT;
typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble);
typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble);
typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*);
typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT);
typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT);
typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*);
typedef _alsoft_int64_t ALint64SOFT;
typedef _alsoft_uint64_t ALuint64SOFT;
typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value);
AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3);
AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values);
AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value);
AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3);
AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values);
AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value);
AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3);
AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values);
AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value);
AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3);
AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values);
AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values) AL_API_NOEXCEPT;
#endif
#endif
#ifndef ALC_EXT_DEFAULT_FILTER_ORDER
#define ALC_EXT_DEFAULT_FILTER_ORDER 1
#define ALC_DEFAULT_FILTER_ORDER 0x1100
#endif
#ifndef AL_SOFT_deferred_updates
#define AL_SOFT_deferred_updates 1
#define AL_DEFERRED_UPDATES_SOFT 0xC002
typedef void (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alDeferUpdatesSOFT(void) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alProcessUpdatesSOFT(void) AL_API_NOEXCEPT;
#endif
#endif
#ifndef AL_SOFT_block_alignment
#define AL_SOFT_block_alignment 1
#define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C
#define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D
#endif
#ifndef AL_SOFT_MSADPCM
#define AL_SOFT_MSADPCM 1
#define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302
#define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303
#endif
#ifndef AL_SOFT_source_length
#define AL_SOFT_source_length 1
/*#define AL_BYTE_LENGTH_SOFT 0x2009*/
/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/
/*#define AL_SEC_LENGTH_SOFT 0x200B*/
#endif
#ifndef AL_SOFT_buffer_length_query
#define AL_SOFT_buffer_length_query 1
/*#define AL_BYTE_LENGTH_SOFT 0x2009*/
/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/
/*#define AL_SEC_LENGTH_SOFT 0x200B*/
#endif
#ifndef ALC_SOFT_pause_device
#define ALC_SOFT_pause_device 1
typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device) ALC_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device) ALC_API_NOEXCEPT;
ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device) ALC_API_NOEXCEPT;
#endif
#endif
#ifndef AL_EXT_BFORMAT
#define AL_EXT_BFORMAT 1
/* Provides support for B-Format ambisonic buffers (first-order, FuMa scaling
* and layout).
*
* BFORMAT2D_8: Unsigned 8-bit, 3-channel non-periphonic (WXY).
* BFORMAT2D_16: Signed 16-bit, 3-channel non-periphonic (WXY).
* BFORMAT2D_FLOAT32: 32-bit float, 3-channel non-periphonic (WXY).
* BFORMAT3D_8: Unsigned 8-bit, 4-channel periphonic (WXYZ).
* BFORMAT3D_16: Signed 16-bit, 4-channel periphonic (WXYZ).
* BFORMAT3D_FLOAT32: 32-bit float, 4-channel periphonic (WXYZ).
*/
#define AL_FORMAT_BFORMAT2D_8 0x20021
#define AL_FORMAT_BFORMAT2D_16 0x20022
#define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023
#define AL_FORMAT_BFORMAT3D_8 0x20031
#define AL_FORMAT_BFORMAT3D_16 0x20032
#define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033
#endif
#ifndef AL_EXT_MULAW_BFORMAT
#define AL_EXT_MULAW_BFORMAT 1
#define AL_FORMAT_BFORMAT2D_MULAW 0x10031
#define AL_FORMAT_BFORMAT3D_MULAW 0x10032
#endif
#ifndef ALC_SOFT_HRTF
#define ALC_SOFT_HRTF 1
#define ALC_HRTF_SOFT 0x1992
#define ALC_DONT_CARE_SOFT 0x0002
#define ALC_HRTF_STATUS_SOFT 0x1993
#define ALC_HRTF_DISABLED_SOFT 0x0000
#define ALC_HRTF_ENABLED_SOFT 0x0001
#define ALC_HRTF_DENIED_SOFT 0x0002
#define ALC_HRTF_REQUIRED_SOFT 0x0003
#define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004
#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005
#define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994
#define ALC_HRTF_SPECIFIER_SOFT 0x1995
#define ALC_HRTF_ID_SOFT 0x1996
typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index) ALC_API_NOEXCEPT17;
typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs) ALC_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index) ALC_API_NOEXCEPT;
ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs) ALC_API_NOEXCEPT;
#endif
#endif
#ifndef AL_SOFT_gain_clamp_ex
#define AL_SOFT_gain_clamp_ex 1
#define AL_GAIN_LIMIT_SOFT 0x200E
#endif
#ifndef AL_SOFT_source_resampler
#define AL_SOFT_source_resampler
#define AL_NUM_RESAMPLERS_SOFT 0x1210
#define AL_DEFAULT_RESAMPLER_SOFT 0x1211
#define AL_SOURCE_RESAMPLER_SOFT 0x1212
#define AL_RESAMPLER_NAME_SOFT 0x1213
typedef const ALchar* (AL_APIENTRY*LPALGETSTRINGISOFT)(ALenum pname, ALsizei index) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index) AL_API_NOEXCEPT;
#endif
#endif
#ifndef AL_SOFT_source_spatialize
#define AL_SOFT_source_spatialize
#define AL_SOURCE_SPATIALIZE_SOFT 0x1214
#define AL_AUTO_SOFT 0x0002
#endif
#ifndef ALC_SOFT_output_limiter
#define ALC_SOFT_output_limiter
#define ALC_OUTPUT_LIMITER_SOFT 0x199A
#endif
#ifndef ALC_SOFT_device_clock
#define ALC_SOFT_device_clock 1
typedef _alsoft_int64_t ALCint64SOFT;
typedef _alsoft_uint64_t ALCuint64SOFT;
#define ALC_DEVICE_CLOCK_SOFT 0x1600
#define ALC_DEVICE_LATENCY_SOFT 0x1601
#define ALC_DEVICE_CLOCK_LATENCY_SOFT 0x1602
#define AL_SAMPLE_OFFSET_CLOCK_SOFT 0x1202
#define AL_SEC_OFFSET_CLOCK_SOFT 0x1203
typedef void (ALC_APIENTRY*LPALCGETINTEGER64VSOFT)(ALCdevice *device, ALCenum pname, ALsizei size, ALCint64SOFT *values) ALC_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname, ALsizei size, ALCint64SOFT *values) ALC_API_NOEXCEPT;
#endif
#endif
#ifndef AL_SOFT_direct_channels_remix
#define AL_SOFT_direct_channels_remix 1
#define AL_DROP_UNMATCHED_SOFT 0x0001
#define AL_REMIX_UNMATCHED_SOFT 0x0002
#endif
#ifndef AL_SOFT_bformat_ex
#define AL_SOFT_bformat_ex 1
#define AL_AMBISONIC_LAYOUT_SOFT 0x1997
#define AL_AMBISONIC_SCALING_SOFT 0x1998
/* Ambisonic layouts */
#define AL_FUMA_SOFT 0x0000
#define AL_ACN_SOFT 0x0001
/* Ambisonic scalings (normalization) */
/*#define AL_FUMA_SOFT*/
#define AL_SN3D_SOFT 0x0001
#define AL_N3D_SOFT 0x0002
#endif
#ifndef ALC_SOFT_loopback_bformat
#define ALC_SOFT_loopback_bformat 1
#define ALC_AMBISONIC_LAYOUT_SOFT 0x1997
#define ALC_AMBISONIC_SCALING_SOFT 0x1998
#define ALC_AMBISONIC_ORDER_SOFT 0x1999
#define ALC_MAX_AMBISONIC_ORDER_SOFT 0x199B
#define ALC_BFORMAT3D_SOFT 0x1507
/* Ambisonic layouts */
#define ALC_FUMA_SOFT 0x0000
#define ALC_ACN_SOFT 0x0001
/* Ambisonic scalings (normalization) */
/*#define ALC_FUMA_SOFT*/
#define ALC_SN3D_SOFT 0x0001
#define ALC_N3D_SOFT 0x0002
#endif
#ifndef AL_SOFT_effect_target
#define AL_SOFT_effect_target
#define AL_EFFECTSLOT_TARGET_SOFT 0x199C
#endif
#ifndef AL_SOFT_events
#define AL_SOFT_events 1
#define AL_EVENT_CALLBACK_FUNCTION_SOFT 0x19A2
#define AL_EVENT_CALLBACK_USER_PARAM_SOFT 0x19A3
#define AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT 0x19A4
#define AL_EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT 0x19A5
#define AL_EVENT_TYPE_DISCONNECTED_SOFT 0x19A6
typedef void (AL_APIENTRY*ALEVENTPROCSOFT)(ALenum eventType, ALuint object, ALuint param,
ALsizei length, const ALchar *message, void *userParam) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALEVENTCONTROLSOFT)(ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALEVENTCALLBACKSOFT)(ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT17;
typedef void* (AL_APIENTRY*LPALGETPOINTERSOFT)(ALenum pname) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETPOINTERVSOFT)(ALenum pname, void **values) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT;
AL_API void* AL_APIENTRY alGetPointerSOFT(ALenum pname) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetPointervSOFT(ALenum pname, void **values) AL_API_NOEXCEPT;
#endif
#endif
#ifndef ALC_SOFT_reopen_device
#define ALC_SOFT_reopen_device
typedef ALCboolean (ALC_APIENTRY*LPALCREOPENDEVICESOFT)(ALCdevice *device,
const ALCchar *deviceName, const ALCint *attribs) ALC_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALCboolean ALC_APIENTRY alcReopenDeviceSOFT(ALCdevice *device, const ALCchar *deviceName,
const ALCint *attribs) ALC_API_NOEXCEPT;
#endif
#endif
#ifndef AL_SOFT_callback_buffer
#define AL_SOFT_callback_buffer
#define AL_BUFFER_CALLBACK_FUNCTION_SOFT 0x19A0
#define AL_BUFFER_CALLBACK_USER_PARAM_SOFT 0x19A1
typedef ALsizei (AL_APIENTRY*ALBUFFERCALLBACKTYPESOFT)(ALvoid *userptr, ALvoid *sampledata, ALsizei numbytes) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETBUFFERPTRSOFT)(ALuint buffer, ALenum param, ALvoid **value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETBUFFER3PTRSOFT)(ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETBUFFERPTRVSOFT)(ALuint buffer, ALenum param, ALvoid **values) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alBufferCallbackSOFT(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBufferPtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBuffer3PtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr0, ALvoid **ptr1, ALvoid **ptr2) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetBufferPtrvSOFT(ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
#endif
#endif
#ifndef AL_SOFT_UHJ
#define AL_SOFT_UHJ
#define AL_FORMAT_UHJ2CHN8_SOFT 0x19A2
#define AL_FORMAT_UHJ2CHN16_SOFT 0x19A3
#define AL_FORMAT_UHJ2CHN_FLOAT32_SOFT 0x19A4
#define AL_FORMAT_UHJ3CHN8_SOFT 0x19A5
#define AL_FORMAT_UHJ3CHN16_SOFT 0x19A6
#define AL_FORMAT_UHJ3CHN_FLOAT32_SOFT 0x19A7
#define AL_FORMAT_UHJ4CHN8_SOFT 0x19A8
#define AL_FORMAT_UHJ4CHN16_SOFT 0x19A9
#define AL_FORMAT_UHJ4CHN_FLOAT32_SOFT 0x19AA
#define AL_STEREO_MODE_SOFT 0x19B0
#define AL_NORMAL_SOFT 0x0000
#define AL_SUPER_STEREO_SOFT 0x0001
#define AL_SUPER_STEREO_WIDTH_SOFT 0x19B1
#endif
#ifndef AL_SOFT_UHJ_ex
#define AL_SOFT_UHJ_ex
#define AL_FORMAT_UHJ2CHN_MULAW_SOFT 0x19B3
#define AL_FORMAT_UHJ2CHN_ALAW_SOFT 0x19B4
#define AL_FORMAT_UHJ2CHN_IMA4_SOFT 0x19B5
#define AL_FORMAT_UHJ2CHN_MSADPCM_SOFT 0x19B6
#define AL_FORMAT_UHJ3CHN_MULAW_SOFT 0x19B7
#define AL_FORMAT_UHJ3CHN_ALAW_SOFT 0x19B8
#define AL_FORMAT_UHJ4CHN_MULAW_SOFT 0x19B9
#define AL_FORMAT_UHJ4CHN_ALAW_SOFT 0x19BA
#endif
#ifndef ALC_SOFT_output_mode
#define ALC_SOFT_output_mode
#define ALC_OUTPUT_MODE_SOFT 0x19AC
#define ALC_ANY_SOFT 0x19AD
/*#define ALC_MONO_SOFT 0x1500*/
/*#define ALC_STEREO_SOFT 0x1501*/
#define ALC_STEREO_BASIC_SOFT 0x19AE
#define ALC_STEREO_UHJ_SOFT 0x19AF
#define ALC_STEREO_HRTF_SOFT 0x19B2
/*#define ALC_QUAD_SOFT 0x1503*/
#define ALC_SURROUND_5_1_SOFT 0x1504
#define ALC_SURROUND_6_1_SOFT 0x1505
#define ALC_SURROUND_7_1_SOFT 0x1506
#endif
#ifndef AL_SOFT_source_start_delay
#define AL_SOFT_source_start_delay
typedef void (AL_APIENTRY*LPALSOURCEPLAYATTIMESOFT)(ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALSOURCEPLAYATTIMEVSOFT)(ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
void AL_APIENTRY alSourcePlayAtTimeSOFT(ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcePlayAtTimevSOFT(ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT;
#endif
#endif
#ifndef ALC_EXT_debug
#define ALC_EXT_debug
#define ALC_CONTEXT_FLAGS_EXT 0x19CF
#define ALC_CONTEXT_DEBUG_BIT_EXT 0x0001
#endif
#ifndef AL_EXT_debug
#define AL_EXT_debug
#define AL_DONT_CARE_EXT 0x0002
#define AL_DEBUG_OUTPUT_EXT 0x19B2
#define AL_DEBUG_CALLBACK_FUNCTION_EXT 0x19B3
#define AL_DEBUG_CALLBACK_USER_PARAM_EXT 0x19B4
#define AL_DEBUG_SOURCE_API_EXT 0x19B5
#define AL_DEBUG_SOURCE_AUDIO_SYSTEM_EXT 0x19B6
#define AL_DEBUG_SOURCE_THIRD_PARTY_EXT 0x19B7
#define AL_DEBUG_SOURCE_APPLICATION_EXT 0x19B8
#define AL_DEBUG_SOURCE_OTHER_EXT 0x19B9
#define AL_DEBUG_TYPE_ERROR_EXT 0x19BA
#define AL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_EXT 0x19BB
#define AL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_EXT 0x19BC
#define AL_DEBUG_TYPE_PORTABILITY_EXT 0x19BD
#define AL_DEBUG_TYPE_PERFORMANCE_EXT 0x19BE
#define AL_DEBUG_TYPE_MARKER_EXT 0x19BF
#define AL_DEBUG_TYPE_PUSH_GROUP_EXT 0x19C0
#define AL_DEBUG_TYPE_POP_GROUP_EXT 0x19C1
#define AL_DEBUG_TYPE_OTHER_EXT 0x19C2
#define AL_DEBUG_SEVERITY_HIGH_EXT 0x19C3
#define AL_DEBUG_SEVERITY_MEDIUM_EXT 0x19C4
#define AL_DEBUG_SEVERITY_LOW_EXT 0x19C5
#define AL_DEBUG_SEVERITY_NOTIFICATION_EXT 0x19C6
#define AL_DEBUG_LOGGED_MESSAGES_EXT 0x19C7
#define AL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_EXT 0x19C8
#define AL_MAX_DEBUG_MESSAGE_LENGTH_EXT 0x19C9
#define AL_MAX_DEBUG_LOGGED_MESSAGES_EXT 0x19CA
#define AL_MAX_DEBUG_GROUP_STACK_DEPTH_EXT 0x19CB
#define AL_MAX_LABEL_LENGTH_EXT 0x19CC
#define AL_STACK_OVERFLOW_EXT 0x19CD
#define AL_STACK_UNDERFLOW_EXT 0x19CE
#define AL_CONTEXT_FLAGS_EXT 0x19CF
#define AL_BUFFER_EXT 0x1009 /* Same as AL_BUFFER */
#define AL_SOURCE_EXT 0x19D0
#define AL_FILTER_EXT 0x19D1
#define AL_EFFECT_EXT 0x19D2
#define AL_AUXILIARY_EFFECT_SLOT_EXT 0x19D3
typedef void (AL_APIENTRY*ALDEBUGPROCEXT)(ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message, void *userParam) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECALLBACKEXT)(ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALDEBUGMESSAGEINSERTEXT)(ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECONTROLEXT)(ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALPUSHDEBUGGROUPEXT)(ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALPOPDEBUGGROUPEXT)(void) AL_API_NOEXCEPT17;
typedef ALuint (AL_APIENTRY*LPALGETDEBUGMESSAGELOGEXT)(ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALOBJECTLABELEXT)(ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETOBJECTLABELEXT)(ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT17;
typedef void* (AL_APIENTRY*LPALGETPOINTEREXT)(ALenum pname) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETPOINTERVEXT)(ALenum pname, void **values) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
void AL_APIENTRY alDebugMessageCallbackEXT(ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT;
void AL_APIENTRY alDebugMessageInsertEXT(ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
void AL_APIENTRY alDebugMessageControlEXT(ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT;
void AL_APIENTRY alPushDebugGroupEXT(ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
void AL_APIENTRY alPopDebugGroupEXT(void) AL_API_NOEXCEPT;
ALuint AL_APIENTRY alGetDebugMessageLogEXT(ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT;
void AL_APIENTRY alObjectLabelEXT(ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT;
void AL_APIENTRY alGetObjectLabelEXT(ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT;
void* AL_APIENTRY alGetPointerEXT(ALenum pname) AL_API_NOEXCEPT;
void AL_APIENTRY alGetPointervEXT(ALenum pname, void **values) AL_API_NOEXCEPT;
#endif
#endif
#ifndef ALC_SOFT_system_events
#define ALC_SOFT_system_events
#define ALC_PLAYBACK_DEVICE_SOFT 0x19D4
#define ALC_CAPTURE_DEVICE_SOFT 0x19D5
#define ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT 0x19D6
#define ALC_EVENT_TYPE_DEVICE_ADDED_SOFT 0x19D7
#define ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT 0x19D8
#define ALC_EVENT_SUPPORTED_SOFT 0x19D9
#define ALC_EVENT_NOT_SUPPORTED_SOFT 0x19DA
typedef void (ALC_APIENTRY*ALCEVENTPROCTYPESOFT)(ALCenum eventType, ALCenum deviceType,
ALCdevice *device, ALCsizei length, const ALCchar *message, void *userParam) ALC_API_NOEXCEPT17;
typedef ALCenum (ALC_APIENTRY*LPALCEVENTISSUPPORTEDSOFT)(ALCenum eventType, ALCenum deviceType) ALC_API_NOEXCEPT17;
typedef ALCboolean (ALC_APIENTRY*LPALCEVENTCONTROLSOFT)(ALCsizei count, const ALCenum *events, ALCboolean enable) ALC_API_NOEXCEPT17;
typedef void (ALC_APIENTRY*LPALCEVENTCALLBACKSOFT)(ALCEVENTPROCTYPESOFT callback, void *userParam) ALC_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALCenum ALC_APIENTRY alcEventIsSupportedSOFT(ALCenum eventType, ALCenum deviceType) ALC_API_NOEXCEPT;
ALCboolean ALC_APIENTRY alcEventControlSOFT(ALCsizei count, const ALCenum *events, ALCboolean enable) ALC_API_NOEXCEPT;
void ALC_APIENTRY alcEventCallbackSOFT(ALCEVENTPROCTYPESOFT callback, void *userParam) ALC_API_NOEXCEPT;
#endif
#endif
#ifndef AL_EXT_direct_context
#define AL_EXT_direct_context
typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS2)(ALCdevice *device, const ALCchar *funcname) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALENABLEDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDISABLEDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISENABLEDDIRECT)(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDOPPLERFACTORDIRECT)(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSPEEDOFSOUNDDIRECT)(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDISTANCEMODELDIRECT)(ALCcontext *context, ALenum distanceModel) AL_API_NOEXCEPT17;
typedef const ALchar* (AL_APIENTRY *LPALGETSTRINGDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBOOLEANVDIRECT)(ALCcontext *context, ALenum param, ALboolean *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETINTEGERVDIRECT)(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFLOATVDIRECT)(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETDOUBLEVDIRECT)(ALCcontext *context, ALenum param, ALdouble *values) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEANDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
typedef ALint (AL_APIENTRY *LPALGETINTEGERDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
typedef ALfloat (AL_APIENTRY *LPALGETFLOATDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLEDIRECT)(ALCcontext *context, ALenum param) AL_API_NOEXCEPT17;
typedef ALenum (AL_APIENTRY *LPALGETERRORDIRECT)(ALCcontext *context) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENTDIRECT)(ALCcontext *context, const ALchar *extname) AL_API_NOEXCEPT17;
typedef void* (AL_APIENTRY *LPALGETPROCADDRESSDIRECT)(ALCcontext *context, const ALchar *fname) AL_API_NOEXCEPT17;
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUEDIRECT)(ALCcontext *context, const ALchar *ename) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERFDIRECT)(ALCcontext *context, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENER3FDIRECT)(ALCcontext *context, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERFVDIRECT)(ALCcontext *context, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERIDIRECT)(ALCcontext *context, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENER3IDIRECT)(ALCcontext *context, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALLISTENERIVDIRECT)(ALCcontext *context, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERFDIRECT)(ALCcontext *context, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENER3FDIRECT)(ALCcontext *context, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERFVDIRECT)(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERIDIRECT)(ALCcontext *context, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENER3IDIRECT)(ALCcontext *context, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETLISTENERIVDIRECT)(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGENSOURCESDIRECT)(ALCcontext *context, ALsizei n, ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETESOURCESDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISSOURCEDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEFDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCE3FDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEFVDIRECT)(ALCcontext *context, ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEIDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCE3IDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEIVDIRECT)(ALCcontext *context, ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEFDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCE3FDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEFVDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEIDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCE3IDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEIVDIRECT)(ALCcontext *context, ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPLAYDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCESTOPDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEREWINDDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPAUSEDIRECT)(ALCcontext *context, ALuint source) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPLAYVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCESTOPVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEREWINDVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPAUSEVDIRECT)(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERSDIRECT)(ALCcontext *context, ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERSDIRECT)(ALCcontext *context, ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGENBUFFERSDIRECT)(ALCcontext *context, ALsizei n, ALuint *buffers) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEBUFFERSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISBUFFERDIRECT)(ALCcontext *context, ALuint buffer) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERDATADIRECT)(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERFDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFER3FDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERFVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERIDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFER3IDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALBUFFERIVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERFDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFER3FDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERFVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERIDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFER3IDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERIVDIRECT)(ALCcontext *context, ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT17;
/* ALC_EXT_EFX */
typedef void (AL_APIENTRY *LPALGENEFFECTSDIRECT)(ALCcontext *context, ALsizei n, ALuint *effects) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEEFFECTSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *effects) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISEFFECTDIRECT)(ALCcontext *context, ALuint effect) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTIDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTIVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTFDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTFVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTIDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTIVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTFDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTFVDIRECT)(ALCcontext *context, ALuint effect, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGENFILTERSDIRECT)(ALCcontext *context, ALsizei n, ALuint *filters) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEFILTERSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *filters) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISFILTERDIRECT)(ALCcontext *context, ALuint filter) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERIDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERIVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERFDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERFVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERIDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERIVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERFDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERFVDIRECT)(ALCcontext *context, ALuint filter, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTSDIRECT)(ALCcontext *context, ALsizei n, ALuint *effectslots) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTSDIRECT)(ALCcontext *context, ALsizei n, const ALuint *effectslots) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOTDIRECT)(ALCcontext *context, ALuint effectslot) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALint value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, const ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, const ALfloat *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALint *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALint *values) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFVDIRECT)(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *values) AL_API_NOEXCEPT17;
/* AL_EXT_BUFFER_DATA_STATIC */
typedef void (AL_APIENTRY *LPALBUFFERDATASTATICDIRECT)(ALCcontext *context, ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) AL_API_NOEXCEPT17;
/* AL_EXT_debug */
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECALLBACKDIRECTEXT)(ALCcontext *context, ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALDEBUGMESSAGEINSERTDIRECTEXT)(ALCcontext *context, ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALDEBUGMESSAGECONTROLDIRECTEXT)(ALCcontext *context, ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALPUSHDEBUGGROUPDIRECTEXT)(ALCcontext *context, ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALPOPDEBUGGROUPDIRECTEXT)(ALCcontext *context) AL_API_NOEXCEPT17;
typedef ALuint (AL_APIENTRY*LPALGETDEBUGMESSAGELOGDIRECTEXT)(ALCcontext *context, ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALOBJECTLABELDIRECTEXT)(ALCcontext *context, ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETOBJECTLABELDIRECTEXT)(ALCcontext *context, ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT17;
typedef void* (AL_APIENTRY*LPALGETPOINTERDIRECTEXT)(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY*LPALGETPOINTERVDIRECTEXT)(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT17;
/* AL_EXT_FOLDBACK */
typedef void (AL_APIENTRY *LPALREQUESTFOLDBACKSTARTDIRECT)(ALCcontext *context, ALenum mode, ALsizei count, ALsizei length, ALfloat *mem, LPALFOLDBACKCALLBACK callback) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALREQUESTFOLDBACKSTOPDIRECT)(ALCcontext *context) AL_API_NOEXCEPT17;
/* AL_SOFT_buffer_sub_data */
typedef void (AL_APIENTRY *LPALBUFFERSUBDATADIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei offset, ALsizei length) AL_API_NOEXCEPT17;
/* AL_SOFT_source_latency */
typedef void (AL_APIENTRY *LPALSOURCEDDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCE3DDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble,ALdouble,ALdouble) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEDVDIRECTSOFT)(ALCcontext*,ALuint,ALenum,const ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEDDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCE3DDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEDVDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALdouble*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEI64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCE3I64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEI64VDIRECTSOFT)(ALCcontext*,ALuint,ALenum,const ALint64SOFT*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEI64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCE3I64DIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETSOURCEI64VDIRECTSOFT)(ALCcontext*,ALuint,ALenum,ALint64SOFT*) AL_API_NOEXCEPT17;
/* AL_SOFT_deferred_updates */
typedef void (AL_APIENTRY *LPALDEFERUPDATESDIRECTSOFT)(ALCcontext *context) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALPROCESSUPDATESDIRECTSOFT)(ALCcontext *context) AL_API_NOEXCEPT17;
/* AL_SOFT_source_resampler */
typedef const ALchar* (AL_APIENTRY *LPALGETSTRINGIDIRECTSOFT)(ALCcontext *context, ALenum pname, ALsizei index) AL_API_NOEXCEPT17;
/* AL_SOFT_events */
typedef void (AL_APIENTRY *LPALEVENTCONTROLDIRECTSOFT)(ALCcontext *context, ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEVENTCALLBACKDIRECTSOFT)(ALCcontext *context, ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT17;
typedef void* (AL_APIENTRY *LPALGETPOINTERDIRECTSOFT)(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETPOINTERVDIRECTSOFT)(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT17;
/* AL_SOFT_callback_buffer */
typedef void (AL_APIENTRY *LPALBUFFERCALLBACKDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERPTRDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **value) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFER3PTRDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETBUFFERPTRVDIRECTSOFT)(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **values) AL_API_NOEXCEPT17;
/* AL_SOFT_source_start_delay */
typedef void (AL_APIENTRY *LPALSOURCEPLAYATTIMEDIRECTSOFT)(ALCcontext *context, ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALSOURCEPLAYATTIMEVDIRECTSOFT)(ALCcontext *context, ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT17;
/* EAX */
typedef ALenum (AL_APIENTRY *LPEAXSETDIRECT)(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT17;
typedef ALenum (AL_APIENTRY *LPEAXGETDIRECT)(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPEAXSETBUFFERMODEDIRECT)(ALCcontext *context, ALsizei n, const ALuint *buffers, ALint value) AL_API_NOEXCEPT17;
typedef ALenum (AL_APIENTRY *LPEAXGETBUFFERMODEDIRECT)(ALCcontext *context, ALuint buffer, ALint *pReserved) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
ALCvoid* ALC_APIENTRY alcGetProcAddress2(ALCdevice *device, const ALCchar *funcName) AL_API_NOEXCEPT;
void AL_APIENTRY alEnableDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT;
void AL_APIENTRY alDisableDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alIsEnabledDirect(ALCcontext *context, ALenum capability) AL_API_NOEXCEPT;
void AL_APIENTRY alDopplerFactorDirect(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT;
void AL_APIENTRY alSpeedOfSoundDirect(ALCcontext *context, ALfloat value) AL_API_NOEXCEPT;
void AL_APIENTRY alDistanceModelDirect(ALCcontext *context, ALenum distanceModel) AL_API_NOEXCEPT;
const ALchar* AL_APIENTRY alGetStringDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBooleanvDirect(ALCcontext *context, ALenum param, ALboolean *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetIntegervDirect(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetFloatvDirect(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetDoublevDirect(ALCcontext *context, ALenum param, ALdouble *values) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alGetBooleanDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
ALint AL_APIENTRY alGetIntegerDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
ALfloat AL_APIENTRY alGetFloatDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
ALdouble AL_APIENTRY alGetDoubleDirect(ALCcontext *context, ALenum param) AL_API_NOEXCEPT;
ALenum AL_APIENTRY alGetErrorDirect(ALCcontext *context) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alIsExtensionPresentDirect(ALCcontext *context, const ALchar *extname) AL_API_NOEXCEPT;
void* AL_APIENTRY alGetProcAddressDirect(ALCcontext *context, const ALchar *fname) AL_API_NOEXCEPT;
ALenum AL_APIENTRY alGetEnumValueDirect(ALCcontext *context, const ALchar *ename) AL_API_NOEXCEPT;
void AL_APIENTRY alListenerfDirect(ALCcontext *context, ALenum param, ALfloat value) AL_API_NOEXCEPT;
void AL_APIENTRY alListener3fDirect(ALCcontext *context, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
void AL_APIENTRY alListenerfvDirect(ALCcontext *context, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
void AL_APIENTRY alListeneriDirect(ALCcontext *context, ALenum param, ALint value) AL_API_NOEXCEPT;
void AL_APIENTRY alListener3iDirect(ALCcontext *context, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
void AL_APIENTRY alListenerivDirect(ALCcontext *context, ALenum param, const ALint *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetListenerfDirect(ALCcontext *context, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetListener3fDirect(ALCcontext *context, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetListenerfvDirect(ALCcontext *context, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetListeneriDirect(ALCcontext *context, ALenum param, ALint *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetListener3iDirect(ALCcontext *context, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetListenerivDirect(ALCcontext *context, ALenum param, ALint *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGenSourcesDirect(ALCcontext *context, ALsizei n, ALuint *sources) AL_API_NOEXCEPT;
void AL_APIENTRY alDeleteSourcesDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alIsSourceDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcefDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat value) AL_API_NOEXCEPT;
void AL_APIENTRY alSource3fDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcefvDirect(ALCcontext *context, ALuint source, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceiDirect(ALCcontext *context, ALuint source, ALenum param, ALint value) AL_API_NOEXCEPT;
void AL_APIENTRY alSource3iDirect(ALCcontext *context, ALuint source, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceivDirect(ALCcontext *context, ALuint source, ALenum param, const ALint *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourcefDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSource3fDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourcefvDirect(ALCcontext *context, ALuint source, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourceiDirect(ALCcontext *context, ALuint source, ALenum param, ALint *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSource3iDirect(ALCcontext *context, ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourceivDirect(ALCcontext *context, ALuint source, ALenum param, ALint *values) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcePlayDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceStopDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceRewindDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcePauseDirect(ALCcontext *context, ALuint source) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcePlayvDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceStopvDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceRewindvDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcePausevDirect(ALCcontext *context, ALsizei n, const ALuint *sources) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceQueueBuffersDirect(ALCcontext *context, ALuint source, ALsizei nb, const ALuint *buffers) AL_API_NOEXCEPT;
void AL_APIENTRY alSourceUnqueueBuffersDirect(ALCcontext *context, ALuint source, ALsizei nb, ALuint *buffers) AL_API_NOEXCEPT;
void AL_APIENTRY alGenBuffersDirect(ALCcontext *context, ALsizei n, ALuint *buffers) AL_API_NOEXCEPT;
void AL_APIENTRY alDeleteBuffersDirect(ALCcontext *context, ALsizei n, const ALuint *buffers) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alIsBufferDirect(ALCcontext *context, ALuint buffer) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferDataDirect(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferfDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value) AL_API_NOEXCEPT;
void AL_APIENTRY alBuffer3fDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferfvDirect(ALCcontext *context, ALuint buffer, ALenum param, const ALfloat *values) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferiDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint value) AL_API_NOEXCEPT;
void AL_APIENTRY alBuffer3iDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferivDirect(ALCcontext *context, ALuint buffer, ALenum param, const ALint *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBufferfDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBuffer3fDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBufferfvDirect(ALCcontext *context, ALuint buffer, ALenum param, ALfloat *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBufferiDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBuffer3iDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBufferivDirect(ALCcontext *context, ALuint buffer, ALenum param, ALint *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGenEffectsDirect(ALCcontext *context, ALsizei n, ALuint *effects) AL_API_NOEXCEPT;
void AL_APIENTRY alDeleteEffectsDirect(ALCcontext *context, ALsizei n, const ALuint *effects) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alIsEffectDirect(ALCcontext *context, ALuint effect) AL_API_NOEXCEPT;
void AL_APIENTRY alEffectiDirect(ALCcontext *context, ALuint effect, ALenum param, ALint iValue) AL_API_NOEXCEPT;
void AL_APIENTRY alEffectivDirect(ALCcontext *context, ALuint effect, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
void AL_APIENTRY alEffectfDirect(ALCcontext *context, ALuint effect, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
void AL_APIENTRY alEffectfvDirect(ALCcontext *context, ALuint effect, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGetEffectiDirect(ALCcontext *context, ALuint effect, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
void AL_APIENTRY alGetEffectivDirect(ALCcontext *context, ALuint effect, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGetEffectfDirect(ALCcontext *context, ALuint effect, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
void AL_APIENTRY alGetEffectfvDirect(ALCcontext *context, ALuint effect, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGenFiltersDirect(ALCcontext *context, ALsizei n, ALuint *filters) AL_API_NOEXCEPT;
void AL_APIENTRY alDeleteFiltersDirect(ALCcontext *context, ALsizei n, const ALuint *filters) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alIsFilterDirect(ALCcontext *context, ALuint filter) AL_API_NOEXCEPT;
void AL_APIENTRY alFilteriDirect(ALCcontext *context, ALuint filter, ALenum param, ALint iValue) AL_API_NOEXCEPT;
void AL_APIENTRY alFilterivDirect(ALCcontext *context, ALuint filter, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
void AL_APIENTRY alFilterfDirect(ALCcontext *context, ALuint filter, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
void AL_APIENTRY alFilterfvDirect(ALCcontext *context, ALuint filter, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGetFilteriDirect(ALCcontext *context, ALuint filter, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
void AL_APIENTRY alGetFilterivDirect(ALCcontext *context, ALuint filter, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGetFilterfDirect(ALCcontext *context, ALuint filter, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
void AL_APIENTRY alGetFilterfvDirect(ALCcontext *context, ALuint filter, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGenAuxiliaryEffectSlotsDirect(ALCcontext *context, ALsizei n, ALuint *effectslots) AL_API_NOEXCEPT;
void AL_APIENTRY alDeleteAuxiliaryEffectSlotsDirect(ALCcontext *context, ALsizei n, const ALuint *effectslots) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY alIsAuxiliaryEffectSlotDirect(ALCcontext *context, ALuint effectslot) AL_API_NOEXCEPT;
void AL_APIENTRY alAuxiliaryEffectSlotiDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALint iValue) AL_API_NOEXCEPT;
void AL_APIENTRY alAuxiliaryEffectSlotivDirect(ALCcontext *context, ALuint effectslot, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
void AL_APIENTRY alAuxiliaryEffectSlotfDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
void AL_APIENTRY alAuxiliaryEffectSlotfvDirect(ALCcontext *context, ALuint effectslot, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGetAuxiliaryEffectSlotiDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
void AL_APIENTRY alGetAuxiliaryEffectSlotivDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
void AL_APIENTRY alGetAuxiliaryEffectSlotfDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
void AL_APIENTRY alGetAuxiliaryEffectSlotfvDirect(ALCcontext *context, ALuint effectslot, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferDataStaticDirect(ALCcontext *context, ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq) AL_API_NOEXCEPT;
void AL_APIENTRY alDebugMessageCallbackDirectEXT(ALCcontext *context, ALDEBUGPROCEXT callback, void *userParam) AL_API_NOEXCEPT;
void AL_APIENTRY alDebugMessageInsertDirectEXT(ALCcontext *context, ALenum source, ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
void AL_APIENTRY alDebugMessageControlDirectEXT(ALCcontext *context, ALenum source, ALenum type, ALenum severity, ALsizei count, const ALuint *ids, ALboolean enable) AL_API_NOEXCEPT;
void AL_APIENTRY alPushDebugGroupDirectEXT(ALCcontext *context, ALenum source, ALuint id, ALsizei length, const ALchar *message) AL_API_NOEXCEPT;
void AL_APIENTRY alPopDebugGroupDirectEXT(ALCcontext *context) AL_API_NOEXCEPT;
ALuint AL_APIENTRY alGetDebugMessageLogDirectEXT(ALCcontext *context, ALuint count, ALsizei logBufSize, ALenum *sources, ALenum *types, ALuint *ids, ALenum *severities, ALsizei *lengths, ALchar *logBuf) AL_API_NOEXCEPT;
void AL_APIENTRY alObjectLabelDirectEXT(ALCcontext *context, ALenum identifier, ALuint name, ALsizei length, const ALchar *label) AL_API_NOEXCEPT;
void AL_APIENTRY alGetObjectLabelDirectEXT(ALCcontext *context, ALenum identifier, ALuint name, ALsizei bufSize, ALsizei *length, ALchar *label) AL_API_NOEXCEPT;
void* AL_APIENTRY alGetPointerDirectEXT(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT;
void AL_APIENTRY alGetPointervDirectEXT(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT;
void AL_APIENTRY alRequestFoldbackStartDirect(ALCcontext *context, ALenum mode, ALsizei count, ALsizei length, ALfloat *mem, LPALFOLDBACKCALLBACK callback) AL_API_NOEXCEPT;
void AL_APIENTRY alRequestFoldbackStopDirect(ALCcontext *context) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferSubDataDirectSOFT(ALCcontext *context, ALuint buffer, ALenum format, const ALvoid *data, ALsizei offset, ALsizei length) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcedDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble value) AL_API_NOEXCEPT;
void AL_APIENTRY alSource3dDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcedvDirectSOFT(ALCcontext *context, ALuint source, ALenum param, const ALdouble *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourcedDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSource3dDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourcedvDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALdouble *values) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcei64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT value) AL_API_NOEXCEPT;
void AL_APIENTRY alSource3i64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcei64vDirectSOFT(ALCcontext *context, ALuint source, ALenum param, const ALint64SOFT *values) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourcei64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT *value) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSource3i64DirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3) AL_API_NOEXCEPT;
void AL_APIENTRY alGetSourcei64vDirectSOFT(ALCcontext *context, ALuint source, ALenum param, ALint64SOFT *values) AL_API_NOEXCEPT;
void AL_APIENTRY alDeferUpdatesDirectSOFT(ALCcontext *context) AL_API_NOEXCEPT;
void AL_APIENTRY alProcessUpdatesDirectSOFT(ALCcontext *context) AL_API_NOEXCEPT;
const ALchar* AL_APIENTRY alGetStringiDirectSOFT(ALCcontext *context, ALenum pname, ALsizei index) AL_API_NOEXCEPT;
void AL_APIENTRY alEventControlDirectSOFT(ALCcontext *context, ALsizei count, const ALenum *types, ALboolean enable) AL_API_NOEXCEPT;
void AL_APIENTRY alEventCallbackDirectSOFT(ALCcontext *context, ALEVENTPROCSOFT callback, void *userParam) AL_API_NOEXCEPT;
void* AL_APIENTRY alGetPointerDirectSOFT(ALCcontext *context, ALenum pname) AL_API_NOEXCEPT;
void AL_APIENTRY alGetPointervDirectSOFT(ALCcontext *context, ALenum pname, void **values) AL_API_NOEXCEPT;
void AL_APIENTRY alBufferCallbackDirectSOFT(ALCcontext *context, ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBufferPtrDirectSOFT(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBuffer3PtrDirectSOFT(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **ptr0, ALvoid **ptr1, ALvoid **ptr2) AL_API_NOEXCEPT;
void AL_APIENTRY alGetBufferPtrvDirectSOFT(ALCcontext *context, ALuint buffer, ALenum param, ALvoid **ptr) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcePlayAtTimeDirectSOFT(ALCcontext *context, ALuint source, ALint64SOFT start_time) AL_API_NOEXCEPT;
void AL_APIENTRY alSourcePlayAtTimevDirectSOFT(ALCcontext *context, ALsizei n, const ALuint *sources, ALint64SOFT start_time) AL_API_NOEXCEPT;
ALenum AL_APIENTRY EAXSetDirect(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT;
ALenum AL_APIENTRY EAXGetDirect(ALCcontext *context, const struct _GUID *property_set_id, ALuint property_id, ALuint source_id, ALvoid *value, ALuint value_size) AL_API_NOEXCEPT;
ALboolean AL_APIENTRY EAXSetBufferModeDirect(ALCcontext *context, ALsizei n, const ALuint *buffers, ALint value) AL_API_NOEXCEPT;
ALenum AL_APIENTRY EAXGetBufferModeDirect(ALCcontext *context, ALuint buffer, ALint *pReserved) AL_API_NOEXCEPT;
#endif
#endif
#ifndef AL_SOFT_bformat_hoa
#define AL_SOFT_bformat_hoa
#define AL_UNPACK_AMBISONIC_ORDER_SOFT 0x199D
#endif
#ifdef __cplusplus
}
#endif
/* NOLINTEND */
#endif

View file

@ -2,6 +2,7 @@
#ifndef EFX_PRESETS_H
#define EFX_PRESETS_H
/* NOLINTBEGIN */
#ifndef EFXEAXREVERBPROPERTIES_DEFINED
#define EFXEAXREVERBPROPERTIES_DEFINED
@ -345,7 +346,7 @@ typedef struct {
/* Driving Presets */
#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \
{ 1.0000f, 0.0000f, 3.1623f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
{ 1.0000f, 0.0000f, 0.3162f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \
{ 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
@ -399,4 +400,5 @@ typedef struct {
#define EFX_REVERB_PRESET_SMALLWATERROOM \
{ 1.0000f, 0.7000f, 0.3162f, 0.4477f, 1.0000f, 1.5100f, 1.2500f, 1.1400f, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
/* NOLINTEND */
#endif /* EFX_PRESETS_H */

View file

@ -1,6 +1,8 @@
#ifndef AL_EFX_H
#define AL_EFX_H
/* NOLINTBEGIN */
#include <float.h>
#include "alc.h"
#include "al.h"
@ -203,80 +205,80 @@ extern "C" {
/* Effect object function types. */
typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*);
typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*);
typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint);
typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint);
typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*);
typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat);
typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*);
typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
/* Filter object function types. */
typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*);
typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*);
typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint);
typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint);
typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*);
typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat);
typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*);
typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
/* Auxiliary Effect Slot object function types. */
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*);
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*);
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat);
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*);
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*) AL_API_NOEXCEPT17;
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*) AL_API_NOEXCEPT17;
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects);
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects);
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect);
AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue);
AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues);
AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue);
AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue);
AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues);
AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue);
AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
AL_API void AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects) AL_API_NOEXCEPT;
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters);
AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters);
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter);
AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue);
AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues);
AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue);
AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue);
AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues);
AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue);
AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues);
AL_API void AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters) AL_API_NOEXCEPT;
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots);
AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots);
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue);
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue);
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues);
AL_API void AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots) AL_API_NOEXCEPT;
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue) AL_API_NOEXCEPT;
AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues) AL_API_NOEXCEPT;
#endif
/* Filter ranges and defaults. */
@ -757,5 +759,6 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
#ifdef __cplusplus
} /* extern "C" */
#endif
/* NOLINTEND */
#endif /* AL_EFX_H */

View file

@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.12)
project(Launcher)
set(LAUNCHER_SOURCES "${CMAKE_SOURCE_DIR}/code/Launcher/launch_main.cpp")
if (WIN32)
set(LAUNCHER_SOURCES ${LAUNCHER_SOURCES}
"${CMAKE_SOURCE_DIR}/code/Launcher/launch_win32.cpp"
"${CMAKE_SOURCE_DIR}/code/sys/win_resource.rc")
else()
set(LAUNCHER_SOURCES ${LAUNCHER_SOURCES}
"${CMAKE_SOURCE_DIR}/code/Launcher/launch_linux.cpp")
endif()
function (create_launcher name type)
if (NOT BUILD_NO_CLIENT)
add_executable(openmohaa_launcher_${name} ${LAUNCHER_SOURCES})
target_include_directories(openmohaa_launcher_${name} PUBLIC "../qcommon")
target_compile_definitions(openmohaa_launcher_${name} PRIVATE NO_RC_MANIFEST=1 TARGET_GAME=${type})
target_compile_features(openmohaa_launcher_${name} PRIVATE cxx_std_17)
set_target_properties(openmohaa_launcher_${name} PROPERTIES OUTPUT_NAME "launch_openmohaa_${name}${TARGET_BIN_SUFFIX}")
INSTALL(TARGETS openmohaa_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
endif()
#add_executable(omohaaded_launcher_${name} ${LAUNCHER_SOURCES})
#target_include_directories(omohaaded_launcher_${name} PUBLIC "../qcommon")
#target_compile_definitions(omohaaded_launcher_${name} PRIVATE NO_RC_MANIFEST=1 TARGET_GAME=${type} DEDICATED=1)
#target_compile_features(omohaaded_launcher_${name} PRIVATE cxx_std_17)
#set_target_properties(omohaaded_launcher_${name} PROPERTIES OUTPUT_NAME "launch_omohaaded_${name}${TARGET_BIN_SUFFIX}")
#
#INSTALL(TARGETS omohaaded_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_INSTALL_SUBDIR})
endfunction()
create_launcher(base 0)
create_launcher(spearhead 1)
create_launcher(breakthrough 2)

32
code/Launcher/launch.h Normal file
View file

@ -0,0 +1,32 @@
/*
===========================================================================
Copyright (C) 2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// launch.h: Base interface for starting programs
#include "q_platform.h"
#include <filesystem>
#include <string>
#include <vector>
std::filesystem::path GetProgramLocation();
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList);

View file

@ -0,0 +1,80 @@
/*
===========================================================================
Copyright (C) 2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// main.cpp: Windows implementation of the launcher
#include "launch.h"
#include <unistd.h>
#include <spawn.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string>
#include <iostream>
extern "C" char** environ;
std::filesystem::path GetProgramLocation()
{
char path[FILENAME_MAX];
ssize_t count = readlink("/proc/self/exe", path, FILENAME_MAX);
return std::filesystem::path(std::string(path, (count > 0) ? count : 0)).parent_path();
}
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList)
{
pid_t pid;
std::string pathString = path.string();
size_t argCount = argumentList.size();
char** argv;
int status;
argv = new char*[argCount + 2];
argv[0] = (char*)pathString.c_str();
for (size_t i = 0; i < argCount; i++) {
argv[i + 1] = (char*)argumentList[i].c_str();
}
argv[argCount + 1] = NULL;
//status = posix_spawn(&pid, pathString.c_str(), NULL, NULL, argv, environ);
//delete[] argv;
//if (status != 0) {
// std::cout << "posix_spawn returned error: " << status << std::endl;
// return;
//}
//
// Using execve rather than posix_spawn
// This replaces the current process that is not needed anyway
//
status = execve(pathString.c_str(), argv, environ);
delete[] argv;
if (status == -1) {
std::cout << "posix_spawn returned error: " << errno << std::endl;
return;
}
waitpid(pid, NULL, 0);
}

View file

@ -0,0 +1,67 @@
/*
===========================================================================
Copyright (C) 2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// main.cpp: The launcher
#include "launch.h"
#include <iostream>
#include <string>
#include <vector>
const char* targetGameList[] =
{
"Base",
"Spearhead",
"Breakthrough"
};
int main(int argc, const char* argv[]) {
std::vector<std::string> argumentList;
#if !defined(DEDICATED) || !DEDICATED
const char* programName = "openmohaa" ARCH_SUFFIX DLL_SUFFIX EXE_EXT;
#else
const char* programName = "omohaaded" ARCH_SUFFIX DLL_SUFFIX EXE_EXT;
#endif
argumentList.push_back("+set");
argumentList.push_back("com_target_game");
argumentList.push_back(std::to_string(TARGET_GAME));
for (size_t i = 1; i < argc; i++) {
argumentList.push_back(argv[i]);
}
std::cout << "Using the target game: " << targetGameList[TARGET_GAME] << std::endl;
std::cout << std::endl;
std::cout << "Expected program name: " << programName << std::endl;
const std::filesystem::path programLocation = GetProgramLocation();
const std::filesystem::path programPath = programLocation / programName;
std::cout << "Program location: " << programLocation << std::endl;
std::cout << "Expected path: " << programPath << std::endl;
LaunchProgram(programPath, argumentList);
return 0;
}

View file

@ -0,0 +1,87 @@
/*
===========================================================================
Copyright (C) 2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// main.cpp: Windows implementation of the launcher
#include "launch.h"
#include <Windows.h>
#include <string>
#include <iostream>
std::filesystem::path GetProgramLocation()
{
wchar_t path[FILENAME_MAX] = { 0 };
GetModuleFileNameW(nullptr, path, FILENAME_MAX);
return std::filesystem::path(path).parent_path();
}
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList)
{
PROCESS_INFORMATION processInfo;
STARTUPINFOW startupInfo;
BOOL returnValue;
std::wstring osCommandLine;
std::wstring commandLine;
size_t argCount = argumentList.size();
memset(&processInfo, 0, sizeof(processInfo));
memset(&startupInfo, 0, sizeof(startupInfo));
startupInfo.cb = sizeof(startupInfo);
for (size_t i = 0; i < argCount; i++) {
commandLine += L"\"";
commandLine += std::wstring(argumentList[i].begin(), argumentList[i].end());
commandLine += L"\"";
if (i != argCount - 1) {
commandLine += L" ";
}
}
osCommandLine = path.wstring();
osCommandLine += L" ";
osCommandLine += commandLine;
returnValue = CreateProcessW(
path.wstring().c_str(),
(LPWSTR)osCommandLine.c_str(),
NULL,
NULL,
FALSE,
0,
NULL,
std::filesystem::current_path().wstring().c_str(),
&startupInfo,
&processInfo
);
if (!returnValue) {
std::cout << "Error in CreateProcess: " << GetLastError() << std::endl;
return;
}
WaitForSingleObject(processInfo.hProcess, INFINITE);
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
}

View file

@ -933,10 +933,13 @@ static void waitToApplyUpdates(void)
OS forcibly closes the pipe), we will unblock. Then we can loop on
kill() until the process is truly gone. */
int x = 0;
struct timespec req;
req.tv_sec = 0;
req.tv_nsec = 100000000;
read(3, &x, sizeof (x));
info("Pipe has closed, waiting for process to fully go away now.");
while (kill(options.waitforprocess, 0) == 0) {
usleep(100000);
nanosleep(&req, NULL);
}
#endif
}

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(fgame)
cmake_minimum_required(VERSION 3.12)
project(cgame)
# Shared source files for modules
set(SOURCES_SHARED
@ -18,25 +18,20 @@ set(SOURCES_SHARED
"../script/scriptvariable.cpp"
)
file(GLOB_RECURSE SOURCES_BG "../fgame/bg_*.cpp")
file(GLOB_RECURSE SOURCES_BG "../fgame/bg_misc.cpp" "../fgame/bg_pmove.cpp" "../fgame/bg_slidemove.cpp" "../fgame/bg_voteoptions.cpp")
file(GLOB_RECURSE SOURCES_CGAME "./*.c" "./*.cpp")
add_library(cgame SHARED ${SOURCES_CGAME} ${SOURCES_BG})
target_compile_definitions(cgame PRIVATE CGAME_DLL TARGET_GAME_TYPE=${TARGET_GAME_TYPE})
target_compile_definitions(cgame PRIVATE CGAME_DLL)
target_compile_features(cgame PUBLIC cxx_nullptr)
target_compile_features(cgame PUBLIC c_variadic_macros)
target_link_libraries(cgame PUBLIC qcommon)
set_target_properties(cgame PROPERTIES PREFIX "${TARGET_PLATFORM_PREFIX}")
set_target_properties(cgame PROPERTIES OUTPUT_NAME "cgame${TARGET_ARCH_SUFFIX}${TARGET_CONFIG_SUFFIX}")
set_target_properties(cgame PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TARGET_BASE_GAME}")
set_target_properties(cgame PROPERTIES PREFIX "")
set_target_properties(cgame PROPERTIES OUTPUT_NAME "cgame${TARGET_BIN_SUFFIX}")
INSTALL(
TARGETS cgame
DESTINATION "${TARGET_BASE_GAME}"
ARCHIVE EXCLUDE_FROM_ALL
)
INSTALL(TARGETS cgame DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR})
if(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:cgame> DESTINATION "${TARGET_BASE_GAME}" OPTIONAL)
INSTALL(FILES $<TARGET_PDB_FILE:cgame> DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR} OPTIONAL)
endif()

196
code/cgame/cg_archive.cpp Normal file
View file

@ -0,0 +1,196 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "cg_local.h"
#include "cg_archive.h"
#include "cg_commands.h"
#include "memarchiver.h"
#include "../qcommon/tiki.h"
void CG_ArchiveStuff(MemArchiver& archiver, int svsTime)
{
archiver.SetBaseTime(svsTime);
commandManager.ArchiveToMemory(archiver);
CG_ArchiveVSSGlobals(archiver);
}
size_t CG_SaveStateToBuffer(void** out, int svsTime)
{
MemArchiver archiver;
size_t size;
archiver.SetupForWriting(0x200000);
CG_ArchiveStuff(archiver, svsTime);
size = archiver.BufferSize();
if (size && out) {
*out = archiver.ConfiscateBuffer();
}
return size;
}
qboolean CG_LoadStateToBuffer(void* state, size_t size, int svsTime)
{
MemArchiver archiver;
archiver.SetupForReading((byte*)state, size);
CG_ArchiveStuff(archiver, svsTime);
return archiver.FinishedReading();
}
void CG_ArchiveStringContainer(MemArchiver& archiver, Container<str>* container)
{
int num;
int i;
if (archiver.IsReading()) {
str tmp;
archiver.ArchiveInteger(&num);
container->ClearObjectList();
for (i = 0; i < num; i++) {
archiver.ArchiveString(&tmp);
container->AddObject(tmp);
}
} else {
num = container->NumObjects();
archiver.ArchiveInteger(&num);
for (i = 0; i < num; i++) {
str& tmp = container->ObjectAt(i + 1);
archiver.ArchiveString(&tmp);
}
}
}
void CG_ArchiveTikiPointer(MemArchiver& archiver, dtiki_t** pTiki)
{
str tmp;
if (archiver.IsReading()) {
archiver.ArchiveString(&tmp);
if (tmp.length()) {
*pTiki = cgi.R_Model_GetHandle(cgi.R_RegisterModel(tmp.c_str()));
} else {
*pTiki = NULL;
}
} else {
if (*pTiki) {
tmp = (*pTiki)->name;
}
archiver.ArchiveString(&tmp);
}
}
void CG_ArchiveModelHandle(MemArchiver& archiver, qhandle_t* handle)
{
str tmp;
if (archiver.IsReading()) {
archiver.ArchiveString(&tmp);
if (tmp.length()) {
*handle = cgi.R_RegisterModel(tmp.c_str());
} else {
*handle = (qhandle_t)0;
}
} else {
if (*handle) {
tmp = cgi.R_GetModelName(*handle);
} else {
tmp = "";
}
archiver.ArchiveString(&tmp);
}
}
void CG_ArchiveShaderHandle(MemArchiver& archiver, qhandle_t* handle)
{
str tmp;
if (archiver.IsReading()) {
archiver.ArchiveString(&tmp);
if (tmp.length()) {
*handle = cgi.R_RegisterShader(tmp.c_str());
} else {
*handle = (qhandle_t)0;
}
} else {
if (*handle) {
tmp = cgi.R_GetShaderName(*handle);
} else {
tmp = "";
}
archiver.ArchiveString(&tmp);
}
}
void CG_ArchiveRefEntity(MemArchiver& archiver, refEntity_t* ref)
{
archiver.ArchiveRaw(&ref->reType, sizeof(ref->reType));
archiver.ArchiveInteger(&ref->renderfx);
CG_ArchiveModelHandle(archiver, &ref->hModel);
CG_ArchiveModelHandle(archiver, &ref->hOldModel);
archiver.ArchiveVec3(ref->lightingOrigin);
archiver.ArchiveInteger(&ref->parentEntity);
archiver.ArchiveVec3(ref->axis[0]);
archiver.ArchiveVec3(ref->axis[1]);
archiver.ArchiveVec3(ref->axis[2]);
archiver.ArchiveBoolean(&ref->nonNormalizedAxes);
archiver.ArchiveVec3(ref->origin);
archiver.ArchiveRaw(ref->frameInfo, sizeof(ref->frameInfo));
archiver.ArchiveFloat(&ref->actionWeight);
archiver.ArchiveShort(&ref->wasframe);
archiver.ArchiveFloat(&ref->scale);
archiver.ArchiveVec3(ref->oldorigin);
archiver.ArchiveInteger(&ref->skinNum);
CG_ArchiveShaderHandle(archiver, &ref->customShader);
archiver.ArchiveRaw(ref->shaderRGBA, sizeof(ref->shaderRGBA));
archiver.ArchiveFloat(ref->shaderTexCoord);
archiver.ArchiveFloat(&ref->shaderTexCoord[1]);
archiver.ArchiveFloat(&ref->shaderTime);
archiver.ArchiveInteger(&ref->entityNumber);
archiver.ArchiveRaw(ref->surfaces, 32);
archiver.ArchiveFloat(ref->shader_data);
archiver.ArchiveFloat(&ref->shader_data[1]);
ref->bone_tag = NULL;
ref->bone_quat = NULL;
ref->of = NULL;
ref->nf = NULL;
CG_ArchiveTikiPointer(archiver, &ref->tiki);
archiver.ArchiveInteger(&ref->bonestart);
archiver.ArchiveInteger(&ref->morphstart);
archiver.ArchiveBoolean(&ref->hasMorph);
archiver.ArchiveFloat(&ref->radius);
archiver.ArchiveFloat(&ref->rotation);
}

53
code/cgame/cg_archive.h Normal file
View file

@ -0,0 +1,53 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// DESCRIPTION:
// Memory archiver
#pragma once
#ifdef __cplusplus
#include "../qcommon/container.h"
#include "../qcommon/str.h"
class MemArchiver;
extern "C" {
#endif
size_t CG_SaveStateToBuffer(void** out, int svsTime);
qboolean CG_LoadStateToBuffer(void* state, size_t size, int svsTime);
#ifdef __cplusplus
void CG_ArchiveStuff(MemArchiver& archiver, int svsTime);
void CG_ArchiveStringContainer(MemArchiver& archiver, Container<str>* container);
void CG_ArchiveTikiPointer(MemArchiver& archiver, dtiki_t** pTiki);
void CG_ArchiveModelHandle(MemArchiver& archiver, qhandle_t* handle);
void CG_ArchiveShaderHandle(MemArchiver& archiver, qhandle_t* handle);
void CG_ArchiveRefEntity(MemArchiver& archiver, refEntity_t* ref);
#endif
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
Copyright (C) 2008-2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// text commands typed in at the local console, or executed by a key binding
#include "cg_local.h"
#include "../fgame/bg_voteoptions.h"
void CG_TargetCommand_f(void);
@ -61,22 +62,25 @@ Debugging command to print the current position
*/
static void CG_Viewpos_f(void)
{
cgi.Printf("(%i %i %i) : %i\n", (int)cg.refdef.vieworg[0],
(int)cg.refdef.vieworg[1], (int)cg.refdef.vieworg[2],
(int)cg.refdefViewAngles[YAW]);
cgi.Printf(
"(%i %i %i) : %i\n",
(int)cg.refdef.vieworg[0],
(int)cg.refdef.vieworg[1],
(int)cg.refdef.vieworg[2],
(int)cg.refdefViewAngles[YAW]
);
}
void CG_SetDesiredObjectiveAlpha(float fAlpha)
{
cg.ObjectivesDesiredAlpha = fAlpha;
cg.ObjectivesAlphaTime = (float)(cg.time + 250);
cg.ObjectivesBaseAlpha = cg.ObjectivesCurrentAlpha;
cg.ObjectivesAlphaTime = (float)(cg.time + 250);
cg.ObjectivesBaseAlpha = cg.ObjectivesCurrentAlpha;
}
void CG_ScoresDown_f( void )
void CG_ScoresDown_f(void)
{
if (cgs.gametype == GT_SINGLE_PLAYER)
{
if (cgs.gametype == GT_SINGLE_PLAYER) {
if (!cg.scoresRequestTime) {
cg.scoresRequestTime = cg.time;
CG_SetDesiredObjectiveAlpha(1.0f);
@ -85,33 +89,30 @@ void CG_ScoresDown_f( void )
return;
}
if ( cg.scoresRequestTime + 2000 >= cg.time )
{
if (cg.scoresRequestTime + 2000 >= cg.time) {
// send another request
cg.showScores = qtrue;
CG_PrepScoreBoardInfo();
cgi.UI_ShowScoreBoard(cg.scoresMenuName);
return;
}
cg.scoresRequestTime = cg.time;
cgi.SendClientCommand( "score" );
return;
}
if ( !cg.showScores ) {
// don't display anything until first score returns
cg.showScores = qtrue;
cg.scoresRequestTime = cg.time;
cgi.SendClientCommand("score");
if (!cg.showScores) {
// don't display anything until first score returns
cg.showScores = qtrue;
CG_PrepScoreBoardInfo();
cgi.UI_ShowScoreBoard(cg.scoresMenuName);
}
}
}
void CG_ScoresUp_f( void )
void CG_ScoresUp_f(void)
{
if (cgs.gametype == GT_SINGLE_PLAYER)
{
if (!cg.scoresRequestTime)
{
cg.scoresRequestTime = cg.time;
if (cgs.gametype == GT_SINGLE_PLAYER) {
if (cg.scoresRequestTime) {
cg.scoresRequestTime = 0;
CG_SetDesiredObjectiveAlpha(0.0f);
}
@ -126,12 +127,12 @@ void CG_ScoresUp_f( void )
cgi.UI_HideScoreBoard();
}
baseshader_t* CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t* pRetTrace)
baseshader_t *CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t *pRetTrace)
{
vec3_t vPos, vEnd;
vec3_t axis[3];
baseshader_t* pShader;
trace_t trace;
vec3_t vPos, vEnd;
vec3_t axis[3];
baseshader_t *pShader;
trace_t trace;
AnglesToAxis(cg.refdefViewAngles, axis);
vPos[0] = cg.refdef.vieworg[0];
@ -140,18 +141,13 @@ baseshader_t* CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t* pRetTrace)
VectorMA(vPos, 4096.0, axis[0], vEnd);
CG_Trace(&trace, vPos, vec3_origin, vec3_origin, vEnd, 0, MASK_SHOT, 0, 0, "CG_GetShaderUnderCrosshair");
if (trace.startsolid || trace.fraction == 1.0) {
return NULL;
}
if (bVerbose)
{
cgi.Printf(
"Surface hit at (%i %i %i)\n",
(int)trace.endpos[0],
(int)trace.endpos[1],
(int)trace.endpos[2]);
if (bVerbose) {
cgi.Printf("Surface hit at (%i %i %i)\n", (int)trace.endpos[0], (int)trace.endpos[1], (int)trace.endpos[2]);
}
pShader = cgi.GetShader(trace.shaderNum);
@ -164,34 +160,170 @@ baseshader_t* CG_GetShaderUnderCrosshair(qboolean bVerbose, trace_t* pRetTrace)
static void CG_PrintContentTypes(int iContentFlags)
{
// FIXME: unimplemented
if (iContentFlags & CONTENTS_SOLID) {
cgi.Printf(" solid");
}
if (iContentFlags & CONTENTS_LAVA) {
cgi.Printf(" lava");
}
if (iContentFlags & CONTENTS_SLIME) {
cgi.Printf(" slime");
}
if (iContentFlags & CONTENTS_WATER) {
cgi.Printf(" water");
}
if (iContentFlags & CONTENTS_FOG) {
cgi.Printf(" fog");
}
if (iContentFlags & CONTENTS_FENCE) {
cgi.Printf(" fence");
}
if (iContentFlags & CONTENTS_AREAPORTAL) {
cgi.Printf(" areaportal");
}
if (iContentFlags & CONTENTS_PLAYERCLIP) {
cgi.Printf(" playerclip");
}
if (iContentFlags & CONTENTS_VEHICLECLIP) {
cgi.Printf(" vehicleclip");
}
if (iContentFlags & CONTENTS_MONSTERCLIP) {
cgi.Printf(" monsterclip");
}
if (iContentFlags & CONTENTS_WEAPONCLIP) {
cgi.Printf(" weaponclip");
}
if (iContentFlags & CONTENTS_SHOOTONLY) {
cgi.Printf(" shootableonly");
}
if (iContentFlags & CONTENTS_ORIGIN) {
cgi.Printf(" origin");
}
if (iContentFlags & CONTENTS_TRANSLUCENT) {
cgi.Printf(" trans");
}
}
static void CG_PrintSurfaceProperties(int iSurfaceFlags)
{
// FIXME: unimplemented
if (iSurfaceFlags & SURF_NODAMAGE) {
cgi.Printf(" nodamage");
}
if (iSurfaceFlags & SURF_SLICK) {
cgi.Printf(" slick");
}
if (iSurfaceFlags & SURF_SKY) {
cgi.Printf(" sky");
}
if (iSurfaceFlags & SURF_LADDER) {
cgi.Printf(" ladder");
}
if (iSurfaceFlags & SURF_NOIMPACT) {
cgi.Printf(" noimpact");
}
if (iSurfaceFlags & SURF_NOMARKS) {
cgi.Printf(" nomarks");
}
if (iSurfaceFlags & SURF_CASTSHADOW) {
cgi.Printf(" castshadow");
}
if (iSurfaceFlags & SURF_NODRAW) {
cgi.Printf(" nodraw");
}
if (iSurfaceFlags & SURF_NOLIGHTMAP) {
cgi.Printf(" nolightmap");
}
if (iSurfaceFlags & SURF_ALPHASHADOW) {
cgi.Printf(" alphashadow");
}
if (iSurfaceFlags & SURF_NOSTEPS) {
cgi.Printf(" nofootsteps");
}
if (iSurfaceFlags & SURF_NONSOLID) {
cgi.Printf(" nonsolid");
}
if (iSurfaceFlags & SURF_OVERBRIGHT) {
cgi.Printf(" overbright");
}
if (iSurfaceFlags & SURF_BACKSIDE) {
cgi.Printf(" backside");
}
if (iSurfaceFlags & SURF_NODLIGHT) {
cgi.Printf(" nodlight");
}
if (iSurfaceFlags & SURF_HINT) {
cgi.Printf(" hint");
}
if (iSurfaceFlags & SURF_PATCH) {
cgi.Printf(" patch");
}
}
static void CG_PrintSurfaceType(int iSurfType)
{
// FIXME: unimplemented
switch (iSurfType & MASK_SURF_TYPE) {
case SURF_FOLIAGE:
cgi.Printf("foliage");
break;
case SURF_SNOW:
cgi.Printf("snow");
break;
case SURF_CARPET:
cgi.Printf("carpet");
break;
case SURF_SAND:
cgi.Printf("sand");
break;
case SURF_PUDDLE:
cgi.Printf("puddle");
break;
case SURF_GLASS:
cgi.Printf("glass");
break;
case SURF_GRAVEL:
cgi.Printf("gravel");
break;
case SURF_MUD:
cgi.Printf("mud");
break;
case SURF_DIRT:
cgi.Printf("dirt");
break;
case SURF_GRILL:
cgi.Printf("metal grill");
break;
case SURF_GRASS:
cgi.Printf("grass");
break;
case SURF_ROCK:
cgi.Printf("rock");
break;
case SURF_PAPER:
cgi.Printf("paper");
break;
case SURF_WOOD:
cgi.Printf("wood");
break;
case SURF_METAL:
cgi.Printf("metal");
break;
default:
cgi.Printf("!!*none specified*!!");
break;
}
}
void CG_GetCHShader(void)
{
trace_t trace;
baseshader_t* pShader;
trace_t trace;
baseshader_t *pShader;
pShader = CG_GetShaderUnderCrosshair(qtrue, &trace);
cgi.Printf("\n");
if (pShader)
{
if (pShader->surfaceFlags & SURF_SKY)
{
if (pShader) {
if (pShader->surfaceFlags & SURF_SKY) {
cgi.Printf("Hit the sky\n");
}
else
{
} else {
cgi.Printf("Shader: %s\n", pShader->shader);
cgi.Printf("Shader Contents:");
CG_PrintContentTypes(pShader->contentFlags);
@ -212,28 +344,23 @@ void CG_GetCHShader(void)
CG_PrintSurfaceType(trace.surfaceFlags);
cgi.Printf("\n\n");
}
}
else
{
} else {
cgi.Printf("No surface selected\n");
}
}
void CG_EditCHShader(void)
{
char name[1024];
baseshader_t* pShader;
char name[1024];
baseshader_t *pShader;
pShader = CG_GetShaderUnderCrosshair(qfalse, NULL);
if (pShader)
{
strcpy(name, "editspecificshader ");
strcat(name, pShader->shader);
strcat(name, "\n");
if (pShader) {
Q_strncpyz(name, "editspecificshader ", sizeof(name));
Q_strcat(name, sizeof(name), pShader->shader);
Q_strcat(name, sizeof(name), "\n");
cgi.AddCommand(name);
}
else
{
} else {
cgi.Printf("No surface selected\n");
}
}
@ -348,61 +475,70 @@ void CG_AddTestModel (void) {
#endif
typedef struct {
char* cmd;
char *cmd;
void (*function)(void);
} consoleCommand_t;
static consoleCommand_t commands[] = {
{ "useweaponclass", &CG_UseWeaponClass_f },
{ "weapnext", &CG_NextWeapon_f },
{ "weapprev", &CG_PrevWeapon_f },
{ "uselast", &CG_UseLastWeapon_f },
{ "holster", &CG_HolsterWeapon_f },
{ "weapdrop", &CG_DropWeapon_f },
{ "toggleitem", &CG_ToggleItem_f },
{ "+scores", &CG_ScoresDown_f },
{ "-scores", &CG_ScoresUp_f },
{ "viewpos", &CG_Viewpos_f },
{ "sizeup", &CG_SizeUp_f },
{ "sizedown", &CG_SizeDown_f },
{ "cg_eventlist", &CG_EventList_f },
{ "cg_eventhelp", &CG_EventHelp_f },
{ "cg_dumpevents", &CG_DumpEventHelp_f },
{ "cg_pendingevents", &CG_PendingEvents_f },
{ "cg_classlist", &CG_ClassList_f },
{ "cg_classtree", &CG_ClassTree_f },
{ "cg_classevents", &CG_ClassEvents_f },
{ "cg_dumpclassevents", &CG_DumpClassEvents_f },
{ "cg_dumpallclasses", &CG_DumpAllClasses_f },
{ "testemitter", &CG_TestEmitter_f },
{ "triggertestemitter", &CG_TriggerTestEmitter_f },
{ "prevemittercommand", &CG_PrevEmitterCommand_f },
{ "nextemittercommand", &CG_NextEmitterCommand_f },
{ "newemittercommand", &CG_NewEmitterCommand_f },
{ "deleteemittercommand", &CG_DeleteEmitterCommand_f },
{ "dumpemitter", &CG_DumpEmitter_f },
{ "loademitter", &CG_LoadEmitter_f },
{ "resetvss", &CG_ResetVSSSources },
{ "getchshader", &CG_GetCHShader },
{ "editchshader", &CG_EditCHShader },
{ "messagemode", &CG_MessageMode_f },
{ "messagemode_all", &CG_MessageMode_All_f },
{ "messagemode_team", &CG_MessageMode_Team_f },
{ "messagemode_private", &CG_MessageMode_Private_f },
{ "say", &CG_MessageSingleAll_f },
{ "sayteam", &CG_MessageSingleTeam_f },
{ "teamsay", &CG_MessageSingleTeam_f },
{ "sayprivate", &CG_MessageSingleClient_f },
{ "sayone", &CG_MessageSingleClient_f },
{ "wisper", &CG_MessageSingleClient_f },
{ "instamsg_main", &CG_InstaMessageMain_f },
{ "instamsg_group_a", &CG_InstaMessageGroupA_f },
{ "instamsg_group_b", &CG_InstaMessageGroupB_f },
{ "instamsg_group_c", &CG_InstaMessageGroupC_f },
{ "instamsg_group_d", &CG_InstaMessageGroupD_f },
{ "instamsg_group_e", &CG_InstaMessageGroupE_f },
{ "pushmenu_teamselect", &CG_PushMenuTeamSelect_f },
{ "pushmenu_weaponselect", &CG_PushMenuWeaponSelect_f },
{"useweaponclass", &CG_UseWeaponClass_f },
{"weapnext", &CG_NextWeapon_f },
{"weapprev", &CG_PrevWeapon_f },
{"uselast", &CG_UseLastWeapon_f },
{"holster", &CG_HolsterWeapon_f },
{"weapdrop", &CG_DropWeapon_f },
{"toggleitem", &CG_ToggleItem_f },
{"+scores", &CG_ScoresDown_f },
{"-scores", &CG_ScoresUp_f },
{"viewpos", &CG_Viewpos_f },
{"sizeup", &CG_SizeUp_f },
{"sizedown", &CG_SizeDown_f },
{"cg_eventlist", &CG_EventList_f },
{"cg_eventhelp", &CG_EventHelp_f },
{"cg_dumpevents", &CG_DumpEventHelp_f },
{"cg_pendingevents", &CG_PendingEvents_f },
{"cg_classlist", &CG_ClassList_f },
{"cg_classtree", &CG_ClassTree_f },
{"cg_classevents", &CG_ClassEvents_f },
{"cg_dumpclassevents", &CG_DumpClassEvents_f },
{"cg_dumpallclasses", &CG_DumpAllClasses_f },
{"testemitter", &CG_TestEmitter_f },
{"triggertestemitter", &CG_TriggerTestEmitter_f },
{"prevemittercommand", &CG_PrevEmitterCommand_f },
{"nextemittercommand", &CG_NextEmitterCommand_f },
{"newemittercommand", &CG_NewEmitterCommand_f },
{"deleteemittercommand", &CG_DeleteEmitterCommand_f },
{"dumpemitter", &CG_DumpEmitter_f },
{"loademitter", &CG_LoadEmitter_f },
{"resetvss", &CG_ResetVSSSources },
{"getchshader", &CG_GetCHShader },
{"editchshader", &CG_EditCHShader },
{"messagemode", &CG_MessageMode_f },
{"messagemode_all", &CG_MessageMode_All_f },
{"messagemode_team", &CG_MessageMode_Team_f },
{"messagemode_private", &CG_MessageMode_Private_f },
{"say", &CG_MessageSingleAll_f },
{"sayteam", &CG_MessageSingleTeam_f },
{"teamsay", &CG_MessageSingleTeam_f },
{"sayprivate", &CG_MessageSingleClient_f },
{"sayone", &CG_MessageSingleClient_f },
{"wisper", &CG_MessageSingleClient_f },
{"instamsg_main", &CG_InstaMessageMain_f },
{"instamsg_group_a", &CG_InstaMessageGroupA_f },
{"instamsg_group_b", &CG_InstaMessageGroupB_f },
{"instamsg_group_c", &CG_InstaMessageGroupC_f },
{"instamsg_group_d", &CG_InstaMessageGroupD_f },
{"instamsg_group_e", &CG_InstaMessageGroupE_f },
{"pushmenu_teamselect", &CG_PushMenuTeamSelect_f },
{"pushmenu_weaponselect", &CG_PushMenuWeaponSelect_f },
// Added in 2.0
{"pushcallvote", &CG_PushCallVote_f },
{"pushcallvotesublist", &CG_PushCallVoteSubList_f },
{"pushcallvotesubtext", &CG_PushCallVoteSubText_f },
{"pushcallvotesubinteger", &CG_PushCallVoteSubInteger_f},
{"pushcallvotesubfloat", &CG_PushCallVoteSubFloat_f },
{"pushcallvotesubclient", &CG_PushCallVoteSubClient_f },
{"pushvote", &CG_PushVote_f },
{"callentryvote", &CG_CallEntryVote_f },
};
/*
@ -415,8 +551,8 @@ Cmd_Argc() / Cmd_Argv()
*/
qboolean CG_ConsoleCommand(void)
{
const char* cmd;
int i;
const char *cmd;
int i;
cmd = cgi.Argv(0);
@ -475,7 +611,7 @@ void CG_PushMenuTeamSelect_f(void)
default:
cgi.Cmd_Execute(EXEC_NOW, "pushmenu SelectTeam\n");
break;
}
}
}
void CG_PushMenuWeaponSelect_f(void)
@ -489,7 +625,7 @@ void CG_PushMenuWeaponSelect_f(void)
void CG_UseWeaponClass_f(void)
{
const char* cmd;
const char *cmd;
cmd = cgi.Argv(1);
@ -520,37 +656,37 @@ void CG_UseWeaponClass_f(void)
void CG_NextWeapon_f(void)
{
cg.iWeaponCommand = WEAPON_COMMAND_USE_NEXT_WEAPON;
cg.iWeaponCommand = WEAPON_COMMAND_USE_NEXT_WEAPON;
cg.iWeaponCommandSend = 0;
}
void CG_PrevWeapon_f(void)
{
cg.iWeaponCommand = WEAPON_COMMAND_USE_PREV_WEAPON;
cg.iWeaponCommand = WEAPON_COMMAND_USE_PREV_WEAPON;
cg.iWeaponCommandSend = 0;
}
void CG_UseLastWeapon_f(void)
{
cg.iWeaponCommand = WEAPON_COMMAND_USE_LAST_WEAPON;
cg.iWeaponCommand = WEAPON_COMMAND_USE_LAST_WEAPON;
cg.iWeaponCommandSend = 0;
}
void CG_HolsterWeapon_f(void)
{
cg.iWeaponCommand = WEAPON_COMMAND_HOLSTER;
cg.iWeaponCommand = WEAPON_COMMAND_HOLSTER;
cg.iWeaponCommandSend = 0;
}
void CG_DropWeapon_f(void)
{
cg.iWeaponCommand = WEAPON_COMMAND_DROP;
cg.iWeaponCommand = WEAPON_COMMAND_DROP;
cg.iWeaponCommandSend = 0;
}
void CG_ToggleItem_f(void)
{
cg.iWeaponCommand = WEAPON_COMMAND_USE_ITEM1;
cg.iWeaponCommand = WEAPON_COMMAND_USE_ITEM1;
cg.iWeaponCommandSend = 0;
}
@ -562,12 +698,12 @@ int CG_WeaponCommandButtonBits(void)
return 0;
}
iShiftedWeaponCommand = cg.iWeaponCommand << 7;
iShiftedWeaponCommand = cg.iWeaponCommand << 7;
cg.iWeaponCommandSend++;
if (cg.iWeaponCommandSend > 2) {
cg.iWeaponCommand = 0;
}
return iShiftedWeaponCommand & WEAPON_COMMAND_MASK;
return iShiftedWeaponCommand & GetWeaponCommandMask(cg_protocol >= PROTOCOL_MOHTA_MIN ? WEAPON_COMMAND_MAX_VER17 : WEAPON_COMMAND_MAX_VER6);
}

File diff suppressed because it is too large Load diff

View file

@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// cg_ents.c -- present snapshot entities, happens every single frame
#include "cg_local.h"
#include "cg_radar.h"
/*
==========================================================================
@ -37,48 +38,42 @@ FUNCTIONS CALLED EACH FRAME
CG_SetEntitySoundPosition
======================
*/
void CG_SetEntitySoundPosition( centity_t *cent )
{
vec3_t origin;
void CG_SetEntitySoundPosition(centity_t *cent)
{
vec3_t origin;
if ( cent->currentState.solid == SOLID_BMODEL )
{
float *v;
vec3_t vel;
if (cent->currentState.solid == SOLID_BMODEL) {
float *v;
vec3_t vel;
v = cgs.inlineModelMidpoints[ cent->currentState.modelindex ];
VectorAdd( cent->lerpOrigin, v, origin );
v = cgs.inlineModelMidpoints[cent->currentState.modelindex];
VectorAdd(cent->lerpOrigin, v, origin);
vel[0] = 0.0;
vel[1] = 0.0;
vel[2] = 0.0;
vel[0] = 0.0;
vel[1] = 0.0;
vel[2] = 0.0;
cgi.S_UpdateEntity( cent->currentState.number, origin, vel, qfalse );
}
else
{
if ( cent && cg.snap && cent->currentState.parent == cg.snap->ps.clientNum )
{
vec3_t origin;
vec3_t velocity;
cgi.S_UpdateEntity(cent->currentState.number, origin, vel, qfalse);
} else {
if (cent && cg.snap && cent->currentState.parent == cg.snap->ps.clientNum) {
vec3_t origin;
vec3_t velocity;
origin[0] = 0;
origin[1] = 0;
origin[2] = 0;
origin[0] = 0;
origin[1] = 0;
origin[2] = 0;
velocity[0] = 0;
velocity[1] = 0;
velocity[2] = 0;
velocity[0] = 0;
velocity[1] = 0;
velocity[2] = 0;
cgi.S_UpdateEntity( cent->currentState.number, origin, velocity, qtrue );
}
else
{
CG_GetOrigin( cent, origin );
cgi.S_UpdateEntity( cent->currentState.number, origin, cent->currentState.pos.trDelta, qfalse );
}
}
}
cgi.S_UpdateEntity(cent->currentState.number, origin, velocity, qtrue);
} else {
CG_GetOrigin(cent, origin);
cgi.S_UpdateEntity(cent->currentState.number, origin, cent->currentState.pos.trDelta, qfalse);
}
}
}
/*
==================
@ -87,165 +82,173 @@ CG_EntityEffects
Add continuous entity effects, like local entity emission and lighting
==================
*/
void CG_EntityEffects( centity_t *cent )
{
// initialize with the client colors
cent->color[ 0 ] = cent->client_color[ 0 ];
cent->color[ 1 ] = cent->client_color[ 1 ];
cent->color[ 2 ] = cent->client_color[ 2 ];
cent->color[ 3 ] = cent->client_color[ 3 ];
void CG_EntityEffects(centity_t *cent)
{
// initialize with the client colors
cent->color[0] = cent->client_color[0];
cent->color[1] = cent->client_color[1];
cent->color[2] = cent->client_color[2];
cent->color[3] = cent->client_color[3];
if ( cent->currentState.constantLight != 0xffffff )
{
int style;
unsigned cl;
float i, r, g, b;
if (cent->currentState.constantLight != 0xffffff) {
int style;
unsigned cl;
float i, r, g, b;
cl = cent->currentState.constantLight;
style = ( cl & 255 );
r = ( float )style / 255.0f;
g = ( float )( ( cl >> 8 ) & 255 ) / 255.0f;
b = ( float )( ( cl >> 16 ) & 255 ) / 255.0f;
i = ( ( cl >> 24 ) & 255 ) * CONSTANTLIGHT_RADIUS_SCALE;
if ( cent->currentState.renderfx & RF_LIGHTSTYLE_DLIGHT )
{
float color[ 4 ];
cl = cent->currentState.constantLight;
style = (cl & 255);
r = (float)style / 255.0f;
g = (float)((cl >> 8) & 255) / 255.0f;
b = (float)((cl >> 16) & 255) / 255.0f;
i = ((cl >> 24) & 255) * CONSTANTLIGHT_RADIUS_SCALE;
if (cent->currentState.renderfx & RF_LIGHTSTYLE_DLIGHT) {
float color[4];
CG_LightStyleColor( style, cg.time, color, qfalse );
r = color[ 0 ];
g = color[ 1 ];
b = color[ 2 ];
i *= color[ 3 ];
}
if ( i )
{
int flags;
CG_LightStyleColor(style, cg.time, color, qfalse);
r = color[0];
g = color[1];
b = color[2];
i *= color[3];
}
if (i) {
int flags;
flags = 0;
if ( cent->currentState.renderfx & RF_LENSFLARE )
{
flags |= lensflare;
flags = 0;
if (cent->currentState.renderfx & RF_LENSFLARE) {
flags |= lensflare;
} else if (cent->currentState.renderfx & RF_VIEWLENSFLARE) {
flags |= viewlensflare;
}
else if ( cent->currentState.renderfx & RF_VIEWLENSFLARE )
{
flags |= viewlensflare;
if (cent->currentState.renderfx & RF_ADDITIVE_DLIGHT) {
flags |= additive;
}
if ( cent->currentState.renderfx & RF_ADDITIVE_DLIGHT )
{
flags |= additive;
}
cgi.R_AddLightToScene( cent->lerpOrigin, i, r, g, b, flags );
}
if ( r < cent->color[ 0 ] )
cent->color[ 0 ] = r;
if ( g < cent->color[ 1 ] )
cent->color[ 1 ] = g;
if ( b < cent->color[ 2 ] )
cent->color[ 2 ] = b;
}
}
cgi.R_AddLightToScene(cent->lerpOrigin, i, r, g, b, flags);
}
if (r < cent->color[0]) {
cent->color[0] = r;
}
if (g < cent->color[1]) {
cent->color[1] = g;
}
if (b < cent->color[2]) {
cent->color[2] = b;
}
}
}
/*
==================
CG_General
==================
*/
void CG_General( centity_t *cent ) {
refEntity_t ent;
entityState_t *s1;
int i;
vec3_t vMins, vMaxs, vTmp;
void CG_General(centity_t *cent)
{
refEntity_t ent;
entityState_t *s1;
int i;
vec3_t vMins, vMaxs, vTmp;
s1 = &cent->currentState;
s1 = &cent->currentState;
// add loop sound
if ( s1->loopSound )
{
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cgs.sound_precache[s1->loopSound], s1->loopSoundVolume, s1->loopSoundMinDist, s1->loopSoundMaxDist, s1->loopSoundPitch, s1->loopSoundFlags );
}
if ( cent->tikiLoopSound )
cgi.S_AddLoopingSound( cent->lerpOrigin, vec3_origin, cent->tikiLoopSound, cent->tikiLoopSoundVolume, cent->tikiLoopSoundMinDist, cent->tikiLoopSoundMaxDist, cent->tikiLoopSoundPitch, cent->tikiLoopSoundFlags );
// add loop sound
if (s1->loopSound) {
cgi.S_AddLoopingSound(
cent->lerpOrigin,
vec3_origin,
cgs.sound_precache[s1->loopSound],
s1->loopSoundVolume,
s1->loopSoundMinDist,
s1->loopSoundMaxDist,
s1->loopSoundPitch,
s1->loopSoundFlags
);
}
if (cent->tikiLoopSound) {
cgi.S_AddLoopingSound(
cent->lerpOrigin,
vec3_origin,
cent->tikiLoopSound,
cent->tikiLoopSoundVolume,
cent->tikiLoopSoundMinDist,
cent->tikiLoopSoundMaxDist,
cent->tikiLoopSoundPitch,
cent->tikiLoopSoundFlags
);
}
// if set to invisible, skip
if (!s1->modelindex) {
return;
}
if (s1->renderfx & RF_SKYORIGIN) {
AnglesToAxis(cent->lerpAngles, cg.sky_axis);
VectorCopy(cent->lerpOrigin, cg.sky_origin);
}
memset (&ent, 0, sizeof(ent));
// if set to invisible, skip
if (!s1->modelindex) {
return;
}
// set frame
if (s1->renderfx & RF_DONTDRAW) {
return;
}
ent.wasframe = s1->wasframe;
memset(&ent, 0, sizeof(ent));
VectorCopy( cent->lerpOrigin, ent.origin);
VectorCopy( cent->lerpOrigin, ent.oldorigin);
// set frame
// set skin
IntegerToBoundingBox(s1->solid, vMins, vMaxs);
VectorSubtract(vMins, vMaxs, vTmp);
ent.lightingOrigin[0] = ent.origin[0] + (vMins[0] + vMaxs[0]) * 0.5;
ent.lightingOrigin[1] = ent.origin[1] + (vMins[1] + vMaxs[1]) * 0.5;
ent.lightingOrigin[2] = ent.origin[2] + (vMins[2] + vMaxs[2]) * 0.5;
ent.radius = VectorLength(vTmp) * 0.5;
ent.wasframe = s1->wasframe;
ent.skinNum = s1->skinNum;
VectorCopy(cent->lerpOrigin, ent.origin);
VectorCopy(cent->lerpOrigin, ent.oldorigin);
ent.hModel = cgs.model_draw[s1->modelindex];
// set skin
IntegerToBoundingBox(s1->solid, vMins, vMaxs);
VectorMA(ent.origin, 0.5f, ent.lightingOrigin, ent.lightingOrigin);
VectorSubtract(vMins, vMaxs, vTmp);
ent.radius = VectorLength(vTmp) * 0.5;
// set surfaces
memcpy( ent.surfaces, s1->surfaces, MAX_MODEL_SURFACES );
ent.skinNum = s1->skinNum;
// Modulation based off the color
for( i=0; i<3; i++ )
ent.shaderRGBA[ i ] = cent->color[ i ] * 255;
ent.hModel = cgs.model_draw[s1->modelindex];
// take the alpha from the entity if less than 1, else grab it from the client commands version
if ( s1->alpha < 1 )
{
ent.shaderRGBA[ 3 ] = s1->alpha * 255;
}
else
{
ent.shaderRGBA[ 3 ] = cent->color[ 3 ] * 255;
}
// set surfaces
memcpy(ent.surfaces, s1->surfaces, MAX_MODEL_SURFACES);
// convert angles to axis
AnglesToAxis( cent->lerpAngles, ent.axis );
// Modulation based off the color
for (i = 0; i < 3; i++) {
ent.shaderRGBA[i] = cent->color[i] * 255;
}
// Interpolated state variables
if ( cent->interpolate )
{
ent.scale = s1->scale + cg.frameInterpolation * ( cent->nextState.scale - cent->currentState.scale );
}
else
{
ent.scale = s1->scale;
}
// set the entity number
ent.entityNumber = s1->number;
// take the alpha from the entity if less than 1, else grab it from the client commands version
if (s1->alpha < 1) {
ent.shaderRGBA[3] = s1->alpha * 255;
} else {
ent.shaderRGBA[3] = cent->color[3] * 255;
}
// copy shader specific data
ent.shader_data[ 0 ] = s1->tag_num;
ent.shader_data[ 1 ] = s1->skinNum;
ent.renderfx |= s1->renderfx;
// convert angles to axis
AnglesToAxis(cent->lerpAngles, ent.axis);
if ( ent.renderfx & RF_SKYORIGIN )
{
memcpy( cg.sky_axis, ent.axis, sizeof( cg.sky_axis ) );
VectorCopy( ent.origin, cg.sky_origin );
}
// Interpolated state variables
if (cent->interpolate) {
ent.scale = s1->scale + cg.frameInterpolation * (cent->nextState.scale - cent->currentState.scale);
} else {
ent.scale = s1->scale;
}
// set the entity number
ent.entityNumber = s1->number;
ent.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
ent.frameInfo[0].index = s1->frameInfo[0].index;
ent.frameInfo[0].time = s1->frameInfo[0].time;
ent.frameInfo[0].weight = s1->frameInfo[0].weight;
ent.actionWeight = 1.0;
// copy shader specific data
ent.shader_data[0] = s1->tag_num;
ent.shader_data[1] = s1->skinNum;
ent.renderfx |= s1->renderfx;
// add to refresh list
cgi.R_AddRefEntityToScene (&ent, ENTITYNUM_NONE);
ent.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
ent.frameInfo[0] = s1->frameInfo[0];
ent.actionWeight = 1.0;
if (ent.tiki)
{
// add to refresh list
cgi.R_AddRefEntityToScene(&ent, ENTITYNUM_NONE);
if (ent.tiki) {
// update any emitter's...
CG_UpdateEntityEmitters(s1->number, &ent, cent);
}
@ -258,58 +261,57 @@ CG_Speaker
Speaker entities can automatically play sounds
==================
*/
void CG_Speaker( centity_t *cent )
{
if ( ! cent->currentState.clientNum ) // FIXME: use something other than clientNum...
{
return; // not auto triggering
}
void CG_Speaker(centity_t *cent)
{
if (!cent->currentState.clientNum) // FIXME: use something other than clientNum...
{
return; // not auto triggering
}
if ( cg.time < cent->miscTime )
{
return;
}
// FIXME
//cgi.S_StartSound (NULL, cent->currentState.number, CHAN_ITEM, cgs.sound_precache[cent->currentState.eventParm] );
if (cg.time < cent->miscTime) {
return;
}
// ent->s.frame = ent->wait * 10;
// ent->s.clientNum = ent->random * 10;
cent->miscTime = cg.time + cent->currentState.wasframe * 100 + cent->currentState.clientNum * 100 * crandom();
}
// FIXME
//cgi.S_StartSound (NULL, cent->currentState.number, CHAN_ITEM, cgs.sound_precache[cent->currentState.eventParm] );
// ent->s.frame = ent->wait * 10;
// ent->s.clientNum = ent->random * 10;
cent->miscTime = cg.time + cent->currentState.wasframe * 100 + cent->currentState.clientNum * 100 * crandom();
}
/*
===============
CG_Mover
===============
*/
void CG_Mover( centity_t *cent ) {
refEntity_t ent;
entityState_t *s1;
void CG_Mover(centity_t *cent)
{
refEntity_t ent;
entityState_t *s1;
s1 = &cent->currentState;
s1 = &cent->currentState;
// create the render entity
memset (&ent, 0, sizeof(ent));
VectorCopy( cent->lerpOrigin, ent.origin);
VectorCopy( cent->lerpOrigin, ent.oldorigin);
AnglesToAxis( cent->lerpAngles, ent.axis );
// create the render entity
memset(&ent, 0, sizeof(ent));
VectorCopy(cent->lerpOrigin, ent.origin);
VectorCopy(cent->lerpOrigin, ent.oldorigin);
AnglesToAxis(cent->lerpAngles, ent.axis);
ent.renderfx &= ~RF_SHADOW;
ent.renderfx &= ~RF_SHADOW;
// flicker between two skins (FIXME?)
ent.skinNum = ( cg.time >> 6 ) & 1;
// flicker between two skins (FIXME?)
ent.skinNum = (cg.time >> 6) & 1;
// get the model, either as a bmodel or a modelindex
if ( s1->solid == SOLID_BMODEL ) {
ent.hModel = cgs.inlineDrawModel[s1->modelindex];
} else {
ent.hModel = cgs.model_draw[s1->modelindex];
}
// get the model, either as a bmodel or a modelindex
if (s1->solid == SOLID_BMODEL) {
ent.hModel = cgs.inlineDrawModel[s1->modelindex];
} else {
ent.hModel = cgs.model_draw[s1->modelindex];
}
// add to refresh list
cgi.R_AddRefEntityToScene(&ent, ENTITYNUM_NONE);
// add to refresh list
cgi.R_AddRefEntityToScene(&ent, ENTITYNUM_NONE);
}
/*
@ -317,120 +319,117 @@ void CG_Mover( centity_t *cent ) {
CG_Beam
===============
*/
void CG_Beam( centity_t *cent ) {
entityState_t *s1;
vec3_t vz={0,0,0},origin={0,0,0};
float modulate[4];
int i;
void CG_Beam(centity_t *cent)
{
entityState_t *s1;
vec3_t vz = {0, 0, 0}, origin = {0, 0, 0};
float modulate[4];
int i;
s1 = &cent->currentState;
s1 = &cent->currentState;
for ( i=0;i<4;i++ )
modulate[i] = cent->color[i];
for (i = 0; i < 4; i++) {
modulate[i] = cent->color[i];
}
if ( s1->beam_entnum != ENTITYNUM_NONE )
{
refEntity_t *parent;
parent = cgi.R_GetRenderEntity( s1->beam_entnum);
if (s1->beam_entnum != ENTITYNUM_NONE) {
refEntity_t *parent;
parent = cgi.R_GetRenderEntity(s1->beam_entnum);
if ( !parent )
{
cgi.DPrintf( "CG_Beam: Could not find parent entity\n" );
return;
}
if (!parent) {
cgi.DPrintf("CG_Beam: Could not find parent entity\n");
return;
}
VectorAdd( s1->origin, parent->origin, origin );
}
else
{
VectorCopy( s1->origin, origin );
}
VectorAdd(s1->origin, parent->origin, origin);
} else {
VectorCopy(s1->origin, origin);
}
CG_CreateBeam( origin, // start
vz, // dir ( auto calculated by using origin2-origin )
s1->number, // owner number
cgs.model_draw[s1->modelindex], //hModel
s1->alpha, // alpha
s1->scale, // scale
s1->skinNum, // flags
0, // length ( auto calculated )
PKT_TO_BEAM_PARM( s1->surfaces[0] ) * 1000, // life
qfalse, // don't always create the beam, just update it
s1->origin2, // endpoint
s1->bone_angles[0][0], // min offset
s1->bone_angles[0][1], // max offset
PKT_TO_BEAM_PARM( s1->surfaces[3] ), // overlap
s1->surfaces[4], // subdivisions
PKT_TO_BEAM_PARM( s1->surfaces[5] ) * 1000, // delay
CG_ConfigString( CS_IMAGES + s1->tag_num ), // index for shader configstring
modulate, // modulate color
s1->surfaces[6], // num sphere beams
PKT_TO_BEAM_PARM( s1->surfaces[7] ), // sphere radius
PKT_TO_BEAM_PARM( s1->surfaces[8] ), // toggle delay
PKT_TO_BEAM_PARM( s1->surfaces[9] ), // end alpha
s1->renderfx,
""
);
CG_CreateBeam(
origin, // start
vz, // dir ( auto calculated by using origin2-origin )
s1->number, // owner number
cgs.model_draw[s1->modelindex], //hModel
s1->alpha, // alpha
s1->scale, // scale
s1->skinNum, // flags
0, // length ( auto calculated )
PKT_TO_BEAM_PARM(s1->surfaces[0]) * 1000, // life
qfalse, // don't always create the beam, just update it
s1->origin2, // endpoint
s1->bone_angles[0][0], // min offset
s1->bone_angles[0][1], // max offset
PKT_TO_BEAM_PARM(s1->surfaces[3]), // overlap
s1->surfaces[4], // subdivisions
PKT_TO_BEAM_PARM(s1->surfaces[5]) * 1000, // delay
CG_ConfigString(CS_IMAGES + s1->tag_num), // index for shader configstring
modulate, // modulate color
s1->surfaces[6], // num sphere beams
PKT_TO_BEAM_PARM(s1->surfaces[7]), // sphere radius
PKT_TO_BEAM_PARM(s1->surfaces[8]), // toggle delay
PKT_TO_BEAM_PARM(s1->surfaces[9]), // end alpha
s1->renderfx,
""
);
}
void CG_Decal(centity_t *cent)
void CG_Decal
(
centity_t *cent
)
{
qhandle_t shader;
vec3_t dir;
entityState_t *s1;
{
qhandle_t shader;
vec3_t dir;
entityState_t *s1;
s1 = &cent->currentState;
s1 = &cent->currentState;
shader = cgi.R_RegisterShader( CG_ConfigString( CS_IMAGES + s1->tag_num ) );
ByteToDir( s1->surfaces[0], dir );
CG_ImpactMark( shader,
s1->origin,
dir,
s1->angles[2],
cent->color[0],
cent->color[1],
cent->color[2],
cent->color[3],
qtrue,
s1->scale,
qfalse,
-1,
qfalse,
0.f,
0.f);
}
shader = cgi.R_RegisterShader(CG_ConfigString(CS_IMAGES + s1->tag_num));
ByteToDir(s1->surfaces[0], dir);
CG_ImpactMark(
shader,
s1->origin,
dir,
s1->angles[2],
s1->scale,
s1->scale,
cent->color[0],
cent->color[1],
cent->color[2],
cent->color[3],
qtrue,
qfalse,
qtrue,
qfalse,
0.5f,
0.5f
);
}
/*
===============
CG_Portal
===============
*/
void CG_Portal(centity_t* cent)
{
}
void CG_Portal(centity_t *cent) {}
/*
================
BG_EvaluateTrajectory
================
*/
void BG_EvaluateTrajectory(const trajectory_t* tr, int atTime, const vec3_t base, vec3_t result) {
float deltaTime;
void BG_EvaluateTrajectory(const trajectory_t *tr, int atTime, const vec3_t base, vec3_t result)
{
float deltaTime;
if (atTime > cg_smoothClientsTime->integer + tr->trTime) {
atTime = cg_smoothClientsTime->integer + tr->trTime;
}
if (atTime > cg_smoothClientsTime->integer + tr->trTime) {
atTime = cg_smoothClientsTime->integer + tr->trTime;
}
deltaTime = (float)(atTime - tr->trTime) / 1000.0;
deltaTime = (float)(atTime - tr->trTime) / 1000.0;
result[0] = tr->trDelta[0] * deltaTime + base[0];
result[1] = tr->trDelta[1] * deltaTime + base[1];
result[2] = tr->trDelta[2] * deltaTime + base[2];
result[0] = tr->trDelta[0] * deltaTime + base[0];
result[1] = tr->trDelta[1] * deltaTime + base[1];
result[2] = tr->trDelta[2] * deltaTime + base[2];
}
/*
@ -439,17 +438,15 @@ CG_CalcEntityLerpPositions
===============
*/
void CG_CalcEntityLerpPositions( centity_t *cent )
void CG_CalcEntityLerpPositions(centity_t *cent)
{
int i;
float f;
float f;
f = cg.frameInterpolation;
if (cent->currentState.eType == ET_PLAYER)
{
if (cent->currentState.number == cg.snap->ps.clientNum)
{
if (cent->currentState.eType == ET_PLAYER) {
if (cent->currentState.number == cg.snap->ps.clientNum) {
// if the player, take position from prediction
VectorCopy(cg.predicted_player_state.origin, cent->lerpOrigin);
for (i = 0; i < 3; i++) {
@ -471,28 +468,26 @@ void CG_CalcEntityLerpPositions( centity_t *cent )
}
for (i = 0; i < 3; i++) {
cent->lerpOrigin[i] = cent->currentState.origin[i] +
f * (cent->nextState.origin[i] - cent->currentState.origin[i]);
cent->lerpOrigin[i] =
cent->currentState.origin[i] + f * (cent->nextState.origin[i] - cent->currentState.origin[i]);
}
if (!memcmp(cent->currentState.angles, cent->nextState.angles, sizeof(vec3_t))) {
VectorCopy(cent->currentState.angles, cent->lerpAngles);
}
else {
} else {
// use spherical interpolation using quaternions so that bound objects
// rotate properly without gimble lock.
SlerpQuaternion(cent->currentState.quat, cent->nextState.quat, f, quat);
QuatToMat(quat, mat);
MatrixToEulerAngles(mat, cent->lerpAngles);
}
}
else if (cent->interpolate) {
} else if (cent->interpolate) {
float quat[4];
float mat[3][3];
// if the entity has a valid next state, interpolate a value between the frames
// unless it is a mover with a known start and stop
vec3_t current, next;
vec3_t current, next;
// this will linearize a sine or parabolic curve, but it is important
// to not extrapolate player positions if more recent data is available
@ -505,16 +500,14 @@ void CG_CalcEntityLerpPositions( centity_t *cent )
if (!memcmp(cent->currentState.angles, cent->nextState.angles, sizeof(vec3_t))) {
VectorCopy(cent->currentState.angles, cent->lerpAngles);
}
else {
} else {
// use spherical interpolation using quaternions so that bound objects
// rotate properly without gimble lock.
SlerpQuaternion(cent->currentState.quat, cent->nextState.quat, f, quat);
QuatToMat(quat, mat);
MatrixToEulerAngles(mat, cent->lerpAngles);
}
}
else {
} else {
// just use the current frame and evaluate as best we can
BG_EvaluateTrajectory(&cent->currentState.pos, cg.time, cent->currentState.origin, cent->lerpOrigin);
VectorCopy(cent->currentState.angles, cent->lerpAngles);
@ -527,7 +520,7 @@ CG_AddCEntity
===============
*/
void CG_AddCEntity(centity_t* cent)
void CG_AddCEntity(centity_t *cent)
{
// event-only entities will have been dealt with already
if (cent->currentState.eType >= ET_EVENTS) {
@ -558,10 +551,13 @@ void CG_AddCEntity(centity_t* cent)
CG_ModelAnim(cent, qtrue);
break;
case ET_PLAYER:
CG_Player(cent);
CG_Player(cent);
CG_Splash(cent);
case ET_ITEM:
CG_ModelAnim(cent, qfalse);
CG_UpdateRadarClient(cent);
break;
case ET_ITEM:
CG_ModelAnim(cent, qfalse);
break;
case ET_GENERAL:
CG_General(cent);
@ -588,10 +584,10 @@ void CG_AddCEntity(centity_t* cent)
break;
case ET_ROPE: // skip
CG_Rope(cent);
break;
case ET_EXEC_COMMANDS:
CG_ModelAnim(cent, qfalse);
break;
break;
case ET_EXEC_COMMANDS:
CG_ModelAnim(cent, qfalse);
break;
}
}
@ -601,29 +597,30 @@ CG_AddPacketEntities
===============
*/
void CG_AddPacketEntities( void ) {
int num;
centity_t *cent;
int child, parent;
qboolean processed[MAX_ENTITIES];
int i;
void CG_AddPacketEntities(void)
{
int num;
centity_t *cent;
int child, parent;
qboolean processed[MAX_ENTITIES];
int i;
// the auto-rotating items will all have the same axis
cg.autoAngles[0] = 0;
cg.autoAngles[1] = ( cg.time & 2047 ) * 360 / 2048.0;
cg.autoAngles[2] = 0;
// the auto-rotating items will all have the same axis
cg.autoAngles[0] = 0;
cg.autoAngles[1] = (cg.time & 2047) * 360 / 2048.0;
cg.autoAngles[2] = 0;
cg.autoAnglesSlow[0] = 0;
cg.autoAnglesSlow[1] = ( cg.time & 4095 ) * 360 / 4096.0f;
cg.autoAnglesSlow[2] = 0;
cg.autoAnglesSlow[0] = 0;
cg.autoAnglesSlow[1] = (cg.time & 4095) * 360 / 4096.0f;
cg.autoAnglesSlow[2] = 0;
cg.autoAnglesFast[0] = 0;
cg.autoAnglesFast[1] = ( cg.time & 1023 ) * 360 / 1024.0f;
cg.autoAnglesFast[2] = 0;
cg.autoAnglesFast[0] = 0;
cg.autoAnglesFast[1] = (cg.time & 1023) * 360 / 1024.0f;
cg.autoAnglesFast[2] = 0;
AnglesToAxis( cg.autoAngles, cg.autoAxis );
AnglesToAxis( cg.autoAnglesSlow, cg.autoAxisSlow );
AnglesToAxis( cg.autoAnglesFast, cg.autoAxisFast );
AnglesToAxis(cg.autoAngles, cg.autoAxis);
AnglesToAxis(cg.autoAnglesSlow, cg.autoAxisSlow);
AnglesToAxis(cg.autoAnglesFast, cg.autoAxisFast);
for (i = 0; i < MAX_ENTITIES; i++) {
processed[i] = qtrue;
@ -636,51 +633,43 @@ void CG_AddPacketEntities( void ) {
// add each entity sent over by the server
for (num = 0; num < cg.snap->numEntities; num++) {
child = cg.snap->entities[num].number;
cent = &cg_entities[child];
cent = &cg_entities[child];
// add the parent first
// so attachments are consistent
for (parent = cent->currentState.parent;
parent != ENTITYNUM_NONE && !processed[parent];
parent = cg_entities[parent].currentState.parent)
{
for (parent = cent->currentState.parent; parent != ENTITYNUM_NONE && !processed[parent];
parent = cg_entities[parent].currentState.parent) {
processed[parent] = qtrue;
CG_AddCEntity(&cg_entities[parent]);
}
if (!processed[child])
{
if (!processed[child]) {
// now add the children if not processed
processed[child] = qtrue;
CG_AddCEntity(cent);
}
}
// Add in the multibeams at the end
for ( num = 0 ; num < cg.snap->numEntities ; num++ ) {
cent = &cg_entities[ cg.snap->entities[ num ].number ];
if ( cent->currentState.eType == ET_MULTIBEAM )
CG_MultiBeam( cent );
}
// Add in the multibeams at the end
for (num = 0; num < cg.snap->numEntities; num++) {
cent = &cg_entities[cg.snap->entities[num].number];
if (cent->currentState.eType == ET_MULTIBEAM) {
CG_MultiBeam(cent);
}
}
}
void CG_GetOrigin(centity_t* cent, vec3_t origin)
void CG_GetOrigin(centity_t *cent, vec3_t origin)
{
if (cent->currentState.parent == ENTITYNUM_NONE)
{
if (cent->currentState.parent == ENTITYNUM_NONE) {
VectorCopy(cent->lerpOrigin, origin);
}
else
{
} else {
int i;
orientation_t or;
refEntity_t* parent;
orientation_t or ;
refEntity_t *parent;
parent = cgi.R_GetRenderEntity(cent->currentState.parent);
if (!parent)
{
cgi.DPrintf("CG_GetOrigin: Could not find parent entity\n");
if (!parent) {
return;
}
@ -689,9 +678,8 @@ void CG_GetOrigin(centity_t* cent, vec3_t origin)
VectorCopy(parent->origin, origin);
for (i = 0; i < 3; i++)
{
VectorMA(origin, or .origin[i], parent->axis[i], origin);
for (i = 0; i < 3; i++) {
VectorMA(origin, or.origin[i], parent->axis[i], origin);
}
}
}

View file

@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
/*
==============
CG_EntityEvent
@ -34,6 +33,4 @@ An entity has an event value
==============
*/
void CG_EntityEvent( centity_t *cent, vec3_t position )
{
}
void CG_EntityEvent(centity_t *cent, vec3_t position) {}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -26,22 +26,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
#include "cg_commands.h"
cvar_t* cg_rain;
cvar_t* cg_rain_drawcoverage;
cvar_t *cg_rain;
cvar_t *cg_rain_drawcoverage;
void RainTouch(ctempmodel_t* ct, trace_t* trace)
void RainTouch(ctempmodel_t *ct, trace_t *trace)
{
Vector norm, neworg;
ct->ent.hModel = cgi.R_RegisterModel("splash_z.spr");
ct->cgd.velocity = vec_zero;
ct->cgd.accel = vec_zero;
ct->killTime = cg.time + 400;
norm = trace->plane.normal;
norm.x = -norm.x;
norm.y = -norm.y;
ct->cgd.angles = norm.toAngles();
ct->ent.scale = 0.3f;
ct->ent.hModel = cgi.R_RegisterModel("splash_z.spr");
ct->cgd.velocity = vec_zero;
ct->cgd.accel = vec_zero;
ct->killTime = cg.time + 400;
norm = trace->plane.normal;
norm.x = -norm.x;
norm.y = -norm.y;
ct->cgd.angles = norm.toAngles();
ct->ent.scale = 0.3f;
ct->cgd.scaleRate = 4.0;
ct->cgd.flags |= T_FADE;
@ -49,25 +49,26 @@ void RainTouch(ctempmodel_t* ct, trace_t* trace)
VectorCopy(neworg, ct->ent.origin);
}
void ClientGameCommandManager::RainTouch(Event* ev)
void ClientGameCommandManager::RainTouch(Event *ev)
{
// FIXME: unimplemented
// Nothing to do
}
void ClientGameCommandManager::InitializeRainCvars()
{
int i;
cg_rain = cgi.Cvar_Get("cg_rain", "0", CVAR_ARCHIVE);
cg_rain_drawcoverage = cgi.Cvar_Get("cg_rain_drawcoverage", "0", CVAR_SAVEGAME | CVAR_SERVER_CREATED | CVAR_SYSTEMINFO);
cg_rain = cgi.Cvar_Get("cg_rain", "1", CVAR_ARCHIVE);
cg_rain_drawcoverage =
cgi.Cvar_Get("cg_rain_drawcoverage", "0", CVAR_SAVEGAME | CVAR_RESETSTRING | CVAR_SYSTEMINFO);
cg.rain.density = 0.0;
cg.rain.speed = 2048.0f;
cg.rain.length = 90.0f;
cg.rain.min_dist = 512.0f;
cg.rain.width = 1.0f;
cg.rain.density = 0.0;
cg.rain.speed = 2048.0f;
cg.rain.length = 90.0f;
cg.rain.min_dist = 512.0f;
cg.rain.width = 1.0f;
cg.rain.speed_vary = 512;
cg.rain.slant = 50;
cg.rain.slant = 50;
for (i = 0; i < MAX_RAIN_SHADERS; i++) {
cg.rain.shader[i][0] = 0;
@ -76,19 +77,19 @@ void ClientGameCommandManager::InitializeRainCvars()
cg.rain.numshaders = 0;
}
void CG_Rain(centity_t* cent)
void CG_Rain(centity_t *cent)
{
int iLife;
vec3_t mins, maxs;
vec3_t vOmins, vOmaxs, vOe;
float fcolor[4];
vec3_t vStart, vEnd;
int iNumSpawn;
int i;
int iRandom;
float fDensity;
vec3_t vLength;
const char* shadername;
int iLife;
vec3_t mins, maxs;
vec3_t vOmins, vOmaxs, vOe;
float fcolor[4];
vec3_t vStart, vEnd;
int iNumSpawn;
int i;
int iRandom;
float fDensity;
vec3_t vLength;
const char *shadername;
fcolor[0] = 1.0;
fcolor[1] = 1.0;
@ -133,35 +134,26 @@ void CG_Rain(centity_t* cent)
return;
}
if (cg_rain_drawcoverage->integer)
{
if (cg_rain_drawcoverage->integer) {
cgi.R_DebugLine(
Vector(vOmins[0], vOmins[1], vOmins[2]),
Vector(vOmaxs[0], vOmins[1], vOmins[2]),
1.0, 0.0, 0.0, 1.0
Vector(vOmins[0], vOmins[1], vOmins[2]), Vector(vOmaxs[0], vOmins[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
);
cgi.R_DebugLine(
Vector(vOmaxs[0], vOmins[1], vOmins[2]),
Vector(vOmaxs[0], vOmaxs[1], vOmins[2]),
1.0, 0.0, 0.0, 1.0
Vector(vOmaxs[0], vOmins[1], vOmins[2]), Vector(vOmaxs[0], vOmaxs[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
);
cgi.R_DebugLine(
Vector(vOmaxs[0], vOmaxs[1], vOmins[2]),
Vector(vOmins[0], vOmaxs[1], vOmins[2]),
1.0, 0.0, 0.0, 1.0
Vector(vOmaxs[0], vOmaxs[1], vOmins[2]), Vector(vOmins[0], vOmaxs[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
);
cgi.R_DebugLine(
Vector(vOmins[0], vOmaxs[1], vOmins[2]),
Vector(vOmins[0], vOmins[1], vOmins[2]),
1.0, 0.0, 0.0, 1.0
Vector(vOmins[0], vOmaxs[1], vOmins[2]), Vector(vOmins[0], vOmins[1], vOmins[2]), 1.0, 0.0, 0.0, 1.0
);
}
VectorSubtract(vOmaxs, vOmins, vOe);
fDensity = cg.rain.density / 200.0;
fDensity = cg.rain.density / 200.0;
iNumSpawn = (int)(sqrt(vOe[0] * vOe[1]) * fDensity);
if (iNumSpawn > MAX_BEAMS) {
iNumSpawn = MAX_BEAMS;
@ -171,21 +163,18 @@ void CG_Rain(centity_t* cent)
if (cg.rain.numshaders) {
shadername = cg.rain.shader[iRandom % cg.rain.numshaders];
}
else {
} else {
shadername = cg.rain.shader[0];
}
for (i = 0; i < iNumSpawn; ++i)
{
iLife = (int)(vOe[2] / ((float)(iRandom % cg.rain.speed_vary) + cg.rain.speed) * 1000.0);
for (i = 0; i < iNumSpawn; ++i) {
iLife = (int)(vOe[2] / ((float)(iRandom % cg.rain.speed_vary) + cg.rain.speed) * 1000.0);
vStart[0] = (float)(iRandom % (int)(vOe[0] + 1.0)) + vOmins[0];
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
iRandom = ((214013 * iRandom + 2531011) >> 16) & 0x7FFF;
vStart[1] = (float)(iRandom % (int)(vOe[1] + 1.0)) + vOmins[1];
vStart[2] = vOmaxs[2];
if (cg.snap)
{
if (cg.snap) {
vLength[0] = cg.snap->ps.origin[0] - vStart[0];
vLength[1] = cg.snap->ps.origin[1] - vStart[1];
vLength[2] = 0.0;

File diff suppressed because it is too large Load diff

View file

@ -29,9 +29,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
extern "C" {
#endif
void CG_AddBulletTracers();
void CG_AddBulletImpacts();
void CG_ParseCGMessage();
void CG_AddBulletTracers();
void CG_AddBulletImpacts();
void CG_InitCGMessageAPI(clientGameExport_t *cge);
#ifdef __cplusplus
}

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// DESCRIPTION:
// Player functions for the cgame
// Player functions for the cgame
#include "cg_local.h"
#include "cg_commands.h"
@ -42,9 +42,9 @@ CG_ResetPlayerEntity
A player just came into view or teleported, so reset all animation info
===============
*/
void CG_ResetPlayerEntity( centity_t *cent )
void CG_ResetPlayerEntity(centity_t *cent)
{
cent->errorTime = -99999; // guarantee no error decay added
cent->errorTime = -99999; // guarantee no error decay added
cent->extrapolated = qfalse;
VectorCopy(cent->currentState.origin, cent->lerpOrigin);
@ -53,8 +53,7 @@ void CG_ResetPlayerEntity( centity_t *cent )
VectorCopy(cent->currentState.angles, cent->lerpAngles);
VectorCopy(cent->lerpAngles, cent->rawAngles);
if (cent->currentState.number == cg.snap->ps.clientNum)
{
if (cent->currentState.number == cg.snap->ps.clientNum) {
// initialize the camera position
VectorCopy(cent->lerpOrigin, cg.currentViewPos);
// initialize the camera angles
@ -70,7 +69,7 @@ void CG_ResetPlayerEntity( centity_t *cent )
CG_Player
===============
*/
void CG_Player( centity_t *cent )
{
//CG_PlayerSplash( cent );
}
void CG_Player(centity_t *cent)
{
//CG_PlayerSplash( cent );
}

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// DESCRIPTION:
//
//
// this file acts on changes in a new playerState_t.
// With normal play, this will be done after local prediction, but when
// following another player or playing back a demo, it will be checked
@ -35,8 +35,4 @@ CG_TransitionPlayerState
===============
*/
void CG_TransitionPlayerState( playerState_t *ps, playerState_t *ops )
{
}
void CG_TransitionPlayerState(playerState_t *ps, playerState_t *ops) {}

View file

@ -25,14 +25,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// interpolating between snapshots from the server or locally predicting
// ahead the client's movement. It also handles local physics interaction,
// like fragments bouncing off walls
//
// ADDITIONS:
// - CG_InterpolatePlayerState() footer: Interpolate the lean angles
#include "cg_local.h"
static pmove_t cg_pmove;
static int cg_numSolidEntities;
static centity_t* cg_solidEntities[MAX_ENTITIES_IN_SNAPSHOT];
static int cg_numTriggerEntities;
static int cg_numSolidEntities;
static centity_t *cg_solidEntities[MAX_ENTITIES_IN_SNAPSHOT];
static int cg_numTriggerEntities;
// static centity_t *cg_triggerEntities[MAX_ENTITIES_IN_SNAPSHOT];
/*
@ -46,12 +50,12 @@ efficient collision detection
*/
void CG_BuildSolidList(void)
{
int i;
centity_t* cent;
snapshot_t* snap;
entityState_t* ent;
int i;
centity_t *cent;
snapshot_t *snap;
entityState_t *ent;
cg_numSolidEntities = 0;
cg_numSolidEntities = 0;
cg_numTriggerEntities = 0;
if (cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport) {
@ -62,10 +66,9 @@ void CG_BuildSolidList(void)
for (i = 0; i < snap->numEntities; i++) {
cent = &cg_entities[snap->entities[i].number];
ent = &cent->currentState;
ent = &cent->currentState;
if (ent->eType == ET_ITEM || ent->eType == ET_PUSH_TRIGGER ||
ent->eType == ET_TELEPORT_TRIGGER) {
if (ent->eType == ET_ITEM || ent->eType == ET_PUSH_TRIGGER || ent->eType == ET_TELEPORT_TRIGGER) {
/*
cg_triggerEntities[cg_numTriggerEntities] = cent;
cg_numTriggerEntities++;
@ -81,29 +84,71 @@ void CG_BuildSolidList(void)
}
}
int CG_GetBrushEntitiesInBounds(int iMaxEnts, centity_t** pEntList, const vec3_t vMins, const vec3_t vMaxs)
{
int i;
int iEntCount;
clipHandle_t cmodel;
vec3_t vEntMins, vEntMaxs;
centity_t* cent;
iEntCount = 0;
for (i = 0; i < cg_numSolidEntities; i++) {
cent = cg_solidEntities[i];
if (cent->currentState.solid != SOLID_BMODEL) {
continue;
}
cmodel = cgi.CM_InlineModel(cent->currentState.modelindex);
cgi.R_GetInlineModelBounds(cmodel, vEntMins, vEntMaxs);
if (cent->lerpAngles[0] || cent->lerpAngles[1] || cent->lerpAngles[2]) {
CalculateRotatedBounds(cent->lerpAngles, vEntMins, vEntMaxs);
}
VectorAdd(vEntMins, cent->lerpOrigin, vEntMins);
VectorAdd(vEntMaxs, cent->lerpOrigin, vEntMaxs);
if (vEntMins[0] <= vMaxs[0] && vEntMaxs[0] >= vMins[0]
&& vEntMins[1] <= vMaxs[1] && vEntMaxs[1] >= vMins[1]
&& vEntMins[2] <= vMaxs[2] && vEntMaxs[2] >= vMins[2]) {
pEntList[iEntCount++] = cent;
if (iEntCount >= iMaxEnts) {
return iEntCount;
}
}
}
return iEntCount;
}
/*
====================
CG_ClipMoveToEntities
====================
*/
void CG_ClipMoveToEntities(const vec3_t start, const vec3_t mins,
const vec3_t maxs, const vec3_t end,
int skipNumber, int mask, trace_t* tr,
qboolean cylinder)
void CG_ClipMoveToEntities(
const vec3_t start,
const vec3_t mins,
const vec3_t maxs,
const vec3_t end,
int skipNumber,
int mask,
trace_t *tr,
qboolean cylinder
)
{
int i;
trace_t trace;
entityState_t* ent;
clipHandle_t cmodel;
vec3_t bmins, bmaxs;
vec3_t origin, angles;
centity_t* cent;
int i;
trace_t trace;
entityState_t *ent;
clipHandle_t cmodel;
vec3_t bmins, bmaxs;
vec3_t origin, angles;
centity_t *cent;
for (i = 0; i < cg_numSolidEntities; i++) {
cent = cg_solidEntities[i];
ent = &cent->currentState;
ent = &cent->currentState;
if (ent->number == skipNumber) {
continue;
@ -117,42 +162,44 @@ void CG_ClipMoveToEntities(const vec3_t start, const vec3_t mins,
}
} else {
IntegerToBoundingBox(ent->solid, bmins, bmaxs);
cmodel = cgi.CM_TempBoxModel(
bmins, bmaxs,
CONTENTS_BBOX);
cmodel = cgi.CM_TempBoxModel(bmins, bmaxs, CONTENTS_BBOX);
}
VectorCopy(cent->lerpOrigin, origin);
if (ent->eFlags & EF_LINKANGLES) {
VectorCopy(cent->lerpAngles, angles);
}
else {
} else {
VectorClear(angles);
}
cgi.CM_TransformedBoxTrace(&trace, start, end, mins, maxs, cmodel, mask,
origin, angles, cylinder);
cgi.CM_TransformedBoxTrace(&trace, start, end, mins, maxs, cmodel, mask, origin, angles, cylinder);
if (trace.allsolid || trace.fraction < tr->fraction) {
trace.entityNum = ent->number;
*tr = trace;
*tr = trace;
} else if (trace.startsolid) {
tr->startsolid = qtrue;
}
}
}
void CG_ShowTrace(trace_t* trace, int passent, const char* reason)
void CG_ShowTrace(trace_t *trace, int passent, const char *reason)
{
char text[1024];
assert(reason);
assert(trace);
sprintf(text, "%0.2f : Pass (%d) Frac %f Hit (%d): '%s'\n",
(float)cg.time / 1000.0f, passent, trace->fraction,
trace->entityNum, reason ? reason : "");
Com_sprintf(
text,
sizeof(text),
"%0.2f : Pass (%d) Frac %f Hit (%d): '%s'\n",
(float)cg.time / 1000.0f,
passent,
trace->fraction,
trace->entityNum,
reason ? reason : ""
);
if (cg_traceinfo->integer == 3) {
cgi.DebugPrintf(text);
@ -166,11 +213,18 @@ void CG_ShowTrace(trace_t* trace, int passent, const char* reason)
CG_Trace
================
*/
void CG_Trace(trace_t* result, const vec3_t start, const vec3_t mins,
const vec3_t maxs, const vec3_t end, int skipNumber, int mask,
qboolean cylinder, qboolean cliptoentities,
const char* description)
void CG_Trace(
trace_t *result,
const vec3_t start,
const vec3_t mins,
const vec3_t maxs,
const vec3_t end,
int skipNumber,
int mask,
qboolean cylinder,
qboolean cliptoentities,
const char *description
)
{
trace_t t;
@ -185,8 +239,7 @@ void CG_Trace(trace_t* result, const vec3_t start, const vec3_t mins,
if (cliptoentities) {
// check all other solid models
CG_ClipMoveToEntities(start, mins, maxs, end, skipNumber, mask, &t,
cylinder);
CG_ClipMoveToEntities(start, mins, maxs, end, skipNumber, mask, &t, cylinder);
}
*result = t;
@ -201,13 +254,19 @@ void CG_Trace(trace_t* result, const vec3_t start, const vec3_t mins,
CG_PlayerTrace
================
*/
void CG_PlayerTrace(trace_t* result, const vec3_t start, const vec3_t mins,
const vec3_t maxs, const vec3_t end, int skipNumber,
int mask, qboolean cylinder, qboolean tracedeep)
void CG_PlayerTrace(
trace_t *result,
const vec3_t start,
const vec3_t mins,
const vec3_t maxs,
const vec3_t end,
int skipNumber,
int mask,
qboolean cylinder,
qboolean tracedeep
)
{
CG_Trace(result, start, mins, maxs, end, skipNumber, mask, cylinder, qtrue,
"PlayerTrace");
CG_Trace(result, start, mins, maxs, end, skipNumber, mask, cylinder, qtrue, "PlayerTrace");
}
/*
@ -217,11 +276,11 @@ CG_PointContents
*/
int CG_PointContents(const vec3_t point, int passEntityNum)
{
int i;
entityState_t* ent;
centity_t* cent;
clipHandle_t cmodel;
int contents;
int i;
entityState_t *ent;
centity_t *cent;
clipHandle_t cmodel;
int contents;
contents = cgi.CM_PointContents(point, 0);
@ -243,8 +302,7 @@ int CG_PointContents(const vec3_t point, int passEntityNum)
continue;
}
contents |= cgi.CM_TransformedPointContents(point, cmodel, ent->origin,
ent->angles);
contents |= cgi.CM_TransformedPointContents(point, cmodel, ent->origin, ent->angles);
}
return contents;
@ -260,8 +318,8 @@ cg.snap->player_state and cg.nextFrame->player_state
*/
static void CG_InterpolatePlayerStateCamera(void)
{
float f;
int i;
float f;
int i;
snapshot_t *prev, *next;
prev = cg.snap;
@ -272,8 +330,18 @@ static void CG_InterpolatePlayerStateCamera(void)
//
VectorCopy(cg.predicted_player_state.camera_angles, cg.camera_angles);
VectorCopy(cg.predicted_player_state.camera_origin, cg.camera_origin);
cg.camera_fov = cg.predicted_player_state.fov;
//
// Added in OPM
// Use the specified fov specified by the server
// when zooming
//
if (cg.predicted_player_state.stats[STAT_INZOOM]) {
cg.camera_fov = cg.predicted_player_state.fov;
} else {
cg.camera_fov = cg_fov->value;
}
// if the next frame is a teleport, we can't lerp to it
if (cg.nextFrameCameraCut) {
return;
@ -283,22 +351,29 @@ static void CG_InterpolatePlayerStateCamera(void)
return;
}
f = (float)(cg.time - prev->serverTime) /
(next->serverTime - prev->serverTime);
f = (float)(cg.time - prev->serverTime) / (next->serverTime - prev->serverTime);
// interpolate fov
cg.camera_fov = prev->ps.fov + f * (next->ps.fov - prev->ps.fov);
if (cg.predicted_player_state.stats[STAT_INZOOM]) {
// interpolate fov
cg.camera_fov = prev->ps.fov + f * (next->ps.fov - prev->ps.fov);
} else {
cg.camera_fov = cg_fov->value;
}
if (!(cg.snap->ps.pm_flags & PMF_CAMERA_VIEW)) {
return;
}
// Added in 2.0
if (cg.predicted_player_state.camera_flags & CF_CAMERA_ANGLES_TURRETMODE) {
VectorCopy(cg.nextSnap->ps.camera_origin, cg.camera_origin);
VectorCopy(cg.nextSnap->ps.camera_angles, cg.camera_angles);
return;
}
for (i = 0; i < 3; i++) {
cg.camera_origin[i] =
prev->ps.camera_origin[i] +
f * (next->ps.camera_origin[i] - prev->ps.camera_origin[i]);
cg.camera_angles[i] =
LerpAngle(prev->ps.camera_angles[i], next->ps.camera_angles[i], f);
cg.camera_origin[i] = prev->ps.camera_origin[i] + f * (next->ps.camera_origin[i] - prev->ps.camera_origin[i]);
cg.camera_angles[i] = LerpAngle(prev->ps.camera_angles[i], next->ps.camera_angles[i], f);
}
}
@ -312,12 +387,12 @@ cg.snap->player_state and cg.nextFrame->player_state
*/
static void CG_InterpolatePlayerState(qboolean grabAngles)
{
float f;
int i;
playerState_t* out;
snapshot_t *prev, *next;
float f;
int i;
playerState_t *out;
snapshot_t *prev, *next;
out = &cg.predicted_player_state;
out = &cg.predicted_player_state;
prev = cg.snap;
next = cg.nextSnap;
@ -329,7 +404,7 @@ static void CG_InterpolatePlayerState(qboolean grabAngles)
// if we are still allowing local input, short circuit the view angles
if (grabAngles) {
usercmd_t cmd;
int cmdNum;
int cmdNum;
cmdNum = cgi.GetCurrentCmdNumber();
cgi.GetUserCmd(cmdNum, &cmd);
@ -349,15 +424,15 @@ static void CG_InterpolatePlayerState(qboolean grabAngles)
f = cg.frameInterpolation;
for (i = 0; i < 3; i++) {
out->origin[i] =
prev->ps.origin[i] + f * (next->ps.origin[i] - prev->ps.origin[i]);
out->origin[i] = prev->ps.origin[i] + f * (next->ps.origin[i] - prev->ps.origin[i]);
if (!grabAngles) {
out->viewangles[i] =
LerpAngle(prev->ps.viewangles[i], next->ps.viewangles[i], f);
out->viewangles[i] = LerpAngle(prev->ps.viewangles[i], next->ps.viewangles[i], f);
}
out->velocity[i] = prev->ps.velocity[i] +
f * (next->ps.velocity[i] - prev->ps.velocity[i]);
out->velocity[i] = prev->ps.velocity[i] + f * (next->ps.velocity[i] - prev->ps.velocity[i]);
}
// interpolate the lean angle
out->fLeanAngle = LerpAngle(prev->ps.fLeanAngle, next->ps.fLeanAngle, f);
}
/*
@ -388,10 +463,10 @@ to ease the jerk.
*/
void CG_PredictPlayerState(void)
{
int cmdNum, current;
int cmdNum, current;
playerState_t oldPlayerState;
qboolean moved;
usercmd_t latestCmd;
qboolean moved;
usercmd_t latestCmd;
cg.hyperspace = qfalse; // will be set if touching a trigger_teleport
@ -399,13 +474,12 @@ void CG_PredictPlayerState(void)
// predicted_player_state is valid even if there is some
// other error condition
if (!cg.validPPS) {
cg.validPPS = qtrue;
cg.validPPS = qtrue;
cg.predicted_player_state = cg.snap->ps;
}
// demo playback just copies the moves
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) ||
(cg.snap->ps.pm_flags & PMF_FROZEN)) {
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) || (cg.snap->ps.pm_flags & PMF_FROZEN)) {
CG_InterpolatePlayerState(qfalse);
return;
}
@ -414,15 +488,14 @@ void CG_PredictPlayerState(void)
// FIXME
// Noclip is jittery for some reason, so I'm disabling prediction while
// noclipping
if (cg_nopredict->integer || cg_synchronousClients->integer ||
(cg.snap->ps.pm_type == PM_NOCLIP)) {
if (cg_nopredict->integer || cg_synchronousClients->integer || (cg.snap->ps.pm_type == PM_NOCLIP)) {
CG_InterpolatePlayerState(qtrue);
return;
}
// prepare for pmove
cg_pmove.ps = &cg.predicted_player_state;
cg_pmove.trace = CG_PlayerTrace;
cg_pmove.ps = &cg.predicted_player_state;
cg_pmove.trace = CG_PlayerTrace;
cg_pmove.pointcontents = CG_PointContents;
if (cg_pmove.ps->pm_type == PM_DEAD) {
@ -432,6 +505,29 @@ void CG_PredictPlayerState(void)
}
cg_pmove.noFootsteps = (cgs.dmflags & DF_NO_FOOTSTEPS) > 0;
if (cg_protocol >= PROTOCOL_MOHTA_MIN) {
// Leaning while moving is allowed in mohta and mohtt only with a specific dm flag bit set
cg_pmove.alwaysAllowLean = (cgs.dmflags & DF_ALLOW_LEAN_MOVEMENT) ? qtrue : qfalse;
cg_pmove.leanMax = 45.f;
cg_pmove.leanAdd = 6.f;
cg_pmove.leanRecoverSpeed = 8.5f;
cg_pmove.leanSpeed = 2.f;
} else {
cg_pmove.alwaysAllowLean = qtrue;
if (cgs.gametype != GT_SINGLE_PLAYER) {
cg_pmove.leanMax = 40.f;
} else {
// Don't allow lean in single-player, like in the original game
cg_pmove.leanMax = 0;
}
cg_pmove.leanAdd = 10.f;
cg_pmove.leanRecoverSpeed = 15.f;
cg_pmove.leanSpeed = 4.f;
}
cg_pmove.protocol = cg_protocol;
// save the state before the pmove so we can detect transitions
oldPlayerState = cg.predicted_player_state;
@ -446,26 +542,28 @@ void CG_PredictPlayerState(void)
// the server time is beyond our current cg.time,
// because predicted player positions are going to
// be ahead of everything else anyway
if (cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport) {
// Added in OPM: prediction check
// Don't use the next snapshot if the prediction is about to be disabled
// this prevent "blinking" issues like when entering a vehicle turret gun
// where arms would be seen shortly
if (cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport && !(cg.nextSnap->ps.pm_flags & PMF_NO_PREDICTION)) {
cg.predicted_player_state = cg.nextSnap->ps;
cg.physicsTime = cg.nextSnap->serverTime;
cg.physicsTime = cg.nextSnap->serverTime;
} else {
cg.predicted_player_state = cg.snap->ps;
cg.physicsTime = cg.snap->serverTime;
cg.physicsTime = cg.snap->serverTime;
}
if (pmove_msec->integer >= 8)
{
if (pmove_msec->integer > 33)
if (pmove_msec->integer >= 8) {
if (pmove_msec->integer > 33) {
cgi.Cvar_Set("pmove_msec", "33");
}
else
{
}
} else {
cgi.Cvar_Set("pmove_msec", "8");
}
cg_pmove.pmove_fixed = pmove_fixed->integer;
cg_pmove.pmove_msec = pmove_msec->integer;
cg_pmove.pmove_msec = pmove_msec->integer;
// run cmds
moved = qfalse;
@ -492,9 +590,7 @@ void CG_PredictPlayerState(void)
// from the snapshot, but on a wan we will have
// to predict several commands to get to the point
// we want to compare
if (cg.predicted_player_state.commandTime ==
oldPlayerState.commandTime) {
if (cg.predicted_player_state.commandTime == oldPlayerState.commandTime) {
if (cg.thisFrameTeleport) {
// a teleport will not cause an error decay
VectorClear(cg.predictedError);
@ -508,13 +604,12 @@ void CG_PredictPlayerState(void)
// if our feet are falling, don't try to move
if (cg_pmove.ps->feetfalling && (cg_pmove.waterlevel < 2)) {
cg_pmove.cmd.forwardmove = 0;
cg_pmove.cmd.rightmove = 0;
cg_pmove.cmd.rightmove = 0;
}
if (cg_pmove.pmove_fixed) {
cg_pmove.cmd.serverTime = pmove_msec->integer
* ((cg_pmove.cmd.serverTime + pmove_msec->integer - 1)
/ pmove_msec->integer);
cg_pmove.cmd.serverTime =
pmove_msec->integer * ((cg_pmove.cmd.serverTime + pmove_msec->integer - 1) / pmove_msec->integer);
}
Pmove(&cg_pmove);
@ -534,8 +629,8 @@ void CG_PredictPlayerState(void)
// Interpolate the player position
if (cg.predicted_player_state.groundEntityNum != ENTITYNUM_WORLD) {
centity_t* cent;
vec3_t offset;
centity_t *cent;
vec3_t offset;
cent = &cg_entities[cg.predicted_player_state.groundEntityNum];
@ -544,9 +639,15 @@ void CG_PredictPlayerState(void)
f = cg.frameInterpolation - 1.0;
offset[0] = (cent->nextState.origin[0] - cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[0]) * f;
offset[1] = (cent->nextState.origin[1] - cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[1]) * f;
offset[2] = (cent->nextState.origin[2] - cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[2]) * f;
offset[0] = (cent->nextState.origin[0]
- cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[0])
* f;
offset[1] = (cent->nextState.origin[1]
- cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[1])
* f;
offset[2] = (cent->nextState.origin[2]
- cg_entities[cg.predicted_player_state.groundEntityNum].currentState.origin[2])
* f;
cg.predicted_player_state.origin[0] += offset[0];
cg.predicted_player_state.origin[1] += offset[1];

View file

@ -23,62 +23,60 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// DESCRIPTION:
// client game public interfaces
#ifndef __CG_PUBLIC_H__
#define __CG_PUBLIC_H__
#pragma once
#include "../renderercommon/tr_types.h"
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
#define MAGIC_UNUSED_NUMBER 7777
#define CMD_BACKUP 128
#define CMD_MASK (CMD_BACKUP - 1)
// allow a lot of command backups for very fast systems
// multiple commands may be combined into a single packet, so this
// needs to be larger than PACKET_BACKUP
#define MAGIC_UNUSED_NUMBER 7777
#define CMD_BACKUP 128
#define CMD_MASK (CMD_BACKUP - 1)
// allow a lot of command backups for very fast systems
// multiple commands may be combined into a single packet, so this
// needs to be larger than PACKET_BACKUP
#define MAX_ENTITIES_IN_SNAPSHOT 1024
#define MAX_ENTITIES_IN_SNAPSHOT 1024
// snapshots are a view of the server at a given time
// snapshots are a view of the server at a given time
// Snapshots are generated at regular time intervals by the server,
// but they may not be sent if a client's rate level is exceeded, or
// they may be dropped by the network.
typedef struct {
int snapFlags; // SNAPFLAG_RATE_DELAYED, etc
int ping;
// Snapshots are generated at regular time intervals by the server,
// but they may not be sent if a client's rate level is exceeded, or
// they may be dropped by the network.
typedef struct {
int snapFlags; // SNAPFLAG_RATE_DELAYED, etc
int ping;
int serverTime; // server time the message is valid for (in msec)
int serverTime; // server time the message is valid for (in msec)
byte areamask[MAX_MAP_AREA_BYTES]; // portalarea visibility bits
byte areamask[MAX_MAP_AREA_BYTES]; // portalarea visibility bits
playerState_t ps; // complete information about the current player at this time
playerState_t ps; // complete information about the current player at this time
int numEntities; // all of the entities that need to be presented
entityState_t entities[MAX_ENTITIES_IN_SNAPSHOT]; // at the time of this snapshot
int numEntities; // all of the entities that need to be presented
entityState_t entities[MAX_ENTITIES_IN_SNAPSHOT]; // at the time of this snapshot
int numServerCommands; // text based server commands to execute when this
int serverCommandSequence; // snapshot becomes current
int numServerCommands; // text based server commands to execute when this
int serverCommandSequence; // snapshot becomes current
int number_of_sounds;
server_sound_t sounds[MAX_SERVER_SOUNDS];
} snapshot_t;
int number_of_sounds;
server_sound_t sounds[ MAX_SERVER_SOUNDS ];
} snapshot_t;
typedef struct stopWatch_s {
int iStartTime;
int iEndTime;
int eType;
} stopWatch_t;
typedef struct stopWatch_s
{
int iStartTime;
int iEndTime;
typedef struct AliasList_s AliasList_t;
typedef struct AliasListNode_s AliasListNode_t;
typedef struct dtiki_s dtiki_t;
typedef struct tiki_cmd_s tiki_cmd_t;
} stopWatch_t;
typedef struct AliasList_s AliasList_t;
typedef struct AliasListNode_s AliasListNode_t;
typedef struct dtiki_s dtiki_t;
typedef struct tiki_cmd_s tiki_cmd_t;
/*
/*
==================================================================
functions imported from the main executable
@ -86,9 +84,9 @@ functions imported from the main executable
==================================================================
*/
#define CGAME_IMPORT_API_VERSION 3
#define CGAME_IMPORT_API_VERSION 3
/*
/*
==================================================================
functions exported to the main executable
@ -96,274 +94,357 @@ functions exported to the main executable
==================================================================
*/
typedef struct
{
int apiversion;
//============== general services ==================
typedef struct {
int apiversion;
// print message on the local console
void (*Printf)( const char *fmt, ...);
void (*DPrintf)( const char *fmt, ...);
void (*DebugPrintf)( const char *fmt, ...);
//============== general services ==================
// managed memory allocation
void *(*Malloc)( int size );
void (*Free)( void *block );
// print message on the local console
void (*Printf)(const char *fmt, ...);
void (*DPrintf)(const char *fmt, ...);
void (*DebugPrintf)(const char *fmt, ...);
// abort the game
void (*Error)( int errorLevel, const char *fmt, ...);
// managed memory allocation
void *(*Malloc)(int size);
void (*Free)(void *block);
// milliseconds should only be used for profiling, never
// for anything game related. Get time from CG_ReadyToBuildScene.
int (*Milliseconds)( void );
// abort the game
void (*Error)(int errorLevel, const char *fmt, ...);
// localization
const char* (*LV_ConvertString)(const char* string);
// milliseconds should only be used for profiling, never
// for anything game related. Get time from CG_ReadyToBuildScene.
int (*Milliseconds)(void);
// console variable interaction
cvar_t * (*Cvar_Get)( const char *var_name, const char *value, int flags );
void (*Cvar_Set)( const char *var_name, const char *value );
// localization
const char *(*LV_ConvertString)(const char *string);
// ClientCommand and ConsoleCommand parameter access
int (*Argc)( void );
char * (*Argv)( int n );
char * (*Args)( void ); // concatenation of all argv >= 1
void (*AddCommand)( const char *cmd );
void (*Cmd_Stuff)(const char* text);
void (*Cmd_Execute)(int execWhen, const char* text);
void (*Cmd_TokenizeString)(const char* textIn);
// console variable interaction
cvar_t *(*Cvar_Get)(const char *var_name, const char *value, int flags);
cvar_t *(*Cvar_Find)(const char *var_name);
void (*Cvar_Set)(const char *var_name, const char *value);
void (*Cvar_CheckRange)(cvar_t* var, float min, float max, qboolean integral);
// a -1 return means the file does not exist
// NULL can be passed for buf to just determine existance
long (*FS_ReadFile)( const char *name, void **buf, qboolean quiet );
void (*FS_FreeFile)( void *buf );
int (*FS_WriteFile)( const char *qpath, const void *buffer, int size );
void (*FS_WriteTextFile)( const char *qpath, const void *buffer, int size );
// add commands to the local console as if they were typed in
// for map changing, etc. The command is not executed immediately,
// but will be executed in order the next time console commands
// are processed
void (*SendConsoleCommand)( const char *text );
// ClientCommand and ConsoleCommand parameter access
int (*Argc)(void);
char *(*Argv)(int n);
char *(*Args)(void); // concatenation of all argv >= 1
void (*AddCommand)(const char *cmd);
void (*Cmd_Stuff)(const char *text);
void (*Cmd_Execute)(int execWhen, const char *text);
void (*Cmd_TokenizeString)(const char *textIn);
// =========== client specific functions ===============
// a -1 return means the file does not exist
// NULL can be passed for buf to just determine existance
long (*FS_ReadFile)(const char *name, void **buf, qboolean quiet);
void (*FS_FreeFile)(void *buf);
int (*FS_WriteFile)(const char *qpath, const void *buffer, int size);
void (*FS_WriteTextFile)(const char *qpath, const void *buffer, int size);
char** (*FS_ListFilteredFiles)(const char* path, const char* extension, const char* filter, qboolean wantSubs, int* numfiles, qboolean allowNonPureFilesOnDisk);
void (*FS_FreeFileList)(char **list);
// add commands to the local console as if they were typed in
// for map changing, etc. The command is not executed immediately,
// but will be executed in order the next time console commands
// are processed
void (*SendConsoleCommand)(const char *text);
// send a string to the server over the network
int (*MSG_ReadBits)(int bits);
int (*MSG_ReadChar)();
int (*MSG_ReadByte)();
int (*MSG_ReadSVC)();
int (*MSG_ReadShort)();
int (*MSG_ReadLong)();
float (*MSG_ReadFloat)();
char* (*MSG_ReadString)();
char* (*MSG_ReadStringLine)();
float (*MSG_ReadAngle8)();
float (*MSG_ReadAngle16)();
void (*MSG_ReadData)(void* data, int len);
float (*MSG_ReadCoord)();
void (*MSG_ReadDir)(vec3_t dir);
void (*SendClientCommand)( const char *s );
// =========== client specific functions ===============
// CM functions
void (*CM_LoadMap)( const char *name );
clipHandle_t (*CM_InlineModel)( int index ); // 0 = world, 1+ = bmodels
int (*CM_NumInlineModels)( void );
int (*CM_PointContents)( const vec3_t p, int headnode );
int (*CM_TransformedPointContents)(const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles);
void (*CM_BoxTrace)( trace_t *results, const vec3_t start, const vec3_t end,
const vec3_t mins, const vec3_t maxs,
int headnode, int brushmask, qboolean cylinder );
void (*CM_TransformedBoxTrace)( trace_t *results, const vec3_t start, const vec3_t end,
const vec3_t mins, const vec3_t maxs,
int headnode, int brushmask,
const vec3_t origin, const vec3_t angles,
qboolean cylinder
);
clipHandle_t (*CM_TempBoxModel)( const vec3_t mins, const vec3_t maxs, int contents );
void (*CM_PrintBSPFileSizes)();
qboolean (*CM_LeafInPVS)(int leaf1, int leaf2);
int (*CM_PointLeafnum)(const vec3_t p);
int (*R_MarkFragments)( int numPoints, const vec3_t *points, const vec3_t projection,
int maxPoints, vec3_t pointBuffer,
int maxFragments, markFragment_t *fragmentBuffer, float fRadiusSquared );
int (*R_MarkFragmentsForInlineModel)(clipHandle_t bmodel, const vec3_t vAngles, const vec3_t vOrigin,
int numPoints, const vec3_t *points, const vec3_t projection,
int maxPoints, vec3_t pointBuffer,
int maxFragments, markFragment_t *fragmentBuffer, float fRadiusSquared );
// send a string to the server over the network
int (*MSG_ReadBits)(int bits);
int (*MSG_ReadChar)();
int (*MSG_ReadByte)();
int (*MSG_ReadSVC)();
int (*MSG_ReadShort)();
int (*MSG_ReadLong)();
float (*MSG_ReadFloat)();
char *(*MSG_ReadString)();
char *(*MSG_ReadStringLine)();
float (*MSG_ReadAngle8)();
float (*MSG_ReadAngle16)();
void (*MSG_ReadData)(void *data, int len);
float (*MSG_ReadCoord)();
void (*MSG_ReadDir)(vec3_t dir);
void (*SendClientCommand)(const char *s);
void (*R_GetInlineModelBounds)(int index, vec3_t mins, vec3_t maxs);
void (*R_GetLightingForDecal)(vec3_t light, vec3_t facing, vec3_t origin);
void (*R_GetLightingForSmoke)(vec3_t light, vec3_t origin);
int (*R_GatherLightSources)(const vec3_t pos, vec3_t* lightPos, vec3_t* lightIntensity, int maxLights);
// CM functions
void (*CM_LoadMap)(const char *name, int* checksum);
clipHandle_t (*CM_InlineModel)(int index); // 0 = world, 1+ = bmodels
int (*CM_NumInlineModels)(void);
int (*CM_PointContents)(const vec3_t p, int headnode);
int (*CM_TransformedPointContents)(
const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles
);
void (*CM_BoxTrace)(
trace_t *results,
const vec3_t start,
const vec3_t end,
const vec3_t mins,
const vec3_t maxs,
int headnode,
int brushmask,
qboolean cylinder
);
void (*CM_TransformedBoxTrace)(
trace_t *results,
const vec3_t start,
const vec3_t end,
const vec3_t mins,
const vec3_t maxs,
int headnode,
int brushmask,
const vec3_t origin,
const vec3_t angles,
qboolean cylinder
);
clipHandle_t (*CM_TempBoxModel)(const vec3_t mins, const vec3_t maxs, int contents);
void (*CM_PrintBSPFileSizes)();
qboolean (*CM_LeafInPVS)(int leaf1, int leaf2);
int (*CM_PointLeafnum)(const vec3_t p);
int (*R_MarkFragments)(
int numPoints,
const vec3_t *points,
const vec3_t projection,
int maxPoints,
vec3_t pointBuffer,
int maxFragments,
markFragment_t *fragmentBuffer,
float fRadiusSquared
);
int (*R_MarkFragmentsForInlineModel)(
clipHandle_t bmodel,
const vec3_t vAngles,
const vec3_t vOrigin,
int numPoints,
const vec3_t *points,
const vec3_t projection,
int maxPoints,
vec3_t pointBuffer,
int maxFragments,
markFragment_t *fragmentBuffer,
float fRadiusSquared
);
// =========== sound function calls ===============
void (*R_GetInlineModelBounds)(int index, vec3_t mins, vec3_t maxs);
void (*R_GetLightingForDecal)(vec3_t light, const vec3_t facing, const vec3_t origin);
void (*R_GetLightingForSmoke)(vec3_t light, const vec3_t origin);
int (*R_GatherLightSources)(const vec3_t pos, vec3_t *lightPos, vec3_t *lightIntensity, int maxLights);
void (*S_StartSound)(const vec3_t origin, int entNum, int entChannel, sfxHandle_t sfxHandle, float volume, float minDist, float pitch, float maxDist, int streamed);
void (*S_StartLocalSound)(const char* soundName, qboolean forceLoad);
void (*S_StopSound)( int entnum, int channel );
void (*S_ClearLoopingSounds)(void);
void (*S_AddLoopingSound)(const vec3_t origin, const vec3_t velocity, sfxHandle_t sfxHandle, float volume, float minDist, float maxDist, float pitch, int flags);
void (*S_Respatialize)( int entityNum, const vec3_t origin, vec3_t axis[3] );
void (*S_BeginRegistration)( void );
sfxHandle_t (*S_RegisterSound)( const char *sample, int streamed );
void (*S_EndRegistration)( void );
void (*S_UpdateEntity)( int entityNum, const vec3_t origin, const vec3_t velocity, qboolean use_listener );
void (*S_SetReverb)( int reverb_type, float reverb_level );
void (*S_SetGlobalAmbientVolumeLevel)( float volume );
float (*S_GetSoundTime)(sfxHandle_t handle);
int (*S_ChannelNameToNum)(const char* name);
const char* (*S_ChannelNumToName)(int channel);
int (*S_IsSoundPlaying)(int channelNumber, const char* name);
// =========== sound function calls ===============
// =========== music function calls ===============
void (*S_StartSound)(
const vec3_t origin,
int entNum,
int entChannel,
sfxHandle_t sfxHandle,
float volume,
float minDist,
float pitch,
float maxDist,
int streamed
);
void (*S_StartLocalSound)(const char *soundName, qboolean forceLoad);
void (*S_StopSound)(int entnum, int channel);
void (*S_ClearLoopingSounds)(void);
void (*S_AddLoopingSound)(
const vec3_t origin,
const vec3_t velocity,
sfxHandle_t sfxHandle,
float volume,
float minDist,
float maxDist,
float pitch,
int flags
);
void (*S_Respatialize)(int entityNum, const vec3_t origin, vec3_t axis[3]);
void (*S_BeginRegistration)(void);
sfxHandle_t (*S_RegisterSound)(const char *sample, int streamed);
void (*S_EndRegistration)(void);
void (*S_UpdateEntity)(int entityNum, const vec3_t origin, const vec3_t velocity, qboolean use_listener);
void (*S_SetReverb)(int reverb_type, float reverb_level);
void (*S_SetGlobalAmbientVolumeLevel)(float volume);
float (*S_GetSoundTime)(sfxHandle_t handle);
int (*S_ChannelNameToNum)(const char *name);
const char *(*S_ChannelNumToName)(int channel);
int (*S_IsSoundPlaying)(int channelNumber, const char *name);
void (*MUSIC_NewSoundtrack)( const char *name );
void (*MUSIC_UpdateMood)( int current_mood, int fallback_mood );
void (*MUSIC_UpdateVolume)( float volume, float fade_time );
// =========== music function calls ===============
// =========== camera function calls ===============
void (*MUSIC_NewSoundtrack)(const char *name);
void (*MUSIC_UpdateMood)(int current_mood, int fallback_mood);
void (*MUSIC_UpdateVolume)(float volume, float fade_time);
float * (*get_camera_offset)( qboolean *lookactive, qboolean *resetview );
// =========== camera function calls ===============
// =========== renderer function calls ================
void (*R_ClearScene)( void );
void (*R_RenderScene)( const refdef_t *fd );
void (*R_LoadWorldMap)(const char* mapname);
void (*R_PrintBSPFileSizes)();
int (*MapVersion)();
int (*R_MapVersion)();
qhandle_t (*R_RegisterModel)( const char *name );
qhandle_t (*R_SpawnEffectModel)(const char* name, vec3_t pos, vec3_t axis[3]);
qhandle_t (*R_RegisterServerModel)(const char* name);
void (*R_UnregisterServerModel)(qhandle_t hModel);
qhandle_t (*R_RegisterSkin)( const char *name );
qhandle_t (*R_RegisterShader)( const char *name );
qhandle_t (*R_RegisterShaderNoMip)( const char *name );
void (*R_AddRefEntityToScene)(const refEntity_t *ent, int parentEntityNumber );
void (*R_AddRefSpriteToScene)(const refEntity_t *ent );
void (*R_AddLightToScene)(const vec3_t origin, float intensity, float r, float g, float b, int type );
qboolean (*R_AddPolyToScene)(qhandle_t hShader, int numVerts, const polyVert_t* verts, int renderfx);
void (*R_AddTerrainMarkToScene)(int terrainIndex, qhandle_t hShader, int numVerts, const polyVert_t* verts, int renderFx);
void (*R_SetColor)( const vec4_t rgba ); // NULL = 1,1,1,1
void (*R_DrawStretchPic) ( float x, float y, float w, float h,
float s1, float t1, float s2, float t2,
qhandle_t hShader ); // 0 = white
fontheader_t* (*R_LoadFont)(const char* name);
void (*R_DrawString)(fontheader_t* font, const char* text, float x, float y, int maxLen, qboolean virtualScreen);
refEntity_t * (*R_GetRenderEntity)( int entityNumber );
void (*R_ModelBounds)( clipHandle_t model, vec3_t mins, vec3_t maxs );
float (*R_ModelRadius)( clipHandle_t model );
float (*R_Noise)( float x, float y, float z, float t );
void (*R_DebugLine)(const vec3_t start, const vec3_t end, float r, float g, float b, float alpha);
baseshader_t* (*GetShader)(int shaderNum);
// =========== Swipes =============
void (*R_SwipeBegin) ( float thistime, float life, qhandle_t shader );
void (*R_SwipePoint) ( vec3_t p1, vec3_t p2, float time );
void (*R_SwipeEnd) ( void );
int (*R_GetShaderWidth)( qhandle_t shader );
int (*R_GetShaderHeight)( qhandle_t shader );
void (*R_DrawBox)( float x, float y, float w, float h );
float *(*get_camera_offset)(qboolean *lookactive, qboolean *resetview);
// =========== data shared with the client =============
void (*GetGameState)( gameState_t *gamestate );
int (*GetSnapshot)( int snapshotNumber, snapshot_t *snapshot );
int (*GetServerStartTime)();
void (*SetTime)(int time);
void (*GetCurrentSnapshotNumber)( int *snapshotNumber, int *serverTime );
void (*GetGlconfig)( glconfig_t *glconfig );
// =========== renderer function calls ================
void (*R_ClearScene)(void);
void (*R_RenderScene)(const refdef_t *fd);
void (*R_LoadWorldMap)(const char *mapname);
void (*R_PrintBSPFileSizes)();
int (*MapVersion)();
int (*R_MapVersion)();
qhandle_t (*R_RegisterModel)(const char *name);
qhandle_t (*R_SpawnEffectModel)(const char *name, vec3_t pos, vec3_t axis[3]);
qhandle_t (*R_RegisterServerModel)(const char *name);
const char * (*R_GetModelName)(qhandle_t hModel);
void (*R_UnregisterServerModel)(qhandle_t hModel);
qhandle_t (*R_RegisterShader)(const char *name);
qhandle_t (*R_RegisterShaderNoMip)(const char *name);
const char* (*R_GetShaderName)(qhandle_t hShader);
void (*R_AddRefEntityToScene)(const refEntity_t *ent, int parentEntityNumber);
void (*R_AddRefSpriteToScene)(const refEntity_t *ent);
void (*R_AddLightToScene)(const vec3_t origin, float intensity, float r, float g, float b, int type);
qboolean (*R_AddPolyToScene)(qhandle_t hShader, int numVerts, const polyVert_t *verts, int renderfx);
void (*R_AddTerrainMarkToScene)(
int terrainIndex, qhandle_t hShader, int numVerts, const polyVert_t *verts, int renderFx
);
void (*R_SetColor)(const vec4_t rgba); // NULL = 1,1,1,1
void (*R_DrawStretchPic)(
float x,
float y,
float w,
float h,
float s1,
float t1,
float s2,
float t2,
qhandle_t hShader
); // 0 = white
fontheader_t *(*R_LoadFont)(const char *name);
void (*R_DrawString)(
fontheader_t *font, const char *text, float x, float y, int maxLen, const float *pvVirtualScreen
);
refEntity_t *(*R_GetRenderEntity)(int entityNumber);
void (*R_ModelBounds)(clipHandle_t model, vec3_t mins, vec3_t maxs);
float (*R_ModelRadius)(clipHandle_t model);
float (*R_Noise)(float x, float y, float z, double t);
void (*R_DebugLine)(const vec3_t start, const vec3_t end, float r, float g, float b, float alpha);
baseshader_t *(*GetShader)(int shaderNum);
// =========== Swipes =============
void (*R_SwipeBegin)(float thistime, float life, qhandle_t shader);
void (*R_SwipePoint)(vec3_t p1, vec3_t p2, float time);
void (*R_SwipeEnd)(void);
int (*R_GetShaderWidth)(qhandle_t shader);
int (*R_GetShaderHeight)(qhandle_t shader);
void (*R_DrawBox)(float x, float y, float w, float h);
// will return false if the number is so old that it doesn't exist in the buffer anymore
qboolean (*GetParseEntityState)( int parseEntityNumber, entityState_t *state );
int (*GetCurrentCmdNumber)( void ); // returns the most recent command number
// which is the local predicted command for
// the following frame
qboolean (*GetUserCmd)( int cmdNumber, usercmd_t *ucmd );
qboolean (*GetServerCommand)(int serverCommandNumber, qboolean differentServer);
// =========== data shared with the client =============
void (*GetGameState)(gameState_t *gamestate);
int (*GetSnapshot)(int snapshotNumber, snapshot_t *snapshot);
int (*GetServerStartTime)();
void (*SetTime)(int time);
void (*GetCurrentSnapshotNumber)(int *snapshotNumber, int *serverTime);
void (*GetGlconfig)(glconfig_t *glconfig);
// ALIAS STUFF
qboolean (*Alias_Add)( const char * alias, const char * name, const char *parameters );
qboolean (*Alias_ListAdd)(AliasList_t* list, const char* alias, const char* name, const char* parameters);
const char* (*Alias_FindRandom)(const char* alias, AliasListNode_t **ret);
const char* (*Alias_ListFindRandom)(AliasList_t* list, const char* alias, AliasListNode_t** ret);
void (*Alias_Dump)( void );
void (*Alias_Clear)( void );
AliasList_t* (*AliasList_New)(const char* name);
void (*Alias_ListFindRandomRange)(AliasList_t* list, const char* alias, int* minIndex, int* maxIndex, float* totalWeight);
AliasList_t* (*Alias_GetGlobalList)();
// will return false if the number is so old that it doesn't exist in the buffer anymore
qboolean (*GetParseEntityState)(int parseEntityNumber, entityState_t *state);
int (*GetCurrentCmdNumber)(void); // returns the most recent command number
// which is the local predicted command for
// the following frame
qboolean (*GetUserCmd)(int cmdNumber, usercmd_t *ucmd);
qboolean (*GetServerCommand)(int serverCommandNumber, qboolean differentServer);
// ==================== UI STUFF ==========================
void (*UI_ShowMenu)(const char* name, qboolean bForce);
void (*UI_HideMenu)(const char* name, qboolean bForce);
int (*UI_FontStringWidth)(fontheader_t* font, const char* string, int maxLen);
// ALIAS STUFF
qboolean (*Alias_Add)(const char *alias, const char *name, const char *parameters);
qboolean (*Alias_ListAdd)(AliasList_t *list, const char *alias, const char *name, const char *parameters);
const char *(*Alias_FindRandom)(const char *alias, AliasListNode_t **ret);
const char *(*Alias_ListFindRandom)(AliasList_t *list, const char *alias, AliasListNode_t **ret);
void (*Alias_Dump)(void);
void (*Alias_Clear)(void);
AliasList_t *(*AliasList_New)(const char *name);
void (*Alias_ListFindRandomRange)(
AliasList_t *list, const char *alias, int *minIndex, int *maxIndex, float *totalWeight
);
AliasList_t *(*Alias_GetGlobalList)();
int (*Key_StringToKeynum)(const char* str);
const char* (*Key_KeynumToBindString)(int keyNum);
void (*Key_GetKeysForCommand)(const char* command, int* key1, int* key2);
// ==================== UI STUFF ==========================
void (*UI_ShowMenu)(const char *name, qboolean bForce);
void (*UI_HideMenu)(const char *name, qboolean bForce);
int (*UI_FontStringWidth)(fontheader_t *font, const char *string, int maxLen);
// Added in 2.0
float (*UI_GetObjectivesTop)(void);
void (*UI_GetHighResolutionScale)(vec2_t scale);
// ==================== TIKI STUFF ==========================
// TIKI SPECIFIC STUFF
dtiki_t* (*R_Model_GetHandle)(qhandle_t handle);
int (*TIKI_NumAnims)(dtiki_t* pmdl);
void (*TIKI_CalculateBounds)(dtiki_t* pmdl, float scale, vec3_t mins, vec3_t maxs);
const char* (*TIKI_Name)(dtiki_t* tiki);
void* (*TIKI_GetSkeletor)(dtiki_t* tiki, int entNum);
void (*TIKI_SetEyeTargetPos)(dtiki_t* tiki, int entNum, vec3_t pos);
int (*Key_StringToKeynum)(const char *str);
const char *(*Key_KeynumToBindString)(int keyNum);
void (*Key_GetKeysForCommand)(const char *command, int *key1, int *key2);
// ANIM SPECIFIC STUFF
const char * (*Anim_NameForNum) (dtiki_t* tiki, int animnum );
int (*Anim_NumForName) (dtiki_t* tiki, const char * name );
int (*Anim_Random) (dtiki_t* tiki, const char * name );
int (*Anim_NumFrames) (dtiki_t* tiki, int animnum );
float (*Anim_Time) (dtiki_t* tiki, int animnum);
float (*Anim_Frametime) (dtiki_t* tiki, int animnum);
void (*Anim_Delta) (dtiki_t* tiki, int animnum, vec3_t delta );
int (*Anim_Flags) (dtiki_t* tiki, int animnum);
int (*Anim_FlagsSkel) (dtiki_t* tiki, int animnum);
float (*Anim_CrossblendTime) (dtiki_t* tiki, int animnum );
qboolean (*Anim_HasCommands) (dtiki_t* tiki, int animnum );
// ==================== TIKI STUFF ==========================
// TIKI SPECIFIC STUFF
dtiki_t *(*R_Model_GetHandle)(qhandle_t handle);
int (*TIKI_NumAnims)(dtiki_t *pmdl);
void (*TIKI_CalculateBounds)(dtiki_t *pmdl, float scale, vec3_t mins, vec3_t maxs);
const char *(*TIKI_Name)(dtiki_t *tiki);
void *(*TIKI_GetSkeletor)(dtiki_t *tiki, int entNum);
void (*TIKI_SetEyeTargetPos)(dtiki_t *tiki, int entNum, vec3_t pos);
// FRAME SPECIFIC STUFF
qboolean (*Frame_Commands) (dtiki_t* tiki, int animnum, int framenum, tiki_cmd_t * tiki_cmd );
qboolean (*Frame_CommandsTime) (dtiki_t* tiki, int animnum, float start, float end, tiki_cmd_t * tiki_cmd );
// ANIM SPECIFIC STUFF
const char *(*Anim_NameForNum)(dtiki_t *tiki, int animnum);
int (*Anim_NumForName)(dtiki_t *tiki, const char *name);
int (*Anim_Random)(dtiki_t *tiki, const char *name);
int (*Anim_NumFrames)(dtiki_t *tiki, int animnum);
float (*Anim_Time)(dtiki_t *tiki, int animnum);
float (*Anim_Frametime)(dtiki_t *tiki, int animnum);
void (*Anim_Delta)(dtiki_t *tiki, int animnum, vec3_t delta);
int (*Anim_Flags)(dtiki_t *tiki, int animnum);
int (*Anim_FlagsSkel)(dtiki_t *tiki, int animnum);
float (*Anim_CrossblendTime)(dtiki_t *tiki, int animnum);
qboolean (*Anim_HasCommands)(dtiki_t *tiki, int animnum);
// SURFACE SPECIFIC STUFF
int (*Surface_NameToNum) (dtiki_t* tiki, const char * name );
//const char * (*Surface_NumToName) (dtiki_t* tiki, int num );
//int (*Surface_Flags) (dtiki_t* tiki, int num );
//int (*Surface_NumSkins) (dtiki_t* tiki, int num );
// FRAME SPECIFIC STUFF
qboolean (*Frame_Commands)(dtiki_t *tiki, int animnum, int framenum, tiki_cmd_t *tiki_cmd);
qboolean (*Frame_CommandsTime)(dtiki_t *tiki, int animnum, float start, float end, tiki_cmd_t *tiki_cmd);
// TAG SPECIFIC STUFF
int (*Tag_NumForName) (dtiki_t* tiki, const char * name );
const char * (*Tag_NameForNum) (dtiki_t* tiki, int num );
void (*ForceUpdatePose)(refEntity_t* model);
orientation_t (*TIKI_Orientation)(refEntity_t* model, int tagNum);
qboolean (*TIKI_IsOnGround)(refEntity_t* model, int tagNum, float threshold);
// SURFACE SPECIFIC STUFF
int (*Surface_NameToNum)(dtiki_t *tiki, const char *name);
//const char * (*Surface_NumToName) (dtiki_t* tiki, int num );
//int (*Surface_Flags) (dtiki_t* tiki, int num );
//int (*Surface_NumSkins) (dtiki_t* tiki, int num );
// MISCELLANEOUS SPECIFIC STUFF
void (*UI_ShowScoreBoard)(const char* menuName);
void (*UI_HideScoreBoard)();
void (*UI_SetScoreBoardItem)(int itemNumber, const char* data1,
const char* data2, const char* data3,
const char* data4, const char* data5,
const char* data6, const char* data7,
const char* data8, const vec4_t textColor,
const vec4_t backColor, qboolean isHeader);
void (*UI_DeleteScoreBoardItems)(int maxIndex);
void (*UI_ToggleDMMessageConsole)(int consoleMode);
dtiki_t* (*TIKI_FindTiki)(const char* path);
void (*LoadResource)(const char* name);
void (*FS_CanonicalFilename)(char* name);
// TAG SPECIFIC STUFF
int (*Tag_NumForName)(dtiki_t *tiki, const char *name);
const char *(*Tag_NameForNum)(dtiki_t *tiki, int num);
void (*ForceUpdatePose)(refEntity_t *model);
orientation_t (*TIKI_Orientation)(refEntity_t *model, int tagNum);
qboolean (*TIKI_IsOnGround)(refEntity_t *model, int tagNum, float threshold);
cvar_t* fsDebug;
hdelement_t* HudDrawElements;
clientAnim_t* anim;
stopWatch_t* stopWatch;
// MISCELLANEOUS SPECIFIC STUFF
void (*UI_ShowScoreBoard)(const char *menuName);
void (*UI_HideScoreBoard)();
void (*UI_SetScoreBoardItem)(
int itemNumber,
const char *data1,
const char *data2,
const char *data3,
const char *data4,
const char *data5,
const char *data6,
const char *data7,
const char *data8,
const vec4_t textColor,
const vec4_t backColor,
qboolean isHeader
);
void (*UI_DeleteScoreBoardItems)(int maxIndex);
void (*UI_ToggleDMMessageConsole)(int consoleMode);
void (*CL_InitRadar)(radarClient_t* radars, qhandle_t* shaders, int clientNum); // Added in 2.0
dtiki_t *(*TIKI_FindTiki)(const char *path);
void (*LoadResource)(const char *name);
void (*FS_CanonicalFilename)(char *name);
void (*CL_RestoreSavedCgameState)();
void (*CL_ClearSavedCgameState)();
} clientGameImport_t;
size_t (*getConfigStringIdNormalized)(size_t num);
cvar_t *fsDebug;
hdelement_t *HudDrawElements;
clientAnim_t *anim;
stopWatch_t *stopWatch;
/*
} clientGameImport_t;
/*
==================================================================
functions exported to the main executable
@ -371,54 +452,84 @@ functions exported to the main executable
==================================================================
*/
typedef struct {
void (*CG_Init)( clientGameImport_t *imported, int serverMessageNum, int serverCommandSequence, int clientNum );
void (*CG_Shutdown)( void );
void (*CG_DrawActiveFrame)( int serverTime, int frameTime, stereoFrame_t stereoView, qboolean demoPlayback );
qboolean (*CG_ConsoleCommand)( void );
void (*CG_GetRendererConfig)( void );
void (*CG_Draw2D)( void );
void (*CG_EyePosition)(vec3_t* eyePos);
void (*CG_EyeOffset)(vec3_t* eyeOffset);
void (*CG_EyeAngles)(vec3_t* eyeAngles);
float (*CG_SensitivityScale)();
void (*CG_ParseCGMessage)();
void (*CG_RefreshHudDrawElements)();
void (*CG_HudDrawShader)(int info);
void (*CG_HudDrawFont)(int info);
int (*CG_GetParent)(int entNum);
float (*CG_GetObjectiveAlpha)();
int (*CG_PermanentMark)(const vec3_t origin, const vec3_t dir, float orientation, float sScale, float tScale, float red, float green, float blue, float alpha, qboolean doLighting, float sCenter, float tCenter, markFragment_t* markFragments, void* polyVerts);
int (*CG_PermanentTreadMarkDecal)(treadMark_t* treadMark, qboolean startSegment, qboolean doLighting, markFragment_t* markFragments, void* polyVerts);
int (*CG_PermanentUpdateTreadMark)(treadMark_t* treadMark, float alpha, float minSegment, float maxSegment, float maxOffset, float texScale);
void (*CG_ProcessInitCommands)(dtiki_t* tiki, refEntity_t* ent);
void (*CG_EndTiki)(dtiki_t* tiki);
const char* (*CG_GetColumnName)(int columnNum, int* columnWidth);
void (*CG_GetScoreBoardColor)(float* red, float* green, float* blue, float* alpha);
void (*CG_GetScoreBoardFontColor)(float* red, float* green, float* blue, float* alpha);
int (*CG_GetScoreBoardDrawHeader)();
void (*CG_GetScoreBoardPosition)(float* x, float* y, float* width, float* height);
int (*CG_WeaponCommandButtonBits)();
int (*CG_CheckCaptureKey)(int key, qboolean down, unsigned int time);
typedef struct {
void (*CG_Init)(clientGameImport_t *imported, int serverMessageNum, int serverCommandSequence, int clientNum);
void (*CG_Shutdown)(void);
void (*CG_DrawActiveFrame)(int serverTime, int frameTime, stereoFrame_t stereoView, qboolean demoPlayback);
qboolean (*CG_ConsoleCommand)(void);
void (*CG_GetRendererConfig)(void);
void (*CG_Draw2D)(void);
void (*CG_EyePosition)(vec3_t *eyePos);
void (*CG_EyeOffset)(vec3_t *eyeOffset);
void (*CG_EyeAngles)(vec3_t *eyeAngles);
float (*CG_SensitivityScale)();
void (*CG_ParseCGMessage)();
void (*CG_RefreshHudDrawElements)();
void (*CG_HudDrawShader)(int info);
void (*CG_HudDrawFont)(int info);
int (*CG_GetParent)(int entNum);
float (*CG_GetObjectiveAlpha)();
int (*CG_PermanentMark)(
vec3_t origin,
vec3_t dir,
float orientation,
float sScale,
float tScale,
float red,
float green,
float blue,
float alpha,
qboolean doLighting,
float sCenter,
float tCenter,
markFragment_t *markFragments,
void *polyVerts
);
int (*CG_PermanentTreadMarkDecal)(
treadMark_t *treadMark,
qboolean startSegment,
qboolean doLighting,
markFragment_t *markFragments,
void *polyVerts
);
int (*CG_PermanentUpdateTreadMark)(
treadMark_t *treadMark, float alpha, float minSegment, float maxSegment, float maxOffset, float texScale
);
void (*CG_ProcessInitCommands)(dtiki_t *tiki, refEntity_t *ent);
void (*CG_EndTiki)(dtiki_t *tiki);
const char *(*CG_GetColumnName)(int columnNum, int *columnWidth);
void (*CG_GetScoreBoardColor)(float *red, float *green, float *blue, float *alpha);
void (*CG_GetScoreBoardFontColor)(float *red, float *green, float *blue, float *alpha);
int (*CG_GetScoreBoardDrawHeader)();
void (*CG_GetScoreBoardPosition)(float *x, float *y, float *width, float *height);
int (*CG_WeaponCommandButtonBits)();
int (*CG_CheckCaptureKey)(int key, qboolean down, unsigned int time);
// FIXME
//prof_cgame_t* profStruct;
//
// Added in 2.0
//
void (*CG_ReadNonPVSClient)(radarUnpacked_t* radarUnpacked);
void (*CG_UpdateRadar)();
size_t (*CG_SaveStateToBuffer)(void** out, int svsTime);
qboolean (*CG_LoadStateToBuffer)(void* state, size_t size, int svsTime);
void (*CG_CleanUpTempModels)();
qboolean (*CG_Command_ProcessFile)(const char* name, qboolean quiet, dtiki_t* curTiki);
// FIXME
//prof_cgame_t* profStruct;
} clientGameExport_t;
qboolean (*CG_Command_ProcessFile)(const char *name, qboolean quiet, dtiki_t *curTiki);
} clientGameExport_t;
#ifdef CGAME_DLL
#ifdef WIN32
__declspec(dllexport)
#else
__attribute__((visibility("default")))
# ifdef WIN32
__declspec(dllexport)
# else
__attribute__((visibility("default")))
# endif
#endif
#endif
clientGameExport_t* GetCGameAPI(void);
clientGameExport_t *GetCGameAPI(void);
#ifdef __cplusplus
}
#endif
#endif // __CG_PUBLIC_H__

168
code/cgame/cg_radar.cpp Normal file
View file

@ -0,0 +1,168 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "cg_local.h"
#include "cg_radar.h"
void CG_InitRadar()
{
int i;
cg.radarShaders[0] = cgi.R_RegisterShader("textures/hud/radar_allies.tga");
cg.radarShaders[1] = cgi.R_RegisterShader("textures/hud/radar_axis.tga");
for (i = 0; i < MAX_CLIENTS; i++)
{
cg.radars[i].time = 0;
cg.radars[i].lastSpeakTime = 0;
}
cgi.CL_InitRadar(cg.radars, cg.radarShaders, cg.snap->ps.clientNum);
}
bool CG_InTeamGame(centity_t *ent)
{
return ent->currentState.solid && cg.clientinfo[ent->currentState.number].team;
}
bool CG_SameTeam(centity_t *ent)
{
return cg.clientinfo[ent->currentState.number].team == cg.clientinfo[cg.snap->ps.clientNum].team;
}
bool CG_IsTeamGame()
{
return cgs.gametype >= GT_TEAM;
}
bool CG_ValidRadarClient(centity_t *ent)
{
if (!cg.snap) {
return qfalse;
}
if (!CG_IsTeamGame()) {
return false;
}
if (!CG_InTeamGame(&cg_entities[cg.snap->ps.clientNum])) {
return false;
}
if (!CG_InTeamGame(ent)) {
return false;
}
return CG_SameTeam(ent);
}
int CG_RadarIcon()
{
switch (cg.clientinfo[cg.snap->ps.clientNum].team)
{
case TEAM_ALLIES:
return 0;
default:
case TEAM_AXIS:
return 1;
}
}
void CG_UpdateRadarClient(centity_t* ent)
{
radarClient_t* radar;
radar = &cg.radars[ent->currentState.number];
if (!CG_ValidRadarClient(ent)) {
radar->time = 0;
return;
}
radar->time = cg.time;
radar->teamShader = CG_RadarIcon();
if (cg.snap->ps.clientNum == ent->currentState.number)
{
radar->origin[0] = cg.refdef.vieworg[0];
radar->origin[1] = cg.refdef.vieworg[1];
radar->axis[0] = cg.refdef.viewaxis[0][0];
radar->axis[1] = cg.refdef.viewaxis[0][1];
VectorNormalize2D(radar->axis);
}
else
{
float axis[2];
radar->origin[0] = ent->currentState.origin[0];
radar->origin[1] = ent->currentState.origin[1];
YawToAxis(ent->currentState.angles[1], axis);
radar->axis[0] = axis[0];
radar->axis[1] = axis[1];
VectorNormalize2D(radar->axis);
}
}
void CG_ReadNonPVSClient(radarUnpacked_t* radarUnpacked)
{
radarClient_t* radar;
float axis[2];
if (!CG_ValidRadarClient(&cg_entities[radarUnpacked->clientNum])) {
return;
}
radar = &cg.radars[radarUnpacked->clientNum];
radar->time = cg.time;
radar->teamShader = CG_RadarIcon();
// copy origin
radar->origin[0] = radarUnpacked->x;
radar->origin[1] = radarUnpacked->y;
// copy yaw
YawToAxis(radarUnpacked->yaw, axis);
radar->axis[0] = axis[0];
radar->axis[1] = axis[1];
VectorNormalize2D(radar->axis);
}
void CG_UpdateRadar()
{
int i;
for (i = 0; i < MAX_CLIENTS; i++)
{
if (cg.radars[i].time)
{
if (!CG_ValidRadarClient(&cg_entities[i])) {
cg.radars[i].time = 0;
}
}
}
}
void CG_RadarClientSpeaks(int num)
{
if (!CG_ValidRadarClient(&cg_entities[num])) {
return;
}
cg.radars[num].lastSpeakTime = cg.time;
}

42
code/cgame/cg_radar.h Normal file
View file

@ -0,0 +1,42 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// DESCRIPTION:
// Radar client
#pragma once
#include "cg_local.h"
#ifdef __cplusplus
extern "C" {
#endif
void CG_InitRadar();
void CG_UpdateRadarClient(centity_t* ent);
void CG_ReadNonPVSClient(radarUnpacked_t* radarUnpacked);
void CG_UpdateRadar();
void CG_RadarClientSpeaks(int num);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
Copyright (C) 2008-2024 the OpenMoHAA team
Copyright (C) 1999-2005 Id Software, Inc.
This file is part of OpenMoHAA source code.
@ -24,12 +25,30 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// cg_servercmds.c -- text commands sent by the server
#include "cg_local.h"
#include "../fgame/bg_voteoptions.h"
#include "cg_servercmds_filter.h"
static const char* IsWeaponAllowed(int dmFlags, int flags) {
/*
================
IsWeaponAllowed
Returns true if the weapon is allowed
================
*/
static const char *IsWeaponAllowed(int dmFlags, int flags)
{
return (dmFlags & flags) ? "0" : "1";
}
static qboolean QueryLandminesAllowed2(const char* mapname, int dmflags) {
/*
================
QueryLandminesAllowed2
Returns true if landmines is allowed by the map or by a dm flag
================
*/
static qboolean QueryLandminesAllowed2(const char *mapname, int dmflags)
{
if (dmflags & DF_WEAPON_NO_LANDMINE) {
return qfalse;
}
@ -38,43 +57,61 @@ static qboolean QueryLandminesAllowed2(const char* mapname, int dmflags) {
return qtrue;
}
if (!Q_stricmpn(mapname, "obj/obj_", 8u))
return qfalse;
if (!Q_stricmpn(mapname, "dm/mohdm", 8u))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Bahnhof_DM"))
return qfalse;
if (!Q_stricmp(mapname, "obj/MP_Ardennes_TOW"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Bazaar_DM"))
return qfalse;
if (!Q_stricmp(mapname, "obj/MP_Berlin_TOW"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Brest_DM"))
return qfalse;
if (!Q_stricmp(mapname, "obj/MP_Druckkammern_TOW"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Gewitter_DM"))
return qfalse;
if (!Q_stricmp(mapname, "obj/MP_Flughafen_TOW"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Holland_DM"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Malta_DM"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Stadt_DM"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Unterseite_DM"))
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM"))
if (!Q_stricmpn(mapname, "obj/obj_", 8u)) {
return qfalse;
if (!Q_stricmp(mapname, "lib/mp_ship_lib"))
}
if (!Q_stricmpn(mapname, "dm/mohdm", 8u)) {
return qfalse;
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM"))
}
if (!Q_stricmp(mapname, "DM/MP_Bahnhof_DM")) {
return qfalse;
if (!Q_stricmp(mapname, "lib/mp_ship_lib"))
}
if (!Q_stricmp(mapname, "obj/MP_Ardennes_TOW")) {
return qfalse;
return qtrue;
}
if (!Q_stricmp(mapname, "DM/MP_Bazaar_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "obj/MP_Berlin_TOW")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Brest_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "obj/MP_Druckkammern_TOW")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Gewitter_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "obj/MP_Flughafen_TOW")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Holland_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Malta_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Stadt_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Unterseite_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "lib/mp_ship_lib")) {
return qfalse;
}
if (!Q_stricmp(mapname, "DM/MP_Verschneit_DM")) {
return qfalse;
}
if (!Q_stricmp(mapname, "lib/mp_ship_lib")) {
return qfalse;
}
return qtrue;
}
/*
@ -87,40 +124,53 @@ and whenever the server updates any serverinfo flagged cvars
*/
void CG_ParseServerinfo(void)
{
const char* info;
const char* mapname;
char map[MAX_QPATH];
char* spawnpos;
const char* version;
const char *info;
const char *mapname;
char map[MAX_QPATH];
char *spawnpos;
const char *version;
const char *mapChecksumStr;
info = CG_ConfigString(CS_SERVERINFO);
cgs.gametype = atoi(Info_ValueForKey(info, "g_gametype"));
cgs.dmflags = atoi(Info_ValueForKey(info, "dmflags"));
cgs.teamflags = atoi(Info_ValueForKey(info, "teamflags"));
cgs.fraglimit = atoi(Info_ValueForKey(info, "fraglimit"));
cgs.timelimit = atoi(Info_ValueForKey(info, "timelimit"));
info = CG_ConfigString(CS_SERVERINFO);
cgs.gametype = atoi(Info_ValueForKey(info, "g_gametype"));
cgs.dmflags = atoi(Info_ValueForKey(info, "dmflags"));
cgs.teamflags = atoi(Info_ValueForKey(info, "teamflags"));
cgs.fraglimit = atoi(Info_ValueForKey(info, "fraglimit"));
cgs.timelimit = atoi(Info_ValueForKey(info, "timelimit"));
cgs.maxclients = atoi(Info_ValueForKey(info, "sv_maxclients"));
version = Info_ValueForKey(info, "version");
if (strstr(version, "Spearhead")) {
cgi.Cvar_Set("g_servertype", "1");
} else {
cgi.Cvar_Set("g_servertype", "2");
cgi.Cvar_Set("g_servertype", "2");
}
cgi.Cvar_Set("cg_gametype", Info_ValueForKey(info, "g_gametype"));
cgi.Cvar_Set("cg_fraglimit", Info_ValueForKey(info, "fraglimit"));
cgi.Cvar_Set("cg_timelimit", Info_ValueForKey(info, "timelimit"));
cgi.Cvar_Set("cg_maxclients", Info_ValueForKey(info, "sv_gametype"));
cgi.Cvar_Set("cg_allowvote", Info_ValueForKey(info, "g_allowvote"));
cgi.Cvar_Set("cg_obj_alliedtext1", Info_ValueForKey(info, "g_obj_alliedtext1"));
cgi.Cvar_Set("cg_obj_alliedtext2", Info_ValueForKey(info, "g_obj_alliedtext2"));
cgi.Cvar_Set("cg_obj_alliedtext3", Info_ValueForKey(info, "g_obj_alliedtext3"));
cgi.Cvar_Set("cg_obj_axistext1", Info_ValueForKey(info, "cg_obj_axistext1"));
cgi.Cvar_Set("cg_obj_axistext2", Info_ValueForKey(info, "cg_obj_axistext2"));
cgi.Cvar_Set("cg_obj_axistext3", Info_ValueForKey(info, "cg_obj_axistext3"));
cgi.Cvar_Set("cg_obj_alliedtext4", Info_ValueForKey(info, "g_obj_alliedtext4"));
cgi.Cvar_Set("cg_obj_alliedtext5", Info_ValueForKey(info, "g_obj_alliedtext5"));
cgi.Cvar_Set("cg_obj_axistext1", Info_ValueForKey(info, "g_obj_axistext1"));
cgi.Cvar_Set("cg_obj_axistext2", Info_ValueForKey(info, "g_obj_axistext2"));
cgi.Cvar_Set("cg_obj_axistext3", Info_ValueForKey(info, "g_obj_axistext3"));
cgi.Cvar_Set("cg_obj_axistext4", Info_ValueForKey(info, "g_obj_axistext4"));
cgi.Cvar_Set("cg_obj_axistext5", Info_ValueForKey(info, "g_obj_axistext5"));
cgi.Cvar_Set("cg_scoreboardpic", Info_ValueForKey(info, "g_scoreboardpic"));
cgi.Cvar_Set("cg_scoreboardpicover", Info_ValueForKey(info, "g_scoreboardpicover"));
cgs.mapChecksum = atoi(Info_ValueForKey(info, "sv_mapChecksum"));
mapChecksumStr = Info_ValueForKey(info, "sv_mapChecksum");
if (mapChecksumStr && mapChecksumStr[0]) {
cgs.mapChecksum = atoi(mapChecksumStr);
cgs.useMapChecksum = qtrue;
} else {
cgs.mapChecksum = 0;
cgs.useMapChecksum = qfalse;
}
mapname = Info_ValueForKey(info, "mapname");
@ -136,28 +186,26 @@ void CG_ParseServerinfo(void)
if (spawnpos) {
Q_strncpyz(map, mapname, spawnpos - mapname + 1);
} else {
strcpy(map, mapname);
Q_strncpyz(map, mapname, sizeof(map));
}
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s.bsp", map);
if (CG_UseLargeLightmaps(mapname)) {
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s.bsp", map);
} else {
Com_sprintf(cgs.mapname, sizeof(cgs.mapname), "maps/%s_sml.bsp", map);
}
// hide/show huds
if (cgs.gametype)
{
if (cgs.gametype) {
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_timelimit\n");
if (cgs.fraglimit)
{
if (cgs.fraglimit) {
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_fraglimit\n");
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_score\n");
}
else
{
} else {
cgi.Cmd_Execute(EXEC_NOW, "ui_addhud hud_score\n");
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_fraglimit\n");
}
}
else
{
} else {
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_timelimit\n");
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_fraglimit\n");
cgi.Cmd_Execute(EXEC_NOW, "ui_removehud hud_score\n");
@ -170,17 +218,13 @@ CG_ConfigStringModified
================
*/
static void CG_ConfigStringModified(void)
static void CG_ConfigStringModified(int num, qboolean modelOnly)
{
int num;
num = atoi(cgi.Argv(1));
// get the gamestate from the client system, which will have the
// new configstring already integrated
cgi.GetGameState(&cgs.gameState);
CG_ProcessConfigString(num);
CG_ProcessConfigString(num, modelOnly);
}
/*
@ -219,32 +263,29 @@ CG_Stopwatch_f
================
*/
#if TARGET_GAME_PROTOCOL >= 15
static void CG_Stopwatch_f()
{
if (cgi.Argc() < 3) {
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
}
if (cgi.Argc() < 3) {
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
}
cgi.stopWatch->iStartTime = atoi(cgi.Argv(1));
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
if (cg_protocol >= PROTOCOL_MOHTA_MIN) {
cgi.stopWatch->iStartTime = atoi(cgi.Argv(1));
if (cgi.Argc() > 3) {
cgi.stopWatch->eType = atoi(cgi.Argv(3));
} else {
// Normal stop watch
cgi.stopWatch->eType = SWT_NORMAL;
}
} else {
// The base game has it wrong
cgi.stopWatch->iStartTime = 1000 * atoi(cgi.Argv(1));
}
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
}
#else
static void CG_Stopwatch_f()
{
if (cgi.Argc() < 3) {
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
}
cgi.stopWatch->iStartTime = 1000 * atoi(cgi.Argv(1));
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
}
#endif
/*
================
CG_ServerLag_f
@ -264,9 +305,9 @@ The string has been tokenized and can be retrieved with
Cmd_Argc() / Cmd_Argv()
=================
*/
static void CG_ServerCommand(void)
static void CG_ServerCommand(qboolean modelOnly)
{
const char* cmd;
const char *cmd;
cmd = cgi.Argv(0);
@ -276,7 +317,11 @@ static void CG_ServerCommand(void)
}
if (!strcmp(cmd, "cs")) {
CG_ConfigStringModified();
CG_ConfigStringModified(cgi.getConfigStringIdNormalized(atoi(cgi.Argv(1))), modelOnly);
return;
}
if (modelOnly) {
return;
}
@ -286,54 +331,56 @@ static void CG_ServerCommand(void)
CG_HudPrint_f();
}
return;
}
else if (!strcmp(cmd, "printdeathmsg")) {
const char* s1, * s2, * s3, * s4, * s5;
const char* result1, * result2;
int hudColor;
} else if (!strcmp(cmd, "printdeathmsg")) {
const char *s1, *s2, *attackerName, *victimName, *type;
const char *result1, *result2;
int hudColor;
result1 = NULL;
result2 = NULL;
s1 = cgi.Argv(1);
s2 = cgi.Argv(2);
s3 = cgi.Argv(3);
s4 = cgi.Argv(4);
s5 = cgi.Argv(5);
result1 = NULL;
result2 = NULL;
s1 = cgi.Argv(1);
s2 = cgi.Argv(2);
attackerName = cgi.Argv(3);
victimName = cgi.Argv(4);
type = cgi.Argv(5);
if (*s5 == tolower(*s5)) {
if (*type == tolower(*type)) {
hudColor = 4;
} else {
hudColor = 5;
hudColor = 5;
}
if (*s1 != 'x')
result1 = cgi.LV_ConvertString(s1);
if (*s2 != 'x')
result2 = cgi.LV_ConvertString(s2);
if (tolower(*s5) == 's')
{
cgi.Printf("%c%s %s\n", hudColor, s4, result1);
}
else if (tolower(*s5) == 'p')
{
if (*s2 == 'x')
cgi.Printf("%c%s %s %s\n", hudColor, s4, result1, s3);
else
cgi.Printf("%c%s %s %s%s\n", hudColor, s4, result1, s3, result2);
}
else if (tolower(*s5) == 'w')
{
cgi.Printf("%c%s %s\n", hudColor, s4, result1);
}
else
{
cgi.Printf("%s", cgi.Argv(1));
}
if (*s1 != 'x') {
result1 = cgi.LV_ConvertString(s1);
}
if (*s2 != 'x') {
result2 = cgi.LV_ConvertString(s2);
}
if (tolower(*type) == 's') {
cgi.Printf("%c%s %s\n", hudColor, victimName, result1);
} else if (tolower(*type) == 'p') {
if (*s2 == 'x') {
cgi.Printf("%c%s %s %s\n", hudColor, victimName, result1, attackerName);
} else {
cgi.Printf("%c%s %s %s%s\n", hudColor, victimName, result1, attackerName, result2);
}
} else if (tolower(*type) == 'w') {
cgi.Printf("%c%s %s\n", hudColor, victimName, result1);
} else {
cgi.Printf("%s", cgi.Argv(1));
}
return;
}
if (!strcmp(cmd, "stufftext")) {
cgi.Cmd_Stuff(cgi.Argv(1));
char *cmd = cgi.Argv(1);
if (CG_IsStatementFiltered(cmd)) {
// Added in OPM
// Don't execute filtered commands
return;
}
cgi.Cmd_Stuff(cmd);
cgi.Cmd_Stuff("\n");
return;
}
@ -358,6 +405,28 @@ static void CG_ServerCommand(void)
return;
}
if (!strcmp(cmd, "voteresult")) {
cmd = cgi.Argv(1);
if (*cmd) {
strcmp(cmd, "passed");
}
}
if (!strcmp(cmd, "vo0")) {
CG_VoteOptions_StartReadFromServer(cgi.Argv(1));
return;
}
if (!strcmp(cmd, "vo1")) {
CG_VoteOptions_ContinueReadFromServer(cgi.Argv(1));
return;
}
if (!strcmp(cmd, "vo2")) {
CG_VoteOptions_FinishReadFromServer(cgi.Argv(1));
return;
}
cgi.Printf("Unknown client game command: %s\n", cmd);
}
@ -371,9 +440,20 @@ with this this snapshot.
*/
void CG_ExecuteNewServerCommands(int latestSequence, qboolean differentServer)
{
int lastServerCommandSequence;
lastServerCommandSequence = cgs.serverCommandSequence;
while (cgs.serverCommandSequence < latestSequence) {
if (cgi.GetServerCommand(++cgs.serverCommandSequence, differentServer)) {
CG_ServerCommand();
CG_ServerCommand(qtrue);
}
}
cgs.serverCommandSequence = lastServerCommandSequence;
while (cgs.serverCommandSequence < latestSequence) {
if (cgi.GetServerCommand(++cgs.serverCommandSequence, differentServer)) {
CG_ServerCommand(qfalse);
}
}
}

View file

@ -0,0 +1,292 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// DESCRIPTION:
// cg_servercmds_filter.c -- filtered server commands
#include "cg_local.h"
#include "cg_servercmds_filter.h"
//
// List of variables allowed to be changed by the server
//
static const char *whiteListedVariables[] = {
// some mods set this variable to make the sky uniform
"r_fastsky",
"ui_hud",
"subtitle0",
"subtitle1",
"subtitle2",
"subtitle3",
"name",
// for 3rd person server
"cg_3rd_person",
"cg_cameraverticaldisplacement"
};
//
// List of variables allowed to be changed by the server
//
static const char *whiteListedLocalServerVariables[] = {"ui_hidemouse", "ui_showmouse", "cg_marks_add"};
//
// List of commands allowed to be executed by the server
//
static const char *whiteListedCommands[] = {
//
// HUD
//==========
"pushmenu",
"pushmenu_teamselect",
"pushmenu_weaponselect",
"popmenu",
"globalwidgetcommand", // used for mods adding custom HUDs
"ui_addhud",
"ui_removehud",
"echo", // to print stuff client-side
//
// Sounds
//==========
"tmstart",
"tmstartloop",
"tmstop",
"tmvolume",
"play",
"playmp3",
"stopmp3",
//
// Misc
//==========
"primarydmweapon",
"wait",
"+moveup", // workaround for mods that want to prevent inactivity when handling the spectate
"-moveup",
"screenshot",
"screenshotJPEG",
"levelshot",
"`stufftext" // Stufftext detection from Reborn, the player gets kicked without it
};
//
// List of commands allowed to be executed locally
// (when the client also runs the server)
//
static const char *whiteListedLocalServerCommands[] = {
// Used by briefings
"spmap",
"map",
"disconnect",
"cinematic",
"showmenu",
"hidemenu"
};
/*
====================
CG_IsVariableFiltered
Returns whether or not the variable should be filtered
====================
*/
static qboolean CG_IsVariableFiltered(const char *name)
{
size_t i;
for (i = 0; i < ARRAY_LEN(whiteListedVariables); i++) {
if (!Q_stricmp(name, whiteListedVariables[i])) {
return qfalse;
}
}
if (cgs.localServer) {
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerVariables); i++) {
if (!Q_stricmp(name, whiteListedLocalServerVariables[i])) {
return qfalse;
}
}
}
// Filtered
return qtrue;
}
/*
====================
CG_IsSetVariableFiltered
Returns whether or not the variable should be filtered
====================
*/
static qboolean CG_IsSetVariableFiltered(const char *name, char type)
{
cvar_t *var;
if (!CG_IsVariableFiltered(name)) {
return qfalse;
}
if (type != 'u' && type != 's') {
// Don't allow custom info variables to avoid flooding
// the client with many serverinfo and userinfo variables
var = cgi.Cvar_Find(name);
if (!var) {
// Allow as it doesn't exist
return qfalse;
}
if (var->flags & CVAR_USER_CREATED) {
// Allow, it's user-created, wouldn't cause issues
return qfalse;
}
}
// Filtered
return qtrue;
}
/*
====================
CG_IsCommandFiltered
Returns whether or not the variable should be filtered
====================
*/
static qboolean CG_IsCommandFiltered(const char *name)
{
size_t i;
for (i = 0; i < ARRAY_LEN(whiteListedCommands); i++) {
if (!Q_stricmp(name, whiteListedCommands[i])) {
return qfalse;
}
}
if (cgs.localServer) {
// Allow more commands when the client is hosting the server
// Mostly used on single-player mode, like when briefings switch to the next map
for (i = 0; i < ARRAY_LEN(whiteListedLocalServerCommands); i++) {
if (!Q_stricmp(name, whiteListedLocalServerCommands[i])) {
return qfalse;
}
}
}
//
// Test variables
//
return CG_IsVariableFiltered(name);
}
/*
====================
RemoveEndToken
====================
*/
static qboolean RemoveEndToken(char* com_token) {
char* p;
for (p = com_token; p[0]; p++) {
if (*p == ';') {
*p = 0;
return qtrue;
}
}
return qfalse;
}
/*
====================
CG_IsStatementFiltered
Returns whether or not the statement is filtered
====================
*/
qboolean CG_IsStatementFiltered(char *cmd)
{
char* parsed;
char com_token[256];
qboolean bNextStatement = qfalse;
parsed = cmd;
for (Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token)); com_token[0]; Q_strncpyz(com_token, COM_ParseExt(&parsed, qtrue), sizeof(com_token))) {
bNextStatement = RemoveEndToken(com_token);
if (com_token[0] == ';') {
continue;
}
if (!Q_stricmp(com_token, "set") || !Q_stricmp(com_token, "setu") || !Q_stricmp(com_token, "seta")
|| !Q_stricmp(com_token, "sets") || !Q_stricmp(com_token, "append")) {
char type;
if (Q_stricmp(com_token, "append")) {
type = com_token[3];
} else {
type = 0;
}
//
// variable
//
Q_strncpyz(com_token, COM_ParseExt(&parsed, qfalse), sizeof(com_token));
bNextStatement |= RemoveEndToken(com_token);
if (com_token[0] == ';') {
continue;
}
if (CG_IsSetVariableFiltered(com_token, type)) {
return qtrue;
}
} else {
//
// normal command
//
if (CG_IsCommandFiltered(com_token)) {
return qtrue;
}
}
if (!bNextStatement) {
// Skip up to the next statement
while (parsed && parsed[0]) {
char c = parsed[0];
parsed++;
if (c == '\n' || c == ';') {
break;
}
}
}
}
return qfalse;
}

View file

@ -0,0 +1,30 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// DESCRIPTION:
// cg_servercmds_filter.h -- filtered server commands
#pragma once
#include "cg_local.h"
qboolean CG_IsStatementFiltered(char *cmd);

View file

@ -23,8 +23,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// DESCRIPTION:
// things that happen on snapshot transition, not necessarily every
// single frame
//
// ADDITIONS:
// - CG_TransitionSnapshot() footer: set ps.walking to true if the ps has a ground entity
#include "cg_local.h"
#include "cg_radar.h"
#include "tiki.h"
/*
@ -32,10 +36,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
CG_ResetEntity
==================
*/
static void CG_ResetEntity(centity_t* cent)
static void CG_ResetEntity(centity_t *cent)
{
dtiki_t* tiki;
int i;
dtiki_t *tiki;
int i;
VectorCopy(cent->currentState.origin, cent->lerpOrigin);
@ -62,17 +66,17 @@ static void CG_ResetEntity(centity_t* cent)
// Reset splash info
cent->splash_last_spawn_time = 0;
cent->splash_still_count = -1;
cent->splash_still_count = -1;
tiki = cgi.R_Model_GetHandle(cgs.model_draw[cent->currentState.modelindex]);
// reset client command
CG_RemoveClientEntity(cent->currentState.number, tiki, cent);
// reset the animation for the entities
if (tiki && tiki->a->bIsCharacter) {
if (tiki) {
for (i = 0; i < MAX_FRAMEINFOS; i++) {
cent->animLast[i] = cent->currentState.frameInfo[i].index;
cent->animLastTimes[i] = cent->currentState.frameInfo[i].time;
cent->animLast[i] = -1;
cent->animLastTimes[i] = -1;
if (cent->currentState.frameInfo[i].weight) {
cent->animLastWeight |= 1 << i;
} else {
@ -83,14 +87,15 @@ static void CG_ResetEntity(centity_t* cent)
} else {
// clear all the last animations
for (i = 0; i < MAX_FRAMEINFOS; i++) {
cent->animLast[i] = -1;
cent->animLast[i] = -1;
cent->animLastTimes[i] = 0.0;
}
cent->animLastWeight = 0;
}
cent->usageIndexLast = 0;
cent->bFootOnGround_Left = qtrue;
cent->usageIndexLast = 0;
cent->bFootOnGround_Left = qtrue;
cent->bFootOnGround_Right = qtrue;
if (cent->currentState.eType == ET_PLAYER) {
@ -105,7 +110,7 @@ CG_TransitionEntity
cent->nextState is moved to cent->currentState and events are fired
===============
*/
static void CG_TransitionEntity(centity_t* cent)
static void CG_TransitionEntity(centity_t *cent)
{
cent->currentState = cent->nextState;
cent->currentValid = qtrue;
@ -134,11 +139,11 @@ on tourney restarts. All other times will use
CG_TransitionSnapshot instead.
==================
*/
void CG_SetInitialSnapshot(snapshot_t* snap)
void CG_SetInitialSnapshot(snapshot_t *snap)
{
int i;
centity_t* cent;
entityState_t* state;
int i;
centity_t *cent;
entityState_t *state;
cg.snap = snap;
@ -149,20 +154,21 @@ void CG_SetInitialSnapshot(snapshot_t* snap)
for (i = 0; i < cg.snap->numEntities; i++) {
state = &cg.snap->entities[i];
cent = &cg_entities[state->number];
cent = &cg_entities[state->number];
cent->currentState = *state;
cent->interpolate = qfalse;
cent->interpolate = qfalse;
cent->currentValid = qtrue;
CG_ResetEntity(cent);
}
cgi.MUSIC_UpdateMood(snap->ps.current_music_mood,
snap->ps.fallback_music_mood);
cgi.MUSIC_UpdateVolume(snap->ps.music_volume,
snap->ps.music_volume_fade_time);
cgi.MUSIC_UpdateMood(snap->ps.current_music_mood, snap->ps.fallback_music_mood);
cgi.MUSIC_UpdateVolume(snap->ps.music_volume, snap->ps.music_volume_fade_time);
cgi.S_SetReverb(snap->ps.reverb_type, snap->ps.reverb_level);
CG_InitRadar();
cgi.CL_RestoreSavedCgameState();
}
/*
@ -174,9 +180,9 @@ The transition point from snap to nextSnap has passed
*/
static void CG_TransitionSnapshot(qboolean differentServer)
{
centity_t* cent;
snapshot_t* oldFrame;
int i;
centity_t *cent;
snapshot_t *oldFrame;
int i;
if (differentServer) {
CG_ServerRestarted();
@ -187,13 +193,13 @@ static void CG_TransitionSnapshot(qboolean differentServer)
// clear the currentValid flag for all entities in the existing snapshot
for (i = 0; i < cg.snap->numEntities; i++) {
cent = &cg_entities[cg.snap->entities[i].number];
cent = &cg_entities[cg.snap->entities[i].number];
cent->currentValid = qfalse;
}
// move nextSnap to snap and do the transitions
oldFrame = cg.snap;
cg.snap = cg.nextSnap;
cg.snap = cg.nextSnap;
// FAKK: Commented out to make our stuff work
// cg_entities[ cg.snap->ps.clientNum ].interpolate = qfalse;
@ -202,9 +208,12 @@ static void CG_TransitionSnapshot(qboolean differentServer)
cent = &cg_entities[cg.snap->entities[i].number];
if (differentServer) {
cent->interpolate = qfalse;
cent->teleported = qfalse;
cent->teleported = qfalse;
}
CG_TransitionEntity(cent);
// remember time of snapshot this entity was last updated in
cent->snapShotTime = cg.snap->serverTime;
}
for (i = 0; i < cg.snap->number_of_sounds; i++) {
@ -220,31 +229,37 @@ static void CG_TransitionSnapshot(qboolean differentServer)
playerState_t *ops, *ps;
ops = &oldFrame->ps;
ps = &cg.snap->ps;
ps = &cg.snap->ps;
// teleporting checks are irrespective of prediction
if (ps->pm_flags & PMF_RESPAWNED) {
cg.thisFrameTeleport = qtrue;
}
if ((ops->music_volume != ps->music_volume) ||
(ops->music_volume_fade_time != ps->music_volume_fade_time)) {
cgi.MUSIC_UpdateVolume(ps->music_volume,
ps->music_volume_fade_time);
if ((ops->music_volume != ps->music_volume) || (ops->music_volume_fade_time != ps->music_volume_fade_time)) {
cgi.MUSIC_UpdateVolume(ps->music_volume, ps->music_volume_fade_time);
}
if ((ops->reverb_type != ps->reverb_type) ||
(ops->reverb_level != ps->reverb_level)) {
if ((ops->reverb_type != ps->reverb_type) || (ops->reverb_level != ps->reverb_level)) {
cgi.S_SetReverb(ps->reverb_type, ps->reverb_level);
}
// if we are not doing client side movement prediction for any
// reason, then the client events and view changes will be issued now
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) ||
cg_nopredict->integer || cg_synchronousClients->integer) {
if (cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_NO_PREDICTION) || cg_nopredict->integer
|| cg_synchronousClients->integer) {
CG_TransitionPlayerState(ps, ops);
}
}
if (differentServer) {
cgi.CL_RestoreSavedCgameState();
} else {
cgi.CL_ClearSavedCgameState();
}
// this allows the view model to still look normal when the player is on ground
cg.snap->ps.walking = cg.snap->ps.groundEntityNum != ENTITYNUM_NONE;
}
/*
@ -254,11 +269,11 @@ CG_SetNextSnap
A new snapshot has just been read in from the client system.
===================
*/
static void CG_SetNextSnap(snapshot_t* snap)
static void CG_SetNextSnap(snapshot_t *snap)
{
int num;
entityState_t* es;
centity_t* cent;
int num;
entityState_t *es;
centity_t *cent;
cg.nextSnap = snap;
@ -266,17 +281,15 @@ static void CG_SetNextSnap(snapshot_t* snap)
// check for extrapolation errors
for (num = 0; num < snap->numEntities; num++) {
es = &snap->entities[num];
es = &snap->entities[num];
cent = &cg_entities[es->number];
cent->nextState = *es;
// if this frame is a teleport, or the entity wasn't in the
// previous frame, don't interpolate
if (!cent->currentValid ||
((cent->currentState.eFlags ^ es->eFlags) & EF_TELEPORT_BIT) ||
(cent->currentState.parent != es->parent) ||
(cent->currentState.modelindex != es->modelindex)) {
if (!cent->currentValid || ((cent->currentState.eFlags ^ es->eFlags) & EF_TELEPORT_BIT)
|| (cent->currentState.parent != es->parent) || (cent->currentState.modelindex != es->modelindex)) {
cent->interpolate = qfalse;
// if this isn't the first frame and we have valid data, set the
// teleport flag
@ -302,8 +315,7 @@ static void CG_SetNextSnap(snapshot_t* snap)
}
// if the camera cut bit changed, than the next frame is a camera cut
if ((cg.nextSnap->ps.camera_flags & CF_CAMERA_CUT_BIT) !=
(cg.snap->ps.camera_flags & CF_CAMERA_CUT_BIT)) {
if ((cg.nextSnap->ps.camera_flags & CF_CAMERA_CUT_BIT) != (cg.snap->ps.camera_flags & CF_CAMERA_CUT_BIT)) {
cg.nextFrameCameraCut = qtrue;
} else {
cg.nextFrameCameraCut = qfalse;
@ -329,14 +341,17 @@ times if the client system fails to return a
valid snapshot.
========================
*/
static snapshot_t* CG_ReadNextSnapshot(void)
static snapshot_t *CG_ReadNextSnapshot(void)
{
qboolean r;
snapshot_t* dest;
qboolean r;
snapshot_t *dest;
if (cg.latestSnapshotNum > cgs.processedSnapshotNum + 1000) {
cgi.Error(ERR_DROP, "CG_ReadNextSnapshot: way out of range, %i > %i",
cg.latestSnapshotNum, cgs.processedSnapshotNum);
cgi.Printf(
"WARNING: CG_ReadNextSnapshot: way out of range, %i > %i\n",
cg.latestSnapshotNum,
cgs.processedSnapshotNum
);
}
while (cgs.processedSnapshotNum < cg.latestSnapshotNum) {
@ -394,17 +409,16 @@ of an interpolating one)
*/
void CG_ProcessSnapshots(void)
{
snapshot_t* snap;
int n;
qboolean differentServer;
snapshot_t *snap;
int n;
qboolean differentServer;
// see what the latest snapshot the client system has is
cgi.GetCurrentSnapshotNumber(&n, &cg.latestSnapshotTime);
if (n != cg.latestSnapshotNum) {
if (n < cg.latestSnapshotNum) {
// this should never happen
cgi.Error(ERR_DROP,
"CG_ProcessSnapshots: n < cg.latestSnapshotNum");
cgi.Error(ERR_DROP, "CG_ProcessSnapshots: n < cg.latestSnapshotNum");
}
cg.latestSnapshotNum = n;
}
@ -445,11 +459,8 @@ void CG_ProcessSnapshots(void)
// if time went backwards, we have a level restart
if (cg.nextSnap->serverTime < cg.snap->serverTime) {
// only drop if this is not a restart or loadgame
if (!((cg.nextSnap->snapFlags ^ cg.snap->snapFlags) &
SNAPFLAG_SERVERCOUNT)) {
cgi.Error(
ERR_DROP,
"CG_ProcessSnapshots: Server time went backwards");
if (!((cg.nextSnap->snapFlags ^ cg.snap->snapFlags) & SNAPFLAG_SERVERCOUNT)) {
cgi.Error(ERR_DROP, "CG_ProcessSnapshots: Server time went backwards");
}
}
}
@ -457,9 +468,7 @@ void CG_ProcessSnapshots(void)
differentServer = cg.snap->serverTime <= cgi.GetServerStartTime();
// if our time is < nextFrame's, we have a nice interpolating state
if (cg.time >= cg.snap->serverTime &&
cg.time < cg.nextSnap->serverTime &&
!differentServer) {
if (cg.time >= cg.snap->serverTime && cg.time < cg.nextSnap->serverTime && !differentServer) {
break;
}
@ -477,7 +486,6 @@ void CG_ProcessSnapshots(void)
cgi.SetTime(cg.time);
}
if (cg.nextSnap != NULL && cg.nextSnap->serverTime <= cg.time) {
cgi.Error(ERR_DROP,
"CG_ProcessSnapshots: cg.nextSnap->serverTime <= cg.time");
cgi.Error(ERR_DROP, "CG_ProcessSnapshots: cg.nextSnap->serverTime <= cg.time");
}
}

View file

@ -25,15 +25,21 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
void CG_ProcessSound( server_sound_t *sound )
{
if ( sound->stop_flag )
{
cgi.S_StopSound( sound->entity_number, sound->channel );
}
else
{
cgi.S_StartSound( sound->origin, sound->entity_number, sound->channel, cgs.sound_precache[sound->sound_index],
sound->volume, sound->min_dist, sound->pitch, sound->maxDist, sound->streamed );
}
}
void CG_ProcessSound(server_sound_t *sound)
{
if (sound->stop_flag) {
cgi.S_StopSound(sound->entity_number, sound->channel);
} else {
cgi.S_StartSound(
sound->origin,
sound->entity_number,
sound->channel,
cgs.sound_precache[sound->sound_index],
sound->volume,
sound->min_dist,
sound->pitch,
sound->maxDist,
sound->streamed
);
}
}

File diff suppressed because it is too large Load diff

View file

@ -31,11 +31,127 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define MAX_SPECIAL_EFFECT_COMMANDS 32
class specialeffectcommand_t : public Class {
typedef enum {
SFX_BHIT_PAPER_LITE,
SFX_BHIT_PAPER_HARD,
SFX_BHIT_WOOD_LITE,
SFX_BHIT_WOOD_HARD,
SFX_BHIT_METAL_LITE,
SFX_BHIT_METAL_HARD,
SFX_BHIT_STONE_LITE,
SFX_BHIT_STONE_HARD,
SFX_BHIT_DIRT_LITE,
SFX_BHIT_DIRT_HARD,
SFX_BHIT_GRILL_LITE,
SFX_BHIT_GRILL_HARD,
SFX_BHIT_GRASS_LITE,
SFX_BHIT_GRASS_HARD,
SFX_BHIT_MUD_LITE,
SFX_BHIT_MUD_HARD,
SFX_BHIT_PUDDLE_LITE,
SFX_BHIT_PUDDLE_HARD,
SFX_BHIT_GLASS_LITE,
SFX_BHIT_GLASS_HARD,
SFX_BHIT_GRAVEL_LITE,
SFX_BHIT_GRAVEL_HARD,
SFX_BHIT_SAND_LITE,
SFX_BHIT_SAND_HARD,
SFX_BHIT_FOLIAGE_LITE,
SFX_BHIT_FOLIAGE_HARD,
SFX_BHIT_SNOW_LITE,
SFX_BHIT_SNOW_HARD,
SFX_BHIT_CARPET_LITE,
SFX_BHIT_CARPET_HARD,
SFX_BHIT_HUMAN_UNIFORM_LITE,
SFX_BHIT_HUMAN_UNIFORM_HARD,
SFX_WATER_TRAIL_BUBBLE,
SFX_VFX_PAPER_LITE,
SFX_VFX_PAPER_HARD,
SFX_VFX_WOOD_LITE,
SFX_VFX_WOOD_HARD,
SFX_VFX_METAL_LITE,
SFX_VFX_METAL_HARD,
SFX_VFX_STONE_LITE,
SFX_VFX_STONE_HARD,
SFX_VFX_DIRT_LITE,
SFX_VFX_DIRT_HARD,
SFX_VFX_GRILL_LITE,
SFX_VFX_GRILL_HARD,
SFX_VFX_GRASS_LITE,
SFX_VFX_GRASS_HARD,
SFX_VFX_MUD_LITE,
SFX_VFX_MUD_HARD,
SFX_VFX_PUDDLE_LITE,
SFX_VFX_PUDDLE_HARD,
SFX_VFX_GLASS_LITE,
SFX_VFX_GLASS_HARD,
SFX_VFX_GRAVEL_LITE,
SFX_VFX_GRAVEL_HARD,
SFX_VFX_SAND_LITE,
SFX_VFX_SAND_HARD,
SFX_VFX_FOLIAGE_LITE,
SFX_VFX_FOLIAGE_HARD,
SFX_VFX_SNOW_LITE,
SFX_VFX_SNOW_HARD,
SFX_VFX_CARPET_LITE,
SFX_VFX_CARPET_HARD,
SFX_EXP_GREN_BASE,
SFX_EXP_BAZOOKA_BASE,
SFX_EXP_HEAVYSHELL_BASE,
SFX_EXP_TANK_BASE,
SFX_EXP_GREN_PAPER,
SFX_EXP_GREN_WOOD,
SFX_EXP_GREN_METAL,
SFX_EXP_GREN_STONE,
SFX_EXP_GREN_DIRT,
SFX_EXP_GREN_GRILL,
SFX_EXP_GREN_GRASS,
SFX_EXP_GREN_MUD,
SFX_EXP_GREN_PUDDLE,
SFX_EXP_GREN_GLASS,
SFX_EXP_GREN_GRAVEL,
SFX_EXP_GREN_SAND,
SFX_EXP_GREN_FOLIAGE,
SFX_EXP_GREN_SNOW,
SFX_EXP_GREN_CARPET,
SFX_EXP_HEAVYSHELL_DIRT,
SFX_EXP_HEAVYSHELL_STONE,
SFX_EXP_HEAVYSHELL_SNOW,
SFX_EXP_TANK_DIRT,
SFX_EXP_TANK_STONE,
SFX_EXP_TANK_SNOW,
SFX_EXP_BAZOOKA_DIRT,
SFX_EXP_BAZOOKA_STONE,
SFX_EXP_BAZOOKA_SNOW,
SFX_WATER_RIPPLE_STILL,
SFX_WATER_RIPPLE_MOVING,
SFX_OIL_LEAK_BIG,
SFX_OIL_LEAK_MEDIUM,
SFX_OIL_LEAK_SMALL,
SFX_OIL_LEAK_SPLAT,
SFX_WATER_LEAK_BIG,
SFX_WATER_LEAK_MEDIUM,
SFX_WATER_LEAK_SMALL,
SFX_WATER_LEAK_SPLAT,
SFX_FOOT_LIGHT_DUST,
SFX_FOOT_HEAVY_DUST,
SFX_FOOT_DIRT,
SFX_FOOT_GRASS,
SFX_FOOT_MUD,
SFX_FOOT_PUDDLE,
SFX_FOOT_SAND,
SFX_FOOT_SNOW,
SFX_FENCE_WOOD,
SFX_TEST_EFFECT,
SFX_COUNT
} SpecialEffects;
class specialeffectcommand_t : public Class
{
public:
spawnthing_t* emitter;
spawnthing_t *emitter;
float fCommandTime;
void (*endfcn)();
void (ClientGameCommandManager::*endfcn)();
Event *pEvent;
public:
@ -45,39 +161,37 @@ public:
class specialeffect_t : public Class
{
public:
int m_iCommandCount;
specialeffectcommand_t* m_commands[MAX_SPECIAL_EFFECT_COMMANDS];
int m_iCommandCount;
specialeffectcommand_t *m_commands[MAX_SPECIAL_EFFECT_COMMANDS];
public:
specialeffect_t();
specialeffectcommand_t* AddNewCommand();
specialeffectcommand_t *AddNewCommand();
};
#define MAX_SPECIAL_EFFECTS 99
#define SPECIAL_EFFECT_TEST MAX_SPECIAL_EFFECTS - 1
class ClientSpecialEffectsManager : public Listener {
specialeffect_t m_effects[99];
qboolean m_bEffectsLoaded;
int m_iNumPendingEvents;
class ClientSpecialEffectsManager : public Listener
{
specialeffect_t m_effects[SFX_COUNT];
qboolean m_bEffectsLoaded;
int m_iNumPendingEvents;
public:
CLASS_PROTOTYPE(ClientSpecialEffectsManager);
private:
void ContinueEffectExecution(Event* ev);
void ContinueEffectExecution(Event *ev);
void ExecuteEffect(int iEffect, int iStartCommand, Vector vPos, Vector vAngles, float axis[3][3]);
public:
ClientSpecialEffectsManager();
void LoadEffects();
qboolean EffectsPending();
void MakeEffect_Normal(int iEffect, Vector vPos, Vector vNormal);
void MakeEffect_Angles(int iEffect, Vector vPos, Vector vAngles);
void MakeEffect_Axis(int iEffect, Vector vPos, float axis[3][3]);
specialeffect_t* GetTestEffectPointer();
void LoadEffects();
qboolean EffectsPending();
void MakeEffect_Normal(int iEffect, Vector vPos, Vector vNormal);
void MakeEffect_Angles(int iEffect, Vector vPos, Vector vAngles);
void MakeEffect_Axis(int iEffect, Vector vPos, float axis[3][3]);
specialeffect_t *GetTestEffectPointer();
};
extern ClientSpecialEffectsManager sfxManager;

View file

@ -25,256 +25,228 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_commands.h"
swipething_t m_swipes[MAX_SWIPES];
extern int current_entity_number;
swipething_t m_swipes[MAX_SWIPES];
extern int current_entity_number;
extern refEntity_t *current_entity;
extern dtiki_t* current_tiki;
extern centity_t *current_centity;
extern dtiki_t *current_tiki;
extern centity_t *current_centity;
void ClientGameCommandManager::SwipeOn
(
Event *ev
)
void ClientGameCommandManager::SwipeOn(Event *ev)
{
// Make a swipe for this if available
int i;
int freeswipe = -1;
str tagname_start,tagname_end;
qhandle_t shader;
{
// Make a swipe for this if available
int i;
int freeswipe = -1;
str tagname_start, tagname_end;
qhandle_t shader;
if ( ev->NumArgs () != 4 )
return;
if (ev->NumArgs() != 4) {
return;
}
shader = cgi.R_RegisterShader( ev->GetString( 1 ) );
tagname_start = ev->GetString( 2 );
tagname_end = ev->GetString( 3 );
for ( i=0; i < MAX_SWIPES; i++ )
{
swipething_t &swipe = m_swipes[i];
shader = cgi.R_RegisterShader(ev->GetString(1));
tagname_start = ev->GetString(2);
tagname_end = ev->GetString(3);
if ( !swipe.enabled ||
(
( swipe.entitynum == current_entity_number ) &&
( tagname_start == swipe.tagname_start ) &&
( tagname_end == swipe.tagname_end ) &&
( shader == swipe.shader )
)
)
{
freeswipe = i;
break;
}
}
for (i = 0; i < MAX_SWIPES; i++) {
swipething_t& swipe = m_swipes[i];
if ( freeswipe == -1 )
return;
if (!swipe.enabled
|| ((swipe.entitynum == current_entity_number) && (tagname_start == swipe.tagname_start)
&& (tagname_end == swipe.tagname_end) && (shader == swipe.shader))) {
freeswipe = i;
break;
}
}
swipething_t &swipe = m_swipes[freeswipe];
if (freeswipe == -1) {
return;
}
if ( !swipe.enabled )
{
swipe.Init ();
swipe.enabled = qtrue;
swipe.entitynum = current_entity_number;
}
swipething_t& swipe = m_swipes[freeswipe];
swipe.shader = cgi.R_RegisterShader( ev->GetString( 1 ) );
swipe.tagname_start = ev->GetString ( 2 );
swipe.tagname_end = ev->GetString ( 3 );
swipe.life = ev->GetFloat ( 4 ) * 1000.f;
if (!swipe.enabled) {
swipe.Init();
swipe.enabled = qtrue;
swipe.entitynum = current_entity_number;
}
if ( current_centity )
current_centity->clientFlags |= CF_UPDATESWIPE;
}
swipe.shader = cgi.R_RegisterShader(ev->GetString(1));
swipe.tagname_start = ev->GetString(2);
swipe.tagname_end = ev->GetString(3);
swipe.life = ev->GetFloat(4) * 1000.f;
void ClientGameCommandManager::SwipeOff
(
Event *ev
)
if (current_centity) {
current_centity->clientFlags |= CF_UPDATESWIPE;
}
}
{
qboolean was_enabled;
int i;
void ClientGameCommandManager::SwipeOff(Event *ev)
was_enabled = qfalse;
for ( i=0; i < MAX_SWIPES; i++ )
{
swipething_t &swipe = m_swipes[i];
{
qboolean was_enabled;
int i;
if ( swipe.enabled && swipe.entitynum == current_entity_number )
{
swipe.enabled = qfalse;
was_enabled = qtrue;
}
}
was_enabled = qfalse;
for (i = 0; i < MAX_SWIPES; i++) {
swipething_t& swipe = m_swipes[i];
if ( was_enabled )
{
//cgi.R_SwipeBegin ( 0.f, 0.f, -1 );
//cgi.R_SwipeEnd ();
if (swipe.enabled && swipe.entitynum == current_entity_number) {
swipe.enabled = qfalse;
was_enabled = qtrue;
}
}
if ( current_centity )
current_centity->clientFlags &= ~CF_UPDATESWIPE;
}
}
if (was_enabled) {
//cgi.R_SwipeBegin ( 0.f, 0.f, -1 );
//cgi.R_SwipeEnd ();
void ClientGameCommandManager::Swipe
(
Event *ev
)
if (current_centity) {
current_centity->clientFlags &= ~CF_UPDATESWIPE;
}
}
}
{
// This does a swipe effect on the entity
int i,swipenum;
orientation_t _or;
int tagnum_start,tagnum_end;
qboolean add_cnt_point = qfalse;
vec3_t tmp;
void ClientGameCommandManager::Swipe(Event *ev)
assert(current_entity);
assert(current_tiki);
{
// This does a swipe effect on the entity
int i, swipenum;
orientation_t _or;
int tagnum_start, tagnum_end;
qboolean add_cnt_point = qfalse;
vec3_t tmp;
if (!current_entity || !current_tiki)
{
return;
}
assert(current_entity);
assert(current_tiki);
// Let's find us a new (or current) swipe
for ( swipenum=0; swipenum < MAX_SWIPES; swipenum++ )
{
swipething_t &swipe = m_swipes[swipenum];
if (!current_entity || !current_tiki) {
return;
}
if ( swipe.enabled && swipe.entitynum == current_entity_number )
{
while ( swipe.num_live_swipes > 1 )
{
i = ( swipe.first_swipe + 1 ) % MAX_SWIPE_POINTS;
swipepoint_t &swipepoint = swipe.swipepoints[i];
// Let's find us a new (or current) swipe
for (swipenum = 0; swipenum < MAX_SWIPES; swipenum++) {
swipething_t& swipe = m_swipes[swipenum];
if ( swipepoint.time < cg.time - swipe.life )
{
// then let's delete the previous
swipe.first_swipe = ( swipe.first_swipe + 1 ) % MAX_SWIPE_POINTS;
swipe.num_live_swipes--;
}
else
{
break;
}
if (swipe.enabled && swipe.entitynum == current_entity_number) {
while (swipe.num_live_swipes > 1) {
i = (swipe.first_swipe + 1) % MAX_SWIPE_POINTS;
swipepoint_t& swipepoint = swipe.swipepoints[i];
if (swipepoint.time < cg.time - swipe.life) {
// then let's delete the previous
swipe.first_swipe = (swipe.first_swipe + 1) % MAX_SWIPE_POINTS;
swipe.num_live_swipes--;
} else {
break;
}
}
if ( swipe.num_live_swipes == 1 )
{
swipepoint_t &swipepoint = swipe.swipepoints[swipe.first_swipe];
if ( swipepoint.time < cg.time - swipe.life )
{
swipe.num_live_swipes = 0;
}
if (swipe.num_live_swipes == 1) {
swipepoint_t& swipepoint = swipe.swipepoints[swipe.first_swipe];
if (swipepoint.time < cg.time - swipe.life) {
swipe.num_live_swipes = 0;
}
}
swipe.cntPoint.time = cg.time;
VectorCopy ( current_entity->origin, swipe.cntPoint.points[0] );
swipe.cntPoint.time = cg.time;
VectorCopy(current_entity->origin, swipe.cntPoint.points[0]);
tagnum_start = cgi.Tag_NumForName( current_tiki, swipe.tagname_start.c_str() );
_or = cgi.TIKI_Orientation(current_entity, tagnum_start);
tagnum_start = cgi.Tag_NumForName(current_tiki, swipe.tagname_start.c_str());
_or = cgi.TIKI_Orientation(current_entity, tagnum_start);
// Clear out the points
VectorClear ( tmp );
VectorClear ( swipe.cntPoint.points[0] );
VectorClear ( swipe.cntPoint.points[1] );
// Clear out the points
VectorClear(tmp);
VectorClear(swipe.cntPoint.points[0]);
VectorClear(swipe.cntPoint.points[1]);
if ( ev->NumArgs() > 0 )
VectorCopy( ev->GetVector( 1 ), tmp );
else
VectorCopy ( current_entity->origin, tmp );
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
for ( i = 0; i < 3; i++ )
{
VectorMA ( tmp, _or.origin[i], current_entity->axis[i], tmp );
if (ev->NumArgs() > 0) {
VectorCopy(ev->GetVector(1), tmp);
} else {
VectorCopy(current_entity->origin, tmp);
}
// Copy tmp into the startpoint
VectorCopy ( tmp, swipe.cntPoint.points[0] );
tagnum_end = cgi.Tag_NumForName( current_tiki, swipe.tagname_end.c_str() );
_or = cgi.TIKI_Orientation(current_entity, tagnum_end);
if ( ev->NumArgs() > 0 )
VectorCopy( ev->GetVector( 1 ), tmp );
else
VectorCopy ( current_entity->origin, tmp );
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
for ( i = 0; i < 3; i++ )
{
VectorMA ( tmp, _or.origin[i], current_entity->axis[i], tmp );
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
for (i = 0; i < 3; i++) {
VectorMA(tmp, _or.origin[i], current_entity->axis[i], tmp);
}
// Copy tmp into the startpoint
VectorCopy ( tmp, swipe.cntPoint.points[1] );
// Copy tmp into the startpoint
VectorCopy(tmp, swipe.cntPoint.points[0]);
if ( swipe.num_live_swipes == 0 )
add_cnt_point = qtrue;
else
{
float deltime = swipe.life / float ( MAX_SWIPES );
swipepoint_t &lastpoint = swipe.swipepoints[ ( swipe.first_swipe + swipe.num_live_swipes - 1 ) % MAX_SWIPE_POINTS];
tagnum_end = cgi.Tag_NumForName(current_tiki, swipe.tagname_end.c_str());
_or = cgi.TIKI_Orientation(current_entity, tagnum_end);
if ( swipe.cntPoint.time - lastpoint.time >= deltime )
add_cnt_point = qtrue;
if (ev->NumArgs() > 0) {
VectorCopy(ev->GetVector(1), tmp);
} else {
VectorCopy(current_entity->origin, tmp);
}
cgi.R_SwipeBegin ( cg.time, swipe.life, swipe.shader );
if ( add_cnt_point )
{
swipepoint_t &swipepoint = swipe.swipepoints[ ( swipe.first_swipe + swipe.num_live_swipes ) % MAX_SWIPE_POINTS];
swipepoint = swipe.cntPoint;
if ( swipe.num_live_swipes == MAX_SWIPE_POINTS )
swipe.first_swipe = ( swipe.first_swipe + 1 ) % MAX_SWIPE_POINTS;
else
swipe.num_live_swipes++;
// Transform the origin of the tag by the axis of the entity and add it to the origin of the entity
for (i = 0; i < 3; i++) {
VectorMA(tmp, _or.origin[i], current_entity->axis[i], tmp);
}
for ( i = 0; i != swipe.num_live_swipes; i++ )
{
swipepoint_t &swipepoint = swipe.swipepoints[ ( swipe.first_swipe + i ) % MAX_SWIPE_POINTS];
// Copy tmp into the startpoint
VectorCopy(tmp, swipe.cntPoint.points[1]);
cgi.R_SwipePoint ( swipepoint.points[0], swipepoint.points[1], swipepoint.time );
if (swipe.num_live_swipes == 0) {
add_cnt_point = qtrue;
} else {
float deltime = swipe.life / float(MAX_SWIPES);
swipepoint_t& lastpoint =
swipe.swipepoints[(swipe.first_swipe + swipe.num_live_swipes - 1) % MAX_SWIPE_POINTS];
if (swipe.cntPoint.time - lastpoint.time >= deltime) {
add_cnt_point = qtrue;
}
}
if ( !add_cnt_point )
cgi.R_SwipePoint ( swipe.cntPoint.points[0], swipe.cntPoint.points[1], swipe.cntPoint.time );
cgi.R_SwipeBegin(cg.time, swipe.life, swipe.shader);
cgi.R_SwipeEnd ();
}
}
}
if (add_cnt_point) {
swipepoint_t& swipepoint =
swipe.swipepoints[(swipe.first_swipe + swipe.num_live_swipes) % MAX_SWIPE_POINTS];
void ClientGameCommandManager::ClearSwipes
(
void
)
swipepoint = swipe.cntPoint;
{
int i;
if (swipe.num_live_swipes == MAX_SWIPE_POINTS) {
swipe.first_swipe = (swipe.first_swipe + 1) % MAX_SWIPE_POINTS;
} else {
swipe.num_live_swipes++;
}
}
for ( i=0; i < MAX_SWIPES; i++ )
{
swipething_t &swipe = m_swipes[i];
for (i = 0; i != swipe.num_live_swipes; i++) {
swipepoint_t& swipepoint = swipe.swipepoints[(swipe.first_swipe + i) % MAX_SWIPE_POINTS];
swipe.enabled = qfalse;
}
cgi.R_SwipePoint(swipepoint.points[0], swipepoint.points[1], swipepoint.time);
}
cgi.R_SwipeBegin ( 0.f, 0.f, -1 );
cgi.R_SwipeEnd ();
}
if (!add_cnt_point) {
cgi.R_SwipePoint(swipe.cntPoint.points[0], swipe.cntPoint.points[1], swipe.cntPoint.time);
}
cgi.R_SwipeEnd();
}
}
}
void ClientGameCommandManager::ClearSwipes(void)
{
int i;
for (i = 0; i < MAX_SWIPES; i++) {
swipething_t& swipe = m_swipes[i];
swipe.enabled = qfalse;
}
cgi.R_SwipeBegin(0.f, 0.f, -1);
cgi.R_SwipeEnd();
}
/*
===================
@ -283,7 +255,7 @@ CG_ClearSwipes
This is called at startup and for tournement restarts
===================
*/
void CG_ClearSwipes( void )
{
commandManager.ClearSwipes();
}
void CG_ClearSwipes(void)
{
commandManager.ClearSwipes();
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
#include "str.h"
#include "../client/keycodes.h"
void CG_MessageMode_f(void)
{
@ -61,9 +62,8 @@ void CG_MessageMode_Private_f(void)
return;
}
clientNum = atoi(cgi.Argv(1)) - 1;
if (clientNum < 0 || clientNum >= MAX_CLIENTS)
{
clientNum = atoi(cgi.Argv(1));
if (clientNum < 1 || clientNum >= MAX_CLIENTS) {
cgi.Printf(HUD_MESSAGE_CHAT_WHITE "Message Error: %s is a bad client number\n", cgi.Argv(1));
return;
}
@ -79,8 +79,7 @@ void CG_MessageSingleAll_f(void)
if (cgi.Argc() > 1) {
cgi.SendClientCommand(va("dmmessage 0 %s\n", cgi.Args()));
}
else {
} else {
cgi.UI_ToggleDMMessageConsole(-100);
}
}
@ -93,8 +92,7 @@ void CG_MessageSingleTeam_f(void)
if (cgi.Argc() > 1) {
cgi.SendClientCommand(va("dmmessage -1 %s\n", cgi.Args()));
}
else {
} else {
cgi.UI_ToggleDMMessageConsole(-200);
}
}
@ -108,14 +106,12 @@ void CG_MessageSingleClient_f(void)
}
clientNum = atoi(cgi.Argv(1));
if (clientNum < 1 || clientNum > MAX_CLIENTS)
{
if (clientNum < 1 || clientNum > MAX_CLIENTS) {
cgi.Printf(HUD_MESSAGE_CHAT_WHITE "Message Error: %s is a bad client number\n", cgi.Argv(1));
return;
}
if (cgi.Argc() > 2)
{
if (cgi.Argc() > 2) {
int i;
str sString;
@ -124,13 +120,12 @@ void CG_MessageSingleClient_f(void)
// copy the rest
for (i = 2; i < cgi.Argc(); i++) {
sString += va("%s", cgi.Argv(i));
sString += va(" %s", cgi.Argv(i));
}
sString += "\n";
cgi.SendClientCommand(sString.c_str());
}
else {
} else {
cgi.UI_ToggleDMMessageConsole(-clientNum);
}
}
@ -195,11 +190,39 @@ void CG_InstaMessageGroupE_f(void)
void CG_HudPrint_f(void)
{
cgi.Printf("\x1%s", cgi.Argv(0));
cgi.Printf("\x1%s", cgi.Argv(1));
}
int CG_CheckCaptureKey(int key, qboolean down, unsigned int time)
qboolean CG_CheckCaptureKey(int key, qboolean down, unsigned int time)
{
// FIXME: unimplemented
return 0;
char minKey = '1', maxKey = '9';
if (!cg.iInstaMessageMenu || !down) {
return qfalse;
}
if (cg_protocol >= protocol_e::PROTOCOL_MOHTA_MIN) {
maxKey = '8';
}
if (key < minKey || key > maxKey) {
if (key == K_ESCAPE || key == '0') {
cg.iInstaMessageMenu = 0;
return qtrue;
}
return qfalse;
}
if (cg.iInstaMessageMenu == -1) {
if (key > '6') {
cg.iInstaMessageMenu = 0;
} else {
cg.iInstaMessageMenu = key - '0';
}
} else if (cg.iInstaMessageMenu > 0) {
cgi.SendClientCommand(va("dmmessage 0 *%i%i\n", cg.iInstaMessageMenu, key - '0'));
cg.iInstaMessageMenu = 0;
}
return qtrue;
}

View file

@ -26,17 +26,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
#include "cg_commands.h"
void CG_Vehicle(centity_t* cent)
{
void CG_Vehicle(centity_t *cent) {}
}
void ClientGameCommandManager::SpawnTreads(Event* ev)
void ClientGameCommandManager::SpawnTreads(Event *ev)
{
// stub
}
void ClientGameCommandManager::TreadsOff(Event* ev)
void ClientGameCommandManager::TreadsOff(Event *ev)
{
// stub
}

File diff suppressed because it is too large Load diff

View file

@ -26,9 +26,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
#include "tiki.h"
static const char* AnimPrefixList[] =
{
static const char *AnimPrefixList[] = {
"",
"unarmed",
"papers",
"colt45",
"p38",
@ -46,7 +46,6 @@ static const char* AnimPrefixList[] =
"bazooka",
"panzerschreck",
"shotgun",
"unarmed",
//
// Team Assault and Team Tactics weapons
"mg42portable",
@ -60,7 +59,6 @@ static const char* AnimPrefixList[] =
"enfieldl42a1",
"carcano",
"delisle",
"thompson",
"sten",
"ppsh",
"moschetto",
@ -82,9 +80,9 @@ static const char* AnimPrefixList[] =
"PIAT"
};
enum animPrefix_e
{
enum animPrefix_e {
WPREFIX_NONE,
WPREFIX_UNARMED,
WPREFIX_PAPERS,
WPREFIX_COLT45,
WPREFIX_P38,
@ -102,191 +100,226 @@ enum animPrefix_e
WPREFIX_BAZOOKA,
WPREFIX_PANZERSCHRECK,
WPREFIX_SHOTGUN,
WPREFIX_UNARMED,
//
// Team Assault and Team Tactics weapons
WPREFIX_MG42_PORTABLE,
WPREFIX_WEBLEY,
WPREFIX_NAGANTREV,
WPREFIX_BERETTA,
WPREFIX_ENFIELD,
WPREFIX_SVT,
WPREFIX_MOSIN,
WPREFIX_G43,
WPREFIX_ENFIELDL42A,
WPREFIX_CARCANO,
WPREFIX_DELISLE,
WPREFIX_STEN,
WPREFIX_PPSH,
WPREFIX_MOSCHETTO,
WPREFIX_FG42,
WPREFIX_VICKERS,
WPREFIX_BREDA,
WPREFIX_F1_GRENADE,
WPREFIX_MILLS_GRENADE,
WPREFIX_NEBELHANDGRANATE,
WPREFIX_M18_SMOKE_GRENADE,
WPREFIX_RDG1_SMOKE_GRENADE,
//
// Team Assault and Team Tactics weapons
WPREFIX_MG42_PORTABLE,
WPREFIX_WEBLEY,
WPREFIX_NAGANTREV,
WPREFIX_BERETTA,
WPREFIX_ENFIELD,
WPREFIX_SVT,
WPREFIX_MOSIN,
WPREFIX_G43,
WPREFIX_ENFIELDL42A,
WPREFIX_CARCANO,
WPREFIX_DELISLE,
WPREFIX_STEN,
WPREFIX_PPSH,
WPREFIX_MOSCHETTO,
WPREFIX_FG42,
WPREFIX_VICKERS,
WPREFIX_BREDA,
WPREFIX_F1_GRENADE,
WPREFIX_MILLS_GRENADE,
WPREFIX_NEBELHANDGRANATE,
WPREFIX_M18_SMOKE_GRENADE,
WPREFIX_RDG1_SMOKE_GRENADE,
WPREFIX_BOMBA,
WPREFIX_BOMBA_BREDA,
WPREFIX_MINE,
WPREFIX_MINE_DETECTOR,
WPREFIX_MINE_DETECTOR_AXIS,
WPREFIX_DETONATOR,
WPREFIX_KAR98_MORTAR,
WPREFIX_PIAT
WPREFIX_BOMBA_BREDA,
WPREFIX_MINE,
WPREFIX_MINE_DETECTOR,
WPREFIX_MINE_DETECTOR_AXIS,
WPREFIX_DETONATOR,
WPREFIX_KAR98_MORTAR,
WPREFIX_PIAT
};
int CG_GetVMAnimPrefixIndex()
{
const char* szWeaponName;
int iWeaponClass;
const char *szWeaponName;
int iWeaponClass;
iWeaponClass = cg.snap->ps.stats[STAT_EQUIPPED_WEAPON];
szWeaponName = CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]);
if (iWeaponClass & WEAPON_CLASS_ANY_ITEM)
{
if (!Q_stricmp(szWeaponName, "Papers"))
return WPREFIX_PAPERS;
if (!Q_stricmp(szWeaponName, "Packed MG42 Turret"))
return WPREFIX_MG42_PORTABLE;
}
else if (iWeaponClass & WEAPON_CLASS_PISTOL)
{
if (!Q_stricmp(szWeaponName, "Colt 45"))
if (iWeaponClass & WEAPON_CLASS_ANY_ITEM) {
if (!Q_stricmp(szWeaponName, "Papers")) {
return WPREFIX_PAPERS;
}
if (!Q_stricmp(szWeaponName, "Packed MG42 Turret")) {
return WPREFIX_MG42_PORTABLE;
}
} else if (iWeaponClass & WEAPON_CLASS_PISTOL) {
if (!Q_stricmp(szWeaponName, "Colt 45")) {
return WPREFIX_COLT45;
if (!Q_stricmp(szWeaponName, "Walther P38"))
}
if (!Q_stricmp(szWeaponName, "Walther P38")) {
return WPREFIX_P38;
if (!Q_stricmp(szWeaponName, "Hi-Standard Silenced"))
return WPREFIX_HISTANDARD;
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "Webley Revolver"))
return WPREFIX_WEBLEY;
if (!Q_stricmp(szWeaponName, "Nagant Revolver"))
return WPREFIX_NAGANTREV;
if (!Q_stricmp(szWeaponName, "Beretta"))
return WPREFIX_BERETTA;
return WPREFIX_COLT45;
}
else if (iWeaponClass & WEAPON_CLASS_RIFLE)
{
if (!Q_stricmp(szWeaponName, "M1 Garand"))
return WPREFIX_GARAND;
if (!Q_stricmp(szWeaponName, "Mauser KAR 98K"))
return WPREFIX_KAR98;
if (!Q_stricmp(szWeaponName, "KAR98 - Sniper"))
return WPREFIX_KAR98SNIPER;
if (!Q_stricmp(szWeaponName, "Springfield '03 Sniper"))
return WPREFIX_SPRINGFIELD;
}
if (!Q_stricmp(szWeaponName, "Hi-Standard Silenced")) {
return WPREFIX_HISTANDARD;
}
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "Lee-Enfield"))
return WPREFIX_SPRINGFIELD;
if (!Q_stricmp(szWeaponName, "SVT 40"))
return WPREFIX_SVT;
if (!Q_stricmp(szWeaponName, "Mosin Nagant Rifle"))
return WPREFIX_MOSIN;
if (!Q_stricmp(szWeaponName, "G 43"))
return WPREFIX_G43;
if (!Q_stricmp(szWeaponName, "Enfield L42A1"))
return WPREFIX_ENFIELD;
if (!Q_stricmp(szWeaponName, "Carcano"))
return WPREFIX_CARCANO;
if (!Q_stricmp(szWeaponName, "DeLisle"))
return WPREFIX_DELISLE;
if (!Q_stricmp(szWeaponName, "Webley Revolver")) {
return WPREFIX_WEBLEY;
}
if (!Q_stricmp(szWeaponName, "Nagant Revolver")) {
return WPREFIX_NAGANTREV;
}
if (!Q_stricmp(szWeaponName, "Beretta")) {
return WPREFIX_BERETTA;
}
return WPREFIX_COLT45;
} else if (iWeaponClass & WEAPON_CLASS_RIFLE) {
if (!Q_stricmp(szWeaponName, "M1 Garand")) {
return WPREFIX_GARAND;
}
if (!Q_stricmp(szWeaponName, "Mauser KAR 98K")) {
return WPREFIX_KAR98;
}
if (!Q_stricmp(szWeaponName, "KAR98 - Sniper")) {
return WPREFIX_KAR98SNIPER;
}
if (!Q_stricmp(szWeaponName, "Springfield '03 Sniper")) {
return WPREFIX_SPRINGFIELD;
}
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "Lee-Enfield")) {
return WPREFIX_ENFIELD;
}
if (!Q_stricmp(szWeaponName, "SVT 40")) {
return WPREFIX_SVT;
}
if (!Q_stricmp(szWeaponName, "Mosin Nagant Rifle")) {
return WPREFIX_MOSIN;
}
if (!Q_stricmp(szWeaponName, "G 43")) {
return WPREFIX_G43;
}
if (!Q_stricmp(szWeaponName, "Enfield L42A1")) {
return WPREFIX_ENFIELDL42A;
}
if (!Q_stricmp(szWeaponName, "Carcano")) {
return WPREFIX_CARCANO;
}
if (!Q_stricmp(szWeaponName, "DeLisle")) {
return WPREFIX_DELISLE;
}
return WPREFIX_GARAND;
}
else if (iWeaponClass & WEAPON_CLASS_SMG)
{
if (!Q_stricmp(szWeaponName, "Thompson"))
} else if (iWeaponClass & WEAPON_CLASS_SMG) {
if (!Q_stricmp(szWeaponName, "Thompson")) {
return WPREFIX_THOMPSON;
if (!Q_stricmp(szWeaponName, "MP40"))
return WPREFIX_MP40;
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "Sten Mark II"))
return WPREFIX_STEN;
if (!Q_stricmp(szWeaponName, "PPSH SMG"))
return WPREFIX_PPSH;
if (!Q_stricmp(szWeaponName, "Moschetto"))
return WPREFIX_MOSCHETTO;
}
if (!Q_stricmp(szWeaponName, "MP40")) {
return WPREFIX_MP40;
}
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "Sten Mark II")) {
return WPREFIX_STEN;
}
if (!Q_stricmp(szWeaponName, "PPSH SMG")) {
return WPREFIX_PPSH;
}
if (!Q_stricmp(szWeaponName, "Moschetto")) {
return WPREFIX_MOSCHETTO;
}
return WPREFIX_THOMPSON;
}
else if (iWeaponClass & WEAPON_CLASS_MG)
{
if (!Q_stricmp(szWeaponName, "BAR"))
} else if (iWeaponClass & WEAPON_CLASS_MG) {
if (!Q_stricmp(szWeaponName, "BAR")) {
return WPREFIX_BAR;
if (!Q_stricmp(szWeaponName, "StG 44"))
return WPREFIX_MP44;
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "FG 42"))
return WPREFIX_MP44;
if (!Q_stricmp(szWeaponName, "Vickers-Berthier"))
return WPREFIX_MP44;
if (!Q_stricmp(szWeaponName, "Breda"))
return WPREFIX_MP44;
}
if (!Q_stricmp(szWeaponName, "StG 44")) {
return WPREFIX_MP44;
}
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "FG 42")) {
return WPREFIX_MP44;
}
if (!Q_stricmp(szWeaponName, "Vickers-Berthier")) {
return WPREFIX_VICKERS;
}
if (!Q_stricmp(szWeaponName, "Breda")) {
return WPREFIX_BREDA;
}
return WPREFIX_BAR;
}
else if (iWeaponClass & WEAPON_CLASS_GRENADE)
{
if (!Q_stricmp(szWeaponName, "Frag Grenade"))
} else if (iWeaponClass & WEAPON_CLASS_GRENADE) {
if (!Q_stricmp(szWeaponName, "Frag Grenade")) {
return WPREFIX_FRAGGRENADE;
if (!Q_stricmp(szWeaponName, "Stielhandgranate"))
return WPREFIX_STIELHANDGRANATE;
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "F1 Grenade"))
return WPREFIX_F1_GRENADE;
if (!Q_stricmp(szWeaponName, "Mills Grenade"))
return WPREFIX_MILLS_GRENADE;
if (!Q_stricmp(szWeaponName, "Nebelhandgranate"))
}
if (!Q_stricmp(szWeaponName, "Stielhandgranate")) {
return WPREFIX_STIELHANDGRANATE;
}
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "F1 Grenade")) {
return WPREFIX_F1_GRENADE;
}
if (!Q_stricmp(szWeaponName, "Mills Grenade")) {
return WPREFIX_MILLS_GRENADE;
}
if (!Q_stricmp(szWeaponName, "Nebelhandgranate")) {
return WPREFIX_NEBELHANDGRANATE;
if (!Q_stricmp(szWeaponName, "M18 Smoke Grenade"))
return WPREFIX_M18_SMOKE_GRENADE;
if (!Q_stricmp(szWeaponName, "RDG-1 Smoke Grenade"))
return WPREFIX_RDG1_SMOKE_GRENADE;
if (!Q_stricmp(szWeaponName, "Bomba A Mano"))
}
if (!Q_stricmp(szWeaponName, "M18 Smoke Grenade")) {
return WPREFIX_M18_SMOKE_GRENADE;
}
if (!Q_stricmp(szWeaponName, "RDG-1 Smoke Grenade")) {
return WPREFIX_RDG1_SMOKE_GRENADE;
}
if (!Q_stricmp(szWeaponName, "Bomba A Mano")) {
return WPREFIX_BOMBA;
if (!Q_stricmp(szWeaponName, "Bomba A Mano Breda"))
return WPREFIX_BOMBA_BREDA;
if (!Q_stricmp(szWeaponName, "LandmineAllies"))
return WPREFIX_MINE;
if (!Q_stricmp(szWeaponName, "LandmineAxis"))
return WPREFIX_MINE;
if (!Q_stricmp(szWeaponName, "Minensuchgerat"))
return WPREFIX_MINE_DETECTOR_AXIS;
if (!Q_stricmp(szWeaponName, "Minedetector"))
return WPREFIX_MINE_DETECTOR;
}
if (!Q_stricmp(szWeaponName, "Bomba A Mano Breda")) {
return WPREFIX_BOMBA_BREDA;
}
if (!Q_stricmp(szWeaponName, "LandmineAllies")) {
return WPREFIX_MINE;
}
if (!Q_stricmp(szWeaponName, "LandmineAxis")) {
return WPREFIX_MINE;
}
if (!Q_stricmp(szWeaponName, "Minensuchgerat")) {
return WPREFIX_MINE_DETECTOR_AXIS;
}
if (!Q_stricmp(szWeaponName, "Minedetector")) {
return WPREFIX_MINE_DETECTOR;
}
return WPREFIX_FRAGGRENADE;
}
else if (iWeaponClass & WEAPON_CLASS_HEAVY)
{
if (!Q_stricmp(szWeaponName, "Bazooka"))
} else if (iWeaponClass & WEAPON_CLASS_HEAVY) {
if (!Q_stricmp(szWeaponName, "Bazooka")) {
return WPREFIX_BAZOOKA;
if (!Q_stricmp(szWeaponName, "Panzerschreck"))
}
if (!Q_stricmp(szWeaponName, "Panzerschreck")) {
return WPREFIX_PANZERSCHRECK;
if (!Q_stricmp(szWeaponName, "Shotgun"))
return WPREFIX_SHOTGUN;
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "PIAT"))
return WPREFIX_PIAT;
}
if (!Q_stricmp(szWeaponName, "Gewehrgranate")) {
return WPREFIX_KAR98_MORTAR;
}
if (!Q_stricmp(szWeaponName, "Shotgun")) {
return WPREFIX_SHOTGUN;
}
//
// Team Assault and Team Tactics
//
if (!Q_stricmp(szWeaponName, "PIAT")) {
return WPREFIX_PIAT;
}
return WPREFIX_BAZOOKA;
}
@ -294,63 +327,59 @@ int CG_GetVMAnimPrefixIndex()
return WPREFIX_UNARMED;
}
void CG_ViewModelAnimation(refEntity_t* pModel)
void CG_ViewModelAnimation(refEntity_t *pModel)
{
int i;
int iAnimFlags;
float fCrossblendTime, fCrossblendFrac, fCrossblendAmount;
float fAnimLength;
int iAnimPrefixIndex;
const char* pszAnimSuffix;
char szAnimName[MAX_QPATH];
dtiki_t* pTiki;
qboolean bAnimChanged;
int i;
int iAnimFlags;
float fCrossblendTime, fCrossblendFrac, fCrossblendAmount;
float fAnimLength;
int iAnimPrefixIndex;
const char *pszAnimSuffix;
char szAnimName[MAX_QPATH];
dtiki_t *pTiki;
qboolean bAnimChanged;
qboolean bWeaponChanged;
fCrossblendFrac = 0.0;
bAnimChanged = 0;
pTiki = pModel->tiki;
bAnimChanged = qfalse;
bWeaponChanged = qfalse; // Added in OPM
pTiki = pModel->tiki;
if (cgi.anim->g_iLastEquippedWeaponStat == cg.snap->ps.stats[STAT_EQUIPPED_WEAPON]
&& !strcmp(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1])))
{
&& !strcmp(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]))) {
iAnimPrefixIndex = cgi.anim->g_iLastAnimPrefixIndex;
}
else
{
iAnimPrefixIndex = CG_GetVMAnimPrefixIndex();
} else {
iAnimPrefixIndex = CG_GetVMAnimPrefixIndex();
cgi.anim->g_iLastEquippedWeaponStat = cg.snap->ps.stats[STAT_EQUIPPED_WEAPON];
strcpy(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]));
Q_strncpyz(cgi.anim->g_szLastActiveItem, CG_ConfigString(CS_WEAPONS + cg.snap->ps.activeItems[1]), sizeof(cgi.anim->g_szLastActiveItem));
cgi.anim->g_iLastAnimPrefixIndex = iAnimPrefixIndex;
bAnimChanged = qtrue;
bAnimChanged = qtrue;
bWeaponChanged = qtrue;
}
if (cgi.anim->g_iLastVMAnim == -1)
{
sprintf(szAnimName, "%s_idle", AnimPrefixList[iAnimPrefixIndex]);
if (cgi.anim->g_iLastVMAnim == -1) {
Com_sprintf(szAnimName, sizeof(szAnimName), "%s_idle", AnimPrefixList[iAnimPrefixIndex]);
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, szAnimName);
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1)
{
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1) {
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, "idle");
cgi.DPrintf("Warning: Couldn't find view model animation %s\n", szAnimName);
}
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].weight = 1.0;
cgi.anim->g_iLastVMAnim = 0;
cgi.anim->g_iLastVMAnim = 0;
}
if (cg.snap->ps.iViewModelAnimChanged != cgi.anim->g_iLastVMAnimChanged)
{
bAnimChanged = qtrue;
cgi.anim->g_iLastVMAnim = cg.snap->ps.iViewModelAnim;
if (cg.snap->ps.iViewModelAnimChanged != cgi.anim->g_iLastVMAnimChanged) {
bAnimChanged = qtrue;
cgi.anim->g_iLastVMAnim = cg.snap->ps.iViewModelAnim;
cgi.anim->g_iLastVMAnimChanged = cg.snap->ps.iViewModelAnimChanged;
}
if (bAnimChanged)
{
switch (cgi.anim->g_iLastVMAnim)
{
if (bAnimChanged) {
switch (cgi.anim->g_iLastVMAnim) {
case VM_ANIM_CHARGE:
pszAnimSuffix = "charge";
break;
@ -381,136 +410,138 @@ void CG_ViewModelAnimation(refEntity_t* pModel)
case VM_ANIM_LADDERSTEP:
pszAnimSuffix = "ladderstep";
break;
case VM_ANIM_IDLE_0:
pszAnimSuffix = "idle0";
break;
case VM_ANIM_IDLE_1:
pszAnimSuffix = "idle1";
break;
case VM_ANIM_IDLE_2:
pszAnimSuffix = "idle2";
break;
case VM_ANIM_DISABLED:
pszAnimSuffix = "disabled";
break;
case VM_ANIM_IDLE_0:
pszAnimSuffix = "idle0";
break;
case VM_ANIM_IDLE_1:
pszAnimSuffix = "idle1";
break;
case VM_ANIM_IDLE_2:
pszAnimSuffix = "idle2";
break;
case VM_ANIM_DISABLED:
pszAnimSuffix = "disabled";
break;
default:
case VM_ANIM_IDLE:
pszAnimSuffix = "idle";
break;
case VM_ANIM_IDLE:
pszAnimSuffix = "idle";
break;
}
sprintf(szAnimName, "%s_%s", AnimPrefixList[iAnimPrefixIndex], pszAnimSuffix);
fCrossblendTime = cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
fCrossblendAmount = cgi.anim->g_iCurrentVMDuration / 1000.0;
Com_sprintf(szAnimName, sizeof(szAnimName), "%s_%s", AnimPrefixList[iAnimPrefixIndex], pszAnimSuffix);
if (!bWeaponChanged) {
fCrossblendTime =
cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
fCrossblendAmount = cgi.anim->g_iCurrentVMDuration / 1000.0;
if (fCrossblendAmount < fCrossblendTime && fCrossblendAmount > 0.0)
{
fCrossblendFrac = fCrossblendAmount / fCrossblendTime;
for (i = 0; i < MAX_FRAMEINFOS; ++i)
{
if (cgi.anim->g_VMFrameInfo[i].weight)
{
if (i == cgi.anim->g_iCurrentVMAnimSlot) {
cgi.anim->g_VMFrameInfo[i].weight = fCrossblendFrac;
}
else {
cgi.anim->g_VMFrameInfo[i].weight *= (1.0 - fCrossblendFrac);
if (fCrossblendAmount < fCrossblendTime && fCrossblendAmount > 0.0) {
fCrossblendFrac = fCrossblendAmount / fCrossblendTime;
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
if (cgi.anim->g_VMFrameInfo[i].weight) {
if (i == cgi.anim->g_iCurrentVMAnimSlot) {
cgi.anim->g_VMFrameInfo[i].weight = fCrossblendFrac;
} else {
cgi.anim->g_VMFrameInfo[i].weight *= (1.0 - fCrossblendFrac);
}
}
}
}
} else {
fCrossblendTime = 0;
fCrossblendAmount = 0;
fCrossblendFrac = 0;
}
cgi.anim->g_iCurrentVMAnimSlot = (cgi.anim->g_iCurrentVMAnimSlot + 1) % MAX_FRAMEINFOS;
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, szAnimName);
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1)
{
if (cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index == -1) {
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index = cgi.Anim_NumForName(pTiki, "idle");
cgi.DPrintf("Warning: Couldn't find view model animation %s\n", szAnimName);
}
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].time = 0.0;
cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].weight = 1.0;
cgi.anim->g_iCurrentVMDuration = 0;
cgi.anim->g_iCurrentVMDuration = 0;
fCrossblendTime = cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
if (!fCrossblendTime)
{
for (i = 0; i < MAX_FRAMEINFOS; ++i)
{
if (!bWeaponChanged) {
fCrossblendTime =
cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
if (!fCrossblendTime) {
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
if (i != cgi.anim->g_iCurrentVMAnimSlot) {
cgi.anim->g_VMFrameInfo[i].weight = 0.0;
}
}
cgi.anim->g_bCrossblending = qfalse;
} else {
cgi.anim->g_bCrossblending = qtrue;
}
} else {
// Added in OPM
// If there is a new weapon, don't do any crossblend
cgi.anim->g_bCrossblending = qfalse;
// clear crossblend values
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
if (i != cgi.anim->g_iCurrentVMAnimSlot) {
cgi.anim->g_VMFrameInfo[i].weight = 0.0;
}
}
cgi.anim->g_bCrossblending = qfalse;
}
else
{
cgi.anim->g_bCrossblending = qtrue;
}
}
cgi.anim->g_iCurrentVMDuration += cg.frametime;
if (cgi.anim->g_bCrossblending)
{
if (cgi.anim->g_bCrossblending) {
fCrossblendTime = cgi.Anim_CrossblendTime(pTiki, cgi.anim->g_VMFrameInfo[cgi.anim->g_iCurrentVMAnimSlot].index);
fCrossblendAmount = cgi.anim->g_iCurrentVMDuration / 1000.0;
if (fCrossblendAmount >= fCrossblendTime || fCrossblendAmount <= 0.0)
{
if (fCrossblendAmount >= fCrossblendTime || fCrossblendAmount <= 0.0) {
// clear crossblend values
for (i = 0; i < MAX_FRAMEINFOS; ++i)
{
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
if (i != cgi.anim->g_iCurrentVMAnimSlot) {
cgi.anim->g_VMFrameInfo[i].weight = 0.0;
}
}
cgi.anim->g_bCrossblending = qfalse;
}
else {
} else {
fCrossblendFrac = fCrossblendAmount / fCrossblendTime;
}
}
for (i = 0; i < MAX_FRAMEINFOS; ++i)
{
if (!cgi.anim->g_VMFrameInfo[i].weight)
{
for (i = 0; i < MAX_FRAMEINFOS; ++i) {
if (!cgi.anim->g_VMFrameInfo[i].weight) {
// clear the weight values of the ref entity
pModel->frameInfo[i].index = 0;
pModel->frameInfo[i].time = 0.0;
pModel->frameInfo[i].index = 0;
pModel->frameInfo[i].time = 0.0;
pModel->frameInfo[i].weight = 0.0;
}
else
{
} else {
fAnimLength = cgi.Anim_Time(pTiki, cgi.anim->g_VMFrameInfo[i].index);
cgi.anim->g_VMFrameInfo[i].time += cg.frametime / 1000.0;
if (cgi.anim->g_VMFrameInfo[i].time > fAnimLength)
{
if (cgi.Anim_Flags(pTiki, cgi.anim->g_VMFrameInfo[i].index) & TAF_DELTADRIVEN) {
cgi.anim->g_VMFrameInfo[i].time -= fAnimLength;
}
else {
cgi.anim->g_VMFrameInfo[i].time = fAnimLength;
if (cgi.anim->g_VMFrameInfo[i].time > fAnimLength) {
if (pTiki) {
if (cgi.Anim_Flags(pTiki, cgi.anim->g_VMFrameInfo[i].index) & TAF_DELTADRIVEN) {
cgi.anim->g_VMFrameInfo[i].time -= fAnimLength;
} else {
cgi.anim->g_VMFrameInfo[i].time = fAnimLength;
}
} else {
cgi.anim->g_VMFrameInfo[i].time = 0.f;
}
}
pModel->frameInfo[i].index = cgi.anim->g_VMFrameInfo[i].index;
pModel->frameInfo[i].time = cgi.anim->g_VMFrameInfo[i].time;
pModel->frameInfo[i].time = cgi.anim->g_VMFrameInfo[i].time;
if (cgi.anim->g_bCrossblending)
{
if (cgi.anim->g_bCrossblending) {
if (i == cgi.anim->g_iCurrentVMAnimSlot) {
pModel->frameInfo[i].weight = fCrossblendFrac;
} else {
pModel->frameInfo[i].weight = cgi.anim->g_VMFrameInfo[i].weight * (1.0 - fCrossblendFrac);
}
else {
pModel->frameInfo[i].weight *= (1.0 - fCrossblendFrac);
}
}
else
{
} else {
pModel->frameInfo[i].weight = 1.0;
}
}
@ -519,60 +550,48 @@ void CG_ViewModelAnimation(refEntity_t* pModel)
pModel->actionWeight = 1.0;
}
void CG_CalcViewModelMovement(float fViewBobPhase, float fViewBobAmp, vec_t* vVelocity, vec_t* vMovement)
void CG_CalcViewModelMovement(float fViewBobPhase, float fViewBobAmp, vec_t *vVelocity, vec_t *vMovement)
{
int i;
float fPhase, fDelta;
int i;
float fPhase, fDelta;
vec3_t vTargOfs;
vec3_t vNorm;
fPhase = sin(fViewBobPhase + M_PI / 10) * fViewBobAmp * vm_sway_side->value;
fPhase = sin(fViewBobPhase + M_PI / 10) * fViewBobAmp * vm_sway_side->value;
vMovement[0] = fPhase * vm_sway_front->value;
vMovement[1] = fPhase;
fPhase = sin(fViewBobPhase - 0.94 + fViewBobPhase - 0.94 + M_PI);
fPhase = sin(fViewBobPhase - 0.94 + fViewBobPhase - 0.94 + M_PI);
vMovement[2] = (sin((fViewBobPhase - 0.94) * 4.0 + M_PI / 2) * 0.125 + fPhase) * fViewBobAmp * vm_sway_up->value;
if (cg.predicted_player_state.walking)
{
if (cg.predicted_player_state.viewheight == CROUCH_EYE_HEIGHT)
{
if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_BAZOOKA || cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_PANZERSCHRECK)
{
if (cg.predicted_player_state.walking) {
if (cg.predicted_player_state.viewheight == CROUCH_EYE_HEIGHT) {
if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_BAZOOKA
|| cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_PANZERSCHRECK) {
vTargOfs[0] = vm_offset_rocketcrouch_front->value;
vTargOfs[1] = vm_offset_rocketcrouch_side->value;
vTargOfs[2] = vm_offset_rocketcrouch_up->value;
}
else if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_SHOTGUN)
{
} else if (cgi.anim->g_iLastAnimPrefixIndex == WPREFIX_SHOTGUN) {
vTargOfs[0] = vm_offset_shotguncrouch_front->value;
vTargOfs[1] = vm_offset_shotguncrouch_side->value;
vTargOfs[2] = vm_offset_shotguncrouch_up->value;
}
else
{
} else {
vTargOfs[0] = vm_offset_crouch_front->value;
vTargOfs[1] = vm_offset_crouch_side->value;
vTargOfs[2] = vm_offset_crouch_up->value;
}
}
else
{
} else {
memset(vTargOfs, 0, sizeof(vTargOfs));
}
}
else
{
} else {
vTargOfs[0] = vm_offset_air_front->value;
vTargOfs[1] = vm_offset_air_side->value;
vTargOfs[2] = vm_offset_air_up->value;
}
if (cg.predicted_player_state.walking)
{
if (cg.predicted_player_state.walking) {
fDelta = VectorLength(vVelocity) - vm_offset_vel_base->value;
if (fDelta > 0.0)
{
if (fDelta > 0.0) {
if (fDelta > 250.0 - vm_offset_vel_base->value) {
fDelta = 250.0 - vm_offset_vel_base->value;
}
@ -582,23 +601,19 @@ void CG_CalcViewModelMovement(float fViewBobPhase, float fViewBobAmp, vec_t* vVe
vTargOfs[1] += fPhase * vm_offset_vel_side->value;
vTargOfs[2] += fPhase * vm_offset_vel_up->value;
}
}
else if (vVelocity[2]) {
} else if (vVelocity[2]) {
vTargOfs[2] -= vVelocity[2] * vm_offset_upvel->value;
}
for (i = 0; i < 3; i++)
{
for (i = 0; i < 3; i++) {
fDelta = vTargOfs[i] - cgi.anim->g_vCurrentVMPosOffset[i];
cgi.anim->g_vCurrentVMPosOffset[i] += cg.frametime / 1000.0 * fDelta * vm_offset_speed->value;
if (fDelta > 0.0)
{
if (fDelta > 0.0) {
if (cgi.anim->g_vCurrentVMPosOffset[i] > vTargOfs[i]) {
cgi.anim->g_vCurrentVMPosOffset[i] = vTargOfs[i];
}
}
else if (fDelta < 0.0) {
} else if (fDelta < 0.0) {
if (cgi.anim->g_vCurrentVMPosOffset[i] < vTargOfs[i]) {
cgi.anim->g_vCurrentVMPosOffset[i] = vTargOfs[i];
}

File diff suppressed because it is too large Load diff

241
code/cgame/memarchiver.cpp Normal file
View file

@ -0,0 +1,241 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "cg_local.h"
#include "memarchiver.h"
#include "../qcommon/vector.h"
#include "../qcommon/str.h"
MemArchiver::MemArchiver()
{
state = MEMARC_WRITING;
buffer = 0;
allocatedSize = 0;
bufferSize = 0;
}
MemArchiver::~MemArchiver()
{
if (state == MEMARC_WRITING && buffer) {
cgi.Free(buffer);
}
}
void MemArchiver::SetupForWriting(size_t initialSize)
{
this->state = MEMARC_WRITING;
this->buffer = (byte*)cgi.Malloc(initialSize);
this->allocatedSize = initialSize;
this->bufferSize = 0;
}
void MemArchiver::SetupForReading(byte* buffer, size_t size)
{
this->state = MEMARC_READING;
this->buffer = buffer;
this->allocatedSize = size;
this->bufferSize = 0;
}
void MemArchiver::SetBaseTime(unsigned int time)
{
this->svsTime = time;
}
size_t MemArchiver::BufferSize() const
{
return bufferSize;
}
byte* MemArchiver::ConfiscateBuffer()
{
byte* confiscatedBuffer = buffer;
buffer = NULL;
allocatedSize = 0;
bufferSize = 0;
return confiscatedBuffer;
}
bool MemArchiver::IsReading() const
{
return !IsWriting();
}
bool MemArchiver::IsWriting() const
{
return state == MEMARC_WRITING;
}
bool MemArchiver::FinishedReading() const
{
return bufferSize == allocatedSize;
}
void MemArchiver::ArchiveByte(byte* value)
{
ArchiveRaw(value, sizeof(byte));
}
void MemArchiver::ArchiveBoolean(qboolean* value)
{
ArchiveRaw(value, sizeof(qboolean));
}
void MemArchiver::ArchiveChar(char* value)
{
ArchiveRaw(value, sizeof(char));
}
void MemArchiver::ArchiveUChar(unsigned char* value)
{
ArchiveRaw(value, sizeof(unsigned char));
}
void MemArchiver::ArchiveShort(short* value)
{
ArchiveRaw(value, sizeof(short));
}
void MemArchiver::ArchiveInteger(int* value)
{
ArchiveRaw(value, sizeof(int));
}
void MemArchiver::ArchiveSize(size_t* value)
{
ArchiveRaw(value, sizeof(size_t));
}
void MemArchiver::ArchiveFloat(float* value)
{
ArchiveRaw(value, sizeof(float));
}
void MemArchiver::ArchiveVec3(vec3_t value)
{
ArchiveRaw(value, sizeof(vec3_t));
}
void MemArchiver::ArchiveVector(Vector* value)
{
ArchiveFloat(&value->x);
ArchiveFloat(&value->y);
ArchiveFloat(&value->z);
}
void MemArchiver::ArchiveString(str* value)
{
char tmp[4096];
int current = 0;
if (IsReading()) {
for (current = 0; current < 4096; current++) {
ArchiveReadRaw(&tmp[current], sizeof(char));
if (!tmp[current]) {
break;
}
}
if (current == 4096) {
tmp[current - 1] = 0;
}
*value = tmp;
} else {
ArchiveWriteRaw(value->c_str(), value->length() + 1);
}
}
void MemArchiver::ArchiveTime(int* value)
{
int time;
if (IsReading()) {
ArchiveReadRaw(&time, sizeof(time));
if (time) {
time += svsTime;
}
*value = time;
} else {
time = *value;
if (time) {
time -= svsTime;
}
ArchiveWriteRaw(&time, sizeof(time));
}
}
void MemArchiver::ArchiveRaw(void* buffer, size_t size)
{
if (IsReading()) {
ArchiveReadRaw(buffer, size);
} else {
ArchiveWriteRaw(buffer, size);
}
}
void MemArchiver::ArchiveReadRaw(void* buffer, size_t size)
{
if (!size) {
return;
}
if (size + this->bufferSize > this->allocatedSize) {
Com_Error(ERR_DROP, "MemArchiver: tried to read past end of buffer");
}
memcpy(buffer, this->buffer + this->bufferSize, size);
this->bufferSize += size;
}
void MemArchiver::ArchiveWriteRaw(const void* buffer, size_t size)
{
if (!size) {
return;
}
if (size + this->bufferSize > this->allocatedSize) {
if (!this->allocatedSize) {
this->allocatedSize = 1024;
this->buffer = (byte*)cgi.Malloc(this->allocatedSize);
} else {
byte* newBuffer;
do {
this->allocatedSize *= 2;
} while (size + this->bufferSize > this->allocatedSize);
newBuffer = (byte*)cgi.Malloc(this->allocatedSize);
memcpy(newBuffer, this->buffer, this->bufferSize);
cgi.Free(this->buffer);
this->buffer = newBuffer;
}
}
memcpy(this->buffer + this->bufferSize, buffer, size);
this->bufferSize += size;
}

72
code/cgame/memarchiver.h Normal file
View file

@ -0,0 +1,72 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// DESCRIPTION:
// In-memory archiver
#include "cg_local.h"
class Vector;
class str;
typedef enum {
MEMARC_WRITING,
MEMARC_READING
} archiverState_e;
class MemArchiver {
public:
MemArchiver();
~MemArchiver();
void SetupForWriting(size_t initialSize);
void SetupForReading(byte* buffer, size_t size);
void SetBaseTime(unsigned int time);
size_t BufferSize() const;
byte* ConfiscateBuffer();
bool IsReading() const;
bool IsWriting() const;
bool FinishedReading() const;
void ArchiveByte(byte* value);
void ArchiveBoolean(qboolean* value);
void ArchiveChar(char* value);
void ArchiveUChar(unsigned char* value);
void ArchiveShort(short* value);
void ArchiveInteger(int* value);
void ArchiveSize(size_t* value);
void ArchiveFloat(float* value);
void ArchiveVec3(vec3_t value);
void ArchiveVector(Vector* value);
void ArchiveString(str* value);
void ArchiveTime(int* value);
void ArchiveRaw(void* buffer, size_t size);
void ArchiveReadRaw(void* buffer, size_t size);
void ArchiveWriteRaw(const void* buffer, size_t size);
private:
archiverState_e state;
byte* buffer;
size_t bufferSize;
size_t allocatedSize;
int svsTime;
};

View file

@ -1,23 +1,84 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.12)
project(omohclient)
add_subdirectory("../cgame" "./cgame")
file(GLOB_RECURSE SOURCES_CLIENT "./*.c*")
file(GLOB SOURCES_CLIENT "./*.c*")
file(GLOB_RECURSE SOURCES_UILIB "../uilib/*.c*")
set(SOURCES_CLIENT ${SOURCES_CLIENT}
# Gamespy
"${CMAKE_SOURCE_DIR}/code/gamespy/cl_gamespy.c"
)
# Made as an interface and not static, as static only links used methods
add_library(omohclient INTERFACE)
target_sources(omohclient INTERFACE ${SOURCES_CLIENT} ${SOURCES_UILIB})
target_compile_definitions(omohclient INTERFACE APP_MODULE)
target_compile_features(omohclient INTERFACE cxx_nullptr)
target_compile_features(omohclient INTERFACE c_variadic_macros)
target_link_libraries(omohclient INTERFACE omohsdl)
target_link_libraries(omohclient INTERFACE omohsdl_client)
target_link_libraries(omohclient INTERFACE gcd)
# Sound stuff
target_compile_definitions(omohclient INTERFACE USE_CODEC_MP3)
add_subdirectory("../libmad-0.15.1b" "./libmad")
target_link_libraries(omohclient INTERFACE libmad)
target_include_directories(omohclient INTERFACE "../libmad-0.15.1b")
if (NOT NO_MODERN_DMA)
# Use OpenAL
find_package(OpenAL REQUIRED)
if (OPENAL_FOUND)
target_compile_definitions(omohclient INTERFACE USE_OPENAL=1 NO_MODERN_DMA=0)
if (MSVC)
target_include_directories(omohclient INTERFACE ${OPENAL_INCLUDE_DIR}/AL)
else()
target_include_directories(omohclient INTERFACE ${OPENAL_INCLUDE_DIR})
endif()
if(NOT USE_SYSTEM_LIBS)
target_compile_definitions(omohclient INTERFACE USE_OPENAL_DLOPEN=1)
else()
# Link against system OpenAL
target_link_libraries(omohclient INTERFACE OpenAL::OpenAL)
endif()
endif()
list(FILTER SOURCES_CLIENT EXCLUDE REGEX "./snd_([a-zA-Z0-9_]+)\.c$")
file(GLOB SOURCES_CLIENT_SND "./snd_*_new.c*" "./snd_codec*.c*")
list(APPEND SOURCES_CLIENT ${SOURCES_CLIENT_SND})
else()
#
# Fallback to old DMA sound system
#
message(NOTICE "OpenAL was explicitly disabled - fallback to old SDL sound system")
target_compile_definitions(omohclient INTERFACE NO_MODERN_DMA=1)
set(NO_MODERN_DMA TRUE)
list(FILTER SOURCES_CLIENT EXCLUDE REGEX "./snd_([a-zA-Z0-9_]+)\.cpp$")
file(GLOB_RECURSE SOURCES_CLIENT_SND "./new/*.c*")
list(APPEND SOURCES_CLIENT ${SOURCES_CLIENT_SND})
endif()
set(OLD_VALUE ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
if(USE_INTERNAL_MAD)
add_subdirectory("../libmad" "./libmad" EXCLUDE_FROM_ALL)
target_link_libraries(omohclient INTERFACE mad)
else()
include(FindPackageHandleStandardArgs)
find_path(LIBMAD_INCLUDE_DIRS mad.h)
find_library(LIBMAD_LIBRARIES mad)
find_package_handle_standard_args(
LibMad
DEFAULT_MSG
LIBMAD_LIBRARIES
LIBMAD_INCLUDE_DIRS
)
target_include_directories(omohclient INTERFACE ${LIBMAD_INCLUDE_DIRS})
target_link_libraries(omohclient INTERFACE ${LIBMAD_LIBRARIES})
endif()
set(BUILD_SHARED_LIBS ${OLD_VALUE} CACHE BOOL "" FORCE)
target_sources(omohclient INTERFACE ${SOURCES_CLIENT} ${SOURCES_UILIB})

View file

@ -334,6 +334,9 @@ writing the actual data can begin
*/
qboolean CL_OpenAVIForWriting( const char *fileName )
{
return qfalse;
// Removed in OPM
#if 0
if( afd.fileOpen )
return qfalse;
@ -425,6 +428,7 @@ qboolean CL_OpenAVIForWriting( const char *fileName )
afd.fileOpen = qtrue;
return qtrue;
#endif
}
/*

View file

@ -23,8 +23,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "client.h"
#include "cl_ui.h"
#include "cl_uiradar.h"
#include "../qcommon/tiki.h"
#include "../qcommon/localization.h"
#include "../qcommon/bg_compat.h"
extern qboolean loadCamera(const char *name);
extern void startCamera(int time);
@ -209,20 +211,20 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
}
snapshot->numEntities = 0;
for ( i = 0 ; i < count ; i++ ) {
for(i = 0; i < MAX_ENTITIES_IN_SNAPSHOT; i++) {
parents[i] = -1;
}
for (i = 0; i < count; i++) {
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
pnum = s1->parent;
if (pnum == ENTITYNUM_NONE) {
parents[s1->number] = -2;
}
else
{
} else {
if (parents[pnum] == -2) {
parents[s1->number] = -2;
}
else
{
} else {
// add it later
parents[s1->number] = pnum;
continue;
@ -232,33 +234,37 @@ qboolean CL_GetSnapshot( int snapshotNumber, snapshot_t *snapshot ) {
snapshot->entities[snapshot->numEntities++] = *s1;
}
for(pcount = 0; pcount < 8 && snapshot->numEntities != count; pcount++)
{
for (i = 0; i < count; i++)
{
for(pcount = 0; pcount < 8 && snapshot->numEntities != count; pcount++) {
for (i = 0; i < count; i++) {
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
pnum = parents[s1->number];
if (pnum >= 0 && parents[pnum] == -2) {
parents[s1->number] = -2;
snapshot->entities[snapshot->numEntities++] = *s1;
}
}
}
if (pcount >= 8)
{
for (i = count; i < snapshot->numEntities; i++)
if (snapshot->numEntities != count) {
Com_DPrintf("CL_GetSnapshot: Not all children could find their parents.\n");
for (i = snapshot->numEntities; i < count; i++)
{
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + i) & (MAX_PARSE_ENTITIES - 1)];
if (parents[s1->number] >= 0) {
Com_DPrintf(
"CL_GetSnapshot: entity %d with parent %d and model '%s' at %.2f %.2f %.2f, could not find parent.\n",
s1->number,
s1->parent,
CL_ConfigString(CS_MODELS + s1->modelindex),
s1->origin[0],
s1->origin[1],
s1->origin[2]
);
for (pnum = 0; pnum < count; pnum++) {
s1 = &cl.parseEntities[(clSnap->parseEntitiesNum + pnum) & (MAX_PARSE_ENTITIES - 1)];
if (parents[s1->number] >= 0) {
Com_DPrintf(
"CL_GetSnapshot: entity %d with parent %d and model '%s' at %.2f %.2f %.2f, could not find parent.\n",
s1->number,
s1->parent,
CL_ConfigString(CS_MODELS + s1->modelindex),
s1->origin[0],
s1->origin[1],
s1->origin[2]
);
parents[s1->number] = -2;
}
}
}
}
@ -297,6 +303,7 @@ void CL_ConfigstringModified(int index, char* s) {
gameState_t oldGs;
size_t len;
index = CPT_NormalizeConfigstring(index);
if ( index < 0 || index >= MAX_CONFIGSTRINGS ) {
Com_Error( ERR_DROP, "configstring > MAX_CONFIGSTRINGS" );
}
@ -355,7 +362,9 @@ qboolean CL_ProcessServerCommand(const char* origString, const char* cmd, qboole
// because this function might be called from a module that would be unloaded
// inside Com_Error
UI_ForceMenuOff(1);
Cbuf_AddText("disconnect;pushmenu disconnected");
// Fixed in OPM
// Added a newline for next commands
Cbuf_AddText("disconnect;pushmenu disconnected\n");
return qtrue;
}
@ -392,8 +401,8 @@ Set up argc/argv for the given command
===================
*/
qboolean CL_GetServerCommand( int serverCommandNumber, qboolean differentServer ) {
char *s;
char *cmd;
char *s;
char *cmd;
static char bigConfigString[BIG_INFO_STRING];
// if we have irretrievably lost a reliable command, drop the connection
@ -418,9 +427,39 @@ qboolean CL_GetServerCommand( int serverCommandNumber, qboolean differentServer
Com_DPrintf( "serverCommand: %i : %s\n", serverCommandNumber, s );
}
Cmd_TokenizeString( s );
Cmd_TokenizeString(s);
cmd = Cmd_Argv(0);
// Readded in OPM (from ioquake)
// Configstring big buffer
if (!strcmp(cmd, "bcs0")) {
Com_sprintf(bigConfigString, BIG_INFO_STRING, "cs %s \"%s", Cmd_Argv(1), Cmd_Argv(2));
return qfalse;
}
if (!strcmp(cmd, "bcs1")) {
s = Cmd_Argv(2);
if (strlen(bigConfigString) + strlen(s) >= BIG_INFO_STRING) {
Com_Error(ERR_DROP, "bcs exceeded BIG_INFO_STRING");
}
strcat(bigConfigString, s);
return qfalse;
}
if (!strcmp(cmd, "bcs2")) {
s = Cmd_Argv(2);
if (strlen(bigConfigString) + strlen(s) + 1 >= BIG_INFO_STRING) {
Com_Error(ERR_DROP, "bcs exceeded BIG_INFO_STRING");
}
strcat(bigConfigString, s);
strcat(bigConfigString, "\"");
s = bigConfigString;
// reparse
Cmd_TokenizeString(s);
cmd = Cmd_Argv(0);
}
return CL_ProcessServerCommand(s, cmd, differentServer);
}
@ -432,10 +471,10 @@ CL_CM_LoadMap
Just adds default parameters that cgame doesn't need to know about
====================
*/
void CL_CM_LoadMap( const char *mapname ) {
int checksum;
CM_LoadMap( mapname, qtrue, &checksum );
void CL_CM_LoadMap( const char *mapname, int *checksum ) {
CM_LoadMap( mapname, qtrue, checksum );
// prepare world vis data
re.SetWorldVisData(CM_VisibilityPointer());
}
/*
@ -538,6 +577,29 @@ void CL_StartLocalSound(const char* soundName, qboolean forceLoad) {
S_StartLocalSound(soundName, qfalse );
}
/*
====================
CL_RestoreSavedCgameState
====================
*/
void CL_RestoreSavedCgameState() {
if (cls.savedCgameState) {
cge->CG_LoadStateToBuffer(cls.savedCgameState, cls.savedCgameStateSize, cl.snap.serverTime);
}
}
/*
====================
CL_ClearSavedCgameState
====================
*/
void CL_ClearSavedCgameState() {
if (cls.savedCgameState) {
cls.savedCgameState = NULL;
cls.savedCgameStateSize = 0;
}
}
/*
====================
CL_InitCGameDLL
@ -554,6 +616,7 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
cgi->Printf = Com_Printf;
cgi->DPrintf = Com_DPrintf;
cgi->DebugPrintf = Com_DebugPrintf;
cgi->Malloc = CL_CG_Malloc;
cgi->Free = CL_CG_Free;
@ -564,7 +627,9 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
cgi->LV_ConvertString = Sys_LV_CL_ConvertString;
cgi->Cvar_Get = Cvar_Get;
cgi->Cvar_Find = Cvar_FindVar;
cgi->Cvar_Set = Cvar_Set;
cgi->Cvar_CheckRange = Cvar_CheckRange;
cgi->Argc = Cmd_Argc;
cgi->Args = Cmd_Args;
@ -579,6 +644,8 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
cgi->FS_FreeFile = FS_FreeFile;
cgi->FS_WriteFile = FS_WriteFile;
cgi->FS_WriteTextFile = FS_WriteTextFile;
cgi->FS_ListFilteredFiles = FS_ListFilteredFiles;
cgi->FS_FreeFileList = FS_FreeFileList;
cgi->SendConsoleCommand = Cbuf_AddText;
@ -650,9 +717,11 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
cgi->R_RegisterModel = re.RegisterModel;
cgi->R_SpawnEffectModel = re.SpawnEffectModel;
cgi->R_RegisterServerModel = re.RegisterServerModel;
cgi->R_GetModelName = re.GetModelName;
cgi->R_UnregisterServerModel = re.UnregisterServerModel;
cgi->R_RegisterShader = re.RegisterShader;
cgi->R_RegisterShaderNoMip = re.RegisterShaderNoMip;
cgi->R_GetShaderName = re.GetShaderName;
cgi->R_AddRefEntityToScene = re.AddRefEntityToScene;
cgi->R_AddRefSpriteToScene = re.AddRefSpriteToScene;
@ -704,7 +773,9 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
cgi->UI_ShowMenu = UI_ShowMenu;
cgi->UI_HideMenu = UI_HideMenu;
cgi->UI_FontStringWidth = uie.FontStringWidth;
cgi->UI_FontStringWidth = CL_FontStringWidth;
cgi->UI_GetObjectivesTop = UI_GetObjectivesTop;
cgi->UI_GetHighResolutionScale = UI_GetHighResolutionScale;
cgi->Key_StringToKeynum = Key_StringToKeynum;
cgi->Key_KeynumToBindString = Key_KeynumToBindString;
cgi->Key_GetKeysForCommand = Key_GetKeysForCommand;
@ -743,11 +814,16 @@ void CL_InitCGameDLL( clientGameImport_t *cgi, clientGameExport_t **cge ) {
cgi->UI_SetScoreBoardItem = UI_SetScoreBoardItem;
cgi->UI_DeleteScoreBoardItems = UI_DeleteScoreBoardItems;
cgi->UI_ToggleDMMessageConsole = UI_ToggleDMConsole;
cgi->CL_InitRadar = CL_InitRadar;
cgi->TIKI_FindTiki = TIKI_FindTiki;
cgi->LoadResource = UI_LoadResource;
cgi->FS_CanonicalFilename = FS_CanonicalFilename;
cgi->CL_RestoreSavedCgameState = CL_RestoreSavedCgameState;
cgi->CL_ClearSavedCgameState = CL_ClearSavedCgameState;
cgi->getConfigStringIdNormalized = CPT_NormalizeConfigstring;
cgi->fsDebug = fs_debug;
cgi->HudDrawElements = cls.HudDrawElements;
@ -848,7 +924,13 @@ void CL_InitCGame( void ) {
// find the current mapname
info = cl.gameState.stringData + cl.gameState.stringOffsets[ CS_SERVERINFO ];
mapname = Info_ValueForKey( info, "mapname" );
Com_sprintf( cl.mapname, sizeof( cl.mapname ), "maps/%s.bsp", mapname );
if (CL_UseLargeLightmap(mapname)) {
Com_sprintf(cl.mapname, sizeof(cl.mapname), "maps/%s.bsp", mapname);
} else {
// Added in 2.0
Com_sprintf(cl.mapname, sizeof(cl.mapname), "maps/%s_sml.bsp", mapname);
}
S_BeginRegistration();
CL_ShutdownCGame();
@ -863,10 +945,17 @@ void CL_InitCGame( void ) {
CL_InitClientSavedData();
}
// init for this gamestate
// use the lastExecutedServerCommand instead of the serverCommandSequence
// otherwise server commands sent just before a gamestate are dropped
cge->CG_Init( &cgi, clc.serverMessageSequence, clc.lastExecutedServerCommand, clc.clientNum );
if (cl.snap.valid) {
// init for this gamestate
// use the lastExecutedServerCommand instead of the serverCommandSequence
// otherwise server commands sent just before a gamestate are dropped
cge->CG_Init(&cgi, clc.serverMessageSequence, clc.lastExecutedServerCommand, clc.clientNum);
} else {
// executing client commands from previous map/server might be an issue, some commands might be cs commands,
// like old CS_SYSTEMINFO configstrings which still contain the sv_serverId from previous map.
// It would cause the client to lose the game state number
cge->CG_Init(&cgi, clc.serverMessageSequence, clc.serverCommandSequence, clc.clientNum);
}
ClearNewConfigFlag();
TIKI_FinishLoad();
@ -902,8 +991,6 @@ qboolean CL_GameCommand( void ) {
return cge->CG_ConsoleCommand();
}
/*
=====================
CL_CGameRendering
@ -918,6 +1005,10 @@ void CL_CGameRendering( stereoFrame_t stereo ) {
cge->CG_DrawActiveFrame( cl.serverTime, cl.serverTime - cl.oldServerTime, stereo, clc.demoplaying );
cl.oldServerTime = cl.serverTime;
//
// Let cgame clean up temp models
//
cge->CG_CleanUpTempModels();
}
/*
@ -1039,6 +1130,42 @@ void CL_FirstSnapshot( void ) {
Cbuf_AddText( cl_activeAction->string );
Cvar_Set( "activeAction", "" );
}
#ifdef USE_MUMBLE
if ((cl_useMumble->integer) && !mumble_islinked()) {
int ret = mumble_link(CLIENT_WINDOW_TITLE);
Com_Printf("Mumble: Linking to Mumble application %s\n", ret==0?"ok":"failed");
}
#endif
#ifdef USE_VOIP
if (!clc.voipCodecInitialized) {
int i;
int error;
clc.opusEncoder = opus_encoder_create(48000, 1, OPUS_APPLICATION_VOIP, &error);
if ( error ) {
Com_DPrintf("VoIP: Error opus_encoder_create %d\n", error);
return;
}
for (i = 0; i < MAX_CLIENTS; i++) {
clc.opusDecoder[i] = opus_decoder_create(48000, 1, &error);
if ( error ) {
Com_DPrintf("VoIP: Error opus_decoder_create(%d) %d\n", i, error);
return;
}
clc.voipIgnore[i] = qfalse;
clc.voipGain[i] = 1.0f;
}
clc.voipCodecInitialized = qtrue;
clc.voipMuteAll = qfalse;
Cmd_AddCommand ("voip", CL_Voip_f);
Cvar_Set("cl_voipSendTarget", "spatial");
Com_Memset(clc.voipTargets, ~0, sizeof(clc.voipTargets));
}
#endif
}
static int lastSnapFlags;
@ -1089,20 +1216,23 @@ void CL_SetCGameTime( void ) {
// allow pause in single player
if ( paused->integer && com_sv_running->integer ) {
// paused
CL_AdjustTimeDelta();
//CL_AdjustTimeDelta();
// Fixed in OPM
// Keep in sync with the server time.
// In OG, the game could lag for a short time
// when pausing and unpausing frequently
cl.serverTimeDelta = cl.snap.serverTime - cls.realtime;
return;
}
// FIXME
//if( ( cl.snap.snapFlags ^ lastSnapFlags ) & SNAPFLAG_SERVERCOUNT ) {
// CL_ServerRestarted();
//} else {
if( ( cl.snap.snapFlags ^ lastSnapFlags ) & SNAPFLAG_SERVERCOUNT ) {
CL_ServerRestarted();
} else {
if( cl.snap.serverTime < cl.oldFrameServerTime ) {
assert( 0 );
Com_Error( ERR_DROP, "cl.snap.serverTime < cl.oldFrameServerTime" );
}
//}
}
cl.oldFrameServerTime = cl.snap.serverTime;

View file

@ -35,6 +35,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../uilib/ui_public.h"
#include "snd_local.h"
#include "cl_ui.h"
#define MAXSIZE 8
#define MINSIZE 4
@ -55,6 +57,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
static void RoQ_init( void );
static void CL_FinishedCinematic();
/******************************************************************************
*
@ -126,6 +129,10 @@ typedef struct {
int playonwalls;
byte* buf;
long drawX, drawY;
long realTime;
long currTime;
long soundTime;
} cin_cache;
static cinematics_t cin;
@ -133,6 +140,10 @@ static cin_cache cinTable[MAX_VIDEO_HANDLES];
static int currentHandle = -1;
static int CL_handle = -1;
static connstate_t oldClientState;
static int audioStartTime = 0;
extern "C" int s_soundtime; // sample PAIRS
@ -160,7 +171,7 @@ static int CIN_HandleForVideo(void) {
}
extern "C" int CL_ScaledMilliseconds(void);
extern "C" int Com_Milliseconds(void);
//-----------------------------------------------------------------------------
// RllSetupTable
@ -1142,24 +1153,20 @@ redump:
case ZA_SOUND_MONO:
if (!cinTable[currentHandle].silent) {
ssize = RllDecodeMonoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags);
S_RawSamples(0, ssize, 22050, 2, 1, (byte *)sbuf, 1.0f, -1);
// S_RawSamples(0, ssize, 22050, 2, 1, (byte *)sbuf, 1.0f, -1);
}
break;
case ZA_SOUND_STEREO:
if (!cinTable[currentHandle].silent) {
if (cinTable[currentHandle].numQuads == -1) {
S_Update();
s_rawend[0] = s_soundtime;
}
ssize = RllDecodeStereoToStereo( framedata, sbuf, cinTable[currentHandle].RoQFrameSize, 0, (unsigned short)cinTable[currentHandle].roq_flags);
S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
// S_RawSamples(0, ssize, 22050, 2, 2, (byte *)sbuf, 1.0f, -1);
}
break;
case ROQ_QUAD_INFO:
if (cinTable[currentHandle].numQuads == -1) {
readQuadInfo( framedata );
setupQuad( 0, 0 );
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = CL_ScaledMilliseconds();
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = Com_Milliseconds();
}
if (cinTable[currentHandle].numQuads != 1) cinTable[currentHandle].numQuads = 0;
break;
@ -1226,7 +1233,10 @@ redump:
static void RoQ_init( void )
{
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = CL_ScaledMilliseconds();
cinTable[currentHandle].startTime = cinTable[currentHandle].lastTime = Com_Milliseconds();
cinTable[currentHandle].realTime = Com_Milliseconds();
cinTable[currentHandle].currTime = 0;
cinTable[currentHandle].soundTime = 0;
cinTable[currentHandle].RoQPlayed = 24;
@ -1273,8 +1283,10 @@ static void RoQShutdown( void ) {
cinTable[currentHandle].iFile = 0;
}
S_StopMovieAudio();
if (cinTable[currentHandle].alterGameState) {
clc.state = CA_DISCONNECTED;
clc.state = oldClientState;
// we can't just do a vstr nextmap, because
// if we are aborting the intro cinematic with
// a devmap command, nextmap would be valid by
@ -1286,8 +1298,29 @@ static void RoQShutdown( void ) {
}
CL_handle = -1;
}
cinTable[currentHandle].fileName[0] = 0;
currentHandle = -1;
CL_FinishedCinematic();
}
static void CL_FinishedCinematic()
{
const char* s;
if (!CL_FinishedIntro())
{
CL_FinishedStartStage();
return;
}
s = Cvar_VariableString("nextmap");
if (*s)
{
Cbuf_ExecuteText(EXEC_APPEND, va("%s\n", s));
Cvar_Set("nextmap", "");
}
}
/*
@ -1328,8 +1361,11 @@ Fetch and decompress the pending frame
e_status CIN_RunCinematic (int handle)
{
int start = 0;
int thisTime = 0;
int deltaTime;
int frameTime;
int soundTime;
int newTime;
long tfps;
if (handle < 0 || handle>= MAX_VIDEO_HANDLES || cinTable[handle].status == FMV_EOF) return FMV_EOF;
@ -1357,24 +1393,46 @@ e_status CIN_RunCinematic (int handle)
return cinTable[currentHandle].status;
}
thisTime = CL_ScaledMilliseconds();
if (cinTable[currentHandle].shader && (abs(thisTime - cinTable[currentHandle].lastTime))>100) {
cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime;
frameTime = Com_Milliseconds();
deltaTime = frameTime - cinTable[currentHandle].realTime;
if (deltaTime > 100) {
deltaTime = 100;
}
cinTable[currentHandle].tfps = (((CL_ScaledMilliseconds() - cinTable[currentHandle].startTime)*3)/100);
start = cinTable[currentHandle].startTime;
while( (cinTable[currentHandle].tfps != cinTable[currentHandle].numQuads)
newTime = cinTable[currentHandle].currTime + deltaTime;
if (cl_movieaudio->integer) {
soundTime = S_CurrentMoviePosition();
if (soundTime > cinTable[currentHandle].currTime || soundTime > cinTable[currentHandle].soundTime) {
cinTable[currentHandle].currTime = newTime + (deltaTime * (soundTime - newTime)) / 100;
}
else {
cinTable[currentHandle].currTime = newTime;
}
cinTable[currentHandle].soundTime = soundTime;
} else {
//
// Fixed in OPM
//
cinTable[currentHandle].currTime = newTime;
}
cinTable[currentHandle].realTime = frameTime;
tfps = (cinTable[currentHandle].currTime * 3) / 100;
while( (tfps != cinTable[currentHandle].numQuads)
&& (cinTable[currentHandle].status == FMV_PLAY) )
{
RoQInterrupt();
if (start != cinTable[currentHandle].startTime) {
cinTable[currentHandle].tfps = (((CL_ScaledMilliseconds() - cinTable[currentHandle].startTime)*3)/100);
start = cinTable[currentHandle].startTime;
cinTable[currentHandle].realTime = Com_Milliseconds();
if (cinTable[currentHandle].realTime > frameTime + 66) {
break;
}
}
cinTable[currentHandle].lastTime = thisTime;
cinTable[currentHandle].lastTime = frameTime;
if (cinTable[currentHandle].status == FMV_LOOPED) {
cinTable[currentHandle].status = FMV_PLAY;
@ -1422,7 +1480,7 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
cin.currentHandle = currentHandle;
strcpy(cinTable[currentHandle].fileName, name);
Q_strncpyz(cinTable[currentHandle].fileName, name, sizeof(cinTable[currentHandle].fileName));
cinTable[currentHandle].ROQSize = 0;
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
@ -1468,10 +1526,6 @@ int CIN_PlayCinematic( const char *arg, int x, int y, int w, int h, int systemBi
clc.state = CA_CINEMATIC;
}
if (!cinTable[currentHandle].silent) {
s_rawend[0] = s_soundtime;
}
return currentHandle;
}
Com_DPrintf("trFMV::play(), invalid RoQ ID\n");
@ -1583,43 +1637,106 @@ void CIN_DrawCinematic (int handle) {
CIN_ResampleCinematic(handle, buf2);
re.DrawStretchRaw( x, y, w, h, 256, 256, (byte *)buf2, 0, qfalse);
re.DrawStretchRaw( x, y, w, h, 256, 256, 0, (byte *)buf2);
cinTable[handle].dirty = qfalse;
Hunk_FreeTempMemory(buf2);
return;
}
re.DrawStretchRaw( x, y, w, h, cinTable[handle].drawX, cinTable[handle].drawY, buf, 0, qfalse);
re.DrawStretchRaw( x, y, w, h, cinTable[handle].drawX, cinTable[handle].drawY, 0, buf);
cinTable[handle].dirty = qfalse;
}
static unsigned short CL_PlayRoQ(const char* name, const char* arg, const char* s) {
unsigned short RoQID;
Com_Memset(&cin, 0, sizeof(cinematics_t) );
currentHandle = CIN_HandleForVideo();
cin.currentHandle = currentHandle;
Q_strncpyz(cinTable[currentHandle].fileName, name, sizeof(cinTable[currentHandle].fileName));
cinTable[currentHandle].ROQSize = 0;
cinTable[currentHandle].ROQSize = FS_FOpenFileRead (cinTable[currentHandle].fileName, &cinTable[currentHandle].iFile, qtrue, qtrue);
if (cinTable[currentHandle].ROQSize<=0) {
Com_DPrintf("Can not find RoQ cinematic '%s'\n", name);
CL_FinishedCinematic();
return -1;
}
if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
cinTable[currentHandle].holdAtEnd = qtrue;
}
CIN_SetExtents(currentHandle, 0, 0, 640, 480);
cinTable[currentHandle].alterGameState = qtrue;
initRoQ();
FS_Read (cin.file, 16, cinTable[currentHandle].iFile);
RoQID = (unsigned short)(cin.file[0]) + (unsigned short)(cin.file[1])*256;
if (RoQID == 0x1084)
{
RoQ_init();
// FS_Read (cin.file, cinTable[currentHandle].RoQFrameSize+8, cinTable[currentHandle].iFile);
cinTable[currentHandle].status = FMV_PLAY;
Com_DPrintf("trFMV::play(), playing %s\n", arg);
if (cl_movieaudio->integer) {
audioStartTime = Com_Milliseconds();
S_SetupMovieAudio(name);
}
oldClientState = clc.state;
clc.state = CA_CINEMATIC;
if (cls.glconfig.maxTextureSize <= 256 || s && *s == '2') {
//cinTable[currentHandle].interlaced = qtrue;
}
CL_handle = currentHandle;
do {
SCR_RunCinematic();
} while (!cinTable[currentHandle].buf && cinTable[currentHandle].status == FMV_PLAY);
UI_CloseConsole();
return currentHandle;
}
Com_DPrintf("trFMV::play(), invalid RoQ ID\n");
RoQShutdown();
return -1;
}
void CL_PlayCinematic_f(void) {
char *arg, *s;
int bits = CIN_system;
char name[256];
Com_DPrintf("CL_PlayCinematic_f\n");
if (clc.state == CA_CINEMATIC) {
SCR_StopCinematic();
}
arg = Cmd_Argv( 1 );
Com_DPrintf("CL_PlayCinematic( %s )\n", arg);
s = Cmd_Argv(2);
if ((s && s[0] == '1') || Q_stricmp(arg,"demoend.roq")==0 || Q_stricmp(arg,"end.roq")==0) {
bits |= CIN_hold;
}
if (s && s[0] == '2') {
bits |= CIN_loop;
CL_StartHunkUsers(qfalse);
S_StopAllSounds2(qtrue);
Com_sprintf(name, sizeof(name), "video/%s", arg);
if (Q_stricmp(&name[strlen(name) - 4], ".roq")) {
Com_Printf("Bad or missing cinematic extension.\n");
return;
}
S_StopAllSounds( qtrue );
CL_handle = CIN_PlayCinematic( arg, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, bits );
if (CL_handle >= 0) {
do {
SCR_RunCinematic();
} while (cinTable[currentHandle].buf == NULL && cinTable[currentHandle].status == FMV_PLAY); // wait for first frame (load codebook and sound)
}
CL_PlayRoQ(name, arg, s);
}
@ -1639,7 +1756,5 @@ void SCR_RunCinematic (void)
void SCR_StopCinematic(void) {
if (CL_handle >= 0 && CL_handle < MAX_VIDEO_HANDLES) {
CIN_StopCinematic(CL_handle);
S_StopAllSounds( qtrue );
CL_handle = -1;
}
}

View file

@ -56,6 +56,10 @@ qboolean in_guimouse;
kbutton_t in_up, in_down;
#ifdef USE_VOIP
kbutton_t in_voiprecord;
#endif
kbutton_t in_buttons[16];
qboolean in_mlooking;
@ -258,6 +262,20 @@ void IN_SpeedUp(void) {IN_KeyUp(&in_speed);}
void IN_StrafeDown(void) {IN_KeyDown(&in_strafe);}
void IN_StrafeUp(void) {IN_KeyUp(&in_strafe);}
#ifdef USE_VOIP
void IN_VoipRecordDown(void)
{
IN_KeyDown(&in_voiprecord);
Cvar_Set("cl_voipSend", "1");
}
void IN_VoipRecordUp(void)
{
IN_KeyUp(&in_voiprecord);
Cvar_Set("cl_voipSend", "0");
}
#endif
void IN_Button0Down(void) {IN_KeyDown(&in_buttons[0]);}
void IN_Button0Up(void) {IN_KeyUp(&in_buttons[0]);}
void IN_Button1Down(void) {IN_KeyDown(&in_buttons[1]);}
@ -432,7 +450,7 @@ void CL_MouseEvent( int dx, int dy, int time ) {
if( cl.mousey > cls.glconfig.vidHeight )
cl.mousey = cls.glconfig.vidHeight;
}
else
else if ( !paused->integer )
{
cl.mouseDx[cl.mouseIndex] += dx;
cl.mouseDy[cl.mouseIndex] += dy;
@ -461,6 +479,16 @@ CL_JoystickMove
void CL_JoystickMove( usercmd_t *cmd ) {
float anglespeed;
float yaw = j_yaw->value * cl.joystickAxis[j_yaw_axis->integer];
float right = j_side->value * cl.joystickAxis[j_side_axis->integer];
float forward = j_forward->value * cl.joystickAxis[j_forward_axis->integer];
float pitch = j_pitch->value * cl.joystickAxis[j_pitch_axis->integer];
float up = j_up->value * cl.joystickAxis[j_up_axis->integer];
if ( in_speed.active ^ cl_run->integer ) {
cmd->buttons |= BUTTON_RUN;
}
if ( in_speed.active ) {
anglespeed = 0.001 * cls.frametime * cl_anglespeedkey->value;
} else {
@ -468,18 +496,22 @@ void CL_JoystickMove( usercmd_t *cmd ) {
}
if ( !in_strafe.active ) {
cl.viewangles[YAW] += anglespeed * cl_yawspeed->value * cl.joystickAxis[AXIS_SIDE];
cl.viewangles[YAW] += anglespeed * yaw;
cmd->rightmove = ClampChar( cmd->rightmove + (int)right );
} else {
cmd->rightmove = ClampChar( cmd->rightmove + cl.joystickAxis[AXIS_SIDE] );
cl.viewangles[YAW] += anglespeed * right;
cmd->rightmove = ClampChar( cmd->rightmove + (int)yaw );
}
if ( in_mlooking ) {
cl.viewangles[PITCH] += anglespeed * cl_pitchspeed->value * cl.joystickAxis[AXIS_FORWARD];
cl.viewangles[PITCH] += anglespeed * forward;
cmd->forwardmove = ClampChar( cmd->forwardmove + (int)pitch );
} else {
cmd->forwardmove = ClampChar( cmd->forwardmove + cl.joystickAxis[AXIS_FORWARD] );
cl.viewangles[PITCH] += anglespeed * pitch;
cmd->forwardmove = ClampChar( cmd->forwardmove + (int)forward );
}
cmd->upmove = ClampChar( cmd->upmove + cl.joystickAxis[AXIS_UP] );
cmd->upmove = ClampChar( cmd->upmove + (int)up );
}
/*
@ -565,6 +597,8 @@ void CL_MouseMove( usercmd_t *cmd ) {
mx *= cgameSensitivity;
my *= cgameSensitivity;
cmd->buttons |= BUTTON_ANY;
// add mouse X/Y movement to cmd
if(in_strafe.active)
cmd->rightmove = ClampChar(cmd->rightmove + m_side->value * mx);
@ -575,6 +609,14 @@ void CL_MouseMove( usercmd_t *cmd ) {
cl.viewangles[PITCH] += m_pitch->value * my;
else
cmd->forwardmove = ClampChar(cmd->forwardmove - m_forward->value * my);
if (!isfinite(cl.viewangles[PITCH]) || !isfinite(cl.viewangles[YAW])) {
Com_DPrintf("Invalid client viewangles encountered (view pitch: %f, view yaw: %f)!\n", cl.viewangles[PITCH], cl.viewangles[YAW]);
Com_DPrintf("cgameSensitivity: %f | mx: %f | my: %f | m_pitch: %f | m_yaw: %f\n", cgameSensitivity, mx, my, m_pitch->value, m_yaw->value);
Com_DPrintf("Resetting client viewangles\n");
cl.viewangles[PITCH] = 0;
cl.viewangles[YAW] = 0;
}
}
/*
@ -609,8 +651,8 @@ void CL_CmdButtons( usercmd_t *cmd ) {
if (UI_MenuActive() || UI_ConsoleIsOpen()) {
cmd->buttons |= BUTTON_TALK;
}
if (in_speed.active == !cl_run->integer) {
if ( in_speed.active ^ cl_run->integer ) {
cmd->buttons |= BUTTON_RUN;
}
@ -718,6 +760,12 @@ void CL_CreateNewCommands( void ) {
frame_msec = com_frameTime - old_com_frameTime;
// if running over 1000fps, act as if each frame is 1ms
// prevents divisions by zero
if ( frame_msec < 1 ) {
frame_msec = 1;
}
// if running less than 5fps, truncate the extra time to prevent
// unexpected moves after a hitch
if ( frame_msec > 200 ) {
@ -818,8 +866,8 @@ qboolean CL_ReadyToSendPacket( void ) {
}
// check for exceeding cl_maxpackets
if ( cl_maxpackets->integer < 15 ) {
Cvar_Set( "cl_maxpackets", "15" );
if ( cl_maxpackets->integer < 30 ) {
Cvar_Set( "cl_maxpackets", "30" );
} else if ( cl_maxpackets->integer > 125 ) {
Cvar_Set( "cl_maxpackets", "125" );
}
@ -909,6 +957,58 @@ void CL_WritePacket( void ) {
count = MAX_PACKET_USERCMDS;
Com_Printf("MAX_PACKET_USERCMDS\n");
}
#ifdef USE_VOIP
if (clc.voipOutgoingDataSize > 0)
{
if((clc.voipFlags & VOIP_SPATIAL) || Com_IsVoipTarget(clc.voipTargets, sizeof(clc.voipTargets), -1))
{
MSG_WriteByte (&buf, clc_voipOpus);
MSG_WriteByte (&buf, clc.voipOutgoingGeneration);
MSG_WriteLong (&buf, clc.voipOutgoingSequence);
MSG_WriteByte (&buf, clc.voipOutgoingDataFrames);
MSG_WriteData (&buf, clc.voipTargets, sizeof(clc.voipTargets));
MSG_WriteByte(&buf, clc.voipFlags);
MSG_WriteShort (&buf, clc.voipOutgoingDataSize);
MSG_WriteData (&buf, clc.voipOutgoingData, clc.voipOutgoingDataSize);
// If we're recording a demo, we have to fake a server packet with
// this VoIP data so it gets to disk; the server doesn't send it
// back to us, and we might as well eliminate concerns about dropped
// and misordered packets here.
if(clc.demorecording && !clc.demowaiting)
{
const int voipSize = clc.voipOutgoingDataSize;
msg_t fakemsg;
byte fakedata[MAX_MSGLEN];
MSG_Init (&fakemsg, fakedata, sizeof (fakedata));
MSG_Bitstream (&fakemsg);
MSG_WriteLong (&fakemsg, clc.reliableAcknowledge);
MSG_WriteByte (&fakemsg, svc_voipOpus);
MSG_WriteShort (&fakemsg, clc.clientNum);
MSG_WriteByte (&fakemsg, clc.voipOutgoingGeneration);
MSG_WriteLong (&fakemsg, clc.voipOutgoingSequence);
MSG_WriteByte (&fakemsg, clc.voipOutgoingDataFrames);
MSG_WriteShort (&fakemsg, clc.voipOutgoingDataSize );
MSG_WriteBits (&fakemsg, clc.voipFlags, VOIP_FLAGCNT);
MSG_WriteData (&fakemsg, clc.voipOutgoingData, voipSize);
MSG_WriteByte (&fakemsg, svc_EOF);
CL_WriteDemoMessage (&fakemsg, 0);
}
clc.voipOutgoingSequence += clc.voipOutgoingDataFrames;
clc.voipOutgoingDataSize = 0;
clc.voipOutgoingDataFrames = 0;
}
else
{
// We have data, but no targets. Silently discard all data
clc.voipOutgoingDataSize = 0;
clc.voipOutgoingDataFrames = 0;
}
}
#endif
if ( count >= 1 ) {
if ( cl_showSend->integer ) {
Com_Printf( "(%i)", count );
@ -965,16 +1065,6 @@ void CL_WritePacket( void ) {
}
CL_Netchan_Transmit (&clc.netchan, &buf);
// clients never really should have messages large enough
// to fragment, but in case they do, fire them all off
// at once
// TTimo: this causes a packet burst, which is bad karma for winsock
// added a WARNING message, we'll see if there are legit situations where this happens
while ( clc.netchan.unsentFragments ) {
Com_DPrintf( "WARNING: #462 unsent fragments (not supposed to happen!)\n" );
CL_Netchan_TransmitNextFragment( &clc.netchan );
}
}
/*
@ -991,7 +1081,7 @@ void CL_SendCmd( void ) {
}
// don't send commands if paused
if ( com_sv_running->integer && paused->integer && paused->integer ) {
if ( com_sv_running->integer && paused->integer ) {
return;
}
@ -1051,8 +1141,8 @@ void CL_InitInput( void ) {
Cmd_AddCommand("-leanleft", IN_LeanLeftUp);
Cmd_AddCommand("+leanright", IN_LeanRightDown);
Cmd_AddCommand("-leanright", IN_LeanRightUp);
Cmd_AddCommand("+speed", IN_SpeedUp);
Cmd_AddCommand("-speed", IN_SpeedDown);
Cmd_AddCommand("+speed", IN_SpeedDown);
Cmd_AddCommand("-speed", IN_SpeedUp);
Cmd_AddCommand("+button0", IN_Button0Down);
Cmd_AddCommand("-button0", IN_Button0Up);
Cmd_AddCommand("+button1", IN_Button1Down);
@ -1086,6 +1176,85 @@ void CL_InitInput( void ) {
Cmd_AddCommand("+mlook", IN_MLookDown);
Cmd_AddCommand("-mlook", IN_MLookUp);
#ifdef USE_VOIP
Cmd_AddCommand ("+voiprecord", IN_VoipRecordDown);
Cmd_AddCommand ("-voiprecord", IN_VoipRecordUp);
#endif
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0);
cl_debugMove = Cvar_Get ("cl_debugMove", "0", 0);
}
/*
============
CL_ShutdownInput
============
*/
void CL_ShutdownInput(void)
{
Cmd_RemoveCommand("centerview");
Cmd_RemoveCommand("+moveup");
Cmd_RemoveCommand("-moveup");
Cmd_RemoveCommand("+movedown");
Cmd_RemoveCommand("-movedown");
Cmd_RemoveCommand("+left");
Cmd_RemoveCommand("-left");
Cmd_RemoveCommand("+right");
Cmd_RemoveCommand("-right");
Cmd_RemoveCommand("+forward");
Cmd_RemoveCommand("-forward");
Cmd_RemoveCommand("+back");
Cmd_RemoveCommand("-back");
Cmd_RemoveCommand("+lookup");
Cmd_RemoveCommand("-lookup");
Cmd_RemoveCommand("+lookdown");
Cmd_RemoveCommand("-lookdown");
Cmd_RemoveCommand("+strafe");
Cmd_RemoveCommand("-strafe");
Cmd_RemoveCommand("+moveleft");
Cmd_RemoveCommand("-moveleft");
Cmd_RemoveCommand("+moveright");
Cmd_RemoveCommand("-moveright");
Cmd_RemoveCommand("+speed");
Cmd_RemoveCommand("-speed");
Cmd_RemoveCommand("+attack");
Cmd_RemoveCommand("-attack");
Cmd_RemoveCommand("+button0");
Cmd_RemoveCommand("-button0");
Cmd_RemoveCommand("+button1");
Cmd_RemoveCommand("-button1");
Cmd_RemoveCommand("+button2");
Cmd_RemoveCommand("-button2");
Cmd_RemoveCommand("+button3");
Cmd_RemoveCommand("-button3");
Cmd_RemoveCommand("+button4");
Cmd_RemoveCommand("-button4");
Cmd_RemoveCommand("+button5");
Cmd_RemoveCommand("-button5");
Cmd_RemoveCommand("+button6");
Cmd_RemoveCommand("-button6");
Cmd_RemoveCommand("+button7");
Cmd_RemoveCommand("-button7");
Cmd_RemoveCommand("+button8");
Cmd_RemoveCommand("-button8");
Cmd_RemoveCommand("+button9");
Cmd_RemoveCommand("-button9");
Cmd_RemoveCommand("+button10");
Cmd_RemoveCommand("-button10");
Cmd_RemoveCommand("+button11");
Cmd_RemoveCommand("-button11");
Cmd_RemoveCommand("+button12");
Cmd_RemoveCommand("-button12");
Cmd_RemoveCommand("+button13");
Cmd_RemoveCommand("-button13");
Cmd_RemoveCommand("+button14");
Cmd_RemoveCommand("-button14");
Cmd_RemoveCommand("+mlook");
Cmd_RemoveCommand("-mlook");
#ifdef USE_VOIP
Cmd_RemoveCommand("+voiprecord");
Cmd_RemoveCommand("-voiprecord");
#endif
}

View file

@ -0,0 +1,640 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#include "cl_ui.h"
#include "cl_instantAction.h"
#include "cl_uiserverlist.h"
#include "../gamespy/sv_gamespy.h"
Event EV_UIInstantAction_AcceptServer
(
"acceptserver",
EV_DEFAULT,
NULL,
NULL,
"Connect to the current server"
);
Event EV_UIInstantAction_RejectServer
(
"rejectserver",
EV_DEFAULT,
NULL,
NULL,
"Reject the current server"
);
Event EV_UIInstantAction_Cancel
(
"ia_cancel",
EV_DEFAULT,
NULL,
NULL,
"cancel the server update"
);
Event EV_UIInstantAction_Refresh
(
"ia_refresh",
EV_DEFAULT,
NULL,
NULL,
"Refresh the server list"
);
CLASS_DECLARATION(UIWidget, UIInstantAction, NULL) {
{&EV_UIInstantAction_AcceptServer, &UIInstantAction::Connect },
{&EV_UIInstantAction_RejectServer, &UIInstantAction::Reject },
{&EV_UIInstantAction_Cancel, &UIInstantAction::CancelRefresh},
{&EV_UIInstantAction_Refresh, &UIInstantAction::Refresh },
{NULL, NULL }
};
struct ServerListInstance {
int iServerType;
UIInstantAction *pServerList;
};
ServerListInstance g_IAServerListInst[2];
UIInstantAction::UIInstantAction()
{
state = IA_INITIALIZE;
numFoundServers = 0;
numServers = 0;
minPlayers = 3;
startingMaxPing = 100;
endingMaxPing = 1500;
maxServers = -1;
servers = NULL;
doneList[0] = false;
doneList[1] = false;
serverList[0] = NULL;
serverList[1] = NULL;
ReadIniFile();
EnableServerInfo(false);
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_refresh_button", new Event(EV_Widget_Disable));
}
UIInstantAction::~UIInstantAction()
{
CleanUp();
}
void UIInstantAction::CleanUp()
{
if (serverList[0]) {
ServerListFree(serverList[0]);
serverList[0] = NULL;
}
if (serverList[1]) {
ServerListFree(serverList[1]);
serverList[1] = NULL;
}
if (servers) {
delete[] servers;
servers = NULL;
}
}
void UIInstantAction::Init()
{
const char *secret_key;
const char *game_name;
static const unsigned int iNumConcurrent = 10;
numFoundServers = 0;
numServers = 0;
doneList[0] = false;
doneList[1] = false;
EnableServerInfo(false);
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_refresh_button", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_noserverfound", new Event(EV_Widget_Disable));
Cvar_Set("ia_search_percentage", va("%d %%", 0));
if (com_target_game->integer < target_game_e::TG_MOHTT) {
g_IAServerListInst[0].iServerType = com_target_game->integer;
g_IAServerListInst[0].pServerList = this;
game_name = GS_GetGameName(com_target_game->integer);
secret_key = GS_GetGameKey(com_target_game->integer);
serverList[0] = ServerListNew(
game_name,
game_name,
secret_key,
iNumConcurrent,
(void *)&IAServerListCallBack,
1,
(void *)&g_IAServerListInst[0]
);
ServerListClear(serverList[0]);
} else {
g_IAServerListInst[0].iServerType = target_game_e::TG_MOHTT;
g_IAServerListInst[0].pServerList = this;
game_name = GS_GetGameName(target_game_e::TG_MOHTT);
secret_key = GS_GetGameKey(target_game_e::TG_MOHTT);
serverList[0] = ServerListNew(
game_name,
game_name,
secret_key,
iNumConcurrent,
(void *)&IAServerListCallBack,
1,
(void *)&g_IAServerListInst[0]
);
ServerListClear(serverList[0]);
g_IAServerListInst[1].iServerType = target_game_e::TG_MOHTA;
g_IAServerListInst[1].pServerList = this;
game_name = GS_GetGameName(target_game_e::TG_MOHTA);
secret_key = GS_GetGameKey(target_game_e::TG_MOHTA);
serverList[1] = ServerListNew(
game_name,
game_name,
secret_key,
iNumConcurrent,
(void *)&IAServerListCallBack,
1,
(void *)&g_IAServerListInst[1]
);
ServerListClear(serverList[1]);
}
state = IA_WAITING;
numFoundServers = 0;
ServerListUpdate(serverList[0], true);
if (serverList[1]) {
ServerListUpdate(serverList[1], true);
}
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("searchstatus", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("searchstatuslable", new Event(EV_Widget_Enable));
}
int UIInstantAction::GetServerIndex(int maxPing, int gameType)
{
int bestPing = 1500;
int bestServer = -1;
int i;
for (i = 0; i < numFoundServers; i++) {
const IAServer_t& IAServer = servers[i];
char *gameVer;
float fGameVer;
int ping;
int numPlayers;
if (IAServer.rejected) {
continue;
}
// Skip servers that don't match the provided game type
if (ServerGetIntValue(IAServer.server, "g_gametype_i", 1) != gameType) {
continue;
}
// Skip servers with high ping
ping = ServerGetPing(IAServer.server);
if (ping > maxPing) {
continue;
}
gameVer = ServerGetStringValue(IAServer.server, "gamever", "1.00");
if (com_target_demo->integer && *gameVer != 'd') {
// Skip retail servers on demo game
continue;
} else if (!com_target_demo->integer && *gameVer == 'd') {
// Skip demo servers on retail game
continue;
}
// Skip incompatible servers
fGameVer = atof(gameVer);
if (com_target_game->integer >= target_game_e::TG_MOHTT) {
if (IAServer.serverGame.serverType == target_game_e::TG_MOHTT) {
if (fabs(fGameVer) < 2.3f) {
continue;
}
} else {
if (fabs(fGameVer) < 2.1f) {
continue;
}
}
} else {
if (fabs(fGameVer - com_target_version->value) > 0.1f) {
continue;
}
}
// Skip servers with a password
if (ServerGetIntValue(IAServer.server, "password", 0)) {
continue;
}
// Skip servers that don't match the minimum number of players
numPlayers = ServerGetIntValue(IAServer.server, "numplayers", 0);
if (numPlayers < minPlayers) {
continue;
}
// Skip full servers
if (numPlayers == ServerGetIntValue(IAServer.server, "maxplayers", 0)) {
continue;
}
// Skip servers with an higher ping than the best one
if (ping >= bestPing) {
continue;
}
//
// Found a potential server
//
bestPing = ping;
bestServer = i;
}
return bestServer;
}
void UIInstantAction::ReadIniFile()
{
char *buffer;
const char *p;
const char *pVal;
int intValue;
char value[32];
if (!FS_ReadFileEx("iaction.ini", (void **)&buffer, qtrue)) {
return;
}
for (p = buffer; p; p = strstr(pVal, "\n")) {
if (sscanf(p, "%31s", value) != 1) {
break;
}
pVal = strstr(p, "=");
if (!pVal) {
break;
}
pVal++;
if (sscanf(pVal, "%d", &intValue) != 1) {
break;
}
if (!Q_stricmpn(value, "MinPlayers", 10)) {
minPlayers = intValue;
}
if (!Q_stricmpn(value, "StartingMaxPing", 15)) {
startingMaxPing = intValue;
}
if (!Q_stricmpn(value, "EndingMaxPing", 13)) {
endingMaxPing = intValue;
}
if (!Q_stricmpn(value, "MaxServers", 10)) {
maxServers = intValue;
}
}
}
void UIInstantAction::FindServer()
{
int ping;
int i;
currentServer = -1;
state = IA_NONE;
for (ping = startingMaxPing; ping < endingMaxPing; ping += 100) {
//
// Find the best server starting from FFA gametype first
//
for (i = 1; i < 7; i++) {
currentServer = GetServerIndex(ping, i);
if (currentServer >= 0) {
break;
}
}
if (currentServer >= 0) {
break;
}
}
menuManager.PassEventToWidget("ia_refresh_button", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_cancel_button", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("searchstatus", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("searchstatuslable", new Event(EV_Widget_Disable));
if (currentServer < 0) {
EnableServerInfo(false);
menuManager.PassEventToWidget("ia_noserverfound", new Event(EV_Widget_Enable));
return;
}
const IAServer_t& IAServer = servers[currentServer];
const char *hostname = ServerGetStringValue(IAServer.server, "hostname", "(NONE)");
const char *gametype = ServerGetStringValue(IAServer.server, "gametype", "(NONE)");
int numplayers = ServerGetIntValue(IAServer.server, "numplayers", 0);
int maxplayers = ServerGetIntValue(IAServer.server, "maxplayers", 0);
ping = ServerGetPing(IAServer.server);
Cvar_Set("ia_servername", va(" %s", hostname));
Cvar_Set("ia_ping", va("%d", ping));
Cvar_Set("ia_gametype", va("%s", gametype));
Cvar_Set("ia_players", va("%d", numplayers));
Cvar_Set("ia_maxplayers", va("%d", maxplayers));
EnableServerInfo(true);
}
void UIInstantAction::Connect(Event *ev)
{
char *gameVer;
float fGameVer;
bool bDiffVersion;
char command[256];
if (currentServer < 0 || currentServer < numServers) {
return;
}
const IAServer_t& IAServer = servers[currentServer];
gameVer = ServerGetStringValue(IAServer.server, "gamever", "1.00");
if (gameVer[0] == 'd') {
gameVer++;
}
// Skip incompatible servers
fGameVer = atof(gameVer);
bDiffVersion = false;
if (com_target_game->integer >= target_game_e::TG_MOHTT) {
if (IAServer.serverGame.serverType == target_game_e::TG_MOHTT) {
if (fabs(fGameVer) < 2.3f) {
bDiffVersion = true;
}
} else {
if (fabs(fGameVer) < 2.1f) {
bDiffVersion = true;
}
}
} else {
if (fabs(fGameVer - com_target_version->value) > 0.1f) {
bDiffVersion = true;
}
}
if (bDiffVersion) {
if (fGameVer - com_target_version->value > 0) {
// Older version
UI_SetReturnMenuToCurrent();
Cvar_Set("com_errormessage", va("Server is version %s, you are using %s", gameVer, "2.40"));
UI_PushMenu("wrongversion");
} else {
// Server version is newer
Cvar_Set("dm_serverstatus", va("Can not connect to v%s server, you are using v%s", gameVer, "2.40"));
}
}
UI_SetReturnMenuToCurrent();
Cvar_Set("g_servertype", va("%d", servers[currentServer].serverGame.serverType));
Com_sprintf(
command,
sizeof(command),
"connect %s:%i\n",
ServerGetAddress(IAServer.server),
ServerGetIntValue(IAServer.server, "hostport", PORT_SERVER)
);
Cbuf_AddText(command);
}
void UIInstantAction::Reject(Event *ev)
{
servers[currentServer].rejected = 1;
FindServer();
}
void UIInstantAction::Draw()
{
switch (state) {
case IA_INITIALIZE:
Init();
break;
case IA_UPDATE:
Update();
break;
case IA_FINISHED:
FindServer();
break;
default:
break;
}
if (serverList[0]) {
ServerListThink(serverList[0]);
}
if (serverList[1]) {
ServerListThink(serverList[1]);
}
}
void UIInstantAction::Update()
{
numFoundServers = 0;
// count the total number of servers from both server list
numServers = ServerListCount(serverList[0]);
if (serverList[1]) {
numServers += ServerListCount(serverList[1]);
}
state = IA_FINISHED;
servers = new IAServer_t[numServers];
ServerListHalt(serverList[0]);
if (serverList[1]) {
ServerListHalt(serverList[1]);
}
ServerListThink(serverList[0]);
if (serverList[1]) {
ServerListThink(serverList[1]);
}
state = IA_SEARCHING;
// Start updating the first list
doneList[0] = false;
ServerListClear(serverList[0]);
ServerListUpdate(serverList[0], true);
// Update the second optional list
if (serverList[1]) {
doneList[1] = false;
ServerListClear(serverList[1]);
ServerListUpdate(serverList[1], true);
}
}
int UIInstantAction::AddServer(GServer server, const ServerGame_t& serverGame)
{
servers[numFoundServers].server = server;
servers[numFoundServers].serverGame = serverGame;
servers[numFoundServers].rejected = false;
numFoundServers++;
return numFoundServers;
}
void UIInstantAction::CancelRefresh(Event *ev)
{
state = IA_FINISHED;
ServerListHalt(serverList[0]);
ServerListHalt(serverList[1]);
}
void UIInstantAction::Refresh(Event *ev)
{
state = IA_INITIALIZE;
}
void UIInstantAction::EnableServerInfo(bool enable)
{
if (enable) {
menuManager.PassEventToWidget("iaservername_label", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_servername_field", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_ping_label", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_ping_field", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_gametype_label", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_gametype_field", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_players_label", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_players_field", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_maxplayers_label", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("ia_maxplayers_field", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("acceptserver", new Event(EV_Widget_Enable));
menuManager.PassEventToWidget("rejectserver", new Event(EV_Widget_Enable));
} else {
menuManager.PassEventToWidget("iaservername_label", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_servername_field", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_ping_label", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_ping_field", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_gametype_label", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_gametype_field", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_players_label", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_players_field", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_maxplayers_label", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("ia_maxplayers_field", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("acceptserver", new Event(EV_Widget_Disable));
menuManager.PassEventToWidget("rejectserver", new Event(EV_Widget_Disable));
}
}
void UIInstantAction::IAServerListCallBack(GServerList serverlist, int msg, void *instance, void *param1, void *param2)
{
const ServerListInstance *pInstance = (const ServerListInstance *)instance;
UIInstantAction *pServerList = pInstance->pServerList;
if (msg == LIST_PROGRESS) {
if (pServerList->state == IA_WAITING) {
if (pInstance->iServerType == com_target_game->integer) {
pServerList->doneList[0] = true;
}
if (com_target_game->integer >= target_game_e::TG_MOHTT && pInstance->iServerType == target_game_e::TG_MOHTA) {
pServerList->doneList[1] = true;
}
if (pServerList->doneList[0] && (!pServerList->serverList[1] || pServerList->doneList[1])) {
pServerList->state = IA_UPDATE;
}
} else if (pServerList->state == IA_SEARCHING) {
ServerGame_t serverGame;
serverGame.serverType = pInstance->iServerType;
const int serverIndex = pServerList->AddServer((GServer)param1, serverGame);
Cvar_Set("ia_search_percentage", va("%d %%", 100 * serverIndex / pServerList->numServers));
if (pServerList->maxServers >= 0 && serverIndex >= pServerList->maxServers) {
// Reached the maximum number of servers, stop there
pServerList->doneList[0] = true;
ServerListHalt(pServerList->serverList[0]);
if (pServerList->serverList[1]) {
pServerList->doneList[1] = true;
ServerListHalt(pServerList->serverList[1]);
}
pServerList->state = IA_FINISHED;
}
}
} else if (msg == LIST_STATECHANGED && ServerListState(serverlist) == GServerListState::sl_idle) {
if (pInstance->iServerType == com_target_game->integer) {
pServerList->doneList[0] = true;
}
if (com_target_game->integer >= target_game_e::TG_MOHTT && pInstance->iServerType == target_game_e::TG_MOHTA) {
pServerList->doneList[1] = true;
}
if (pServerList->doneList[0] && (!pServerList->serverList[1] || pServerList->doneList[1])) {
if (pServerList->state == IA_WAITING) {
pServerList->state = IA_UPDATE;
}
if (pServerList->state == IA_SEARCHING) {
pServerList->state = IA_FINISHED;
}
}
}
}

View file

@ -0,0 +1,103 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// Added in 2.30
// Instantly find a server matching common criterias
#pragma once
#include "../gamespy/goaceng.h"
typedef struct {
int serverType;
} ServerGame_t;
typedef struct {
GServer server;
ServerGame_t serverGame;
bool rejected;
} IAServer_t;
enum IAState_e {
IA_NONE,
IA_INITIALIZE,
IA_WAITING,
IA_UPDATE,
IA_SEARCHING,
IA_FINISHED
};
class UIInstantAction : public UIWidget
{
public:
CLASS_PROTOTYPE(UIInstantAction);
public:
UIInstantAction();
~UIInstantAction() override;
void CleanUp();
void Init();
int GetServerIndex(int maxPing, int gameType);
void ReadIniFile();
void FindServer();
void Connect(Event *ev);
void Reject(Event *ev);
void Draw();
void Update();
int AddServer(GServer server, const ServerGame_t& serverGame);
void CancelRefresh(Event *ev);
void Refresh(Event *ev);
void EnableServerInfo(bool enable);
private:
static void IAServerListCallBack(GServerList serverlist, int msg, void *instance, void *param1, void *param2);
private:
//
// List
//
bool doneList[2];
GServerList serverList[2];
int maxServers;
//
// Current states
//
IAState_e state;
int numServers;
int numFoundServers;
//
// Filters
//
int minPlayers;
int startingMaxPing;
int endingMaxPing;
//
// Servers
//
IAServer_t *servers;
int currentServer;
};

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,175 +20,198 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_INV_H__
#define __CL_INV_H__
#pragma once
typedef enum { INV_MOVE_NONE, INV_MOVE_BOB, INV_MOVE_SPIN } inv_move_type;
typedef enum { INV_CASCADE_LEFT, INV_CASCADE_RIGHT } inv_cascade_type;
typedef enum { INV_HUDANGLES_BASE, INV_HUDANGLES_COMPASS, INV_HUDANGLES_COMPASS_NEEDLE } inv_hudangles_type;
typedef enum {
INV_MOVE_NONE,
INV_MOVE_BOB,
INV_MOVE_SPIN
} inv_move_type;
class item_properties_t : public Class {
public:
float scale;
Vector angles;
Vector angledeltas;
Vector rotateoffset;
Vector offset;
inv_move_type move;
str model;
str anim;
};
typedef enum {
INV_ALIGN_NONE,
INV_ALIGN_LEFT,
INV_ALIGN_RIGHT
} inv_align_type;
class inventory_item_t : public Class {
public:
str name;
str ammoname;
int equip;
int width;
int height;
int barwidth;
int barheight;
int baroffsetY;
int baroffsetX;
float modelWindowX;
float modelWindowY;
float modelWindowWidth;
float modelWindowHeight;
bool selShaderOnTop;
bool checkammo;
str command;
inv_hudangles_type anglesType;
item_properties_t hudprops;
item_properties_t invprops;
UIReggedMaterial *bgshader;
UIReggedMaterial *barshader;
UIReggedMaterial *selshader;
};
typedef enum {
INV_CASCADE_LEFT,
INV_CASCADE_RIGHT
} inv_cascade_type;
class inventory_type_t {
public:
str name;
bool bg_tile;
UIReggedMaterial *texture;
UIReggedMaterial *bg;
UIReggedMaterial *hoverTexture;
UIReggedMaterial *selTexture;
Container<inventory_item_t *> items;
typedef enum {
INV_HUDANGLES_BASE,
INV_HUDANGLES_COMPASS,
INV_HUDANGLES_COMPASS_NEEDLE
} inv_hudangles_type;
int IndexOfItemPtr( inventory_item_t *item );
};
inline
int inventory_type_t::IndexOfItemPtr( inventory_item_t *item )
class item_properties_t : public Class
{
for( int i = items.NumObjects(); i > 0; i-- )
{
if( items.ObjectAt( i ) == item )
{
return i;
}
}
public:
float scale;
Vector angles;
Vector angledeltas;
Vector rotateoffset;
Vector offset;
inv_move_type move;
str model;
str anim;
};
return 0;
class inventory_item_t : public Class
{
public:
str name;
str ammoname;
int equip;
int width;
int height;
int barwidth;
int barheight;
int baroffsetY;
int baroffsetX;
float modelWindowX;
float modelWindowY;
float modelWindowWidth;
float modelWindowHeight;
bool selShaderOnTop;
bool checkammo;
str command;
inv_hudangles_type anglesType;
item_properties_t hudprops;
item_properties_t invprops;
UIReggedMaterial *bgshader;
UIReggedMaterial *barshader;
UIReggedMaterial *selshader;
};
class inventory_type_t
{
public:
str name;
bool bg_tile;
UIReggedMaterial *texture;
UIReggedMaterial *bg;
UIReggedMaterial *hoverTexture;
UIReggedMaterial *selTexture;
Container<inventory_item_t *> items;
int IndexOfItemPtr(inventory_item_t *item);
};
inline int inventory_type_t::IndexOfItemPtr(inventory_item_t *item)
{
for (int i = items.NumObjects(); i > 0; i--) {
if (items.ObjectAt(i) == item) {
return i;
}
}
return 0;
}
class inventory_t {
class inventory_t
{
public:
int typewidth;
int typeheight;
int horizoffset;
int vertoffset;
int align;
inv_cascade_type cascade;
str selectsound;
str rejectsound;
str changesound;
Container<inventory_type_t *> types;
int typewidth;
int typeheight;
int horizoffset;
int vertoffset;
inv_align_type align;
inv_cascade_type cascade;
str selectsound;
str rejectsound;
str changesound;
Container<inventory_type_t *> types;
void Clear() { types.ClearObjectList(); }
public:
inventory_t();
~inventory_t();
inventory_t(const inventory_t& other);
inventory_t& operator=(const inventory_t& other);
void Clear();
};
class invlistener : public Listener {
class invlistener : public Listener
{
protected:
inventory_t *inv;
inventory_type_t *curtype;
inventory_item_t *curitem;
int defaultWidth;
int defaultHeight;
int defaultBarWidth;
int defaultBarHeight;
int defaultBarOffsetX;
int defaultBarOffsetY;
inventory_t *inv;
inventory_type_t *curtype;
inventory_item_t *curitem;
int defaultWidth;
int defaultHeight;
int defaultBarWidth;
int defaultBarHeight;
int defaultBarOffsetX;
int defaultBarOffsetY;
public:
CLASS_PROTOTYPE( invlistener );
CLASS_PROTOTYPE(invlistener);
protected:
void verify_curitem( void );
void verify_curtype( void );
void verify_one_arg( Event *ev );
void verify_curitem(void);
void verify_curtype(void);
void verify_one_arg(Event *ev);
public:
invlistener( inventory_t *i );
invlistener();
invlistener(inventory_t *i);
invlistener();
bool Load( Script& script );
void InvSelectSound( Event *ev );
void InvRejectSound( Event *ev );
void InvChangeSound( Event *ev );
void InvWidth( Event *ev );
void InvHeight( Event *ev );
void InvHorizOffset( Event *ev );
void InvVertOffset( Event *ev );
void InvAlign( Event *ev );
void InvCascade( Event *ev );
void Typedef( Event *ev );
void OpenBrace( Event *ev );
void CloseBrace( Event *ev );
void ButtonShader( Event *ev );
void HoverShader( Event *ev );
void SelShader( Event *ev );
void Background( Event *ev );
void BackgroundTile( Event *ev );
void Width( Event *ev );
void Height( Event *ev );
void BarWidth( Event *ev );
void BarHeight( Event *ev );
void BarOffsetX( Event *ev );
void BarOffsetY( Event *ev );
void Item( Event *ev );
void Ammo( Event *ev );
void Equip( Event *ev );
void CheckAmmo( Event *ev );
void Command( Event *ev );
void BGShader( Event *ev );
void BarShader( Event *ev );
void SelItemShader( Event *ev );
void SelItemShaderOnTop( Event *ev );
void RotateOffset( Event *ev );
void Offset( Event *ev );
void Model( Event *ev );
void Anim( Event *ev );
void Scale( Event *ev );
void Angles( Event *ev );
void AngleDeltas( Event *ev );
void Move( Event *ev );
void ModelWindow( Event *ev );
void HudRotateOffset( Event *ev );
void HudOffset( Event *ev );
void HudModel( Event *ev );
void HudAnim( Event *ev );
void HudScale( Event *ev );
void HudAngles( Event *ev );
void HudAngleDeltas( Event *ev );
void HudMove( Event *ev );
void HudCompassAngles( Event *ev );
void HudCompassNeedleAngles( Event *ev );
bool Load(Script& script);
void InvSelectSound(Event *ev);
void InvRejectSound(Event *ev);
void InvChangeSound(Event *ev);
void InvWidth(Event *ev);
void InvHeight(Event *ev);
void InvHorizOffset(Event *ev);
void InvVertOffset(Event *ev);
void InvAlign(Event *ev);
void InvCascade(Event *ev);
void Typedef(Event *ev);
void OpenBrace(Event *ev);
void CloseBrace(Event *ev);
void ButtonShader(Event *ev);
void HoverShader(Event *ev);
void SelShader(Event *ev);
void Background(Event *ev);
void BackgroundTile(Event *ev);
void Width(Event *ev);
void Height(Event *ev);
void BarWidth(Event *ev);
void BarHeight(Event *ev);
void BarOffsetX(Event *ev);
void BarOffsetY(Event *ev);
void Item(Event *ev);
void Ammo(Event *ev);
void Equip(Event *ev);
void CheckAmmo(Event *ev);
void Command(Event *ev);
void BGShader(Event *ev);
void BarShader(Event *ev);
void SelItemShader(Event *ev);
void SelItemShaderOnTop(Event *ev);
void RotateOffset(Event *ev);
void Offset(Event *ev);
void Model(Event *ev);
void Anim(Event *ev);
void Scale(Event *ev);
void Angles(Event *ev);
void AngleDeltas(Event *ev);
void Move(Event *ev);
void ModelWindow(Event *ev);
void HudRotateOffset(Event *ev);
void HudOffset(Event *ev);
void HudModel(Event *ev);
void HudAnim(Event *ev);
void HudScale(Event *ev);
void HudAngles(Event *ev);
void HudAngleDeltas(Event *ev);
void HudMove(Event *ev);
void HudCompassAngles(Event *ev);
void HudCompassNeedleAngles(Event *ev);
};
bool CL_LoadInventory( const char *filename, inventory_t *inv );
inventory_item_t *CL_GetInvItemByName( inventory_t *inv, const char *name );
qboolean CL_HasInventoryItem( const char *name );
void CL_AmmoCount( const char *name, int *ammo_count, int *max_ammo_count );
#endif // __CL_INV_H__
bool CL_LoadInventory(const char *filename, inventory_t *inv);
inventory_item_t *CL_GetInvItemByName(inventory_t *inv, const char *name);
qboolean CL_HasInventoryItem(const char *name);
void CL_AmmoCount(const char *name, int *ammo_count, int *max_ammo_count);

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,79 +20,102 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_INVRENDER_H__
#define __CL_INVRENDER_H__
#pragma once
class FakkInventory;
typedef enum { selectsound, rejectsound, changesound } invsound_t;
class FakkItemList : public UIWidget {
typedef enum {
selectsound,
rejectsound,
changesound
} invsound_t;
class FakkItemList : public UIWidget
{
protected:
inventory_type_t *type;
uipopup_describe m_describe[ 10 ];
inventory_item_t *m_hoveritem;
inventory_item_t *m_lastmenuitem;
FakkInventory *m_parent;
float m_hovertop;
inventory_type_t *type;
uipopup_describe m_describe[10];
inventory_item_t *m_hoveritem;
inventory_item_t *m_lastmenuitem;
FakkInventory *m_parent;
float m_hovertop;
public:
CLASS_PROTOTYPE( FakkItemList );
CLASS_PROTOTYPE(FakkItemList);
FakkItemList();
~FakkItemList();
FakkItemList();
~FakkItemList();
void VerifyItemUp( inventory_item_t *item, qboolean warpmouse );
void setType( inventory_type_t *t );
void Create( float x, float y, FakkInventory *parent );
bool HasAnyItems( void );
void Draw( void ) override;
void OnLeftMouseDown( Event *ev );
void OnRightMouseDown( Event *ev );
void OnLeftMouseUp( Event *ev );
void OnRightMouseUp( Event *ev );
void OnMouseMove( Event *ev );
void OnMouseEnter( Event *ev );
void OnMouseLeave( Event *ev );
void OnMenuKilled( Event *ev );
void EquipItem( Event *ev );
void VerifyItemUp(inventory_item_t *item, qboolean warpmouse);
void setType(inventory_type_t *t);
void Create(float x, float y, FakkInventory *parent);
bool HasAnyItems(void);
void Draw(void) override;
void OnLeftMouseDown(Event *ev);
void OnRightMouseDown(Event *ev);
void OnLeftMouseUp(Event *ev);
void OnRightMouseUp(Event *ev);
void OnMouseMove(Event *ev);
void OnMouseEnter(Event *ev);
void OnMouseLeave(Event *ev);
void OnMenuKilled(Event *ev);
void EquipItem(Event *ev);
inventory_item_t *getHoverItem() const;
};
class FakkInventory : public UIWidget {
class FakkInventory : public UIWidget
{
protected:
inventory_t *m_inv;
SafePtr<FakkItemList> m_currentlist;
inventory_type_t *m_currenttype;
int m_currentitemnum;
inventory_t *m_inv;
SafePtr<FakkItemList> m_currentlist;
inventory_type_t *m_currenttype;
int m_currentitemnum;
public:
CLASS_PROTOTYPE( FakkInventory );
protected:
void VerifyItemUp( inventory_item_t *item, qboolean warpmouse );
CLASS_PROTOTYPE(FakkInventory);
public:
FakkInventory();
~FakkInventory();
qboolean m_mouse_active;
void setInventory( inventory_t *i );
void Draw( void ) override;
void OnMouseMove( Event *ev );
void OnMouseLeave( Event *ev );
void OnMouseEnter( Event *ev );
void OnMouseDown( Event *ev );
void WarpTo( const char *name );
void WarpTo( int slotnum );
void NextItem( void );
void PrevItem( void );
qboolean isDying( void );
qboolean KeyEvent( int key, unsigned int time ) override;
void PlaySound( invsound_t type );
void Timeout( Event *ev );
void ChangeItem( int sign );
int FindFirstItem( int itemindex, int sign );
protected:
void VerifyTypeUp(inventory_type_t *t, qboolean warpmouse);
public:
FakkInventory();
~FakkInventory();
void setInventory(inventory_t *i);
void Draw(void) override;
void OnMouseMove(Event *ev);
void OnMouseLeave(Event *ev);
void OnMouseEnter(Event *ev);
void OnMouseDown(Event *ev);
void WarpTo(const char *name);
void WarpTo(int slotnum);
void NextItem(void);
void PrevItem(void);
qboolean isDying(void);
qboolean KeyEvent(int key, unsigned int time) override;
void PlaySound(invsound_t type);
void Timeout(Event *ev);
void ChangeItem(int sign);
int FindFirstItem(int itemindex, int sign);
};
void CL_Draw3DModel( float x, float y, float w, float h, qhandle_t model, vec3_t origin, vec3_t rotateoffset, vec3_t offset, vec3_t angle, vec3_t color, str anim );
qboolean UI_CloseInventory( void );
void CL_Draw3DModel(
float x,
float y,
float w,
float h,
qhandle_t model,
vec3_t origin,
vec3_t rotateoffset,
vec3_t offset,
vec3_t angle,
vec3_t color,
str anim
);
#endif // __CL_INVRENDER_H__
void UI_DoInventory(qboolean activate_mouse);
qboolean UI_CloseInventory(void);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -132,7 +132,7 @@ CL_Netchan_TransmitNextFragment
=================
*/
void CL_Netchan_TransmitNextFragment( netchan_t *chan ) {
Netchan_TransmitNextFragment( chan );
Netchan_TransmitNextFragment( chan, cl_netprofile->integer ? &cls.netprofile.inPackets : NULL );
}
/*
@ -144,7 +144,7 @@ void CL_Netchan_Transmit( netchan_t *chan, msg_t* msg ) {
MSG_WriteByte( msg, clc_EOF );
CL_Netchan_Encode( msg );
Netchan_Transmit( chan, msg->cursize, msg->data );
Netchan_Transmit( chan, msg->cursize, msg->data, cl_netprofile->integer ? &cls.netprofile.inPackets : NULL );
}
extern int oldsize;
@ -158,10 +158,30 @@ CL_Netchan_Process
qboolean CL_Netchan_Process( netchan_t *chan, msg_t *msg ) {
int ret;
ret = Netchan_Process( chan, msg );
ret = Netchan_Process( chan, msg, cl_netprofile->integer ? &cls.netprofile.outPackets : NULL );
if (!ret)
return qfalse;
CL_Netchan_Decode( msg );
newsize += msg->cursize;
return qtrue;
}
/*
=================
CL_NET_OutOfBandPrint
=================
*/
void CL_NET_OutOfBandPrint(netadr_t adr, const char* format, ...) {
va_list argptr;
char string[MAX_MSGLEN];
va_start(argptr, format);
Q_vsnprintf(string, sizeof(string), format, argptr);
va_end(argptr);
NET_OutOfBandPrint(NS_CLIENT, adr, "%s", string);
if (cl_netprofile->integer) {
NetProfileAddPacket(&cls.netprofile.inPackets, strlen(string), NETPROF_PACKET_MESSAGE);
}
}

View file

@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "client.h"
#include "cl_ui.h"
#include "../qcommon/bg_compat.h"
const char *svc_strings[256] = {
"svc_bad",
@ -193,6 +194,69 @@ void CL_ParsePacketEntities( msg_t *msg, clSnapshot_t *oldframe, clSnapshot_t *n
}
}
/*
================
CL_UnpackNonPVSClient
Unpack info about non-visible client.
================
*/
qboolean CL_UnpackNonPVSClient(int* packed, radarUnpacked_t* unpacked) {
int x, y;
int yaw;
qboolean bValid;
float range;
unpacked->clientNum = *packed & (MAX_CLIENTS - 1);
if (unpacked->clientNum == cl.snap.ps.clientNum) {
return qfalse;
}
x = ((*packed >> 6) & 0x7F) - (MAX_CLIENTS - 1);
y = ((*packed >> 13) & 0x7F) - (MAX_CLIENTS - 1);
yaw = (*packed >> 20) & 0x1F;
bValid = (*packed >> 25) & 1;
if (com_radar_range && com_radar_range->value) {
range = com_radar_range->value;
} else {
range = 0;
}
unpacked->x = x * range / (MAX_CLIENTS - 1);
unpacked->y = y * range / (MAX_CLIENTS - 1);
if (!bValid)
{
unpacked->x = x * range / (MAX_CLIENTS - 1) * 1024.0;
unpacked->y = y * range / (MAX_CLIENTS - 1) * 1024.0;
}
unpacked->yaw = yaw * 11.25f;
return qtrue;
}
/*
================
CL_ReadNonPVSClient
Reads packed info about non-visible client.
================
*/
void CL_ReadNonPVSClient(int radarInfo) {
radarUnpacked_t unpacked;
if (!cge) {
return;
}
if (CL_UnpackNonPVSClient(&radarInfo, &unpacked)) {
unpacked.x += cl.snap.ps.origin[0];
unpacked.y += cl.snap.ps.origin[1];
cge->CG_ReadNonPVSClient(&unpacked);
}
}
/*
================
@ -278,6 +342,9 @@ void CL_ParseSnapshot( msg_t *msg ) {
} else {
MSG_ReadDeltaPlayerstate( msg, NULL, &newSnap.ps, cls.serverFrameTime);
}
// get normalized flags
newSnap.ps.pm_flags = CPT_NormalizePlayerStateFlags(newSnap.ps.net_pm_flags);
newSnap.ps.iViewModelAnim = CPT_NormalizeViewModelAnim(newSnap.ps.iNetViewModelAnim);
// read packet entities
SHOWNET( msg, "packet entities" );
@ -328,6 +395,9 @@ void CL_ParseSnapshot( msg_t *msg ) {
}
cl.newSnapshots = qtrue;
// read radar info about invisible clients
CL_ReadNonPVSClient(cl.snap.ps.radarInfo);
}
@ -359,12 +429,24 @@ void CL_SystemInfoChanged( void ) {
// in some cases, outdated cp commands might get sent with this news serverId
cl.serverId = atoi( Info_ValueForKey( systemInfo, "sv_serverid" ) );
#ifdef USE_VOIP
#ifdef LEGACY_PROTOCOL
if(clc.compat)
clc.voipEnabled = qfalse;
else
#endif
{
s = Info_ValueForKey( systemInfo, "sv_voipProtocol" );
clc.voipEnabled = !Q_stricmp(s, "opus");
}
#endif
// don't set any vars when playing a demo
if ( clc.demoplaying ) {
return;
}
s = Info_ValueForKey( systemInfo, "sv_cheats" );
s = Info_ValueForKey( systemInfo, "cheats" );
cl_connectedToCheatServer = atoi( s );
if ( !cl_connectedToCheatServer ) {
Cvar_SetCheatState();
@ -444,35 +526,13 @@ static void CL_ParseServerInfo(void)
sizeof(clc.sv_dlURL));
}
#if TARGET_GAME_PROTOCOL >= 15
char* MSG_ReadGameStateChar(msg_t* msg) {
return MSG_ReadScrambledBigString(msg);
}
float MSG_ReadServerFrameTime(msg_t* msg) {
return MSG_ReadFloat(msg);
}
#else
char* MSG_ReadGameStateChar(msg_t* msg) {
return MSG_ReadString(msg);
}
float MSG_ReadServerFrameTime(msg_t* msg) {
return 1.f / atof(Info_ValueForKey(cl.gameState.stringData + cl.gameState.stringOffsets[CS_SYSTEMINFO], "sv_fps"));
}
#endif
/*
==================
CL_ParseGamestate
==================
*/
void CL_ParseGamestate( msg_t *msg ) {
int i;
int i, csNum;
entityState_t *es;
int newnum;
entityState_t nullstate;
@ -502,22 +562,25 @@ void CL_ParseGamestate( msg_t *msg ) {
}
if ( cmd == svc_configstring ) {
int len;
int len;
i = MSG_ReadShort( msg );
if ( i < 0 || i >= MAX_CONFIGSTRINGS ) {
Com_Error( ERR_DROP, "configstring > MAX_CONFIGSTRINGS" );
}
s = MSG_ReadGameStateChar( msg );
len = strlen( s );
i = MSG_ReadShort(msg);
csNum = CPT_NormalizeConfigstring(i);
if (csNum < 0 || csNum >= MAX_CONFIGSTRINGS) {
Com_Error(ERR_DROP, "configstring > MAX_CONFIGSTRINGS");
return;
}
s = MSG_ReadScrambledBigString(msg);
len = strlen(s);
if ( len + 1 + cl.gameState.dataCount > MAX_GAMESTATE_CHARS ) {
Com_Error( ERR_DROP, "MAX_GAMESTATE_CHARS exceeded" );
}
// append it to the gameState string buffer
cl.gameState.stringOffsets[ i ] = cl.gameState.dataCount;
Com_Memcpy( cl.gameState.stringData + cl.gameState.dataCount, s, len + 1 );
cl.gameState.dataCount += len + 1;
if (len + 1 + cl.gameState.dataCount > MAX_GAMESTATE_CHARS) {
Com_Error(ERR_DROP, "MAX_GAMESTATE_CHARS exceeded");
}
// append it to the gameState string buffer
cl.gameState.stringOffsets[csNum] = cl.gameState.dataCount;
Com_Memcpy(cl.gameState.stringData + cl.gameState.dataCount, s, len + 1);
cl.gameState.dataCount += len + 1;
} else if ( cmd == svc_baseline ) {
newnum = MSG_ReadEntityNum(msg);
if ( newnum < 0 || newnum >= MAX_GENTITIES ) {
@ -526,8 +589,7 @@ void CL_ParseGamestate( msg_t *msg ) {
//Com_Memset (&nullstate, 0, sizeof(nullstate));
MSG_GetNullEntityState(&nullstate);
es = &cl.entityBaselines[ newnum ];
// FIXME: frametime
MSG_ReadDeltaEntity( msg, &nullstate, es, newnum, 0.0);
MSG_ReadDeltaEntity( msg, &nullstate, es, newnum, cls.serverFrameTime);
} else {
Com_Error( ERR_DROP, "CL_ParseGamestate: bad command byte %i", cmd );
}
@ -536,7 +598,7 @@ void CL_ParseGamestate( msg_t *msg ) {
clc.clientNum = MSG_ReadLong(msg);
// read the checksum feed
clc.checksumFeed = MSG_ReadLong( msg );
cls.serverFrameTime = MSG_ReadServerFrameTime(msg);
cls.serverFrameTime = MSG_ReadServerFrameTime(msg, &cl.gameState);
// parse serverId and other cvars
CL_SystemInfoChanged();
@ -544,16 +606,25 @@ void CL_ParseGamestate( msg_t *msg ) {
// stop recording now so the demo won't have an unnecessary level load at the end.
if(cl_autoRecordDemo->integer && clc.demorecording)
CL_StopRecord_f();
// reinitialize the filesystem if the game directory has changed
FS_ConditionalRestart( clc.checksumFeed, qfalse );
if (clc.state == CA_CONNECTED && !Cvar_Get("sv_paks", "", 0)->string[0]) {
// Added in 2.30
FS_Restart(clc.checksumFeed);
} else {
// reinitialize the filesystem if the game directory has changed
FS_ConditionalRestart(clc.checksumFeed, qfalse);
}
clc.state = CA_LOADING;
if (!com_sv_running->integer)
{
const char *info = cl.gameState.stringData + cl.gameState.stringOffsets[CS_SERVERINFO];
UI_ClearState();
UI_BeginLoad(Info_ValueForKey(info, "mapname"));
const char *mapname = Info_ValueForKey(info, "mapname");
// Added in 2.0
Cvar_Set("mapname", mapname);
UI_ClearState();
UI_BeginLoad(mapname);
}
// This used to call CL_StartHunkUsers, but now we enter the download state before loading the
@ -734,6 +805,178 @@ void CL_ParseDownload ( msg_t *msg ) {
}
}
#ifdef USE_VOIP
static
qboolean CL_ShouldIgnoreVoipSender(int sender)
{
if (!cl_voip->integer)
return qtrue; // VoIP is disabled.
else if ((sender == clc.clientNum) && (!clc.demoplaying))
return qtrue; // ignore own voice (unless playing back a demo).
else if (clc.voipMuteAll)
return qtrue; // all channels are muted with extreme prejudice.
else if (clc.voipIgnore[sender])
return qtrue; // just ignoring this guy.
else if (clc.voipGain[sender] == 0.0f)
return qtrue; // too quiet to play.
return qfalse;
}
/*
=====================
CL_PlayVoip
Play raw data
=====================
*/
static void CL_PlayVoip(int sender, int samplecnt, const byte *data, int flags)
{
if(flags & VOIP_DIRECT)
{
S_RawSamples(sender + 1, samplecnt, 48000, 2, 1,
data, clc.voipGain[sender], -1);
}
if(flags & VOIP_SPATIAL)
{
S_RawSamples(sender + MAX_CLIENTS + 1, samplecnt, 48000, 2, 1,
data, 1.0f, sender);
}
}
/*
=====================
CL_ParseVoip
A VoIP message has been received from the server
=====================
*/
static
void CL_ParseVoip ( msg_t *msg, qboolean ignoreData ) {
static short decoded[VOIP_MAX_PACKET_SAMPLES*4]; // !!! FIXME: don't hard code
const int sender = MSG_ReadShort(msg);
const int generation = MSG_ReadByte(msg);
const int sequence = MSG_ReadLong(msg);
const int frames = MSG_ReadByte(msg);
const int packetsize = MSG_ReadShort(msg);
const int flags = MSG_ReadBits(msg, VOIP_FLAGCNT);
unsigned char encoded[4000];
int numSamples;
int seqdiff;
int written = 0;
int i;
Com_DPrintf("VoIP: %d-byte packet from client %d\n", packetsize, sender);
if (sender < 0)
return; // short/invalid packet, bail.
else if (generation < 0)
return; // short/invalid packet, bail.
else if (sequence < 0)
return; // short/invalid packet, bail.
else if (frames < 0)
return; // short/invalid packet, bail.
else if (packetsize < 0)
return; // short/invalid packet, bail.
if (packetsize > sizeof (encoded)) { // overlarge packet?
int bytesleft = packetsize;
while (bytesleft) {
int br = bytesleft;
if (br > sizeof (encoded))
br = sizeof (encoded);
MSG_ReadData(msg, encoded, br);
bytesleft -= br;
}
return; // overlarge packet, bail.
}
MSG_ReadData(msg, encoded, packetsize);
if (ignoreData) {
return; // just ignore legacy speex voip data
} else if (!clc.voipCodecInitialized) {
return; // can't handle VoIP without libopus!
} else if (sender >= MAX_CLIENTS) {
return; // bogus sender.
} else if (CL_ShouldIgnoreVoipSender(sender)) {
return; // Channel is muted, bail.
}
// !!! FIXME: make sure data is narrowband? Does decoder handle this?
Com_DPrintf("VoIP: packet accepted!\n");
seqdiff = sequence - clc.voipIncomingSequence[sender];
// This is a new "generation" ... a new recording started, reset the bits.
if (generation != clc.voipIncomingGeneration[sender]) {
Com_DPrintf("VoIP: new generation %d!\n", generation);
opus_decoder_ctl(clc.opusDecoder[sender], OPUS_RESET_STATE);
clc.voipIncomingGeneration[sender] = generation;
seqdiff = 0;
} else if (seqdiff < 0) { // we're ahead of the sequence?!
// This shouldn't happen unless the packet is corrupted or something.
Com_DPrintf("VoIP: misordered sequence! %d < %d!\n",
sequence, clc.voipIncomingSequence[sender]);
// reset the decoder just in case.
opus_decoder_ctl(clc.opusDecoder[sender], OPUS_RESET_STATE);
seqdiff = 0;
} else if (seqdiff * VOIP_MAX_PACKET_SAMPLES*2 >= sizeof (decoded)) { // dropped more than we can handle?
// just start over.
Com_DPrintf("VoIP: Dropped way too many (%d) frames from client #%d\n",
seqdiff, sender);
opus_decoder_ctl(clc.opusDecoder[sender], OPUS_RESET_STATE);
seqdiff = 0;
}
if (seqdiff != 0) {
Com_DPrintf("VoIP: Dropped %d frames from client #%d\n",
seqdiff, sender);
// tell opus that we're missing frames...
for (i = 0; i < seqdiff; i++) {
assert((written + VOIP_MAX_PACKET_SAMPLES) * 2 < sizeof (decoded));
numSamples = opus_decode(clc.opusDecoder[sender], NULL, 0, decoded + written, VOIP_MAX_PACKET_SAMPLES, 0);
if ( numSamples <= 0 ) {
Com_DPrintf("VoIP: Error decoding frame %d from client #%d\n", i, sender);
continue;
}
written += numSamples;
}
}
numSamples = opus_decode(clc.opusDecoder[sender], encoded, packetsize, decoded + written, ARRAY_LEN(decoded) - written, 0);
if ( numSamples <= 0 ) {
Com_DPrintf("VoIP: Error decoding voip data from client #%d\n", sender);
numSamples = 0;
}
#if 0
static FILE *encio = NULL;
if (encio == NULL) encio = fopen("voip-incoming-encoded.bin", "wb");
if (encio != NULL) { fwrite(encoded, packetsize, 1, encio); fflush(encio); }
static FILE *decio = NULL;
if (decio == NULL) decio = fopen("voip-incoming-decoded.bin", "wb");
if (decio != NULL) { fwrite(decoded+written, numSamples*2, 1, decio); fflush(decio); }
#endif
written += numSamples;
Com_DPrintf("VoIP: playback %d bytes, %d samples, %d frames\n",
written * 2, written, frames);
if(written > 0)
CL_PlayVoip(sender, written, (const byte *) decoded, flags);
clc.voipIncomingSequence[sender] = sequence + frames;
}
#endif
/*
=====================
CL_ParseCommandString
@ -882,8 +1125,16 @@ void CL_ParseServerMessage( msg_t *msg ) {
}
CL_ParseCGMessage( msg );
break;
case svc_voipSpeex:
#ifdef USE_VOIP
CL_ParseVoip( msg, qtrue );
#endif
break;
case svc_voipOpus:
#ifdef USE_VOIP
CL_ParseVoip( msg, !clc.voipEnabled );
#endif
break;
}
}
}

View file

@ -343,7 +343,7 @@ void SCR_DrawDemoRecording( void ) {
}
pos = FS_FTell( clc.demofile );
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
Com_sprintf( string, sizeof( string ), "RECORDING %s: %ik", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue, qfalse );
}
@ -520,16 +520,18 @@ text to the screen.
==================
*/
void SCR_UpdateScreen( void ) {
static int recursive;
static qboolean screen_recursive;
if ( !scr_initialized ) {
return; // not initialized yet
}
if ( ++recursive > 2 ) {
Com_Error( ERR_FATAL, "SCR_UpdateScreen: recursively called" );
if (screen_recursive) {
// already called
return;
}
recursive = 1;
screen_recursive = qtrue;
CL_StartHunkUsers(qfalse);
SCR_SimpleUpdateScreen();
@ -553,6 +555,6 @@ void SCR_UpdateScreen( void ) {
}
}
recursive = 0;
screen_recursive = qfalse;
}

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023-2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,103 +20,137 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_UI_H__
#define __CL_UI_H__
#pragma once
#include "../uilib/ui_extern.h"
#include "../uilib/uiwidget.h"
typedef struct {
UIReggedMaterial *loading;
UIReggedMaterial *loading;
} static_media_t;
//
// cvars
//
extern cvar_t *ui_health_start;
extern cvar_t *ui_health_end;
extern cvar_t *sound_overlay;
extern cvar_t *cl_movieaudio;
//
// initialization
//
void CL_FillUIDef( void );
void CL_InitializeUI( void );
void CL_ShutdownUI( void );
void CL_FillUIDef(void);
void CL_InitializeUI(void);
void CL_ShutdownUI(void);
//
// general ui stuff
//
extern inventory_t client_inv;
extern bind_t client_bind;
extern cvar_t* cl_greenfps;
extern inventory_t client_inv;
extern bind_t client_bind;
extern cvar_t *cl_greenfps;
extern qboolean server_loading;
extern const UColor UWhiteChatMessageColor;
extern const UColor URedChatMessageColor;
extern const UColor UGreenChatMessageColor;
const char *CvarGetForUI( const char *name, const char *defval );
void UI_ClearState( void );
void CL_BeginRegistration( void );
void CL_EndRegistration(void);
const char *CvarGetForUI(const char *name, const char *defval);
void UI_ClearState(void);
void CL_BeginRegistration(void);
void CL_EndRegistration(void);
float UI_GetObjectivesTop(void);
void UI_GetHighResolutionScale(vec2_t scale);
//
// menu
//
extern Menu *ui_pLoadingMenu;
void UI_ShowMenu( const char *name, qboolean bForce );
void UI_HideMenu( const char *name, qboolean bForce );
void UI_ForceMenuOff( bool force );
void UI_PushMenu( const char *name );
void UI_ForceMenu( const char *name );
qboolean UI_BindActive( void );
void UI_ActivateView3D( void );
void UI_MenuEscape( const char *name );
void UI_CreateScoreboard( void );
qboolean UI_MenuActive( void );
qboolean UI_MenuUp( void );
void UI_DrawConnect( void );
void UI_CreateDialog( const char *title, char *cvarname, const char *command, const char *cancelCommand, int width, int height, const char *shader, const char *okshader, const char *cancelshader );
void UI_ToggleDMConsole( int iMode );
void UI_ShowScoreboard_f( const char *pszMenuName );
void UI_HideScoreboard_f( void );
void UI_SetScoreBoardItem( int iItemNumber,
const char *pszData1, const char *pszData2, const char *pszData3, const char *pszData4,
const char *pszData5, const char *pszData6, const char *pszData7, const char *pszData8,
const vec4_t pTextColor, const vec4_t pBackColor, qboolean bIsHeader );
void UI_DeleteScoreBoardItems( int iMaxIndex );
void UI_ShowMenu(const char *name, qboolean bForce);
void UI_HideMenu(const char *name, qboolean bForce);
void UI_ForceMenuOff(bool force);
void UI_PushMenu(const char *name);
void UI_ForceMenu(const char *name);
qboolean UI_BindActive(void);
void UI_SetReturnMenuToCurrent(void);
void UI_ActivateView3D(void);
void UI_MenuEscape(const char *name);
void UI_CreateScoreboard(void);
qboolean UI_MenuActive(void);
qboolean UI_MenuUp(void);
void UI_FocusMenuIfExists(void);
void UI_DrawConnect(void);
void UI_CreateDialog(
const char *title,
char *cvarname,
const char *command,
const char *cancelCommand,
int width,
int height,
const char *shader,
const char *okshader,
const char *cancelshader
);
void UI_ToggleDMConsole(int iMode);
void UI_ShowScoreboard_f(const char *pszMenuName);
void UI_HideScoreboard_f(void);
void UI_SetScoreBoardItem(
int iItemNumber,
const char *pszData1,
const char *pszData2,
const char *pszData3,
const char *pszData4,
const char *pszData5,
const char *pszData6,
const char *pszData7,
const char *pszData8,
const vec4_t pTextColor,
const vec4_t pBackColor,
qboolean bIsHeader
);
void UI_DeleteScoreBoardItems(int iMaxIndex);
//
// ressources
//
void UI_BeginLoad( const char *pszMapName );
void UI_EndLoad( void );
void UI_AbortLoad( void );
void UI_BeginLoadResource( void );
void UI_EndLoadResource( void );
void UI_EndLoadResource( const char *name );
qboolean UI_IsResourceLoaded( const char *name );
void UI_RegisterLoadResource( const char *name );
void UI_ClearResource( void );
void UI_LoadResource( const char *name );
void UI_BeginLoad(const char *pszMapName);
void UI_EndLoad(void);
void UI_AbortLoad(void);
int CL_FontStringWidth(fontheader_t* pFont, const char* pszString, int iMaxLen);
void UI_BeginLoadResource(void);
void UI_EndLoadResource(void);
void UI_EndLoadResource(const char *name);
qboolean UI_IsResourceLoaded(const char *name);
void UI_RegisterLoadResource(const char *name);
void UI_ClearResource(void);
void UI_LoadResource(const char *name);
//
// windows
//
void UI_DeactiveFloatingWindows( void );
void UI_DeactiveFloatingWindows(void);
//
// console
//
void UI_OpenConsole( void );
qboolean UI_ConsoleIsVisible( void );
qboolean UI_ConsoleIsOpen( void );
void UI_CloseConsole( void );
void UI_ToggleConsole( void );
void UI_OpenDMConsole( int iMode );
void UI_CloseDMConsole( void );
void UI_ToggleDMConsole( int iMode );
void UI_OpenDeveloperConsole( void );
void UI_CloseDeveloperConsole( void );
void UI_PrintConsole(const char* msg);
void UI_OpenConsole(void);
qboolean UI_ConsoleIsVisible(void);
qboolean UI_ConsoleIsOpen(void);
void UI_CloseConsole(void);
void UI_ToggleConsole(void);
void UI_OpenDMConsole(int iMode);
void UI_CloseDMConsole(void);
void UI_ToggleDMConsole(int iMode);
void UI_OpenDeveloperConsole(void);
void UI_CloseDeveloperConsole(void);
void UI_PrintConsole(const char *msg);
//
// callbacks
//
void UI_Update( void );
void UI_ServerLoaded( void );
void UI_ResolutionChange( void );
void UI_KeyEvent( int key, unsigned int time );
void UI_CharEvent( int ch );
#endif /* __CL_UI_H__ */
void UI_Update(void);
void UI_ServerLoaded(void);
void UI_ResolutionChange(void);
void UI_KeyEvent(int key, unsigned int time);
void UI_CharEvent(int ch);

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -24,281 +24,529 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
bind_t::bind_t()
{
// FIXME: stub
int i;
commandwidth = 100;
commandheight = 20;
primarykeywidth = 100;
primarykeyheight = 20;
alternatekeywidth = 100;
alternatekeyheight = 20;
fillwidth = 16;
fillmaterial = NULL;
for (i = 0; i < ARRAY_LEN(headermats); i++) {
headermats[i] = NULL;
}
}
bind_t::~bind_t()
{
Clear();
Clear();
}
void bind_t::Clear
(
void
)
void bind_t::Clear(void)
{
// FIXME: stub
for (int i = binds.NumObjects(); i > 0; i--) {
bind_item_t *bi;
bi = binds.ObjectAt(i);
binds.RemoveObjectAt(i);
if (bi) {
delete bi;
}
}
}
CLASS_DECLARATION( Listener, bindlistener, NULL )
{
{ NULL, NULL }
Event EV_Bind_Header
(
"header",
EV_DEFAULT,
"iss",
"column_num name material",
"Set the header of each column"
);
Event EV_Bind_Width
(
"bind_width",
EV_DEFAULT,
"i",
"width",
"Width of the bind menu"
);
Event EV_Bind_Height
(
"bind_height",
EV_DEFAULT,
"i",
"height",
"Height of the bind menu"
);
Event EV_Bind_FillWidth
(
"bind_fillwidth",
EV_DEFAULT,
"iS",
"width material",
"Width of the filling between widgets"
);
Event EV_Bind_CommandWidth
(
"bind_commandwidth",
EV_DEFAULT,
"i",
"width",
"Width of the command item"
);
Event EV_Bind_CommandHeight
(
"bind_commandheight",
EV_DEFAULT,
"i",
"height",
"Height of the command item"
);
Event EV_Bind_PrimaryKeyWidth
(
"bind_primarykeywidth",
EV_DEFAULT,
"i",
"width",
"Width of the primary key item"
);
Event EV_Bind_PrimaryKeyHeight
(
"bind_primarykeyheight",
EV_DEFAULT,
"i",
"height",
"Height of the primary key item"
);
Event EV_Bind_AlternateKeyWidth
(
"bind_alternatekeywidth",
EV_DEFAULT,
"i",
"width",
"Width of the alternate key item"
);
Event EV_Bind_AlternateKeyHeight
(
"bind_alternatekeyheight",
EV_DEFAULT,
"i",
"height",
"Height of the alternate key item"
);
Event EV_Bind_NewItem
(
"binditem",
EV_DEFAULT,
"ss",
"name command",
"Create a new bind item in the interface"
);
Event EV_Bind_Align
(
"align",
EV_DEFAULT,
"sSSSSS",
"arg1 arg2 arg3 arg4 arg5 arg6",
"Set the alignment on the bind menu"
);
Event EV_Bind_TitleForegroundColor
(
"titleforegroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the title foreground"
);
Event EV_Bind_TitleBackgroundColor
(
"titlebackgroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the title background"
);
Event EV_Bind_InactiveForegroundColor
(
"inactiveforegroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the inactive button foreground"
);
Event EV_Bind_InactiveBackgroundColor
(
"inactivebackgroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the inactive button background"
);
Event EV_Bind_ActiveForegroundColor
(
"activeforegroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the active button foreground"
);
Event EV_Bind_ActiveBackgroundColor
(
"activebackgroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the active button background"
);
Event EV_Bind_ActiveBorderColor
(
"activebordercolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the active button border"
);
Event EV_Bind_HighlightForegroundColor
(
"highlightforegroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the highlighted button foreground"
);
Event EV_Bind_HighlightBackgroundColor
(
"highlightbackgroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the highlighted button background"
);
Event EV_Bind_SelectForegroundColor
(
"selectforegroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the selected button foreground"
);
Event EV_Bind_SelectBackgroundColor
(
"selectbackgroundcolor",
EV_DEFAULT,
"ffff",
"r g b a",
"Set the color for the selected button background"
);
Event EV_Bind_ChangeSound
(
"changesound",
EV_DEFAULT,
"s",
"soundname",
"Set the name of the sound to play when the highlighted item changes"
);
Event EV_Bind_ActiveSound
(
"activesound",
EV_DEFAULT,
"s",
"soundname",
"Set the name of the sound to play when the item is made active"
);
Event EV_Bind_EnterSound
(
"entersound",
EV_DEFAULT,
"s",
"soundname",
"Set the name of the sound to play when the key is entered"
);
CLASS_DECLARATION(Listener, bindlistener, NULL) {
{&EV_Bind_Width, &bindlistener::Width },
{&EV_Bind_Height, &bindlistener::Height },
{&EV_Bind_FillWidth, &bindlistener::FillWidth },
{&EV_Bind_CommandWidth, &bindlistener::CommandWidth },
{&EV_Bind_CommandHeight, &bindlistener::CommandHeight },
{&EV_Bind_PrimaryKeyWidth, &bindlistener::PrimaryKeyWidth },
{&EV_Bind_PrimaryKeyHeight, &bindlistener::PrimaryKeyHeight },
{&EV_Bind_AlternateKeyWidth, &bindlistener::AlternateKeyWidth },
{&EV_Bind_AlternateKeyHeight, &bindlistener::AlternateKeyHeight },
{&EV_Bind_Header, &bindlistener::Header },
{&EV_Bind_NewItem, &bindlistener::NewItem },
{&EV_Bind_Align, &bindlistener::Align },
{&EV_Bind_TitleForegroundColor, &bindlistener::TitleForegroundColor },
{&EV_Bind_TitleBackgroundColor, &bindlistener::TitleBackgroundColor },
{&EV_Bind_InactiveForegroundColor, &bindlistener::InactiveForegroundColor },
{&EV_Bind_InactiveBackgroundColor, &bindlistener::InactiveBackgroundColor },
{&EV_Bind_ActiveForegroundColor, &bindlistener::ActiveForegroundColor },
{&EV_Bind_ActiveBackgroundColor, &bindlistener::ActiveBackgroundColor },
{&EV_Bind_ActiveBorderColor, &bindlistener::ActiveBorderColor },
{&EV_Bind_HighlightForegroundColor, &bindlistener::HighlightForegroundColor},
{&EV_Bind_HighlightBackgroundColor, &bindlistener::HighlightBackgroundColor},
{&EV_Bind_SelectForegroundColor, &bindlistener::SelectForegroundColor },
{&EV_Bind_SelectBackgroundColor, &bindlistener::SelectBackgroundColor },
{&EV_Bind_ChangeSound, &bindlistener::ChangeSound },
{&EV_Bind_ActiveSound, &bindlistener::ActiveSound },
{&EV_Bind_EnterSound, &bindlistener::EnterSound },
{NULL, NULL }
};
bindlistener::bindlistener()
bindlistener::bindlistener() {}
bindlistener::bindlistener(bind_t *b)
{
bind = b;
}
bindlistener::bindlistener
(
bind_t *b
)
void bindlistener::Header(Event *ev)
{
bind = b;
int num;
num = ev->GetInteger(1) - 1;
if (num > ARRAY_LEN(bind_t::headers)) {
return;
}
bind->headers[num] = ev->GetString(2);
if (ev->NumArgs() > 2) {
bind->headermats[num] = uWinMan.RegisterShader(ev->GetString(3));
}
}
bool bindlistener::Load
(
Script& script
)
void bindlistener::ChangeSound(Event *ev)
{
// FIXME: stub
return false;
bind->changesound = ev->GetString(1);
}
void bindlistener::Header
(
Event *ev
)
void bindlistener::ActiveSound(Event *ev)
{
// FIXME: stub
bind->activesound = ev->GetString(1);
}
void bindlistener::Width
(
Event *ev
)
void bindlistener::EnterSound(Event *ev)
{
// FIXME: stub
bind->entersound = ev->GetString(1);
}
void bindlistener::FillWidth
(
Event *ev
)
void bindlistener::SelectForegroundColor(Event *ev)
{
// FIXME: stub
bind->selectfgcolor.r = ev->GetFloat(1);
bind->selectfgcolor.g = ev->GetFloat(2);
bind->selectfgcolor.b = ev->GetFloat(3);
bind->selectfgcolor.a = ev->GetFloat(4);
}
void bindlistener::Height
(
Event *ev
)
void bindlistener::SelectBackgroundColor(Event *ev)
{
// FIXME: stub
bind->selectbgcolor.r = ev->GetFloat(1);
bind->selectbgcolor.g = ev->GetFloat(2);
bind->selectbgcolor.b = ev->GetFloat(3);
bind->selectbgcolor.a = ev->GetFloat(4);
}
void bindlistener::CommandWidth
(
Event *ev
)
void bindlistener::TitleForegroundColor(Event *ev)
{
// FIXME: stub
bind->titlefgcolor.r = ev->GetFloat(1);
bind->titlefgcolor.g = ev->GetFloat(2);
bind->titlefgcolor.b = ev->GetFloat(3);
bind->titlefgcolor.a = ev->GetFloat(4);
}
void bindlistener::CommandHeight
(
Event *ev
)
void bindlistener::TitleBackgroundColor(Event *ev)
{
// FIXME: stub
bind->titlebgcolor.r = ev->GetFloat(1);
bind->titlebgcolor.g = ev->GetFloat(2);
bind->titlebgcolor.b = ev->GetFloat(3);
bind->titlebgcolor.a = ev->GetFloat(4);
}
void bindlistener::PrimaryKeyWidth
(
Event *ev
)
void bindlistener::ActiveBorderColor(Event *ev)
{
// FIXME: stub
bind->activebordercolor.r = ev->GetFloat(1);
bind->activebordercolor.g = ev->GetFloat(2);
bind->activebordercolor.b = ev->GetFloat(3);
bind->activebordercolor.a = ev->GetFloat(4);
}
void bindlistener::PrimaryKeyHeight
(
Event *ev
)
void bindlistener::ActiveForegroundColor(Event *ev)
{
// FIXME: stub
bind->activefgcolor.r = ev->GetFloat(1);
bind->activefgcolor.g = ev->GetFloat(2);
bind->activefgcolor.b = ev->GetFloat(3);
bind->activefgcolor.a = ev->GetFloat(4);
}
void bindlistener::AlternateKeyWidth
(
Event *ev
)
void bindlistener::ActiveBackgroundColor(Event *ev)
{
// FIXME: stub
bind->activebgcolor.r = ev->GetFloat(1);
bind->activebgcolor.g = ev->GetFloat(2);
bind->activebgcolor.b = ev->GetFloat(3);
bind->activebgcolor.a = ev->GetFloat(4);
}
void bindlistener::AlternateKeyHeight
(
Event *ev
)
void bindlistener::InactiveForegroundColor(Event *ev)
{
// FIXME: stub
bind->inactivefgcolor.r = ev->GetFloat(1);
bind->inactivefgcolor.g = ev->GetFloat(2);
bind->inactivefgcolor.b = ev->GetFloat(3);
bind->inactivefgcolor.a = ev->GetFloat(4);
}
void bindlistener::NewItem
(
Event *ev
)
void bindlistener::InactiveBackgroundColor(Event *ev)
{
// FIXME: stub
bind->inactivebgcolor.r = ev->GetFloat(1);
bind->inactivebgcolor.g = ev->GetFloat(2);
bind->inactivebgcolor.b = ev->GetFloat(3);
bind->inactivebgcolor.a = ev->GetFloat(4);
}
void bindlistener::Align
(
Event *ev
)
void bindlistener::HighlightForegroundColor(Event *ev)
{
// FIXME: stub
bind->highlightfgcolor.r = ev->GetFloat(1);
bind->highlightfgcolor.g = ev->GetFloat(2);
bind->highlightfgcolor.b = ev->GetFloat(3);
bind->highlightfgcolor.a = ev->GetFloat(4);
}
void bindlistener::TitleForegroundColor
(
Event *ev
)
void bindlistener::HighlightBackgroundColor(Event *ev)
{
// FIXME: stub
bind->highlightbgcolor.r = ev->GetFloat(1);
bind->highlightbgcolor.g = ev->GetFloat(2);
bind->highlightbgcolor.b = ev->GetFloat(3);
bind->highlightbgcolor.a = ev->GetFloat(4);
}
void bindlistener::TitleBackgroundColor
(
Event *ev
)
void bindlistener::Align(Event *ev)
{
// FIXME: stub
int i;
for (i = 1; i <= ev->NumArgs(); i++) {
str align = ev->GetString(i);
if (!str::icmp(align, "left")) {
bind->align |= WA_LEFT;
} else if (!str::icmp(align, "right")) {
bind->align |= WA_RIGHT;
} else if (!str::icmp(align, "top")) {
bind->align |= WA_TOP;
} else if (!str::icmp(align, "bottom")) {
bind->align |= WA_BOTTOM;
} else if (!str::icmp(align, "centerx")) {
bind->align |= WA_CENTERX;
} else if (!str::icmp(align, "centery")) {
bind->align |= WA_CENTERY;
}
}
}
void bindlistener::InactiveForegroundColor
(
Event *ev
)
void bindlistener::NewItem(Event *ev)
{
// FIXME: stub
bind_item_t *bt;
UIReggedMaterial *mat = NULL;
if (ev->NumArgs() > 2) {
mat = uWinMan.RegisterShader(ev->GetString(3));
}
str n = ev->GetString(1);
str c = ev->GetString(2);
bt = new bind_item_t;
bt->name = n;
bt->command = c;
bt->nameMaterial = mat;
bind->binds.AddObject(bt);
}
void bindlistener::InactiveBackgroundColor
(
Event *ev
)
void bindlistener::Width(Event *ev)
{
// FIXME: stub
bind->width = ev->GetInteger(1);
}
void bindlistener::ActiveForegroundColor
(
Event *ev
)
void bindlistener::Height(Event *ev)
{
// FIXME: stub
bind->height = ev->GetInteger(1);
}
void bindlistener::ActiveBackgroundColor
(
Event *ev
)
void bindlistener::FillWidth(Event *ev)
{
// FIXME: stub
bind->fillwidth = ev->GetInteger(1);
if (ev->NumArgs() > 1) {
bind->fillmaterial = uWinMan.RegisterShader(ev->GetString(2));
}
}
void bindlistener::ActiveBorderColor
(
Event *ev
)
void bindlistener::CommandWidth(Event *ev)
{
// FIXME: stub
bind->commandwidth = ev->GetInteger(1);
}
void bindlistener::HighlightForegroundColor
(
Event *ev
)
void bindlistener::CommandHeight(Event *ev)
{
// FIXME: stub
bind->commandheight = ev->GetInteger(1);
}
void bindlistener::HighlightBackgroundColor
(
Event *ev
)
void bindlistener::PrimaryKeyWidth(Event *ev)
{
// FIXME: stub
bind->primarykeywidth = ev->GetInteger(1);
}
void bindlistener::SelectForegroundColor
(
Event *ev
)
void bindlistener::PrimaryKeyHeight(Event *ev)
{
// FIXME: stub
bind->primarykeyheight = ev->GetInteger(1);
}
void bindlistener::SelectBackgroundColor
(
Event *ev
)
void bindlistener::AlternateKeyWidth(Event *ev)
{
// FIXME: stub
bind->alternatekeywidth = ev->GetInteger(1);
}
void bindlistener::ChangeSound
(
Event *ev
)
void bindlistener::AlternateKeyHeight(Event *ev)
{
// FIXME: stub
bind->alternatekeyheight = ev->GetInteger(1);
}
void bindlistener::ActiveSound
(
Event *ev
)
bool bindlistener::Load(Script& script)
{
// FIXME: stub
str token;
str errortext;
while (script.TokenAvailable(true)) {
token = script.GetToken(true);
if (!token.length() || !ValidEvent(token)) {
throw "invalid token";
}
Event *event = new Event(token);
while (script.TokenAvailable(false)) {
event->AddToken(script.GetToken(false));
}
ProcessEvent(event);
}
return true;
}
void bindlistener::EnterSound
(
Event *ev
)
bool CL_LoadBind(const char *filename, bind_t *bind)
{
// FIXME: stub
Script script;
bind->Clear();
bindlistener listener(bind);
script.LoadFile(filename);
// Load the bind file
return listener.Load(script);
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,115 +20,109 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_UIBIND_H__
#define __CL_UIBIND_H__
#pragma once
class bind_item_t {
class bind_item_t
{
public:
str name;
str command;
UIReggedMaterial *nameMaterial;
str name;
str command;
UIReggedMaterial *nameMaterial;
bind_item_t();
bind_item_t( str name, str command, UIReggedMaterial *nameMaterial );
bind_item_t();
bind_item_t(str name, str command, UIReggedMaterial *nameMaterial);
};
inline
bind_item_t::bind_item_t()
inline bind_item_t::bind_item_t()
{
nameMaterial = NULL;
nameMaterial = NULL;
}
inline
bind_item_t::bind_item_t
(
str name,
str command,
UIReggedMaterial *nameMaterial
)
inline bind_item_t::bind_item_t(str name, str command, UIReggedMaterial *nameMaterial)
{
this->name = name;
this->command = command;
this->nameMaterial = nameMaterial;
this->name = name;
this->command = command;
this->nameMaterial = nameMaterial;
}
class bind_t {
class bind_t
{
public:
int width;
int height;
int fillwidth;
int commandwidth;
int commandheight;
int primarykeywidth;
int primarykeyheight;
int alternatekeywidth;
int alternatekeyheight;
int align;
UColor titlebgcolor;
UColor titlefgcolor;
UColor activefgcolor;
UColor activebgcolor;
UColor activebordercolor;
UColor inactivefgcolor;
UColor inactivebgcolor;
UColor highlightfgcolor;
UColor highlightbgcolor;
UColor selectfgcolor;
UColor selectbgcolor;
str changesound;
str activesound;
str entersound;
str headers[ 3 ];
UIReggedMaterial *headermats[ 3 ];
UIReggedMaterial *fillmaterial;
Container<bind_item_t *> binds;
int width;
int height;
int fillwidth;
int commandwidth;
int commandheight;
int primarykeywidth;
int primarykeyheight;
int alternatekeywidth;
int alternatekeyheight;
int align;
UColor titlebgcolor;
UColor titlefgcolor;
UColor activefgcolor;
UColor activebgcolor;
UColor activebordercolor;
UColor inactivefgcolor;
UColor inactivebgcolor;
UColor highlightfgcolor;
UColor highlightbgcolor;
UColor selectfgcolor;
UColor selectbgcolor;
str changesound;
str activesound;
str entersound;
str headers[3];
UIReggedMaterial *headermats[3];
UIReggedMaterial *fillmaterial;
Container<bind_item_t *> binds;
public:
bind_t();
~bind_t();
bind_t();
~bind_t();
void Clear( void );
void Clear(void);
};
class bindlistener : public Listener {
class bindlistener : public Listener
{
protected:
bind_t *bind;
bind_t *bind;
public:
CLASS_PROTOTYPE( bindlistener );
CLASS_PROTOTYPE(bindlistener);
public:
bindlistener();
bindlistener( bind_t *b );
bindlistener();
bindlistener(bind_t *b);
bool Load( Script& script );
void Header( Event *ev );
void Width( Event *ev );
void FillWidth( Event *ev );
void Height( Event *ev );
void CommandWidth( Event *ev );
void CommandHeight( Event *ev );
void PrimaryKeyWidth( Event *ev );
void PrimaryKeyHeight( Event *ev );
void AlternateKeyWidth( Event *ev );
void AlternateKeyHeight( Event *ev );
void NewItem( Event *ev );
void Align( Event *ev );
void TitleForegroundColor( Event *ev );
void TitleBackgroundColor( Event *ev );
void InactiveForegroundColor( Event *ev );
void InactiveBackgroundColor( Event *ev );
void ActiveForegroundColor( Event *ev );
void ActiveBackgroundColor( Event *ev );
void ActiveBorderColor( Event *ev );
void HighlightForegroundColor( Event *ev );
void HighlightBackgroundColor( Event *ev );
void SelectForegroundColor( Event *ev );
void SelectBackgroundColor( Event *ev );
void ChangeSound( Event *ev );
void ActiveSound( Event *ev );
void EnterSound( Event *ev );
bool Load(Script& script);
void Header(Event *ev);
void Width(Event *ev);
void FillWidth(Event *ev);
void Height(Event *ev);
void CommandWidth(Event *ev);
void CommandHeight(Event *ev);
void PrimaryKeyWidth(Event *ev);
void PrimaryKeyHeight(Event *ev);
void AlternateKeyWidth(Event *ev);
void AlternateKeyHeight(Event *ev);
void NewItem(Event *ev);
void Align(Event *ev);
void TitleForegroundColor(Event *ev);
void TitleBackgroundColor(Event *ev);
void InactiveForegroundColor(Event *ev);
void InactiveBackgroundColor(Event *ev);
void ActiveForegroundColor(Event *ev);
void ActiveBackgroundColor(Event *ev);
void ActiveBorderColor(Event *ev);
void HighlightForegroundColor(Event *ev);
void HighlightBackgroundColor(Event *ev);
void SelectForegroundColor(Event *ev);
void SelectBackgroundColor(Event *ev);
void ChangeSound(Event *ev);
void ActiveSound(Event *ev);
void EnterSound(Event *ev);
};
#endif
bool CL_LoadBind(const char* filename, bind_t* bind);

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "cl_ui.h"
#include "../qcommon/localization.h"
Event EV_DMBox_Goin
(
@ -40,389 +41,385 @@ Event EV_DMBox_Decay
"Event to make the dmbox console line decay"
);
static float s_dmboxWidth = 384.0;
static float s_dmboxWidth = 384.0;
static float s_dmboxOffsetX = 3.0f;
static float s_dmboxOffsetY = 8.0f;
CLASS_DECLARATION( UIWidget, UIDMBox, NULL )
{
{ &W_SizeChanged, &UIDMBox::OnSizeChanged },
{ &EV_DMBox_Goin, &UIDMBox::MoveInEvent },
{ &EV_DMBox_Decay, &UIDMBox::DecayEvent },
{ NULL, NULL }
CLASS_DECLARATION(UIWidget, UIDMBox, NULL) {
{&W_SizeChanged, &UIDMBox::OnSizeChanged},
{&EV_DMBox_Goin, &UIDMBox::MoveInEvent },
{&EV_DMBox_Decay, &UIDMBox::DecayEvent },
{NULL, NULL }
};
UIDMBox::UIDMBox()
{
m_numitems = 0;
m_reallyshown = true;
m_fontbold = NULL;
m_boxstate = boxstate_t::box_out;
m_iBeginDecay = 0;
m_boxtime = uid.time;
m_movespeed = 500;
m_numitems = 0;
m_reallyshown = true;
m_fontbold = NULL;
m_boxstate = boxstate_t::box_out;
m_iBeginDecay = 0;
m_boxtime = uid.time;
m_movespeed = 500;
m_drawoutline = com_target_game->integer >= target_game_e::TG_MOHTA;
}
void UIDMBox::VerifyBoxOut( void )
void UIDMBox::VerifyBoxOut(void)
{
PostMoveinEvent();
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out)
{
ChangeBoxState(boxstate_t::box_moving_out);
}
PostMoveinEvent();
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out) {
ChangeBoxState(boxstate_t::box_moving_out);
}
}
void UIDMBox::ChangeBoxState( boxstate_t state )
void UIDMBox::ChangeBoxState(boxstate_t state)
{
m_boxstate = state;
m_boxtime = uid.time;
setShowState();
m_boxstate = state;
m_boxtime = uid.time;
setShowState();
if (state == box_out) {
PostMoveinEvent();
}
if (state == box_out) {
PostMoveinEvent();
}
}
void UIDMBox::HandleBoxMoving( void )
void UIDMBox::HandleBoxMoving(void)
{
int delta;
UIRect2D newRect;
int delta;
UIRect2D newRect;
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_moving_in) {
return;
}
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_moving_in) {
return;
}
delta = m_movespeed * (uid.time - m_boxtime) / 1000;
m_boxtime = 1000 * delta / m_movespeed + m_boxtime;
if (m_boxstate == boxstate_t::box_moving_out)
{
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta + m_frame.pos.y;
delta = m_movespeed * (uid.time - m_boxtime) / 1000;
m_boxtime = 1000 * delta / m_movespeed + m_boxtime;
if (m_boxstate == boxstate_t::box_moving_out) {
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta + m_frame.pos.y;
if (newRect.pos.y <= 0.0)
{
newRect.pos.y = 0.0;
ChangeBoxState(boxstate_t::box_out);
}
}
else if (m_boxstate == boxstate_t::box_moving_in)
{
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta - m_frame.pos.y;
if (newRect.pos.y <= 0.0) {
newRect.pos.y = 0.0;
ChangeBoxState(boxstate_t::box_out);
}
} else if (m_boxstate == boxstate_t::box_moving_in) {
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta - m_frame.pos.y;
if (newRect.pos.y <= -newRect.size.height)
{
newRect.pos.y = -newRect.size.height;
ChangeBoxState(boxstate_t::box_in);
}
}
else {
newRect = m_frame;
}
if (newRect.pos.y <= -newRect.size.height) {
newRect.pos.y = -newRect.size.height;
ChangeBoxState(boxstate_t::box_in);
}
} else {
newRect = m_frame;
}
setFrame(newRect);
setFrame(newRect);
}
void UIDMBox::PostMoveinEvent( void )
void UIDMBox::PostMoveinEvent(void)
{
if (m_boxstate != boxstate_t::box_out) {
return;
}
if (m_boxstate != boxstate_t::box_out) {
return;
}
if (!EventPending(EV_DMBox_Goin)) {
PostEvent(EV_DMBox_Goin, 10.0);
}
else {
PostponeEvent(EV_DMBox_Goin, 10.0);
}
if (!EventPending(EV_DMBox_Goin)) {
PostEvent(EV_DMBox_Goin, 10.0);
} else {
PostponeEvent(EV_DMBox_Goin, 10.0);
}
}
void UIDMBox::PostDecayEvent( void )
void UIDMBox::PostDecayEvent(void)
{
if (!EventPending(EV_DMBox_Decay))
{
float fDelayTime;
int iNumLines;
int i;
const char* pszString = m_items[0].string.c_str();
if (!EventPending(EV_DMBox_Decay)) {
float fDelayTime;
int iNumLines;
int i;
const char *pszString = m_items[0].string.c_str();
//
// Calculate the number of lines
//
iNumLines = 1;
for (i = 0; pszString[i]; i++)
{
if (pszString[i] == '\n') {
iNumLines++;
}
}
//
// Calculate the number of lines
//
iNumLines = 1;
for (i = 0; pszString[i]; i++) {
if (pszString[i] == '\n') {
iNumLines++;
}
}
//
// Bold as twice more decay
//
if (m_items[0].flags & DMBOX_ITEM_FLAG_BOLD) {
fDelayTime = iNumLines * 6.0;
}
else {
fDelayTime = iNumLines * 5.0;
}
if (m_items[0].flags & DMBOX_ITEM_FLAG_BOLD) {
fDelayTime = iNumLines * 8.0;
}
//
// Bold as twice more decay
//
else if (m_items[0].flags & DMBOX_ITEM_FLAG_DEATH) {
fDelayTime = iNumLines * 6.0;
} else {
fDelayTime = iNumLines * 5.0;
}
m_iBeginDecay = cls.realtime;
m_iEndDecay = (int)(fDelayTime * 1000.0);
m_iBeginDecay = cls.realtime;
m_iEndDecay = (int)(fDelayTime * 1000.0);
PostEvent(EV_DMBox_Decay, fDelayTime);
}
PostEvent(EV_DMBox_Decay, fDelayTime);
}
}
void UIDMBox::setShowState( void )
void UIDMBox::setShowState(void)
{
if (m_reallyshown) {
setShow(m_boxstate != box_in);
} else {
setShow(false);
}
if (m_reallyshown) {
setShow(m_boxstate != box_in);
} else {
setShow(false);
}
}
void UIDMBox::RemoveTopItem( void )
void UIDMBox::RemoveTopItem(void)
{
int i;
int i;
if (m_numitems > 0) {
for (i = 0; i < m_numitems - 1; i++) {
m_items[i] = m_items[i + 1];
}
if (m_numitems > 0) {
for (i = 0; i < m_numitems - 1; i++) {
m_items[i] = m_items[i + 1];
}
m_numitems--;
}
m_numitems--;
}
}
str UIDMBox::CalculateBreaks( UIFont *font, str text, float max_width )
str UIDMBox::CalculateBreaks(UIFont *font, str text, float max_width)
{
str newText, sTmp;
int i;
float fX;
float fwX, fsX;
str newText;
float fX;
float fwX;
const char *current;
int count;
Cmd_TokenizeString(text.c_str());
if (Cmd_Argc())
{
fX = 0.0;
fsX = font->getCharWidth(' ');
current = text;
fX = 0.0;
for (i = 0; i < Cmd_Argc(); i++)
{
sTmp = Cmd_Argv(i);
for (count = font->DBCSGetWordBlockCount(current, -1); count;
current += count, count = font->DBCSGetWordBlockCount(current, -1)) {
fwX = font->getWidth(current, count);
fwX = font->getWidth(sTmp.c_str(), -1);
if (fwX + i <= max_width)
{
if (fwX + i + fX <= max_width)
{
newText += sTmp + " ";
} else {
newText += "\n" + sTmp + " ";
}
}
else
{
sTmp += "\n";
fX = 0.0;
}
}
} else {
newText = "";
}
if (fX + fwX > max_width) {
newText += "\n" + str(current, 0, count);
fX = 0;
} else {
newText += str(current, 0, count);
}
return newText;
fX += fwX;
}
return newText;
}
float UIDMBox::PrintWrap( UIFont *font, float x, float y, str text )
float UIDMBox::PrintWrap(UIFont *font, float x, float y, str text)
{
const char* p1, * p2;
size_t n, l;
float fY;
const char *p1, *p2;
size_t n, l;
float fY;
fY = y;
p1 = text.c_str();
l = text.length();
fY = y;
p1 = text.c_str();
l = text.length();
for (;;)
{
p2 = strchr(p1, '\n');
if (!p2) {
break;
}
for (;;) {
p2 = strchr(p1, '\n');
if (!p2) {
break;
}
n = p2 - p1;
if (n >= l) {
break;
}
n = p2 - p1;
if (n >= l) {
break;
}
font->Print(x, fY, p1, p2 - p1, qfalse);
p1 = p2 + 1;
l -= n;
fY += font->getHeight(qfalse);
}
font->Print(x, fY, p1, p2 - p1, getHighResScale());
p1 = p2 + 1;
l -= n;
fY += font->getHeight();
}
font->Print(x, fY, p1, l, qfalse);
if (*p1) {
font->Print(x, fY, p1, l, getHighResScale());
fY += font->getHeight();
}
return font->getHeight(qfalse) + (fY - y);
return fY - y;
}
float UIDMBox::DrawItem( item_t *in, float x, float y, float alpha )
float UIDMBox::DrawItem(item_t *in, float x, float y, float alpha)
{
in->font->setColor(in->color);
in->font->setAlpha(alpha);
if (m_drawoutline) {
//
// Draw an outline
//
return PrintWrap(in->font, x, y, in->string);
in->font->setColor(UBlack);
in->font->setAlpha(alpha);
PrintWrap(in->font, x + 1, y + 2, in->string);
PrintWrap(in->font, x + 2, y + 1, in->string);
PrintWrap(in->font, x - 1, y + 2, in->string);
PrintWrap(in->font, x - 2, y + 1, in->string);
PrintWrap(in->font, x - 1, y - 2, in->string);
PrintWrap(in->font, x - 2, y - 1, in->string);
PrintWrap(in->font, x + 1, y - 2, in->string);
PrintWrap(in->font, x + 2, y - 1, in->string);
PrintWrap(in->font, x + 2, y, in->string);
PrintWrap(in->font, x - 2, y, in->string);
PrintWrap(in->font, x, y + 2, in->string);
PrintWrap(in->font, x, y - 2, in->string);
}
in->font->setColor(in->color);
in->font->setAlpha(alpha);
return PrintWrap(in->font, x, y, in->string);
}
void UIDMBox::Print( const char *text )
void UIDMBox::Print(const char *text)
{
const char* text1 = text;
const char *text1 = text;
if (m_numitems > 4)
{
//
// Overwrite an item
//
RemoveTopItem();
}
if (m_numitems > 5) {
//
// Overwrite an item
//
RemoveTopItem();
}
m_items[m_numitems].flags = 0;
m_items[m_numitems].flags = 0;
if (*text == MESSAGE_CHAT_WHITE)
{
m_items[m_numitems].color = UGrey;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_BOLD;
if (*text == MESSAGE_CHAT_WHITE) {
m_items[m_numitems].color = UWhiteChatMessageColor;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_BOLD;
text1 = text + 1;
}
else if (*text == MESSAGE_CHAT_RED)
{
m_items[m_numitems].color = ULightRed;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_BOLD;
text1 = text + 1;
} else if (*text == MESSAGE_CHAT_RED) {
m_items[m_numitems].color = URedChatMessageColor;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
text1 = text + 1;
}
else if (*text == MESSAGE_CHAT_GREEN)
{
m_items[m_numitems].color = UGreen;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_BOLD;
text1 = text + 1;
} else if (*text == MESSAGE_CHAT_GREEN) {
m_items[m_numitems].color = UGreenChatMessageColor;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= DMBOX_ITEM_FLAG_DEATH;
text1 = text + 1;
}
else
{
m_items[m_numitems].color = m_foreground_color;
m_items[m_numitems].font = m_font;
}
text1 = text + 1;
} else {
m_items[m_numitems].color = m_foreground_color;
m_items[m_numitems].font = m_font;
}
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, text1, s_dmboxWidth);
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, Sys_LV_CL_ConvertString(text1), s_dmboxWidth);
m_numitems++;
VerifyBoxOut();
PostDecayEvent();
m_numitems++;
VerifyBoxOut();
PostDecayEvent();
}
void UIDMBox::OnSizeChanged( Event *ev )
void UIDMBox::OnSizeChanged(Event *ev)
{
s_dmboxWidth = m_frame.size.width;
s_dmboxWidth = m_frame.size.width;
}
void UIDMBox::Create( const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha )
void UIDMBox::Create(const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha)
{
InitFrame(NULL, rect, 0, "facfont-20");
InitFrame(NULL, rect, 0, "facfont-20");
if (!m_fontbold) {
m_fontbold = new UIFont("facfont-20");
}
if (!m_fontbold) {
m_fontbold = new UIFont("facfont-20");
}
m_fontbold->setColor(URed);
setBackgroundColor(back, true);
setForegroundColor(fore);
setBackgroundAlpha(alpha);
m_fontbold->setColor(URed);
setBackgroundColor(back, true);
setForegroundColor(fore);
setBackgroundAlpha(alpha);
Connect(this, W_SizeChanged, W_SizeChanged);
OnSizeChanged(NULL);
Connect(this, W_SizeChanged, W_SizeChanged);
OnSizeChanged(NULL);
m_movespeed = rect.size.height * 3.0;
m_movespeed = rect.size.height * 3.0;
setShowState();
setShowState();
}
void UIDMBox::MoveInEvent( Event *ev )
void UIDMBox::MoveInEvent(Event *ev) {}
void UIDMBox::DecayEvent(Event *ev)
{
RemoveTopItem();
if (m_numitems) {
PostDecayEvent();
}
}
void UIDMBox::DecayEvent( Event *ev )
void UIDMBox::Draw(void)
{
RemoveTopItem();
if (m_numitems) {
PostDecayEvent();
}
float fsY;
int i;
float alpha;
float alphaScale;
alphaScale = 0.8f;
HandleBoxMoving();
if (!m_numitems) {
//
// Nothing to show
//
return;
}
m_font->setColor(m_foreground_color);
alpha = (float)(cls.realtime - m_iBeginDecay) / (float)m_iEndDecay;
if (alpha > 1.0) {
alpha = 1.0;
}
alpha = (1.0 - alpha) * 4.0;
if (alpha > 1.0) {
alpha = 1.0;
}
if (cge) {
alphaScale = 1.0 - cge->CG_GetObjectiveAlpha();
}
fsY = DrawItem(m_items, s_dmboxOffsetX, s_dmboxOffsetY, alpha * alphaScale);
fsY = alpha <= 0.2 ? s_dmboxOffsetY : fsY + s_dmboxOffsetY;
for (i = 1; i < m_numitems; i++) {
fsY += DrawItem(&m_items[i], s_dmboxOffsetX, fsY, alphaScale);
if (fsY > m_frame.size.height) {
if (EventPending(EV_DMBox_Decay)) {
CancelEventsOfType(EV_DMBox_Decay);
}
PostEvent(EV_DMBox_Decay, 0.0);
break;
}
}
}
void UIDMBox::Draw( void )
void UIDMBox::setRealShow(bool b)
{
float fsY;
int i;
float alpha;
float alphaScale;
alphaScale = 0.8;
HandleBoxMoving();
if (!m_numitems) {
//
// Nothing to show
//
return;
}
m_font->setColor(m_foreground_color);
alpha = (float)(cls.realtime - m_iBeginDecay) / (float)m_iEndDecay;
if (alpha > 1.0) alpha = 1.0;
alpha = (1.0 - alpha) * 4.0;
if (alpha > 1.0) alpha = 1.0;
if (cge) {
alphaScale = 1.0 - cge->CG_GetObjectiveAlpha();
}
fsY = DrawItem(m_items, s_dmboxOffsetX, s_dmboxOffsetY, alpha * alphaScale);
fsY = alpha <= 0.2 ? s_dmboxOffsetY : fsY + s_dmboxOffsetY;
for (i = 1; i < m_numitems; i++)
{
fsY += DrawItem(&m_items[i], s_dmboxOffsetX, fsY, alphaScale);
if (fsY > m_frame.size.height)
{
if (EventPending(EV_DMBox_Decay)) {
CancelEventsOfType(EV_DMBox_Decay);
}
PostEvent(EV_DMBox_Decay, 0.0);
break;
}
}
this->m_reallyshown = b;
setShowState();
}
void UIDMBox::setRealShow( bool b )
void UIDMBox::Clear(void)
{
this->m_reallyshown = b;
setShowState();
}
void UIDMBox::Clear( void )
{
m_numitems = 0;
m_numitems = 0;
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2015-2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,10 +20,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_UIDMBOX_H__
#define __CL_UIDMBOX_H__
#pragma once
static constexpr unsigned int DMBOX_ITEM_FLAG_BOLD = 1u;
static constexpr unsigned int DMBOX_ITEM_FLAG_BOLD = 2u;
static constexpr unsigned int DMBOX_ITEM_FLAG_DEATH = 4u;
typedef enum { box_moving_out, box_moving_in, box_out, box_in } boxstate_t;
@ -46,6 +46,8 @@ protected:
int m_movespeed;
int m_iBeginDecay;
int m_iEndDecay;
// Added in OPM
bool m_drawoutline;
public:
CLASS_PROTOTYPE( UIDMBox );
@ -74,5 +76,3 @@ public:
void setRealShow( bool b );
void Clear( void );
};
#endif /* __CL_UIDMBOX_H__ */

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -22,72 +22,256 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cl_ui.h"
CLASS_DECLARATION( USignal, FilePickerClass, NULL )
class FilePickerItem : public UIListCtrlItem
{
{ NULL, NULL }
str strings[3];
public:
FilePickerItem(const str& fileName, const str& date, const str& size);
int getListItemValue(int which) const override;
griditemtype_t getListItemType(int which) const override;
str getListItemString(int which) const override;
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
qboolean IsHeaderEntry() const override;
};
CLASS_DECLARATION(USignal, FilePickerClass, NULL) {
{&EV_UIListBase_ItemSelected, &FilePickerClass::FileSelected },
{&EV_UIListBase_ItemDoubleClicked, &FilePickerClass::FileChosen },
{&W_Deactivated, &FilePickerClass::OnDeactivated},
{NULL, NULL }
};
FilePickerClass::FilePickerClass()
{
// FIXME: stub
window = new UIFloatingWindow();
window->Create(
NULL,
UIRect2D((uid.vidWidth - 400) / 2, (uid.vidHeight - 300) / 2, 400, 300),
"File Picker",
UColor(0.15f, 0.195f, 0.278f),
UHudColor
);
window->Connect(this, W_Deactivated, W_Deactivated);
listbox = new UIListCtrl();
listbox->InitFrame(window->getChildSpace(), window->getChildSpace()->getClientFrame(), 0);
listbox->setBackgroundColor(UColor(0.02f, 0.07f, 0.005f), true);
listbox->setForegroundColor(UHudColor);
listbox->AddColumn("File Name", 0, 175, false, false);
listbox->AddColumn("Date", 1, 125, false, false);
listbox->AddColumn("Size", 2, 100, true, false);
listbox->Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
listbox->Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
listbox->AllowActivate(true);
// Added in 2.0
// Don't localize elements
listbox->SetDontLocalize();
}
FilePickerClass::~FilePickerClass()
{
// FIXME: stub
if (listbox) {
delete listbox;
listbox = NULL;
}
if (window) {
delete window;
window = NULL;
}
}
void FilePickerClass::SetupFiles( void )
void FilePickerClass::Setup(
const char *root_directory, const char *current_directory, const char *ext, const char *ignore_files
)
{
// FIXME: stub
Initialize(root_directory, current_directory, ext, ignore_files);
}
void FilePickerClass::GotoParentDirectory( void )
void FilePickerClass::Initialize(
const char *root_directory, const char *current_directory, const char *ext, const char *ignore_files
)
{
// FIXME: stub
rootDirectory = root_directory;
if (rootDirectory.length() > 1 && rootDirectory[rootDirectory.length() - 1] != '/') {
rootDirectory += "/";
}
currentDirectory = current_directory;
if (currentDirectory.length() > 1 && currentDirectory[currentDirectory.length() - 1] != '/') {
currentDirectory += "/";
}
extension = ext;
if (ignore_files) {
ignoredFiles = ignore_files;
}
SetupFiles();
}
void FilePickerClass::GotoSubDirectory( str subdir )
void FilePickerClass::GotoParentDirectory(void)
{
// FIXME: stub
int i;
if (currentDirectory == rootDirectory) {
return;
}
for (i = currentDirectory.length() - 2; i > 0; i--) {
if (currentDirectory[i] == '/') {
break;
}
}
if (currentDirectory[i] == '/') {
i++;
}
currentDirectory = str(currentDirectory, 0, i);
// refresh files
SetupFiles();
}
void FilePickerClass::Initialize( const char *root_directory, const char *current_directory, const char *ext )
void FilePickerClass::GotoSubDirectory(str subdir)
{
// FIXME: stub
currentDirectory += subdir + "/";
// refresh files
SetupFiles();
}
void FilePickerClass::CloseWindow( void )
void FilePickerClass::SetupFiles(void)
{
// FIXME: stub
str mappath;
str work;
char **filenames;
int numfiles;
int i;
char date[128];
char size[128];
listbox->DeleteAllItems();
if (currentDirectory != rootDirectory) {
// create the parent directory item
listbox->AddItem(new FilePickerItem("..", "", ""));
}
// retrieve directories
filenames = FS_ListFiles(currentDirectory, "/", qfalse, &numfiles);
for (i = 0; i < numfiles; i++) {
const char *filename = filenames[i];
if (filename[0] == '.' || !strlen(filename)) {
continue;
}
work = "[";
work += filename;
work += "]";
FS_FileTime(currentDirectory + filename, date, size);
listbox->AddItem(new FilePickerItem(work, date, size));
}
FS_FreeFileList(filenames);
filenames = FS_ListFiles(currentDirectory, extension, qfalse, &numfiles);
for (i = 0; i < numfiles; i++) {
const char *filename = filenames[i];
if (ignoredFiles.length() && strstr(filename, ignoredFiles)) {
// Added in 2.0
// Check for ignored files
continue;
}
work = filename;
FS_FileTime(currentDirectory + work, date, size);
listbox->AddItem(new FilePickerItem(work, date, size));
}
FS_FreeFileList(filenames);
window->setTitle(currentDirectory);
}
void FilePickerClass::FileSelected( Event *ev )
void FilePickerClass::FileSelected(const str& currentDirectory, const str& partialName, const str& fullname) {}
void FilePickerClass::FileSelected(Event *ev)
{
// FIXME: stub
str name = listbox->GetItem(listbox->getCurrentItem())->getListItemString(0);
if (*name != '[' && *name != '.') {
FileSelected(currentDirectory, name, currentDirectory + name);
}
uii.Snd_PlaySound("sound/menu/scroll.wav");
}
void FilePickerClass::FileSelected( str &currentDirectory, str &partialName, str &fullname )
void FilePickerClass::FileChosen(const str& currentDirectory, const str& partialName, const str& fullname) {}
void FilePickerClass::FileChosen(Event *ev)
{
// FIXME: stub
str filename = listbox->GetItem(listbox->getCurrentItem())->getListItemString(0);
if (*filename == '[') {
uii.Snd_PlaySound("sound/menu/scroll.wav");
GotoSubDirectory(str(filename, 1, filename.length() - 1));
} else if (*filename == '.') {
GotoParentDirectory();
} else {
uii.Snd_PlaySound("sound/menu/apply.wav");
FileChosen(currentDirectory, filename, currentDirectory + filename);
}
}
void FilePickerClass::FileChosen( Event *ev )
void FilePickerClass::CloseWindow(void)
{
// FIXME: stub
PostEvent(EV_Remove, 0);
}
void FilePickerClass::FileChosen( str &currentDirectory, str &partialName, str &fullname )
void FilePickerClass::OnDeactivated(Event *ev)
{
// FIXME: stub
CloseWindow();
}
void FilePickerClass::OnDeactivated( Event *ev )
FilePickerItem::FilePickerItem(const str& fileName, const str& date, const str& size)
{
// FIXME: stub
strings[0] = fileName;
strings[1] = date;
strings[2] = size;
}
void FilePickerClass::Setup( const char *root_directory, const char *current_directory, const char *ext )
int FilePickerItem::getListItemValue(int which) const
{
// FIXME: stub
return atoi(strings[which]);
}
griditemtype_t FilePickerItem::getListItemType(int which) const
{
return griditemtype_t::TYPE_STRING;
}
str FilePickerItem::getListItemString(int which) const
{
return strings[which];
}
void FilePickerItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
qboolean FilePickerItem::IsHeaderEntry() const
{
return qfalse;
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,40 +20,41 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_UIFILEPICKER_H__
#define __CL_UIFILEPICKER_H__
#pragma once
class UIListCtrl;
class FilePickerClass : public USignal {
UIFloatingWindow *window;
UIListCtrl *listbox;
str currentDirectory;
str rootDirectory;
str extension;
class FilePickerClass : public USignal
{
UIFloatingWindow *window;
UIListCtrl *listbox;
str currentDirectory;
str rootDirectory;
str extension;
// Added in 2.0
str ignoredFiles;
public:
CLASS_PROTOTYPE( FilePickerClass );
CLASS_PROTOTYPE(FilePickerClass);
private:
void SetupFiles( void );
void GotoParentDirectory( void );
void GotoSubDirectory( str subdir );
void Initialize( const char *root_directory, const char *current_directory, const char *ext );
void SetupFiles(void);
void GotoParentDirectory(void);
void GotoSubDirectory(str subdir);
// ignore_files parameter, added in 2.0
void Initialize(const char *root_directory, const char *current_directory, const char *ext, const char* ignore_files);
protected:
void CloseWindow( void );
void FileSelected( Event *ev );
virtual void FileSelected( str &currentDirectory, str &partialName, str &fullname );
void FileChosen( Event *ev );
virtual void FileChosen( str &currentDirectory, str &partialName, str &fullname );
void OnDeactivated( Event *ev );
void CloseWindow(void);
void FileSelected(Event *ev);
virtual void FileSelected(const str& currentDirectory, const str& partialName, const str& fullname);
void FileChosen(Event *ev);
virtual void FileChosen(const str& currentDirectory, const str& partialName, const str& fullname);
void OnDeactivated(Event *ev);
public:
FilePickerClass();
~FilePickerClass();
FilePickerClass();
~FilePickerClass();
void Setup( const char *root_directory, const char *current_directory, const char *ext );
void Setup(const char *root_directory, const char *current_directory, const char *ext, const char* ignore_files = NULL);
};
#endif /* __CL_UIFILEPICKER_H__ */

View file

@ -0,0 +1,118 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// cl_uigamespy.cpp
#include "cl_uigamespy.h"
CLASS_DECLARATION(UIFloatingWindow, GameSpyDialog, NULL) {
{&W_Deactivated, &UIFloatingWindow::ClosePressed},
{NULL, NULL }
};
GameSpyDialog::GameSpyDialog()
: overlay(NULL)
, label(NULL)
, closeButton(NULL)
{
AddFlag(WF_ALWAYS_TOP);
}
GameSpyDialog::~GameSpyDialog()
{
if (overlay) {
delete overlay;
overlay = NULL;
}
if (label) {
delete label;
label = NULL;
}
if (closeButton) {
delete closeButton;
closeButton = NULL;
}
}
void GameSpyDialog::FrameInitialized(void)
{
UIFloatingWindow::FrameInitialized();
label = new UILabel();
label->InitFrame(getChildSpace(), getChildSpace()->getClientFrame(), 0);
label->setTitle(
"GameSpy's multiplayer matchmaking\n"
"and server browsing services, which were\n"
"essential for online gaming in many classic\n"
"titles including Medal of Honor: Allied Assault,\n"
"were permanently shut down in 2014."
);
label->setForegroundColor(UHudColor);
closeButton = new UIButton();
closeButton->InitFrame(getChildSpace(), UIRect2D(100, 150, 100, 30), 0);
closeButton->setTitle("Close");
closeButton->AllowActivate(true);
closeButton->Connect(this, W_Button_Pressed, W_Deactivated);
overlay = new UIButton();
overlay->InitFrame(NULL, UIRect2D(0, 0, uid.vidWidth, uid.vidHeight), 0);
overlay->setBackgroundColor(UColor(0, 0, 0, 0.5f), true);
overlay->AllowActivate(true);
overlay->Connect(this, W_Button_Pressed, W_Deactivated);
}
void GameSpyDialog::Create(
UIWidget *parent, const UIRect2D& rect, const char *title, const UColor& bgColor, const UColor& fgColor
)
{
// First call parent's Create
UIFloatingWindow::Create(parent, rect, title, bgColor, fgColor);
// After creation, find minimize button by name and hide it
for (UIWidget *child = getFirstChild(); child; child = getNextChild(child)) {
if (strcmp(child->getName(), "minimizebutton") == 0) {
child->setShow(false);
break;
}
}
}
void UI_LaunchGameSpy_f(void)
{
GameSpyDialog *dialog = new GameSpyDialog();
dialog->Create(
NULL,
UIRect2D((uid.vidWidth - 300) / 2, (uid.vidHeight - 200) / 2, 300, 200),
"GameSpy",
UColor(0.15f, 0.195f, 0.278f),
UHudColor
);
uWinMan.ActivateControl(dialog);
dialog->Connect(dialog, W_Deactivated, W_Deactivated);
}

View file

@ -0,0 +1,50 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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 2 of the License,
or (at your option) any later version.
OpenMoHAA source code 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.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// cl_gamespy.h
#ifndef __CL_GAMESPY_H__
#define __CL_GAMESPY_H__
#include "cl_ui.h"
#include "keycodes.h"
class GameSpyDialog : public UIFloatingWindow
{
private:
UIButton *overlay;
UILabel *label;
UIButton *closeButton;
protected:
void FrameInitialized(void) override;
public:
GameSpyDialog();
~GameSpyDialog();
void
Create(UIWidget *parent, const UIRect2D& rect, const char *title, const UColor& bgColor, const UColor& fgColor);
CLASS_PROTOTYPE(GameSpyDialog);
};
void UI_LaunchGameSpy_f(void);
#endif

View file

@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "cl_ui.h"
#include "../qcommon/localization.h"
Event EV_GMBox_Goin
(
@ -40,371 +41,370 @@ Event EV_GMBox_Decay
"Event to make the gmbox console line decay"
);
static float s_gmboxWidth = 640.0;
static float s_gmboxWidth = 640.0;
static float s_gmboxOffsetX = 3.0f;
static float s_gmboxOffsetY = 0.0f;
CLASS_DECLARATION( UIWidget, UIGMBox, NULL )
{
{ &W_SizeChanged, &UIGMBox::OnSizeChanged },
{ &EV_GMBox_Goin, &UIGMBox::MoveInEvent },
{ &EV_GMBox_Decay, &UIGMBox::DecayEvent },
{ NULL, NULL }
CLASS_DECLARATION(UIWidget, UIGMBox, NULL) {
{&W_SizeChanged, &UIGMBox::OnSizeChanged},
{&EV_GMBox_Goin, &UIGMBox::MoveInEvent },
{&EV_GMBox_Decay, &UIGMBox::DecayEvent },
{NULL, NULL }
};
UIGMBox::UIGMBox()
{
m_numitems = 0;
m_reallyshown = true;
m_fontbold = NULL;
m_boxstate = boxstate_t::box_out;
m_iBeginDecay = 0;
m_boxtime = uid.time;
m_movespeed = 500;
m_numitems = 0;
m_reallyshown = true;
m_fontbold = NULL;
m_boxstate = boxstate_t::box_out;
m_iBeginDecay = 0;
m_boxtime = uid.time;
m_movespeed = 500;
m_drawoutline = com_target_game->integer >= target_game_e::TG_MOHTA;
}
void UIGMBox::VerifyBoxOut( void )
void UIGMBox::VerifyBoxOut(void)
{
PostMoveinEvent();
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out)
{
ChangeBoxState(boxstate_t::box_moving_out);
}
PostMoveinEvent();
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_out) {
ChangeBoxState(boxstate_t::box_moving_out);
}
}
void UIGMBox::ChangeBoxState( boxstate_t state )
void UIGMBox::ChangeBoxState(boxstate_t state)
{
m_boxstate = state;
m_boxtime = uid.time;
setShowState();
m_boxstate = state;
m_boxtime = uid.time;
setShowState();
if (state == box_out) {
PostMoveinEvent();
}
if (state == box_out) {
PostMoveinEvent();
}
}
void UIGMBox::HandleBoxMoving( void )
void UIGMBox::HandleBoxMoving(void)
{
int delta;
UIRect2D newRect;
int delta;
UIRect2D newRect;
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_moving_in) {
return;
}
if (m_boxstate != boxstate_t::box_moving_out && m_boxstate != boxstate_t::box_moving_in) {
return;
}
delta = m_movespeed * (uid.time - m_boxtime) / 1000;
m_boxtime = 1000 * delta / m_movespeed + m_boxtime;
if (m_boxstate == boxstate_t::box_moving_out)
{
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta + m_frame.pos.y;
delta = m_movespeed * (uid.time - m_boxtime) / 1000;
m_boxtime = 1000 * delta / m_movespeed + m_boxtime;
if (m_boxstate == boxstate_t::box_moving_out) {
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta + m_frame.pos.y;
if (newRect.pos.y <= 0.0)
{
newRect.pos.y = 0.0;
ChangeBoxState(boxstate_t::box_out);
}
}
else if (m_boxstate == boxstate_t::box_moving_in)
{
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta - m_frame.pos.y;
if (newRect.pos.y <= 0.0) {
newRect.pos.y = 0.0;
ChangeBoxState(boxstate_t::box_out);
}
} else if (m_boxstate == boxstate_t::box_moving_in) {
newRect.size.width = m_frame.size.width;
newRect.size.height = m_frame.size.height;
newRect.pos.x = m_frame.pos.x;
newRect.pos.y = delta - m_frame.pos.y;
if (newRect.pos.y <= -newRect.size.height)
{
newRect.pos.y = -newRect.size.height;
ChangeBoxState(boxstate_t::box_in);
}
} else {
newRect = m_frame;
}
if (newRect.pos.y <= -newRect.size.height) {
newRect.pos.y = -newRect.size.height;
ChangeBoxState(boxstate_t::box_in);
}
} else {
newRect = m_frame;
}
setFrame(newRect);
setFrame(newRect);
}
void UIGMBox::PostMoveinEvent( void )
void UIGMBox::PostMoveinEvent(void)
{
if (m_boxstate != boxstate_t::box_out) {
return;
}
if (m_boxstate != boxstate_t::box_out) {
return;
}
if (!EventPending(EV_GMBox_Goin)) {
PostEvent(EV_GMBox_Goin, 10.0);
} else {
PostponeEvent(EV_GMBox_Goin, 10.0);
}
if (!EventPending(EV_GMBox_Goin)) {
PostEvent(EV_GMBox_Goin, 10.0);
} else {
PostponeEvent(EV_GMBox_Goin, 10.0);
}
}
void UIGMBox::PostDecayEvent( void )
void UIGMBox::PostDecayEvent(void)
{
if (!EventPending(EV_GMBox_Decay))
{
float fDelayTime;
int iNumLines;
int i;
const char* pszString = m_items[0].string.c_str();
if (!EventPending(EV_GMBox_Decay)) {
float fDelayTime;
int iNumLines;
int i;
const char *pszString = m_items[0].string.c_str();
//
// Calculate the number of lines
//
iNumLines = 1;
for (i = 0; pszString[i]; i++)
{
if (pszString[i] == '\n') {
iNumLines++;
}
}
//
// Calculate the number of lines
//
iNumLines = 1;
for (i = 0; pszString[i]; i++) {
if (pszString[i] == '\n') {
iNumLines++;
}
}
//
// Bold as twice more decay
//
if (m_items[0].flags & GMBOX_ITEM_FLAG_BOLD) {
fDelayTime = iNumLines * 10.0;
} else {
fDelayTime = iNumLines * 5.0;
}
//
// Bold as twice more decay
//
if (m_items[0].flags & GMBOX_ITEM_FLAG_BOLD) {
fDelayTime = iNumLines * 10.0;
} else {
fDelayTime = iNumLines * 5.0;
}
m_iBeginDecay = cls.realtime;
m_iEndDecay = (int)(fDelayTime * 1000.0);
m_iBeginDecay = cls.realtime;
m_iEndDecay = (int)(fDelayTime * 1000.0);
PostEvent(EV_GMBox_Decay, fDelayTime);
}
PostEvent(EV_GMBox_Decay, fDelayTime);
}
}
void UIGMBox::setShowState( void )
void UIGMBox::setShowState(void)
{
if (m_reallyshown) {
setShow(m_boxstate != box_in);
} else {
setShow(false);
}
if (m_reallyshown) {
setShow(m_boxstate != box_in);
} else {
setShow(false);
}
}
void UIGMBox::RemoveTopItem( void )
void UIGMBox::RemoveTopItem(void)
{
int i;
int i;
if (m_numitems > 0) {
for (i = 0; i < m_numitems - 1; i++) {
m_items[i] = m_items[i + 1];
}
if (m_numitems > 0) {
for (i = 0; i < m_numitems - 1; i++) {
m_items[i] = m_items[i + 1];
}
m_numitems--;
}
m_numitems--;
}
}
str UIGMBox::CalculateBreaks( UIFont *font, str text, float max_width )
str UIGMBox::CalculateBreaks(UIFont *font, str text, float max_width)
{
str newText, sTmp;
int i;
float fX;
float fwX, fsX;
str newText;
float fX;
float fwX;
const char *current;
int count;
Cmd_TokenizeString(text.c_str());
if (Cmd_Argc())
{
fX = 0.0;
fsX = font->getCharWidth(' ');
current = text;
fX = 0.0;
for (i = 0; i < Cmd_Argc(); i++)
{
sTmp = Cmd_Argv(i);
for (count = font->DBCSGetWordBlockCount(current, -1); count;
current += count, count = font->DBCSGetWordBlockCount(current, -1)) {
fwX = font->getWidth(current, count);
fwX = font->getWidth(sTmp.c_str(), -1);
if (fwX + i <= max_width)
{
if (fwX + i + fX <= max_width)
{
newText += sTmp + " ";
} else {
newText += "\n" + sTmp + " ";
}
}
else
{
sTmp += "\n";
fX = 0.0;
}
}
} else {
newText = "";
}
if (fX + fwX > max_width) {
newText += "\n" + str(current, 0, count);
fX = 0;
} else {
newText += str(current, 0, count);
}
return newText;
fX += fwX;
}
return newText;
}
float UIGMBox::PrintWrap( UIFont *font, float x, float y, str text )
float UIGMBox::PrintWrap(UIFont *font, float x, float y, str text)
{
const char* p1, * p2;
size_t n, l;
float fY;
const char *p1, *p2;
size_t n, l;
float fY;
fY = y;
p1 = text.c_str();
l = text.length();
fY = y;
p1 = text.c_str();
l = text.length();
for (;;)
{
p2 = strchr(p1, '\n');
if (!p2) {
break;
}
for (;;) {
p2 = strchr(p1, '\n');
if (!p2) {
break;
}
n = p2 - p1;
if (n >= l) {
break;
}
n = p2 - p1;
if (n >= l) {
break;
}
font->Print(x, fY, p1, p2 - p1, qfalse);
p1 = p2 + 1;
l -= n;
fY += font->getHeight(qfalse);
}
font->Print(x, fY, p1, p2 - p1, getHighResScale());
p1 = p2 + 1;
l -= n;
fY += font->getHeight();
}
font->Print(x, fY, p1, l, qfalse);
if (*p1) {
font->Print(x, fY, p1, l, getHighResScale());
fY += font->getHeight();
}
return font->getHeight(qfalse) + (fY - y);
return fY - y;
}
float UIGMBox::DrawItem( item_t *in, float x, float y, float alpha )
float UIGMBox::DrawItem(item_t *in, float x, float y, float alpha)
{
in->font->setColor(in->color);
in->font->setAlpha(alpha);
if (m_drawoutline) {
//
// Draw an outline
//
return PrintWrap(in->font, x, y, in->string);
in->font->setColor(UBlack);
in->font->setAlpha(alpha);
PrintWrap(in->font, x + 1, y + 2, in->string);
PrintWrap(in->font, x + 2, y + 1, in->string);
PrintWrap(in->font, x - 1, y + 2, in->string);
PrintWrap(in->font, x - 2, y + 1, in->string);
PrintWrap(in->font, x - 1, y - 2, in->string);
PrintWrap(in->font, x - 2, y - 1, in->string);
PrintWrap(in->font, x + 1, y - 2, in->string);
PrintWrap(in->font, x + 2, y - 1, in->string);
PrintWrap(in->font, x + 2, y, in->string);
PrintWrap(in->font, x - 2, y, in->string);
PrintWrap(in->font, x, y + 2, in->string);
PrintWrap(in->font, x, y - 2, in->string);
}
in->font->setColor(in->color);
in->font->setAlpha(alpha);
return PrintWrap(in->font, x, y, in->string);
}
void UIGMBox::Print( const char *text )
void UIGMBox::Print(const char *text)
{
const char* text1 = text;
const char *text1 = text;
if (m_numitems > 4)
{
//
// Overwrite an item
//
RemoveTopItem();
}
if (m_numitems > 4) {
//
// Overwrite an item
//
RemoveTopItem();
}
m_items[m_numitems].flags = 0;
m_items[m_numitems].flags = 0;
if (*text == 3)
{
m_items[m_numitems].color = UWhite;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= GMBOX_ITEM_FLAG_BOLD;
if (*text == MESSAGE_WHITE) {
m_items[m_numitems].color = UWhite;
m_items[m_numitems].font = m_fontbold;
m_items[m_numitems].flags |= GMBOX_ITEM_FLAG_BOLD;
text1 = text + 1;
}
else
{
m_items[m_numitems].color = m_foreground_color;
m_items[m_numitems].font = m_font;
}
text1 = text + 1;
} else {
m_items[m_numitems].color = m_foreground_color;
m_items[m_numitems].font = m_font;
}
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, text1, s_gmboxWidth);
m_items[m_numitems].string = CalculateBreaks(m_items[m_numitems].font, Sys_LV_CL_ConvertString(text1), s_gmboxWidth);
m_numitems++;
VerifyBoxOut();
PostDecayEvent();
m_numitems++;
VerifyBoxOut();
PostDecayEvent();
}
void UIGMBox::OnSizeChanged( Event *ev )
void UIGMBox::OnSizeChanged(Event *ev)
{
s_gmboxWidth = m_frame.size.width;
s_gmboxWidth = m_frame.size.width;
}
void UIGMBox::Create( const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha )
void UIGMBox::Create(const UIRect2D& rect, const UColor& fore, const UColor& back, float alpha)
{
InitFrame(NULL, rect, 0, "facfont-20");
InitFrame(NULL, rect, 0, "facfont-20");
if (!m_fontbold) {
m_fontbold = new UIFont("facfont-20");
}
if (!m_fontbold) {
m_fontbold = new UIFont("facfont-20");
}
m_fontbold->setColor(URed);
setBackgroundColor(back, true);
setForegroundColor(fore);
setBackgroundAlpha(alpha);
m_fontbold->setColor(URed);
setBackgroundColor(back, true);
setForegroundColor(fore);
setBackgroundAlpha(alpha);
Connect(this, W_SizeChanged, W_SizeChanged);
OnSizeChanged(NULL);
Connect(this, W_SizeChanged, W_SizeChanged);
OnSizeChanged(NULL);
m_movespeed = rect.size.height * 3.0;
m_movespeed = rect.size.height * 3.0;
setShowState();
setShowState();
}
void UIGMBox::MoveInEvent( Event *ev )
void UIGMBox::MoveInEvent(Event *ev) {}
void UIGMBox::DecayEvent(Event *ev)
{
RemoveTopItem();
if (m_numitems) {
PostDecayEvent();
}
}
void UIGMBox::DecayEvent( Event *ev )
void UIGMBox::Draw(void)
{
RemoveTopItem();
if (m_numitems) {
PostDecayEvent();
}
float fsY;
int i;
float alpha;
float alphaScale;
alphaScale = 1.0;
HandleBoxMoving();
if (!m_numitems) {
//
// Nothing to show
//
return;
}
m_font->setColor(m_foreground_color);
alpha = (float)(cls.realtime - m_iBeginDecay) / (float)m_iEndDecay;
if (alpha > 1.0) {
alpha = 1.0;
}
alpha = (1.0 - alpha) * 4.0;
if (alpha > 1.0) {
alpha = 1.0;
}
if (cge) {
alphaScale = 1.0 - cge->CG_GetObjectiveAlpha();
}
fsY = DrawItem(m_items, s_gmboxOffsetX, s_gmboxOffsetY, alpha * alphaScale);
fsY = alpha <= 0.2 ? s_gmboxOffsetY : fsY + s_gmboxOffsetY;
for (i = 1; i < m_numitems; i++) {
fsY += DrawItem(&m_items[i], s_gmboxOffsetX, fsY, alphaScale);
if (fsY > m_frame.size.height) {
if (EventPending(EV_GMBox_Decay)) {
CancelEventsOfType(EV_GMBox_Decay);
}
PostEvent(EV_GMBox_Decay, 0.0);
break;
}
}
}
void UIGMBox::Draw( void )
void UIGMBox::setRealShow(bool b)
{
float fsY;
int i;
float alpha;
float alphaScale;
alphaScale = 1.0;
HandleBoxMoving();
if (!m_numitems) {
//
// Nothing to show
//
return;
}
m_font->setColor(m_foreground_color);
alpha = (float)(cls.realtime - m_iBeginDecay) / (float)m_iEndDecay;
if (alpha > 1.0) alpha = 1.0;
alpha = (1.0 - alpha) * 4.0;
if (alpha > 1.0) alpha = 1.0;
if (cge) {
alphaScale = 1.0 - cge->CG_GetObjectiveAlpha();
}
fsY = DrawItem(m_items, s_gmboxOffsetX, s_gmboxOffsetY, alpha * alphaScale);
fsY = alpha <= 0.2 ? s_gmboxOffsetY : fsY + s_gmboxOffsetY;
for (i = 1; i < m_numitems; i++)
{
fsY += DrawItem(&m_items[i], s_gmboxOffsetX, fsY, alphaScale);
if (fsY > m_frame.size.height)
{
if (EventPending(EV_GMBox_Decay)) {
CancelEventsOfType(EV_GMBox_Decay);
}
PostEvent(EV_GMBox_Decay, 0.0);
break;
}
}
this->m_reallyshown = b;
setShowState();
}
void UIGMBox::setRealShow( bool b )
void UIGMBox::Clear(void)
{
this->m_reallyshown = b;
setShowState();
m_numitems = 0;
}
void UIGMBox::Clear( void )
{
m_numitems = 0;
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2015-2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,8 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_UIGMBOX_H__
#define __CL_UIGMBOX_H__
#pragma once
static constexpr unsigned int GMBOX_ITEM_FLAG_BOLD = 1u;
@ -44,6 +43,8 @@ protected:
int m_movespeed;
int m_iBeginDecay;
int m_iEndDecay;
// Added in OPM
bool m_drawoutline;
public:
CLASS_PROTOTYPE( UIGMBox );
@ -72,5 +73,3 @@ public:
void setRealShow( bool b );
void Clear( void );
};
#endif

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023-2024 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -21,44 +21,224 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "cl_ui.h"
#include "../qcommon/localization.h"
CLASS_DECLARATION( UIListCtrl, UILANGameClass, NULL )
class LANGameItem : public UIListCtrlItem
{
{ NULL, NULL }
str strings[6];
public:
LANGameItem();
LANGameItem(
const str& hostName, const str& mapName, const str& players, const str& gameTypeString, const str& ping, const str& ipAddress
);
int getListItemValue(int which) const override;
griditemtype_t getListItemType(int which) const override;
str getListItemString(int which) const override;
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
qboolean IsHeaderEntry() const override;
};
Event EV_LANGame_JoinGame
(
"joingame",
EV_DEFAULT,
NULL,
NULL,
"Join the currently selected server"
);
CLASS_DECLARATION(UIListCtrl, UILANGameClass, NULL) {
{&EV_UIListBase_ItemSelected, &UILANGameClass::SelectServer},
{&EV_UIListBase_ItemDoubleClicked, &UILANGameClass::JoinServer },
{&EV_LANGame_JoinGame, &UILANGameClass::JoinServer },
{NULL, NULL }
};
UILANGameClass::UILANGameClass()
{
// FIXME: stub
Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
AllowActivate(true);
setHeaderFont("facfont-20");
m_iLastUpdateTime = 0;
m_noservers_mat = uWinMan.RegisterShader("textures/menu/noservers");
//
// Added in OPM
//
m_bVirtual = false;
}
void UILANGameClass::SetupServers( void )
void UILANGameClass::Draw(void)
{
// FIXME: stub
if (cls.bNewLocalServerInfo) {
SetupServers();
}
UIListCtrl::Draw();
if (!getNumItems() && m_noservers_mat) {
float x, y, w, h;
w = re.GetShaderWidth(m_noservers_mat->GetMaterial()) * m_vVirtualScale[0];
h = re.GetShaderHeight(m_noservers_mat->GetMaterial()) * m_vVirtualScale[1];
UIRect2D frame = getClientFrame();
x = (frame.size.width - w) * 0.5f;
y = (frame.size.height - h) * 0.5f;
re.DrawStretchPic(x, y, w, h, 0, 0, 1, 1, m_noservers_mat->GetMaterial());
}
if (m_iLastUpdateTime && m_iLastUpdateTime < cls.realtime) {
Cvar_Set("cl_langamerefreshstatus", "Ready");
m_iLastUpdateTime = 0;
}
}
void UILANGameClass::Draw( void )
void UILANGameClass::UpdateUIElement(void)
{
// FIXME: stub
float width;
RemoveAllColumns();
width = getClientFrame().size.width - 16.f;
AddColumn(Sys_LV_CL_ConvertString("Server Name"), 0, width * 0.27f, false, false); // was 0.4
AddColumn(Sys_LV_CL_ConvertString("Map"), 1, width * 0.12f, false, false); // was 0.15
AddColumn(Sys_LV_CL_ConvertString("Players"), 2, width * 0.08f, true, true); // was 0.165
AddColumn(Sys_LV_CL_ConvertString("GameType"), 3, width * 0.118f, false, false); // was 0.22
AddColumn(Sys_LV_CL_ConvertString("Ping"), 4, width * 0.052f, true, false); // was 0.065
AddColumn(Sys_LV_CL_ConvertString("IP"), 5, width * 0.36f, false, false); // Added in OPM
uWinMan.ActivateControl(this);
SetupServers();
}
void UILANGameClass::SelectServer( Event *ev )
void UILANGameClass::SetupServers(void)
{
// FIXME: stub
int i;
LANGameItem *pItem;
const serverInfo_t *pServerInfo;
for (i = 1; i <= cls.numlocalservers; i++) {
pServerInfo = &cls.localServers[i - 1];
if (i > getNumItems()) {
pItem = new LANGameItem();
AddItem(pItem);
} else {
pItem = static_cast<LANGameItem *>(GetItem(i));
}
*pItem = LANGameItem(
pServerInfo->hostName,
pServerInfo->mapName,
va("%02i/%02i", pServerInfo->clients, pServerInfo->maxClients),
pServerInfo->gameTypeString,
str(pServerInfo->ping),
// Added in OPM
NET_AdrToStringwPort(pServerInfo->adr)
);
}
while (cls.numlocalservers < getNumItems()) {
DeleteItem(getNumItems());
}
cls.bNewLocalServerInfo = false;
m_iLastUpdateTime = 0;
}
void UILANGameClass::JoinServer( Event *ev )
void UILANGameClass::SelectServer(Event *ev)
{
// FIXME: stub
const serverInfo_t& serverInfo = cls.localServers[getCurrentItem() - 1];
static const char info[] = "\xFF\xFF\xFF\xFF\x02getinfo xxx";
Com_Printf("Requesting updated info from server...\n");
Cvar_Set("cl_langamerefreshstatus", "Requesting updated info from server...");
NET_SendPacket(NS_CLIENT, sizeof(info), info, serverInfo.adr);
m_iLastUpdateTime = cls.realtime + 3000;
}
qboolean UILANGameClass::KeyEvent( int key, unsigned int time )
void UILANGameClass::JoinServer(Event *ev)
{
// FIXME: stub
return qfalse;
if (!getCurrentItem()) {
return;
}
const serverInfo_t& serverInfo = cls.localServers[getCurrentItem() - 1];
UI_SetReturnMenuToCurrent();
CL_Connect(NET_AdrToStringwPort(serverInfo.adr), netadrtype_t::NA_UNSPEC);
}
void UILANGameClass::UpdateUIElement( void )
qboolean UILANGameClass::KeyEvent(int key, unsigned int time)
{
// FIXME: stub
switch (key) {
case K_ENTER:
case K_KP_ENTER:
JoinServer(NULL);
return true;
case K_UPARROW:
if (getCurrentItem() > 1) {
TrySelectItem(getCurrentItem() - 1);
SelectServer(NULL);
}
return false;
case K_DOWNARROW:
if (getCurrentItem() < getNumItems()) {
TrySelectItem(getCurrentItem() + 1);
SelectServer(NULL);
}
return false;
}
return UIListBase::KeyEvent(key, time);
}
LANGameItem::LANGameItem() {}
LANGameItem::LANGameItem(
const str& hostName, const str& mapName, const str& players, const str& gameTypeString, const str& ping, const str& ipAddress
)
{
strings[0] = hostName;
strings[1] = mapName;
strings[2] = players;
strings[3] = gameTypeString;
strings[4] = ping;
//
// Added in OPM
//
strings[5] = ipAddress;
}
int LANGameItem::getListItemValue(int which) const
{
return atoi(strings[which]);
}
griditemtype_t LANGameItem::getListItemType(int which) const
{
return griditemtype_t::TYPE_STRING;
}
str LANGameItem::getListItemString(int which) const
{
return strings[which];
}
void LANGameItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
qboolean LANGameItem::IsHeaderEntry() const
{
return qfalse;
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -20,29 +20,27 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
#ifndef __CL_UILANGAME_H__
#define __CL_UILANGAME_H__
#pragma once
class UILANGameClass : public UIListCtrl {
class UILANGameClass : public UIListCtrl
{
protected:
int m_iLastUpdateTime;
UIReggedMaterial *m_noservers_mat;
int m_iLastUpdateTime;
UIReggedMaterial *m_noservers_mat;
public:
CLASS_PROTOTYPE( UILANGameClass );
CLASS_PROTOTYPE(UILANGameClass);
private:
void SetupServers( void );
void SetupServers(void);
protected:
void Draw( void ) override;
void SelectServer( Event *ev );
void JoinServer( Event *ev );
qboolean KeyEvent( int key, unsigned int time ) override;
void UpdateUIElement( void ) override;
void Draw(void) override;
void SelectServer(Event *ev);
void JoinServer(Event *ev);
qboolean KeyEvent(int key, unsigned int time) override;
void UpdateUIElement(void) override;
public:
UILANGameClass();
UILANGameClass();
};
#endif /* __CL_UILANGAME_H__ */

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2015 the OpenMoHAA team
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -21,63 +21,359 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "cl_ui.h"
#include "../qcommon/localization.h"
CLASS_DECLARATION( UIListCtrl, UIFAKKLoadGameClass, NULL )
class FAKKLoadGameItem : public UIListCtrlItem
{
{ NULL, NULL }
str strings[4];
public:
FAKKLoadGameItem(const str& missionName, const str& elapsedTime, const str& dateTime, const str& fileName);
int getListItemValue(int which) const override;
griditemtype_t getListItemType(int which) const override;
str getListItemString(int which) const override;
void DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) override;
qboolean IsHeaderEntry() const override;
};
static UIFAKKLoadGameClass *loadgame_ui = NULL;
Event EV_FAKKLoadGame_LoadGame
(
"loadgame",
EV_DEFAULT,
NULL,
NULL,
"Load the currently selected game"
);
Event EV_FAKKLoadGame_RemoveGame
(
"removegame",
EV_DEFAULT,
NULL,
NULL,
"Delete the currently selected game"
);
Event EV_FAKKLoadGame_DeleteGame
(
"deletegame",
EV_DEFAULT,
NULL,
NULL,
"Delete the currently selected game... for real"
);
Event EV_FAKKLoadGame_NoDeleteGame
(
"nodeletegame",
EV_DEFAULT,
NULL,
NULL,
"Delete the currently selected game... for real"
);
Event EV_FAKKLoadGame_SaveGame
(
"savegame",
EV_DEFAULT,
NULL,
NULL,
"Save the currently selected game"
);
CLASS_DECLARATION(UIListCtrl, UIFAKKLoadGameClass, NULL) {
{&EV_UIListBase_ItemSelected, &UIFAKKLoadGameClass::SelectGame },
{&EV_UIListBase_ItemDoubleClicked, &UIFAKKLoadGameClass::LoadGame },
{&EV_FAKKLoadGame_RemoveGame, &UIFAKKLoadGameClass::RemoveGame },
{&EV_FAKKLoadGame_DeleteGame, &UIFAKKLoadGameClass::DeleteGame },
{&EV_FAKKLoadGame_NoDeleteGame, &UIFAKKLoadGameClass::NoDeleteGame},
{&EV_FAKKLoadGame_LoadGame, &UIFAKKLoadGameClass::LoadGame },
{&EV_FAKKLoadGame_SaveGame, &UIFAKKLoadGameClass::SaveGame },
{NULL, NULL }
};
UIFAKKLoadGameClass::UIFAKKLoadGameClass()
{
// FIXME: stub
Connect(this, EV_UIListBase_ItemDoubleClicked, EV_UIListBase_ItemDoubleClicked);
Connect(this, EV_UIListBase_ItemSelected, EV_UIListBase_ItemSelected);
AllowActivate(true);
m_bRemovePending = false;
setHeaderFont("facfont-20");
loadgame_ui = this;
}
void UIFAKKLoadGameClass::SelectGame( Event *ev )
UIFAKKLoadGameClass::~UIFAKKLoadGameClass()
{
// FIXME: stub
loadgame_ui = NULL;
}
void UIFAKKLoadGameClass::LoadGame( Event *ev )
void UIFAKKLoadGameClass::UpdateUIElement(void)
{
// FIXME: stub
float width;
RemoveAllColumns();
width = getClientFrame().size.width;
AddColumn(Sys_LV_CL_ConvertString("Mission"), 0, width * 0.555, false, false);
AddColumn(Sys_LV_CL_ConvertString("Elapsed Time"), 1, width * 0.17f, true, true);
AddColumn(Sys_LV_CL_ConvertString("Date & Time Logged"), 2, width * 0.275f, true, true);
uWinMan.ActivateControl(this);
SetupFiles();
}
void UIFAKKLoadGameClass::SaveGame( Event *ev )
void UIFAKKLoadGameClass::SetupFiles(void)
{
// FIXME: stub
char **filenames;
int numfiles;
int i;
const char *searchFolder = Com_GetArchiveFolder();
// cleanup
DeleteAllItems();
filenames = FS_ListFiles(searchFolder, "ssv", qfalse, &numfiles);
for (i = 0; i < numfiles; i++) {
const char *filename;
str work;
str gametime;
str date;
fileHandle_t f;
savegamestruct_t save;
filename = filenames[i];
work = searchFolder;
work += "/";
work += filename;
FS_FOpenFileRead(work, &f, qfalse, qtrue);
if (!f) {
continue;
}
FS_Read(&save, sizeof(savegamestruct_t), f);
FS_FCloseFile(f);
Com_SwapSaveStruct(&save);
if (save.version != SAVEGAME_STRUCT_VERSION) {
// wrong save game version
continue;
}
if (save.type != com_target_game->integer) {
continue;
}
gametime = (save.mapTime / 1000);
date = save.time;
AddItem(new FAKKLoadGameItem(save.comment, gametime, date, save.saveName));
}
FS_FreeFileList(filenames);
// sort by date
SortByColumn(2);
// select the first item
TrySelectItem(1);
SelectGame(NULL);
}
void UIFAKKLoadGameClass::RemoveGame( Event *ev )
void UIFAKKLoadGameClass::SelectGame(Event *ev)
{
// FIXME: stub
UIWidget *wid;
const char *shotName;
if (getCurrentItem() > 0) {
shotName = Com_GetArchiveFileName(GetItem(getCurrentItem())->getListItemString(3), "tga");
} else {
shotName = "textures/menu/no_saved_games.tga";
}
wid = findSibling("LoadSaveShot");
if (!wid) {
return;
}
wid->setMaterial(uWinMan.RefreshShader(shotName));
}
void UIFAKKLoadGameClass::DeleteGame( Event *ev )
void UIFAKKLoadGameClass::RemoveGame(Event *ev)
{
// FIXME: stub
if (m_bRemovePending || getCurrentItem() <= 0) {
return;
}
Cbuf_ExecuteText(
EXEC_NOW,
"dialog \"\" \"\" \"widgetcommand LoadSaveList deletegame\" \"widgetcommand LoadSaveList nodeletegame\" 256 64 "
"confirm_delete menu_button_trans menu_button_trans\n"
);
m_bRemovePending = true;
}
void UIFAKKLoadGameClass::NoDeleteGame( Event *ev )
void UIFAKKLoadGameClass::NoDeleteGame(Event *ev)
{
// FIXME: stub
m_bRemovePending = false;
}
qboolean UIFAKKLoadGameClass::KeyEvent( int key, unsigned int time )
void UIFAKKLoadGameClass::DeleteGame(Event *ev)
{
// FIXME: stub
return qfalse;
str name;
cvar_t *var;
m_bRemovePending = false;
if (getCurrentItem() <= 0) {
return;
}
name = GetItem(getCurrentItem())->getListItemString(3);
var = Cvar_Get("g_lastsave", "", 0);
if (!strcmp(name, var->string)) {
// Make sure the last save is not the save being deleted
Cvar_Set("g_lastsave", "");
}
Com_WipeSavegame(name);
SetupFiles();
}
void UIFAKKLoadGameClass::UpdateUIElement( void )
void UIFAKKLoadGameClass::LoadGame(Event *ev)
{
// FIXME: stub
char cmdString[266];
str name;
if (getCurrentItem() <= 0) {
return;
}
name = GetItem(getCurrentItem())->getListItemString(3);
// Execute the command
Com_sprintf(cmdString, sizeof(cmdString), "loadgame %s\n", name.c_str());
Cbuf_AddText(cmdString);
}
void UIFAKKLoadGameClass::SetupFiles( void )
void UIFAKKLoadGameClass::SaveGame(Event *ev)
{
// FIXME: stub
Cbuf_ExecuteText(EXEC_NOW, "savegame");
}
void UI_SetupFiles( void ) {
// FIXME: stub
qboolean UIFAKKLoadGameClass::KeyEvent(int key, unsigned int time)
{
switch (key) {
case K_DEL:
RemoveGame(NULL);
return qtrue;
case K_ENTER:
case K_KP_ENTER:
LoadGame(NULL);
return qtrue;
case K_UPARROW:
if (getCurrentItem() > 1) {
TrySelectItem(getCurrentItem() - 1);
SelectGame(NULL);
return qtrue;
}
break;
case K_DOWNARROW:
if (getCurrentItem() < getNumItems()) {
TrySelectItem(getCurrentItem() + 1);
SelectGame(NULL);
return qtrue;
}
break;
default:
return UIListCtrl::KeyEvent(key, time);
}
return qfalse;
}
void UI_SetupFiles(void)
{
if (loadgame_ui && loadgame_ui->getShow()) {
loadgame_ui->SetupFiles();
}
}
FAKKLoadGameItem::FAKKLoadGameItem(
const str& missionName, const str& elapsedTime, const str& dateTime, const str& fileName
)
{
strings[0] = missionName;
strings[1] = elapsedTime;
strings[2] = dateTime;
strings[3] = fileName;
}
int FAKKLoadGameItem::getListItemValue(int which) const
{
return atoi(strings[which]);
}
griditemtype_t FAKKLoadGameItem::getListItemType(int which) const
{
return griditemtype_t::TYPE_STRING;
}
str FAKKLoadGameItem::getListItemString(int which) const
{
str itemstring;
switch (which) {
case 0:
case 3:
itemstring = strings[which];
break;
case 1:
{
int numseconds;
int numseconds_hours;
int seconds;
// hours
numseconds = atol(strings[1]);
itemstring += (numseconds / 3600);
itemstring += ":";
// minutes
numseconds_hours = numseconds % 3600;
if (numseconds_hours / 60 < 10) {
itemstring += "0";
}
itemstring += (numseconds_hours / 60);
itemstring += ":";
// seconds
seconds = numseconds_hours % 60;
if (seconds < 10) {
itemstring += "0";
}
itemstring += seconds;
}
break;
case 2:
{
time_t time;
char buffer[2048];
time = atol(strings[2]);
strftime(buffer, sizeof(buffer), "%a %b %d %Y %H:%M:%S", localtime(&time));
itemstring = buffer;
}
break;
}
return itemstring;
}
void FAKKLoadGameItem::DrawListItem(int iColumn, const UIRect2D& drawRect, bool bSelected, UIFont *pFont) {}
qboolean FAKKLoadGameItem::IsHeaderEntry() const
{
return qfalse;
}

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