Compare commits

..
311 Commits
Author SHA1 Message Date
smallmodel a2f3401959 docs: clarify contribution guidelines 2026-04-24 00:05:25 +02:00
smallmodel 667c50f9b2 fix(cgame): draw svlag only if developer mode is enabled 2026-04-13 22:10:46 +02:00
smallmodel bcf1c4a4ea docs: improve installation documentation 2026-04-12 16:43:50 +02:00
smallmodel 7831195b98 feat(fgame): add cvar to allow standing on another player's head 2026-04-12 16:42:21 +02:00
smallmodel 44ce0595c2 fix(fgame): fix typo in TurretGun setthread response method (#915) 2026-04-09 00:37:09 +02:00
smallmodel 2a105f52a3 fix(fgame): use the default player start when no spawn point is specified during map load 2026-04-08 22:52:26 +02:00
smallmodel 067302c108 fix(fgame): fix incorrect damage clamping 2026-04-07 19:21:48 +02:00
smallmodel 614f424105 feat(fgame): add a default targetname to playerstart (#913) 2026-04-06 17:22:20 +02:00
smallmodel b1a45c0546 feat(client): add fps_location to set the location of the FPS counter on screen 2026-04-06 14:53:53 +02:00
smallmodel 8b9881736c feat(client): for fps, show the number of verts/tris when the option is set to 2 2026-04-06 13:46:38 +02:00
smallmodel 21a6e07180 fix(sys): use the binary's location as the default base path rather than the current directory
This is the default behavior in upstream (ioquake3).

This avoids issues with the current directory varying depending on how the program is launched (shortcut, services...) and improves portability when the binary is moved.

It doesn't require users to cd into a specific directory before launching.

The game directory can be overridden by setting `fs_basepath` variable.
2026-04-06 02:19:18 +02:00
smallmodel a21732ce3e chore(misc): update icon files
This updates/adds win32 icons for AA, SH and BT. This should fix corrupted icon on the taskbar.
2026-04-06 02:02:20 +02:00
smallmodel 46aa4ebed1 fix(cmake): show the system console only for debug releases 2026-04-06 01:18:18 +02:00
smallmodel 5ebf885a19 chore(qcommon): handle com_viewlog modification 2026-04-06 01:16:22 +02:00
smallmodel 8c31216b59 feat(fgame): add an option for continuous legs animation 2026-04-06 00:29:41 +02:00
smallmodel d50de3f00a feat(fgame): add a variable to reopen doors from the opposite side when blocked 2026-04-05 21:41:24 +02:00
.Crimewavez 969311274f fix(cgame): crosshair centering at hi-res UI scaling (#908) 2026-03-29 21:41:05 +02:00
.Crimewavez 919206af63 fix(ui): use actual drawn width for horizontal statbar tile shader (#906) 2026-03-29 21:32:41 +02:00
smallmodel dd1e7469ab fix(script): fix array being freed during evaluation (#904) 2026-03-19 23:30:09 +01:00
Tim Angus 42a9d00bbf Fix incorrect variable reference 2026-03-11 21:37:57 +01:00
smallmodel b1d81e4e92 fix(actions): fix flex/bison cmake configuration error on windows 2026-03-10 23:11:57 +01:00
motrar 94d10d08d5 chore(misc): add spearhead and breakthrough icons
Signed-off-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2026-03-10 22:55:49 +01:00
smallmodel 842f120b43 chore(misc): cleanup svg files 2026-03-10 22:44:35 +01:00
smallmodel f812e784e0 fix(misc): fix linux screenshots link 2026-03-10 21:22:17 +01:00
Alex S 25b336eb58 fix(fgame): print objective text to all player screens (#901) 2026-03-10 21:16:46 +01:00
smallmodel ab43a0def6 fix(fgame): only throw an error if the target name is not found when g_scriptdebug is set 2026-03-06 00:57:52 +01:00
smallmodel 87dd1f650e fix(fgame): fix vehiclesoundentity_postspawn event name (#899) 2026-03-02 22:33:22 +01:00
smallmodel 68cca1c58b fix(ui): fix stat spinner flash lacking transparency (#898) 2026-03-01 22:58:07 +01:00
smallmodel 7edc1028bd fix(renderer): load the same DCL file as the large lightmap BSP file 2026-03-01 21:16:41 +01:00
smallmodel 903c4a290e docs: update doxygen-awesome-css 2026-02-28 01:02:01 +01:00
smallmodel e7c192fbf2 fix(parser): treat "end" as a reserved keyword
Some scripts omit whitespace after the command, for example `end//test comment`, which causes the parser to fail.
2026-02-27 23:54:02 +01:00
smallmodel 8cbaff38b5 fix(docs): disable automatic link in Doxygen 2026-02-27 19:12:14 +01:00
.Crimewavezandsmallmodel e7bd3c22c4 fix(fgame): fix access violation in Actor::Think_MachineGunner_TurretGun (#896)
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2026-02-26 00:27:31 +01:00
.Crimewavez 3f83b4b36a fix(common): fix buffer overflow in CM_EdgePlaneNum (#895) 2026-02-25 21:22:18 +01:00
smallmodel 97da1c58d1 feat(fgame): implement missing ScriptDoor functionality from mohaa (#893) 2026-02-24 23:31:07 +01:00
cbbf307fd0 docs: fix broken links
This fixes links set the markdown ID style to GITHUB so the documentation can be read both using Markdown or from the documentation website.
It also updates doxygen to version 1.16.1.

Co-authored-by: laurensdepaepe <laurens@encima.com>
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2026-02-24 20:49:14 +01:00
smallmodel c98165ea5f chore(fgame): fix forcedropweapon description 2026-02-21 21:05:54 +01:00
smallmodel 0c5f7db70d fix(client): make serverlist interaction the same when using key or buttons 2026-02-19 21:23:26 +01:00
smallmodel dfd9bd230c fix(renderer): add missing surface* functions and alphagen identity 2026-02-18 00:59:35 +01:00
smallmodel 41a4ba9036 feat(fgame): add level intermission and level exit events
This adds level_exit and level_intermission, with backwards compatibility for old scripted events.
2026-02-16 23:39:35 +01:00
smallmodel 230fcb7ff6 fix(fgame): add missing #pragma once and copyright in headers 2026-02-16 21:44:15 +01:00
smallmodel bd8a07cd4e fix(compile): fix build errors in renderergl2 with some compilers 2026-02-15 22:43:58 +01:00
smallmodel 69d2236d8b fix(client): fix reconnect command not working after disconnect (#883) 2026-02-13 00:12:49 +01:00
smallmodel 729e72ae40 docs: update compiling documentation to reflect with the new CMake changes from ioquake3 2026-02-11 00:59:25 +01:00
smallmodel b5c25001e9 fix(container): use modern cmake version on older ubuntu versions 2026-02-11 00:19:03 +01:00
smallmodel 8779f00195 fix(cmake): check for BUILD_CLIENT instead of BUILD_NO_CLIENT 2026-02-10 22:43:05 +01:00
smallmodel 7b357cdfa9 fix(fgame): fix text message event receiving only the last word (#882) 2026-02-10 21:54:26 +01:00
smallmodel 3e4b989a13 fix(fgame): properly calculate the number of not ready players 2026-02-10 21:39:28 +01:00
smallmodel b64ba58654 docs(readme): update links 2026-02-10 21:38:37 +01:00
smallmodel 5b663c9699 fix(parser): handle cases where there is no space after brackets
e.g `if(cond)println "test"`
2026-02-04 23:51:26 +01:00
smallmodel 5e3944d530 fix(script): store the type name rather than throwing an exception when casting an unhandled type to string 2026-02-04 23:51:23 +01:00
smallmodel 8a8d0d3a63 chore(parser): use a single function to rollback to the previous token 2026-02-04 21:10:55 +01:00
smallmodel b8a20d9ab9 fix(fgame): fix addbotnamed still using the old sv_botxname variables 2026-02-01 21:49:24 +01:00
smallmodel 489bd9385c fix(gamespy): use global qrec 2026-02-01 13:30:10 +01:00
smallmodel 02de33a5c8 docs(changelog): update changelog 2026-02-01 02:06:21 +01:00
smallmodel f53dc80d7c fix(server): use multiplayer gametype as default for dedicated servers
Dedicated servers are only playable with a multiplayer gametype. Making it the default value simplifies setup for users.
2026-02-01 01:47:21 +01:00
smallmodel 6e6ccd8f05 fix(gamespy): update net_gamespy_port to match the bound port
This makes it clearer for users by showing the actual port in use, without requiring the use of external tools.
2026-01-31 23:51:21 +01:00
smallmodel d77873ccf7 chore: use explicit enum for checking g_gametype 2026-01-29 19:54:37 +01:00
smallmodel 1b33f499e7 fix(fgame): add missing skipFade parameter from mohaab in leveltransition and missiontransition 2026-01-29 19:50:27 +01:00
smallmodel 887b649bb5 chore(fgame): clarify intermission type 2026-01-29 19:43:34 +01:00
smallmodel dda5b11cbc fix(common): use Q3CONFIG_CFG macro for the config file
This also splits the config between client `omconfig.cfg` and dedicated server `omconfig_server.cfg`
2026-01-29 19:26:24 +01:00
smallmodel 9ec545aae6 chore(fgame): clarify squad sentient methods 2026-01-26 22:52:21 +01:00
smallmodel 497b0df699 fix(fgame): fix nearby squads not forming when disguised, or forming with improper radius and dead sentients 2026-01-26 22:44:54 +01:00
smallmodel 0d271fe180 fix(fgame): properly check for valid squadmate before taking action (#875) 2026-01-26 22:30:52 +01:00
smallmodel 879e2397ce docs(changelog): update changelog 2026-01-23 00:34:06 +01:00
Florianandsmallmodel b19a3406fb docs: Improve installation and FAQ documentation for clarity (#868)
Signed-off-by: Florian <florian.olive@gmail.com>
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2026-01-23 00:33:33 +01:00
smallmodel a09132b9fd fix(cgame): always use the same crosshair_friend value across base and expansions
This prevents expansions from inheriting the default crosshair texture on first launch, avoiding the crosshair turning green when hovering over a teammate.
2026-01-21 23:29:50 +01:00
smallmodel 2970ab1d02 fix(fgame)!: rename bot_manualmove to g_bot_manualmove for consistency with other bot settings
This also fixes a tiny issue where bots would lag in place for 1 second when setting the manual move
2026-01-21 23:29:44 +01:00
smallmodel e1f49207d2 fix(fgame)!: rename sv_botxname to g_botx_name for consistency
The name of bots are game-specific settings, so it must be prefixed with `g_` rather than `sv_`, plus the setting name should properly separated by an underscore for clarity.
Some allocation variables like `sv_numbots` and `sv_maxbots` start with `sv_` even though they are read by game. It's because they interfere with the server's allocation of clients.
2026-01-20 21:46:57 +01:00
Tim Angus cb39fe5709 Allow execution of VM code on macOS
The Q3 VM compiles native code that is unsigned, which since Tahoe (possibly
earlier) requires an entitlement to be set in order to execute it.
2026-01-20 21:46:45 +01:00
Allen Cronce 55443336d8 Set the maximum file limit for POSIX systems
Resolves an issue where the macOS application's dylibs could not be
loaded because there were too many maps; on macOS the default maximum
number of open files is 256.
2026-01-20 21:46:44 +01:00
smallmodel 951b4b33b9 fix(cgame): handle effectNum = -1 for bullets, used for surface deduction (#872) 2026-01-18 20:33:05 +01:00
smallmodel 2681659329 fix(skeletor): avoid nan or negative time value (#871) 2026-01-18 17:42:24 +01:00
smallmodel 3cda08bec4 fix(script): retrieve type name before clearing and printing valid type in array evaluation 2026-01-17 22:10:07 +01:00
smallmodel 098843cd0a refactor(script): use only GetTypeName() to retrieve the type name 2026-01-17 22:09:43 +01:00
smallmodel 3af8c64bfc fix(corepp): allow arguments to be separated by a comma 2026-01-16 23:52:14 +01:00
smallmodel a4c70670df fix(corepp): tokenized files must use ';' or '//' for comments 2026-01-16 23:51:19 +01:00
smallmodel f74343b183 docs(contributing): update policy 2025-12-29 02:20:59 +01:00
smallmodel 12202e2d98 docs(changelog): update changelog 2025-12-29 02:08:27 +01:00
Tim Angus 54c98c5e38 Create SDL window after all SDL_GL_SetAttribute calls 2025-12-29 01:44:26 +01:00
smallmodel be4e3fd7ac fix(gamespy): fix gamespy gcd authorize issues
This fixes:
- gcd not working when enabled
- a crash that occurs when the server processes gcd verification
2025-12-23 01:09:44 +01:00
smallmodel 46798d46dc refactor(network): clarify net profiling struct and field names 2025-12-20 23:32:47 +01:00
smallmodel b019c1811c fix(network): reset the % of OOB packets in the packet profiling 2025-12-20 22:38:18 +01:00
smallmodel 55a990efa6 fix(client): use the correct packet list profiling when the client receives a connectionless packet 2025-12-20 22:37:58 +01:00
smallmodel 97ae04eff3 fix(renderergl1): use the correct enum value (AGEN_WAVEFORM) to check the alphaGen 2025-12-19 21:38:20 +01:00
smallmodel 9fd2fb13f1 feat(fgame): add an optional parameter to removeclass and killclass to control subclass inclusion (#863)
Subclasses are included by default.
2025-12-15 23:52:32 +01:00
smallmodel e3a873b4aa fix(move): use a tiny tolerance check to clip the velocity 2025-12-15 22:23:29 +01:00
smallmodel f8876404c2 fix(fgame): fix invalid voteUpload value when loading from save (crash) 2025-12-15 22:23:23 +01:00
smallmodel 3e16d8a2ff refactor(cmake): define the version in one place (identity file) 2025-12-12 14:43:20 +01:00
smallmodel 82be5b03bd docs(changelog): update changelog 2025-12-12 14:43:12 +01:00
smallmodel f648db6b52 feat(fgame): send vote options between multiple client frames (#861)
It is now possible for servers to send large vote configuration files to clients without causing disconnections due to packets being larger than 50 KB.
The issue also occurs on vanilla servers.
2025-12-10 21:14:37 +01:00
Tim Angus 277717120d Remove Makefile things from .gitignore 2025-12-07 15:40:02 +01:00
erysdren 9db02300dc Improve PVR image support 2025-12-07 15:38:12 +01:00
Noah Metzger c46b6cddfe Fix Windows dedicated server console
Use con_win32.c instead of con_passive.c to fix the Windows dedicated server interactive console under CMake.
2025-12-07 15:37:59 +01:00
smallmodel 942ae5c038 feat(fgame): allow changing the animation when the player is in the death state
This lets the player enter noclip mode without the animation looking messy when dead.
2025-12-04 22:07:42 +01:00
smallmodel 42fa1fb87d feat(fgame): allow the player to rotate in noclip mode 2025-12-04 22:05:24 +01:00
smallmodel 5604a1f7f8 fix(network): suppress animation time delta only if the time delta is nearly equal to the frame step (#860)
This fixes animation flickering due to floating-point precision differences between SSE2/x64 and x86 FP87. The animation time could drift slightly and wrap earlier or later than it should.
2025-12-04 22:01:09 +01:00
smallmodel ac993b45b9 refactor(fgame): add missing header 2025-12-03 21:20:32 +01:00
smallmodel 701964b8c2 refactor(cgame): wrap animation time using modulo 2025-12-02 23:25:16 +01:00
smallmodel 9168f32cdb refactor(network): pack decimals based on the explicitly rounded value 2025-12-02 00:02:51 +01:00
smallmodel 042108d12c fix(fgame): createlistener must create a SimpleArchivedEntity instead of a Listener (#855)
This allows these objects to be removed upon map change or restart.
This also allows existing scripts to assign a targetname on the created object.
2025-11-29 18:12:37 +01:00
smallmodel 634a2371e6 fix(ui): fix alignment for centery (#853) 2025-11-29 13:45:43 +01:00
smallmodel f4a21b73a4 fix(fgame): fix unused holster attach offset (#852) 2025-11-29 13:30:26 +01:00
smallmodel 3c3683536b Disable LTO on debug builds 2025-11-26 22:46:35 +01:00
smallmodel 2fececd62f docs(differences): update documentation about difference and new features 2025-11-25 23:55:16 +01:00
smallmodel 68383565f2 docs(changelog): update changelog 2025-11-25 23:55:13 +01:00
smallmodel 51f2ed1cba Use case-insensitive comparison for all Info_Key functions
Info_ValueForKey performs case-insensitive comparisons on key names, other functions should also be case-insensitive for consistency.
2025-11-25 20:31:28 +01:00
Tim Angus f723cbf01d Enable LTO if available 2025-11-25 20:31:22 +01:00
Tim Angus 9a22cc94b2 Remove some dead library code (issue #839) 2025-11-25 20:31:17 +01:00
erysdren 7ee122f0b2 add support for loading PVR images
this is from Q3A for Dreamcast
2025-11-25 20:30:02 +01:00
smallmodel 8169bd01a8 docs: fix version annotation 2025-11-24 00:48:41 +01:00
smallmodel 351a5fa644 refactor(container): rename docker to container 2025-11-23 19:03:40 +01:00
smallmodel e48baf19a9 fix(container): set health_check.sh script as executable 2025-11-23 19:02:49 +01:00
smallmodel 9077a8c0ee fix(container): fix varibale usage in the entry point 2025-11-23 19:02:32 +01:00
smallmodel 52146bee45 fix(container): add a sleep in healthcheck loop 2025-11-23 19:02:00 +01:00
smallmodel 63a1679bf6 fix(fgame): allow spectators and dead players to vote (#845) 2025-11-23 01:02:46 +01:00
smallmodel b1a18b66a8 fix(fgame): fix commands being executed twice when the server was also the client 2025-11-22 23:29:02 +01:00
smallmodel e39f9dc6e5 fix(tiki): use a dedicated anim compare function (#844)
Q_stricmp uses uppercase comparison and the original game (win32 builds) uses lowercase comparison.
This can be an issue when sorting animations containing characters between lowercase/uppercase letters (like the '_').
Animations sorted using Q_stricmp won't have the same index as when using _stricmp, causing a few animations mismatch with the original game.
2025-11-22 16:36:31 +01:00
smallmodel a767599893 fix(fgame): fix portable turret placement 2025-11-21 23:27:21 +01:00
smallmodel 777a9f2405 feat(fgame): use the camera's origin with a calculated offset for the player's camera view position
This makes it so bullets fired from turrets aim directly at the player's target when shooting.
2025-11-21 23:27:06 +01:00
smallmodel 3b1d1699c7 fix(fgame): use the turret camera's origin when there is no barrel 2025-11-21 23:25:03 +01:00
smallmodel 59f2aea41d fix(fgame): correctly blend portable turret aim animations 2025-11-21 23:20:43 +01:00
smallmodel 26508d26f0 docs: correctly annotate version changes in comments 2025-11-21 23:19:46 +01:00
smallmodel 8df4c82855 docs(contributing): state that English must be used when writing 2025-11-20 23:22:12 +01:00
smallmodel 80732c6256 fix(github-actions): use maximum compression for artifacts 2025-11-20 21:00:48 +01:00
smallmodel f666681035 feat(ui): properly support shaders with one-shot animated textures (#839)
The issue also occurs in the original game. One-shot animated shaders would always appear as already finished.
2025-11-20 20:57:37 +01:00
smallmodel c2d5f203b8 fix(fgame): remove unnecessary radian conversion for sqrt() 2025-11-20 19:38:27 +01:00
smallmodel ec1ab7f327 feat(network): implement changeVectors with switchable network message profiling
This implements changeVectors to profile and collect statistics for network bit usage.
2025-11-19 23:39:05 +01:00
smallmodel 7584af9774 fix(network): properly check needed deltas when writing player state
This optimization was accidentally missed out for player state, it checks for field changes using packed values rather than raw data.
2025-11-19 22:57:18 +01:00
smallmodel 8af5d9179d fix(qcommon): allow zero-length values for Info_SetValueForKey_Big 2025-11-19 20:36:40 +01:00
smallmodel af660acc40 fix(qcommon): use memmove instead of strcpy for Info_RemoveKey_Big 2025-11-19 20:36:03 +01:00
smallmodel 561ee6648a refactor(fgame): use constants rather than a magic number for sentient mins/maxs 2025-11-18 21:44:08 +01:00
Tim Angus e7c66cfb77 Double MAX_RENDER_COMMANDS
Following changes to the console code, it turned out that at very high
resolutions, the large number of glyphs rendered would cause render
commands to be dropped; avoid this by simply raising the maximum number
of render commands.
2025-11-18 20:43:43 +01:00
Tim Angus 2e58621210 Print warning when a render command is dropped 2025-11-18 20:43:32 +01:00
smallmodel 4a839f5b41 docs(changelog): update changelog 2025-11-18 00:33:19 +01:00
smallmodel a43ed409cf feat(fgame): expose projectile owner to scripts 2025-11-18 00:23:31 +01:00
smallmodel d82f0258a0 refactor(fgame): use a function that removes projectiles 2025-11-18 00:10:26 +01:00
smallmodel a16db487e8 feat(fgame): store the map file name in a variable 2025-11-17 20:38:08 +01:00
smallmodel 1fd5c7319d fix(fgame): add "_sml" suffix when not using large lightmap 2025-11-17 20:37:52 +01:00
smallmodel b44252b989 docs(fgame): annotate 2.11 final changes 2025-11-17 20:25:53 +01:00
smallmodel 35f74db1d3 fix(ui): fix mapinfo files never being created (#835)
- .min files are now created for maps that don't have one.
- Saving .min files no longer results in a crash.
- The loading bar is now always cleared when no .min file is present.
2025-11-16 18:45:08 +01:00
smallmodel b839d55a07 fix(fgame): fix strange spectate behavior when going to spectator immediately after being killed
- Spectators would have 0 health.
- Spectators would sometimes drop health or anything DM-related.
- Spectators could have pain.
2025-11-13 23:05:59 +01:00
smallmodel 5df5735965 fix(fgame): remove view-model states and only cache players' world model (#829)
Caching all FPS models would create too many unnecessary entries. On some maps, this would cause clients to reach the MAX_MOD_KNOWN limit, causing crashes.
2025-11-13 00:16:26 +01:00
smallmodel 4373b3d976 fix(cgame): delete the temp model if the model is invalid 2025-11-12 22:02:32 +01:00
smallmodel 7e1de3e0cc docs(contributing): point to the contributing markdown file directly
This is because doxygen can't parse files outside the docs/ folder.
2025-11-12 00:07:40 +01:00
smallmodel 61cf668c68 docs(contributing): move and improve contributing guidelines in CONTRIBUTING.md 2025-11-11 23:53:04 +01:00
Tim Angus cca1f28ce6 refactor(misc): reorganise misc directory 2025-11-11 16:12:49 +01:00
Lojjik Braughler f5861f5329 renderergl2: allow DDS fallback when r_ext_compressed_textures=0
R_LoadImage now tries .dds as a final fallback when compressed textures are disabled.

This allows assets to ship as DDS-only without requiring duplicate PNG/TGA for every texture.

Fixes #583.
2025-11-11 16:04:26 +01:00
Lojjik Braughler fbe9cfb445 renderergl2: reimplement greyscale as backend post after all 2D+3D draws
Fixes #654 - HUD/UI previously bypassed greyscale.
r_greyscale now supports partial desaturation [0-1].
Removed unused legacy logic from tr_shade.c
2025-11-11 16:00:46 +01:00
Tim Angus 3f090ff1ec Move autoupdater to its own repo (https://github.com/ioquake/autoupdater) 2025-11-11 16:00:15 +01:00
Tim Angus 06b1c0e879 Guard autoupdater more completely 2025-11-11 16:00:01 +01:00
smallmodel 94328af9b1 fix(cgame): fix attached entities not being able to emit a light correctly (#825)
Attached entities don't have an origin (0,0,0) so a light would be emitted at the null origin.
2025-11-09 22:21:31 +01:00
smallmodel 21d6401da7 refactor(fgame): refactor controller angles scripting functions 2025-11-05 23:46:29 +01:00
smallmodel f2c31e956e fix(common): provide the delta time when executing console commands on dedicated servers
This fixes an issue in which the `wait` command would prevent further commands from being executed afterward.
2025-11-04 00:35:02 +01:00
smallmodel c1c230f04c fix: clear all medals if the game has no config file (#822) 2025-11-02 18:14:48 +01:00
smallmodel 8eb3f66b45 fix(renderering): add an option for culling farplane only when rendering a portal sky (#821)
This option was present since Spearhead 2.0.
2025-11-02 14:49:16 +01:00
smallmodel 548f07cc5a fix(fgame): don't create a sound index for bots
Only players are counted for PVS, in fact the server doesn't create a client entry for bots as it's handled by fgame.
2025-10-28 22:36:35 +01:00
smallmodel cf523bd4cd docs(q_math): add values in the comment 2025-10-28 21:04:25 +01:00
Tim Angus 6737aaf017 Remove commented code 2025-10-27 23:12:59 +01:00
smallmodel 800e82327b docs(changelog): add changes about dropping weapons 2025-10-27 22:59:37 +01:00
smallmodel b06857d077 fix(fgame): add more checks for weapon dropping (#815)
- Drop carryable turrets, even if they are items.
- Don’t drop weapons when dead.
- In single-player mode, only allow dropping when realism mode is enabled.
2025-10-26 23:52:20 +01:00
smallmodel 0487696dc3 docs(changelog): add all versions from 0.49 2025-10-24 21:25:29 +02:00
smallmodel c7e2431e15 docs: update changelog 2025-10-20 23:46:48 +02:00
smallmodel 6eae2c9841 fix: use the correct format for terrain normals 2025-10-20 23:00:26 +02:00
smallmodel e75b535c82 fix: properly handle map changes on gl2 2025-10-20 22:45:55 +02:00
smallmodel ba4cf34530 fix: call R_Init() from GetRefAPI()
This fixes an issue with GL2 crashing on vid_restart
2025-10-20 22:17:39 +02:00
Tim Angusandsmallmodel 2c9e500570 XDG home directory support
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-10-19 21:03:23 +02:00
Tim Angus 941f2de533 Fix Com_Filter
Com_Filter uses a limited sort of proto-regex syntax including a
character class like construct, but prior to this change these did not
work if preceded by a * glob.
2025-10-19 14:28:22 +02:00
llbraughler b64a3765e5 Fix flare visibility in mirrors
Compute the flare's depth with the same projection used for the scene, then compare it to the depth we read.
2025-10-19 14:28:05 +02:00
Tim Angus b5a0006724 Handle case where ioq3 is present as a git submodule 2025-10-18 22:56:02 +02:00
Tim Angus 105202e0b1 Use CMAKE_DL_LIBS 2025-10-18 13:37:42 +02:00
Tim Angus cbb43b702e Use FS_CreatePath in Sys_ErrorDialog 2025-10-18 01:26:57 +02:00
Tim Angus 53bd800669 Fix MSVC double truncation warnings 2025-10-18 01:26:34 +02:00
Tim Angus e4ec343a80 Use PRODUCT_NAME in config file comments 2025-10-17 20:29:48 +02:00
Tim Angus 353ae6a12f Better un-pure client error message 2025-10-17 20:29:32 +02:00
Tim Angus 28274e9422 Stricter Info_Validate 2025-10-17 20:29:28 +02:00
Tim Angus bc5217915c Remove inconsistent '.' in server message 2025-10-17 20:29:25 +02:00
Tim Angus dc50137f66 Render ANSI black text inverse (so that it is readable on black terminals) 2025-10-17 20:29:11 +02:00
Tim Angus bba5213d38 Extend size of serverInfo_t.hostName (handle longer server names) 2025-10-17 20:28:57 +02:00
Tim Angus 69864db4e7 Add CONFIG_PREFIX, for customising the config name 2025-10-17 20:20:29 +02:00
smallmodel a40b9104b6 Only draw shadows that are inside the frustum, below a certain distance 2025-10-13 23:26:29 +02:00
Tim Angus 457c2f0a43 When arch detection fails, show the compiler output 2025-10-12 13:41:50 +02:00
Tim Angus fb741a9a0b Add Sys_OpenFolderInFileManager 2025-10-11 22:01:30 +02:00
Tim Angus 3886afec57 Move Sys_Exec within the file 2025-10-11 22:01:24 +02:00
smallmodel fcc84bae6e Expose dedicated to always 1 on dedicated-only binaries 2025-10-10 18:59:43 +02:00
smallmodel edb2419c98 Use latest lcc 2025-10-09 00:16:29 +02:00
Tim Angus b89bd34b4c Remove unused/outdated null_* files 2025-10-09 00:14:37 +02:00
Tim Angus 10e6221e35 Don't set USE_ICON on macOS; the icon is derived from the bundle 2025-10-09 00:13:12 +02:00
Tim Angus feaf3fe8d0 (Optionally) put the build products in a subdir, in the dmg 2025-10-09 00:11:35 +02:00
smallmodel 3039da305a Update changelog 2025-10-07 23:58:37 +02:00
smallmodel 69a63629e4 Don't animate and don't play states when frozen
The player's animation would look weird/shy and footsteps sound would continue to play.
2025-10-07 23:16:40 +02:00
smallmodel a64007cb23 Make tick functions clearer 2025-10-07 22:48:42 +02:00
smallmodel 8041939976 Rename vote time variable 2025-10-07 21:36:40 +02:00
smallmodel d757609842 Fix client's vote indication not cleared 2025-10-07 20:59:39 +02:00
smallmodel acd3757f7e Exclude bots from votes 2025-10-07 20:50:29 +02:00
Tim Angus 4429d22f11 Fix warnings 2025-10-06 22:48:12 +02:00
smallmodel f84e881b9a r_farclip is not a cheat variable 2025-10-06 21:09:12 +02:00
llbraughler 1e68f67743 Implement ShowNormals in RendererGL2 2025-10-05 21:55:32 +02:00
smallmodel a07e642820 Slightly increase the brightness of chat messages 2025-10-05 00:39:30 +02:00
Tim Angus 1c27f3edd1 Make sound channel exhaustion warning a Com_DPrintf 2025-10-04 02:06:41 +02:00
Tim Angus 6bff3a0731 Set CMP0177 directly rather than by version 2025-09-27 12:56:04 +02:00
smallmodel 5c9eb7c858 Remove the contact email 2025-09-27 12:55:46 +02:00
Tim Angus 46f668ee12 Improve dmg cosmetics 2025-09-27 12:55:22 +02:00
Tim Angus e115d142b4 Code sign on macOS 2025-09-27 12:55:21 +02:00
smallmodel 309f21e172 Reorder by continent 2025-09-25 20:19:07 +02:00
smallmodel 25705763e5 Use MAX_MASTERS instead MAX_MASTER_SERVERS
MAX_MASTER_SERVERS was improperly used in this context.
2025-09-25 20:11:15 +02:00
smallmodel 48febb1247 Give binoculars for players on AA 2025-09-25 00:49:50 +02:00
Tim Angus 28e6ea159c SV_RehashBans_f may be executed when the server isn't running (#785) 2025-09-24 00:54:51 +02:00
smallmodel 05e086e015 Add setters/getters for info_landmark 2025-09-21 15:44:43 +02:00
smallmodel ddfada66c4 Document info_landmark 2025-09-21 15:40:45 +02:00
smallmodel c9e145a4ff Update base image to Trixie 2025-09-20 17:43:46 +02:00
smallmodel c84b93fb77 Remove calls to ladder/turret detachment
These are called in InitModel() already
2025-09-19 13:20:37 +02:00
smallmodel cf0970069b Annotate the changes 2025-09-19 00:24:34 +02:00
Tim Angus 5a6ff0443a Do post configure function(s) more generically 2025-09-18 23:51:56 +02:00
Tim Angus c0a6788f3e Revert CMake minimum to previous value (by setting cmake_policy) 2025-09-18 23:50:33 +02:00
Justin Luong 87bbb3e1d4 Fix emscripten preload file not working for a symlinked directory 2025-09-18 23:50:32 +02:00
smallmodel 5a430cfd4f Allow Actor to think with no player in multiplayer 2025-09-17 19:54:00 +02:00
smallmodel f974c36c6d Add initial CHANGELOG file (#805) 2025-09-17 12:42:50 +02:00
smallmodel e6eb3aa0a1 Fix incorrect usage of planes for curves (#806) 2025-09-17 01:04:51 +02:00
Tim Angus c8c9ae2468 Basic standalone Debian package 2025-09-13 00:34:04 +02:00
Tim Angus cca7f9d20f Basic macOS dmg generation 2025-09-13 00:32:42 +02:00
Tim Angus f992185398 Basic Windows NSIS installer 2025-09-13 00:32:19 +02:00
Tim Angus ce9cbdc19c Set CMAKE_INSTALL_PREFIX default more correctly 2025-09-13 00:31:10 +02:00
Tim Angus 9808cf8d01 Remove pointless conditional 2025-09-13 00:29:14 +02:00
Tim Angus f8a9a66247 Fold install(...) calls into set_output_dirs 2025-09-13 00:27:28 +02:00
smallmodel bef56ad16d Add a variable that sets the initial bot spawn delay 2025-09-11 21:46:58 +02:00
smallmodel b495ac8324 Avoid spawning more bots than specified when restarting 2025-09-11 21:02:53 +02:00
Tim Angus 031eb7ac2a Add -Wshadow to compiler warnings 2025-09-08 22:58:29 +02:00
smallmodel aabb2c7d03 Fix paths being created before navigation generation (#798) 2025-09-08 20:02:04 +02:00
Tim Angus ce9199ea1e Better warning fix (that doesn't crash) 2025-09-07 22:46:02 +02:00
Tim Angus d610d6f45f Fix quotes in comments 2025-09-07 20:29:29 +02:00
Tim Angus ed6f279785 Fix macOS deprecated constants 2025-09-07 20:29:29 +02:00
smallmodel 9f1749ef65 Fix uninitialized local variable 2025-09-07 20:29:15 +02:00
Tim Angus fbedcd1928 Enable format warnings under MinGW 2025-09-07 20:26:40 +02:00
Tim Angus 258c5f53f9 Wrap __attribute__s in macros 2025-09-07 20:19:05 +02:00
Tim Angus 6e57eb7d00 Fix various warnings 2025-09-07 19:45:51 +02:00
Tim Angus cd4d396d30 Fix warnings not being disabled for zlib 2025-09-07 19:05:03 +02:00
Tim Angus b5dc39e953 Add q3rcc and q3cpp to dependency chain 2025-09-07 19:05:03 +02:00
Justin Luong 749ff62cac Fixes to emscripten cmake 2025-09-07 17:54:17 +02:00
smallmodel c2519c86e6 Fix weapon falling angle adjustment (#796) 2025-09-07 01:01:56 +02:00
Tim Angus 6e04025971 Fix uninitialised variable warning 2025-09-06 13:19:35 +02:00
smallmodel ab70d70357 Post-initialize bots before notifying level spawn (#795)
On restart, this will spawn bots before scripts are notified, so subsequent rounds can start immediately.
Some scripts rely on the match time: the issue would cause some of them to fall behind the match time, as the round would start at the next server frame, which would cause the teamwin event to be sent too late (after the match has ended due to the clock).
2025-09-05 22:23:02 +02:00
Tim Angus 45e1daf65a More generic de-duplication of path vars 2025-09-05 19:34:31 +02:00
smallmodel c93d0f6975 Add standalone definition to avoid including steam/gog/msstore path 2025-09-04 23:40:30 +02:00
Tim Angusandsmallmodel e299031470 Reduce duplication in FS path search code
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-09-04 23:28:07 +02:00
smallmodel eb6b6173ee Fix roundlimit variable ignored on ToW 2025-09-03 21:06:14 +02:00
smallmodel 01562e5d83 Annotate 2.0 specific code 2025-09-03 20:43:23 +02:00
smallmodel d7a2e5bc65 Clear the time message on liberation
There is no clock on liberation game mode.
2025-09-03 20:37:13 +02:00
smallmodel ac67939b76 Use explicit path when including q_common and q_shared 2025-08-31 16:53:09 +02:00
smallmodel 378938ae39 Remove NO_VM_COMPILED (VM is not supported in the game) 2025-08-31 12:12:12 +02:00
smallmodel 93d487a0d6 Calculate model/sound index once in CG_ProcessConfigString 2025-08-30 23:56:31 +02:00
smallmodel 4b61caf47a Set max settings by default
Any modern computer can run the game in max settings, let the user change settings if necessary.
2025-08-30 23:44:06 +02:00
smallmodel 4268269eaa Fix CMake pinned error on macOS 2025-08-30 22:38:38 +02:00
Tim Angus 1582325a72 Fix QVM tool dependencies on Windows 2025-08-30 22:24:27 +02:00
Tim Angus aee897f52a Add SOURCE_DATE_EPOCH support 2025-08-30 22:23:49 +02:00
Tim Angus 6bcfe1788d Allow ARCH_STRING to be undefined 2025-08-30 21:31:54 +02:00
smallmodel b038d5ca03 Fix dbg suffix 2025-08-30 20:47:39 +02:00
Tim Angus 4ef547cd86 Remove architecture from binary filenames 2025-08-29 22:51:27 +02:00
smallmodel 0fdf19a3d4 Add reflective team damage
A flag can be set for `g_teamdamage` so reflective damage can be enabled. When enabled, an attacker who damage their teammate will also get damaged.
2025-08-29 21:41:46 +02:00
smallmodel bb9189f219 Don't kick all players if g_teamkillkick is set to 0 2025-08-29 21:16:23 +02:00
Youssef Saeedandsmallmodel f72cc9da77 Use false instead of NULL for boolean (#792)
This PR replaces `NULL` with `false` for a boolean member in an `extensions_table_t` initializer to fix C++ type-mismatch build error on modern C++ compilers.

Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-28 23:47:57 +02:00
smallmodel f75892cd26 Add variables that allow modifying bots behavior 2025-08-27 23:51:33 +02:00
Tim Angus 8dbae6247c OCD 2025-08-27 23:39:01 +02:00
Youssef Saeedandsmallmodel f72e10a297 Use an integer for file handles (#791)
This PR replaces `NULL` with `0` for integer file handles to fix C++ type-mismatch build errors on modern C++ compilers.

---------

Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-26 23:29:42 +02:00
Jack Slater 3c92f1e13a Added more VS stuff to .gitignore 2025-08-26 23:03:17 +02:00
Tim Angus ced7e21fd3 Simplify find_include_dirs 2025-08-25 20:34:48 +02:00
yumirak e68101abaa cmake: define USE_CODEC regardless of USE_INTERNAL 2025-08-25 20:34:31 +02:00
smallmodel ecf70528a7 Move all C++ core classes to the corepp directory 2025-08-24 16:51:11 +02:00
smallmodel e0a748a2e7 Fix uninitialized current variable 2025-08-24 16:50:37 +02:00
Tim Angus 5136eb3856 Add DEFAULT_RELATIVE_BASEDIR
Sys_BinaryPathRelative takes a parameter which is path concatenated with
Sys_BinaryPath, and resolved to a canonical path. The intended use case
is to facilitate the situation where you want the game data directory to
exist outside the same directory in which the binary lives, but relative
to it. More specifically, if you want to distriute multiple binaries for
different architectures, in the same tree, this allows for a means of
having said binaries in architecture subdirectories, with a shared data
directory, e.g.:

  ioq3/x86/ioquake3.exe etc.
  ioq3/x86_64/ioquake3.exe etc.
  ioq3/baseq3/pak0.pk3 etc.

Here, when building you would define DEFAULT_RELATIVE_BASEDIR=".." by
appending it to the build system CFLAGS, and then the executables will
by default look in their parent directory for the data.
2025-08-23 23:30:58 +02:00
Simon McVittie fabc7c7c74 Remove unused matha.S
Before commit a7d33b1c "(bug #3639) BoxOnPlaneSide rewrite" there
was more code here, but since then the only thing left is the
Invert24To16 function, to which I couldn't find any references since
the beginning of ioquake3's git history.

Resolves: https://github.com/ioquake/ioq3/issues/774
Signed-off-by: Simon McVittie <smcv@debian.org>

client: Remove i386 GNU assembler version of S_WriteLinearBlastStereo16()

This was the last remaining GNU assembler code that was in its own
independent source file, as opposed to being embedded in C code with
GNU `__asm__ volatile` or MSVC `__asm` (which tends to be much easier
to deal with in a modern build system).

When the Quake 3 engine was originally written, this might have been
an "expensive" function when written in portable C, but after 25 years
of CPU development it's less likely to matter (and modern compilers
might produce faster results from the C code anyway).

Resolves: https://github.com/ioquake/ioq3/issues/778
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-08-23 23:30:50 +02:00
smallmodel f885408059 Improve class and event printing with interface classes 2025-08-23 22:28:52 +02:00
smallmodel a2b891acd9 Add str constructor with length parameter 2025-08-23 22:28:27 +02:00
smallmodel f529358357 Move updatecheck variables to the update checker source file 2025-08-22 23:34:48 +02:00
smallmodel 270a7663c2 Remove the label from list only if it was registered 2025-08-22 23:34:38 +02:00
Tim Angusandsmallmodel 2adabc7468 Add upstream GNU changes
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-22 23:34:29 +02:00
smallmodel 80b2e89dcc Fix spelling errors 2025-08-19 19:07:35 +02:00
smallmodel 654ab91efb Increase the minor version number due to previous enhancements 2025-08-19 19:07:29 +02:00
smallmodel 555caa10f3 Make bot's name modifiable through variables
Bot names must be set using `sv_botXname` where X is the bot ID, because bots can be spawned automatically using `sv_minPlayers`. `addbot` and `addbotnamed` commands shouldn't be used, they only exist for testing purposes.
2025-08-18 20:46:29 +02:00
smallmodel 0c5cfb7a37 Add support for naming bots
`addbotnamed` command is used to spawn a bot with the specified name. The `addbot` command no longer supplies an argument for the botname
2025-08-17 18:47:47 +02:00
smallmodel 31e6830aee Add Cvar_Find 2025-08-17 18:37:03 +02:00
smallmodel 3a7105246d Remove bot_run.scr
It's unused and it gets spammy in developer mode
2025-08-17 17:55:35 +02:00
smallmodel 740c47fa6d Use new CMake options 2025-08-17 17:11:20 +02:00
smallmodel a824d9e912 Fix access violation in angles_pointat with entity and target 2025-08-16 22:50:57 +02:00
smallmodel be3d9892e4 Fix bot serverTime not being set when not alive
This caused some artifacts when the bot was dying (such as the animation delta not being applied).
2025-08-16 22:18:57 +02:00
smallmodel 95474c92b3 Fix switch team messages 2025-08-16 21:15:35 +02:00
smallmodel 480a377292 Expose API to kick client with reason for game
This will let the client know why it gets kicked by game.
2025-08-16 21:08:10 +02:00
smallmodel 8ce3866e70 Use the server fov when in camera view 2025-08-16 20:15:29 +02:00
smallmodel f5b01e7137 Fix window icon 2025-08-15 19:24:17 +02:00
smallmodel 425885bf61 Explicitly use signed char for network strings
ARM uses unsigned char by default when the sign is unspecified, this would cause some issues with messages containing accents, players would lose user control.
2025-08-15 19:02:27 +02:00
smallmodel 2eb190fe97 Fix Info_Print values
Some programs use dumpuser and split entries with the semicolon.
2025-08-14 23:25:07 +02:00
smallmodel 282110239e Add USE_CODEC_MAD option 2025-08-13 23:20:04 +02:00
Tim Angus 4170feddca Enable ASM language as required 2025-08-13 19:54:52 +02:00
Tim Angus 833b660c68 CMake install configuration
This is 99% for *nix based operating systems; it may work elsewhere but
it's not recommended.
2025-08-13 19:53:48 +02:00
Tim Angus edd58f2042 Remove clientHtmlFallback 2025-08-13 19:51:45 +02:00
Tim Angus f7c77ce804 Improve QVM tools dependencies 2025-08-13 19:51:17 +02:00
Tim Angus 5da907484a Add guards preventing various illogical combinations of BUILD_* options 2025-08-13 19:51:03 +02:00
smallmodel f502f6a3c6 Don't include third-party client libraries when not building the client 2025-08-12 23:05:31 +02:00
Tim Angus 0da5496d28 Document reasons for contents of COMMON_LIBRARIES 2025-08-12 21:36:14 +02:00
Tim Angus e9bc305a26 Unconditionally rebuild QVM tools every time 2025-08-12 21:36:13 +02:00
smallmodel 4cd6a51869 Expose the number of bots through minplayers variable
Clients will now show the number of bots (if there are any) in the server browser. Servers must be running a build since this commit
2025-08-11 23:08:04 +02:00
smallmodel 3cd01b77d1 Don't allocate bots in single-player mode (#784) 2025-08-11 00:33:06 +02:00
smallmodel f3b66de7e3 Don't use internal SDL 2025-08-10 19:43:21 +02:00
smallmodel d3ca24d27a Fix Winsock getting shutdown after gamespy shutdown 2025-08-10 19:17:25 +02:00
smallmodel 70c12a1639 Bump version number 2025-08-10 19:17:23 +02:00
Tim Angus b68c2920ab Add USE_INTERNAL_SDL_HEADERS 2025-08-09 23:22:04 +02:00
smallmodel 59329b4fb3 Mark member function overriding 2025-08-09 00:39:41 +02:00
Tim Angus 4083d1123f Map SDL gamepad buttons to keys explicitly 2025-08-08 22:58:03 +02:00
Tim Angus fa047b7bf9 http -> https on URLs 2025-08-08 22:53:00 +02:00
Tim Angus 659939352a Add USE_ARCHLESS_FILENAMES 2025-08-08 22:52:26 +02:00
smallmodelandTim Angus e556f58cc4 Reimplement CMake from upstream ioq3 (#781)
This reuse the CMake build system from ioq3, modified to make it work with the C++ code.

---------

Co-authored-by: Tim Angus <tim@ngus.net>
2025-08-08 01:03:07 +02:00
560 changed files with 15332 additions and 27849 deletions

No files matched your search

+1 -1
View File
@@ -68,7 +68,7 @@ jobs:
- name: Zip
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
run: zip -r "../${{env.RELEASE_NAME}}.zip" ./
run: zip -9 -r "../${{env.RELEASE_NAME}}.zip" ./
- name: Release
uses: softprops/action-gh-release@v2.3.2
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
steps:
- name: Get and install Doxygen
run: |
wget https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.linux.bin.tar.gz -O doxygen.tar.gz
wget https://github.com/doxygen/doxygen/releases/download/Release_1_16_1/doxygen-1.16.1.linux.bin.tar.gz -O doxygen.tar.gz
tar xzf doxygen.tar.gz
cd doxygen-*
sudo cp bin/doxygen /usr/local/bin/
+4
View File
@@ -214,10 +214,13 @@ jobs:
run: |
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DUSE_INTERNAL_SDL=OFF \
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL2/install/lib/cmake/SDL2' \
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' \
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' \
-DUSE_RENDERER_DLOPEN=OFF \
-DBUILD_RENDERER_GL2=OFF \
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
@@ -252,5 +255,6 @@ jobs:
with:
name: out-linux-${{matrix.architecture.name}}
if-no-files-found: error
compression-level: 9
path:
${{github.workspace}}/package
+8 -1
View File
@@ -47,7 +47,9 @@ jobs:
- name: Install required packages
run: |
brew install git flex bison ninja cmake llvm perl
brew install flex bison llvm
# Those packages are already installed
#brew install git ninja cmake perl
- name: Settings
working-directory: ${{github.workspace}}
@@ -208,10 +210,14 @@ jobs:
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DCMAKE_VERBOSE_MAKEFILE=on \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
-DUSE_INTERNAL_SDL=OFF \
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL2/install/lib/cmake/SDL2' \
-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' \
-DUSE_RENDERER_DLOPEN=OFF \
-DBUILD_RENDERER_GL2=OFF \
-DBUILD_MACOS_APP=OFF \
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} \
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'" >> $GITHUB_ENV
@@ -246,5 +252,6 @@ jobs:
with:
name: out-macos-${{matrix.architecture.name}}
if-no-files-found: error
compression-level: 9
path:
${{github.workspace}}/package
+8 -3
View File
@@ -48,7 +48,7 @@ jobs:
uses: actions/cache@v4
with:
path: 'thirdparties/winflexbison-install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-flexbison-${{ env.flexbison-branch }}-v1
key: ${{ runner.os }}-${{ matrix.architecture.name }}-flexbison-${{ env.flexbison-branch }}-v2
- name: Install Flex/Bison
if: steps.cache-flexbison.outputs.cache-hit != 'true'
@@ -56,7 +56,7 @@ jobs:
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 -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' -DCMAKE_POLICY_VERSION_MINIMUM="3.5" ./winflexbison
cmake --build winflexbison-build --config Release --parallel
cmake --install winflexbison-build --config Release
@@ -226,11 +226,14 @@ jobs:
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=true `
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
-DUSE_INTERNAL_SDL=OFF `
-DSDL2_DIR='${{github.workspace}}/thirdparties/SDL2/install/cmake' `
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' `
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include' `
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/install/include/AL' `
-DCURL_ROOT='${{github.workspace}}/thirdparties/curl/install' `
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe' `
-DUSE_RENDERER_DLOPEN=OFF `
-DBUILD_RENDERER_GL2=OFF `
-DPRODUCT_VERSION_STAGE='${{ env.RELEASE_STAGE }}'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
- name: Configure CMake
@@ -269,6 +272,7 @@ jobs:
with:
name: out-windows-${{matrix.architecture.name}}
if-no-files-found: error
compression-level: 9
path: |
${{github.workspace}}/package
!${{github.workspace}}/package/**/*.pdb
@@ -277,6 +281,7 @@ jobs:
with:
name: out-windows-${{matrix.architecture.name}}-pdb
if-no-files-found: error
compression-level: 9
path: |
${{github.workspace}}/package
+1 -1
View File
@@ -69,7 +69,7 @@ jobs:
- name: Zip
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
run: zip -r "../${{ env.RELEASE_NAME }}.zip" ./
run: zip -9 -r "../${{ env.RELEASE_NAME }}.zip" ./
- name: Release
uses: softprops/action-gh-release@v2.3.2
+3 -1
View File
@@ -34,7 +34,9 @@ jobs:
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install'" >> $GITHUB_ENV
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install'" \
-DUSE_RENDERER_DLOPEN=OFF \
-DBUILD_RENDERER_GL2=OFF >> $GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
+7 -9
View File
@@ -1,7 +1,4 @@
build
mohaa-re
out
Makefile.local
build*
*.swp
*tags
*~
@@ -17,7 +14,6 @@ Makefile.local
.DS_Store
.LSOverride
Icon?
make-macosx-values.local
# Xcode
####################
@@ -44,8 +40,10 @@ profile
*.sdf
*.opensdf
*.suo
/.vs
.vs
code_unfinished/*
thirdparties/
code/parser/generated/*
out
# Flex and Bison
####################
/code/parser/generated
+929
View File
@@ -0,0 +1,929 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
#### Server
- Feature to name bots (most requested bot feature). See the [bot documentation](https://github.com/openmoh/openmohaa/blob/main/docs/markdown/03-configuration/01-configuration.md#bots). This may change in the future.
- More settings for bots. See the [documentation](https://github.com/openmoh/openmohaa/blob/main/docs/markdown/03-configuration/03-configuration-bots.md) for settings.
- Reason will be sent to clients getting kicked automatically by the game for teamkill or inactivity.
- Reflective team damage feature. See the [documentation](https://github.com/openmoh/openmohaa/blob/main/docs/markdown/03-configuration/02-configuration-server.md#g_teamdamage) for settings and explanations.
- Store the map file name in the `mapfilename` variable.
##### Scripting
- Add a third optional parameter for `removeclass` to specify if it should include subclasses (defaults to true).
- The owner of a projectile is now accessible from scripts.
#### General
- Add the bot count (if there are any) in the server browser. This will only work for servers running at least the version **0.83.0** of OpenMoHAA. The bot count will also show on the [333networks](https://master.333networks.com/) master server website.
#### Client
- Add support for one-shot animated shaders in the UI (#838) (not supported in the original game).
#### Platform
- Allow separation of config, data, and state directories within the home path (XDG directory support) (#588).
### Changed
- Older saves are incompatible due to changes from commit 5df5735965298b26b9bd4b90034843c743ff7158.
#### Server
- Prevent dropping the binoculars (this change was introduced in Spearhead v2.11).
- Servers now read and write into a configuration file `omconfig_server.cfg`, separate from the client configuration for convenience.
### Fixed
#### General
- Fix network profiling connectionless packet improperly counted.
- Fix Spearhead getting medals from Allied Assault when the config file doesn't exist (also occurs in the original game) (#818).
#### Server
- Allow `g_teamkillkick` to be set to 0. Players would get kicked when this variable was set to 0 (also occurs in the original game).
- Allow spectators and dead players to vote (#843).
- Fix a bug where players who switched to spectator mode immediately after dying would have 0 health and drop DM items (also occurs in the original game).
- Fix a crash that occurs when the server receives a gamespy cdkey authorize request.
- Fix a crash that could occur when starting a `jvbot` game.
- Fix a possible crash caused by scripts using `angles_pointat` (also occurs in the original game).
- Fix a rare glitch causing the player to be teleported to (0,0,0) and stuck (also occurs in the original game).
- Fix Actors not doing anything without client #0 (also occurs in the original game).
- Fix Actors squad formation.
- Fix an issue where clients could crash because of too many models being loaded from the server.
- Fix bad animation blending with portable turret.
- Fix bots being counted for voting.
- Fix death animation movement for bots.
- Fix holstered weapon attachment position (#847).
- Fix improper weapon falling rotation.
- Fix mismatched animation issues between the original clients and the server (#842).
- Fix players not having binoculars on Allied Assault.
- Fix players temporarily losing user input control on ARM-based OpenMoHAA servers when a message contained a special ASCII character.
- Fix some death animations flickering for original clients playing on an OpenMoHAA servers (#857).
- Fix some RCON programs not working with `dumpuser`.
- Fix the carryable turret disappearing when being dropped (#812).
- Fix the round limit being always `15` on Tug-of-War.
- Fix votes being messed up after calling a vote the second time during the match.
- Fix `wait` command not working on dedicated server binaries. Further commands would not be able to be executed (also occurs in the original game).
- Fix weapon select mod not working (#849).
- Fix wrong portable turret placement.
- Large vote configurations will no longer cause clients to disconnect (also occurs in the original game) (#858).
- The gamespy port `net_gamespy_port` now reflects the real port being used by the server (the issue also occurs in the original game).
- The player would spawn with no weapons on single-player when `sv_maxbots` was set (#783).
#### Clients
- Fix a crash caused when firing bullets to specific entities with no surface type (#831).
- Fix entities not being able to emit a light when attached to another entity (also occurs on the original Allied Assault but was fixed since Spearhead 2.0) (#824).
- Fix mapinfo (.min) files never being saved, resulting in the loading bar never showing on some maps (#832).
- Fix not being able to view sniper zoom when spectating.
- Fix sky being partially culled out on some single-player maps (#817).
- Fix the issue where the network would no longer work after hosting a multiplayer game on Allied Assault using the client.
- Fix wrong alignment for UI elements using `centery` (#848).
### Changed
#### Server
- Free-For-All is now the default gametype on dedicated servers (`g_gametype 1`) when unspecified, rather than single-player (the issue also occurs in the original game).
- Freezeplayer now freezes player animation/state, because frozen players would still emit footsteps sound when frozen.
- Nocliping when dead no longer makes the player animation sketchy.
#### Clients
- Slightly increase the brightness of red/green chat messages.
#### Misc
- Completely refactor CMake build system (from [ioquake3's](<https://github.com/ioquake/ioq3>) new CMake build system).
## [0.82.1] - 2025-08-05
### Fixed
#### Crashes
- Fix a crash that would occur when loading custom maps in some map packs (due to a UI incorrectly declaring a widget: loadingbar, twice) (#764)
- Fix an issue where the server could crash MOHAA base (1.11) clients in certain situations (#778)
- The game no longer terminate with error `FS_ReadFile with empty name`. (#772)
#### Drawing & rendering
- Fix force model always using an allied skin for dead bodies.
- Fix HUD being shown during briefings (#767)
- Fix in-game mouse cursor disappearing on some platforms (#765)
- Set a more distant fog for d-day by default (`set g_ddayfog 0`). This fixes an issue with sky artifacts in m3l1a. (#770)
#### Multiplayer
- Fix frequent telefrags on servers with a lot of players, like 25 players.
- Fix taunts being played as team rather than global (#775)
#### Miscellaneous
- Update third-party libraries like jpeg and zlib.
## [0.82.0] - 2025-08-05
### Added
#### General
- Commands `add`, `subtract`, `scale`, `append` and `bitset`. `bitset`, which comes from mohaab, is particulary useful to set flags for flag-based variables like `dmflags`.
- Logfile timestamping. It's enabled by default with the `com_logfile_timestamps` cvar. The current time is displayed at the beginning of each log entry.
- Setup files (.msi packages) are now distributed for Windows.
- Update check. The game will verify the latest version in the background (by querying the latest GitHub release of the repository) and print a
- Add the **Instant Action** feature from Breakthrough. This feature, although only usable through the Breakthrough UI, allows anyone to quickly find and join popular low-ping multiplayer servers.
#### Multiplayer
- Add `(all)` prefix in text message when a player is talking to all
- A message will be printed into console/log when a client changes their name.
- In Spearhead and Breakthrough, axis players can now select the kar98 sniper by choosing a german panzer skin (this was one of the feature of Daven's patch).
- The client number and their IP address will be printed next to each action (text message, joined the game...)
##### Bots
- [Recast Navigation](https://recastnav.com/) is now used by default to generate the navigation for bots. It's all automatic and works out of the box for any level, there is no need for `mp-navigation.pk3`. It provides a better and more accurate ways for bots to navigate through the maps.
- Bots can now take path that requires jumping, falling or climbing ladders.
- Bots will now try to get around small obstacles in front of them.
*Note: bigger obstacles are minimally supported, but may cause some issues in some area, like the West axis spawn in Omaha Beach.*
It takes less than 2 seconds to generate the navigation mesh on large maps like Berlin and Druckkammern.
If you have issues, executing `set g_navigation_legacy 1` command and then reloading the map will fallback to the basic pathnode-based navigation system.
### Fixed
#### Audio
- Updated OpenAL to version 1.24.3
- The sound quality has improved a little bit, the new version of OpenAL uses another sound resampler by default.
- Fix enhanced audio spatialization being forcefully enabled when it shouldn't for audio devices detected as headphones that aren't headphones.
#### General
- Fix `LOCALIZATION ERROR` spam.
- Fix an infinite loop that would occur during name sanitization.
- Fix a crash that would occur when using special menus (like admin menus).
- Fix memory leaks after the process has been running for a long time.
- Fix player name being cutoff at the first negative character
- Fix player being able to shoot bullets from under the LOD terrain (also occurs on the original game)
- Fix the `version` string, ensuring most software such as HLSW and mods work as intended depending on the target game version.
#### Client
- Fix bullet impacts having multiple effects sometimes.
- Fix cinematic not stopping on map change.
- Fix delayed SFX (such as smoke sound) being played on unrelated entities
- Fix `Illegible server message` error when firing some type of bullets on Spearhead and Breakthrough.
- Fix lean angle slightly not matching the original game.
- Fix localization issues.
- Fix Waffen skins not being usable on servers
- Player models (selected skins) will be reset to their default value in-game if it doesn't exist, and force models will not work if the model doesn't exist on the server.
- Reallow client `name` to be changed by the server. Names are often changed by administrators to fix duplicate names.
#### Multiplayer
- Correctly print the text of instant messages in the console/logfile.
- Fix AllocEdict when some Breakthrough maps are started in multiplayer mode (for co-op).
- Fix a crash related to spawnpoints.
- Fix a crash that would occur when playing a sound with subtitle without player #0.
- Fix a crash that occured when a player reconnects to the same slot (after timing out) and then displays the scoreboard
- Fix an issue preventing spawning next to spawn points with an offset. This lead to frequent telefrags with lot of players.
- Fix a crash that would occur when the player sets a first-person model as a skin, causing an infinite state loop (also occurs in the original game).
- Fix clients joining during intermission and having a corrupt `Time` value in the scoreboard (also occurs in the original game).
- Fix fog sometimes not updating on maps such as Gewitter.
- Fix incorrect number of wins shown for allies and axis in the scoreboard.
- Fix spawnpoints metrics.
- Fix missing player starts on some maps.
- Fix players temporarily having the name of another player when rejoining after losing connection (also occurs in original game)
- Fix projectiles with no owner getting removed when a player joins a team (also occurs in Spearhead and Breakthrough)
- Fix score not being able to have negative values in the result returned by the `status` server command.
- Fix scores being incorrectly sorted in round-based matches (they must be sorted by total kills).
- Fix some issues with laser mods, like the `Freeze-Tag` mode where the laser would not trace from the player sight.
- Fix `sv_precache` being ignored.
- Fix the issue where the text message gets empty when exceeding character limit.
- Fix the round ending incorrectly in mods like beach soccer.
- Fix weapon being dropped sometimes when switching weapons too fast (also occurs in original game)
- Increase text message character limit to 400 characters (taking the name of the player into account).
#### Game module
- Bazooka was never showing as the preferred weapon in singleplayer.
- Fix AI not shooting when squadmates are next to eachother in Spearhead and Breakthrough (also occurs in original game).
- Fix AI not moving to specific location when ordered.
- Fix AI misbehaving when curious.
- Fix AI moving too fast on Allied Assault.
- Fix AI having a notepad.
- Fix ammo type not properly localized.
- Fix an infinite loop that would occur on some maps when a vehicle start driving to a path.
- Fix an issue where legs animations (like idle pistol stand) would not loop.
- Fix an undefined behavior issue in some mods that could lead to infinite loop, like, `while (self.variable)` (where `self` is `NULL`).
- Fix a crash (MAX_GAMESTATE_CHARS) and a memory leak in long matches after many models are loaded. This would occur mostly in ToW maps during long matches, or in maps spawning many `Actor`.
- Fix a crash related to VehicleTurretGun having no vehicle owner (also occurs in original mohaab).
- Fix a crash that would occur when a turret shoots projectiles.
- Fix a crash when a player quits the server while in a vehicle (also occurs in original game).
- Fix damage blend not working in Spearhead and Breakthrough.
- Fix leaning not making a difference when trying to use.
- Fix mods like Elgbot server-side not working properly.
- Fix inconsistent cross-blending of torso animations.
- Fix "silent walk", where rapidly switching weapons would prevent emitting footstep sounds (also occurs in original game).
- Fix weapon banning not working properly when banning rifles.
#### Rendering
- Fix a crash that would occur when there are insufficient triangles for LOD terrain tessellation (also occurs in original game).
- Fix a possible crash when loading a map with lightmaps and then loading a map that has no lightmaps.
- Fix a rare crash that would occur when toggling the scoreboard (also occurs in original game, but was fixed in Breakthrough 2.30).
- Fix blurry text.
- Fix disconnected water lakes
- Fix console prompt being hidden when there are too many characters
- Fix line breaks occurring mid-word
- Fix long messages being cut off in the console
- Fix omaha beach shorelines being incorrectly rendered
- Fix the server list being requested twice on Allied Assault when browsing internet servers.
#### Server
- Fix `CM_AdjustAreaPortalState` error
- Fix clients rejected for too low/high ping not being able to reconnect again.
- Fix some programs (like gamedig) not being able to retrieve gamespy data from the server.
- Fix some programs not being able to retrieve the complete list of players
- Fix `SV_FindIndex: overflow` errors that would occur more often than the original game during long matches.
- Fix server crashing all clients under rare occasions.
### Changed
- Removed the architecture suffix from executables. They're now simply named `openmohaa` and `omohaaded`, for multiple reasons:
- Avoids conflicts with shipped third-party DLLs (like SDL, OpenAL) which have no suffix.
- Easier to build an installer and document.
- Makes launchers and automation scripts simpler (universal name for executable files).
- The architecture is already indicated in the archive name, on startup and in the `version` variable.*
- Older saves are incompatible due to changes from commit 4e8ddf3c358baef7cbfe2c8ff66c2426338cd2c7.
#### Client
- A random number is now added for the default name, like `UnnamedSoldier#1234`, or `*** Blank Name #1234 ***`.
#### Multiplayer
- All player models inside the `models/player/` folder will be cached in multiplayer. This avoids short lags/hitches when a player spawns with an un-cached model.
##### Master server
- Updated the master server to use [333networks](https://333networks.com/).
- Add support for multiple master servers. The server browser queries them all at once, and servers send updates to each. They are powered by the **333networks** community, managed independently. Even if one master goes down, others are used, ensuring constant availability of multiplayer.
- Iccups will occur less when fetching the server list if the network is really slow, or if the master server is unreachable.
#### Rendering
- On windowed mode, the hardware cursor is now used to navigate in the UI. This quickly allow users to get out of the window when bringing the console or the main menu up, instead of doing ALT+TAB.
#### Server
- The server is now showing the project version number in the server list.
## [0.81.1] - 2025-01-04
### Fixed
- Fix the text of pulldown elements being invisible on some menus
- Fix the server not taking the client rate into account and transmitting network fragments too fast, this may be the reason why some clients were unable to connect
## [0.81.0] - 2025-01-02
### Added
#### Audio
- Add support for IMA-ADPCM Wave sound files (4-bit compressed sound). Sounds such as sea waves (in the d-day landing mission) and subpen are now played accordingly
#### Client
- Add support for smaller lightmaps (BSP files having `_sml` suffix). Smaller lightmaps are enabled at startup when the texture detail is set to `Low` and if the map supports it (single-player levels of Spearhead and Breakthrough), useful for old low-end hardware.
- Add a new variable to customize the FOV client-side `cg_fov` (defaults to 80), the FOV is no longer an ephemeral server-side setting.
- The FOV is automatically adjusted depending on the aspect ratio
#### UI
- Automatically scale UI and HUD for resolutions above 1920x1080 (support for 2K and above). UI and HUD elements no longer look tiny on 4K resolutions
### Fixed
- The OpenAL library has been updated to version [1.24.1](https://github.com/kcat/openal-soft/releases/tag/1.24.1).
#### Client
- Fix the client getting stuck in the loading screen when disconnected due to an error
- Fix the client loading the map twice when the server restarts and change map immediately
- Fix the first person model not matching the player model
#### General
- Fix letters with diacritic not being parsed nor displayed correctly in Spearhead and Breakthrough.
- Fix a crash that would occur on some custom maps with a lot of grid patches (increased `MAX_PATCH_PLANES`).
- Fix a rare crash that would occur when rendering static models under certain configurations.
- Fix a stack overflow crash that would occur with a name of more than 30 characters.
#### AI
- Fix singleplayer AI not aiming at the enemy while taking cover
- Fix singleplayer AI not dropping weapons if forcedropweapon is set on the sentient and weapon drops are disabled in the level (should be better for Breakthrough single-player maps)
- Fix a random crash that would occur when using multiplayer bots
- Improved multiplayer bot logic
- Fix the match not ending after the clock reached 0:00 in round-based games
#### Game
- Fix doors closing immediately when blocked (this bug also occurs in the original game)
- Fix smoke grenades not reapparing when loading from save
- Fix vehicle tank tandem causing a crash when a single turret was attached
- Make players non-solid when they're a passenger in a vehicle (fixes players getting hit/damaged by the moving vehicle)
- Prevent the player from going out of the maximum world bounds in noclip mode (as in mohaas/mohaab)
- Prevent the player from shooting silently by firing and dropping the weapon at the exact same time (this is trick is possible in the original game)
- When a door is blocked (voluntarily by a player or not), it will now try to open again in the other direction, to make the door not impossible to open (this is also an issue in the original game)
#### Multiplayer
- Fix game messages not having a newline
- Fix letters with accents not displaying in the chat box
- Fix a bug that would make the player die or spawn with no inventory. This occurs when getting killed and respawning immediately (this bug also occurs in the original game)
- Fix an issue where remote clients would lose track of other clients team that have changed their name
- Fix players getting the score from previous maps if they reconnect at the right moment (this bug also occurs in the original game)
- Fix players deaths (or total kills) being added twice in round-based matches
- Fix spawn metrics being terrible in FFA (like players respawning right behind other players)
- Fix teamkill kick not displayed in Spearhead and Breakthrough
#### Server
- Fix the result of the `status` command which prevented tools like `Advanced Security` from getting IP addresses (note: `Advanced Security` doesn't support IPv6 addresses)
- Fix an issue where connecting clients would disconnect with the error `tried to parse cg message without cgame loaded`. This issue occurs in original 1.11, but was fixed in original 2.0 (Spearhead and Breakthrough)
#### UI
- Fix an issue when resizing an in-game window, the window would stop being resized when the mouse was rapidly moving
- Fix huddraw elements being wrongly positioned on wide screen when elements have virtualscale enabled
- Fix pulldown menus being improperly focused and activated at the same time
- Fix the crosshair being too small or hidden when a lower `Texture Detail` value (`r_picmip`) is set
- Properly handle long strings in the chat message box and in the game message box
### Changed
#### General
- Don't execute newconfig.cfg anymore as it overrides graphical settings.
- Some errors that show in console will only print in developer mode now (`developer` set to 1), as those are not relevant for the end-user.
- The `unnamedsoldier.cfg` configuration file will be used as a template for creating the `omconfig.cfg` configuration file if the latter doesn't exist
## [0.80.0] - 2024-11-24
### Added
#### Audio
- Add "tmvolume", so single-player scripts can adjust the music volume.
#### Client
- Add fuse stopwatch (Medal of Honor: Spearhead and Breakthrough feature).
- Add testemitter support for creating emitters.
- Briefings videos are now played in mohaas/mohaab.
- The game intro is now played when the game starts.
#### Game module
- Add a server feature to tweak in-game text messages and instant messages.
- Add a server feature to prevent unbalancing teams.
- Add Breakthrough liberation instant messages.
#### Rendering
- Add dynamic light support for terrains
- Add lighting for smoke FX
- Add support for sunflares and lensflares
- Improved the overall lighting. Objects should now be lit correctly (some issues could still occur)
- JPEG screenshots are now supported using the `screenshotJPEG` command
### Fixed
#### Audio
- Ambient sounds should now play correctly on all maps.
- Fix a crash when the sound quality was set to a value lower to `High` (which means 44 kHz).
- Fix an occurence where some sounds would loop forever. This would occur mostly when loading a saved game.
- Fix background ambient sounds being muted when restarting after the intermission (this is a bug in the original game).
- The ambient sound is now completely reset on each map, which means ambient sounds from previous maps won't be heard (this is a bug in the original game).
#### Client
- Better FX
- Fix a rare crash that would occur when loading a map.
- Fix an issue where delayed effects wouldn't spawn, like the K5 cannon in MOH: Breakthrough, e3l3.
- Fix animations issue when the player dies (weird shaking, etc).
- Fix barrel water/oil leaks not showing.
- Fix bullet holes disappearing on doors.
- Fix emitters leaking, this would cause a massive lag in a server with a lot of players.
- Fix issues with shaky animation in a multiplayer game, like when dying, the animation would repeat and look buggy.
- Fix the client not being able to play on standalone non-dedicated MOH: Breakthrough servers (which would prevent awesome LAN sessions).
- Fix the quick message mode window being shown as a full chat window.
- In mohaas/mohaab mode, team radar icon should now blink when the teammate is talking.
- It's now possible to navigate and play voices from the in-game voice menu.
#### Filesystem
- Fix pk3 ordering: for example, files starting with `zzzzz_name` must take precedence over `zz_name`. This should fix the issue where some mods would unexpectedly take precedence over other mods
#### General
- Fix a crash that could occur when no valid animation exist for a model.
- Fix long subtitles not being displayed.
- Lowered log verbosity to avoid spamming console with useless stuff. Set `developer` to 1 for more verbosity.
- Missing animations are no longer missing.
#### Rendering
- Dynamic lights are now rendered properly and they no longer cause rendering artifacts all over the place
- Fix a crash that would occur in terrain code on some platforms
- Fix static models being incorrectly culled/hidden
- Fix water and oceans being strangely deformed
- Improved the overall lighting. Objects should now be lit correctly (some issues could still occur)
- Sky seams and similar graphical artifacts should no longer be seen on most configurations
#### Server
- Don't send pak names to clients if download (`sv_allowDownload`) is disabled
- Fix animations not playing (like in e2l1) when they are played while the server is starting
- Fix an hang (infinite loop) that would occur when sv_fps is above 1000 (this bug also occurs in the original game)
- Fix entities being sent through skyportals
- Fix `status` returning too long columns for some programs
- Fix velocity being incorrect on ARM systems due to a signed integer overflow
- Reject demo clients on full servers
- Reject non-Breakthrough clients when targeting Breakthrough
#### UI
- Fix a bug where the game would get stuck in the loading screen if the loading screen doesn't have a "continue" button
- Fix bugs in the UI map rotation list when adding/applying
- Improved in-game Notepad support
- The UI should no longer lock up when refreshing/canceling the server list (this bug also occurs in the original game)
### Changed
#### Client
- As a protection, stufftext commands (commands that the server want clients to execute) are now filtered out, only some stufftext commands are allowed to prevent any alteration from a remote server.
- Animations now play smoothly, a lower timescale won't result in a poorly laggy animation anymore (this is an issue in the original game).
#### Game
- Don't allow lean in single-player in the base game.
- Don't count telefrags as teamkills (this is an issue in the original game).
- Fix a bug where the map would not end when the remaining time left reached 0:00 and the fraglimit was set
- Fix a crash that would occur when loading a saved game
- Fix a memory leak issue that can be seen after a long play time, some of the memory leaks also occur in the original game
- Fix AI animations
- Fix AI incorrectly holding a turret too far away
- Fix AI moving incorrectly after loading from save
- Fix AI not turning away from walls
- Fix AI not being able to see through a window frame
- Fix AI running too slowly, and a rare occurence where AIs would get stuck when going down the stairs
- Fix an issue where bullets would not hit anything behind triggers in Allied Assault, like in m2l3 from inside the vent
- Fix an issue where the player would be invulnerable when using heavy weapons, like the Granatwerfer
- Fix an issue where some AIs would not have a speech animation when speaking
- Fix barrel jittering
- Fix errors related to the script lexer & grammar
- Fix Flak88 and Nebelwerfer destroyed models in Spearhead and Breakthrough
- Fix jeep vehicle position on m3l2
- Fix ladder positioning (the issue would only occur on 64-bit systems)
- Fix player position on a vehicle turret gun (like the AA gun, or the Granatwerfer)
- Fix sentients still dropping their weapons even if the level has disabled weapon drops
- Fix some rare mods not loading properly due to an error in the script lexer
- Fix some script models not having any animation after loading from save
- Fix the barrel jittering
- Fix the roof top door on e1l3 (with Gino Corelli) opening when closing the handle (due to an incorrect returned result of a script command)
- Fix vehicle turret gun not making any sounds
- Fix vehicle turret gun being out of sync with the vehicle after loading from save (this issue also occurs in the original game)
- Fix weapon pickups where picking up a weapon with only 1 ammo remaining (like a grenade) would not pick the ammo up (this is a bug in the original game)
- Fix weapprev/weappnext/weapdrop switching to inventory item like binoculars
- Navigation fixes
#### Server
- Clients who are not sent to others (invisible + not sent to snapshots) won't be able to use anything like doors, and won't be able to send instant/voice messages
## [0.70.0] - 2024-09-02
### Added
#### Binaries
- This new version ships with binaries for PowerPC, PowerPC64 and PowerPC64 Little-Endian. Currently experimental and the client may not work correctly.
- For linux binaries, AARCH64 was renamed to ARM64
#### General
- Add a default idle animation for TIKI files not having any animation
#### Rendering
- Add support for DDS textures
- Add morphs: dynamic facial expressions for characters
- Implemented sky portal
#### Sound
- Add OpenAL support:
- Ambient sound (soundtrack)
- HRTF can be used on OpenAL by setting the speaker type to `Headphones`
- Loopsounds
- Music support (triggered music)
- Proper sound entity spatialization
- Streamed sounds - audio files (such as music) are streamed from disk without them being entirely loaded in memory
- Volume/Pitch variation
#### UI
- Add in-game Notepad (thanks to @pryon)
- Add screenshots for saved games
### Fixed
#### General
- Animation fixes
- Fix a crash related to localization (due to some strings containing a backtick)
- Fix some models having surfaces without a shader
- Fix entity collision
- Fix bad terrain/patch collision with grenades
- Fix improper collision on fences - it's now possible to target flak88 behind barbwires with binoculars
- Fix load/save game crashes
- Networking fixes
- Improved support for big-endian architectures (like PowerPC 32/64 bits and ARM in big-endian mode)
#### Client
- Fix entities being incorrectly attached sometimes
##### CGame module
- Bullet hit effects like snow, water and glass are fixed, as well as bullet tracers and flesh impacts
- Corrected Gewehrgranate viewmodel animations
- Fix occasional crashes due to volumetric smoke
- Fix marks not showing on entities like doors
- Invisible models fix
- Rain/snow should now be properly working
- Various fixes for special FX
#### Server
- Fix configstrings overflow on big maps, like t1l2 on MOH: Spearhead
##### Game module
- Door fixes, like door opening in the wrong direction
- Physics fixes, like grenade bouncing
- Fix AIs: they're less dumb than on previous versions
- Fix the artillery system (ProjectileGenerator) - fixes for t2l3, t2l4...
- Fix game loading/saving having wrong datas
- Fix the scoreboard on FFA and for spectators
- Fix the script engine - all scripts must be working now
- Fix an issue with spawnpoints where the player wouldn't spawn at the correct spot
- The mine detector correctly detect mines, in single-player
- The mission date (such as "JUNE 6, 1944") is now displayed
- The vehicle system is now fully working properly: no more vehicles getting stuck
- Singleplayer maps are all completable now (although some rare bugs may occur)
#### Rendering
- Fix crashes related to terrain
- Fix crashes related to `vid_restart` and `snd_restart`
- Fix strange lighting when `Full entity lighting` is disabled
- Lighting related fixes
- Most shaders should correctly load
#### UI
- Fix crashes related to UI
- Fix `vid_restart` breaking the UI
- Fix the multiplayer map picker displaying the same maps twice
- Player model picker should now be displaying characters properly
- Properly show the "disconnected" menu when the client get disconnected from a server
## [0.61.0] - 2024-01-08
### Added
#### Game Module
- Landmines are now fully working (a **Medal of Honor: Allied Assault Breakthrough** feature)
- Script command documentation can now be exported properly using `dumpallclasses` command
#### Client
- Add single-player map list and multiplayer map list
- Add map rotation list for multiplayer
- Add player model selection list
- Add LAN game searcher
- Add subtitles, centerprint, and locationprint
- Add the miniconsole
- Binds can now be set
### Fixed
#### Game module
- Crash fixes
- Fix callvote with invalid strings
- Fix grenade crash
- Fix weapons being attached to the wrong player's hand under some circumstances
- Players should now get the correct loadout in multiplayer
- `sv_fps` with a value higher than 20 shouldn't cause issues anymore with animations
#### Client
- 3D player models are now shown in the main menu screen
- Configstring can now be handled in multiple chunks
- Fix mohaas server version mismatch in the server list when using mohaab target game
- Fix vote menu not working
- Fix UI sounds not working
- Fix locationprint and centerprint not working
## [0.60.2] - 2023-11-29
### Fixed
#### Game Module
- Fix pain animations
- Fix portable turret animations
- Fix game crashing when saving and/or loading from save
#### ClientGame Module
- Fix for the client game module not hiding the stats screen
#### Server
- Fix level file archive
## [0.60.1] - 2023-11-15
### Changed
- The carryable turret (packed MG42 turret) can now be placed
### Fixed
- Fix bullet tracers, they should now be working correctly
- Fix a bug where player could get stuck in turret mode after the turret was removed
## [0.60.0] - 2023-11-15
### Added
- Add non-pvs feature (hide players from other clients who cannot see them)
- Add more SH and BT features
- Add ioq3 server features
- Mostly implemented AI Actor (still buggy)
- Implemented Vehicle and TurretGun from BT 2.40
- Implemented voting system
### Changed
- Configs are now stored in the homepath
- Binaries are now stored in the root folder (no need to replace existing MOH binaries anymore)
- Crashes fixes
- Rendering fixes, client fixes, game fixes and script engine fixes
## [0.58.1] - 2023-08-21
### Fixed
- Fix demo recordings not working with different protocols
- Publish `sv_fps` in server info variables
## [0.58.0] - 2023-08-20
### Added
- Multiplayer bot support
- Server browser
#### Spearhead and Breakthrough features
- Animated farplanes
- Bullets through wood/metal
- Smokes
- Sprint
- Compass radar (icon of teammates on the compass)
- Landmines
- Tug-of-War and Liberation game types
- ...
### Fixed
- Fix bugs, and crashes
- Fix training map not working
- The script engine should now be fully compatible with mohaa scripts
## [0.57.0] - 2023-07-25
### Added
#### Renderer
- Sphere lights for entities
- Light grid entity lighting
- Light grid support from Spearhead and Breakthrough
#### Game
- Allow/disallow leaning while moving (Spearhead and Breakthrough)
## [0.56.0] - 2023-07-23
### Added
- Add bullets, bullet trails, emitters, explosions, marks, model attachment, special effects, viewmodel anim
- Add fog, font, dynamic lights, shader fade, sprite, trees
### Changed
- Use a single executable to play on mohaa, moh_spearhead or moh_breakthrough servers, by starting openmohaa with `+set com_target_game x` commandline (check README)
### Fixed
- Fix disconnect menu not working
- Fix compass not working
- Fix crashes
## [0.55.3] - 2023-06-27
## [0.55.2] - 2023-06-27
### Added
- Add Breakthrough-compatible executable
## [0.55.1] - 2023-06-24
## [0.54.0] - 2023-05-30
### Added
- ioquake3 backport
- SDL2 support, which means input, rendering and sound improvements
- Better console support (using OS console host, rather than a custom Windows 95 console)
- Rendering improvement: sprite support, light glow support (light coronas), more shaders support, minor fixes, and beam fixes
- Sound improvement: MP3 support + better sound/format support
- Client game: better emitter support, scoreboard fixes, kar98 overlay fix
- Networking improvement
- UI improvement: using Spearhead/Breakthrough gmbox/dmbox placement
### Fixed
- Fix compass scale
## [0.53.2] - 2023-05-23
### Added
- ARM support
- DDS texture support
- Death messages on Spearhead/Breakthrough
### Fixed
- More SH/BT fixes
- Networking fixes
- UI/HUD fixes
- Weapon binding fixes
## [0.53.1] - 2023-05-22
### Fixed
- Crashes fixes
- Minor fixes
- Rendering fixes (especially for menus in SH/BT)
- Scoreboard fixes for SH/BT
## [0.53.0] - 2023-05-21
### Added
- Add support for Spearhead (TA/Team Assault) and Breakthrough (TT/Team Tactics) server/client
### Fixed
- Bug fixes
## [0.52.0] - 2023-05-21
### Changed
- Use semantic version number
### Fixed
- Rendering fixes
- UI fixes
## [0.51a] - 2023-05-20
### Fixed
- Crash fixes
- Lighting tweaks
- Performance fixes
## [0.51] - 2023-05-20
### Added
- Loading screens
- Scoreboard
- Weapon buttons
## [0.50a] - 2023-05-19
### Added
- Fog support
### Fixed
- Fix static model
## [0.50] - 2023-05-18
### Added
- Almost full LOD terrain support
- Basic sound implementation
- Better multi-texture support
## [0.49f] - 2023-05-18
### Added
- Client binaries
## [0.49e] - 2023-02-05
## [0.49d] - 2023-02-05
## [0.49c] - 2023-02-03
## [0.49b] - 2023-01-30
## [0.49] - 2023-01-29
### Added
- This is the first public release on GitHub with CMake support. Dedicated-only binaries.
[unreleased]: https://github.com/openmoh/openmohaa/compare/v0.82.1...HEAD
[0.82.1]: https://github.com/openmoh/openmohaa/compare/v0.82.0...v0.82.1
[0.82.0]: https://github.com/openmoh/openmohaa/compare/v0.81.1...v0.82.0
[0.81.1]: https://github.com/openmoh/openmohaa/compare/v0.81.0...v0.81.1
[0.81.0]: https://github.com/openmoh/openmohaa/compare/v0.80.0...v0.81.0
[0.80.0]: https://github.com/openmoh/openmohaa/compare/v0.70.0...v0.80.0
[0.70.0]: https://github.com/openmoh/openmohaa/compare/v0.61.0...v0.70.0
[0.61.0]: https://github.com/openmoh/openmohaa/compare/v0.60.2...v0.61.0
[0.60.2]: https://github.com/openmoh/openmohaa/compare/v0.60.1...v0.60.2
[0.60.1]: https://github.com/openmoh/openmohaa/compare/v0.60.0...v0.60.1
[0.60.0]: https://github.com/openmoh/openmohaa/compare/v0.58.0...v0.60.0
[0.58.1]: https://github.com/openmoh/openmohaa/compare/v0.58.0...v0.58.1
[0.58.0]: https://github.com/openmoh/openmohaa/compare/v0.57.0...v0.58.0
[0.57.0]: https://github.com/openmoh/openmohaa/compare/v0.56.0...v0.57.0
[0.56.0]: https://github.com/openmoh/openmohaa/compare/v0.55.3...v0.56.0
[0.55.3]: https://github.com/openmoh/openmohaa/compare/v0.55.2...v0.55.3
[0.55.2]: https://github.com/openmoh/openmohaa/compare/v0.55.1...v0.55.2
[0.55.1]: https://github.com/openmoh/openmohaa/compare/v0.54.0...v0.55.1
[0.54.0]: https://github.com/openmoh/openmohaa/compare/v0.53.2...v0.54.0
[0.53.2]: https://github.com/openmoh/openmohaa/compare/v0.53.1...v0.53.2
[0.53.1]: https://github.com/openmoh/openmohaa/compare/v0.53.0...v0.53.1
[0.53.0]: https://github.com/openmoh/openmohaa/compare/v0.52.0...v0.53.0
[0.52.0]: https://github.com/openmoh/openmohaa/compare/0.51a...v0.52.0
[0.51a]: https://github.com/openmoh/openmohaa/compare/0.51...0.51a
[0.51]: https://github.com/openmoh/openmohaa/compare/0.50a...0.51
[0.50a]: https://github.com/openmoh/openmohaa/compare/0.50...0.50a
[0.50]: https://github.com/openmoh/openmohaa/compare/0.49f...0.50
[0.49f]: https://github.com/openmoh/openmohaa/compare/0.49e...0.49f
[0.49e]: https://github.com/openmoh/openmohaa/compare/0.49d...0.49e
[0.49d]: https://github.com/openmoh/openmohaa/compare/0.49c...0.49d
[0.49c]: https://github.com/openmoh/openmohaa/compare/0.49b...0.49c
[0.49b]: https://github.com/openmoh/openmohaa/compare/0.49...0.49b
[0.49]: https://github.com/openmoh/openmohaa/releases/tag/0.49
+69 -223
View File
@@ -1,241 +1,87 @@
cmake_minimum_required(VERSION 3.12)
project(openmohaa)
cmake_minimum_required(VERSION 3.25)
include(misc/cmake/TargetArch.cmake)
target_architecture(TARGET_ARCH)
list(LENGTH TARGET_ARCH TARGET_ARCH_COUNT)
set(USE_INTERNAL_LIBS ON)
if(USE_SYSTEM_LIBS)
set(USE_INTERNAL_LIBS OFF)
if(POLICY CMP0177)
# Policy CMP0177: install() DESTINATION paths are normalized
# Introduced in CMake 3.31
cmake_policy(SET CMP0177 NEW)
endif()
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)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(identity)
if(TARGET_GAME_TYPE)
message(SEND_ERROR "TARGET_GAME_TYPE is now unsupported, it is now done at runtime.")
project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
option(BUILD_SERVER "Build dedicated server" ON)
option(BUILD_CLIENT "Build client" ON)
option(BUILD_RENDERER_GL1 "Build GL1 renderer" ON)
option(BUILD_RENDERER_GL2 "Build GL2 renderer" OFF)
option(BUILD_GAME_LIBRARIES "Build game module libraries" ON)
option(BUILD_GAME_QVMS "Build game module qvms" ON)
option(BUILD_STANDALONE "Build binaries for standalone games" OFF)
option(USE_RENDERER_DLOPEN "Dynamically load the renderer(s)" ON)
option(USE_OPENAL "OpenAL audio" ON)
option(USE_OPENAL_DLOPEN "Dynamically load OpenAL" ON)
option(USE_HTTP "HTTP download support" ON)
option(USE_CODEC_VORBIS "Ogg Vorbis support" ON)
option(USE_CODEC_OPUS "Ogg Opus support" ON)
option(USE_CODEC_MAD "MP3 support" ON)
option(USE_VOIP "Voice chat" OFF)
option(USE_MUMBLE "Mumble support" OFF)
option(USE_FREETYPE "Freetype font rendering" OFF)
option(USE_INTERNAL_LIBS "Use internally packaged libraries" ON)
option(USE_INTERNAL_SDL "Use internal SDL binary (if available)" ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_ZLIB "Use internal copy of zlib" ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_JPEG "Use internal copy of libjpeg" ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_OGG "Use internal copy of ogg" ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_VORBIS "Use internal copy of vorbis" ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_OPUS "Use internal copy of opus" ${USE_INTERNAL_LIBS})
option(USE_INTERNAL_MAD "Use internal copy of libmad" ${USE_INTERNAL_LIBS})
# Release build by default, set externally if you want something else
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
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)
# Treat no return type as error
add_compile_options(/we4715)
# Try to enable LTO by default
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_SUPPORTED)
if(IPO_SUPPORTED)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE)
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()
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
#
# 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()
set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/code)
#
# 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()
message(STATUS "Architecture detected: ${TARGET_ARCH}")
set(TARGET_BIN_SUFFIX "")
if(WIN32)
set(TARGET_PLATFORM_PREFIX "")
message(STATUS "Using Win32 naming convention")
elseif(UNIX)
set(TARGET_PLATFORM_PREFIX "")
message(STATUS "Using Unix naming convention")
else()
set(TARGET_PLATFORM_PREFIX "")
endif()
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()
# 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)
# Enable unit testing
include(CTest)
#
# 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")
target_compile_definitions(omohaaded PRIVATE APP_MODULE DEDICATED)
target_compile_features(omohaaded PUBLIC cxx_nullptr)
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)
# 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_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 ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
if(DEFINED ENV{SOURCE_DATE_EPOCH})
string(TIMESTAMP PRODUCT_DATE "%b %d %Y" UTC)
add_compile_definitions(PRODUCT_DATE="${PRODUCT_DATE}")
endif()
if (NOT BUILD_NO_CLIENT)
##
## Client app
##
option(NO_MODERN_DMA "Use older sound-system" FALSE)
include(compilers/all)
include(platforms/all)
include(libraries/all)
include(deploy/all)
add_subdirectory("code/client")
add_subdirectory("code/renderercommon")
add_subdirectory("code/sdl")
include(version)
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)
target_link_libraries(openmohaa PRIVATE qcommon qcommon_standalone)
include(server)
include(renderer_gl1)
include(renderer_gl2)
include(client)
include(basegame)
#include(missionpack)
include(launcher)
# 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})
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 ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR} OPTIONAL)
endif()
if(UNIX AND NOT APPLE)
# 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()
include(post_configure)
#include(installer)
+191
View File
@@ -0,0 +1,191 @@
# Contributing guidelines
Whether you're reporting issues or coding, follow the guidelines below to help keep the project consistent and maintainable.
All contributions, including **issues**, **discussions**, **code comments**, **commit messages**, and **documentation**, must be written in *English*. This ensures clarity and consistency for all contributors.
There are many ways to contribute. Contributions are welcome in the following areas:
- Fixing [bugs and crashes](#issues).
- Documentation improvements
- Performance improvements
- Testing
- Helping users (issues, discussions)
- Suggesting enhancements (via issues only)
New features are designed and implemented by maintainers, so the project's direction and maintenance burden stay consistent.
If you want to propose a new feature, please open an issue first.
Do not start implementing a new feature before getting approval. Pull requests that introduce unapproved features may be closed without review.
---
## Issues
Before opening a new issue:
1. Make sure you're running the [latest development version](https://github.com/openmoh/openmohaa/releases/tag/dev).
2. Check if the issue already exists.
When filing an issue, include as much detail as possible, this helps reproducing and fixing the problem effectively:
- Clear description of the bug.
- Steps to reproduce.
- Log file (`qconsole.log`) and crash output if applicable:
- Attach the relevant log file.
- For crashes, paste the console output that includes the backtrace.
- Operating System and version. Example: `Debian 13`.
- Full game version. Example: `0.70.0-alpha+0.0b1a20dcf win_msvc64-x86_64-debug`. The version is obtained at the start of the log file, or by executing the `version` command in console.
## Usage of generative AI / Large language models
### Policy
This project requires that all contributions be human-authored.
Do not submit any code, documentation, issues, pull requests, commit messages or comments that are generated using AI or similar assistive tools (such as Microsoft Copilot, Anthropic Claude, ChatGPT...).
- **No AI-derived patches**. If the change was proposed by an AI, it must not be ported over "by hand". If the idea came from AI, treat is as untrusted and do your own independent implementation.
- **No AI-assisted refactors**. Mass rewrites, LLM-based formatting, or modernization are not accepted.
- **Enforcement**. Maintainers may request clarification. PRs suspected of AI involvement may be rejected or reverted, and may lead to a ban.
#### Acceptable uses
- **Non-generative tools** are allowed: static analyzers, formatters, linters, sanitizers, fuzzers and IDE features are fine as long they do not generate code.
- **Translation tools** to help communicating between people.
### Reasoning
This policy exists due to:
- **Copyright and licensing risk**. The origin of the outputs may be unclear as these tools plagiarize the original sources without permission.
- **Security and authenticity**. AI produces plausible code but may often look wrong. This could work, but would turn into undefined behavior, vulnerabilities, or time spent in a debugger.
- **Maintability**. Changes must be explainable and reviewable. Humans can explain tradeoffs they consciously accepted. Generated code can't. If you can't explain why a specific line exists, it shouldn't be proposed at all.
- **Respect for maintainers**. Submitting contributions generated by these tools waste maintainers resources to review them.
### Responsibility
When submitting, you agree that:
- The submission **complies with this policy**. Changes must be able to be explained and justified during review.
- The submission **can be declined** if it is **suspected to use AI** or is raising reviewability concerns.
## Coding
### Compatibility
All changes must stay retro-compatible with the original game:
- Assets must be loaded correctly.
- Changes related to networking must be compatible with existing MOHAA clients and servers, these changes must not cause an error/disconnect.
- Scripts/mods must remain functional.
- The singleplayer campaign must be fully playable.
### Coding style & Guidelines
- Match the existing code style in any files you modify.
- Avoid personal tags or author comments (.e.g., `// @Name: note`). Git already tracks authorship.
- Ensure the code builds successfully using CI.
- Use **camelCase** notation for all variables, and **PascalCase** notation for functions. Even if some existing code doesn't.
- Format code using `clang-format`.
- In VSCode from the command palette: **Format document**
### Event declaration
When declaring a new Event, use the following structure:
```cpp
Event EV_YourEventName // Pascal Case naming convention
(
"name", // Each parameter on a new line
flags,
"format specifiers...",
"argument names...",
"description"
);
```
### Code annotations
When modifying existing code from the original game or adding new classes, annotate your changes using one of the following patterns:
#### Additions
```cpp
// Added in OPM
// Description
```
#### Changes
```cpp
// Changed in OPM
// Description
```
#### Fixes
```cpp
// Fixed in OPM
// Description
```
#### Removal
```cpp
// Removed in OPM
// Description
```
If referencing a specific game version, replace OPM with that version number. Example:
```cpp
// Added in 2.11
// Make sure to clean turret stuff up
// when the player is deleted
```
Known versions are `1.00`, `1.10`, `1.11`, `2.0`, `2.1`, `2.11`, `2.15`, `2.30`, `2.40`.
You can also group multiple related functions like this:
```cpp
// Added in OPM
//====
void Function1();
void Function2();
void Function3();
//====
```
For new source files, include the annotation after the license notice.
### Source files
- Always put the license notice as the header of the file (template [here](docs/markdown/05-contributing/01-license-header.md)).
- Only `#include` what's necessary.
- Each source file should contain related classes and functions.
---
## Pull Requests
Pull Requests are the preferred way of submitting code changes.
### Before you start
1. **Discuss major changes first**: open an issue or discuss about it.
2. **Create a branch** based on the `main` branch (you shouldn't commit directly on `main`)
3. **Keep PRs as small as possible and focused**: One clear purpose per PR.
### Submitting a PR
- Target the correct branch (usually `main`).
- Add a short and clear description of what you changed and why.
- Reference matching issues (e.g. `Fixes #123`).
- Make sure your code builds and passes tests.
- Test locally to ensure your changes don't break functionality or compatibility.
### Reviews
- Maintainers may ask for tweaks or commit changes directly to your PR, that's normal.
- Stay polite and technical.
- Once approved, your changes will be merged.
### Additional Notes
- Contributions follow the same license as the project.
- Keep things consistent with existing code and docs.
- If you're unsure about anything, you can discuss it on Discord via [this link](https://discord.gg/NYtH58R).
+3 -3
View File
@@ -45,11 +45,11 @@ If you encounter a bug or a problem, you can do one of the following:
- 📖 [Documentation](https://openmoh.github.io/openmohaa)
- ⚙️ [Game settings & configuration](docs/markdown/03-configuration/01-configuration.md)
- 📝 [Code & Scripting reference](docs/markdown/04-coding/02-coding.md)
- 📜 [Contributing guidelines](docs/markdown/05-contributing/01-guidelines.md)
- 📜 [Contributing guidelines](CONTRIBUTING.md)
## Current state
- 🧰 [Feature list](docs/markdown/01-intro/04-features.md)
- 🧰 [List of differences](docs/markdown/01-intro/04-differences.md)
### Single-player
@@ -102,7 +102,7 @@ The following third party tools and libraries are used by the project
## Resources
- 🔗 [GitHub Repository](https://github.com/openmoh/openmohaa/)
- 🌐 [MOHAAAA Amalgamated Allied Assault Alliance](https://mohaaaa.co.uk/AAAAMOHAA/index.php)
- 🌐 [MOH-DB](https://www.moh-db.com/)
- 🕹️ [333networks](https://333networks.com/)
- 📂 [ModDB](https://www.moddb.com/games/medal-of-honor-allied-assault)
- 📂 [GameBanana](https://gamebanana.com/games/720)
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>@MACOS_APP_EXECUTABLE_NAME@</string>
<key>CFBundleIconFile</key>
<string>@MACOS_APP_ICON_FILE@</string>
<key>CFBundleIdentifier</key>
<string>@MACOS_APP_GUI_IDENTIFIER@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>@MACOS_APP_BUNDLE_NAME@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@MACOS_APP_SHORT_VERSION_STRING@</string>
<key>CFBundleVersion</key>
<string>@MACOS_APP_BUNDLE_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>@MACOS_APP_COPYRIGHT@</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSMinimumSystemVersion</key>
<string>@MACOS_APP_DEPLOYMENT_TARGET@</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
@MACOS_APP_PLIST_URL_TYPES@
</dict>
</plist>
+107
View File
@@ -0,0 +1,107 @@
if(NOT BUILD_GAME_LIBRARIES AND NOT BUILD_GAME_QVMS)
return()
endif()
include(utils/set_output_dirs)
include(shared_script)
file(GLOB_RECURSE BG_SOURCES
${SOURCE_DIR}/fgame/bg_misc.cpp
${SOURCE_DIR}/fgame/bg_pmove.cpp
${SOURCE_DIR}/fgame/bg_slidemove.cpp
${SOURCE_DIR}/fgame/bg_voteoptions.cpp
)
file(GLOB_RECURSE CGAME_SOURCES
${SOURCE_DIR}/cgame/*.c ${SOURCE_DIR}/cgame/*.cpp
)
set(CGAME_BINARY_SOURCES)
set(CGAME_QVM_SOURCES)
file(GLOB_RECURSE GAME_SOURCES
${SOURCE_DIR}/fgame/*.c ${SOURCE_DIR}/fgame/*.cpp
${SOURCE_DIR}/script/*.c ${SOURCE_DIR}/script/*.cpp
${SOURCE_DIR}/parser/parsetree.cpp
)
# Compile lexer and grammar files
if (FLEX_FOUND)
flex_target(fgame-lexer ${CMAKE_SOURCE_DIR}/code/parser/lex_source.txt ${CMAKE_SOURCE_DIR}/code/parser/generated/yyLexer.cpp DEFINES_FILE ${CMAKE_SOURCE_DIR}/code/parser/generated/yyLexer.h COMPILE_FLAGS "-Cem --nounistd")
endif()
if (BISON_FOUND)
bison_target(fgame-parser ${CMAKE_SOURCE_DIR}/code/parser/bison_source.txt ${CMAKE_SOURCE_DIR}/code/parser/generated/yyParser.cpp)
endif()
file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/code/parser/generated")
list(APPEND GAME_SOURCES
${BISON_fgame-parser_OUTPUTS}
${FLEX_fgame-lexer_OUTPUTS}
)
set(GAME_BINARY_SOURCES)
set(GAME_QVM_SOURCES)
set(UI_SOURCES)
set(UI_BINARY_SOURCES)
set(UI_QVM_SOURCES)
set(GAME_MODULE_SHARED_SOURCES
${SOURCE_DIR}/qcommon/q_math.c
${SOURCE_DIR}/qcommon/q_shared.c
${SCRIPT_SYSTEM_SOURCES}
)
set(CGAME_SOURCES_BASEGAME ${CGAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
set(GAME_SOURCES_BASEGAME ${GAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
set(UI_SOURCES_BASEGAME ${UI_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
if(BUILD_GAME_LIBRARIES)
set(CGAME_MODULE_BINARY ${CGAME_MODULE})
set(GAME_MODULE_BINARY ${GAME_MODULE})
set(UI_MODULE_BINARY ${UI_MODULE})
if (BASEGAME)
set(CGAME_MODULE_BINARY_BASEGAME ${CGAME_MODULE_BINARY}_${BASEGAME})
set(GAME_MODULE_BINARY_BASEGAME ${GAME_MODULE_BINARY}_${BASEGAME})
set(UI_MODULE_BINARY_BASEGAME ${UI_MODULE_BINARY}_${BASEGAME})
else()
set(CGAME_MODULE_BINARY_BASEGAME ${CGAME_MODULE_BINARY})
set(GAME_MODULE_BINARY_BASEGAME ${GAME_MODULE_BINARY})
set(UI_MODULE_BINARY_BASEGAME ${UI_MODULE_BINARY})
endif()
add_library( ${CGAME_MODULE_BINARY_BASEGAME} SHARED ${CGAME_SOURCES_BASEGAME} ${BG_SOURCES} ${CGAME_BINARY_SOURCES})
target_compile_definitions( ${CGAME_MODULE_BINARY_BASEGAME} PRIVATE CGAME_DLL)
target_link_libraries( ${CGAME_MODULE_BINARY_BASEGAME} PRIVATE ${COMMON_LIBRARIES})
set_target_properties( ${CGAME_MODULE_BINARY_BASEGAME} PROPERTIES OUTPUT_NAME ${CGAME_MODULE_BINARY})
set_output_dirs( ${CGAME_MODULE_BINARY_BASEGAME} SUBDIRECTORY ${BASEGAME})
INSTALL(TARGETS ${CGAME_MODULE_BINARY_BASEGAME} DESTINATION ${INSTALL_LIBDIR_FULL})
if(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:${CGAME_MODULE_BINARY_BASEGAME}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
endif()
add_library( ${GAME_MODULE_BINARY_BASEGAME} SHARED ${GAME_SOURCES_BASEGAME} ${BG_SOURCES} ${GAME_BINARY_SOURCES})
target_compile_definitions( ${GAME_MODULE_BINARY_BASEGAME} PRIVATE GAME_DLL WITH_SCRIPT_ENGINE ARCHIVE_SUPPORTED)
target_link_libraries( ${GAME_MODULE_BINARY_BASEGAME} PRIVATE RecastNavigation::Detour RecastNavigation::DetourCrowd RecastNavigation::Recast)
target_link_libraries( ${GAME_MODULE_BINARY_BASEGAME} PRIVATE ${COMMON_LIBRARIES})
set_target_properties( ${GAME_MODULE_BINARY_BASEGAME} PROPERTIES OUTPUT_NAME ${GAME_MODULE_BINARY})
set_output_dirs( ${GAME_MODULE_BINARY_BASEGAME} SUBDIRECTORY ${BASEGAME})
INSTALL(TARGETS ${GAME_MODULE_BINARY_BASEGAME} DESTINATION ${INSTALL_LIBDIR_FULL})
if(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:${GAME_MODULE_BINARY_BASEGAME}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
endif()
#add_library( ${UI_MODULE_BINARY_BASEGAME} SHARED ${UI_SOURCES_BASEGAME} ${UI_BINARY_SOURCES})
#target_compile_definitions( ${UI_MODULE_BINARY_BASEGAME} PRIVATE UI)
#set_target_properties( ${UI_MODULE_BINARY_BASEGAME} PROPERTIES OUTPUT_NAME ${UI_MODULE_BINARY})
#set_output_dirs( ${UI_MODULE_BINARY_BASEGAME} SUBDIRECTORY ${BASEGAME})
endif()
+150
View File
@@ -0,0 +1,150 @@
if(NOT BUILD_CLIENT)
return()
endif()
include(utils/add_git_dependency)
include(utils/set_output_dirs)
include(shared_sources)
include(shared_script)
include(renderer_common)
set(CLIENT_SOURCES
${SOURCE_DIR}/client/cl_avi.cpp
${SOURCE_DIR}/client/cl_cgame.cpp
${SOURCE_DIR}/client/cl_cin.cpp
${SOURCE_DIR}/client/cl_consolecmds.cpp
${SOURCE_DIR}/client/cl_curl.c
${SOURCE_DIR}/client/cl_input.cpp
${SOURCE_DIR}/client/cl_instantAction.cpp
${SOURCE_DIR}/client/cl_inv.cpp
${SOURCE_DIR}/client/cl_invrender.cpp
${SOURCE_DIR}/client/cl_keys.cpp
${SOURCE_DIR}/client/cl_main.cpp
${SOURCE_DIR}/client/cl_net_chan.cpp
${SOURCE_DIR}/client/cl_parse.cpp
${SOURCE_DIR}/client/cl_scrn.cpp
${SOURCE_DIR}/client/cl_ui.cpp
${SOURCE_DIR}/client/cl_uibind.cpp
${SOURCE_DIR}/client/cl_uidmbox.cpp
${SOURCE_DIR}/client/cl_uifilepicker.cpp
${SOURCE_DIR}/client/cl_uigamespy.cpp
${SOURCE_DIR}/client/cl_uigmbox.cpp
${SOURCE_DIR}/client/cl_uilangame.cpp
${SOURCE_DIR}/client/cl_uiloadsave.cpp
${SOURCE_DIR}/client/cl_uimaprotationsetup.cpp
${SOURCE_DIR}/client/cl_uimaprunner.cpp
${SOURCE_DIR}/client/cl_uiminicon.cpp
${SOURCE_DIR}/client/cl_uimpmappicker.cpp
${SOURCE_DIR}/client/cl_uiplayermodelpicker.cpp
${SOURCE_DIR}/client/cl_uiradar.cpp
${SOURCE_DIR}/client/cl_uiserverlist.cpp
${SOURCE_DIR}/client/cl_uisoundpicker.cpp
${SOURCE_DIR}/client/cl_uistd.cpp
${SOURCE_DIR}/client/cl_uiview3d.cpp
${SOURCE_DIR}/client/libmumblelink.c
${SOURCE_DIR}/client/qal.c
${SOURCE_DIR}/client/snd_codec_mp3.c
${SOURCE_DIR}/client/snd_codec_ogg.c
${SOURCE_DIR}/client/snd_codec_opus.c
${SOURCE_DIR}/client/snd_codec_wav.c
${SOURCE_DIR}/client/snd_codec.c
${SOURCE_DIR}/client/snd_dma_new.cpp
${SOURCE_DIR}/client/snd_info.cpp
${SOURCE_DIR}/client/snd_mem_new.cpp
${SOURCE_DIR}/client/snd_miles_new.cpp
${SOURCE_DIR}/client/snd_openal_new.cpp
${SOURCE_DIR}/client/usignal.cpp
${SOURCE_DIR}/sdl/sdl_input.c
${SOURCE_DIR}/sdl/sdl_mouse.c
${CLIENT_PLATFORM_SOURCES}
)
# Gamespy
list(APPEND CLIENT_SOURCES
${SOURCE_DIR}/gamespy/cl_gamespy.c
)
file(GLOB_RECURSE UI_SOURCES "${SOURCE_DIR}/uilib/*.c" "${SOURCE_DIR}/uilib/*.cpp")
add_git_dependency(${SOURCE_DIR}/client/cl_console.c)
set(CLIENT_BINARY ${CLIENT_NAME})
list(APPEND CLIENT_DEFINITIONS BOTLIB)
list(APPEND CLIENT_DEFINITIONS APP_MODULE)
if(BUILD_STANDALONE)
list(APPEND CLIENT_DEFINITIONS STANDALONE)
endif()
if(USE_RENDERER_DLOPEN)
list(APPEND CLIENT_DEFINITIONS USE_RENDERER_DLOPEN)
endif()
if(USE_HTTP)
list(APPEND CLIENT_DEFINITIONS USE_HTTP)
endif()
if(USE_VOIP)
list(APPEND CLIENT_DEFINITIONS USE_VOIP)
endif()
if(USE_MUMBLE)
list(APPEND CLIENT_DEFINITIONS USE_MUMBLE)
list(APPEND CLIENT_LIBRARY_SOURCES ${SOURCE_DIR}/client/libmumblelink.c)
endif()
list(APPEND CLIENT_BINARY_SOURCES
${SERVER_SOURCES}
${CLIENT_SOURCES}
${UI_SOURCES}
${COMMON_SOURCES}
${SCRIPT_SYSTEM_SOURCES}
${BOTLIB_SOURCES}
${SYSTEM_SOURCES}
${ASM_SOURCES}
${CLIENT_LIBRARY_SOURCES})
add_executable(${CLIENT_BINARY} ${CLIENT_EXECUTABLE_OPTIONS} ${CLIENT_BINARY_SOURCES})
target_include_directories( ${CLIENT_BINARY} PRIVATE ${CLIENT_INCLUDE_DIRS})
target_include_directories( ${CLIENT_BINARY} PRIVATE ${SOURCE_DIR}/client)
target_compile_definitions( ${CLIENT_BINARY} PRIVATE ${CLIENT_DEFINITIONS})
target_compile_options( ${CLIENT_BINARY} PRIVATE ${CLIENT_COMPILE_OPTIONS})
target_link_libraries( ${CLIENT_BINARY} PRIVATE ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES})
target_link_options( ${CLIENT_BINARY} PRIVATE ${CLIENT_LINK_OPTIONS})
set_output_dirs(${CLIENT_BINARY})
if(NOT USE_RENDERER_DLOPEN)
target_sources(${CLIENT_BINARY} PRIVATE
# These are never simultaneously populated
${RENDERER_GL1_BINARY_SOURCES}
${RENDERER_GL2_BINARY_SOURCES})
target_include_directories( ${CLIENT_BINARY} PRIVATE ${RENDERER_INCLUDE_DIRS})
target_compile_definitions( ${CLIENT_BINARY} PRIVATE ${RENDERER_DEFINITIONS})
target_compile_options( ${CLIENT_BINARY} PRIVATE ${RENDERER_COMPILE_OPTIONS})
target_link_libraries( ${CLIENT_BINARY} PRIVATE ${RENDERER_LIBRARIES})
endif()
foreach(LIBRARY IN LISTS CLIENT_DEPLOY_LIBRARIES)
add_custom_command(TARGET ${CLIENT_BINARY} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${LIBRARY}
$<TARGET_FILE_DIR:${CLIENT_BINARY}>)
install(FILES ${LIBRARY} DESTINATION
# install() requires a relative path hence:
$<PATH:RELATIVE_PATH,$<TARGET_FILE_DIR:${CLIENT_BINARY}>,${CMAKE_BINARY_DIR}/$<CONFIG>>)
endforeach()
set_target_properties(${CLIENT_BINARY} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
INSTALL(TARGETS ${CLIENT_BINARY} DESTINATION ${INSTALL_BINDIR_FULL})
if (MSVC)
target_link_options(${CLIENT_BINARY} PRIVATE "/MANIFEST:NO")
INSTALL(FILES $<TARGET_PDB_FILE:${CLIENT_BINARY}> DESTINATION ${INSTALL_BINDIR_FULL} OPTIONAL)
endif()
+21
View File
@@ -0,0 +1,21 @@
include(compilers/appleclang)
include(compilers/clang)
include(compilers/gcc)
include(compilers/gnu)
include(compilers/msvc)
set(CMAKE_DEBUG_POSTFIX "-dbg")
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()
# Non-debug builds
add_compile_definitions(NDEBUG)
endif()
+15
View File
@@ -0,0 +1,15 @@
# Apple Clang compiler specific settings
if(NOT CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
return()
endif()
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()
+8
View File
@@ -0,0 +1,8 @@
# Clang compiler specific settings
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
return()
endif()
# Ignore warnings for code like 'assert("Assert string")'
add_compile_options(-Wno-pointer-bool-conversion)
+10
View File
@@ -0,0 +1,10 @@
# GCC compiler specific settings
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")
return()
endif()
# 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)
+50
View File
@@ -0,0 +1,50 @@
# GNU style (GCC/Clang) compiler specific settings
if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_ID MATCHES "^(Apple)?Clang$")
return()
endif()
enable_language(ASM)
set(ASM_SOURCES
${SOURCE_DIR}/asm/ftola.c
${SOURCE_DIR}/asm/snapvector.c
)
add_compile_options(-Wall -Wimplicit -Wshadow
-Wstrict-prototypes -Wformat=2 -Wformat-security
-Wstrict-aliasing=2 -Wmissing-format-attribute
-Wdisabled-optimization -Werror-implicit-function-declaration)
add_compile_options(-Wno-format-zero-length -Wno-format-nonliteral)
# There are lots of instances of union based aliasing in the code
# that rely on the compiler not optimising them away, so disable it
add_compile_options(-fno-strict-aliasing)
# This is necessary to hide all symbols unless explicitly exported
# via the Q_EXPORT macro
#add_compile_options(-fvisibility=hidden)
add_compile_options(-Wno-comment)
# Treat no return type as error
add_compile_options(-Werror=return-type)
set(ASM_SOURCES)
execute_process(COMMAND ${CMAKE_C_COMPILER} -v
OUTPUT_VARIABLE COMPILER_OUTPUT
ERROR_VARIABLE COMPILER_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE)
list(APPEND CLIENT_LIBRARIES m)
list(APPEND SERVER_LIBRARIES m)
if(COMPILER_OUTPUT MATCHES "musl|freebsd|openbsd|netbsd")
list(APPEND CLIENT_LIBRARIES execinfo)
list(APPEND SERVER_LIBRARIES execinfo)
elseif (NOT APPLE)
# For when using GLIBC versions older than 2.34
list(APPEND CLIENT_LIBRARIES rt)
list(APPEND SERVER_LIBRARIES rt)
endif()
+55
View File
@@ -0,0 +1,55 @@
# MSVC compiler specific settings
if(NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC")
return()
endif()
include(utils/arch)
#enable_language(ASM_MASM)
set(ASM_SOURCES
${SOURCE_DIR}/asm/snapvector.asm
${SOURCE_DIR}/asm/ftola.asm
)
if(ARCH MATCHES "x86_64")
list(APPEND ASM_SOURCES ${SOURCE_DIR}/asm/vm_x86_64.asm)
set_source_files_properties(
${ASM_SOURCES}
PROPERTIES COMPILE_DEFINITIONS "idx64")
endif()
# Baseline warnings
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/W4>")
# C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data
# There are way too many of these to realistically deal with them
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4267>")
# C4206: nonstandard extension used: translation unit is empty
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4206>")
# C4324: 'struct': structure was padded due to alignment specifier
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4324>")
# C4200: nonstandard extension used: zero-sized array in struct/union
add_compile_options("$<$<COMPILE_LANGUAGE:C>:/wd4200>")
# MSVC doesn't understand __inline__, which libjpeg uses
add_compile_definitions(__inline__=inline)
# It's unlikely that we'll move to the _s variants, so stop the warning
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
# The sockets platform abstraction layer necessarily uses deprecated APIs
add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS)
#
# Microsoft compiler specific parameters
#
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE)
# Treat no return type as error
add_compile_options(/we4715)
+1
View File
@@ -0,0 +1 @@
include(deploy/unix)
+28
View File
@@ -0,0 +1,28 @@
if(NOT APPLE)
# 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 ${INSTALL_DATADIR_FULL}/applications)
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaab.desktop DESTINATION ${INSTALL_DATADIR_FULL}/applications)
install(FILES ${CMAKE_BINARY_DIR}/misc/linux/org.openmoh.openmohaas.desktop DESTINATION ${INSTALL_DATADIR_FULL}/applications)
install(FILES misc/linux/org.openmoh.openmohaa.metainfo.xml DESTINATION ${INSTALL_DATADIR_FULL}/metainfo)
install(FILES misc/openmohaa.svg DESTINATION ${INSTALL_DATADIR_FULL}/icons/hicolor/symbolic/apps/ RENAME org.openmoh.openmohaa.svg)
endif()
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
+62
View File
@@ -0,0 +1,62 @@
include_directories(${SOURCE_DIR}/gamespy/common)
include_directories(${SOURCE_DIR}/gamespy/gcdkey)
file(GLOB SRCS_common
${SOURCE_DIR}/gamespy/common/*.c
${SOURCE_DIR}/gamespy/darray.c
${SOURCE_DIR}/gamespy/gserver.c
${SOURCE_DIR}/gamespy/gserverlist.c
${SOURCE_DIR}/gamespy/hashtable.c
${SOURCE_DIR}/gamespy/md5c.c
${SOURCE_DIR}/gamespy/gutil.c
)
file(GLOB SRCS_gcdkey
${SOURCE_DIR}/gamespy/gcdkey/*.c
)
file(GLOB SRCS_natneg
${SOURCE_DIR}/gamespy/natneg/*.c
)
file(GLOB SRCS_qr2
${SOURCE_DIR}/gamespy/qr2/*.c
)
add_library(gcd_common STATIC ${SRCS_common})
add_library(gcd_key STATIC ${SRCS_gcdkey})
add_library(gcd_natneg STATIC ${SRCS_natneg})
add_library(gcd_qr2 STATIC ${SRCS_qr2})
add_library(gcd INTERFACE)
set_property(TARGET gcd_common gcd_key PROPERTY POSITION_INDEPENDENT_CODE ON)
if(UNIX)
add_definitions(-D_LINUX=1)
endif()
set(DEPENDENT_LIBS
gcd_key
# gcd_gp
# gcd_gstats
gcd_natneg
# gcd_pinger
# gcd_pt
gcd_qr2
# gcd_sake
# gcd_sc
# gcd_serverbrowsing
# gcd_webservices
)
target_link_libraries(gcd INTERFACE ${DEPENDENT_LIBS})
foreach(LIB ${DEPENDENT_LIBS})
target_link_libraries(${LIB} PUBLIC gcd_common)
endforeach()
target_link_libraries(gcd_key PRIVATE gcd_qr2)
target_link_libraries(gcd_qr2 PRIVATE gcd_natneg)
list(APPEND CLIENT_LIBRARIES gcd)
list(APPEND SERVER_LIBRARIES gcd)
+21
View File
@@ -0,0 +1,21 @@
set(PROJECT_NAME openmohaa)
set(PROJECT_VERSION 0.83.0)
set(SERVER_NAME omohaaded)
set(CLIENT_NAME openmohaa)
set(BASEGAME)
set(CGAME_MODULE cgame)
set(GAME_MODULE game)
set(UI_MODULE ui)
set(WINDOWS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/windows/openmohaa.ico)
set(MACOS_ICON_PATH ${CMAKE_SOURCE_DIR}/misc/macos/openmohaa.icns)
set(MACOS_BUNDLE_ID org.openmohaa.${CLIENT_NAME})
set(COPYRIGHT "OpenMoHAA Copyright © 2025 OpenMoHAA Team, Inc. All rights reserved.")
set(CONTACT_EMAIL "")
set(PROTOCOL_HANDLER_SCHEME openmohaa)
+30
View File
@@ -0,0 +1,30 @@
get_directory_property(INSTALL_TARGETS DIRECTORY
${CMAKE_SOURCE_DIR} BUILDSYSTEM_TARGETS)
# Iterate over all the targets that have an INSTALL_DESTINATION
# property (set by set_output_dirs) and call install() on them
foreach(TARGET IN LISTS INSTALL_TARGETS)
get_target_property(DESTINATION ${TARGET} INSTALL_DESTINATION)
if(NOT DESTINATION)
continue()
endif()
install(TARGETS ${TARGET}
RUNTIME DESTINATION ${DESTINATION}
LIBRARY DESTINATION ${DESTINATION}
BUNDLE DESTINATION ${DESTINATION}
ARCHIVE EXCLUDE_FROM_ALL)
endforeach()
if(NOT CPACK_GENERATOR)
return()
endif()
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME})
set(CPACK_PACKAGE_EXECUTABLES ${CLIENT_NAME} ${PROJECT_NAME})
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PRODUCT_VERSION})
set(CPACK_PACKAGE_CONTACT ${CONTACT_EMAIL})
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING.txt)
include(CPack)
@@ -1,32 +1,28 @@
cmake_minimum_required(VERSION 3.12)
project(Launcher)
set(LAUNCHER_SOURCES "${CMAKE_SOURCE_DIR}/code/Launcher/launch_main.cpp")
set(LAUNCHER_SOURCES "${SOURCE_DIR}/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")
list(APPEND LAUNCHER_SOURCES
${SOURCE_DIR}/Launcher/launch_win32.cpp
${SOURCE_DIR}/sys/win_resource.rc
)
else()
set(LAUNCHER_SOURCES ${LAUNCHER_SOURCES}
"${CMAKE_SOURCE_DIR}/code/Launcher/launch_linux.cpp")
list(APPEND LAUNCHER_SOURCES
${SOURCE_DIR}/Launcher/launch_linux.cpp
)
endif()
function (create_launcher name type)
if (NOT BUILD_NO_CLIENT)
if (BUILD_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}")
set_target_properties(openmohaa_launcher_${name} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
INSTALL(TARGETS openmohaa_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR})
INSTALL(TARGETS openmohaa_launcher_${name} DESTINATION ${INSTALL_BINDIR_FULL})
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}")
+12
View File
@@ -0,0 +1,12 @@
include(libraries/curl)
include(libraries/freetype)
include(libraries/jpeg)
include(libraries/ogg)
include(libraries/opus)
include(libraries/openal)
include(libraries/sdl)
include(libraries/vorbis)
include(libraries/zlib)
include(libraries/libmad)
include(libraries/flex_bison)
include(libraries/recastnavigation)
+19
View File
@@ -0,0 +1,19 @@
if(NOT USE_HTTP)
return()
endif()
set(INTERNAL_CURL_DIR ${SOURCE_DIR}/thirdparty/curl-8.15.0/include)
find_package(CURL QUIET)
if(NOT CURL_FOUND)
set(CURL_DEFINITIONS USE_INTERNAL_CURL_HEADERS)
set(CURL_INCLUDE_DIRS ${INTERNAL_CURL_DIR})
endif()
list(APPEND CLIENT_DEFINITIONS ${CURL_DEFINITIONS})
list(APPEND CLIENT_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
# For some functions like update checker
list(APPEND SERVER_DEFINITIONS ${CURL_DEFINITIONS})
list(APPEND SERVER_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
+18
View File
@@ -0,0 +1,18 @@
#
# Workaround to get a recent version Flex and Bison executables in MacOS
# as Bison 2.3 shipped with MacOS doesn't work
#
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
execute_process(COMMAND brew --prefix bison RESULT_VARIABLE APP_RESULT OUTPUT_VARIABLE APP_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
if (APP_RESULT EQUAL 0 AND EXISTS "${APP_PREFIX}")
set(BISON_EXECUTABLE "${APP_PREFIX}/bin/bison")
endif()
execute_process(COMMAND brew --prefix flex RESULT_VARIABLE APP_RESULT OUTPUT_VARIABLE APP_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
if (APP_RESULT EQUAL 0 AND EXISTS "${APP_PREFIX}")
set(FLEX_EXECUTABLE "${APP_PREFIX}/bin/flex")
endif()
endif()
find_package(BISON 3 REQUIRED)
find_package(FLEX REQUIRED)
+12
View File
@@ -0,0 +1,12 @@
if(NOT USE_FREETYPE)
return()
endif()
if(NOT BUILD_RENDERER_GL1 AND NOT BUILD_RENDERER_GL2)
return()
endif()
find_package(Freetype REQUIRED)
list(APPEND RENDERER_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
list(APPEND RENDERER_LIBRARIES ${FREETYPE_LIBRARIES})
+22
View File
@@ -0,0 +1,22 @@
if(NOT BUILD_RENDERER_GL1 AND NOT BUILD_RENDERER_GL2)
return()
endif()
include(utils/disable_warnings)
include(utils/find_include_dirs)
set(INTERNAL_JPEG_DIR ${SOURCE_DIR}/thirdparty/jpeg-9f)
if(USE_INTERNAL_JPEG)
file(GLOB_RECURSE JPEG_SOURCES ${INTERNAL_JPEG_DIR}/j*.c)
disable_warnings(${JPEG_SOURCES})
find_include_dirs(JPEG_INCLUDE_DIRS ${INTERNAL_JPEG_DIR})
set(JPEG_DEFINITIONS USE_INTERNAL_JPEG)
list(APPEND RENDERER_LIBRARY_SOURCES ${JPEG_SOURCES})
else()
find_package(JPEG REQUIRED)
endif()
list(APPEND RENDERER_LIBRARIES ${JPEG_LIBRARIES})
list(APPEND RENDERER_INCLUDE_DIRS ${JPEG_INCLUDE_DIRS})
list(APPEND RENDERER_DEFINITIONS ${JPEG_DEFINTIONS})
+33
View File
@@ -0,0 +1,33 @@
if(NOT USE_CODEC_MAD)
return()
endif()
if(NOT BUILD_CLIENT)
return()
endif()
set(OLD_VALUE ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
if(USE_INTERNAL_MAD)
add_subdirectory("${SOURCE_DIR}/thirdparty/libmad" "./libmad" EXCLUDE_FROM_ALL)
list(APPEND CLIENT_LIBRARIES 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
)
list(APPEND CLIENT_INCLUDE_DIRS ${LIBMAD_INCLUDE_DIRS})
list(APPEND CLIENT_LIBRARIES ${LIBMAD_LIBRARIES})
endif()
set(BUILD_SHARED_LIBS ${OLD_VALUE} CACHE BOOL "" FORCE)
list(APPEND CLIENT_DEFINITIONS USE_CODEC_MAD=1)
+25
View File
@@ -0,0 +1,25 @@
if(NOT USE_CODEC_VORBIS)
return()
endif()
if(NOT BUILD_CLIENT)
return()
endif()
include(utils/disable_warnings)
set(INTERNAL_OGG_DIR ${SOURCE_DIR}/thirdparty/libogg-1.3.6)
if(USE_INTERNAL_OGG)
file(GLOB_RECURSE OGG_SOURCES ${INTERNAL_OGG_DIR}/*.c)
disable_warnings(${OGG_SOURCES})
set(OGG_INCLUDE_DIRS ${INTERNAL_OGG_DIR}/include)
list(APPEND CLIENT_LIBRARY_SOURCES ${OGG_SOURCES})
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(OGG REQUIRED ogg)
endif()
list(APPEND CLIENT_LIBRARIES ${OGG_LIBRARIES})
list(APPEND CLIENT_INCLUDE_DIRS ${OGG_INCLUDE_DIRS})
list(APPEND CLIENT_DEFINITIONS ${OGG_DEFINITIONS})
+27
View File
@@ -0,0 +1,27 @@
if(NOT USE_OPENAL)
return()
endif()
if(NOT BUILD_CLIENT)
return()
endif()
set(INTERNAL_OPENAL_DIR ${SOURCE_DIR}/thirdparty/openal-soft-1.24.3)
find_package(OpenAL QUIET)
if(NOT OpenAL_FOUND)
set(OPENAL_DEFINITIONS USE_INTERNAL_OPENAL_HEADERS)
set(OPENAL_INCLUDE_DIR ${INTERNAL_OPENAL_DIR}/include)
set(OPENAL_LIBRARY openal)
endif()
list(APPEND CLIENT_DEFINITIONS ${OPENAL_DEFINITIONS} USE_OPENAL)
list(APPEND CLIENT_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR})
if(USE_OPENAL_DLOPEN)
list(APPEND CLIENT_DEFINITIONS USE_OPENAL_DLOPEN)
else()
find_package(Threads REQUIRED)
list(APPEND CLIENT_LIBRARIES Threads::Threads ${OPENAL_LIBRARY})
endif()
+31
View File
@@ -0,0 +1,31 @@
if(NOT USE_CODEC_OPUS)
return()
endif()
if(NOT BUILD_CLIENT)
return()
endif()
include(utils/disable_warnings)
include(utils/find_include_dirs)
set(INTERNAL_OPUS_DIR ${SOURCE_DIR}/thirdparty/opus-1.5.2)
set(INTERNAL_OPUSFILE_DIR ${SOURCE_DIR}/thirdparty/opusfile-0.12)
if(USE_INTERNAL_OPUS)
file(GLOB_RECURSE OPUS_SOURCES ${INTERNAL_OPUS_DIR}/*.c)
file(GLOB_RECURSE OPUSFILE_SOURCES ${INTERNAL_OPUSFILE_DIR}/*.c)
disable_warnings(${OPUS_SOURCES} ${OPUSFILE_SOURCES})
find_include_dirs(OPUS_INCLUDE_DIRS ${INTERNAL_OPUS_DIR})
find_include_dirs(OPUSFILE_INCLUDE_DIRS ${INTERNAL_OPUSFILE_DIR})
set(OPUS_DEFINITIONS OPUS_BUILD HAVE_LRINTF FLOATING_POINT FLOAT_APPROX USE_ALLOCA)
list(APPEND CLIENT_LIBRARY_SOURCES ${OPUS_SOURCES} ${OPUSFILE_SOURCES})
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPUS REQUIRED opus)
pkg_check_modules(OPUSFILE REQUIRED opusfile)
endif()
list(APPEND CLIENT_LIBRARIES ${OPUS_LIBRARIES} ${OPUSFILE_LIBRARIES})
list(APPEND CLIENT_INCLUDE_DIRS ${OPUS_INCLUDE_DIRS} ${OPUSFILE_INCLUDE_DIRS})
list(APPEND CLIENT_DEFINITIONS USE_CODEC_OPUS ${OPUS_DEFINITIONS} ${OPUSFILE_DEFINITIONS})
+9
View File
@@ -0,0 +1,9 @@
# Recast navigation
add_subdirectory(${SOURCE_DIR}/thirdparty/recastnavigation/Detour recastnav_detour)
add_subdirectory(${SOURCE_DIR}/thirdparty/recastnavigation/DetourCrowd recastnav_crowd)
add_subdirectory(${SOURCE_DIR}/thirdparty/recastnavigation/Recast recacstnav_recast)
# Enable position independant code on recast navigation libraries.
# Otherwise linking will fail relocating some functions on Linux
set_property(TARGET Detour DetourCrowd Recast PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(Detour DetourCrowd Recast PROPERTIES LINKER_LANGUAGE CXX)
+64
View File
@@ -0,0 +1,64 @@
if(NOT BUILD_CLIENT)
return()
endif()
if(EMSCRIPTEN)
# Emscripten provides its own self contained SDL setup
list(APPEND CLIENT_COMPILE_OPTIONS -sUSE_SDL=2)
list(APPEND CLIENT_LINK_OPTIONS -sUSE_SDL=2)
return()
endif()
set(INTERNAL_SDL_DIR ${SOURCE_DIR}/thirdparty/SDL2-2.32.8)
include(utils/arch)
if(WIN32 OR APPLE)
# On Windows and macOS we have internal SDL binaries we can use
set(HAVE_INTERNAL_SDL true)
endif()
if(USE_INTERNAL_SDL AND HAVE_INTERNAL_SDL)
set(SDL2_INCLUDE_DIRS ${INTERNAL_SDL_DIR}/include)
list(APPEND CLIENT_DEFINITIONS USE_INTERNAL_SDL_HEADERS)
list(APPEND RENDERER_DEFINITIONS USE_INTERNAL_SDL_HEADERS)
if(WIN32)
if(ARCH STREQUAL "x86_64")
set(LIB_DIR ${SOURCE_DIR}/thirdparty/libs/win64)
elseif(ARCH STREQUAL "x86")
set(LIB_DIR ${SOURCE_DIR}/thirdparty/libs/win32)
else()
message(FATAL_ERROR "Unknown ARCH")
endif()
if(MINGW)
set(SDL2_LIBRARIES
${LIB_DIR}/libSDL2main.a
${LIB_DIR}/libSDL2.dll.a)
elseif(MSVC)
set(SDL2_LIBRARIES
${LIB_DIR}/SDL2main.lib
${LIB_DIR}/SDL2.lib)
endif()
list(APPEND CLIENT_DEPLOY_LIBRARIES ${LIB_DIR}/SDL2.dll)
elseif(APPLE)
set(SDL2_LIBRARIES
${SOURCE_DIR}/thirdparty/libs/macos/libSDL2main.a
${SOURCE_DIR}/thirdparty/libs/macos/libSDL2-2.0.0.dylib)
list(APPEND CLIENT_DEPLOY_LIBRARIES
${SOURCE_DIR}/thirdparty/libs/macos/libSDL2-2.0.0.dylib)
else()
message(FATAL_ERROR "HAVE_INTERNAL_SDL set incorrectly; file a bug")
endif()
else()
find_package(SDL2 REQUIRED)
endif()
list(APPEND CLIENT_LIBRARIES ${SDL2_LIBRARIES})
list(APPEND CLIENT_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
list(APPEND CLIENT_COMPILE_OPTIONS ${SDL2_CFLAGS_OTHER})
list(APPEND RENDERER_LIBRARIES ${SDL2_LIBRARIES})
list(APPEND RENDERER_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS})
list(APPEND RENDERER_COMPILE_OPTIONS ${SDL2_CFLAGS_OTHER})
+26
View File
@@ -0,0 +1,26 @@
if(NOT USE_CODEC_VORBIS)
return()
endif()
if(NOT BUILD_CLIENT)
return()
endif()
include(utils/disable_warnings)
set(INTERNAL_VORBIS_DIR ${SOURCE_DIR}/thirdparty/libvorbis-1.3.7)
if(USE_INTERNAL_VORBIS)
file(GLOB_RECURSE VORBIS_SOURCES ${INTERNAL_VORBIS_DIR}/*.c)
disable_warnings(${VORBIS_SOURCES})
set(VORBIS_INCLUDE_DIRS ${INTERNAL_VORBIS_DIR}/include ${INTERNAL_VORBIS_DIR}/lib)
list(APPEND CLIENT_LIBRARY_SOURCES ${VORBIS_SOURCES})
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(VORBIS REQUIRED vorbis)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
endif()
list(APPEND CLIENT_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISFILE_LIBRARIES})
list(APPEND CLIENT_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS} ${VORBISFILE_INCLUDE_DIRS})
list(APPEND CLIENT_DEFINITIONS USE_CODEC_VORBIS ${VORBIS_DEFINITIONS} ${VORBISFILE_DEFINITIONS})
+22
View File
@@ -0,0 +1,22 @@
include(utils/disable_warnings)
include(utils/find_include_dirs)
set(INTERNAL_ZLIB_DIR ${SOURCE_DIR}/thirdparty/zlib-1.3.1)
if(USE_INTERNAL_ZLIB)
file(GLOB_RECURSE ZLIB_SOURCES ${INTERNAL_ZLIB_DIR}/*.c)
disable_warnings(${ZLIB_SOURCES})
find_include_dirs(ZLIB_INCLUDE_DIRS ${INTERNAL_ZLIB_DIR})
set(ZLIB_DEFINITIONS NO_GZIP)
list(APPEND SERVER_LIBRARY_SOURCES ${ZLIB_SOURCES})
list(APPEND CLIENT_LIBRARY_SOURCES ${ZLIB_SOURCES})
else()
find_package(ZLIB REQUIRED)
endif()
list(APPEND SERVER_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND SERVER_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
list(APPEND SERVER_DEFINITIONS ${ZLIB_DEFINITIONS})
list(APPEND CLIENT_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND CLIENT_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
list(APPEND CLIENT_DEFINITIONS ${ZLIB_DEFINITIONS})
+75
View File
@@ -0,0 +1,75 @@
if(NOT BUILD_GAME_LIBRARIES AND NOT BUILD_GAME_QVMS)
return()
endif()
include(utils/qvm_tools)
include(utils/set_output_dirs)
set(MPCGAME_SOURCES
${SOURCE_DIR}/cgame/cg_newdraw.c
${SOURCE_DIR}/ui/ui_shared.c
)
set(MPUI_SOURCES
${SOURCE_DIR}/ui/ui_main.c
${SOURCE_DIR}/ui/ui_atoms.c
${SOURCE_DIR}/ui/ui_gameinfo.c
${SOURCE_DIR}/ui/ui_players.c
${SOURCE_DIR}/ui/ui_shared.c
${SOURCE_DIR}/game/bg_misc.c
${SOURCE_DIR}/game/bg_lib.c
)
set(MISSIONPACK "missionpack")
set(CGAME_SOURCES_MISSIONPACK ${CGAME_SOURCES} ${MPCGAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
set(GAME_SOURCES_MISSIONPACK ${GAME_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
set(UI_SOURCES_MISSIONPACK ${MPUI_SOURCES} ${GAME_MODULE_SHARED_SOURCES})
if(BUILD_GAME_LIBRARIES)
set(CGAME_MODULE_BINARY_MISSIONPACK ${CGAME_MODULE_BINARY}_${MISSIONPACK})
set(GAME_MODULE_BINARY_MISSIONPACK ${GAME_MODULE_BINARY}_${MISSIONPACK})
set(UI_MODULE_BINARY_MISSIONPACK ${UI_MODULE_BINARY}_${MISSIONPACK})
add_library( ${CGAME_MODULE_BINARY_MISSIONPACK} SHARED ${CGAME_SOURCES_MISSIONPACK} ${CGAME_BINARY_SOURCES})
target_compile_definitions( ${CGAME_MODULE_BINARY_MISSIONPACK} PRIVATE CGAME MISSIONPACK)
target_link_libraries( ${CGAME_MODULE_BINARY_MISSIONPACK} PRIVATE ${COMMON_LIBRARIES})
set_target_properties( ${CGAME_MODULE_BINARY_MISSIONPACK} PROPERTIES OUTPUT_NAME ${CGAME_MODULE_BINARY})
set_output_dirs( ${CGAME_MODULE_BINARY_MISSIONPACK} SUBDIRECTORY ${MISSIONPACK})
add_library( ${GAME_MODULE_BINARY_MISSIONPACK} SHARED ${GAME_SOURCES_MISSIONPACK} ${GAME_BINARY_SOURCES})
target_compile_definitions( ${GAME_MODULE_BINARY_MISSIONPACK} PRIVATE QAGAME MISSIONPACK)
target_link_libraries( ${GAME_MODULE_BINARY_MISSIONPACK} PRIVATE ${COMMON_LIBRARIES})
set_target_properties( ${GAME_MODULE_BINARY_MISSIONPACK} PROPERTIES OUTPUT_NAME ${GAME_MODULE_BINARY})
set_output_dirs( ${GAME_MODULE_BINARY_MISSIONPACK} SUBDIRECTORY ${MISSIONPACK})
add_library( ${UI_MODULE_BINARY_MISSIONPACK} SHARED ${UI_SOURCES_MISSIONPACK} ${UI_BINARY_SOURCES})
target_compile_definitions( ${UI_MODULE_BINARY_MISSIONPACK} PRIVATE UI MISSIONPACK)
target_link_libraries( ${UI_MODULE_BINARY_MISSIONPACK} PRIVATE ${COMMON_LIBRARIES})
set_target_properties( ${UI_MODULE_BINARY_MISSIONPACK} PROPERTIES OUTPUT_NAME ${UI_MODULE_BINARY})
set_output_dirs( ${UI_MODULE_BINARY_MISSIONPACK} SUBDIRECTORY ${MISSIONPACK})
endif()
if(BUILD_GAME_QVMS)
set(CGAME_MODULE_QVM_MISSIONPACK ${CGAME_MODULE}qvm_${MISSIONPACK})
set(GAME_MODULE_QVM_MISSIONPACK ${GAME_MODULE}qvm_${MISSIONPACK})
set(UI_MODULE_QVM_MISSIONPACK ${UI_MODULE}qvm_${MISSIONPACK})
add_qvm(${CGAME_MODULE_QVM_MISSIONPACK}
DEFINITIONS CGAME MISSIONPACK
OUTPUT_NAME ${CGAME_MODULE}
OUTPUT_DIRECTORY ${MISSIONPACK}/vm
SOURCES ${CGAME_SOURCES_MISSIONPACK} ${CGAME_QVM_SOURCES})
add_qvm(${GAME_MODULE_QVM_MISSIONPACK}
DEFINITIONS QAGAME MISSIONPACK
OUTPUT_NAME ${GAME_MODULE}
OUTPUT_DIRECTORY ${MISSIONPACK}/vm
SOURCES ${GAME_SOURCES_MISSIONPACK} ${GAME_QVM_SOURCES})
add_qvm(${UI_MODULE_QVM_MISSIONPACK}
DEFINITIONS UI MISSIONPACK
OUTPUT_NAME ${UI_MODULE}
OUTPUT_DIRECTORY ${MISSIONPACK}/vm
SOURCES ${UI_SOURCES_MISSIONPACK} ${UI_QVM_SOURCES})
endif()
+20
View File
@@ -0,0 +1,20 @@
include(platforms/emscripten)
include(platforms/linux)
include(platforms/macos)
include(platforms/unix)
include(platforms/windows)
if(DEBUG_MEMORY)
add_definitions(-D_DEBUG_MEM)
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)
cmake_path(SET INSTALL_BINDIR_FULL NORMALIZE "${CMAKE_INSTALL_BINDIR}/${BIN_INSTALL_SUBDIR}")
cmake_path(SET INSTALL_LIBDIR_FULL NORMALIZE "${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR}")
cmake_path(SET INSTALL_DATADIR_FULL NORMALIZE "${CMAKE_INSTALL_DATADIR}")
+51
View File
@@ -0,0 +1,51 @@
# Emscripten specific settings
if(NOT EMSCRIPTEN)
return()
endif()
set(CMAKE_EXECUTABLE_SUFFIX ".js")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".wasm")
# Disable options that don't make sense for emscripten
set(BUILD_SERVER OFF CACHE INTERNAL "")
set(BUILD_RENDERER_GL1 OFF CACHE INTERNAL "")
set(USE_RENDERER_DLOPEN OFF CACHE INTERNAL "")
set(USE_OPENAL_DLOPEN OFF CACHE INTERNAL "")
set(BUILD_GAME_LIBRARIES OFF CACHE INTERNAL "")
set(USE_HTTP OFF CACHE INTERNAL "")
# Disable LTO since the libraries Emscripten provides aren't LTO enabled
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
list(APPEND CLIENT_LINK_OPTIONS
-sTOTAL_MEMORY=256MB
-sSTACK_SIZE=5MB
-sMIN_WEBGL_VERSION=1
-sMAX_WEBGL_VERSION=2
-sEXPORTED_RUNTIME_METHODS=FS,addRunDependency,removeRunDependency
-sEXIT_RUNTIME=1
-sEXPORT_ES6
-sEXPORT_NAME=${CLIENT_NAME}
)
option(EMSCRIPTEN_PRELOAD_FILE "Preload game files into .data file" OFF)
if(EMSCRIPTEN_PRELOAD_FILE)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/${BASEGAME}")
message(FATAL_ERROR "No files in '${BASEGAME}' directory for emscripten to preload.")
endif()
list(APPEND CLIENT_LINK_OPTIONS --preload-file "${BASEGAME}")
endif()
list(APPEND POST_CONFIGURE_FUNCTIONS deploy_shell_files)
function(deploy_shell_files)
configure_file(${SOURCE_DIR}/web/client.html.in
${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CLIENT_NAME}.html @ONLY)
if(NOT EMSCRIPTEN_PRELOAD_FILE)
configure_file(${SOURCE_DIR}/web/client-config.json
${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CLIENT_NAME}-config.json COPYONLY)
endif()
endfunction()
+15
View File
@@ -0,0 +1,15 @@
# Linux-like specific settings, i.e. including FreeBSD etc.
if(NOT UNIX OR APPLE)
return()
endif()
list(APPEND CLIENT_DEFINITIONS USE_ICON)
list(APPEND RENDERER_DEFINITIONS USE_ICON)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE /opt/mohaa)
endif()
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
+118
View File
@@ -0,0 +1,118 @@
# macOS specific settings
if(NOT APPLE)
return()
endif()
option(BUILD_MACOS_APP "Deploy as a macOS .app" ON)
enable_language(OBJC)
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/sys_osx.m)
list(APPEND COMMON_LIBRARIES "-framework Cocoa")
list(APPEND CLIENT_LIBRARIES "-framework IOKit")
list(APPEND RENDERER_LIBRARIES "-framework OpenGL")
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
set(CMAKE_OSX_ARCHITECTURES arm64;x86_64)
if(BUILD_MACOS_APP)
set(CLIENT_EXECUTABLE_OPTIONS MACOSX_BUNDLE)
list(APPEND POST_CONFIGURE_FUNCTIONS finish_macos_app)
endif()
function(finish_macos_app)
get_filename_component(MACOS_ICON_FILE ${MACOS_ICON_PATH} NAME)
set(MACOS_APP_BUNDLE_NAME ${CLIENT_NAME})
set(MACOS_APP_EXECUTABLE_NAME ${CLIENT_BINARY})
set(MACOS_APP_GUI_IDENTIFIER ${MACOS_BUNDLE_ID})
set(MACOS_APP_ICON_FILE ${MACOS_ICON_FILE})
set(MACOS_APP_SHORT_VERSION_STRING ${PRODUCT_VERSION})
set(MACOS_APP_BUNDLE_VERSION ${PRODUCT_VERSION})
set(MACOS_APP_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
set(MACOS_APP_COPYRIGHT ${COPYRIGHT})
if(PROTOCOL_HANDLER_SCHEME)
set(MACOS_APP_PLIST_URL_TYPES
"<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>${MACOS_APP_BUNDLE_NAME}</string>
<key>CFBundleURLSchemes</key>
<array>
<string>${PROTOCOL_HANDLER_SCHEME}</string>
</array>
</dict>
</array>")
else()
set(MACOS_APP_PLIST_URL_TYPES "")
endif()
configure_file(${CMAKE_SOURCE_DIR}/cmake/Info.plist.in
${CMAKE_BINARY_DIR}/Info.plist @ONLY)
set_target_properties(${CLIENT_BINARY} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/Info.plist)
set(RESOURCES_DIR $<TARGET_FILE_DIR:${CLIENT_BINARY}>/../Resources)
add_custom_command(TARGET ${CLIENT_BINARY} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${RESOURCES_DIR}
COMMAND ${CMAKE_COMMAND} -E copy ${MACOS_ICON_PATH} ${RESOURCES_DIR})
if(USE_RENDERER_DLOPEN)
set(MACOS_APP_BINARY_DIR ${CLIENT_BINARY}.app/Contents/MacOS)
if(BUILD_RENDERER_GL1)
set_output_dirs(${RENDERER_GL1_BINARY} SUBDIRECTORY ${MACOS_APP_BINARY_DIR})
add_dependencies(${CLIENT_BINARY} ${RENDERER_GL1_BINARY})
endif()
if(BUILD_RENDERER_GL2)
set_output_dirs(${RENDERER_GL2_BINARY} SUBDIRECTORY ${MACOS_APP_BINARY_DIR})
add_dependencies(${CLIENT_BINARY} ${RENDERER_GL2_BINARY})
endif()
endif()
endfunction()
if(NOT "$ENV{APPLE_CERTIFICATE_ID}" STREQUAL "")
list(APPEND POST_CONFIGURE_FUNCTIONS codesign)
function(codesign)
set(DEV_ID "Developer ID Application")
get_directory_property(INSTALL_TARGETS DIRECTORY
${CMAKE_SOURCE_DIR} BUILDSYSTEM_TARGETS)
# Code sign everything that will be installed
foreach(TARGET IN LISTS INSTALL_TARGETS)
get_target_property(DESTINATION ${TARGET} INSTALL_DESTINATION)
if(NOT DESTINATION)
continue()
endif()
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND codesign --force --deep --options runtime
--entitlements ${CMAKE_SOURCE_DIR}/cmake/entitlements.plist
--sign "$ENV{APPLE_CERTIFICATE_ID}"
"$<TARGET_FILE:${TARGET}>"
COMMENT "Code Signing for macOS: $<TARGET_FILE_BASE_NAME:${TARGET}>")
endforeach()
endfunction()
endif()
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_VOLUME_NAME "${PROJECT_NAME} Installer")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/misc/macos/macos-dmg-background.png")
set(CPACK_DMG_SUBDIRECTORY "${CLIENT_NAME}")
configure_file(
"${CMAKE_SOURCE_DIR}/misc/macos/macos-dmg-setup.applescript.in"
"${CMAKE_BINARY_DIR}/macos-dmg-setup.applescript"
@ONLY
)
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_BINARY_DIR}/macos-dmg-setup.applescript")
+34
View File
@@ -0,0 +1,34 @@
# Unix specific settings (this includes macOS and emscripten)
if(NOT UNIX)
return()
endif()
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/sys_unix.c)
if(EMSCRIPTEN)
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_passive.c)
else()
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_tty.c)
endif()
#if(USE_HTTP)
# list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/client/cl_http_curl.c)
#endif()
list(APPEND COMMON_LIBRARIES
${CMAKE_DL_LIBS} # Dynamic loader
m # Math library
)
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/new/sys_unix_new.c)
find_package(Threads)
list(APPEND COMMON_LIBRARIES ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
#
# Setup the installation directory
#
set(CMAKE_DEFAULT_INSTALL_RUNTIME_DIR lib${CMAKE_LIB_SUFFIX})
set(BIN_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
set(LIB_INSTALL_SUBDIR ${CMAKE_PROJECT_NAME})
+73
View File
@@ -0,0 +1,73 @@
# Windows specific settings
if(NOT WIN32)
return()
endif()
list(APPEND SYSTEM_PLATFORM_SOURCES
${SOURCE_DIR}/sys/sys_win32.c
${SOURCE_DIR}/sys/win_resource.rc
)
list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_passive.c)
list(APPEND SERVER_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_win32.c)
#if(USE_HTTP)
# list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/client/cl_http_windows.c)
# list(APPEND CLIENT_LIBRARIES wininet)
#endif()
list(APPEND COMMON_LIBRARIES
ws2_32 # Windows Sockets 2
winmm # timeBeginPeriod/timeEndPeriod
psapi # EnumProcesses
)
if(MINGW)
list(APPEND COMMON_LIBRARIES mingw32)
endif()
list(APPEND CLIENT_DEFINITIONS USE_ICON)
set_source_files_properties(${SOURCE_DIR}/sys/win_resource.rc
PROPERTIES COMPILE_DEFINITIONS WINDOWS_ICON_PATH=${WINDOWS_ICON_PATH})
if(MSVC)
# We have our own manifest, disable auto creation
list(APPEND SERVER_LINK_OPTIONS "/MANIFEST:NO")
list(APPEND CLIENT_LINK_OPTIONS "/MANIFEST:NO")
endif()
set(CLIENT_EXECUTABLE_OPTIONS WIN32)
# It's only necessary to set this on Windows; elsewhere
# CMAKE_EXECUTABLE_SUFFIX will be empty anyway, or we want
# HOST_EXECUTABLE_SUFFIX to be empty for other reasons
set(HOST_EXECUTABLE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
set(CPACK_GENERATOR NSIS)
set(CPACK_NSIS_MUI_ICON ${WINDOWS_ICON_PATH})
set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
#
# non-ioq3
#
if(CMAKE_BUILD_TYPE MATCHES Debug|RelWithDebInfo)
# Enable the console in debug builds
list(REMOVE_ITEM CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_passive.c)
list(APPEND CLIENT_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_win32.c)
set(CLIENT_EXECUTABLE_OPTIONS)
endif()
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/new/sys_win32_new.c)
list(APPEND COMMON_LIBRARIES dbghelp)
#
# Setup the installation directory
#
# 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 ".")
+3
View File
@@ -0,0 +1,3 @@
foreach(POST_CONFIGURE_FUNCTION IN LISTS POST_CONFIGURE_FUNCTIONS)
cmake_language(CALL ${POST_CONFIGURE_FUNCTION})
endforeach()
@@ -28,4 +28,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define GIT_REVISION_DATE_TIME "${GIT_REVISION_DATE_TIME}"
#define GIT_REVISION_DATE "${GIT_REVISION_DATE}"
#define GIT_REVISION_BUILD_NUMBER ${GIT_REVISION_BUILD_NUMBER}
#define PRODUCT_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}
#define PRODUCT_VERSION_MINOR ${PROJECT_VERSION_MINOR}
#define PRODUCT_VERSION_PATCH ${PROJECT_VERSION_PATCH}
#define PRODUCT_VERSION_STAGE "${PRODUCT_VERSION_STAGE}"
+42
View File
@@ -0,0 +1,42 @@
include_guard(GLOBAL)
set(RENDERER_COMMON_SOURCES
${SOURCE_DIR}/renderercommon/tr_font.c
${SOURCE_DIR}/renderercommon/tr_image_bmp.c
${SOURCE_DIR}/renderercommon/tr_image_jpg.c
${SOURCE_DIR}/renderercommon/tr_image_pcx.c
${SOURCE_DIR}/renderercommon/tr_image_png.c
${SOURCE_DIR}/renderercommon/tr_image_pvr.c
${SOURCE_DIR}/renderercommon/tr_image_tga.c
${SOURCE_DIR}/renderercommon/tr_noise.c
${SOURCE_DIR}/renderercommon/puff.c
${SOURCE_DIR}/tiki/tiki_mesh.cpp
)
set(SDL_RENDERER_SOURCES
${SOURCE_DIR}/sdl/sdl_gamma.c
${SOURCE_DIR}/sdl/sdl_glimp.c
)
set(DYNAMIC_RENDERER_SOURCES
${SOURCE_DIR}/renderercommon/tr_subs.c
${SOURCE_DIR}/qcommon/q_shared.c
${SOURCE_DIR}/qcommon/q_math.c
${SOURCE_DIR}/corepp/str.cpp
)
if(USE_FREETYPE)
list(APPEND RENDERER_DEFINITIONS BUILD_FREETYPE)
endif()
if(USE_RENDERER_DLOPEN)
list(APPEND RENDERER_DEFINITIONS USE_RENDERER_DLOPEN)
list(APPEND RENDERER_DEFINITIONS REF_DLL=1)
elseif(BUILD_RENDERER_GL1 AND BUILD_RENDERER_GL2)
message(FATAL_ERROR "Multiple static renderers enabled; choose one")
elseif(NOT BUILD_RENDERER_GL1 AND NOT BUILD_RENDERER_GL2)
message(FATAL_ERROR "Zero static renderers enabled; choose one")
endif()
list(APPEND RENDERER_LIBRARIES ${COMMON_LIBRARIES})
+70
View File
@@ -0,0 +1,70 @@
if(NOT BUILD_CLIENT OR NOT BUILD_RENDERER_GL1)
return()
endif()
include(utils/set_output_dirs)
include(renderer_common)
set(RENDERER_GL1_SOURCES
${SOURCE_DIR}/renderergl1/tr_backend.c
${SOURCE_DIR}/renderergl1/tr_bsp.c
${SOURCE_DIR}/renderergl1/tr_cmds.c
${SOURCE_DIR}/renderergl1/tr_curve.c
${SOURCE_DIR}/renderergl1/tr_draw.c
${SOURCE_DIR}/renderergl1/tr_flares.c
${SOURCE_DIR}/renderergl1/tr_font.cpp
${SOURCE_DIR}/renderergl1/tr_ghost.cpp
${SOURCE_DIR}/renderergl1/tr_image.c
${SOURCE_DIR}/renderergl1/tr_init.c
${SOURCE_DIR}/renderergl1/tr_light.c
${SOURCE_DIR}/renderergl1/tr_main.c
${SOURCE_DIR}/renderergl1/tr_marks_permanent.c
${SOURCE_DIR}/renderergl1/tr_marks.c
${SOURCE_DIR}/renderergl1/tr_model.cpp
${SOURCE_DIR}/renderergl1/tr_scene.c
${SOURCE_DIR}/renderergl1/tr_shade_calc.c
${SOURCE_DIR}/renderergl1/tr_shade.c
${SOURCE_DIR}/renderergl1/tr_shader.c
${SOURCE_DIR}/renderergl1/tr_shadows.c
${SOURCE_DIR}/renderergl1/tr_sky_portal.cpp
${SOURCE_DIR}/renderergl1/tr_sky.c
${SOURCE_DIR}/renderergl1/tr_sphere_shade.cpp
${SOURCE_DIR}/renderergl1/tr_sprite.c
${SOURCE_DIR}/renderergl1/tr_staticmodels.cpp
${SOURCE_DIR}/renderergl1/tr_sun_flare.cpp
${SOURCE_DIR}/renderergl1/tr_surface.c
${SOURCE_DIR}/renderergl1/tr_swipe.cpp
${SOURCE_DIR}/renderergl1/tr_terrain.c
${SOURCE_DIR}/renderergl1/tr_util.cpp
${SOURCE_DIR}/renderergl1/tr_vis.cpp
${SOURCE_DIR}/renderergl1/tr_world.c
)
set(RENDERER_GL1_BASENAME renderer_opengl1)
set(RENDERER_GL1_BINARY ${RENDERER_GL1_BASENAME})
list(APPEND RENDERER_GL1_BINARY_SOURCES
${RENDERER_COMMON_SOURCES}
${RENDERER_GL1_SOURCES}
${SDL_RENDERER_SOURCES}
${RENDERER_LIBRARY_SOURCES})
if(USE_RENDERER_DLOPEN)
list(APPEND RENDERER_GL1_BINARY_SOURCES ${DYNAMIC_RENDERER_SOURCES})
add_library(${RENDERER_GL1_BINARY} SHARED ${RENDERER_GL1_BINARY_SOURCES})
target_link_libraries( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_LIBRARIES})
target_include_directories( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_INCLUDE_DIRS})
target_compile_definitions( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_DEFINITIONS})
target_compile_options( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_COMPILE_OPTIONS})
target_link_options( ${RENDERER_GL1_BINARY} PRIVATE ${RENDERER_LINK_OPTIONS})
set_output_dirs(${RENDERER_GL1_BINARY})
INSTALL(TARGETS ${RENDERER_GL1_BINARY} DESTINATION ${INSTALL_LIBDIR_FULL})
if(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:${RENDERER_GL1_BINARY}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
endif()
endif()
+106
View File
@@ -0,0 +1,106 @@
if(NOT BUILD_CLIENT OR NOT BUILD_RENDERER_GL2)
return()
endif()
include(utils/set_output_dirs)
include(renderer_common)
set(RENDERER_GL2_SOURCES
${SOURCE_DIR}/renderergl2/tr_animation.c
${SOURCE_DIR}/renderergl2/tr_backend.c
${SOURCE_DIR}/renderergl2/tr_bsp.c
${SOURCE_DIR}/renderergl2/tr_cmds.c
${SOURCE_DIR}/renderergl2/tr_curve.c
${SOURCE_DIR}/renderergl2/tr_draw.c
${SOURCE_DIR}/renderergl2/tr_dsa.c
${SOURCE_DIR}/renderergl2/tr_extramath.c
${SOURCE_DIR}/renderergl2/tr_extensions.c
${SOURCE_DIR}/renderergl2/tr_fbo.c
${SOURCE_DIR}/renderergl2/tr_flares.c
${SOURCE_DIR}/renderergl2/tr_font.cpp
${SOURCE_DIR}/renderergl2/tr_ghost.cpp
${SOURCE_DIR}/renderergl2/tr_glsl.c
${SOURCE_DIR}/renderergl2/tr_image.c
${SOURCE_DIR}/renderergl2/tr_image_dds.c
${SOURCE_DIR}/renderergl2/tr_init.c
${SOURCE_DIR}/renderergl2/tr_light.c
${SOURCE_DIR}/renderergl2/tr_main.c
${SOURCE_DIR}/renderergl2/tr_marks_permanent.c
${SOURCE_DIR}/renderergl2/tr_marks.c
${SOURCE_DIR}/renderergl2/tr_mesh.c
${SOURCE_DIR}/renderergl2/tr_model_iqm.c
${SOURCE_DIR}/renderergl2/tr_model.cpp
${SOURCE_DIR}/renderergl2/tr_postprocess.c
${SOURCE_DIR}/renderergl2/tr_scene.c
${SOURCE_DIR}/renderergl2/tr_shade_calc.c
${SOURCE_DIR}/renderergl2/tr_shade.c
${SOURCE_DIR}/renderergl2/tr_shader.c
${SOURCE_DIR}/renderergl2/tr_shadows.c
${SOURCE_DIR}/renderergl2/tr_sky_portal.cpp
${SOURCE_DIR}/renderergl2/tr_sky.c
${SOURCE_DIR}/renderergl2/tr_sphere_shade.cpp
${SOURCE_DIR}/renderergl2/tr_sprite.c
${SOURCE_DIR}/renderergl2/tr_staticmodels.cpp
${SOURCE_DIR}/renderergl2/tr_sun_flare.cpp
${SOURCE_DIR}/renderergl2/tr_surface.c
${SOURCE_DIR}/renderergl2/tr_swipe.cpp
${SOURCE_DIR}/renderergl2/tr_terrain.c
${SOURCE_DIR}/renderergl2/tr_util.cpp
${SOURCE_DIR}/renderergl2/tr_vbo.c
${SOURCE_DIR}/renderergl2/tr_vis.cpp
${SOURCE_DIR}/renderergl2/tr_world.c
)
file(GLOB RENDERER_GL2_SHADER_SOURCES ${SOURCE_DIR}/renderergl2/glsl/*.glsl)
set(SHADERS_DIR ${CMAKE_BINARY_DIR}/shaders.dir)
file(MAKE_DIRECTORY ${SHADERS_DIR})
foreach(SHADER_FILE IN LISTS RENDERER_GL2_SHADER_SOURCES)
get_filename_component(SHADER_NAME ${SHADER_FILE} NAME_WE)
set(SHADER_C_FILE ${SHADERS_DIR}/${SHADER_NAME}.c)
string(REPLACE "${CMAKE_BINARY_DIR}/" "" SHADER_C_FILE_COMMENT ${SHADER_C_FILE})
add_custom_command(
OUTPUT ${SHADER_C_FILE}
COMMAND ${CMAKE_COMMAND}
-DINPUT_FILE=${SHADER_FILE}
-DOUTPUT_FILE=${SHADER_C_FILE}
-DSHADER_NAME=${SHADER_NAME}
-P ${CMAKE_SOURCE_DIR}/cmake/utils/stringify_shader.cmake
DEPENDS ${SHADER_FILE}
COMMENT "Stringify shader ${SHADER_C_FILE_COMMENT}")
list(APPEND RENDERER_GL2_SHADER_C_SOURCES ${SHADER_C_FILE})
endforeach()
set(RENDERER_GL2_BASENAME renderer_opengl2)
set(RENDERER_GL2_BINARY ${RENDERER_GL2_BASENAME})
list(APPEND RENDERER_GL2_BINARY_SOURCES
${RENDERER_COMMON_SOURCES}
${RENDERER_GL2_SOURCES}
${RENDERER_GL2_SHADER_C_SOURCES}
${SDL_RENDERER_SOURCES}
${RENDERER_LIBRARY_SOURCES})
if(USE_RENDERER_DLOPEN)
list(APPEND RENDERER_GL2_BINARY_SOURCES ${DYNAMIC_RENDERER_SOURCES})
add_library(${RENDERER_GL2_BINARY} SHARED ${RENDERER_GL2_BINARY_SOURCES})
target_link_libraries( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_LIBRARIES})
target_include_directories( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_INCLUDE_DIRS})
target_compile_definitions( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_DEFINITIONS})
target_compile_options( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_COMPILE_OPTIONS})
target_link_options( ${RENDERER_GL2_BINARY} PRIVATE ${RENDERER_LINK_OPTIONS})
set_output_dirs(${RENDERER_GL2_BINARY})
INSTALL(TARGETS ${RENDERER_GL2_BINARY} DESTINATION ${INSTALL_LIBDIR_FULL})
if(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:${RENDERER_GL2_BINARY}> DESTINATION ${INSTALL_LIBDIR_FULL} OPTIONAL)
endif()
endif()
+66
View File
@@ -0,0 +1,66 @@
if(NOT BUILD_SERVER)
return()
endif()
include(utils/set_output_dirs)
include(shared_sources)
include(shared_script)
set(NULL_SOURCES
${SOURCE_DIR}/null/null_client.c
${SOURCE_DIR}/null/null_input.c
${SOURCE_DIR}/null/null_snddma.c
)
set(SERVER_BINARY ${SERVER_NAME})
list(APPEND SERVER_DEFINITIONS DEDICATED)
list(APPEND SERVER_DEFINITIONS BOTLIB)
list(APPEND SERVER_DEFINITIONS APP_MODULE)
if(BUILD_STANDALONE)
list(APPEND SERVER_DEFINITIONS STANDALONE)
endif()
if(USE_VOIP)
list(APPEND SERVER_DEFINITIONS USE_VOIP)
endif()
if(USE_HTTP)
list(APPEND SERVER_DEFINITIONS USE_HTTP)
endif()
list(APPEND SERVER_BINARY_SOURCES
${SERVER_SOURCES}
${NULL_SOURCES}
${COMMON_SOURCES}
${SCRIPT_SYSTEM_SOURCES}
${BOTLIB_SOURCES}
${SYSTEM_SOURCES}
${ASM_SOURCES}
${SERVER_PLATFORM_SOURCES}
${SERVER_LIBRARY_SOURCES})
add_executable(${SERVER_BINARY} ${SERVER_EXECUTABLE_OPTIONS} ${SERVER_BINARY_SOURCES})
target_include_directories( ${SERVER_BINARY} PRIVATE ${SERVER_INCLUDE_DIRS})
target_compile_definitions( ${SERVER_BINARY} PRIVATE ${SERVER_DEFINITIONS})
target_compile_options( ${SERVER_BINARY} PRIVATE ${SERVER_COMPILE_OPTIONS})
target_link_libraries( ${SERVER_BINARY} PRIVATE ${COMMON_LIBRARIES} ${SERVER_LIBRARIES})
target_link_options( ${SERVER_BINARY} PRIVATE ${SERVER_LINK_OPTIONS})
set_output_dirs(${SERVER_BINARY})
if(POST_SERVER_CONFIGURE_FUNCTION)
cmake_language(CALL ${POST_SERVER_CONFIGURE_FUNCTION})
endif()
set_target_properties(${SERVER_BINARY} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
INSTALL(TARGETS ${SERVER_BINARY} DESTINATION ${INSTALL_BINDIR_FULL})
if (MSVC)
target_link_options(${SERVER_BINARY} PRIVATE "/MANIFEST:NO")
INSTALL(FILES $<TARGET_PDB_FILE:${SERVER_BINARY}> DESTINATION ${INSTALL_BINDIR_FULL} OPTIONAL)
endif()
+17
View File
@@ -0,0 +1,17 @@
include_guard(GLOBAL)
set(SCRIPT_SYSTEM_SOURCES
${SOURCE_DIR}/corepp/class.cpp
${SOURCE_DIR}/corepp/con_set.cpp
${SOURCE_DIR}/corepp/con_timer.cpp
${SOURCE_DIR}/corepp/delegate.cpp
${SOURCE_DIR}/corepp/lightclass.cpp
${SOURCE_DIR}/corepp/listener.cpp
${SOURCE_DIR}/corepp/lz77.cpp
${SOURCE_DIR}/corepp/mem_blockalloc.cpp
${SOURCE_DIR}/corepp/mem_tempalloc.cpp
${SOURCE_DIR}/corepp/script.cpp
${SOURCE_DIR}/corepp/str.cpp
${SOURCE_DIR}/script/scriptexception.cpp
${SOURCE_DIR}/script/scriptvariable.cpp
)
+106
View File
@@ -0,0 +1,106 @@
include_guard(GLOBAL)
include(utils/add_git_dependency)
include(utils/disable_warnings)
include(gamespy)
set(COMMON_SOURCES
${SOURCE_DIR}/qcommon/alias.c
${SOURCE_DIR}/qcommon/bg_compat.cpp
${SOURCE_DIR}/qcommon/cm_fencemask.c
${SOURCE_DIR}/qcommon/cm_load.c
${SOURCE_DIR}/qcommon/cm_patch.c
${SOURCE_DIR}/qcommon/cm_polylib.c
${SOURCE_DIR}/qcommon/cm_terrain.c
${SOURCE_DIR}/qcommon/cm_test.c
${SOURCE_DIR}/qcommon/cm_trace.c
${SOURCE_DIR}/qcommon/cm_trace_lbd.cpp
${SOURCE_DIR}/qcommon/cm_trace_obfuscation.cpp
${SOURCE_DIR}/qcommon/cmd.c
${SOURCE_DIR}/qcommon/common.c
${SOURCE_DIR}/qcommon/crc.c
${SOURCE_DIR}/qcommon/cvar.c
${SOURCE_DIR}/qcommon/files.cpp
${SOURCE_DIR}/qcommon/ioapi.c
${SOURCE_DIR}/qcommon/huffman.cpp
${SOURCE_DIR}/qcommon/md4.c
${SOURCE_DIR}/qcommon/md5.c
${SOURCE_DIR}/qcommon/memory.c
${SOURCE_DIR}/qcommon/msg.cpp
${SOURCE_DIR}/qcommon/net_chan.c
${SOURCE_DIR}/qcommon/net_ip.c
${SOURCE_DIR}/qcommon/q_math.c
${SOURCE_DIR}/qcommon/q_shared.c
${SOURCE_DIR}/qcommon/unzip.c
${SOURCE_DIR}/gamespy/q_gamespy.c
)
disable_warnings(
${SOURCE_DIR}/qcommon/unzip.c
${SOURCE_DIR}/qcommon/ioapi.c
)
add_git_dependency(${SOURCE_DIR}/qcommon/common.c)
set(SYSTEM_SOURCES
${SOURCE_DIR}/sys/con_log.c
${SOURCE_DIR}/sys/sys_autoupdater.c
${SOURCE_DIR}/sys/sys_main.c
${SYSTEM_PLATFORM_SOURCES}
)
set(SERVER_SOURCES
${SOURCE_DIR}/server/sv_client.c
${SOURCE_DIR}/server/sv_ccmds.c
${SOURCE_DIR}/server/sv_game.c
${SOURCE_DIR}/server/sv_init.c
${SOURCE_DIR}/server/sv_main.c
${SOURCE_DIR}/server/sv_net_chan.c
${SOURCE_DIR}/server/sv_snapshot.c
${SOURCE_DIR}/server/sv_snd.c
${SOURCE_DIR}/server/sv_world.c
)
list(APPEND SYSTEM_SOURCES
${SOURCE_DIR}/sys/new/sys_main_new.c
${SOURCE_DIR}/sys/win_bounds.cpp
${SOURCE_DIR}/sys/win_localization.cpp
${SOURCE_DIR}/sys/sys_curl.c
${SOURCE_DIR}/sys/sys_update_checker.cpp
)
# Append TIKI sources
list(APPEND COMMON_SOURCES
${SOURCE_DIR}/skeletor/bonetable.cpp
${SOURCE_DIR}/skeletor/skeletor_imports.cpp
${SOURCE_DIR}/skeletor/skeletor_loadanimation.cpp
${SOURCE_DIR}/skeletor/skeletor_model_files.cpp
${SOURCE_DIR}/skeletor/skeletor_utilities.cpp
${SOURCE_DIR}/skeletor/skeletor.cpp
${SOURCE_DIR}/skeletor/skeletorbones.cpp
${SOURCE_DIR}/skeletor/tokenizer.cpp
${SOURCE_DIR}/tiki/tiki_anim.cpp
${SOURCE_DIR}/tiki/tiki_cache.cpp
${SOURCE_DIR}/tiki/tiki_commands.cpp
${SOURCE_DIR}/tiki/tiki_files.cpp
${SOURCE_DIR}/tiki/tiki_frame.cpp
${SOURCE_DIR}/tiki/tiki_imports.cpp
${SOURCE_DIR}/tiki/tiki_parse.cpp
${SOURCE_DIR}/tiki/tiki_skel.cpp
${SOURCE_DIR}/tiki/tiki_surface.cpp
${SOURCE_DIR}/tiki/tiki_tag.cpp
${SOURCE_DIR}/tiki/tiki_utility.cpp
${SOURCE_DIR}/corepp/tiki_main.cpp
${SOURCE_DIR}/corepp/tiki_script.cpp
)
# Gamespy
list(APPEND SERVER_SOURCES
${SOURCE_DIR}/gamespy/sv_gamespy.c
${SOURCE_DIR}/gamespy/sv_gqueryreporting.c
)
include_directories(${SOURCE_DIR}/qcommon)
include_directories(${SOURCE_DIR}/script)
+3
View File
@@ -0,0 +1,3 @@
enable_testing()
include(tests/lz77)
+14
View File
@@ -0,0 +1,14 @@
#
# Unit tests
#
add_executable(test_lz77
${SOURCE_DIR}/corepp/tests/test_lz77.cpp
${SOURCE_DIR}/corepp/lz77.cpp
${SOURCE_DIR}/qcommon/q_shared.c
${SOURCE_DIR}/qcommon/common_light.c
)
target_link_libraries(test_lz77 INTERFACE testing)
add_test(NAME test_lz77 COMMAND test_lz77)
set_tests_properties(test_lz77 PROPERTIES TIMEOUT 15)
+93
View File
@@ -0,0 +1,93 @@
cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})
project(qvm_tools LANGUAGES C)
include(utils/set_output_dirs)
set(Q3ASM_SOURCES
${SOURCE_DIR}/tools/asm/q3asm.c
${SOURCE_DIR}/tools/asm/cmdlib.c
)
set(Q3LCC_SOURCES
${SOURCE_DIR}/tools/lcc/etc/lcc.c
${SOURCE_DIR}/tools/lcc/etc/bytecode.c
)
set(Q3RCC_SOURCES
${SOURCE_DIR}/tools/lcc/src/alloc.c
${SOURCE_DIR}/tools/lcc/src/bind.c
${SOURCE_DIR}/tools/lcc/src/bytecode.c
${SOURCE_DIR}/tools/lcc/src/dag.c
${SOURCE_DIR}/tools/lcc/src/decl.c
${SOURCE_DIR}/tools/lcc/src/enode.c
${SOURCE_DIR}/tools/lcc/src/error.c
${SOURCE_DIR}/tools/lcc/src/event.c
${SOURCE_DIR}/tools/lcc/src/expr.c
${SOURCE_DIR}/tools/lcc/src/gen.c
${SOURCE_DIR}/tools/lcc/src/init.c
${SOURCE_DIR}/tools/lcc/src/inits.c
${SOURCE_DIR}/tools/lcc/src/input.c
${SOURCE_DIR}/tools/lcc/src/lex.c
${SOURCE_DIR}/tools/lcc/src/list.c
${SOURCE_DIR}/tools/lcc/src/main.c
${SOURCE_DIR}/tools/lcc/src/null.c
${SOURCE_DIR}/tools/lcc/src/output.c
${SOURCE_DIR}/tools/lcc/src/prof.c
${SOURCE_DIR}/tools/lcc/src/profio.c
${SOURCE_DIR}/tools/lcc/src/simp.c
${SOURCE_DIR}/tools/lcc/src/stmt.c
${SOURCE_DIR}/tools/lcc/src/string.c
${SOURCE_DIR}/tools/lcc/src/sym.c
${SOURCE_DIR}/tools/lcc/src/symbolic.c
${SOURCE_DIR}/tools/lcc/src/trace.c
${SOURCE_DIR}/tools/lcc/src/tree.c
${SOURCE_DIR}/tools/lcc/src/types.c
)
set(Q3RCC_DAGCHECK_SOURCE ${SOURCE_DIR}/tools/lcc/src/dagcheck.md)
set(Q3CPP_SOURCES
${SOURCE_DIR}/tools/lcc/cpp/cpp.c
${SOURCE_DIR}/tools/lcc/cpp/lex.c
${SOURCE_DIR}/tools/lcc/cpp/nlist.c
${SOURCE_DIR}/tools/lcc/cpp/tokens.c
${SOURCE_DIR}/tools/lcc/cpp/macro.c
${SOURCE_DIR}/tools/lcc/cpp/eval.c
${SOURCE_DIR}/tools/lcc/cpp/include.c
${SOURCE_DIR}/tools/lcc/cpp/hideset.c
${SOURCE_DIR}/tools/lcc/cpp/getopt.c
${SOURCE_DIR}/tools/lcc/cpp/unix.c
)
set(LBURG_SOURCES
${SOURCE_DIR}/tools/lcc/lburg/lburg.c
${SOURCE_DIR}/tools/lcc/lburg/gram.c
)
add_executable(q3asm ${Q3ASM_SOURCES})
set_output_dirs(q3asm)
add_executable(q3lcc ${Q3LCC_SOURCES})
set_output_dirs(q3lcc)
add_dependencies(q3lcc q3rcc q3cpp)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "^(Apple)?Clang$")
add_compile_options(-fno-strict-aliasing -Wno-unused-result
-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
add_compile_options(/wd4311 /wd4312)
endif()
add_executable(lburg ${LBURG_SOURCES})
set_output_dirs(lburg)
set(DAGCHECK_C ${CMAKE_BINARY_DIR}/dagcheck.c)
add_custom_command(
OUTPUT ${DAGCHECK_C}
COMMAND lburg ${Q3RCC_DAGCHECK_SOURCE} ${DAGCHECK_C}
DEPENDS lburg ${Q3RCC_DAGCHECK_SOURCE})
add_executable(q3rcc ${Q3RCC_SOURCES} ${DAGCHECK_C})
set_output_dirs(q3rcc)
target_include_directories(q3rcc PRIVATE ${SOURCE_DIR}/tools/lcc/src)
add_executable(q3cpp ${Q3CPP_SOURCES})
set_output_dirs(q3cpp)
+38
View File
@@ -0,0 +1,38 @@
include_guard(GLOBAL)
function(add_git_dependency SOURCE_FILE)
set(GIT_DIR ${CMAKE_SOURCE_DIR}/.git)
if(NOT EXISTS ${GIT_DIR})
return()
endif()
# If we're a submodule, .git won't be a directory
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} GIT_FILE_CONTENT)
string(REGEX MATCH "gitdir: (.+)" MATCHED_PATH ${GIT_FILE_CONTENT})
if(NOT MATCHED_PATH)
return()
endif()
string(STRIP ${CMAKE_MATCH_1} GIT_DIR)
endif()
set(GIT_FILES)
list(APPEND GIT_FILES ${GIT_DIR}/HEAD)
list(APPEND GIT_FILES ${GIT_DIR}/packed-refs)
file(READ ${GIT_DIR}/HEAD GIT_HEAD)
string(REGEX MATCH "^ref: (.+)$" HAVE_REF ${GIT_HEAD})
if(HAVE_REF)
set(GIT_REF_PATH ${CMAKE_MATCH_1})
string(STRIP ${GIT_REF_PATH} GIT_REF_PATH)
list(APPEND GIT_FILES ${GIT_DIR}/${GIT_REF_PATH})
endif()
foreach(GIT_FILE IN LISTS GIT_FILES)
if(EXISTS ${GIT_FILE})
set_source_files_properties(${SOURCE_FILE}
PROPERTIES OBJECT_DEPENDS ${GIT_FILE})
endif()
endforeach()
endfunction()
+20
View File
@@ -0,0 +1,20 @@
include_guard(GLOBAL)
set(DETECT_ARCH_C ${CMAKE_BINARY_DIR}/detect_arch.c)
file(WRITE ${DETECT_ARCH_C}
"#include \"${SOURCE_DIR}/qcommon/q_platform.h\"
#pragma message(\"@\" ARCH_STRING \"@\")
int main(void) { return 0; }
")
try_compile(COMPILE_SUCCESS
SOURCES ${DETECT_ARCH_C}
OUTPUT_VARIABLE COMPILE_OUTPUT)
string(REGEX MATCH "^[^\@]+@([a-zA-Z0-9_]+)@.*$" HAVE_MATCH ${COMPILE_OUTPUT})
set(ARCH ${CMAKE_MATCH_1})
if(NOT COMPILE_SUCCESS OR NOT HAVE_MATCH OR NOT ARCH)
message(FATAL_ERROR "Architecture detection failed: ${COMPILE_OUTPUT}")
endif()
+17
View File
@@ -0,0 +1,17 @@
include_guard(GLOBAL)
function(disable_warnings)
set(SOURCES ${ARGN})
foreach(FILE IN LISTS SOURCES)
if(MSVC)
# Annoyingly if you disable all warnings (/w) in combination with enabling
# some warnings, which we and/or CMake inevitably do, this causes a
# meta-warning D9025, so instead we have to individually disable them:
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS
"/wd4131 /wd4245 /wd4100 /wd4127 /wd4244 /wd4310 /wd4457 /wd4456 /wd4701 /wd4305 /wd4189 /wd4232")
else()
set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS -w)
endif()
endforeach()
endfunction()
+15
View File
@@ -0,0 +1,15 @@
include_guard(GLOBAL)
function(find_include_dirs OUT_VAR LIBRARY_DIR)
# Recursively find directories that contain .h files under LIBRARY_DIR
file(GLOB_RECURSE HEADER_FILES ${LIBRARY_DIR}/*.h)
set(INCLUDE_DIRS "")
foreach(HEADER_FILE IN LISTS HEADER_FILES)
get_filename_component(HEADER_DIR ${HEADER_FILE} DIRECTORY)
list(APPEND INCLUDE_DIRS ${HEADER_DIR})
endforeach()
list(REMOVE_DUPLICATES INCLUDE_DIRS)
set(${OUT_VAR} ${INCLUDE_DIRS} PARENT_SCOPE)
endfunction()
+91
View File
@@ -0,0 +1,91 @@
include_guard(GLOBAL)
if(NOT BUILD_GAME_QVMS)
return()
endif()
include(ExternalProject)
set(TOOLS_DIR ${CMAKE_BINARY_DIR}/tools)
if(CMAKE_BUILD_TYPE)
set(BUILD_TYPE_ARG -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
set(Q3RCC ${TOOLS_DIR}/$<CONFIG>/q3rcc${HOST_EXECUTABLE_SUFFIX})
set(Q3CPP ${TOOLS_DIR}/$<CONFIG>/q3cpp${HOST_EXECUTABLE_SUFFIX})
set(Q3LCC ${TOOLS_DIR}/$<CONFIG>/q3lcc${HOST_EXECUTABLE_SUFFIX})
set(Q3ASM ${TOOLS_DIR}/$<CONFIG>/q3asm${HOST_EXECUTABLE_SUFFIX})
ExternalProject_Add(qvm_tools
SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake/tools
BINARY_DIR ${TOOLS_DIR}
CMAKE_ARGS
-DSOURCE_DIR=${SOURCE_DIR}
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DCMAKE_MINIMUM_REQUIRED_VERSION=${CMAKE_MINIMUM_REQUIRED_VERSION}
${BUILD_TYPE_ARG}
BUILD_ALWAYS TRUE
BUILD_BYPRODUCTS ${Q3RCC} ${Q3CPP} ${Q3LCC} ${Q3ASM}
INSTALL_COMMAND "")
function(add_qvm MODULE_NAME)
list(REMOVE_AT ARGV 0)
cmake_parse_arguments(ARG "" "" "DEFINITIONS;OUTPUT_NAME;OUTPUT_DIRECTORY;SOURCES" ${ARGV})
set(QVM_OUTPUT_DIR ${CMAKE_BINARY_DIR}/$<CONFIG>)
if(ARG_OUTPUT_DIRECTORY)
set(QVM_OUTPUT_DIR ${QVM_OUTPUT_DIR}/${ARG_OUTPUT_DIRECTORY})
endif()
add_custom_command(
OUTPUT ${QVM_OUTPUT_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${QVM_OUTPUT_DIR})
if(ARG_OUTPUT_NAME)
set(QVM_FILE ${QVM_OUTPUT_DIR}/${ARG_OUTPUT_NAME}.qvm)
else()
set(QVM_FILE ${QVM_OUTPUT_DIR}/${MODULE_NAME}.qvm)
endif()
set(QVM_ASM_DIR ${CMAKE_BINARY_DIR}/qvm.dir/${MODULE_NAME})
file(MAKE_DIRECTORY ${QVM_ASM_DIR})
set(LCC_FLAGS "")
foreach(DEFINITION IN LISTS ARG_DEFINITIONS)
list(APPEND LCC_FLAGS "-D${DEFINITION}")
endforeach()
set(ASM_FILES "")
foreach(SOURCE ${ARG_SOURCES})
if(${SOURCE} MATCHES "\\.asm$")
list(APPEND ASM_FILES ${SOURCE})
continue()
endif()
get_filename_component(BASE_FILE ${SOURCE} NAME_WE)
set(ASM_FILE ${QVM_ASM_DIR}/${BASE_FILE}.asm)
string(REPLACE "${CMAKE_BINARY_DIR}/" "" ASM_FILE_COMMENT ${ASM_FILE})
add_custom_command(
OUTPUT ${ASM_FILE}
COMMAND ${Q3LCC} ${LCC_FLAGS} -o ${ASM_FILE} ${SOURCE}
DEPENDS ${SOURCE} qvm_tools ${Q3RCC} ${Q3CPP} ${Q3LCC}
COMMENT "Building C object ${ASM_FILE_COMMENT}")
list(APPEND ASM_FILES ${ASM_FILE})
endforeach()
string(REPLACE "${CMAKE_BINARY_DIR}/" "" QVM_FILE_COMMENT ${QVM_FILE})
add_custom_command(
OUTPUT ${QVM_FILE}
COMMAND ${Q3ASM} -o ${QVM_FILE} ${ASM_FILES}
DEPENDS ${ASM_FILES} qvm_tools ${Q3ASM}
COMMENT "Linking C QVM library ${QVM_FILE_COMMENT}")
string(REGEX REPLACE "[^A-Za-z0-9]" "_" TARGET_NAME ${MODULE_NAME})
add_custom_target(${TARGET_NAME} ALL DEPENDS ${QVM_FILE})
if(ARG_OUTPUT_DIRECTORY)
install(FILES ${QVM_FILE} DESTINATION ${ARG_OUTPUT_DIRECTORY})
endif()
endfunction()
+26
View File
@@ -0,0 +1,26 @@
include_guard(GLOBAL)
function(set_output_dirs TARGET)
list(REMOVE_AT ARGV 0)
cmake_parse_arguments(ARG "" "" "SUBDIRECTORY" ${ARGV})
if(CMAKE_CONFIGURATION_TYPES) # Multi-config
set(CONFIGS ${CMAKE_CONFIGURATION_TYPES})
else() # Single-config
set(CONFIGS ${CMAKE_BUILD_TYPE})
endif()
foreach(CONFIG ${CONFIGS})
string(TOUPPER ${CONFIG} CONFIG_UPPER)
set(OUT_DIR ${CMAKE_BINARY_DIR}/${CONFIG}/${ARG_SUBDIRECTORY})
set_target_properties(${TARGET} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR}
RUNTIME_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR}
ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR})
endforeach()
set_target_properties(${TARGET} PROPERTIES
INSTALL_DESTINATION ./${ARG_SUBDIRECTORY})
endfunction()
+13
View File
@@ -0,0 +1,13 @@
# Convert a shader file to a compilable C file
# INPUT_FILE, OUTPUT_FILE, SHADER_NAME must be set via -D
file(READ ${INPUT_FILE} CONTENTS)
string(REPLACE "\\" "\\\\" CONTENTS "${CONTENTS}") # Escape backslashes
string(REPLACE "\"" "\\\"" CONTENTS "${CONTENTS}") # Escape double quotes
string(REPLACE "\n" "\\n\"\n\"" CONTENTS "${CONTENTS}") # Escape newlines
set(OUTPUT_CONTENT "const char *fallbackShader_${SHADER_NAME} =\n\"${CONTENTS}\";\n")
file(WRITE ${OUTPUT_FILE} "${OUTPUT_CONTENT}")
@@ -1,5 +1,3 @@
add_library(qcommon_version INTERFACE)
execute_process(
COMMAND git rev-parse --is-inside-work-tree
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -64,5 +62,8 @@ message(VERBOSE "Git revision date: ${GIT_REVISION_DATE}")
message(VERBOSE "Git revision build: ${GIT_REVISION_BUILD_NUMBER}")
message(VERBOSE "Stage: ${PRODUCT_VERSION_STAGE}")
configure_file("q_version.generated.h.in" "generated/q_version.generated.h")
target_include_directories(qcommon_version INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/generated")
configure_file("cmake/q_version.generated.h.in" "${CMAKE_CURRENT_BINARY_DIR}/generated/q_version.generated.h")
list(APPEND CLIENT_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/generated")
list(APPEND SERVER_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/generated")
list(APPEND RENDERER_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/generated")
+1 -1
View File
@@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// launch.h: Base interface for starting programs
#include "q_platform.h"
#include "../qcommon/q_platform.h"
#include <filesystem>
#include <string>
+1 -1
View File
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* See MASM snapvector.asm for commentary
*/
static unsigned char ssemask[16] __attribute__((aligned(16))) =
static unsigned char ssemask[16] Q_ALIGN(16) =
{
"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00"
};
File diff suppressed because it is too large. Load diff
-8
View File
@@ -1,8 +0,0 @@
crypt-*.tar.bz2
tfm-*.tar.xz
libtomcrypt-*
tomsfastmath-*
rsa_make_keys
rsa_sign
rsa_verify
*.exe
@@ -1,79 +0,0 @@
#!/bin/bash
TFMVER=0.13.1
LTCVER=1.17
set -e
OSTYPE=`uname -s`
if [ "$OSTYPE" = "Linux" ]; then
NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
let NCPU=$NCPU+1
elif [ "$OSTYPE" = "Darwin" ]; then
NCPU=`sysctl -n hw.ncpu`
export CFLAGS="$CFLAGS -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070"
export LDFLAGS="$LDFLAGS -mmacosx-version-min=10.7"
elif [ "$OSTYPE" = "SunOS" ]; then
NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
else
NCPU=1
fi
if [ -z "$NCPU" ]; then
NCPU=1
elif [ "$NCPU" = "0" ]; then
NCPU=1
fi
if [ ! -f tfm-$TFMVER.tar.xz ]; then
echo "Downloading TomsFastMath $TFMVER sources..."
curl -L -o tfm-$TFMVER.tar.xz https://github.com/libtom/tomsfastmath/releases/download/v$TFMVER/tfm-$TFMVER.tar.xz || exit 1
fi
if [ ! -f ./crypt-$LTCVER.tar.bz2 ]; then
echo "Downloading LibTomCrypt $LTCVER sources..."
curl -L -o crypt-$LTCVER.tar.bz2 https://github.com/libtom/libtomcrypt/releases/download/$LTCVER/crypt-$LTCVER.tar.bz2 || exit 1
fi
if [ ! -d tomsfastmath-$TFMVER ]; then
echo "Checking TomsFastMath archive hash..."
if [ "`shasum -a 256 tfm-$TFMVER.tar.xz |awk '{print $1;}'`" != "47c97a1ada3ccc9fcbd2a8a922d5859a84b4ba53778c84c1d509c1a955ac1738" ]; then
echo "Uhoh, tfm-$TFMVER.tar.xz does not have the sha256sum we expected!"
exit 1
fi
echo "Unpacking TomsFastMath $TFMVER sources..."
tar -xJvvf ./tfm-$TFMVER.tar.xz
fi
if [ ! -d libtomcrypt-$LTCVER ]; then
if [ "`shasum -a 256 crypt-$LTCVER.tar.bz2 |awk '{print $1;}'`" != "e33b47d77a495091c8703175a25c8228aff043140b2554c08a3c3cd71f79d116" ]; then
echo "Uhoh, crypt-$LTCVER.tar.bz2 does not have the sha256sum we expected!"
exit 1
fi
echo "Unpacking LibTomCrypt $LTCVER sources..."
tar -xjvvf ./crypt-$LTCVER.tar.bz2
fi
echo
echo
echo "Will use make -j$NCPU. If this is wrong, check NCPU at top of script."
echo
echo
set -e
set -x
# Some compilers can't handle the ROLC inline asm; just turn it off.
cd tomsfastmath-$TFMVER
make -j$NCPU
cd ..
export CFLAGS="$CFLAGS -DTFM_DESC -DLTC_NO_ROLC -I ../tomsfastmath-$TFMVER/src/headers"
cd libtomcrypt-$LTCVER
make -j$NCPU
cd ..
set +x
echo "All done."
# end of build-libtom-unix.sh ...
@@ -1,33 +0,0 @@
#!/bin/bash
export TFMDIR="tomsfastmath-0.13.1"
export LTCDIR="libtomcrypt-1.17"
OSTYPE=`uname -s`
if [ -z "$CC" ]; then
if [ "`uname -o`" = "Cygwin" ]; then
export CC=/usr/bin/i686-w64-mingw32-gcc
else
export CC=cc
fi
fi
function build {
if [ "$OSTYPE" = "Darwin" ]; then
$CC -mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -I $TFMDIR/src/headers -I $LTCDIR/src/headers -o "$1" -Wall -O3 "$1.c" rsa_common.c $LTCDIR/libtomcrypt.a $TFMDIR/libtfm.a
else
$CC -I $TFMDIR/src/headers -I $LTCDIR/src/headers -o "$1" -Wall -O3 "$1.c" rsa_common.c $LTCDIR/libtomcrypt.a $TFMDIR/libtfm.a
fi
}
set -e
set -x
./build-libtom-unix.sh
build rsa_make_keys
build rsa_sign
build rsa_verify
set +x
echo "rsa_tools are compiled!"
-61
View File
@@ -1,61 +0,0 @@
#include "rsa_common.h"
void fail(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fputs("\n", stderr);
fflush(stderr);
exit(1);
}
void write_file(const char *fname, const void *buf, const unsigned long len)
{
FILE *io = fopen(fname, "wb");
if (!io) {
fail("Can't open '%s' for writing: %s", fname, strerror(errno));
}
if (fwrite(buf, len, 1, io) != 1) {
fail("Couldn't write '%s': %s", fname, strerror(errno));
}
if (fclose(io) != 0) {
fail("Couldn't flush '%s' to disk: %s", fname, strerror(errno));
}
}
void read_file(const char *fname, void *buf, unsigned long *len)
{
ssize_t br;
FILE *io = fopen(fname, "rb");
if (!io) {
fail("Can't open '%s' for reading: %s", fname, strerror(errno));
}
br = fread(buf, 1, *len, io);
if (ferror(io)) {
fail("Couldn't read '%s': %s", fname, strerror(errno));
} else if (!feof(io)) {
fail("Buffer too small to read '%s'", fname);
}
fclose(io);
*len = (unsigned long) br;
}
void read_rsakey(rsa_key *key, const char *fname)
{
unsigned char buf[4096];
unsigned long len = sizeof (buf);
int rc;
read_file(fname, buf, &len);
if ((rc = rsa_import(buf, len, key)) != CRYPT_OK) {
fail("rsa_import for '%s' failed: %s", fname, error_to_string(rc));
}
}
-30
View File
@@ -1,30 +0,0 @@
#ifndef _INCL_RSA_COMMON_H_
#define _INCL_RSA_COMMON_H_ 1
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
#define TFM_DESC
#define LTC_NO_ROLC
#include "tomcrypt.h"
#define SALT_LEN 8
#if defined(__GNUC__) || defined(__clang__)
#define NEVER_RETURNS __attribute__((noreturn))
#define PRINTF_FUNC(fmtargnum, dotargnum) __attribute__ (( format( __printf__, fmtargnum, dotargnum )))
#else
#define NEVER_RETURNS
#define PRINTF_FUNC(fmtargnum, dotargnum)
#endif
void fail(const char *fmt, ...) NEVER_RETURNS PRINTF_FUNC(1, 2);
void write_file(const char *fname, const void *buf, const unsigned long len);
void read_file(const char *fname, void *buf, unsigned long *len);
void read_rsakey(rsa_key *key, const char *fname);
#endif
/* end of rsa_common.h ... */
@@ -1,45 +0,0 @@
#include "rsa_common.h"
static void write_rsakey(rsa_key *key, const int type, const char *fname)
{
unsigned char buf[4096];
unsigned long len = sizeof (buf);
int rc;
if ((rc = rsa_export(buf, &len, type, key)) != CRYPT_OK) {
fail("rsa_export for '%s' failed: %s", fname, error_to_string(rc));
}
write_file(fname, buf, len);
}
int main(int argc, char **argv)
{
int rc = 0;
prng_state prng;
int prng_index;
rsa_key key;
ltc_mp = tfm_desc;
prng_index = register_prng(&sprng_desc); /* (fortuna_desc is a good choice if your platform's PRNG sucks.) */
if (prng_index == -1) {
fail("Failed to register a RNG");
}
if ((rc = rng_make_prng(128, prng_index, &prng, NULL)) != CRYPT_OK) {
fail("rng_make_prng failed: %s", error_to_string(rc));
}
if ((rc = rsa_make_key(&prng, prng_index, 256, 65537, &key)) != CRYPT_OK) {
fail("rng_make_key failed: %s", error_to_string(rc));
}
write_rsakey(&key, PK_PRIVATE, "privatekey.bin");
write_rsakey(&key, PK_PUBLIC, "publickey.bin");
rsa_free(&key);
return 0;
}
/* end of rsa_make_keys.c ... */
-75
View File
@@ -1,75 +0,0 @@
#include "rsa_common.h"
static void sign_file(const char *fname, rsa_key *key, prng_state *prng, const int prng_index, const int hash_index)
{
const size_t sigfnamelen = strlen(fname) + 5;
char *sigfname = (char *) malloc(sigfnamelen);
unsigned char hash[256];
unsigned long hashlen = sizeof (hash);
unsigned char sig[1024];
unsigned long siglen = sizeof (sig);
int rc = 0;
int status = 0;
if (!sigfname) {
fail("out of memory");
}
if ((rc = hash_file(hash_index, fname, hash, &hashlen)) != CRYPT_OK) {
fail("hash_file for '%s' failed: %s", fname, error_to_string(rc));
}
if ((rc = rsa_sign_hash(hash, hashlen, sig, &siglen, prng, prng_index, hash_index, SALT_LEN, key)) != CRYPT_OK) {
fail("rsa_sign_hash for '%s' failed: %s", fname, error_to_string(rc));
}
if ((rc = rsa_verify_hash(sig, siglen, hash, hashlen, hash_index, SALT_LEN, &status, key)) != CRYPT_OK) {
fail("rsa_verify_hash for '%s' failed: %s", fname, error_to_string(rc));
}
if (!status) {
fail("Generated signature isn't valid! Bug in the program!");
}
snprintf(sigfname, sigfnamelen, "%s.sig", fname);
write_file(sigfname, sig, siglen);
free(sigfname);
}
int main(int argc, char **argv)
{
int rc = 0;
prng_state prng;
int prng_index, hash_index;
rsa_key key;
int i;
ltc_mp = tfm_desc;
prng_index = register_prng(&sprng_desc); /* (fortuna_desc is a good choice if your platform's PRNG sucks.) */
if (prng_index == -1) {
fail("Failed to register a RNG");
}
hash_index = register_hash(&sha256_desc);
if (hash_index == -1) {
fail("Failed to register sha256 hasher");
}
if ((rc = rng_make_prng(128, prng_index, &prng, NULL)) != CRYPT_OK) {
fail("rng_make_prng failed: %s", error_to_string(rc));
}
read_rsakey(&key, "privatekey.bin");
for (i = 1; i < argc; i++) {
sign_file(argv[i], &key, &prng, prng_index, hash_index);
}
rsa_free(&key);
return 0;
}
/* end of rsa_sign.c ... */
-60
View File
@@ -1,60 +0,0 @@
#include "rsa_common.h"
static void verify_file(const char *fname, rsa_key *key, const int hash_index)
{
const size_t sigfnamelen = strlen(fname) + 5;
char *sigfname = (char *) malloc(sigfnamelen);
unsigned char hash[256];
unsigned long hashlen = sizeof (hash);
unsigned char sig[1024];
unsigned long siglen = sizeof (sig);
int status = 0;
int rc = 0;
if (!sigfname) {
fail("out of memory");
}
snprintf(sigfname, sigfnamelen, "%s.sig", fname);
read_file(sigfname, sig, &siglen);
free(sigfname);
if ((rc = hash_file(hash_index, fname, hash, &hashlen)) != CRYPT_OK) {
fail("hash_file for '%s' failed: %s", fname, error_to_string(rc));
}
if ((rc = rsa_verify_hash(sig, siglen, hash, hashlen, hash_index, SALT_LEN, &status, key)) != CRYPT_OK) {
fail("rsa_verify_hash for '%s' failed: %s", fname, error_to_string(rc));
}
if (!status) {
fail("Invalid signature for '%s'! Don't trust this file!", fname);
}
}
int main(int argc, char **argv)
{
int hash_index;
rsa_key key;
int i;
ltc_mp = tfm_desc;
hash_index = register_hash(&sha256_desc);
if (hash_index == -1) {
fail("Failed to register sha256 hasher");
}
read_rsakey(&key, "publickey.bin");
for (i = 1; i < argc; i++) {
verify_file(argv[i], &key, hash_index);
}
rsa_free(&key);
return 0;
}
/* end of rsa_verify.c ... */
@@ -1,17 +0,0 @@
#!/bin/bash
if [ -f privatekey.bin ]; then
echo "move your existing keys out of the way."
exit 1
fi
( ./rsa_make_keys && echo "key making okay") || echo "key making NOT okay"
echo "The quick brown fox jumped over the lazy dog." >testmsg.txt
( ./rsa_sign testmsg.txt && echo "signing okay" ) || echo "signing NOT okay"
( ./rsa_verify testmsg.txt && echo "basic verifying okay" ) || echo "basic verifying NOT okay"
echo "The quick brown fox jumped over the lazy dog!" >testmsg.txt
( ./rsa_verify testmsg.txt 2>/dev/null && echo "tamper test NOT okay" ) || echo "tamper test okay"
echo "The quick brown fox jumped over the lazy dog." >testmsg.txt
( ./rsa_verify testmsg.txt && echo "reverify okay" ) || echo "reverify NOT okay"
rm -f testmsg.txt testmsg.txt.sig publickey.bin privatekey.bin
+1 -1
View File
@@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
extern aas_t aasworld;
//AAS error message
void QDECL AAS_Error(char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
void QDECL AAS_Error(char *fmt, ...) Q_PRINTF_FUNC(1, 2);
//set AAS initialized
void AAS_SetInitialized(void);
//setup AAS with the given number of entities and clients
+1 -1
View File
@@ -247,7 +247,7 @@ bot_character_t *BotLoadCharacterFromFile(char *charfile, int skill)
return NULL;
} //end if
//if it's the correct skill
if (skill < 0 || token.intvalue == skill)
if (skill < 0 || (int)token.intvalue == skill)
{
foundcharacter = qtrue;
ch->skill = token.intvalue;
+1 -1
View File
@@ -71,7 +71,7 @@ void Log_Open(char *filename)
botimport.Print(PRT_ERROR, "log file %s is already opened\n", logfile.filename);
return;
} //end if
ospath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), Cvar_VariableString("fs_game"), filename);
ospath = FS_BuildOSPath(Cvar_VariableString("fs_homestatepath"), Cvar_VariableString("fs_game"), filename);
logfile.fp = fopen(ospath, "wb");
if (!logfile.fp)
{
+2 -2
View File
@@ -36,9 +36,9 @@ void Log_Close(void);
//close log file if present
void Log_Shutdown(void);
//write to the current opened log file
void QDECL Log_Write(char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
void QDECL Log_Write(char *fmt, ...) Q_PRINTF_FUNC(1, 2);
//write to the current opened log file with a time stamp
void QDECL Log_WriteTimeStamped(char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
void QDECL Log_WriteTimeStamped(char *fmt, ...) Q_PRINTF_FUNC(1, 2);
//returns a pointer to the log file
FILE *Log_FilePointer(void);
//flush log file
+2 -2
View File
@@ -148,9 +148,9 @@ source_t *LoadSourceMemory(char *ptr, int length, char *name);
//free the given source
void FreeSource(source_t *source);
//print a source error
void QDECL SourceError(source_t *source, char *str, ...) __attribute__ ((format (printf, 2, 3)));
void QDECL SourceError(source_t *source, char *str, ...) Q_PRINTF_FUNC(2, 3);
//print a source warning
void QDECL SourceWarning(source_t *source, char *str, ...) __attribute__ ((format (printf, 2, 3)));
void QDECL SourceWarning(source_t *source, char *str, ...) Q_PRINTF_FUNC(2, 3);
#ifdef BSPC
// some of BSPC source does include game/q_shared.h and some does not
+3 -3
View File
@@ -356,7 +356,7 @@ int PS_ReadWhiteSpace(script_t *script)
//============================================================================
int PS_ReadEscapeCharacter(script_t *script, char *ch)
{
int c, val, i;
int c, val;
//step over the leading '\\'
script->script_p++;
@@ -377,7 +377,7 @@ int PS_ReadEscapeCharacter(script_t *script, char *ch)
case 'x':
{
script->script_p++;
for (i = 0, val = 0; ; i++, script->script_p++)
for (val = 0; ; script->script_p++)
{
c = *script->script_p;
if (c >= '0' && c <= '9') c = c - '0';
@@ -398,7 +398,7 @@ int PS_ReadEscapeCharacter(script_t *script, char *ch)
default: //NOTE: decimal ASCII code, NOT octal
{
if (*script->script_p < '0' || *script->script_p > '9') ScriptError(script, "unknown escape char");
for (i = 0, val = 0; ; i++, script->script_p++)
for (val = 0; ; script->script_p++)
{
c = *script->script_p;
if (c >= '0' && c <= '9') c = c - '0';
+2 -2
View File
@@ -240,8 +240,8 @@ void FreeScript(script_t *script);
//set the base folder to load files from
void PS_SetBaseFolder(char *path);
//print a script error with filename and line number
void QDECL ScriptError(script_t *script, char *str, ...) __attribute__ ((format (printf, 2, 3)));
void QDECL ScriptError(script_t *script, char *str, ...) Q_PRINTF_FUNC(2, 3);
//print a script warning with filename and line number
void QDECL ScriptWarning(script_t *script, char *str, ...) __attribute__ ((format (printf, 2, 3)));
void QDECL ScriptWarning(script_t *script, char *str, ...) Q_PRINTF_FUNC(2, 3);
-37
View File
@@ -1,37 +0,0 @@
cmake_minimum_required(VERSION 3.12)
project(cgame)
# Shared source files for modules
set(SOURCES_SHARED
"../qcommon/class.cpp"
"../qcommon/con_set.cpp"
"../qcommon/con_timer.cpp"
"../qcommon/listener.cpp"
"../qcommon/lz77.cpp"
"../qcommon/mem_blockalloc.cpp"
"../qcommon/mem_tempalloc.cpp"
"../qcommon/q_math.c"
"../qcommon/q_shared.c"
"../qcommon/script.cpp"
"../qcommon/str.cpp"
"../script/scriptexception.cpp"
"../script/scriptvariable.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_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 "")
set_target_properties(cgame PROPERTIES OUTPUT_NAME "cgame${TARGET_BIN_SUFFIX}")
INSTALL(TARGETS cgame DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR})
if(MSVC)
INSTALL(FILES $<TARGET_PDB_FILE:cgame> DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LIB_INSTALL_SUBDIR} OPTIONAL)
endif()
+1 -1
View File
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_archive.h"
#include "cg_commands.h"
#include "memarchiver.h"
#include "../qcommon/tiki.h"
#include "../corepp/tiki.h"
void CG_ArchiveStuff(MemArchiver& archiver, int svsTime)
{
+2 -2
View File
@@ -27,8 +27,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifdef __cplusplus
#include "../qcommon/container.h"
#include "../qcommon/str.h"
#include "../corepp/container.h"
#include "../corepp/str.h"
class MemArchiver;
+2 -2
View File
@@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Beam effects
#include "cg_local.h"
#include "vector.h"
#include "container.h"
#include "../corepp/vector.h"
#include "../corepp/container.h"
#include "cg_commands.h"
class beam_t : public Class
+1 -1
View File
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_commands.h"
#include "cg_specialfx.h"
#include "scriptexception.h"
#include "tiki.h"
#include "../corepp/tiki.h"
#include "cg_archive.h"
#include "memarchiver.h"
+3 -3
View File
@@ -48,9 +48,9 @@ TIKI file, similar to ScriptMaster in the server game dll.
#pragma once
#include "cg_local.h"
#include "listener.h"
#include "script.h"
#include "vector.h"
#include "../corepp/listener.h"
#include "../corepp/script.h"
#include "../corepp/vector.h"
#include "../qcommon/qcommon.h"
#define EMITTER_DEFAULT_LIFE 1000
+28 -10
View File
@@ -340,11 +340,19 @@ static void CG_DrawServerLag()
float w, h;
qhandle_t handle;
if (cgs.gametype == GT_SINGLE_PLAYER) {
// Fixed in 2.0
// Don't draw server lag in single-player mode
return;
}
if (!cg_drawsvlag->integer) {
return;
}
if (!developer->integer && !cgs.gametype) {
if (!developer->integer) {
// Changed in 2.0
// Svlag should only be drawn when developer mode is enabled
return;
}
@@ -1028,13 +1036,18 @@ void CG_UpdateCountdown()
}
if (cg.matchStartTime != -1) {
int iSecondsLeft, iMinutesLeft;
if (cgs.gametype != GT_LIBERATION) {
int iSecondsLeft, iMinutesLeft;
iSecondsLeft = (cgs.matchEndTime - cg.time) / 1000;
if (iSecondsLeft >= 0) {
iMinutesLeft = iSecondsLeft / 60;
message = va("%s %2i:%02i", cgi.LV_ConvertString("Time Left:"), iMinutesLeft, iSecondsLeft % 60);
} else if (!cgs.matchEndTime) {
iSecondsLeft = (cgs.matchEndTime - cg.time) / 1000;
if (iSecondsLeft >= 0) {
iMinutesLeft = iSecondsLeft / 60;
message = va("%s %2i:%02i", cgi.LV_ConvertString("Time Left:"), iMinutesLeft, iSecondsLeft % 60);
} else if (!cgs.matchEndTime) {
message = "";
}
} else {
// No clock on liberation game mode
message = "";
}
} else {
@@ -1394,6 +1407,11 @@ void CG_DrawCrosshair()
// friend
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
shader = cgi.R_RegisterShaderNoMip(cg_crosshair_friend->string);
if (!shader) {
// Fixed in OPM
// Fallback to normal crosshair texture if it doesn't exist
shader = cgi.R_RegisterShaderNoMip(cg_crosshair->string);
}
}
} else {
// enemy
@@ -1414,13 +1432,13 @@ void CG_DrawCrosshair()
}
if (shader) {
width = cgi.R_GetShaderWidth(shader);
height = cgi.R_GetShaderHeight(shader);
width = cgi.R_GetShaderWidth(shader) * cgs.uiHiResScale[0];
height = cgi.R_GetShaderHeight(shader) * cgs.uiHiResScale[1];
x = (cgs.glconfig.vidWidth - width) * 0.5f;
y = (cgs.glconfig.vidHeight - height) * 0.5f;
cgi.R_SetColor(NULL);
cgi.R_DrawStretchPic(x, y, width * cgs.uiHiResScale[0], height * cgs.uiHiResScale[1], 0, 0, 1, 1, shader);
cgi.R_DrawStretchPic(x, y, width, height, 0, 0, 1, 1, shader);
}
}
+14 -6
View File
@@ -122,7 +122,15 @@ void CG_EntityEffects(centity_t *cent)
if (cent->currentState.renderfx & RF_ADDITIVE_DLIGHT) {
flags |= additive;
}
cgi.R_AddLightToScene(cent->lerpOrigin, i, r, g, b, flags);
// Fixed in 2.0
// Use the parent entity's tag for the effect
if (cent->currentState.parent == ENTITYNUM_NONE) {
cgi.R_AddLightToScene(cent->lerpOrigin, i, r, g, b, flags);
} else {
vec3_t origin;
CG_GetOrigin(cent, origin);
cgi.R_AddLightToScene(origin, i, r, g, b, flags);
}
}
if (r < cent->color[0]) {
cent->color[0] = r;
@@ -241,9 +249,9 @@ void CG_General(centity_t *cent)
ent.shader_data[1] = s1->skinNum;
ent.renderfx |= s1->renderfx;
ent.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
ent.frameInfo[0] = s1->frameInfo[0];
ent.actionWeight = 1.0;
ent.tiki = cgi.R_Model_GetHandle(cgs.model_draw[s1->modelindex]);
ent.frameInfo[0] = s1->frameInfo[0];
ent.actionWeight = 1.0;
// add to refresh list
cgi.R_AddRefEntityToScene(&ent, ENTITYNUM_NONE);
@@ -552,8 +560,8 @@ void CG_AddCEntity(centity_t *cent)
break;
case ET_PLAYER:
CG_Player(cent);
CG_Splash(cent);
CG_ModelAnim(cent, qfalse);
CG_Splash(cent);
CG_ModelAnim(cent, qfalse);
CG_UpdateRadarClient(cent);
break;
case ET_ITEM:
+2 -1
View File
@@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#pragma once
#include "q_shared.h"
#include "../qcommon/q_shared.h"
#include "tr_types.h"
#include "../fgame/bg_public.h"
#include "cm_public.h"
@@ -606,6 +606,7 @@ extern "C" {
float CG_SensitivityScale();
void CG_AddLightShow();
qboolean CG_FrustumCullSphere(const vec3_t vPos, float fRadius);
qboolean CG_SimpleDistanceCull(const vec3_t origin, float maxDist);
void CG_OffsetFirstPersonView(refEntity_t *pREnt, qboolean bUseWorldPosition);
void CG_DrawActiveFrame(int serverTime, int frameTime, stereoFrame_t stereoView, qboolean demoPlayback);
+33 -31
View File
@@ -129,7 +129,7 @@ void CG_RegisterCvars(void)
cgi.Cvar_Get("g_subtitle", "0", CVAR_ARCHIVE);
cg_viewsize = cgi.Cvar_Get("viewsize", "100", CVAR_ARCHIVE);
cg_addMarks = cgi.Cvar_Get("cg_marks_add", "0", CVAR_ARCHIVE);
cg_addMarks = cgi.Cvar_Get("cg_marks_add", "1", CVAR_ARCHIVE);
cg_maxMarks = cgi.Cvar_Get("cg_marks_max", "256", CVAR_ARCHIVE | CVAR_LATCH);
cg_animSpeed = cgi.Cvar_Get("cg_animspeed", "1", CVAR_CHEAT);
cg_debugAnim = cgi.Cvar_Get("cg_debuganim", "0", CVAR_CHEAT);
@@ -171,13 +171,10 @@ void CG_RegisterCvars(void)
cg_huddraw_force = cgi.Cvar_Get("cg_huddraw_force", "0", CVAR_SAVEGAME);
cg_drawsvlag = cgi.Cvar_Get("cg_drawsvlag", "1", CVAR_ARCHIVE);
cg_crosshair = cgi.Cvar_Get("cg_crosshair", "textures/hud/crosshair", CVAR_ARCHIVE);
if (cg_protocol >= PROTOCOL_MOHTA_MIN) {
cg_crosshair_friend = cgi.Cvar_Get("cg_crosshair_friend", "textures/hud/crosshair_friend", CVAR_ARCHIVE);
} else {
// on 1.11 and below, fallback to standard crosshair
// as it doesn't have crosshair_friend texture
cg_crosshair_friend = cgi.Cvar_Get("cg_crosshair_friend", "textures/hud/crosshair", CVAR_ARCHIVE);
}
// 1.11 and below will fallback to cg_crosshair if the texture doesn't exist
// as it doesn't have crosshair_friend texture
cg_crosshair_friend = cgi.Cvar_Get("cg_crosshair_friend", "textures/hud/crosshair_friend", CVAR_ARCHIVE);
ui_crosshair = cgi.Cvar_Get("ui_crosshair", "1", CVAR_ARCHIVE);
vm_offset_max = cgi.Cvar_Get("vm_offset_max", "8.0", 0);
vm_offset_speed = cgi.Cvar_Get("vm_offset_speed", "8.0", 0);
@@ -305,7 +302,7 @@ void CG_RegisterSounds(void)
for (i = 0; i < numFiles; i++) {
// Added in 2.0
// Since 2.0, all files in the ubersound folder
// Since this version, all files in the ubersound folder
// are parsed
CG_RegisterSoundsForFile(va("ubersound/%s", fileList[i]));
}
@@ -344,13 +341,17 @@ CG_ProcessConfigString
*/
void CG_ProcessConfigString(int num, qboolean modelOnly)
{
const char* str;
int i;
const char *str;
size_t index;
int i;
str = CG_ConfigString(num);
if (num >= CS_MODELS && num < CS_MODELS + MAX_MODELS) {
qhandle_t hOldModel = cgs.model_draw[num - CS_MODELS];
qhandle_t hOldModel;
index = num - CS_MODELS;
hOldModel = cgs.model_draw[index];
if (str && str[0] && !modelOnly) {
qhandle_t hModel = cgi.R_RegisterServerModel(str);
@@ -362,7 +363,7 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
cgi.R_UnregisterServerModel(hOldModel);
}
cgs.model_draw[num - CS_MODELS] = hModel;
cgs.model_draw[index] = hModel;
assert(CG_IsHandleUnique(hModel));
}
tiki = cgi.R_Model_GetHandle(hModel);
@@ -378,7 +379,7 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
cgi.R_UnregisterServerModel(hOldModel);
}
cgs.model_draw[num - CS_MODELS] = 0;
cgs.model_draw[index] = 0;
if (!str || !str[0]) {
CG_ServerModelUnloaded(hOldModel);
@@ -441,7 +442,8 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
if (num >= CS_OBJECTIVES && num < CS_OBJECTIVES + MAX_OBJECTIVES) {
cobjective_t *objective = &cg.Objectives[num - CS_OBJECTIVES];
objective->flags = atoi(Info_ValueForKey(str, "flags"));
objective->flags = atoi(Info_ValueForKey(str, "flags"));
Q_strncpyz(objective->text, Info_ValueForKey(str, "text"), sizeof(objective->text));
}
@@ -453,7 +455,7 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
cg.matchStartTime = atoi(str);
return;
case CS_FOGINFO:
cg.farclipOverride = 0;
cg.farclipOverride = 0;
cg.farplaneColorOverride[0] = -1;
cg.farplaneColorOverride[1] = -1;
cg.farplaneColorOverride[2] = -1;
@@ -469,23 +471,23 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
cgs.levelStartTime = atoi(str);
return;
case CS_VOTE_TIME:
cgs.voteTime = atoi(str);
cgs.voteTime = atoi(str);
cgs.voteRefreshed = qtrue;
break;
case CS_VOTE_STRING:
Q_strncpyz(cgs.voteString, str, sizeof(cgs.voteString));
break;
case CS_VOTE_YES:
cgs.numVotesYes = atoi(str);
cgs.numVotesYes = atoi(str);
cgs.voteRefreshed = qtrue;
break;
case CS_VOTE_NO:
cgs.numVotesNo = atoi(str);
cgs.numVotesNo = atoi(str);
cgs.voteRefreshed = qtrue;
break;
case CS_VOTE_UNDECIDED:
cgs.numUndecidedVotes = atoi(str);
cgs.voteRefreshed = qtrue;
cgs.voteRefreshed = qtrue;
break;
case CS_MATCHEND:
cgs.matchEndTime = atoi(str);
@@ -498,7 +500,7 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
qboolean streamed;
char buf[1024];
Q_strncpyz(buf, str, sizeof(buf));
streamed = buf[len - 1] != '0';
buf[len - 1] = 0;
if (buf[0] != '*') {
@@ -509,21 +511,21 @@ void CG_ProcessConfigString(int num, qboolean modelOnly)
CG_SetLightStyle(num - CS_LIGHTSTYLES, str);
} else if (num >= CS_PLAYERS && num < CS_PLAYERS + MAX_CLIENTS) {
const char *value;
index = num - CS_PLAYERS;
// Get the name
value = Info_ValueForKey(str, "name");
if (value) {
strncpy(cg.clientinfo[num - CS_PLAYERS].name, value, sizeof(cg.clientinfo[num - CS_PLAYERS].name));
} else {
strncpy(
cg.clientinfo[num - CS_PLAYERS].name, "UnnamedSoldier", sizeof(cg.clientinfo[num - CS_PLAYERS].name)
);
if (!value) {
value = "UnnamedSoldier";
}
Q_strncpyz(cg.clientinfo[index].name, value, sizeof(cg.clientinfo[index].name));
value = Info_ValueForKey(str, "team");
if (value) {
cg.clientinfo[num - CS_PLAYERS].team = atoi(value);
cg.clientinfo[index].team = atoi(value);
} else {
cg.clientinfo[num - CS_PLAYERS].team = TEAM_NONE;
cg.clientinfo[index].team = TEAM_NONE;
}
}
}
+8 -17
View File
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Functions for doing model animation and attachments
#include "cg_local.h"
#include "tiki.h"
#include "../corepp/tiki.h"
static qboolean cg_forceModelAllowed = qfalse;
@@ -250,21 +250,9 @@ void CG_InterpolateAnimParms(entityState_t *state, entityState_t *sNext, refEnti
} else {
t1 = (animLength + sNext->frameInfo[i].time - state->frameInfo[i].time) * t
+ state->frameInfo[i].time;
model->frameInfo[i].time = fmod(t1, animLength);
}
t2 = t1;
while (t2 > animLength) {
t2 -= animLength;
if (t2 == t1) {
t2 = 1.0;
break;
}
t1 = t2;
}
model->frameInfo[i].time = t2;
}
} else {
animLength = cgi.Anim_Time(model->tiki, sNext->frameInfo[i].index);
@@ -612,7 +600,8 @@ qboolean CG_EntityShadow(centity_t *cent, refEntity_t *model)
return qfalse;
}
// since 2.0: no shadow if solid
// Fixed in 2.0:
// No shadow if solid
if (trace.startsolid || trace.allsolid) {
return qfalse;
}
@@ -1297,7 +1286,9 @@ void CG_ModelAnim(centity_t *cent, qboolean bDoShaderTime)
}
}
if (!(s1->renderfx & RF_DONTDRAW) && (model.renderfx & RF_SHADOW)) {
if (!(s1->renderfx & RF_DONTDRAW) && (model.renderfx & RF_SHADOW) && cg_shadows->integer
&& !CG_SimpleDistanceCull(model.origin, Square(1400))
&& !CG_FrustumCullSphere(model.origin, model.radius + 64)) {
// add the shadow
CG_EntityShadow(cent, &model);
}
+99 -165
View File
@@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_specialfx.h"
#include "cg_radar.h"
#include "str.h"
#include "../corepp/str.h"
extern int current_entity_number;
@@ -232,8 +232,9 @@ static void CG_MakeBulletHoleType(
sfxManager.MakeEffect_Normal(iEffectNum, i_vPos, i_vNorm);
}
static void
CG_MakeBulletHole(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t *pPreTrace, qboolean bMakeSound)
static void CG_MakeBulletHole(
const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t *pPreTrace, qboolean bMakeSound, int iPreEffect
)
{
int iSurfType;
int iEffect;
@@ -243,6 +244,11 @@ CG_MakeBulletHole(const vec3_t i_vPos, const vec3_t i_vNorm, int iLarge, trace_t
vec3_t vFrom, vDest;
trace_t trace;
if (iPreEffect >= 0) {
CG_MakeBulletHoleType(i_vPos, i_vNorm, iLarge, iPreEffect, 2.0, bMakeSound);
return;
}
if (pPreTrace) {
trace = *pPreTrace;
} else {
@@ -668,10 +674,10 @@ static void CG_MakeBulletTracerInternal(
}
if (iNumImpacts > 2) {
fImpSndDistRA = 9999.0f;
fImpSndDistRB = 9999.0f;
fImpSndDistLA = 9999.0f;
fImpSndDistLB = 9999.0f;
fImpSndDistRA = 9999;
fImpSndDistLA = 9999;
fImpSndDistRB = 9999;
fImpSndDistLB = 9999;
iImpSndIndexRA = 0;
iImpSndIndexLA = 0;
iImpSndIndexRB = 0;
@@ -679,25 +685,13 @@ static void CG_MakeBulletTracerInternal(
for (iBullet = 0; iBullet < iNumImpacts; iBullet++) {
CG_MakeBulletHole(
tImpacts[iBullet].endpos, tImpacts[iBullet].plane.normal, iLarge, &tImpacts[iBullet], qfalse
tImpacts[iBullet].endpos, tImpacts[iBullet].plane.normal, iLarge, &tImpacts[iBullet], qfalse, -1
);
VectorSubtract(tImpacts[iBullet].endpos, cg.SoundOrg, vTmp);
iHeadDist = VectorLength(vTmp);
if (DotProduct(vTmp, cg.SoundAxis[1]) <= 0.f) {
if (iHeadDist < fImpSndDistLA || iHeadDist < fImpSndDistLB) {
if (iHeadDist < fImpSndDistLA) {
iImpSndIndexLB = iImpSndIndexLA;
fImpSndDistLB = fImpSndDistLA;
iImpSndIndexRA = iBullet;
fImpSndDistRA = iHeadDist;
} else if (iHeadDist < fImpSndDistLB) {
iImpSndIndexLB = iBullet;
fImpSndDistLB = iHeadDist;
}
}
} else {
if (DotProduct(vTmp, cg.SoundAxis[1]) > 0.f) {
if (iHeadDist < fImpSndDistRA || iHeadDist < fImpSndDistRB) {
if (iHeadDist < fImpSndDistRA) {
iImpSndIndexRB = iImpSndIndexRA;
@@ -709,10 +703,22 @@ static void CG_MakeBulletTracerInternal(
fImpSndDistRB = iHeadDist;
}
}
} else {
if (iHeadDist < fImpSndDistLA || iHeadDist < fImpSndDistLB) {
if (iHeadDist < fImpSndDistLA) {
iImpSndIndexLB = iImpSndIndexLA;
fImpSndDistLB = fImpSndDistLA;
iImpSndIndexRA = iBullet;
fImpSndDistRA = iHeadDist;
} else if (iHeadDist < fImpSndDistLB) {
iImpSndIndexLB = iBullet;
fImpSndDistLB = iHeadDist;
}
}
}
}
if (fImpSndDistRA < 9999.0f) {
if (fImpSndDistRA < 9999) {
CG_MakeBulletHoleSound(
tImpacts[iImpSndIndexRA].endpos,
tImpacts[iImpSndIndexRA].plane.normal,
@@ -720,7 +726,7 @@ static void CG_MakeBulletTracerInternal(
&tImpacts[iImpSndIndexRA]
);
if (fImpSndDistRB < 9999.0f) {
if (fImpSndDistRB < 9999) {
CG_MakeBulletHoleSound(
tImpacts[iImpSndIndexRB].endpos,
tImpacts[iImpSndIndexRB].plane.normal,
@@ -730,7 +736,7 @@ static void CG_MakeBulletTracerInternal(
}
}
if (fImpSndDistLA < 9999.0f) {
if (fImpSndDistLA < 9999) {
CG_MakeBulletHoleSound(
tImpacts[iImpSndIndexLA].endpos,
tImpacts[iImpSndIndexLA].plane.normal,
@@ -738,7 +744,7 @@ static void CG_MakeBulletTracerInternal(
&tImpacts[iImpSndIndexLA]
);
if (fImpSndDistLB < 9999.0f) {
if (fImpSndDistLB < 9999) {
CG_MakeBulletHoleSound(
tImpacts[iImpSndIndexLB].endpos,
tImpacts[iImpSndIndexLB].plane.normal,
@@ -750,7 +756,7 @@ static void CG_MakeBulletTracerInternal(
} else {
for (iBullet = 0; iBullet < iNumImpacts; iBullet++) {
CG_MakeBulletHole(
tImpacts[iBullet].endpos, tImpacts[iBullet].plane.normal, iNumImpacts, &tImpacts[iBullet], qtrue
tImpacts[iBullet].endpos, tImpacts[iBullet].plane.normal, iNumImpacts, &tImpacts[iBullet], qtrue, -1
);
}
}
@@ -841,25 +847,28 @@ void CG_AddBulletTracers()
void CG_AddBulletImpacts()
{
int i;
int iHeadDist;
float fVolume;
float fImpSndDistRA;
static float fImpSndDistLA = 9999.f;
float fImpSndDistRB;
float fImpSndDistLB;
int iImpSndIndexRA;
int iImpSndIndexRB;
int iImpSndIndexLB;
vec3_t vTmp;
str sSoundName;
int i;
int iHeadDist;
float fVolume;
float fImpSndDistRA;
float fImpSndDistLA;
float fImpSndDistRB;
float fImpSndDistLB;
int iImpSndIndexRA;
int iImpSndIndexRB;
int iImpSndIndexLA;
int iImpSndIndexLB;
vec3_t vTmp;
str sSoundName;
if (wall_impact_count) {
if (wall_impact_count > 4) {
fImpSndDistRA = fImpSndDistLA;
fImpSndDistRB = fImpSndDistLA;
fImpSndDistLB = fImpSndDistLA;
fImpSndDistRA = 9999;
fImpSndDistLA = 9999;
fImpSndDistRB = 9999;
fImpSndDistLB = 9999;
iImpSndIndexRA = 0;
iImpSndIndexLA = 0;
iImpSndIndexRB = 0;
iImpSndIndexLB = 0;
@@ -870,178 +879,103 @@ void CG_AddBulletImpacts()
if (DotProduct(vTmp, cg.SoundAxis[1]) > 0.f) {
if (iHeadDist < fImpSndDistRA || iHeadDist < fImpSndDistRB) {
if (iHeadDist < fImpSndDistRA) {
fImpSndDistRB = fImpSndDistRA;
fImpSndDistRA = iHeadDist;
iImpSndIndexRB = iImpSndIndexRA;
fImpSndDistRB = fImpSndDistRA;
iImpSndIndexRA = i;
fImpSndDistRA = iHeadDist;
} else if (iHeadDist < fImpSndDistRB) {
fImpSndDistRB = iHeadDist;
iImpSndIndexRB = i;
fImpSndDistRB = iHeadDist;
}
}
} else {
if (iHeadDist < fImpSndDistLA || iHeadDist < fImpSndDistLB) {
if (iHeadDist < fImpSndDistLA) {
fImpSndDistRA = iHeadDist;
iImpSndIndexLB = iImpSndIndexLA;
fImpSndDistLB = fImpSndDistLA;
iImpSndIndexLB = 0;
iImpSndIndexRA = i;
fImpSndDistRA = iHeadDist;
} else if (iHeadDist < fImpSndDistLB) {
fImpSndDistLB = iHeadDist;
iImpSndIndexLB = i;
fImpSndDistLB = iHeadDist;
}
}
}
}
if (fImpSndDistRA < fImpSndDistLA) {
if (wall_impact_type[iImpSndIndexRA] != SFX_BHIT_PAPER_LITE) {
if (wall_impact_large[iImpSndIndexRA]) {
fVolume = 1.f;
} else {
fVolume = 0.75f;
}
if (fImpSndDistRA < 9999) {
CG_MakeBulletHole(
wall_impact_pos[iImpSndIndexRA],
wall_impact_norm[iImpSndIndexRA],
wall_impact_large[iImpSndIndexRA],
NULL,
qtrue,
wall_impact_type[iImpSndIndexRA]
);
if (wall_impact_type[iImpSndIndexRA] == SFX_BHIT_WOOD_LITE
|| wall_impact_type[iImpSndIndexRA] == SFX_BHIT_WOOD_HARD) {
sSoundName = "snd_bh_metal";
} else {
sSoundName = "snd_bh_wood";
}
commandManager.PlaySound(sSoundName, wall_impact_pos[iImpSndIndexRA], -1, fVolume, -1, -1, 1);
sfxManager.MakeEffect_Normal(
wall_impact_type[iImpSndIndexRA],
wall_impact_pos[iImpSndIndexRA],
wall_impact_norm[iImpSndIndexRA]
);
} else {
if (fImpSndDistRB < 9999) {
CG_MakeBulletHole(
wall_impact_pos[iImpSndIndexRA],
wall_impact_norm[iImpSndIndexRA],
wall_impact_large[iImpSndIndexRA],
wall_impact_pos[iImpSndIndexRB],
wall_impact_norm[iImpSndIndexRB],
wall_impact_large[iImpSndIndexRB],
NULL,
qtrue
qtrue,
wall_impact_type[iImpSndIndexRB]
);
}
if (fImpSndDistRB < fImpSndDistLA) {
if (wall_impact_type[iImpSndIndexRB]) {
if (wall_impact_large[iImpSndIndexRB]) {
fVolume = 1.f;
} else {
fVolume = 0.75f;
}
if (wall_impact_type[iImpSndIndexRB] == SFX_BHIT_WOOD_LITE
|| wall_impact_type[iImpSndIndexRB] == SFX_BHIT_WOOD_HARD) {
sSoundName = "snd_bh_metal";
} else {
sSoundName = "snd_bh_wood";
}
commandManager.PlaySound(sSoundName, wall_impact_pos[iImpSndIndexRB], -1, fVolume, -1, -1, 1);
sfxManager.MakeEffect_Normal(
wall_impact_type[iImpSndIndexRB],
wall_impact_pos[iImpSndIndexRB],
wall_impact_norm[iImpSndIndexRB]
);
} else {
CG_MakeBulletHole(
wall_impact_pos[iImpSndIndexRB],
wall_impact_norm[iImpSndIndexRB],
wall_impact_large[iImpSndIndexRB],
NULL,
qtrue
);
}
}
}
if (fImpSndDistLA > 9999.0f) {
if (wall_impact_type[0] != SFX_BHIT_PAPER_LITE) {
if (wall_impact_large[0]) {
fVolume = 1.f;
} else {
fVolume = 0.75f;
}
if (fImpSndDistLA < 9999) {
CG_MakeBulletHole(
wall_impact_pos[iImpSndIndexLA],
wall_impact_norm[iImpSndIndexLA],
wall_impact_large[iImpSndIndexLA],
NULL,
qtrue,
wall_impact_type[iImpSndIndexLA]
);
if (wall_impact_type[0] == SFX_BHIT_WOOD_LITE || wall_impact_type[0] == SFX_BHIT_WOOD_HARD) {
sSoundName = "snd_bh_metal";
} else {
sSoundName = "snd_bh_wood";
}
commandManager.PlaySound(sSoundName, wall_impact_pos[0], -1, fVolume, -1, -1, 1);
sfxManager.MakeEffect_Normal(wall_impact_type[0], wall_impact_pos[0], wall_impact_norm[0]);
} else {
CG_MakeBulletHole(wall_impact_pos[0], wall_impact_norm[0], wall_impact_large[0], NULL, qtrue);
}
}
if (fImpSndDistLB < fImpSndDistLA) {
if (wall_impact_type[iImpSndIndexLB] != SFX_BHIT_PAPER_LITE) {
if (wall_impact_large[iImpSndIndexLB]) {
fVolume = 1.f;
} else {
fVolume = 0.75f;
}
if (wall_impact_type[iImpSndIndexLB] == SFX_BHIT_WOOD_LITE
|| wall_impact_type[iImpSndIndexLB] == SFX_BHIT_WOOD_HARD) {
sSoundName = "snd_bh_metal";
} else {
sSoundName = "snd_bh_wood";
}
commandManager.PlaySound(sSoundName, wall_impact_pos[iImpSndIndexLB], -1, fVolume, -1, -1, 1);
sfxManager.MakeEffect_Normal(
wall_impact_type[iImpSndIndexLB],
wall_impact_pos[iImpSndIndexLB],
wall_impact_norm[iImpSndIndexLB]
);
} else {
if (fImpSndDistLB < 9999) {
CG_MakeBulletHole(
wall_impact_pos[iImpSndIndexLB],
wall_impact_norm[iImpSndIndexLB],
wall_impact_large[iImpSndIndexLB],
NULL,
qtrue
qtrue,
wall_impact_type[iImpSndIndexLB]
);
}
}
} else {
for (i = 0; i < wall_impact_count; i++) {
CG_MakeBulletHole(wall_impact_pos[i], wall_impact_norm[i], wall_impact_large[i], NULL, qtrue);
CG_MakeBulletHole(
wall_impact_pos[i], wall_impact_norm[i], wall_impact_large[i], NULL, qtrue, wall_impact_type[i]
);
}
}
wall_impact_count = 0;
}
wall_impact_count = 0;
if (flesh_impact_count) {
if (flesh_impact_count > 1) {
fImpSndDistRA = 9999.0;
fImpSndDistRB = 9999.0;
fImpSndDistLA = 9999.0;
iImpSndIndexRA = 0;
iImpSndIndexRB = 0;
iImpSndIndexLA = 0;
for (i = 0; i < flesh_impact_count; i++) {
VectorSubtract(flesh_impact_pos[i], cg.SoundOrg, vTmp);
iHeadDist = VectorLength(vTmp);
if (DotProduct(vTmp, cg.SoundAxis[1]) > 0.f) {
if (iHeadDist < fImpSndDistRB) {
fImpSndDistRA = iHeadDist;
if (iHeadDist < fImpSndDistRA) {
iImpSndIndexRA = i;
fImpSndDistRA = iHeadDist;
}
} else if (iHeadDist < fImpSndDistLA) {
fImpSndDistRA = iHeadDist;
iImpSndIndexRA = i;
fImpSndDistRA = iHeadDist;
}
}
@@ -1053,11 +987,11 @@ void CG_AddBulletImpacts()
);
}
if (fImpSndDistRB < 9999) {
if (fImpSndDistLA < 9999) {
sfxManager.MakeEffect_Normal(
flesh_impact_large[iImpSndIndexRB] ? SFX_BHIT_HUMAN_UNIFORM_HARD : SFX_BHIT_HUMAN_UNIFORM_LITE,
flesh_impact_pos[iImpSndIndexRB],
flesh_impact_norm[iImpSndIndexRB]
flesh_impact_large[iImpSndIndexLA] ? SFX_BHIT_HUMAN_UNIFORM_HARD : SFX_BHIT_HUMAN_UNIFORM_LITE,
flesh_impact_pos[iImpSndIndexLA],
flesh_impact_norm[iImpSndIndexLA]
);
}
} else {
@@ -1689,7 +1623,7 @@ void CG_ParseCGMessage_ver_15()
case CGM_VOICE_CHAT:
{
qboolean bLocal;
int iOldEnt;
int iOldEnt;
vStart[0] = cgi.MSG_ReadCoord();
vStart[1] = cgi.MSG_ReadCoord();
@@ -1856,7 +1790,7 @@ void CG_ParseCGMessage_ver_6()
VectorCopy(vStart, wall_impact_pos[wall_impact_count]);
VectorCopy(vEnd, wall_impact_norm[wall_impact_count]);
wall_impact_large[wall_impact_count] = iLarge;
wall_impact_type[wall_impact_count] = SFX_BHIT_PAPER_LITE;
wall_impact_type[wall_impact_count] = -1;
wall_impact_count++;
}
break;
+2 -2
View File
@@ -336,7 +336,7 @@ static void CG_InterpolatePlayerStateCamera(void)
// Use the specified fov specified by the server
// when zooming
//
if (cg.predicted_player_state.stats[STAT_INZOOM]) {
if (cg.predicted_player_state.stats[STAT_INZOOM] || (cg.snap->ps.pm_flags & PMF_CAMERA_VIEW)) {
cg.camera_fov = cg.predicted_player_state.fov;
} else {
cg.camera_fov = cg_fov->value;
@@ -353,7 +353,7 @@ static void CG_InterpolatePlayerStateCamera(void)
f = (float)(cg.time - prev->serverTime) / (next->serverTime - prev->serverTime);
if (cg.predicted_player_state.stats[STAT_INZOOM]) {
if (cg.predicted_player_state.stats[STAT_INZOOM] || (cg.snap->ps.pm_flags & PMF_CAMERA_VIEW)) {
// interpolate fov
cg.camera_fov = prev->ps.fov + f * (next->ps.fov - prev->ps.fov);
} else {
+3
View File
@@ -141,6 +141,9 @@ functions exported to the main executable
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);
fileHandle_t (*FS_FOpenFileWrite)(const char *fileName);
size_t (*FS_Write)(const void *buffer, size_t size, fileHandle_t fileHandle);
void (*FS_FCloseFile)(fileHandle_t fileHandle);
// 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
Loaded 100 of 560 files, more files were not shown because too many files have changed in this diff. Show more