Compare commits

...
1962 Commits
Author SHA1 Message Date
bearstonem ead71109fc docs: present OpenMoHAA VR for Quest and Steam Frame 2026-10-14 14:59:59 -07:00
bearstonem aaf287d1fb build(vr): prepare Quest 0.2.0 prerelease
Track the Android Gradle build scripts excluded by the broad build ignore rule. Bump the Android version code and identify the Quest release in the version name.

Ship normal menu startup with cheats, test-map loading, weapon grants, and diagnostics disabled. Preserve and document the dynamic-lighting workaround in the external config.
2026-10-14 14:51:04 -07:00
bearstonem d9968210aa fix(vr): correct visual glitches and reduce rendering overhead
Restore desktop HUD behavior and objective state, fix stereo text lifetimes, HUD placement and colors, sprite culling, and font shader passes. Handle swapchain timeouts and incomplete stereo frames safely, remove forced GPU waits, and correct rendering timing attribution.

Track client-game source additions in CMake. Validated desktop and Android GL1/GL2 builds plus targeted regression and sanitizer checks. Headset appearance and performance remain unverified.
2026-10-14 14:48:22 -07:00
bearstonem bd72599ab7 feat(vr): the HUD comes up when asked, and the compass is whole
The group is hidden now. The off hand's X brings it up for vr_hudTime seconds
and then it fades over 600ms. Almost everything it carries - how much ammo is
left, which way the objective is - is only wanted at the moment it is asked
for, and one that is always there is always in the way of a game about looking
at things.

The press is a timestamp rather than a toggle. The VR layer writes
Sys_Milliseconds into vr_hudShow on the button's down edge and cgame reads it
against cgi.Milliseconds, which is the same function, so there is no state to
latch and no edge to clear on the far side - and a second press during the fade
simply restarts it. Only the down edge counts: holding the button should not
keep restarting the timer, and should not hold the group open either, because a
button held down is a button the player has forgotten about. vr_hud 2 pins it
up, which is what to use while arguing with the layout.

X used to jump, and jump was also on the right hand's A, so it was a button
spent twice. The HUD is worth one of them and jump keeps A. Left Y is the
better candidate and is not used here: it still sends +scores for an objectives
overlay that no longer appears on its own, since the objectives moved into this
group and vr_objectivesAlways forces them on regardless. Moving the HUD there
would cost nothing, and would give X back to jump.

The compass has the two layers it was missing. The damage ring is
stats[STAT_DAMAGEDIR] drawn through compasspain, fading over 1500ms from
whenever the value last changed - it is a headingspinner, which unlike the
objective is the variant that does subtract the view angles, so the direction
arrives in world terms and has to be brought round to the head, and the +180 in
that is because the stat points at the attacker while the ring marks where the
damage came in. The objective is compassobjarrow turned to its angle rather
than the pip that stood in for it while nothing here could draw anything
rotated.

vr_hudGroupY is 0.92, which is 0.63 of the eye. 0.68 is as low as this can
reach at all - vr_hudScale compresses everything towards the middle of the
display, so past that the cvar has nothing left to give and the size has to come
down instead.

And a guard where the font bug actually lives. glGenTextures never legitimately
hands back 0 - it is the reserved name - so a zero means the call did not write,
and nothing downstream notices: Upload32 uploads into texture zero, GL_Bind
binds it, and the surface samples opaque black, which is what every string in
the game looked like. R_CreateImage now asks a second time and says so if it
still comes back empty.

That is a guard and not the cure, because the cause is still unknown. What is
known is that three of the four fonts recover and verdana-14 does not, that it
is the first one created, and that its image is alive and correctly named with
no texture attached - so it was never freed, and R_FreeImage and R_DeleteTextures
both memset, which is how that was ruled out. The trace prints every font atlas
as it is created, with its slot and its texnum, because from the outside an
image that was never created and one created without a texture are
indistinguishable by the time anything draws with it, and telling those apart is
the next step. Until it is found, CG_HudDrawElements still draws its text as
boxes.
2026-08-02 23:35:31 -07:00
bearstonem e6a7c76f84 feat(vr): one HUD in the middle of the view, and the two bugs that hid it
The retail HUD is five menus from ui/hud_*.urc, each aligned to a corner of a
4:3 screen. On a monitor those corners are a glance away; through a lens they
are the far edge, present and unreadable. cg_vrhud.cpp draws the same
information again as one group below the centre of the view.

Nothing is read back out of the widgets, because there is nothing in them to
read: every one is a formatter over cl.snap.ps.stats[], thirty-two integers,
and the .urc files are pure layout - hud_health.urc is "playerstat 0,
maxplayerstat 1, draw it as a vertical bar". cgame has the same array as
cg.snap->ps.stats[]. The .urc files were still worth reading, as the spec for
which stat index and which shader each element uses, and the decode of the two
compass angles is taken from the widgets that already do it rather than guessed:
the heading is the eye yaw less stats[STAT_COMPASSNORTH]/182, a sixteen bit
angle, and the objective is stat/10 - 180 and is already relative to the view,
because hud_compass.urc draws it as a plain spinner and not the headingspinner
variant that subtracts the view angles itself.

It is drawn from cgame rather than as another widget for a reason beyond taste.
cgame's 2D goes through the one full screen window UIView3D::set2D sets up, and
that window is converged as a whole. A widget would arrive with its own window,
which is the first bug below.

Convergence: the correction belongs to the display, not to the window.

R_VRAdjust2DOrtho bent whatever ortho window it was handed, and in this engine
that window is usually one widget - UIWidget::set2D cuts a viewport and an ortho
window to each widget's own frame. The correction was therefore scaled to the
widget, and a 150 pixel compass in a 1680 pixel eye got about a twelfth of the
shift it needed while the objectives, drawn through the full screen window, got
all of it. Every element ended up with a disparity in proportion to its own
width, so each sat at a different apparent depth, and no vergence resolves that
set - which is what "the HUD will not converge" was.

It is R_VRAdjust2DRect now, applied to the viewport and scissor rectangle in
eye buffer pixels, which every 2D window shares. The scissor has to move with
it or a widget the shift has displaced is clipped away at where it used to be.
vr_hudOffset goes back to 1 in autoexec.cfg: 0 was set on a measurement of the
old bug, and it is the one value that cannot fuse at all, because the centre of
each eye's buffer is about seven degrees off its own axis in opposite
directions, so it asks the eyes to diverge by fourteen degrees.

Text: the font atlases had no texture.

Every string drew as a flat black rectangle - 0,0,0 with no glyph structure,
measured off an eye dump rather than a compositor screenshot. The atlas is a 32
bit TGA with a real alpha channel and the shader is correct, so neither of the
obvious causes held. The shader's own stage reported texnum 0, and GL_Bind binds
image->texnum straight, so it was binding texture zero, which samples opaque
black.

The image is alive and correctly named, so it was never freed - R_FreeImage and
R_DeleteTextures both memset, and the name survived. texnum was zero from
creation. R_LoadFontShader now notices and reloads, but it has to free the image
first: R_FindImageFileOld looks in the hash before it looks on disk, so asking
by name returns the very image that has no texture. Three of the four fonts come
back with a texture; verdana-14, the first one created, still comes back as zero
on a fresh load from disk, which means qglGenTextures is not writing to it and
the real bug is upstream in image creation. That is not fixed here, and
CG_HudDrawElements still draws its text as boxes because of it.

Also in here: R_DrawTrianglePic added to the cgame imports, which the UI has
always had as re.DrawTrianglePic and is the only way to draw anything rotated,
so the compass card can turn under a fixed needle the way hud_compass.urc does
it. The retail corner HUD is hidden from the "Hide the HUD when necessary" block
in UI_Update rather than from the explicit Display calls above it, because that
branch returns early and is not the path taken - when it is not, UpdateViews
walks the whole tree and draws every shown menu regardless, which is how
hud_health and hud_ammo stayed on screen through the first attempt.

Bars are R_DrawBox rather than a stretched gfx/2d/blank. That shader is declared
alphaGen oneMinusVertex, which inverts the alpha: the bars asked for at 1 came
out at 0 and the backdrop asked for at 0.35 came out at 0.65.

vr_hudGroupY is 0.73 and does not mean what it looks like. It places the cluster
in the flat frame, which is then scaled to vr_hudScale about the middle of the
display and lifted by the eye's vertical frustum asymmetry, 170 pixels of 1760
here - so 0.73 is a little below the middle of what is actually seen and 0.62
was a little above it. The reachable range is about 0.13 to 0.68 of the eye.

Not done: the damage direction ring, the objective as compassobjarrow rather
than a pip, and the compass worth having, which is one the player takes out of a
pocket and holds.
2026-08-02 23:16:00 -07:00
bearstonemandClaude Opus 5 bec1f4a8d5 fix(render): stop dynamic lights darkening the world, and record why
Firing in the Bocage multiplies roughly a sixth of the screen down by about 4x
for as long as the trigger is held. It is the ground plane, with hard polygon
edges, and it is not black - the texture is still there underneath. r_worldDlights
0 in autoexec.cfg stops the world responding to dynamic lights at all, which
loses flashes lighting the scenery and is the smaller loss.

The cause is not found. Seven theories were tried and all seven were wrong, so
what this mostly commits is the evidence, in docs/markdown/04-coding/05-dlights.md
next to the gl4es notes, so that picking it up again does not start from nothing:
the cadence table and the frame difference that measured the 4x, a table of every
dead theory with what killed it, the worked texcoord arithmetic showing the faces
land correctly, and the one hard contradiction to resume on - every component of
the dynamic lightmap path measures correct end to end, and switching the path off
makes the symptom stop.

Two things in there are recorded specifically because they look damning and are
not. "texels 9275" against "rows 28" cannot fit, but R_RealDlightFace counts
c_dlightTexels before it knows whether any light landed and then bails at
!added without committing to dli.allocated, so failed surfaces are counted and
take no space. And R_UploadDlights' guard on tr.pc.c_dlightSurfaces reads like it
must always be zero from the back end, because R_IssueRenderCommands clears the
counters before running the command list - it is not what happens, measured at 35
surfaces. That guard is gone anyway: the height below it is the same test done
against the allocator's own state rather than against a debug counter.

The workaround is its own cvar rather than a level of vr_traceDlight, which is
what it was while it was being tested. A diagnostic switch that also changes
behaviour means turning tracing off silently brings the bug back, and this port
has already lost a day to a cvar that did not do what its name said.

The diagnostics stay, off. 1 reports what each upload contained and where every
dlit face landed in the atlas; 2 stains the whole atlas white and paints the lit
texels magenta, which is read off the walls rather than out of the log; 3 skips
ProjectDlightTexture, which was measured never to run here and is kept because
proving that cost a run. The first stain was dark green and was useless in a
level made of hedgerows - white can only brighten, so it cannot be mistaken for
foliage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 17:12:39 -07:00
bearstonemandClaude Opus 5 6f443949ae fix(vr): the death screen was drawn on the player's face
The stats screen the game raises when the player dies, and again at the end of
a mission, went into both eye buffers as screen space 2D - at the near plane, a
hand's width away, with no disparity to fuse and each eye warping it through its
own asymmetric frustum. That is the same fault 013b2f5b fixed for the mission
briefing, and the fix there did not cover this one for two separate reasons.

cg_view.c raises it with UI_ShowMenu, which sends the widget a showmenu event
directly instead of going through MenuManager. The menu never reaches either
menu stack, so CurrentMenu() does not return it and UI_FullscreenMenuUp() cannot
see it however fullscreen it is.

And it is not fullscreen: statsscreen_failed.urc has its "fullscreen 1" line
commented out. It is a 640x480 overlay the flat game draws over the live view,
so even as the current menu it would still answer no.

So neither test could have caught it, and asking a third question about menus
would have been guessing at the next one. It now asks about intermission, which
is the same condition CG_DrawActiveFrame itself uses to decide to put the screen
up - if the game thinks it is showing a stats screen, the panel is where it
goes. That also covers mission success, the MOHTA mission_* screens and the
multiplayer scoreboard, which are the same kind of content with the same
problem.

Confirmed on the device: the screen is now a quad in the room. Its text renders
as black boxes with a sliver of the font atlas showing through, which is a
separate defect and untouched here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 17:12:19 -07:00
bearstonemandClaude Opus 5 7bb71e7550 build(vr): the knobs this session added, and the harness back on
The throw cvars are set here as well as defaulted in code, and that is the point
rather than duplication. They are CVAR_ARCHIVE, so a device that has run before
keeps whatever omconfig.cfg holds and a changed default in the source does
nothing at all. That cost a build: the floor stayed at its old 0.45 while the
curve moved under it, and every throw came out clamped to the same 45% however
hard it was thrown. autoexec runs after omconfig and wins.

Measured values, not guesses - vr_throwFull 340 is a hard overhand, against
gentle lobs at 145 to 192.

Also on: vr_traceUse, vr_traceHolster and vr_traceThrow, and the test harness -
cheats, give all, and m4l1 - because weapon work is still in progress. None of
that should ship; see 6e86e55c for turning it back off.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 15:49:25 -07:00
bearstonemandClaude Opus 5 711cad20e6 feat(vr): reach into the world - use, holsters, ladders and thrown grenades
Four interactions that all needed the same thing: the hands' positions and
velocities on the other side of the game module boundary. They share the
plumbing, so they share a commit.

use moves to B on the weapon hand, where the reference puts activate. The
objectives list keeps the left hand's button; it had been bound to both, which
was a button spent twice on one rarely opened screen. The trace also starts from
the head's real position now rather than the body's notional eye - the two come
apart exactly when leaning through a doorway to reach the thing on the far side.

Weapons live on the body, the way Half-Life: Alyx does it: pistol at the right
hip, grenades at the left, rifle and smg over the shoulders. Reaching back to
where a weapon came from puts it away, reaching anywhere else swaps - holstering
on any zone would have cost two gestures for every swap. Zones are measured from
the head and rotated by the head's heading, so they stay on the body rather than
wandering as the player turns.

Ladders are climbed by pulling on them. MOHAA moves a climbing player by the
root motion of the climb animation, with pmove skipped entirely, so this runs
after the animation rather than instead of it: the animation still plays and the
distance travelled is the distance the hand pulled. Both grips, averaged when
both are held, and the grips stop meaning reload and rifle-steady while on a
ladder.

Grenades leave along the arm. Which instant of a swing to read is the whole
problem and took several passes: averaging across the release blends the wind up
with the follow through; the peak of the whole swing is usually the *backswing*,
which threw grenades over the player's shoulder. What works is the natural
gesture's own shape - take the direction the hand had as it let go, then find
the fastest sample that agrees with it, which excludes the wind up by
construction. Strength is a fraction of the game's own throw so all of MOHAA's
grenade tuning survives.

The sideways damping is the one deliberate lie. An underhand swing crosses the
body, so the hand really is moving sideways at release - measured, lobs drifted
left by up to 0.73, more sideways than forward. Damped in proportion to how
gentle the throw is, so hard throws keep their true direction.

A weapon wheel is included and is not finished: its input works and a tap of the
same stick holsters, but the ring never appeared on screen and the drawing was
not chased down. It is harmless - a hold selects nothing and does nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 15:49:25 -07:00
bearstonemandClaude Opus 5 15471f7578 feat(vr): a hand is always drawn, and the weapon hand is only a hand
Two changes to what the first person model is for.

Being unarmed is not a reason to have no hands. Flat, that model exists only to
hold a weapon, so putting the gun away hides the arms with it and nobody
notices; in a headset the player is holding two controllers whether or not there
is anything in them, and hands that vanish read as tracking having dropped out.
No mesh work was needed - triggerhand and lefthand are already separate
surfaces, so the unarmed case shows those two and hides garandhand, a left hand
posed around a rifle that is not there. Zoom, death and cg_drawviewmodel still
hide, being about something else entirely.

The weapon hand's copy now draws triggerhand alone. viewsleeves is a single mesh
carrying *both* forearms - weighted 27% to Bip01 R Forearm and 27% to
Bip01 L Forearm, with both elbows, shoulders and clavicles - so drawing it on a
model anchored to the right controller hung a disembodied left sleeve in the air
beside it. What is left is a whole hand rather than a stump: triggerhand is
weighted to Bip01 R Hand, every R finger bone, and helper Rwrist. The wrist is
in, the forearm is not, and there is no way to get part of one without
re-authoring - the forearm exists only inside the two-armed sleeve.

Those weights were read out of the retail USarmyplyr.skd rather than guessed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 15:49:00 -07:00
bearstonemandClaude Opus 5 74dc964962 fix(vr): the use trace was aimed at the player's feet
Use worked about half the time, and the half it worked was luck.

cg.refdefViewAngles is not only the view. CG_OffsetFirstPersonView overwrites it
with the player model's animated *head bone* orientation on the paths that place
the view from a world position, and CG_EyeAngles samples whatever is left there
when the packet is written. Those angles travel up in the usercmd as usereyes_t
and become Player::m_vViewAng, which is what getUseableEntities aims with.

Measured on device, that left a pitch pinned between 73 and 86 degrees. Every
press traced about 77 units into the floor and stopped there - the trace
fractions were 0.87 to 0.93 - and the box at the end of it caught the player's
own entity plus whatever trigger happened to be underfoot. Standing on a
TriggerUse was what "working" meant.

In VR the eye angles now come from the player state's view angles, which are the
headset's and only the headset's: CL_VRMove writes the head's yaw and pitch into
them every frame and nothing animated gets a say. No recoil kick or lean in them
either, which is right for reaching at a door handle.

Flat play keeps the old source. There the two agree except for kick and lean,
and changing where a desktop player's use is aimed is not what this is for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 15:49:00 -07:00
bearstonemandClaude Opus 5 b51ed2e430 docs: the shipped config no longer starts in the test map
Two spots in the status went stale with the change above. The device
configuration section said the harness ships on and to clear it to play
properly, which was true when written and is now the reverse. The hands section
said both hands need a roll of 180 in the config, which is now the compiled
default.

Both replaced with the rule they are instances of: nothing the game needs to be
correct lives only in autoexec.cfg, because that file is not in the APK.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 14:36:02 -07:00
bearstonemandClaude Opus 5 aa2fbeaf94 fix(vr): the hand rotation the models need is the default, not an override
vr_weaponAdjust and vr_offHandAdjust both defaulted to a zero roll, and the 180
that makes the hands come out the right way up existed only in
misc/android/autoexec.cfg. That file is deliberately not packaged into the APK
- it lives next to the game data, so that the config survives reinstalling the
build - which means anyone installing the APK on its own got upside-down hands
and no way to guess why.

Both defaults are now 180, which is the value measured on device rather than a
guess. The config still sets them, so it stays the place to tune them from;
it is no longer the only place the right answer exists.

The comment explains why the number is not arbitrary: anchoring forces the
bone to take the controller's orientation, and a wrist bone's local axes do not
run the way a controller is held, so the mesh inherits that mismatch as a
constant half turn about the aim axis. The two hands are mirrored and were
still measured to need the same 180, which is why they remain two cvars.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 14:35:03 -07:00
bearstonemandClaude Opus 5 e45388bd01 chore(vr): the config that ships starts the game, not the test map
The harness was switched back on to tune the hands and left on: cheats, every
weapon handed over a second after spawn, and m4l1 loaded straight past the
menu. That is how you tune weapon alignment without replaying a level on every
build, and it is not how anyone should be handed the game.

cheats, vr_testStart and vr_startMap are empty again, with the working values
kept in the comment beside the explanation of why each needs its own timing.
The commented example said vr_startMap "" - which is the off value, not the
harness value, so the comment did not actually record how to turn it back on.
It says m4l1 now.

The reasoning for why m4l1 is the right test map stays where it is. It was
worked out from the game's own scripts rather than from reputation, and it will
be wanted again the next time the hands need looking at.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 14:34:53 -07:00
bearstonemandClaude Opus 5 dcd85654a4 docs: record the frame cost of full resolution, and what it rules out
Section 4 said rendering at 36% of the pixels was the largest cheap win left. It
has been taken, and it was not cheap - it was a trade.

Measured in the Bocage at 1680x1760 per eye: 90 fps standing at spawn with an
8-9 ms eye pass, 77-85 fps moving with 11-12 ms against an 11.1 ms display
period, so most frames while moving are reprojected. Kept on how it plays rather
than on the number, which is a legitimate call and now a recorded one instead of
something for the next reader to rediscover and wonder about.

Two consequences replace the old next steps. MSAA is out - not because it is
expensive, since it resolves in tile memory, but because there is nothing spare
on the CPU side and the GPU was never the constraint. And the frame split cannot
be trusted: it reports world 1 ms against hud 5 ms, which is Set2DWindow's flush
charging the world's deferred draws to the first 2D call. gpuwait is still 3 ms,
so the GPU idles and the missing time is CPU issuing draw calls.

Fixing that attribution is now step 1, because half the frame is presently
charged to the wrong thing and every later decision about the budget rests on it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 12:23:57 -07:00
bearstonemandClaude Opus 5 214933c5fe perf(vr): render the eyes at the resolution the runtime asks for
vr_resolutionScale has been at 0.6 since the days when a frame cost 50-60 ms per
eye, which meant the headset was being given 1008x1056 against a native
1680x1760 - 36% of the pixels it has.

The measurement that justified it has since answered the opposite question.
Rendering at 36% of the pixels bought only 23% of the frame time back, which is
what proved the cost was never fill rate: it was CPU in rend2's back end binding
a GLSL program per surface per eye. Swapping to renderergl1 on gl4es took the eye
from 50-60 ms to 4-6, and nothing has claimed that budget since.

So it goes back to 1. The cvar stays rather than being deleted - it is still the
first question worth asking of any frame time regression, and it is the cheapest
thing to trade if a later feature wants budget it has not got.

Measured on the device afterwards, in the Bocage:

    standing at spawn   90.0 fps   eyes 8-9 ms
    moving in the level 77-85 fps  eyes 11-12 ms, most frames over the 11 ms period

So this does not hold 90 Hz while moving and the compositor is reprojecting a
good share of frames. Kept anyway, on the judgement of how it actually plays -
the picture is much sharper and the reprojection is not felt. The number is
recorded here so the trade is a known one rather than a surprise to whoever reads
the frame times next.

Two things follow. There is now no headroom for MSAA. And the frame split cannot
be taken at face value: it reports world 1 ms against hud 5 ms, which is the
Set2DWindow flush attributing the world's deferred draw calls to the first 2D
call that forces them out - the trap in QUEST_PORTING_GUIDE.md section 7.1. The
one figure that is trustworthy is gpuwait, still 3 ms, so the GPU remains idle
and whatever the 11 ms is, it is CPU side.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 12:23:14 -07:00
bearstonemandClaude Opus 5 fb2855f664 docs: bring the status up to date with the port as it stands
It had drifted a long way. It still described renderergl2 as the renderer, said
head aim was the next real piece of work, listed the weapon handling as not
begun, and called the redundant renderer restart harmless when it was the entire
black menu bug. All four are false, and it is the first file a new session reads.

Rewritten against what is actually true and verified, with the phase table, the
build commands and the outstanding list all matched to the tree.

What is new rather than corrected:

  - the frame composition rule, which is the thing most likely to be tripped over
    next: cg.refdef.vieworg is not the camera, both routes to fixing that, and
    why half of each amplifies instead;
  - the hands - separate surfaces, tag anchoring, and the measurement that
    corrected the guess about tag_weapon_left;
  - the colour space, and that the sRGB format alone looks like the whole fix;
  - the world being 52.5 units to the metre and how the game's own art says so;
  - starting the logcat capture before handing over the headset.

Section 4 now says plainly what has *not* been confirmed on the device - the two
handed hold, the reload tap, off hand steering - rather than leaving them to read
as working. And it names the largest cheap win left, which is that
vr_resolutionScale is still at the 0.6 that was set when a frame cost ten times
what it now costs, so the game is rendering 36% of the pixels the headset has.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 12:02:14 -07:00
bearstonemandClaude Opus 5 649f8f682d docs: fold this session's findings into the porting guide
Everything here was paid for on the device over one session, and none of it was
in the guide because none of it had happened yet.

New material:

  4.8.1  The engine's camera variable is probably not the camera. Once the head
         pose is composed in the renderer, refdef.vieworg is short of the real
         camera by the head's play space offset, and the game module never sees
         it. Gives the three symptoms that identify it - drifts on head turns,
         lags snap turns, moves at double rate - and both correct routes, with
         the warning that taking half of each is what produces the third.

  4.8    World scale is the engine's own number, not a feel value. Where to find
         it (an asset pipeline comment, the player bounding box) and why getting
         it wrong reads as oversized hands rather than as a scale error.

  6.4.1  Anchor on the hand, not the model origin: the tag composition inverted,
         which anchor suits which hand, and the instruction to measure every
         candidate rather than trust that it resolved. Records that the guess
         this replaced was wrong.

  6.4    The adjustment string's first field is the model's scale.

  9.1    A map-loading harness has to wait for idle, and the menu is
         CA_CINEMATIC rather than CA_DISCONNECTED.

  9.4    Verifying the change landed, extended to the case where a refactor
         changes what an argument *means* and the compiler cannot help.

  9.4.1  Make silent paths speak - print on every exit, naming the state that
         decided it.

  9.4.2  On-device logs rotate, so start the capture before handing the headset
         over.

The trap index is reordered to put the frame, the meaning-changing refactor, the
world scale and the anchor near the top, which is where their cost puts them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:56:46 -07:00
bearstonemandClaude Opus 5 7ce4e07352 fix(vr): scale the world by the game's own number, and the model by its own field
Reported as the hand and weapon models rendering too large. Two causes, one of
them the same knob failing to do what its name says.

**vr_worldscale was 32.** That is roughly the id Tech number for a game built in
inches and is simply the wrong engine's. MOHAA's art is authored at 16 units per
foot, which its own tik files state where they convert from centimetres:

    models/weapons/bar.tik:
    scale 0.52   // 16/30.5 since world is in 16 units per foot

16 / 0.3048 = 52.5 units to the metre, and the player dimensions agree - MAXS_Z
94 and DEFAULT_VIEWHEIGHT 82 come to 1.79 m standing and 1.56 m to the eye, where
32 would have made the player over two and a half metres tall.

Being out by a factor of 1.64 does not present as a scale error. Everything
measured in metres and handed to the game was too small, so a hand held half a
metre out was placed at 16 units rather than 26 - while the hand *model* is
authored at the game's true scale. A correctly sized model drawn far too close
reads as oversized, and there is nothing in the world to compare it against. Your
own hands are the only reference object, which is why this surfaced now and not
when the world first rendered.

Set in autoexec.cfg as well as changed in code, because vr_worldscale is
CVAR_ARCHIVE and the value already stored on the device beats any new default.
That trap is documented two sections above the one this was found in.

**The adjustment string's scale field did nothing to the model.** It is
scale,right,up,forward,pitch,yaw,roll, and the reference uses the first field as
the entity scale - VrInputWeaponAlign.c reads it into test_scale and cg_weapons.c
returns it as the model's scale. Here it only ever scaled the offset, so it was a
knob that appeared inert on a model that was the wrong size. Now applied to
model->scale, and applied before anything asks for a tag: TIKI_Orientation
multiplies the tag origin by the entity scale, so anchoring first and scaling
afterwards would slide the hand off the controller by whatever the scale changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:56:46 -07:00
bearstonemandClaude Opus 5 43e29a300a docs: how to port these engines to Android and Quest, from three ports
Written after three of them rather than before, and aimed at the next one. The
Quake lineage is where the advice is most exact - id Tech 2/3 and everything
descended from it - but sections 3 to 10 transfer to any C or C++ engine of that
era.

Draws on this port, the Homeworld: Unbound port (1999 engine, GL 1.x on gl4es,
meson) and the openblack VR port (modern C++, bgfx, no gl4es), plus RTCWQuest as
the finished reference all three lean on. Where the three disagree the guide says
so, and where something is believed rather than measured it says that too.

The parts worth having are the ones that cost days: the renderer choice and the
numbers behind it, the gl4es boundary in full, the adb data directory ownership
rules, the sRGB swapchain finding, the off centre frustum sign and why either eye
alone still looks correct, and section 9 on debugging a device with no console -
prove the renderer can draw before believing a negative, show a probe reaches
what it measures, verify the change landed, and never change code and
configuration in the same step.

Section 4.4 carries a correction to the Homeworld notes it came from, which
claimed an sRGB swapchain without write control would over darken. It does not;
it washes out identically to a linear one, and believing otherwise is what let
this port sit in exactly that state for months while reading as already fixed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:46:31 -07:00
bearstonemandClaude Opus 5 f52d6e5163 build(vr): test on the bocage, and knobs for the hand alignment
vr_startMap was still pointing at m1l1, which opens on a long scripted sequence -
a poor place to look at your hands. m4l1 was chosen off the game's own data
rather than by reputation:

  - its script calls itself THE BOCAGE and opens on the Normandy hedgerows with
    Manon, spawned with her AI disabled and set nodamage, so nothing is shooting
    while you look at your hands;
  - 2 spawn references in 538 lines of script, against m1l2a's 59 in 3660.
    Almost nothing is scripted to happen at the start;
  - global/loadout.scr hands the player a colt45 and an m1_garand and selects the
    rifle, so there is a weapon in hand at spawn.

That last point is why it suits the hands specifically: the Garand is the weapon
that swaps the left hand surface to garandhand, so the level exercises both hand
meshes rather than only the common one.

vr_offHandAdjust is new, in the same seven fields as vr_weaponAdjust. Both carry
a roll of 180 and no offsets. The offsets are zero because each hand is now
anchored on its own bone, so there is no built in offset left to cancel - the
-10 right and -6 up the weapon used to need were correcting an anchor that no
longer exists, and keeping them would push the gun the wrong way. The roll is
not a fudge: anchoring forces the bone to take the controller's orientation, and
a wrist bone's local axes do not run the way a controller is held, so the mesh
inherits a constant twist. Both files say which field to reach for if the model
comes out on its side rather than upside down, and that the two hands are
mirrored so their corrections need not match.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:46:11 -07:00
bearstonemandClaude Opus 5 4f5b54c74c feat(vr): a hand on each controller, placed in the renderer's frame
The first person model already has the hands as separate surfaces - triggerhand,
lefthand, garandhand and viewsleeves on USarmyplyr.skd - so putting one on each
controller needs no mesh work at all. The weapon hand's copy drops the left hand
surface and a second copy is drawn on the off hand carrying only that, using the
same Surface_NameToNum and MDL_SURFACE_NODRAW the game already uses to swap
lefthand for garandhand on rifles.

Two things had to be right first, and both were wrong in ways that looked like
tuning problems rather than faults.

**The frame.** cg.refdef.vieworg is not the camera. R_VRComposeView adds the
head's play space offset to it, rotated into the body's frame, after cgame is
finished (tr_vr.c). So anything anchored on vieworg alone is left behind by
exactly the head's offset within the play space - and because the head swings
about the neck, every look around moved it, and a snap turn left it behind
entirely since a stick turn moves the body frame that a head relative offset
knows nothing about.

Both hands are now reported measured from the tracking origin, the frame
VR_PoseToView puts the eyes in, and composed the way the renderer composes the
camera:

    bodyAngles = (0, viewYaw - baseYaw, 0)
    handWorld  = vieworg + bodyAxis * trackingOffset

RTCWQuest reaches the same place by a different road - convertFromVR rotates a
head relative offset by viewangles[YAW] - hmdorientation[YAW] and the -64 plus
hmdposition[1] * worldScale rebase then replaces its height, which comes to the
same thing. Either route works. Taking half of each does not, and did not: a
head relative offset composed as though it were play space leaves the hand at
vieworg + R*(hand - head) while the camera is at vieworg + R*head, so the head's
movement is counted twice and every hand movement is amplified. That is what
"the right hand is accelerated" was, and it happened because VR_GetWeaponPose
was left reporting the old frame while its caller had moved to the new one - the
signature is identical either way, so nothing complained. The header now says so
at length.

**The anchor.** A hand drawn at the model origin sits wherever the animation put
it, which for a rifle is a long way out in front. The model is now moved so the
hand's own bone lands on the controller instead, inverting the composition the
engine itself uses in Entity::GetTagPositionAndOrientation. The off hand anchors
on Bip01 L Hand and the weapon hand on tag_weapon_right, because what the player
is holding there is the gun and the controller is its grip.

Every candidate anchor is measured and logged rather than trusted, which earned
itself immediately: tag_weapon_left was assumed to be an unused slot parked at
the origin and is nothing of the sort (23.5 units out), while the weapon hand's
lookup was returning -1 in silence and anchoring nothing. Both now report what
they found and how far out it is, and the early return says which precondition
failed.

Tracking is confirmed 1:1 on both controllers on the device. What is left is the
wrist bones' own rotation convention, which is a constant and lives in
vr_weaponAdjust and vr_offHandAdjust.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:45:57 -07:00
bearstonemandClaude Opus 5 48b5876e3f fix(vr): the menu is CA_CINEMATIC, so the start map never loaded
vr_startMap waits for the client to sit idle before loading, because a map
started from autoexec.cfg runs during Com_Init and the game's own startup tears
it straight back down again. It counted only CA_DISCONNECTED as idle.

MOHAA's main menu is drawn over a static pic, and the enum says what that means:

    CA_CINEMATIC   // playing a cinematic or a static pic, not connected to a server

So the client is CA_CINEMATIC at the menu and never CA_DISCONNECTED. idleSince
was cleared every frame the menu was up, the four second wait could never
accumulate, and the map simply never loaded. Eight seconds sitting at the menu
was plenty; the timer just kept resetting. Confirmed by the state it now prints:
9, which is CA_CINEMATIC.

The reason this took a round trip to find is worth more than the fix. The
vr_testStart branch three lines below prints either way, and says why:

    // Printed either way. A hook that silently does nothing is indistinguishable
    // from one that never ran, and telling those apart has cost enough already.

vr_startMap printed only on success, so its silence could not be told from "ran
with an empty cvar". It now prints unconditionally and names the state that let
it through, so the next time this misbehaves the log says which.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:45:31 -07:00
bearstonemandClaude Opus 5 bd480975a3 fix(vr): stop the driver encoding the engine's colour a second time
Reported as flat lighting - the whole scene lit from everywhere, shadowed faces
pulled up towards lit ones. That reads as a lighting fault and is not one: the
shading is untouched, and a defect that moves the entire scene by one curve is
the pipeline rather than any model's normals.

The swapchains have always been GL_SRGB8_ALPHA8, which is the right declaration.
This engine's output is display referred - the same values a monitor would have
been handed in 2002 - so telling the compositor the images are sRGB is what makes
it pass them through instead of encoding them again.

What the format does not do on its own is stop GL encoding on the way *in*.
ES 3.0 converts linear to sRGB on every write into an sRGB attachment, blits
included, and core ES has no state to turn that off - GL_EXT_sRGB_write_control
is what adds the switch, and it defaults to on. So the driver was encoding
already encoded colour and the compositor was faithfully passing it through:

    stored = encode(V), displayed = encode(V)

which is the same lifted mid tones as declaring the images linear, reached from
the other side. The format line looks like the fix and is half of it, which is
why this survived so long - a port that has done only that half reads as one
that cannot possibly have the washed out bug.

Measured on the Homeworld port, where the same defect arrived by the linear
route: a mid tone the data puts at 0.19 came out at 0.45, against 0.473 for a
straight sRGB encode of it, and the ratio between the brightest and darkest
tenth of a hull collapsed from about 5:1 to 1.76:1.

Not routed through gl4es. gl4es keeps no copy of this enable and never sets it
itself, so disabling it once holds for the whole run, the engine's own rendering
through gl4es included.

Confirmed on the device: "sRGB write conversion off" in the log, and the picture
is correct - which means considerably darker. That is how the game is meant to
look.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 23:45:20 -07:00
bearstonemandClaude Opus 5 6e86e55c08 chore(vr): do not ship the test harness switched on
The config that goes out had cheats enabled, every weapon handed to the player a
second after spawn, and a map loaded straight past the menu. That is a harness
for tuning weapon alignment without replaying a level each build, and it has no
business being the way anyone is handed the game.

cheats, vr_testStart and vr_startMap are now empty, with the working values kept
in a comment next to the explanation of why each one needs its own timing -
autoexec runs before there is a map, and a map loaded from autoexec is torn back
down by the game's own startup.

vr_captureEye off and vr_traceFrame back on, which are the normal values for
both.

vr_weaponAdjust keeps the value being tuned; it is a correction the weapon
genuinely needs, not a testing shortcut.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 21:10:06 -07:00
bearstonemandClaude Opus 5 013b2f5bbf fix(vr): put in-game fullscreen menus on the panel, and load the test map late
Three things, all found by running it.

The mission briefing was drawn onto the player's face. VR_UseScreenLayer only
asked whether clc.state was CA_ACTIVE, so a fullscreen menu that comes up while
the player is still in the world skipped the quad layer and was drawn as screen
space 2D into both eye buffers - at the near plane, a hand's width away, with no
disparity to fuse and each eye warping it through its own asymmetric frustum.
That is exactly what the panel exists to prevent; nothing in-game was reaching
for it. It now checks UI_FullscreenMenuUp as well.

The log said so before the headset did: "view3d 0" with the eye passes still
running means the 3D scene is not being drawn at all, which only happens when a
fullscreen menu is covering it.

map in autoexec.cfg never had a chance. That file is exec'd during Com_Init and
the game's own startup - the intro stages, then the menu - runs afterwards and
tears down anything loaded there. vr_startMap now waits until the client is
sitting idle at the menu and loads it then. vr_testStart also prints
unconditionally: a hook that silently does nothing is indistinguishable from one
that never ran, and telling those apart has cost enough already.

vr_captureEye is a plain archived cvar rather than a VR_TuningCvar. Those force
their default at every start, which is right for a value still being argued with
and wrong for a switch - it made the config's own setting impossible to honour
and cost a device run to notice. The handoff warns about this exact trap.

vr_traceFrame is off in the shipped config: three lines a second rolls anything
that prints once out of logcat within a minute.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 19:46:46 -07:00
bearstonemandClaude Opus 5 ce91fd1bf7 feat(vr): per weapon alignment, and a way to test it without replaying the level
The view model is authored to sit at the camera with the arms reaching forward,
so anchoring its origin at the controller leaves that built-in offset in place
and the gun lands near the player's elbow. Rotation was already correct; only
the position was wrong, which is exactly what this fixes and exactly why no
amount of getting the hand pose right removes the need for it.

Same mechanism as the reference's vr_weapon_adjustment_<id> (rtcw
cg_weapons.c, VrInputWeaponAlign.c), as one tunable cvar:

    vr_weaponAdjust "scale,right,up,forward,pitch,yaw,roll"

Two details from theirs that are easy to get wrong and are kept here. The
rotation correction is composed in the weapon's own frame rather than added to
the angles, which is only right for one axis at a time. And the offset is
applied along the corrected axes, after the rotation - that ordering is why a
model can rotate correctly and still sit in the wrong place. It is a cvar so it
can be dialled in by pushing a config and relaunching, with no rebuild in the
loop.

CL_RunStartupCommand runs vr_testStart once, a second and a half after the
player is in the world. Setting up a weapon test otherwise means playing through
to wherever the game hands one over on every single build; there is no console
in a headset to type "give" into, and autoexec runs before there is a map, let
alone a player to give anything to. The delay is because CA_ACTIVE arrives
before the player has finished spawning and a give aimed at nothing is dropped.
It re-arms on every map load rather than firing only once per run.

The reference keeps an adjustment per weapon. This is a single global one until
the numbers for each are known - which is what the harness is for.

Not yet run: the headset dropped its connection before this could be installed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 08:39:04 -07:00
bearstonemandClaude Opus 5 db8dfae0bd feat(vr): reload on a tap of the weapon hand's grip
The reference's gesture (VrInputDefault.c): press and release the dominant grip
inside vr_reloadtimeoutms and it sends +reload, then -reload a frame later
because the game wants to see the key held for a tick before it is let go. A
long hold is their weapon wheel, which this port does not have, so holding
simply does nothing rather than reloading late.

The weapon hand grip was a second binding for use. Use stays on the right stick
click, which is where the reference has it too - +activate on ovrButton_Joystick
- so nothing is lost.

vr_reloadTapMs is their vr_reloadtimeoutms under this port's naming.

Built, not yet run: the headset has been unreachable since the previous commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 08:12:06 -07:00
bearstonemandClaude Opus 5 046e2dd9a6 feat(vr): put the weapon in the player's hand, from the reference
Four pieces, each adapted from RTCWQuest rather than invented.

Aim. Weapon::GetMuzzlePosition derives a shot from player->m_vViewAng, which is
MOHAA's analogue of rtcw g_weapon.c:1904. It now takes the controller's pitch
and the yaw the hand leads the head by, added to the view yaw the game already
has - the controller's absolute yaw means nothing to the game, since the player
can snap turn on the stick and the play space has an arbitrary forward. Only the
trace moves; the camera stays on the head.

The angles reach fgame through gameImport_t rather than the usercmd, which has
no spare field - angles[3] is the view direction and buttons is packed. A
dedicated server answers false and keeps the aim it had.

Placement. The first person model is MOHAA's FPS view model, positioned by
CG_OffsetFirstPersonView against the camera and given the walk bob. Both are
wrong in a headset: the hand has its own position, and shaking the view model
when the camera is the player's head is a way to make people ill. It now goes
where the hand is - RTCWQuest's CG_CalculateVRWeaponPosition, including
dropping the origin to the feet and adding the measured head height back so the
weapon hangs at the height the player is really holding it, rather than off the
camera where crouching would drag it about.

Selection. Nothing was bound to it at all, and there is no button left - the
triggers fire, both face buttons on each hand are objectives and jump, and the
sticks and grips are duck and use. The reference does not spend a button either:
the dominant thumbstick up is weapprev and down is weapnext, gated on the
sideways component so it cannot be read as a turn and edge triggered so a held
stick does not run the inventory. This port's turn already ignores that stick's
Y axis, so nothing was displaced.

Two handed hold. Off hand grip squeezed with the hands close together points
the weapon along the line between them instead of along the weapon hand alone -
how a rifle is actually held, and steadier, because a wobble at one hand is
damped by the distance to the other. Roll is halved rather than taken from the
line, which carries none. The off hand grip was a duplicate of use; the weapon
hand's still opens doors.

The suggested binding array was 16 with 14 in use. Now 32.

Aim and placement are built but not yet confirmed on the device.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 08:10:24 -07:00
bearstonemandClaude Opus 5 411c3d9bc2 docs: stop pointing at diagnostics that no longer exist
r_traceSurf and the r_noCull/r_noDepth overrides were removed with the bugs they
were built to find. The technique the doc is actually teaching - ask the driver,
not gl4es - stands on its own and is four lines to put back.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 07:39:07 -07:00
bearstonemandClaude Opus 5 862d36a9ba chore(vr): take the diagnostics back out
Removes r_flatColor, r_traceSurf, r_forceGenericStage, r_noCull, r_noDepth,
r_noFog, r_invertCull, vr_debugPanel and its magenta panel clear, along with
R_TraceSurface, R_DriverGet, R_FlatColorPush/Pop and the GetFloatv/IsEnabled
entries added to qgl.h for them. Around 570 lines.

Everything they were built to find is fixed, and the fixes are all still here:
the cull face forced past gl4es's cache, RB_SurfaceFace's index type, the window
resize vid_restart, the frustum built from the runtime's tangents, the terrain
cone sized to the headset, and the VR layer's state calls routed through gl4es.
Verified rendering on the device after the strip, with no overrides at all.

vr_captureEye stays, defaulted off. It writes the eye buffer to a TGA and it is
the one probe that consistently earned its keep - a picture settled in one look
what rounds of description could not. Inert unless switched on.

misc/android/autoexec.cfg is down to that single line. Nothing in it is load
bearing any more.

Also records a third instance of the session's recurring mistake in the gl4es
doc: r_noDepth was declared, registered and tested for several device runs while
the edit meant to read it had silently failed to apply. Every result attributed
to it was a no-op, and it sat in the "known good" configuration taking credit for
what disabling culling was actually doing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 07:38:40 -07:00
bearstonemandClaude Opus 5 11b1597f14 docs: write up the gl4es boundary, which is where the days went
Three bugs on this port presented identically - geometry submitted, vertex data
correct, indices in range, matrices correct, on screen, unclipped, no GL error,
nothing drawn - and all three were gl4es state calls being dropped. The
framebuffer binding, the viewport, and finally the cull face, which cost most of
a session on its own.

The underlying fact is that gl4es keeps its own copy of GL state. It answers
glGetIntegerv for GL_CULL_FACE_MODE, GL_FRONT_FACE and GL_MODELVIEW_MATRIX from
its own tables rather than the driver, so reading state back through qgl and
comparing it against the engine compares the engine with a copy of itself and
agrees by construction. And it returns early from glCullFace, glDepthMask,
glDepthFunc, glBlendFunc, glColorMask, glViewport, glScissor and several
glEnable caps whenever the request matches that copy - so once it drifts, the
engine can never correct it. It asks for the right value, gl4es calls it
redundant, the driver never hears, and nothing raises an error.

docs/markdown/04-coding/04-gl4es.md records what to do about it: resolve
glGetIntegerv out of libGLESv3 to ask the hardware; route the VR layer's state
calls through gl4es, with the three exceptions that must not be; and where a
value has to land regardless, name a throwaway first so the real one cannot
match a stale cache.

It also records the two rules that are not about gl4es and cost as much: a probe
must be shown to reach the thing it measures - three of ours had blind spots
exactly where the fault was - and look at the frame, because one capture settled
what six rounds of description could not.

Linked from the Android build doc, since that is where someone hitting this will
be.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 07:30:18 -07:00
bearstonemandClaude Opus 5 5e7e907792 fix(renderer): force the cull face past gl4es's cache, and the world appears
gl4es keeps its own copy of the cull face and returns early from glCullFace
whenever the requested mode matches it (src/gl/face.c:14). Measured on the
device, past gl4es and straight out of libGLESv3, its copy said GL_FRONT while
the driver was culling GL_BACK. So the engine asked for GL_FRONT every frame,
gl4es judged that redundant against a copy that had drifted, and the hardware
went on removing exactly the faces Quake wants kept - its world polygons are
back facing in GL's terms, which is why CT_FRONT_SIDED culls GL_FRONT at all.

The symptom was the entire world invisible while models rendered perfectly,
because model shaders are CT_TWO_SIDED and never enable culling. Inverting the
culled face did not help either, because asking for GL_BACK matched what the
driver was already doing. Only disabling culling outright brought the world
back, which is what made this look like a winding fault for so long.

GL_Cull now names GL_FRONT_AND_BACK first, so the mode it actually wants cannot
be mistaken for a no-op. Nothing is drawn between the two calls.

With this, and with the vid_restart and RB_SurfaceFace index fixes, the world
renders with no overrides at all: terrain, BSP, models, lightmaps, fog and sky,
at 89-90 fps and 6 ms per eye against rend2's 50-60.

Handoff section 9 is rewritten around what this cost to find: gl4es answers
glGetIntegerv from its own tables, so every "GL and the engine agree"
measurement taken through qgl compared the engine against a copy of itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 07:28:56 -07:00
bearstonemandClaude Opus 5 e967529ec6 fix(renderer): ask the driver for GL state, not gl4es's copy of the question
gl4es answers glGetIntegerv for GL_CULL_FACE_MODE, GL_FRONT_FACE and
GL_MODELVIEW_MATRIX out of its own tables (src/gl/getter.c), the same way it
answers glGetString from constants - the trap section 5.5 already records. Two
measurements in this session read back "GL" state through qgl, compared it
against the engine, found it identical, and concluded the state was correct.
They were comparing the engine against gl4es's copy of the engine. That agrees
by construction and proves nothing, and both conclusions drawn from it were
worthless.

It matters because gl4es also drops calls its cache thinks are redundant -
glCullFace returns early when the mode already matches (src/gl/face.c:14), as do
glDepthMask, glDepthFunc, glBlendFunc, glColorMask, glScissor and glViewport. So
the driver can hold something the engine never asked for while gl4es reports the
engine's own value straight back at it.

r_traceSurf now resolves glGetIntegerv and glIsEnabled out of libGLESv3 directly
and prints the driver's answer next to gl4es's. The open question it is aimed at:
world geometry disappears with backface culling enabled whichever face is named,
while CT_TWO_SIDED models are unaffected. No winding fault does that, but a
driver cull mode of GL_FRONT_AND_BACK would, and gl4es would still report
GL_FRONT.

Not tested on the device.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 07:02:06 -07:00
bearstonemandClaude Opus 5 5267bc66c0 fix(vr): size the terrain visibility cone to the headset, not the game's fov
MOHAA decides which terrain patches are visible with a cone test:
R_MarkTerrainPatch rejects anything further off the view axis than
g_fClipDotSquared allows, and that value is a table lookup indexed by
tr.refdef.fov_x. At the game's 80 degrees the half angle is about 46.

In VR nothing else reads fov_x any more. The projection is built from the
runtime's four tangents in R_SetupProjection, and the culling frustum from the
same in R_SetupFrustum. So refdef.fov_x stayed at whatever the game asked for
while a Quest 3 eye sees closer to 100 degrees, and terrain that was inside the
headset's view but outside an 80 degree cone was never marked visible and never
drawn - with nothing anywhere reporting it, because that cvar has no other
consumer left in this path.

The fov now comes from the widest horizontal tangent when a headset view is
active. Widest rather than the sum: the per-eye frustum is asymmetric and the
cone is symmetric about the view axis, so it has to cover the wider side.

The index is also clamped away from zero. g_fDistanceTable[0] is
443.5 / sqrt(1 - 1) - infinity - which poisons g_vClipOrigin and culls every
patch in the level. Not reachable today, but nothing checked, and the failure
would be total and silent.

MOHAA specific: RTCWQuest has no terrain, so the reference could not have caught
this one.

Not yet tested on the device.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 02:46:53 -07:00
bearstonemandClaude Opus 5 a3e3d04a5a build(vr): keep the device config in the repo, with what it is working around
misc/android/autoexec.cfg is the only way to set a cvar on a headset - there is
no console, and the file is exec'd after omconfig.cfg and before R_Init, so it
beats both the stored config and the renderer's own defaults, latched and
archived cvars included.

It currently carries r_noCull 1 and r_noDepth 1, which the world does not draw
without. Those are workarounds, not fixes, and the file says so at the point
someone will read it. It lives next to the game data rather than in the APK, so
reflashing the data loses it - which is the reason to keep a copy here.

Section 10 also records the traps that cost round trips: adb install -r leaves
the old process running so a run can test the previous build; a cvar left out of
the config is whatever omconfig.cfg last archived, which is how a shadows test
came to test nothing; and pulling the data directory for a screenshot moves 1.6
GB of pk3s.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 02:38:42 -07:00
bearstonemandClaude Opus 5 b49e34a9ed fix(vr): stop the window resize restart, and the indices the world was drawn with
Two bugs, both found on the device, both with the evidence recorded in
VR_RENDERER_HANDOFF.md sections 8 and 9.

The menu was a renderer restart. SDL reports a window resize; the handler
compares it against glconfig.vidWidth/Height, which in VR is the eye buffer and
never the Android surface, so it can never match. It set r_customwidth,
r_customheight and r_mode -1 - cvars the renderer then ignores, because the VR
resolution comes from GetVRRenderResolution - and scheduled a vid_restart that
destroyed and rebuilt the GL context and the OpenXR session under a running
frame loop. The panel drew a full 256/256 samples up to CL_Vid_Restart_f and
nothing ever after. VR_PORT_STATUS called that restart harmless; it was the
whole bug.

RB_SurfaceFace declared its output pointer as unsigned* and assigned
tess.indexes to it, which is glIndex_t* - unsigned short under gl4es. Every
index went in four bytes apart in a two byte array, so each triangle picked up
whichever vertex the zero high halves pointed at. That was the world smeared
into streaks that dragged its textures with it; models never come through that
function, which is why they were always correct. ProjectDlightTexture had the
same fault in hitIndexes. The compiler had been reporting it all along, under
sixty other warnings in that file.

Also: renderergl1 culled against the game's symmetric fov rather than the
runtime's asymmetric per-eye frustum; the VR layer set viewport, cull, depth,
blend, colour mask and scissor state natively while gl4es caches all of them and
drops the engine's next request for a value its stale copy already claims; and
GfxInfo_f reported a different draw route than R_DrawElements took.

The remaining diagnostics are CVAR_TEMP and default off. vr_captureEye is worth
keeping: it writes the eye buffer to a TGA, and one image settled questions that
six rounds of verbal description could not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 02:29:43 -07:00
bearstonemandClaude Opus 5 27011bd3eb docs: hand off the renderer swap with what is proven and what is not
renderergl1 on gl4es runs on the headset at 90fps and draws the engine's own
geometry - the intro logo screen renders under a flat colour override. The main
menu still draws nothing, and that is the one open problem.

The largest blocker turned out to be the gl4es build itself: with CMake's flags
it cleared framebuffers perfectly and rendered no geometry whatsoever, measured
as 144 red from a clear and 0 green from a quad into the same buffer moments
later. Matching RTCWQuest's Android.mk fixed it outright with no engine-side
change. gl4es's own CMakeLists adds -DANDROID under the NDK toolchain and
ndk-build never does, so the reference has only been exercised without it, and
it gates the code that decides what the fixed function pipeline may emit.

Recorded at length because it invalidated most of a session's work: while gl4es
could not draw, every experiment ending "and nothing was drawn" returned the
same answer whatever it was testing. Four changes were adopted on the strength
of such results and are now marked for re-testing rather than trusted. The
document says plainly which findings are measured and which are not.

Also commits the framebuffer helpers the VR layer needs: gl4es has to own the
GL_FRAMEBUFFER binding or it renders from its own table into a 16x16 pbuffer,
while the swapchain texture attachment and the blit's read and draw bindings
must stay with the driver - routing those through gl4es empties the blit and
takes the cutscenes with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 23:48:49 -07:00
bearstonemandClaude Opus 5 1249e897c6 build(vr): build gl4es the way the reference builds it
renderergl1 on gl4es reaches the headset, clears the eye and panel buffers
correctly, and renders no geometry at all - immediate mode and vertex arrays
alike, with correct geometry, correct matrices, a complete framebuffer both
layers agree on, and no GL error on any draw. Measured as 144 red from a clear
and 0 green from a quad drawn immediately afterwards into the same buffer.

Since RTCWQuest runs this same stack on this same device, this makes our gl4es
identical to theirs rather than to CMake's defaults. From their Android.mk:

    -DBCMHOST -DNOX11 -DNO_GBM -DDEFAULT_ES=2 -DNO_INIT_CONSTRUCTOR
    -O3 -fcommon -fvisibility=hidden -funwind-tables

ANDROID is deliberately not among them. gl4es's own CMakeLists adds it whenever
the NDK toolchain is in use and ndk-build never does, so the reference has only
ever been exercised without it - and it is not cosmetic: it selects different
code in the loader, in glx, and in hardext, which is where gl4es compiles a
probe shader to decide what its fixed function pipeline may emit. It comes from
add_definitions(), a directory property, so it is removed where it was set
rather than overridden on the target.

-fcommon matters for a different reason: gl4es is old C that expects tentative
definitions to merge, clang has defaulted to -fno-common since 15, and this NDK
is well past that while the reference's toolchain is not.

BCMHOST is the Raspberry Pi switch and looks wrong here; everything it gates is
additionally guarded by !defined(ANDROID). Carried because matching a build that
demonstrably works matters more than tidiness.

This is convergence on a known-good configuration, not a diagnosis. If it
renders, bisect the flags to find which one mattered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 23:36:03 -07:00
bearstonemandClaude Opus 5 6e369175be docs: record what the gl4es boundary actually requires
Three findings that each cost a device run: gl4es cannot bind a framebuffer it
did not create and fails silently when asked, so the renderer must bind nothing
and only flush; gl4es answers glGetString from constants, which defeats the
engine's only check that a context is live; and SDL unbinds the context and
reports success when the window has no EGL surface, which in a headset is always.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 22:12:45 -07:00
bearstonemandClaude Opus 5 17771047c5 fix(vr): stop binding the eye framebuffer through gl4es
The headset was black while the frame loop ran at a contented 90 fps and the
audio played. Everything was being drawn into the window nobody looks at.

Routing the renderer's glBindFramebuffer through gl4es - so that gl4es would see
every call the renderer makes - is right in general and wrong for this call in
particular. gl4es can only bind framebuffers it created itself: its
glBindFramebuffer looks the name up in its own table, and every framebuffer the
VR layer owns comes from the driver's glGenFramebuffers. The lookup misses, it
raises GL_INVALID_VALUE, returns without binding, and goes on believing
framebuffer 0 is current. So the eye redirect quietly did nothing.

RTCWQuest's renderer never binds a framebuffer at all - Quake 3's fixed function
path predates them - and TBXR_Common binds the eye directly, leaving gl4es to
draw into whatever the driver has. renderergl1 is the same renderer and this now
does the same thing.

What the renderer is still told about is the flush. gl4es batches geometry and
issues it lazily, so work built for one eye would otherwise arrive in whichever
target is bound when it finally goes out. RE_SetDefaultFramebuffer flushes while
the old target is still current and binds nothing, which is also why the VR
layer calls it before its own bind rather than after.

readfboBegin and readfboEnd early out while gl4es's read and draw framebuffers
are the same, which they always are here, so gl4es does not rebind behind this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 22:12:04 -07:00
bearstonemandClaude Opus 5 d9960e1857 fix(vr): bind the engine's GL context against a pbuffer, as RTCWQuest does
The OpenXR session could not be created: eglGetCurrentContext returned nothing
while SDL was certain a context was current.

SDL binds the GL context against the window's EGL surface. In a headset there is
no window being presented - every pixel reaches the display through the
swapchains - so that surface never arrives. What SDL does then is the trap.
SDL_EGL_MakeCurrent, handed no surface and without gl_allow_no_surface, calls
eglMakeCurrent(EGL_NO_SURFACE, EGL_NO_CONTEXT) to unbind everything and returns
success; SDL_GL_MakeCurrent then records the context as current. So SDL's
bookkeeping and EGL's actual state disagree permanently, and asking SDL to bind
it again does nothing, because SDL_GL_MakeCurrent sees its own record agree and
returns early.

RTCWQuest never meets this because it never depends on a window surface: it
makes its context current against a 16x16 pbuffer (TBXR_Common.c,
egl->TinySurface). Same here, except the context is the one SDL already made,
since the engine renders in it. The EGLConfig comes from eglQueryContext, which
VR_CreateSession was already recovering for the graphics binding.

The pbuffer outlives the session deliberately - the session is torn down and
rebuilt around renderer restarts, and unbinding the context in the middle of
that is the thing this prevents. It is released in VR_Shutdown.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 22:08:14 -07:00
bearstonemandClaude Opus 5 a8a1314c2d fix(vr): ask for an ES context for the fixed function renderer, and check it is current
Two problems the first device run found, one hiding the other.

GLimp_SetMode's fixedFunction branch offers exactly one context: desktop OpenGL
1.1. There is no such thing on Android, so window creation failed three times
over and R_Init gave up with "Couldn't get a visual". renderergl2 never met this
because it takes the other branch, which already knows how to ask for ES.

gl4es is what makes the request answerable, and it wants the opposite of what
the renderer believes it is getting: desktop GL 1.x presented upwards, OpenGL ES
underneath. So the fixed function branch now asks for ES 3.0 and then ES 2.0,
and the renderer is never told - it reads its version through gl4es, which
reports desktop GL, and takes the desktop fixed function path on the strength of
it.

That got the renderer up, and revealed the second problem: the OpenXR session
found no current EGL context. Which is where gl4es having its own opinion about
glGetString stops being convenient. The engine's proof that a context is live is
GL_VERSION coming back non-NULL, and gl4es answers VERSION, VENDOR and RENDERER
out of constants without asking the driver - so a context that was created but
never bound passes that test and is only noticed much later, somewhere else
entirely. GLimp_SetMode now asks SDL directly whether the context it just made
is current, restoring the check gl4es defeated.

The session no longer assumes one is bound either. Being current is per thread,
and a window that has not been shown yet has no surface to be current against,
so VR_CreateSession asks for the binding through GLimp_MakeCurrent rather than
requiring it to already be there, and reports the EGL handles when it cannot get
one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 22:02:44 -07:00
bearstonemandClaude Opus 5 aae8dff0f2 docs: correct the renderer handoff against what was actually true
Section 4 claimed renderergl1 compiled clean. It had never compiled at all -
android.cmake forced the renderer choice into the cache with CACHE INTERNAL,
which implies FORCE, so the command line was overwritten every configure.

Section 5.1 asked whether the gl4es target was real. It was, and it was
building; the artifact went into the engine's source tree because gl4es points
CMAKE_LIBRARY_OUTPUT_DIRECTORY at ${CMAKE_SOURCE_DIR}/lib and FetchContent makes
that the top-level project. RENDERER_LIBRARIES reached the client the whole
time.

Both of those turned out to be the wrong question anyway, which is the part
worth keeping: renderergl1 does not call GL by name. Every entry point is a
function pointer filled in from SDL_GL_GetProcAddress, and on EGL 1.5 SDL asks
eglGetProcAddress first - so linking gl4es correctly would still have left the
driver answering for every name GL 1.x and ES share.

Records what is now settled about gl4es alongside the VR layer, and what is
still only suspected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 21:48:41 -07:00
bearstonemandClaude Opus 5 d2d52a5af4 fix(vr): tell the renderer before moving the framebuffer under it
The VR layer bound each eye, the UI buffer and the wrist panel directly and
then told the renderer afterwards. That order was harmless while the renderer
issued every call as it made it. It is not harmless under gl4es, which batches
geometry and flushes lazily: it only learns to flush when something it knows
about changes the target, so a batch left over from one pass would arrive in
whatever was bound next - the previous eye's contents showing up in this one.

Routing the transition through re.SetDefaultFramebuffer first gives gl4es the
chance to flush into the target the geometry was drawn for. The direct bind
stays where it was needed, since the renderer only binds framebuffers when its
own framebuffer support is on; it is now a no-op against the same target.

Also points the Android docs at renderergl1 with gl4es under it, and records
that libgl4es.so rides into the APK as a dependency of libopenmohaa.so rather
than being loaded by name.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 21:46:20 -07:00
bearstonemandClaude Opus 5 6f34f4524c feat(vr): put the headset behind the fixed function renderer
Everything the VR work had built so far lived in renderergl2. This carries it
across to renderergl1, which is the renderer the port is moving to.

Most of it transfers unchanged: the head pose composed onto whatever camera the
game asked for (R_ApplyVRView, in RE_RenderScene so it follows cutscenes and
ladders as well as the player), the asymmetric per-eye frustum and vr_fovZoom in
R_SetupProjection, the eye render resolution asked for through
GetVRRenderResolution rather than r_mode, and the sprite paths that face the
viewer's position rather than the view plane.

Two places came out simpler than rend2. Everything 2D in this renderer goes
through Set2DWindow - RB_SetGL2D is a one line call to it - so the HUD's
convergence has a single place to be applied rather than two that had to be
kept in agreement. And RE_SetDefaultFramebuffer is nearly nothing: renderergl1
predates framebuffer objects, has none of its own and never touches the
binding, so redirecting an eye is one bind with no FBO_Bind to intercept and
nothing to restore.

glBindFramebuffer is resolved on first use rather than declared with the rest
of qgl, because renderergl1 has no extension probe of its own - it goes through
GLimp_GetProcAddress so it reaches gl4es like everything else the renderer
calls, and gl4es stays aware of which framebuffer is bound.

renderergl2 still builds and is unchanged in behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 21:38:59 -07:00
bearstonemandClaude Opus 5 633221c57d build(vr): actually build renderergl1 on Android, and route its GL through gl4es
The gl4es work was in the tree but nothing had exercised it. Three things were
wrong, each hiding the next.

cmake/platforms/android.cmake forced BUILD_RENDERER_GL1 OFF and GL2 ON into the
cache. CACHE INTERNAL implies FORCE, so the -D on the command line was
overwritten on every configure and renderergl1 had never once compiled - the
build that appeared to succeed was a renderergl2 build with gl4es sitting unused
beside it. The renderer choice goes back to the top level options, which already
default the way this port wants.

gl4es's own CMakeLists points CMAKE_LIBRARY_OUTPUT_DIRECTORY at
${CMAKE_SOURCE_DIR}/lib, which under FetchContent is this project's source root,
so the artifact was written into the engine's source tree. It also builds itself
as libGL.so.1 after the fashion of a system OpenGL, and Android has no versioned
sonames - the package manager extracts only lib*.so out of an APK. Redirected
into the build tree as libgl4es.so and staged with the other APK libraries.

With that fixed renderergl1 does compile for arm64, but it would not have
rendered. Its entry points come from GLimp_GetProcAddresses via
SDL_GL_GetProcAddress, and on EGL 1.5 - which the Quest is - SDL asks
eglGetProcAddress first. The driver answers for every name OpenGL 1.x and ES
have in common, so glEnable, glBindTexture and eighty more would have bound to
Adreno while glBegin and glMatrixMode bound to gl4es. gl4es would then have been
batching geometry and tracking a matrix stack against calls the driver was never
told about. The renderer now resolves against the gl4es handle directly, and
calls initialize_gl4es since NO_INIT_CONSTRUCTOR is set. The extension string
had the same problem and the same fix: read through SDL it is the driver's ES
list, which names none of the desktop extensions the renderer asks after, so
GL_ARB_multitexture read as absent and the renderer would have quietly dropped
to one texture unit.

The VR layer keeps its own direct GLES linkage; only the renderer is moved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 21:26:22 -07:00
bearstonemandClaude Opus 5 7f794abbb4 docs: record where the VR port stands
A companion to VR_PORT_PLAN.md for picking the work up cold: what is
built, the deployment traps, how the VR layer fits together, and what to
do next.

It also records where the plan turned out to be wrong, which is the part
worth reading first. The renderer did not in fact start on any OpenGL ES
context; framebuffer objects were switched off on the ES path despite
being core there; there is no SDL audio path to fall back on; and static
linking the game modules is not possible. Each of those shaped the port
differently to how the plan assumed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 17:22:36 -07:00
bearstonemandClaude Opus 5 7872929f32 feat(vr): head aim, stick locomotion and comfort options
The game now knows where the player is looking. Until now head tracking
only moved the camera the renderer drew from, so anything consulting the
player's view angles - objectives that ask them to look at something, aim,
hit detection - never saw it. CL_VRMove writes the head's heading and
pitch into cl.viewangles, which is what all of that reads.

Walking follows the off hand rather than the gaze, after the approach in
Team Beef's RTCWQuest. Tying travel to where the player is looking means
they cannot glance sideways without veering, which is what makes room
scale movement feel like being dragged; steering with the free hand lets
them look around and still walk a straight line. cl_vrWalkWithView
restores gaze-directed movement.

Turning snaps by default. A stick that rotates the world smoothly while
the inner ear insists otherwise is the usual way to make people ill, and
one flick gives one step rather than one per frame.

  cl_vrSnapAngle    45    degrees per flick
  cl_vrSmoothTurn   0     1 for smooth turning instead
  cl_vrTurnSpeed    90    degrees/second when smooth
  cl_vrDeadzone     0.2
  cl_vrWalkWithView 0     1 to walk where the player looks

All archived, so they are tunable on the headset rather than at build
time, which is what section 5 of the porting plan asks for.

Thumbsticks are bound on the Touch profile only: the simple controller
has none, and offering a binding a runtime does not recognise makes it
reject the whole set, which would cost the fallback its pointer too.

The dominant hand's aim angles are carried through vrInput_t but not yet
used. Aim is still on the head, which section 5 is right to call wrong
for a shooter - that belongs with weapon handling, and looking at things
had to work first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 17:21:14 -07:00
bearstonemandClaude Opus 5 393b0e3e3d fix(vr): make billboards face the viewer rather than the view plane
Quake's autosprites and MOH:AA's sprite imposters both orient themselves
by adopting the camera's own axes, so every one of them sits parallel to
the view plane. On a monitor that is indistinguishable from facing the
viewer, because the screen is the view plane. In a headset it is not:
turning the head swings every billboard in the level round in unison,
and they visibly spin in place.

They now take the direction from their own position to where the viewer
actually is, built against world up so they stay upright instead of
inheriting the head's roll. Head rotation no longer affects them; only
moving does.

Covers AutospriteDeform, and SPRITE_PARALLEL and SPRITE_PARALLEL_UPRIGHT
in the sprite path - the latter being the foliage imposters that stand in
for static models at a distance, which is why near foliage looked correct
while distant foliage did not.

Still outstanding: some foliage continues to rotate, so at least one more
path orients this way. Left for when movement makes it easier to tell
which effects are misbehaving and why. Autosprite2Deform is untouched: it
pivots around a fixed axis for beams and rails, so it is far less
sensitive to this, and changing it blind would risk breaking effects that
currently look right.

All of this is conditional on a VR view being active, so the flat
renderer is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 17:12:26 -07:00
bearstonemandClaude Opus 5 5aff8d336a feat(vr): stereo rendering and 6DoF head tracking through OpenXR
Runs on a Meta Quest 3 in stereo at the headset's native 1680x1760 per
eye, with the world tracking head movement in six degrees of freedom.

The session binds to the EGL context SDL already created rather than a
private one, so there is a single GL context and the renderer needs no
thread or context juggling. Each eye is rendered into an OpenXR swapchain
image by substituting the framebuffer the renderer treats as the screen,
which leaves the whole render path untouched. Exactly two eye passes per
frame; there is deliberately no third pass to produce a flat image.

The session and its swapchains belong to the GL context they were made
with, so they are torn down and rebuilt around the renderer restarts the
engine performs.

Menus, the loading screen and cinematics go on a quad layer fixed in the
room, placed once in front of wherever the player is facing. Drawing
screen space content into both eyes instead gives it no stereo disparity
while each eye still warps it through its own asymmetric frustum, and the
result cannot be fused. The panel is drawn into one persistent buffer
that is then copied into the swapchain image: a swapchain rotates through
several images, and the engine's 2D path expects the screen to still hold
what it drew last frame.

Head tracking:

- The per-eye asymmetric frustum from xrLocateViews feeds
  R_SetupProjection directly. A symmetric approximation misaligns the two
  images by a few degrees, which the eyes cannot fuse.
- The pose is applied in RE_RenderScene, so it follows every camera the
  game has - the player's, cutscenes, ladders, death animations - without
  each needing to know about VR.
- Orientation is carried as axes rather than pitch/yaw/roll, and composed
  with the game's heading as a rotation. Adding Euler angles only works
  while pitch and roll are near zero and turns every head movement into a
  twist once they are not.
- Position is measured from where the head was when tracking started, so
  the game keeps supplying eye height and the headset contributes only
  leaning, ducking and stepping. The initial heading is subtracted too,
  or the play space's arbitrary forward is added to the character's and
  the player spawns facing the wrong way.

The controllers point at the panel and click: the aim ray is intersected
with the quad and the hit becomes the engine's cursor position, so the
menus behave as they always did.

The renderer's own framebuffer objects stay off on Android. Each eye is
already a swapchain image, so routing through tr.renderFbo first would
cost a second full resolution pass and resolve per eye for nothing.

Known gaps: head orientation does not yet reach the player's view angles,
so the game does not know where the player is looking; and there is no
controller model or pointer ray.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 17:03:38 -07:00
bearstonemandClaude Opus 5 eea9112be9 feat(android): add Android platform support
Builds an APK for arm64-v8a, brought up on a Meta Quest 3 but not
specific to it. The engine reaches the main menu with retail data
side-loaded and renders through renderergl2 on an OpenGL ES 3.2 context.

Build system: a new cmake/platforms/android.cmake, driven by the NDK's
android.toolchain.cmake. renderergl1 is not built (it is fixed function
and would need a GL-over-GLES translation layer), the renderer is linked
into the client rather than dlopen'd, and SDL2 and OpenAL Soft are built
from source since neither ships an Android binary. OpenAL is not
optional here: it is the engine's only sound driver, so USE_OPENAL=OFF
does not build. Native libraries are staged per-ABI for gradle, which
packages them in misc/android.

Portability fixes for bionic:

- pthread_cancel does not exist; GameSpy's async DNS thread detaches
  instead.
- <execinfo.h> does not exist. sys_android_new.c walks the stack with
  _Unwind_Backtrace and resolves it through dladdr, writing straight to
  logcat. This matters because tombstoned does not reliably report a
  backtrace, leaving no account of where the engine died.
- librt does not exist; those symbols live in libc.
- libmumblelink.c needs shm_open and was being compiled even with
  USE_MUMBLE off. It now builds only when Mumble is enabled.

con_android.c sends the console to logcat and pumps stdout and stderr
there too, so output from the C library and from third party code is not
silently discarded.

The fatal signal handlers move ahead of Com_Init. Startup is exactly
when renderer and filesystem bring-up crash on a new platform, and a
fault there previously died with no backtrace at all.

Game modules ship inside the APK as libgame.so and libcgame.so and are
loaded off the linker's search path. Static linking is not an option:
cgame and fgame both compile q_shared, q_math and the script system, so
linking them into one binary collides. Android extracts only lib*.so
from an APK, hence DLL_PREFIX in q_platform.h.

Paths point at the app's external files directory, which is where the
user side-loads the game data and the only place the engine can write.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 15:19:30 -07:00
bearstonemandClaude Opus 5 f3ca623053 fix(renderer): let renderergl2 initialise on OpenGL ES contexts
GLimp_GetProcAddresses() failed on every OpenGL ES context, so the GL2
renderer could not start on any ES target. Two independent causes:

QGL_1_1_PROCS carried five entry points that exist in no version of
OpenGL ES - glCallList, glDrawPixels, glFogi, glLineStipple and
glPixelZoom. That list is shared by the desktop and ES paths, so
requiring them there failed the whole load. Upstream keeps ES-incompatible
functions in QGL_DESKTOP_1_1_PROCS; these are moved there to match. Only
renderergl1 calls them - every use in renderergl2 sits inside an
"#if 0 // FIXME: unimplemented (GL2)" - so nothing loses a function it
actually invokes.

The ES 3.0 context was also only ever requested under __EMSCRIPTEN__.
Everywhere else the highest ES context asked for was 2.0, and since EGL
returns a genuine ES 2.0 context when that is what was requested, ES 3
was never reached even on hardware that supports it. It is now requested
first on all platforms.

Verified on a Meta Quest 3 (Adreno 740): renderergl2 now comes up on an
ES 3.2 context and compiles all 115 GLSL shaders. Desktop builds of both
renderers are unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 15:19:10 -07:00
bearstonemandClaude Opus 5 6517d02dfe Add the Quest 3 VR porting plan
Survey of the tree plus a staged plan: Android build first, then flat
playable on the headset, then OpenXR stereo, then the VR interaction
design.

The finding that shapes the whole approach is that renderergl2 already
speaks OpenGL ES, inherited from upstream ioquake3 - qglesMajorVersion
is a real runtime variable, tr_glsl.c emits "#version 300 es" and
injects precision qualifiers, tr_extensions.c branches on it, and
sdl_glimp.c has an r_preferOpenGLES cvar that requests an ES context.

That is a much better starting position than it might have been. A
comparable Quest port of Homeworld needed gl4es to emulate
fixed-function GL 1.x over GLES2, and every later constraint followed
from that. Here renderergl2 can be driven at GLES 3 directly: no
translation layer, real shaders, and FBOs already first class in
tr_fbo.c - which matters for stereo, since rendering each eye into its
own framebuffer is exactly the piece the Homeworld port never built and
whose absence blocked MSAA there.

renderergl1 is treated as out of scope for the same reason: it is fixed
function and would need the emulation layer we are avoiding.

Also records the deployment traps from that earlier port - the silent
2770 directory ownership that locks the app out of its own data, the
chmod-after-push ordering, never launching over adb, and verifying that
crash logging works before trusting it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 13:27:31 -07:00
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
smallmodel a72bc153db Fix configstring replacement causing the model to be referenced twice on base MOHAA clients (#779) 2025-08-03 02:21:35 +02:00
Tim Angusandsmallmodel e47790cd54 Move third party code to code/thirdparty
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-02 23:19:02 +02:00
Tim Angusandsmallmodel 8708953e96 Move puff.* to renderercommon
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-02 23:00:57 +02:00
Tim Angus b0ca50c4c5 Merge identical tr_subs.c into renderercommon 2025-08-02 22:58:22 +02:00
smallmodel 1be22e9343 Use resetString for the fallback renderer 2025-08-02 22:53:13 +02:00
Tim Angusandsmallmodel fabd2fd848 Fix incorrect architecture detection on Windows
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-01 23:14:25 +02:00
Pan7andsmallmodel 6d2d6e1429 Replace USE_LOCAL_HEADERS with USE_INTERNAL_*
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-01 23:02:06 +02:00
Tim Angus df165d162d Cleanup opus and vorbis more 2025-08-01 22:44:20 +02:00
J.Ingram 88e41fd6e5 Call SHGetFolderPathA directly
Removing shfolder.h satisfies MSVC, and calling the function directly makes PFNSHGETFOLDERPATHA unnecessary.
2025-08-01 22:43:04 +02:00
Tim Angus 790e4286db *Don't* configure zlib so we get the generic zconf.h 2025-08-01 22:40:10 +02:00
Tim Angusandsmallmodel e6e260933a Update SDL
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-08-01 22:37:53 +02:00
Tim Angus a3c10c4fae Remove macOS ppc support 2025-08-01 22:31:22 +02:00
Tim Angus 076099d0ed Update OpenAL (headers) 2025-08-01 22:29:51 +02:00
smallmodel 4d168a2e20 Fix mouse cursor disappearing (#774) 2025-08-01 22:22:56 +02:00
smallmodel c0ac03afde Compile SDL2 directly instead of using an action 2025-08-01 22:05:07 +02:00
smallmodel 6adeca6196 Fix taunts incorrectly played as team on mohaa base (#776) 2025-07-27 13:41:19 +02:00
smallmodel 84b1d3e8d1 Fix server items not drawn when using cl_browserdetailedcolors 2025-07-27 00:54:42 +02:00
smallmodel de65af5a43 Don't throw a fatal error when the filename is empty (#773) 2025-07-25 22:27:08 +02:00
smallmodel a9b8c44206 Fix incorrect entity flags set on the spawned dead body 2025-07-24 22:47:52 +02:00
smallmodel c9f13f182c Make r_swapInterval CVAR_LATCH
This variable is used only when initializing SDL.
2025-07-21 22:02:55 +02:00
smallmodel d1bfeeadbf Improve default graphic settings for d-day (#771) 2025-07-21 21:56:12 +02:00
smallmodel 95a7169d21 Fix HUD being shown during briefings (single-player) (#769) 2025-07-20 23:13:52 +02:00
smallmodel 5b57949bc9 Fix missing pm flags for bit 15 and above on mohaa 1.11 (protocol version 6) 2025-07-20 22:58:53 +02:00
smallmodel 7e6ea644ba Don't reset the client on singleplayer
This fixes an issue where some scripts would apply modifications such as drawhud to the player, that would get reset after connecting.
2025-07-20 22:28:30 +02:00
smallmodel 8e905c8617 Update installation doc 2025-07-20 14:35:34 +02:00
smallmodel 0bd1159607 Fix notation 2025-07-20 01:28:46 +02:00
smallmodel 838f84b9f3 Fix typo 2025-07-20 01:25:32 +02:00
smallmodel ee5a6b5a47 Add contributing guidelines 2025-07-20 00:53:43 +02:00
smallmodel a3f520de8c Format most source files 2025-07-19 23:30:20 +02:00
Tim Angus 57abfa297b Undefine real error codes to fix warnings 2025-07-19 23:29:58 +02:00
smallmodel 11ba758ca3 Fix ephemeral event being passed multiple times after being freed with multiple widgets of the same name (#766) 2025-07-19 22:18:08 +02:00
smallmodel a35008dfca Fix create-release being called for a PR 2025-07-19 22:04:51 +02:00
smallmodel 83a32c2635 Fix incorrect mins/maxs value for SpotWouldTelefrag
This caused telefrags on multiplayer with an high number of players
2025-07-19 00:05:21 +02:00
J.Ingram 8336e48566 Use PFNGETFOLDERPATHA typedef
FARPROC is defined with an empty parameter list, which newer versions of GCC consider equivalent to (void). Compilation fails when qSHGetFolderPath gets called with arguments.
2025-07-17 21:00:52 +02:00
smallmodel 3e842ffe40 Redefine aliases for WSA errors instead on win32 2025-07-15 21:35:05 +02:00
Tim Angusandsmallmodel c9fcd723db Update integrated third-party libraries
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-07-14 21:44:52 +02:00
Tim Angus 175beea77e Selectively disable -Warray-bounds 2025-07-14 21:17:24 +02:00
Tim Angus fda7cc0c6e GCC warning fixes 2025-07-14 21:16:39 +02:00
Tim Angus 7fc2e36bcb Use correct abs function in FBO_FastBlit 2025-07-14 21:15:21 +02:00
Tim Angus d00ccb5d5b Security fixes 2025-07-14 21:12:44 +02:00
cake 0966021099 fix minor spelling errors 2025-07-14 21:12:19 +02:00
James Darpinian ed3af6dbf5 OpenGL2: Disable the VAO cache by default
The VAO surface cache uses glBufferSubData and triggers a very slow
path in some GLES implementations. Specifically I have observed 10x
frame times under Emscripten with ANGLE/Metal on macOS and with Mali
on Android.

Co-authored-by: Zack Middleton <zack@cloemail.com>
Co-authored-by: WofWca <wofwca@protonmail.com>

# Conflicts:
#	code/renderergl2/tr_local.h
2025-07-14 21:11:34 +02:00
smallmodel edb1950a76 Rename latest prerelease to dev 2025-07-14 00:00:44 +02:00
smallmodel b5821e9bbd Automatically generate a prerelease 2025-07-13 22:47:09 +02:00
smallmodel 3f44dcf301 Bump version number 2025-07-12 00:16:00 +02:00
smallmodel 77ed007086 Add more explicit instructions 2025-07-10 23:15:54 +02:00
smallmodel ba3ebed1c9 Stop cinematic when clearing the state 2025-07-07 21:48:29 +02:00
smallmodel 4e8ddf3c35 Refactor server-sided view model animation 2025-07-06 20:10:02 +02:00
smallmodel 850b6de927 Fix cache ignoring sv_precache when called from scripts 2025-07-06 19:47:10 +02:00
smallmodel e45ab50367 Fix the number of bits for iLarge on protocol >= 15 2025-07-06 18:33:49 +02:00
smallmodel 567ec755b1 Fix duplicated configstrings
This caused issues such as clients crashing as they were improperly unregistering used models
2025-07-06 17:20:50 +02:00
smallmodel beec594ea4 Fix the wrong random animation being chosen (#763) 2025-07-06 16:59:53 +02:00
smallmodel f59f1df9b6 Prevent spamming the no ammo sound and max movement sound
This caused some full-auto weapons (like the thompson) to not play the reloading sound after emptying the clip
2025-07-05 22:13:25 +02:00
smallmodel 0dabcc776f Clear pending events when the server restarts or when an entity is reset
This prevents sounds from previous entities, such as smoke grenades, to emit a sound on an unrelated entity
2025-07-05 21:49:28 +02:00
smallmodel 17ab3d1114 Fix the value of the RF_ALWAYSDRAW flag
This caused entities such as smoke grenades marked as alwaysdraw to not always be drawn
2025-07-05 20:57:04 +02:00
smallmodel ba42479dbc Add asserts to check that model user count won't go below 0 2025-07-05 20:39:59 +02:00
smallmodel 4e9640c433 Fix ladder positioning 2025-07-03 00:10:44 +02:00
smallmodel 4b95809397 Fix some offmesh points being wrong on some maps
Some offmesh points were tunneling through surfaces and terrains, which caused bots to try to path through it.
2025-07-02 23:55:31 +02:00
smallmodel bd93897286 Add PMF_NO_WEAPONBAR to hide the weapon bar using drawhud 2 2025-07-02 21:28:12 +02:00
smallmodel 68ddfb69fc Fix maximum polys error when reaching 256 paths 2025-07-02 21:12:32 +02:00
smallmodel ae28b03e02 Prevent points and objects to tunnel through terrain from below
This fixes an issue where players going under the terrain could fire bullets and grenades through it
2025-07-02 01:17:25 +02:00
smallmodel e0e1f42acc Fix pm flags 2025-07-02 01:13:45 +02:00
smallmodel 46fbb6e8b3 Disable third person on turrets 2025-07-02 00:52:23 +02:00
smallmodel 65601eeb48 Store trace point on stack instead of globally 2025-07-01 21:25:11 +02:00
smallmodel 8b75c6639b Support for clampmapx/clampmapy 2025-07-01 20:33:46 +02:00
smallmodel 8d431681bd Use patch vertice generation from collision code 2025-06-30 00:30:10 +02:00
smallmodel a9f0fe7800 Allow the bot to fall and jump when avoiding an obstacle 2025-06-29 20:13:50 +02:00
smallmodel 34a812d462 Handle complex collision with BSP brushes (basic) 2025-06-29 20:05:54 +02:00
smallmodel e098f52b84 Use the appropriate trace mask 2025-06-29 19:45:37 +02:00
smallmodel 8c03001cbb Make sure to check if the entity is valid for removeent 2025-06-29 19:45:27 +02:00
smallmodel e243d24839 Check if tiki and tag name are valid when using the parent's old model 2025-06-28 01:20:13 +02:00
smallmodel 5108c800b6 Use an AI broadcast radius for weapon firing, based on the world radius
This is so bots don't get notified about shots at the other end of the map. This allows to bots to divide the map into smaller arenas for fighting.
2025-06-27 23:46:15 +02:00
smallmodel 4b4644547a Prevent clients from using first-person player model as a skin 2025-06-27 22:53:15 +02:00
smallmodel be43b164b8 Fix obstacle avoidance on entrance with lower ceiling
This fixes an issue where the bot would sometimes get stuck when reaching entrances with low ceilings
2025-06-27 00:11:52 +02:00
smallmodel bf95447483 Draw full self body when viewing from a camera 2025-06-26 22:12:27 +02:00
smallmodel 854d24138e Improve bot attack to reduce the difficulty
- Bigger aim offset
- Burst fire
- Random reaction time based on enemy distance
2025-06-26 00:11:21 +02:00
smallmodel 9c81b4d475 Add a method to return the current fire spread multiplier 2025-06-25 21:39:58 +02:00
smallmodel f7a5f85a75 Improve collision detection
- Fix tiny mistakes related to distance calculation
- Fix bot going back and forth when opening a door in stairs (mohdm4)
- More precise collision detection
2025-06-25 01:27:48 +02:00
smallmodel 92fafe195c Remove useless instructions 2025-06-23 23:26:23 +02:00
smallmodel a1bd17d360 Fix region minimal size causing small ledges to not be reachable 2025-06-23 00:14:25 +02:00
smallmodel cd984ccce1 Improve bot obstacles handling and ladders
- Add a way to climb over obstacles like in Brest (getting outside the house spawn area)
- Bots will try to break window objects in their way
- Fix some ladders not being usable as a path for bots
- Fix bots acting dumb when trying to climb a ladder
- Improve the way bots jump on obstacles overall
- Improve bot collision detection
2025-06-23 00:02:46 +02:00
smallmodel d180f36370 Allow player_textMessage event to return a value
The script can optionally prevent the message from being sent.
2025-06-21 22:27:09 +02:00
smallmodel 40fb8de556 Allow script events to return a variable value 2025-06-21 22:19:15 +02:00
smallmodel d567ef9793 Add IsNone() and HasValue() 2025-06-21 22:18:17 +02:00
smallmodel f6cc732886 Update the scores when the scoreboard is displayed 2025-06-21 21:52:17 +02:00
smallmodel 01f08958f0 Capitalize the first letter of ammo type (#761)
This fixes an issue where the ammo pickup message would not get
localized.
2025-06-21 21:20:52 +02:00
smallmodel 1c5a33f82a Gather usable entities based on the view position
This fixes an issue where leaning had no effect when trying to use entities.
2025-06-21 00:12:12 +02:00
smallmodel 71d8685fe3 Update gamespy SDK 2025-06-20 23:36:13 +02:00
smallmodel 45488c2362 Fix parameter mismatch 2025-06-20 23:36:09 +02:00
smallmodel 73e1b47c77 Update gamespy crypt code
It uses the official crypt code from the gamespy SDK
2025-06-20 22:50:27 +02:00
smallmodel 7a3920bfb9 Remove nonport.c (unused) 2025-06-20 22:38:32 +02:00
smallmodel 301625d3cd Rework bot rotation 2025-06-20 01:43:27 +02:00
smallmodel 45c112a463 Properly close the file handle if an invalid length was returned on read attempt 2025-06-18 00:29:13 +02:00
smallmodel 89a748673c Catch all exceptions when parsing json 2025-06-17 21:45:21 +02:00
DraGoNandsmallmodel 6220ecb80c Fix linking error when compiling on Fedora and FreeBSD (#759)
---------

Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-06-17 20:35:41 +02:00
smallmodel 5de6180106 Update release action version 2025-06-17 00:23:56 +02:00
smallmodel 807359c662 Use a turret firing state enumeration to improve clarity 2025-06-16 23:21:56 +02:00
smallmodel 0cba64ea7e Refactor TurretGun::P_ThinkActive() 2025-06-16 22:49:04 +02:00
smallmodel a459ad27d9 Fix incorrect metric for team 2025-06-16 21:49:52 +02:00
smallmodel 5ed828e49b Use random() instead of G_Random() 2025-06-16 21:49:15 +02:00
smallmodel c59be4be1e Don't use random for next time values 2025-06-16 21:46:39 +02:00
smallmodel 7e2f4e0023 Enable interprocedural optimization on Windows 2025-06-16 00:13:08 +02:00
smallmodel 37af1bbe7b Add a known issues section related to bots 2025-06-15 22:46:50 +02:00
smallmodel dc85a1e13a Update README 2025-06-15 22:41:57 +02:00
smallmodel c23b116f11 Filter special entities like minefields (workaround)
This prevents bots from navigating through minefields and getting killed. Unfortunately this has the side-effect of filtering a large zone like the west axis spawn in obj_team3
2025-06-15 21:38:25 +02:00
smallmodel 76c9e3a30a Add 2 units to the max jump height
Player can take steps while jumping
2025-06-15 21:38:22 +02:00
smallmodel 116b84312a Re-allow SURF_NODRAW
Due to trace being non-cylindrical now, there are no more issues caused by terrain
2025-06-15 21:36:36 +02:00
smallmodel 8c2f5184c1 Set poly flags only after calling GeneratePolyMesh() 2025-06-15 21:28:55 +02:00
smallmodel e74651f548 Fix incorrectly converted extents 2025-06-15 20:46:36 +02:00
smallmodel 377dfb618b Add helper functions to convert extents 2025-06-15 20:12:04 +02:00
smallmodel e5f645ec0c Don't use cylinder trace
Cylinder causes some issues with terrain where some points would get created below a terrain patch
2025-06-15 18:06:05 +02:00
smallmodel 7fe8a90e8a Use a better cost for jumping, falling and ladders 2025-06-15 18:00:48 +02:00
smallmodel 70a9a61f93 Use a different color depending on the poly area 2025-06-15 18:00:27 +02:00
smallmodel d87b97256b Add cost for different types of area
This makes it so special paths, like jump, have an higher cost
2025-06-15 01:26:17 +02:00
smallmodel 6e64526167 Fix sketchy ladder positioning 2025-06-15 00:12:02 +02:00
smallmodel 9b563eef75 Close the door if reopening on the other side fails 2025-06-14 21:57:30 +02:00
smallmodel b98dcd8a53 Use the spawn delegate 2025-06-14 21:33:34 +02:00
smallmodel ccb4b801bf Add a code delegate for spawn 2025-06-14 21:31:00 +02:00
smallmodel a5f7d9596a Add a documentation about files 2025-06-14 20:19:09 +02:00
smallmodel 4ea06f6eb2 Update g_allclasses.html 2025-06-14 20:19:05 +02:00
smallmodel e1923b58f6 Fix FPS model not drawing properly when the skin has no FPS model 2025-06-14 19:36:43 +02:00
smallmodel df294ff155 Update workflows name 2025-06-13 23:04:44 +02:00
smallmodel e43ade976b Prevent switching teams and primary weapon in single-player 2025-06-13 00:41:25 +02:00
smallmodel 774c9d1853 Don't spawn bots in single-player 2025-06-13 00:24:31 +02:00
smallmodel be6d2a05d2 Set a new session when the game type changes 2025-06-13 00:23:49 +02:00
1337Smithy 78565fbd3c Deactivate all floating windows when using the popmenu command (#757) 2025-06-13 00:22:06 +02:00
smallmodel a3662d01ba Use a debug print rather than an error drop when the reference count for an area is negative (#755) 2025-06-11 03:00:27 +02:00
smallmodel 970dfcf1d8 Use v2.2.2 of action-gh-release (#752)
This is due to this bug: https://github.com/softprops/action-gh-release/issues/628
2025-06-10 20:08:07 +02:00
smallmodel 5a563b3cf0 Add unit test support (#751)
This adds simple support for unit testing, starting with the LZ77 compressor.
- Unit tests run on a separate GitHub Actions workflow
- Remove CTest commands from shared build workflow
2025-06-10 19:45:57 +02:00
smallmodel ca9455bea1 Clear game variables when loading persistent archive 2025-06-10 16:21:05 +02:00
smallmodel 77bcd6d258 Use a 4-byte little-endian number for the raw saved data length (#749) 2025-06-10 16:14:23 +02:00
smallmodel 8c7cbfaa48 Don't use va for unnamedsoldier.cfg 2025-06-10 01:22:16 +02:00
smallmodel 7fdc863175 Refactor LZ77 code (#748) 2025-06-09 23:47:53 +02:00
smallmodel ba3e68adc5 Make the trace functions properly match with the original game 2025-06-08 23:48:17 +02:00
smallmodel c350b7e9c4 Fix complement operator being incorrect with float values 2025-06-08 22:42:47 +02:00
smallmodel dad49e46ed Use a tiny approximation when comparing float values (#747)
This fixes an issue where very tiny values would fail in comparison operators, for example the comparison `2.00000620 > 2` succeeds in the original game but fails in openmohaa.
2025-06-08 22:42:01 +02:00
1337Smithy a0481b86f1 Make r_drawstaticdecals archivable (#744) 2025-06-08 17:59:21 +02:00
1337Smithy 1dc0dcc3cd Lower deployed portable turrets so they don't float in the air (#746) 2025-06-08 17:51:28 +02:00
smallmodel 9ec3c68d64 Add file functions that uses the engine file API (#740)
This provides a safer and more secure alternative to the standard C file API.
2025-06-07 23:54:31 +02:00
smallmodel 50fdc70025 Implement remaining ScriptVariableList methods 2025-06-07 20:45:06 +02:00
smallmodel 5ab30b97d7 Make size() constant 2025-06-07 20:44:45 +02:00
smallmodel 099a67f1fd Make cURL loosely coupled (#739)
This makes it so the project doesn't link against the library. The project must be able to run without the presence of the library.
2025-06-07 20:36:15 +02:00
smallmodel 56db5a1845 Properly initialize the client's enter time regardless of intermission 2025-06-06 21:26:25 +02:00
smallmodel e152eba8fc Fix jump points being made at incorrect locations
This fixes bots not jumping correctly on Verschneit
2025-06-06 20:51:49 +02:00
smallmodel 9663b38c62 Check if crowd is valid before updating 2025-06-06 20:37:31 +02:00
smallmodel 3d1741ec20 Fix bulge vertexes causing some surfaces to disconnect 2025-06-06 00:09:58 +02:00
smallmodel 64cbcd023e Clear pending weapon commands when a new one arrives 2025-06-05 23:40:52 +02:00
smallmodel 33cfc2cbf8 Fix projectiles with no owner getting removed when a player joins a team (#735) 2025-06-05 21:00:20 +02:00
smallmodel 4b486e4a90 Make the barrel also get exploded by landmine and not bash 2025-06-05 00:35:32 +02:00
1337Smithyandsmallmodel b4c96cc543 Prevent barrel leaks when bashed with a weapon (#733)
---------

Signed-off-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-06-05 00:00:41 +02:00
smallmodel 1e27efd7af Set the minimum z bound back to 1 when checking for telefrag
Some mods block spawns by spawning a tiny solid object, this slight modification made these mods not work properly
2025-06-04 22:36:22 +02:00
smallmodel 12d5849e25 Use isValidPolyRef instead of calling passFilter()
passFilter() is currently defined as an inline function and can't be called properly outside its cpp file
2025-06-04 20:59:21 +02:00
smallmodel 663a7bb39e Use correct clamping modes for clampmapx and clampmapy 2025-06-04 19:33:05 +02:00
smallmodel 2cf8c7d62e Ignore combine extension 2025-06-04 19:29:09 +02:00
smallmodel 34c80df5ae Add basic support for obstacles in Recast
- Obstacles with a radius smaller than 100 units (sphere) will be ignored
- An obstacle that would cover polygons more than twice the radius of the obstacle will be ignored

Currently, this only works for big obstacles that affect small areas
2025-06-04 03:20:14 +02:00
smallmodel 62a52c8974 Set agent max height to the character Z bounding box 2025-06-04 01:10:18 +02:00
smallmodel 971f0c9347 Update features.md 2025-06-03 20:13:41 +02:00
smallmodel f4b41df38e Update documentation about bots 2025-06-03 20:10:19 +02:00
smallmodel 6af295ebcb Add a getter to retrieve the player's user info 2025-06-03 19:36:36 +02:00
smallmodel d7ed1c8530 Add a script function to get the value of a key given an info string 2025-06-03 19:36:33 +02:00
smallmodel ea8ee67784 Improve stufftext filtering (#731)
- Use `allow` rather than `filter`, as it checks for allowed commands
rather than prohibited commands.
- Allow userinfo variables to be created by the server.

Userinfo variables are now removed when disconnecting. Some servers use
userinfo variables for custom settings or to store temporary
information, which makes them irrelevant on other servers and uses space.
2025-06-03 18:46:56 +02:00
1337Smithyandsmallmodel 2c0e913e86 Lower the animation sync rate for non-german actors on Spearhead and Breakthrough (#730)
---------

Signed-off-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
Co-authored-by: smallmodel <15067410+smallmodel@users.noreply.github.com>
2025-06-03 00:43:01 +02:00
smallmodel 17fa5af480 Comment out non-existent waffen skins 2025-06-02 20:46:50 +02:00
smallmodel 850a17807c Fix waffen skins not being usable on servers 2025-06-02 20:46:34 +02:00
smallmodel c2ed93e92b TouchField doesn't wait by default 2025-06-02 14:01:22 +02:00
smallmodel c144c345c5 Clear actor state functions that shouldn't be used
Functions like RestartState causes specific states like curious to repeat when it shouldn't (AI misbehaving)
2025-06-02 13:47:24 +02:00
smallmodel a20a1facb0 Add missing UpdateFog() call 2025-06-02 13:15:34 +02:00
smallmodel 45205c1906 Fix MoveTo() using actor's origin instead of waypoint origin
MoveTo() was incorrectly setting the script goal to the actor's origin rather than the waypoint's origin, causing the actor to stand still instead of moving to the specified location.
2025-06-02 01:55:00 +02:00
smallmodel 13762a05b8 Don't pass curious conditions if actor has no curiosity 2025-06-02 01:44:12 +02:00
smallmodel 2c42499788 Fix CuriousSound probability 2025-06-02 01:43:38 +02:00
smallmodel b0c111170e Correctly check if a squadmate is in line of fire (#728)
This fixes actors incorrectly not shooting in Spearhead/Breakthrough when squadmates are next to each other.
2025-06-01 15:41:57 +02:00
smallmodel 08b15c4fe6 Fix server query count increasing when updating a server 2025-06-01 13:41:31 +02:00
smallmodel 94cfcfe5e2 Fix server list stuck in fetching state in specific situations 2025-06-01 12:54:30 +02:00
smallmodel cf06a395de Properly initialize a client when reusing an entity
This fixes an issue where, if a client rejoins after losing connection, the scoreboard would temporarily display the name of client 0 before spawning.
2025-06-01 01:11:05 +02:00
smallmodel 023770f63e Use the entity number rather than the client's clientNum
The number must match the entity number parameter used in G_GetEntity().
This fixes a crash caused by gclient struct being reset when a client reconnects to the same player slot
2025-06-01 00:35:38 +02:00
smallmodel 95dff2536b Add contextual print feature (#727)
Add metadata to client-specific messages such as text and join events.
Can be disabled via `sv_logContext 0`.
2025-05-31 22:31:36 +02:00
smallmodel 7ce1eda3a7 Print to each client individually rather than broadcasting
This prevents spamming the logfile constantly with a bunch of messages that are not relevant
2025-05-31 18:45:23 +02:00
smallmodel 96e4b26635 Fix ip field being wrong 2025-05-31 18:43:25 +02:00
smallmodel 525f75a1a7 Don't filter terrain patches
In the terrain tessellation code, patches sometimes rely on neighbors, which if are hidden can issues with invalid tri. Collision doesn't rely on shader contents anyway
2025-05-30 23:21:02 +02:00
smallmodel 9200b37610 Use rain changes from Spearhead and Breakthrough 2025-05-30 22:48:37 +02:00
smallmodel 44d745d534 Fix vertreg not freed 2025-05-30 13:23:55 +02:00
smallmodel ee287ce00b Correctly unpack and filter out terrain patches that aren't used
This was causing uninitialized terrain patches to be used if they have an invalid content
2025-05-29 20:30:01 +02:00
smallmodel e259d62e18 Fix broken object insertion
This was causing the last object to be uninitialized when an object was being inserted at index 0
2025-05-29 20:26:00 +02:00
smallmodel 2514aed55c Update documentation about bots 2025-05-29 13:07:40 +02:00
smallmodel 3c4f361c7a Fix typo 2025-05-29 12:57:36 +02:00
smallmodel a4391bc320 Implement Recast-based navigation system (#726)
- Paths are generated automatically during map loading, for any map
- Bots can take path that requires climbing ladders (can climb ladders)
- Bots can take path that requires jump (like the ledge on Stalingrad)
- Bots will try to avoid obstacles in front of them by navigating on the
side

The old navigation system with pathnodes can still be used with `g_navigation_legacy
1`
2025-05-29 12:22:27 +02:00
smallmodel 80ae850063 Properly handle the null-terminated character when printing 2025-05-25 18:51:09 +02:00
smallmodel bf4d973097 Fix lean angle slightly not matching the original game (#724) 2025-05-25 18:39:05 +02:00
smallmodel 8bbebe9dea Send the print command to each client instead of broadcasting
This prevents spamming the server console/logfile with print messages
2025-05-25 02:38:08 +02:00
smallmodel 0eca5c56ac Fixed an issue preventing spawning next to spawn points with an offset 2025-05-25 02:24:10 +02:00
smallmodel fa18824a8a Fix client being refused forever after being rejected for high ping 2025-05-21 23:52:43 +02:00
smallmodel ffcec02aa6 Allow a certain amount of challenges to have the same IP address 2025-05-21 23:51:16 +02:00
smallmodel 312dd2f4a6 Don't trigger the doxygen workflow for pull requests 2025-05-19 18:27:15 +02:00
Cowcat5150 7e52f74d2a Missing bigendian values in fencemask. 2025-05-19 18:08:50 +02:00
smallmodel 1241818d5e Use placement new when copying as the object is uninitialized 2025-05-18 19:48:14 +02:00
smallmodel d474791e1d Fix missing bottom line when characters are outside the frame 2025-05-18 00:30:15 +02:00
smallmodel bdf92ffb06 Increase max dm message length to 400 characters 2025-05-18 00:30:10 +02:00
smallmodel 85f8f581bc Initialize the subtitle buffer 2025-05-18 00:24:20 +02:00
smallmodel 76c11e3c97 Fix words counted incorrectly 2025-05-18 00:22:26 +02:00
smallmodel 02c2579366 Use the message string directly rather than copying into a buffer
This removes the print length limit
2025-05-17 23:03:21 +02:00
smallmodel 6c5f95c6bf Fix line breaks being incorrectly calculated
This fixes the issue where long messages would not be shown in console
2025-05-17 22:59:04 +02:00
smallmodel 424243e500 Prevent underflow when caret is 0 2025-05-17 22:27:51 +02:00
smallmodel b725c92922 Fix buffer overflow due to missing null-terminated character 2025-05-17 20:55:48 +02:00
smallmodel 1bcf6f73a4 Add "(all)" prefix 2025-05-17 16:51:15 +02:00
smallmodel 483b49f5ee Print the exact message that is shown in-game to console 2025-05-17 16:49:24 +02:00
smallmodel d790fa398f Add verbose print when rejecting due to user info being too long 2025-05-17 00:18:18 +02:00
smallmodel 23e7df2796 Print the userinfo string when debugging print SV_DirectConnect() 2025-05-16 23:29:52 +02:00
smallmodel ba502a9d39 Log name changes from the server instead of the game module 2025-05-16 22:21:55 +02:00
smallmodel 3ce9621715 Print the correct client number for clients connecting 2025-05-16 22:18:20 +02:00
smallmodel 7806da0448 Don't print name changes from an empty name 2025-05-16 21:12:40 +02:00
smallmodel d533bc450f Display the IP address of the connecting client 2025-05-16 21:12:27 +02:00
smallmodel b91c3dab2d Improve configuration doc 2025-05-16 20:30:18 +02:00
smallmodel b0a541226e Add a note about the major version 2025-05-16 20:06:57 +02:00
smallmodel dbfb911826 Fix provide statement 2025-05-16 19:49:47 +02:00
smallmodel fc33dfe656 Set output remote command buffer size to 8192 bytes
This fixes issues where some tools fail to handle multiple print packets. On a 64-player server, the status command can generate around 5000 bytes of output.

The buffer size in the original game is 49152 bytes, but that's excessively large and can lead to excessive IPv4 fragmentation.
2025-05-15 22:16:36 +02:00
smallmodel ab48b8232b Correctly sort scores in round-based matches 2025-05-15 00:08:18 +02:00
smallmodel 8ab12b29a6 Fix issue where the text message gets empty when exceeding character limit 2025-05-14 23:55:47 +02:00
smallmodel 035f7b2605 Increase message buffer to 200 characters 2025-05-14 23:50:20 +02:00
smallmodel 7081a56113 Fix name being cut off at the first negative character.
Com_SanitizeName uses unsigned comparison when validating characters to prevent premature truncation when encountering characters above 127
2025-05-14 23:36:18 +02:00
smallmodel da9979f887 Remove the architecture suffix from binary names
- Avoids conflicts with third-party DLLs (like SDL, OpenAL) which have no suffix.
- Easier to build an installer and document.
- More clarity as the architecture is already indicated in the archive name.
- Simplifies launchers & automation (no need to guess the architecture).
- The architecture is still visible when typing `version` in the console or when the executable starts
2025-05-13 20:44:35 +02:00
smallmodel e6c53e77b7 Add a note about pdb archives on Windows 2025-05-11 16:17:40 +02:00
smallmodel 0ea834788e Add documentation for running omohaaded in a Docker container 2025-05-09 23:29:28 +02:00
smallmodel c13e977291 More simplification 2025-05-09 22:39:13 +02:00
smallmodel d3dc939a14 Fix steps numbering 2025-05-09 21:39:35 +02:00
smallmodel fd00346eee Fix the heading for the main page 2025-05-09 01:27:11 +02:00
smallmodel a04ad5c689 Use links that are relevant to the project 2025-05-09 00:58:09 +02:00
smallmodel 484b13ba41 Automatically set the version number when generating the doc 2025-05-08 23:34:26 +02:00
smallmodel e1b949d958 Use PROJECT_VERSION_NUMBER environment variable for the docs 2025-05-08 23:32:14 +02:00
smallmodel af0829a7a2 Update the README with the documentation link 2025-05-08 22:44:47 +02:00
smallmodel 34585da510 Fix configuration links 2025-05-08 22:27:02 +02:00
smallmodel 8f7a754d58 Fix the link to "Hosting a server" 2025-05-08 22:13:54 +02:00
smallmodel d93ba45515 Use mathjax rather than Latex 2025-05-08 22:09:43 +02:00
smallmodel 314b47d8e6 Add favicon 2025-05-08 22:04:20 +02:00
smallmodel 5f88448bf6 Compile the latest version of Doxygen instead of using APT 2025-05-08 22:03:51 +02:00
smallmodel 6fb09175d0 Fix typo 2025-05-08 21:15:42 +02:00
smallmodel 7dd3ed4553 Order markdown files 2025-05-08 20:59:29 +02:00
smallmodel c5a921ae76 Integrate the server_opm.cfg file inside the documentation 2025-05-08 20:26:27 +02:00
smallmodel 7e8936667f Move docs/assets/css/doxygen-awesome-css to docs/css/doxygen-awesome-css 2025-05-08 20:25:52 +02:00
smallmodel 6329deef54 Generate and publish doxygen documentation on GitHub pages 2025-05-08 18:40:43 +02:00
smallmodel ce4794e0b2 Add Doxygen support for generating HTML documentation 2025-05-08 18:35:31 +02:00
smallmodel 3cfda459a8 Restructure the whole docs folder 2025-05-08 16:50:41 +02:00
smallmodel 6641100cbd Improve script documentation and add a documentation to define a custom class 2025-05-08 14:10:03 +02:00
smallmodel 962ae8a013 Add a quote to the first command-line path.
This fixes an issue where the game wouldn't load DLLs from the same folder when a space was present in the full binary path.
2025-05-08 01:05:11 +02:00
smallmodel ead8087cff Format launcher source files 2025-05-08 01:03:14 +02:00
smallmodel 9af1bbe286 Iterate maps only if sv_maplist is set 2025-05-07 20:06:36 +02:00
smallmodel 4827e0788c Don't check for mission failed in G_ExitLevel() 2025-05-07 20:06:24 +02:00
smallmodel c8dfecf79c Refactor G_ExitLevel 2025-05-07 20:06:10 +02:00
smallmodel 6285a33ee5 Match exactly the vstr command for nextmap 2025-05-07 18:36:13 +02:00
smallmodel 2ab7252beb Implement and distribute setup packages for Windows
WiX is used to generate an MSI file per architecture for easy installation. GitHub Actions distributes the resulting MSI packages as artifacts and when releasing a new tag.
2025-05-07 00:15:23 +02:00
smallmodel d1c1f284ab Fix links 2025-05-05 23:02:10 +02:00
smallmodel ddcdf73c30 Fix tiny mistakes in the docs 2025-05-05 01:15:11 +02:00
smallmodel 6ab939fbe0 Rework the README file
This makes the README file more clear, more readable and more beginner-friendly.
2025-05-05 00:53:20 +02:00
smallmodel 1d7d7deaed Set the default mode to -2.
-2 makes the game use the current desktop resolution.
2025-05-04 20:30:05 +02:00
smallmodel c2e775666a Add an option to wait between heartbeat packets when sending to multiple masters
The heartbeat implementation now supports an optional delay between sending heartbeat packets to multiple master servers. This is a precaution in case there are issues when sending multiple heartbeat packets simultaneously. If it causes any problems, the delay between packets can be adjusted.
2025-05-04 17:51:14 +02:00
smallmodel d358e4274c Sanitize the name before sending it during challenge 2025-05-03 21:52:04 +02:00
smallmodel ca8efa52c4 Keep the call to CL_RequestAuthorization() even if it's unused 2025-05-03 21:47:51 +02:00
smallmodel eeb82630c4 Use Cvar_VariableIntegerValue() to get the qport 2025-05-03 21:43:13 +02:00
smallmodel 831695f288 Rework the version string (#720)
Rework the version string.

- Make the original game version appear first in the `version` variable.
- Use `com_target_shortversion` for the short version number.
- Use `com_target_version` for the original game version.

Some software, such as HLSW, as well as certain mods, check if the version string begins with "Medal of Honor ....". This commit makes these changes to ensure most software properly handles the game version.
2025-05-03 13:38:00 +02:00
smallmodel e10fa5050a Update links to ports 2025-05-03 00:24:58 +02:00
smallmodel 46ead9fa53 Increase the number of concurrent connections with 2 server lists
This value increases the number of parallel servers to above 1 in Spearhead and Breakthrough when the rate is set to xDSL or above.
2025-05-02 22:54:31 +02:00
smallmodel 8e02230827 Update Dockerfile to add libcurl 2025-05-02 22:46:59 +02:00
smallmodel a924fc252b Use the hardware cursor in windowed mode (#718)
In windowed mode, the mouse is no longer grabbed when one of the UI/console catcher is active. When a UI menu is active, the system's hardware cursor is shown, using the game's custom cursor texture, instead of simulating and rendering the cursor in-game.

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

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

* Refactor update checker

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

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

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

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

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

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

---------

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

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

    ioq3ded +set g_motd \"hello world\"

but it doesn't match behavior of other start up commands (which now
includes seta, sets, and setu) that use all tokens.
2024-09-22 13:47:55 +02:00
Thilo Schulz 7c28efe9cd Fix bug where Com_StartupVariable would set CVAR_USER_CREATED on already existing cvars 2024-09-22 13:36:23 +02:00
smallmodel 5b567f4cba Fix music volume not restored when the map restarts after the intermission 2024-09-22 01:39:40 +02:00
smallmodel 78918eb59d Correctly process statements with a semicolon 2024-09-22 01:23:23 +02:00
smallmodel 1848506f09 Properly pass the size of the path buffer into Q_strncpyz 2024-09-21 23:09:16 +02:00
smallmodel ce0004a296 Use unsafe version of strcpy as the buffer length is unknown 2024-09-21 23:08:52 +02:00
smallmodel e85d3f2a19 Pass the correct size to Q_strncpyz 2024-09-21 22:50:53 +02:00
smallmodel 4e5a0a30bf Fix subtitle being incorrect due to the size of the pointer (and not the size of the string) being passed to Q_strncpyz 2024-09-21 21:09:12 +02:00
pryon 9ab37e54b4 Fix CodeQL printf argument type warning 2024-09-21 20:59:27 +02:00
smallmodel 0bd15172b1 Use Ninja generator for faster builds and set compiler/flags in environment variables directly to reduce copy-pasted parameters 2024-09-21 20:34:45 +02:00
pryon fe0e5c1d9c Fix bug when multiple lines are joined together after copy-pasting text 2024-09-21 20:08:11 +02:00
pryon 5128d88722 Fix bug when deleting multiple lines doesn't actually remove everything selected 2024-09-21 20:04:57 +02:00
pryon 173ca3e58e Fix assertion failures on str operations 2024-09-21 20:02:58 +02:00
pryon 2a13fca737 Fix an off-by-one bug when selection points are determined 2024-09-21 20:01:03 +02:00
pryon b3a9f4423b Fix crash when saving a file with no contents or with no name 2024-09-21 19:52:20 +02:00
pryon 62c24826e6 Silence some localization error console spam messages
This helps to reduce the number of `LOCALIZATION ERROR` messages in the console for strings that couldn't be translated anyway
2024-09-21 19:49:43 +02:00
pryon a3d2c2c044 Properly free uipopup_describe instances 2024-09-21 19:46:32 +02:00
pryon 72409622ef Stop activating controls when their vertical scrollbar is hovered over
This fixes the annoyance of open windows (console, notepad) losing focus just by simply moving the mouse around
2024-09-21 19:43:18 +02:00
pryon c8a2de8235 Implement FS_FileTime for proper retrieval of file date/size info in FilePicker 2024-09-21 19:37:50 +02:00
pryon 6b91846b0c Reimplement Sys_ListFiles and Sys_ListFilteredFiles
They had several bugs, like showing the current and parent directory entires twice, not seeing files but only directories, etc.
2024-09-21 19:36:13 +02:00
pryon 92190220aa Implement clipboard functionality 2024-09-21 19:32:23 +02:00
smallmodel 705d30d125 Add ninja/cmake/clang to the list of packages to install 2024-09-21 19:18:35 +02:00
pryon c316dc7b00 Fix incorrect line width calculation when tabs are present 2024-09-21 19:17:25 +02:00
smallmodel 529dc29d08 Remove CMake parallel build setting 2024-09-21 19:15:26 +02:00
smallmodel 91e760bf5f Use a more recent version of ubuntu image for linux 2024-09-21 18:50:10 +02:00
smallmodel 61e24499bf Cross-compile macOS binaries with single hosted runner image 2024-09-21 18:44:23 +02:00
smallmodel 75621651e5 Add arm64 to valid OSX architectures 2024-09-21 18:30:37 +02:00
smallmodel 3973b95746 Build MacOS binaries from GitHub Action 2024-09-20 23:09:07 +02:00
smallmodel f9d264058b Use safe version of sprintf and strcpy 2024-09-20 23:08:53 +02:00
smallmodel a69d9d4483 Fix compilation errors for MacOS, and add support for MacOS 2024-09-20 21:31:27 +02:00
smallmodel 8b19d00086 Remove the last OpenAL linking as it's already linked before 2024-09-20 21:29:15 +02:00
smallmodel 1156d4f881 Replaced (u)int64_t with long long to avoid constructor conflicts with some compilers 2024-09-20 21:28:36 +02:00
smallmodel 08c5186426 Use stdlib.h as malloc.h is deprecated 2024-09-20 21:27:53 +02:00
smallmodel 61b4a817f3 Move alloca include directive to q_platform.h due to difference between platforms 2024-09-20 20:52:41 +02:00
smallmodel 13710904ba Update getting started installation 2024-09-20 18:45:15 +02:00
smallmodel 015ebb650e Clean up ClassDef class 2024-09-19 22:50:33 +02:00
smallmodel 17d623bf85 Add more clarity + check the length of the const_str enumeration and the length of the const string array to make sure they both match 2024-09-19 21:23:19 +02:00
smallmodel 0049348de5 Update features documentation 2024-09-19 21:06:22 +02:00
smallmodel 20d11f5f97 Add max_amount parameter to the EV_Sentient_GiveAmmo documentation 2024-09-19 21:02:04 +02:00
smallmodel 047a7bb949 Deprecate r_forceClampToEdge in favor of automatic detection
This avoids setting the variable manually to fix sky seams and weird graphical artifacts. Now, it's detected automatically
2024-09-19 21:00:22 +02:00
smallmodel 52c79f7f77 Make crates correctly fall 2024-09-19 20:49:33 +02:00
smallmodel c97bc2e977 Add more clarity in crateobject.cpp 2024-09-19 20:38:31 +02:00
smallmodel 78d564cc04 Fix CrateThink stopping when it shouldn't 2024-09-19 20:34:04 +02:00
smallmodel e27c0716c4 Allow more stufftext commands when the local server is running
Those stufftext commands are primarily used by single-player maps and briefings
2024-09-19 20:14:15 +02:00
smallmodel 35d037daff small detail change 2024-09-19 20:00:53 +02:00
smallmodel f055162ac0 Adjust the quick message DM console rectangle to avoid seeing characters 2024-09-19 19:46:27 +02:00
smallmodel f2e32c737b Fix the gap in the console between the bottom line and the text 2024-09-19 19:46:07 +02:00
smallmodel 205709271b Add fixes from upstream ioq3 2024-09-19 19:24:31 +02:00
smallmodel 3e70a9fab8 Fix mistakes that lead to compilation errors 2024-09-19 19:19:58 +02:00
smallmodel 733c6c96f0 Merge pull request #359 from twolife/spelling
Fix a few typos
2024-09-19 17:44:08 +02:00
Sébastien Noel a010e648ee Fix a few typos 2024-09-19 10:52:47 +02:00
smallmodel 1c7b561aa9 Filter stufftext commands
This works by allowing the stufftext server command to be executed if the statement only contains whitelisted commands and variables
2024-09-18 23:51:39 +02:00
smallmodel 75a71d35ec Avoid calling isspace with a character that has a value below 0 2024-09-18 23:04:01 +02:00
smallmodel 7c0f0672bd Add r_vidmode1024 and r_vidmodemax so the display resolution can be changed in Spearhead and Breakthrough 2024-09-18 22:59:30 +02:00
smallmodel 8fc6b6e3c3 Correctly handle quick message and message mode for the chat window
This fixes the chat window not being put in quick message mode at all when intended, now it also correctly handle team/private message modes
2024-09-18 22:14:16 +02:00
smallmodel 6c2c8ca2b7 Don't archive s_openaldevice and s_openaldriver 2024-09-18 22:10:33 +02:00
smallmodel 1b6bdd07e7 Disable function keys for UI
This fixes the issue where menus like the message mode can't be toggled
2024-09-18 21:51:35 +02:00
smallmodel 539688dd3d Reduced the delay to 33 ms (30 fps) to update the loading bar
This makes the loading bar smoother
2024-09-18 20:56:13 +02:00
smallmodel 08e09c3b4c Avoid setting variables with the same value
This prevents the console from being spammed with constant variable change when `developer` is set to 2
2024-09-18 20:55:02 +02:00
smallmodel 4259053c7e Expose methods for basic DMA (when OpenAL is unavailable) 2024-09-18 20:49:38 +02:00
smallmodel c221cfd493 Reorganize workflows and use multiple environments for different release stages 2024-09-18 20:33:30 +02:00
smallmodel 41298b53d4 Add PRODUCT_VERSION_STAGE variable to define the stage of the software through builds 2024-09-18 18:13:57 +02:00
smallmodel ddcd05adc6 Cancel other CodeQL actions on newer pushes 2024-09-18 17:10:25 +02:00
smallmodel a28cd64c7a Update implementation documentation again 2024-09-18 00:30:38 +02:00
smallmodel 38e62fef18 Update the implementation documentation with the current state 2024-09-18 00:26:51 +02:00
smallmodel 3f139f463b Remove stub print 2024-09-18 00:19:05 +02:00
smallmodel 0597191319 Implement SkelVec3::IsUnit 2024-09-18 00:18:08 +02:00
smallmodel f4c8b0c21f Initialize the cube build info
This should fix lighting being too dark or incorrect in some places
2024-09-17 22:22:42 +02:00
smallmodel bba7031f3d Add more clarity to code 2024-09-17 22:20:20 +02:00
smallmodel 4785913e02 compare_light_intensities should compare intensity as integers directly 2024-09-17 21:31:50 +02:00
smallmodel a6808d1f6a Fix incorrect light color for point lights and spot lights, also handle negative point light intensity
This fixes lighting from sphere being computed incorrectly for entities, making entities often look black or having strange lighting color
2024-09-17 21:27:14 +02:00
smallmodel 7188e9832a Fix leaf iteration 2024-09-17 20:51:00 +02:00
smallmodel 0cce0c81fb Prevent world values from being overridden by entities 2024-09-17 20:32:39 +02:00
smallmodel a60baa03e0 Add MAX_SPHERE_LIGHTS 2024-09-17 20:06:35 +02:00
smallmodel b0c8dafb33 Correctly compute colors for static model in vertex lit texture 2024-09-17 20:02:37 +02:00
smallmodel b672fc8b29 Add #if, #if_not and #else shader statements 2024-09-17 20:00:24 +02:00
smallmodel eac69f659f For dot/oneminusdot, shader needs normal 2024-09-17 20:00:00 +02:00
smallmodel d9ab65154c Fix incorrect lighting grid blend 2024-09-17 00:27:01 +02:00
smallmodel c120aed8bb Fix incorrect static model grid lighting 2024-09-16 22:11:58 +02:00
smallmodel ecdbe3d959 Don't check lightmap for RB_StageIteratorVertexLitTextureUnfogged to be used 2024-09-16 22:01:04 +02:00
smallmodel 96d10fb8b0 Mark r_light_nolight as cheat 2024-09-16 20:50:02 +02:00
smallmodel 2ab826268d Clear the legs state during the torso evaluation when the movecontrol is not legs
The legs state won't be stuck anymore waiting for an empty animation. This could happen under special circumstances, when the torso evaluation sets the movecontrol to non-legs (clears the legs anim) and then back to legs in subsequent iterations.
Fixes #105, the issue cannot be exploited anymore for land-sharking
2024-09-16 20:20:19 +02:00
smallmodel c3e3f368e0 use cheats rather than sv_cheats to check if the client is connected to a cheat server 2024-09-16 18:59:36 +02:00
smallmodel f35582489d Fix support for british, russian and italian voices in Spearhead and Breakthrough 2024-09-16 18:09:56 +02:00
smallmodel 9acea3484d Play zing sounds only if the location if the zing is valid
This fixes a potential crash where uninitialized position would be passed to the sound system
2024-09-16 17:39:15 +02:00
smallmodel a72da9b73e Fix incorrect terrain height for poly
This caused decals to float in the air when they were placed on the terrain
2024-09-15 23:49:42 +02:00
smallmodel df53d35967 Fix real dynamic lighting algorithm for both terrain and patch
This fixes #356 where real dynamic lighting would look completely wrong, making it look like there are graphical artifacts on surfaces
2024-09-15 21:23:17 +02:00
smallmodel e5e7421d3c Fix terrain lightmap when there is a dynamic light map
This fixes terrain having a completely wrong lightmap texture coordinates for dynamic lighting
2024-09-15 21:21:38 +02:00
smallmodel 6ff25d00fc Use lightmap offset for grid surface when a dlightmap is specified 2024-09-15 21:15:01 +02:00
smallmodel 4a5b0b3105 Fix y lightmap position when allocating a new lightmap block
See the issue with dynamic lights: #356
2024-09-15 19:39:22 +02:00
smallmodel d05d964432 Fix NaN lmapStep for terrain patches 2024-09-15 19:34:25 +02:00
smallmodel daa4a67b49 Reuse dlightmap in R_CheckDlightSurface and R_CheckDlightTerrain 2024-09-15 19:34:06 +02:00
smallmodel 9c0224911c Reset the number of dynamic lights when calculating the real terrain lighting
This fixes a crash that can occur when there is only the terrain that can be lit with dlights
2024-09-15 12:02:05 +02:00
smallmodel ef5759cff5 Don't execute commands during the intro 2024-09-15 01:21:20 +02:00
smallmodel 77292fb9ab First person spectator fix (not working yet) 2024-09-15 01:21:17 +02:00
smallmodel 6fb9ab078e Implement RE_DrawBackground_DrawPixels 2024-09-15 01:12:00 +02:00
smallmodel 844a72e0f3 Add DrawPixels and PixelZoom 2024-09-15 01:11:52 +02:00
smallmodel 46e9046629 Implement VehicleHalfTrack 2024-09-15 01:03:37 +02:00
smallmodel e5af60787e Partially implement GetZone/IsInZone 2024-09-15 00:42:35 +02:00
smallmodel 4b0696a187 Implement remaining methods of ClientGameCommandManager 2024-09-15 00:42:22 +02:00
smallmodel a6377fedab Remove useless code 2024-09-14 23:36:19 +02:00
smallmodel 2f884e6d55 Call Key_GetCatcher/Key_SetCatcher instead of modifying the variable directly 2024-09-14 23:32:24 +02:00
smallmodel 28f8c65771 Key_SetCatcher() must use cls.keyCatchers 2024-09-14 23:30:30 +02:00
smallmodel b509ef5ab4 Deactivate the mouse only when loading 2024-09-14 23:29:30 +02:00
smallmodel 9f48dabaec Play the game's intro when starting 2024-09-14 22:59:27 +02:00
smallmodel 5b0224ae3c Implement support for playing movies
Videos like briefings and intro are now played correctly
2024-09-14 22:58:43 +02:00
smallmodel c3ef267d6d Implement movie audio in OpenAL code 2024-09-14 21:55:15 +02:00
smallmodel fe9b298705 Export cl_movieaudio 2024-09-14 21:53:19 +02:00
smallmodel 0b106cf47e Print errors only when developer mode is set 2024-09-14 13:21:08 +02:00
smallmodel 9b417c9b26 Add EV_Client_ForceFeedback (unused) 2024-09-14 13:20:55 +02:00
smallmodel 37d5458c4c Partially implement cinematic support for reading RoQ files (no audio yet) 2024-09-13 23:00:31 +02:00
smallmodel 77d48cb104 Don't call UI_ClearBackground in cinematic mode 2024-09-13 22:58:37 +02:00
smallmodel a25200741a Finis the loading screen if it's the default 2024-09-13 22:23:53 +02:00
smallmodel d04a32920a Fix an incorrect parameter value passed to FS_Read when reading the DCL file 2024-09-13 21:49:45 +02:00
smallmodel 792b676c11 Set the number of brush models
The level marks system depends on the number of brush models and leafs, having a number that doesn't match what was saved would cause a crash
2024-09-13 21:47:57 +02:00
smallmodel 690a7a7557 Format cl_ui file 2024-09-13 21:36:23 +02:00
smallmodel e128c93ad9 Declare CL_FinishedStartStage 2024-09-13 21:25:41 +02:00
smallmodel 39add5ccec Fix incorrect parsing of music volumes 2024-09-13 20:01:01 +02:00
smallmodel a1a89cba34 Allow dynamic adjustment for the size of status columns in SVC_Status 2024-09-13 19:50:29 +02:00
smallmodel 2d696cf500 Also use the port when connecting to a server 2024-09-13 19:07:06 +02:00
smallmodel 45fe0bc8b7 Add an IP column
See #353 where servers would appear twice
2024-09-13 19:06:38 +02:00
smallmodel 9fc4c67187 Fix a crash when insep is 0 2024-09-13 19:05:30 +02:00
smallmodel 34aeab5f77 Fix the game type string being empty
(see #353 for the game type)
2024-09-13 18:34:43 +02:00
smallmodel b510452260 Remove useless comment 2024-09-12 23:48:46 +02:00
smallmodel 89b8d5a67b Use source files in renderercommon 2024-09-12 23:46:13 +02:00
smallmodel 500e3a3b2c Add support for JPEG screenshots 2024-09-12 23:33:39 +02:00
smallmodel 47e575ed9a define USE_INTERNAL_JPEG for compatible JPEG struct size 2024-09-12 23:33:21 +02:00
smallmodel 10b30d74e7 Implement sample_volume() 2024-09-12 22:23:27 +02:00
smallmodel 1ba4c6b7ad Remove useless comment 2024-09-12 22:18:09 +02:00
smallmodel eb899be95e Implement RE_GetGraphicsInfo 2024-09-12 21:40:07 +02:00
smallmodel 6d993af419 Fix compiler warning 2024-09-12 21:09:07 +02:00
smallmodel a136cccbe1 Implement R_CraterTerrain 2024-09-12 21:02:04 +02:00
smallmodel 2b43ebfca4 Add ter_crater command 2024-09-12 20:43:24 +02:00
smallmodel 06f4980ee1 Implement ghost textures with particles 2024-09-12 20:09:05 +02:00
smallmodel 6cdf5b7b7e Process .gst files 2024-09-12 19:44:36 +02:00
smallmodel 117b9a5579 Add declarations for GHOST functions 2024-09-12 19:42:41 +02:00
smallmodel 9475be8f6f Remove entityNumIndexes/staticModelNumIndexes from declaration as it causes compilation issue on some compilers 2024-09-11 23:41:47 +02:00
smallmodel 41ca1797f9 Implement basic GHOST methods and functions 2024-09-11 23:21:50 +02:00
smallmodel e56ae3d266 Update features.md 2024-09-11 21:07:55 +02:00
smallmodel 735ffaf80b Implement swipe 2024-09-11 19:57:45 +02:00
smallmodel ed52d1c648 Implement R_FastDlightTerrain 2024-09-11 19:19:38 +02:00
smallmodel 78fa90c59b Move RB_StaticMesh to tr_model.cpp for info world tris 2024-09-11 19:03:41 +02:00
smallmodel 548a3efe5a Implement R_InfoWorldTris_f and R_PrintInfoWorldtris 2024-09-11 18:57:50 +02:00
smallmodel 18a12eeba3 Fix loop breaking instead of continuing 2024-09-11 18:51:05 +02:00
smallmodel 83d486ceeb Add missing declarations 2024-09-11 18:48:47 +02:00
smallmodel d898c0f995 Implement R_PrintInfoStaticModels 2024-09-11 18:45:17 +02:00
smallmodel 02faf6f8c1 Implement R_Sky_ChangeFrustum 2024-09-11 18:27:19 +02:00
smallmodel 3478bbddf2 Implement RB_ComputeShadowVolume 2024-09-11 18:02:39 +02:00
smallmodel fd1ee31e1e Remove useless comment 2024-09-11 17:56:26 +02:00
smallmodel 4a565f0985 Declare R_GetLightingGridValueFast 2024-09-11 00:23:43 +02:00
smallmodel c68f23cdaf Fix compilation warnings 2024-09-11 00:21:31 +02:00
smallmodel e386eb00ef Implement all lighting functions 2024-09-11 00:12:13 +02:00
smallmodel 662d048bf4 Implement R_AddLightGridSurfacesToScene 2024-09-10 20:42:05 +02:00
smallmodel d9e3cc2188 Add a way to draw the skeleton for debugging purposes 2024-09-10 20:16:56 +02:00
smallmodel a586f13af8 Remove CL_GamespyServers_f as there is an existing implementation 2024-09-10 19:58:28 +02:00
smallmodel 37820c1673 Generate QKey 2024-09-10 19:57:25 +02:00
smallmodel 8a2e4ca470 Add Com_RandomBytes and Com_IsVoipTarget 2024-09-10 19:54:25 +02:00
smallmodel 3a5da64c6f Make radar clients speak on mohaas/mohaab 2024-09-10 19:50:43 +02:00
smallmodel 9c018a2330 Implement CGM_FENCEPOST 2024-09-10 19:40:53 +02:00
smallmodel 0840cdd83a Restore the old behavior where the bullet would hit all entities in sight. Only works when targeting mohaa version 1.x
Fixes #348. Since 2.0, bullet trace stops after the first hit entity even if it's a trigger, which can be an issue on some SP maps.
2024-09-10 19:01:34 +02:00
smallmodel e972747969 Update documentation
This adds an example for using fs_homepath
2024-09-09 23:59:06 +02:00
smallmodel e151c6eb15 Update documentation 2024-09-09 23:38:37 +02:00
smallmodel 603444a69f Fix an issue where the remaining time would reach 0:00 and the match would never end
See #287, this occurred when the fraglimit was defined.
2024-09-09 22:25:54 +02:00
smallmodel 999e0fd721 Implement test emitter 2024-09-09 21:48:40 +02:00
smallmodel 47131dec44 Fix wrong special effects count 2024-09-09 21:43:20 +02:00
smallmodel 6adad053d9 Explicitly disable looping when setting the sample loop count to a value other than 0
This fixes a rare occurrence where some sounds would loop forever
2024-09-09 00:15:39 +02:00
smallmodel 725561b655 Fix the usage of memory, strings, constant and parameters 2024-09-08 23:54:47 +02:00
smallmodel b84fbf452e Pass a vec4_t to GL_SetFogColor() rather than a vec3_t 2024-09-08 23:49:48 +02:00
smallmodel eb7af2bce9 Implement basic test emitter functions 2024-09-08 23:33:55 +02:00
smallmodel 7c57c4b131 Fix wrong secondary ammo type being picked up 2024-09-08 20:20:58 +02:00
smallmodel 4460466cb3 Implement RE_SetRenderTime 2024-09-08 19:43:37 +02:00
smallmodel eea19d733d Add R_UpdateGhostTextures (unimplemented) 2024-09-08 19:43:29 +02:00
smallmodel abc97dcab3 Implement R_AddTerrainMarkSurfaces and RE_AddTerrainMarkToScene 2024-09-08 19:40:00 +02:00
smallmodel 065c791a10 Implement CG_ResetEffectCommandCvars 2024-09-08 19:29:40 +02:00
smallmodel 6b902e7f5d Remove "unimplemented" comment 2024-09-08 18:49:45 +02:00
smallmodel df0cb87b35 Implement CG_AddLightShow (cg_acidtrip) 2024-09-08 18:48:15 +02:00
smallmodel 0b9687fea4 Implement functions for printing content types, surface properties and surface types 2024-09-08 18:39:39 +02:00
smallmodel 99fbe092bc Use correct names for surface flags 2024-09-08 18:34:02 +02:00
smallmodel 7a7849ae83 Remove comment 2024-09-08 18:25:10 +02:00
smallmodel 47830bb330 Update version number 2024-09-08 18:24:59 +02:00
smallmodel 0dfb1a3a2a Use Com_DPrintf for TIKI/alias warnings/errors
This prevent the console from getting spammed with developer errors in production
2024-09-08 18:22:12 +02:00
smallmodel e2e1ab0275 Fix status command column length breaking some programs 2024-09-08 18:09:54 +02:00
smallmodel 4249cacf2f Support token dollar in variable name
This fixes mods like trapshooting not working because of a '$' in a variable name
2024-09-08 18:03:43 +02:00
smallmodel 4e3ec52673 Fix a crash due to NULL string being appended 2024-09-08 18:02:57 +02:00
smallmodel 98991a4a7a Fix file ordering with uppercase/lowercase file names 2024-09-08 17:59:30 +02:00
smallmodel bca6d656b6 Fix bad verts value passed to CG_AddFragmentToScene 2024-09-08 17:53:35 +02:00
smallmodel ffc3580d43 Implement CG_CheckCaptureKey 2024-09-08 16:31:19 +02:00
smallmodel c18cdc78ea Fix Cgame key catching 2024-09-08 15:48:46 +02:00
smallmodel 77ecc73631 Implement lens flare / sun flares
Some maps like mohdm1 have a sun flares, now when you look up the sky towards the sun direction, you will see the flare of the sun
2024-09-08 15:31:18 +02:00
smallmodel 3834f51d74 Fix GetNamedWidget() always returning the last valid widget
This is problematic when doing different logic when a widget doesn't exist, for example when loading a map, if the continue button doesn't exist then the game should continue automatically
2024-09-08 15:06:43 +02:00
smallmodel 86ddec3f76 Clear the world to prevent crashes 2024-09-08 14:59:10 +02:00
smallmodel 4d12bcb184 Export s_sun 2024-09-08 00:52:03 +02:00
smallmodel 7d93723382 Update getting started doc 2024-09-07 23:58:56 +02:00
smallmodel 8e1a52bbb7 Implement VIS debugging 2024-09-07 23:58:50 +02:00
smallmodel cd9b1a741f Match CG_PermanentMark parameters
This fixes #355
2024-09-07 23:57:17 +02:00
smallmodel cefe331e0c Remove useless surface flags 2024-09-07 23:51:52 +02:00
smallmodel 14d1fae54a Implement all treadmark functions 2024-09-06 22:10:22 +02:00
smallmodel a1601be7a6 Implement code to make tread mark decals 2024-09-05 23:54:01 +02:00
smallmodel a2ebeb11e3 Update features.md 2024-09-05 23:10:50 +02:00
smallmodel b7f0f32878 Fix DCL signature on big-endian architectures 2024-09-05 01:14:42 +02:00
smallmodel 58e39add5b Implemented treadmarks update functions 2024-09-05 01:04:53 +02:00
smallmodel 61725c95df Add MASK_TREADMARKS 2024-09-05 00:43:36 +02:00
smallmodel 71a1df661a Fix current mark's alpha component not updating properly 2024-09-04 21:54:49 +02:00
smallmodel 9eed0eab5f Implement CG_PermanentMark 2024-09-04 21:51:42 +02:00
smallmodel e42b6fe0a9 Fix current mark not updating if it has a rotation 2024-09-04 21:51:16 +02:00
smallmodel b1e640ad1d Implement CG_PermanentMark 2024-09-04 21:41:16 +02:00
smallmodel 2fc091fdf7 Skip loading if the file length is less than the dcl header length 2024-09-04 20:56:41 +02:00
smallmodel 47ba241e7d Fix file being closed but still used afterwards 2024-09-04 20:50:22 +02:00
smallmodel c0d37c504a Fix infinite loop in R_TerrainHeightForPoly 2024-09-04 20:46:10 +02:00
smallmodel 1e0195f6e3 Add variables that will be used in unimplemented functions 2024-09-04 20:29:29 +02:00
smallmodel e806c1ddf1 Move MAX_MARK values to tr_types_new.h 2024-09-04 20:23:20 +02:00
smallmodel 78f0072c59 Update the SFX datasize when downsampling
This fixes #349 where the size of the AL buffer didn't match the real downsampled size, which would cause AL to read way past of end of the data buffer
2024-09-04 20:12:46 +02:00
smallmodel 1022ce531a Fix AL buffers having sound data past end of the sound buffer 2024-09-04 20:10:56 +02:00
smallmodel 7f08a7bca8 Remove register keyword as it's deprecated since C++17 2024-09-04 20:10:21 +02:00
smallmodel 4123bef60d Implement R_ApplyLevelDecal 2024-09-04 20:05:48 +02:00
smallmodel c6464efa07 Implement level mark loading and updating 2024-09-04 00:02:07 +02:00
2047 changed files with 320264 additions and 295123 deletions

No files matched your search

+52 -18
View File
@@ -1,39 +1,73 @@
---
name: Bug report
about: Create a report to help us improve
name: OpenMoHAA VR bug report
about: Report a VR, gameplay, rendering, or performance issue in this port
title: ''
labels: bug
assignees: ''
---
Report port issues at https://github.com/bearstonem/openmohaa-vr/issues.
Meta Quest is the current standalone release target. Steam Frame is a development
target; no Steam Frame binary is available yet. Please identify the build you tested.
**Describe the bug**
A clear and concise description of what the bug is.
What went wrong? For visual issues, describe whether it affects one eye or both,
the world, HUD, menus, or controller models.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
1. Start the game using '...'
2. Load mission/map or multiplayer mode '...'
3. Use these controls or settings: '...'
4. Observe '...'
Does it happen every time? Did a previous port release work?
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots (OPTIONAL)**
If applicable, add screenshots to help explain your problem.
**Headset and build**
- Headset model:
- Headset OS / firmware version:
- OpenXR runtime and version, if known:
- Controllers and input mode:
- OpenMoHAA VR release / downloaded asset name:
- Git commit and build configuration, if built from source:
- Engine version from the startup log or `version` console command:
- Host OS and GPU, if applicable to a development build:
**Game and settings**
- Game edition: Allied Assault / Spearhead / Breakthrough:
- Mission/map and single-player or multiplayer:
- Mods or custom assets:
- Changed VR/render settings and whether the release's `autoexec.cfg` was installed:
- For performance issues: refresh rate, render scale, and measured frame time/FPS, if available:
**Screenshots or recording (optional)**
Attach a short capture when useful. Describe headset-only symptoms that a recording
does not show, such as double vision, flickering in one eye, or tracking drift.
**Logs**
- Paste the output of the console window in a text file, and attach the text file.
- If applicable (`logfile` set to 2), attach the `qconsole.log` file. On Windows, it can be found in **%APPDATA%\...\qconsole.log** and on Linux, it can be found on the home directory **~/.openmohaa/.../qconsole.log**.
**Version information (please complete the following information):**
- OS: [e.g. `Debian`]
- OS Version [e.g `12`]
- OpenMoHAA Version: [e.g `0.70.0-alpha+0.0b1a20dcf win_msvc64-x86_64-debug`, can be found below **Common Initialization** in the console, or by typing `version`]
- Attach the startup log and the output around the failure as a text file.
- On Quest, start log capture before reproducing: `adb logcat -v threadtime -s openmohaa:V AndroidRuntime:E > openmohaa-vr.log`.
- Include `qconsole.log` when available (`logfile 2` enables it), plus crash output or a backtrace for crashes.
- For source builds on other targets, include relevant OpenXR/runtime logs and the exact launch command.
- Remove personal information or server passwords before attaching logs.
**Dump (OPTIONAL)**
You can include a core dump generated by the OS (`.dmp` file). If you compiled OpenMoHAA yourself, also add all output openmohaa binaries (except libopenal and libSDL).
**Crash dump (optional)**
If available, attach a crash dump or Android tombstone. For a source build, identify
the matching commit and retain its binaries/debug symbols for follow-up debugging.
**Additional context (optional)**
**Additional context (OPTIONAL)**
Add any other context about the problem here.
+77
View File
@@ -0,0 +1,77 @@
name: "Builds"
on:
push:
branches:
- '**'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build-all:
uses: ./.github/workflows/shared-build.yml
with:
environment: 'testing'
# Initially create a release with 1 job
# so multiple files can be uploaded at the same time afterwards
create-release:
if: github.event_name != 'pull_request' && github.ref_name == 'main'
runs-on: ubuntu-24.04
environment: 'testing'
needs: [build-all]
steps:
- name: Release
uses: softprops/action-gh-release@v2.3.2
with:
prerelease: true
name: '${{github.ref_name}}-${{github.sha}}'
tag_name: 'dev'
deploy-release:
if: github.event_name != 'pull_request' && github.ref_name == 'main'
strategy:
matrix:
target_os: [
'linux-amd64',
'linux-i686',
'linux-arm64',
'linux-armhf',
'linux-powerpc',
'linux-ppc64',
'linux-ppc64el',
'windows-x64-pdb',
'windows-x86-pdb',
'windows-arm64-pdb',
'macos-multiarch-arm64-x86_64',
]
runs-on: ubuntu-24.04
environment: 'testing'
needs: [create-release]
env:
RELEASE_NAME: ${{github.event.repository.name}}-dev-${{matrix.target_os}}
steps:
- uses: actions/download-artifact@v4
with:
name: 'out-${{matrix.target_os}}'
path: ${{github.workspace}}/${{matrix.target_os}}
- name: Zip
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
run: zip -9 -r "../${{env.RELEASE_NAME}}.zip" ./
- name: Release
uses: softprops/action-gh-release@v2.3.2
with:
tag_name: 'dev'
files: ${{github.workspace}}/${{env.RELEASE_NAME}}.zip
-256
View File
@@ -1,256 +0,0 @@
name: Build
on:
push:
branches:
- '**'
pull_request:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
build-platform-linux:
strategy:
matrix:
architecture: [
{name: 'amd64', triple: 'x86_64-linux-gnu'},
{name: 'i686', triple: 'i686-linux-gnu'},
{name: 'arm64', triple: 'aarch64-linux-gnu'},
{name: 'armhf', triple: 'arm-linux-gnueabihf'},
{name: 'powerpc', triple: 'powerpc-linux-gnu'},
{name: 'ppc64', triple: 'powerpc64-linux-gnu'},
{name: 'ppc64el', triple: 'powerpc64le-linux-gnu'}
]
name: "Building for platform linux-${{matrix.architecture.name}}"
runs-on: ubuntu-22.04
steps:
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_BUILD_PARALLEL_LEVEL=$(($(nproc) * 16))" >> $GITHUB_ENV
# echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Install required packages
run: |
sudo apt update && sudo apt install -y flex bison \
libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
- name: Install required cross-platform packages (${{ matrix.architecture.triple }})
if: matrix.architecture.name != 'amd64'
run: sudo apt install -y gcc-12-${{ matrix.architecture.triple }} g++-12-${{ matrix.architecture.triple }}
# Setup SDL
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
version: sdl2-latest
build-type: Release
cmake-arguments: "-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }}
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }}"
# soft-oal setup
# Use GCC instead of Clang because of missing SSE intrinsics
# It also doesn't enable altivec support on PowerPC by default
- name: Checkout soft-oal
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '1.23.1'
- name: Configure and install soft-oal
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \
-DCMAKE_C_COMPILER=${{ matrix.architecture.triple }}-gcc-12 \
-DCMAKE_CXX_COMPILER=${{ matrix.architecture.triple }}-g++-12
cmake --build ./build --config ${{env.BUILD_TYPE}}
cmake --install ./build --config ${{env.BUILD_TYPE}}
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS=--target=${{ matrix.architecture.triple }} \
-DCMAKE_CXX_FLAGS=--target=${{ matrix.architecture.triple }} \
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' \
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' \
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd "${{github.workspace}}/build"
ctest -C ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Create hard-link and copy symbolic links
cp -l ${{steps.sdl.outputs.prefix}}/lib/libSDL2-2.0.so.0 '${{github.workspace}}/install/'
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/install/'
- uses: actions/upload-artifact@v4
with:
name: out-linux-${{matrix.architecture.name}}
if-no-files-found: error
path:
${{github.workspace}}/install
build-platform-windows:
strategy:
matrix:
architecture: [
{name: 'x64', config: 'x64' },
{name: 'x86', config: 'Win32' },
{name: 'arm64', config: 'ARM64' }
]
name: "Building for platform windows-${{matrix.architecture.name}}"
runs-on: windows-2022
steps:
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_BUILD_PARALLEL_LEVEL=$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors * 16)" >> $GITHUB_ENV
# Setup SDL
- name: Set up SDL
id: sdl
uses: libsdl-org/setup-sdl@main
with:
version: sdl2-latest
build-type: Release
cmake-arguments: "-A ${{ matrix.architecture.config }}"
- name: Install Flex/Bison
working-directory: ${{github.workspace}}
run: |
mkdir thirdparties && cd thirdparties
git clone --depth 1 --single-branch --branch v2.5.25 https://github.com/lexxmark/winflexbison.git
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' ./winflexbison
cmake --build winflexbison-build --config Release --parallel
cmake --install winflexbison-build
# soft-oal setup
- name: Checkout soft-oal
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '1.23.1'
# soft-oal build
# Statically link the CRT runtime into OAL as a workaround to prevent crashes
- name: Configure and install soft-oal
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build -A ${{ matrix.architecture.config }} `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' `
-DALSOFT_BUILD_ROUTER=OFF `
-DALSOFT_REQUIRE_WINMM=ON `
-DALSOFT_REQUIRE_DSOUND=ON `
-DALSOFT_REQUIRE_WASAPI=ON `
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_C_FLAGS_MINSIZEREL="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_MINSIZEREL="/MT /O1 /Ob1 /DNDEBUG" `
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG"
cmake --build ./build --config ${{env.BUILD_TYPE}}
cmake --install ./build --config ${{env.BUILD_TYPE}}
# Unfortunately soft-oal produces a binary called OpenAL32 even in 64-bit
if (("x64", "ARM64") -icontains "${{ matrix.architecture.config }}") { Rename-Item -Path '.\install\bin\OpenAL32.dll' -NewName 'OpenAL64.dll' }
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=-A ${{ matrix.architecture.config }} `
--log-level=VERBOSE `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
-DGIT_REVISION_BUILD_NUMBER=${{ github.run_number }} `
-DBISON_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_bison.exe' `
-DOPENAL_LIBRARY='${{github.workspace}}/thirdparties/soft-oal' `
-DOPENAL_INCLUDE_DIR='${{github.workspace}}/thirdparties/soft-oal/include' `
-DFLEX_EXECUTABLE='${{github.workspace}}/thirdparties/winflexbison-install/win_flex.exe'".Replace("`r", "").Replace("`n", "") >> $env:GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cd "${{github.workspace}}/build"
ctest -C ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
Copy-Item '${{steps.sdl.outputs.prefix}}/bin/*.dll' -Destination '${{github.workspace}}/install'
Copy-Item '${{github.workspace}}/thirdparties/soft-oal/install/bin/*.dll' -Destination '${{github.workspace}}/install'
- uses: actions/upload-artifact@v4
with:
name: out-windows-${{matrix.architecture.name}}
if-no-files-found: error
path: |
${{github.workspace}}/install
!${{github.workspace}}/install/**/*.pdb
- uses: actions/upload-artifact@v4
with:
name: out-windows-${{matrix.architecture.name}}-pdb
if-no-files-found: error
path: |
${{github.workspace}}/install
+60
View File
@@ -0,0 +1,60 @@
name: "Generate Documentation"
on:
push:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get and install Doxygen
run: |
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/
- name: Checkout repository
uses: actions/checkout@v4
with:
path: 'source'
- name: Generate Documentation (Doxygen)
working-directory: ${{github.workspace}}/source
run: |
version_file=$(cat code/qcommon/q_version.h)
PRODUCT_VERSION_MAJOR=$(echo "$version_file" | grep -E "define[ \t]+PRODUCT_VERSION_MAJOR" | awk -F'[ \t]+' '{print $3""}' | tr -d '\r\n')
PRODUCT_VERSION_MINOR=$(echo "$version_file" | grep -E "define[ \t]+PRODUCT_VERSION_MINOR" | awk -F'[ \t]+' '{print $3""}' | tr -d '\r\n')
PRODUCT_VERSION_PATCH=$(echo "$version_file" | grep -E "define[ \t]+PRODUCT_VERSION_PATCH" | awk -F'[ \t]+' '{print $3""}' | tr -d '\r\n')
export PROJECT_VERSION_NUMBER="$PRODUCT_VERSION_MAJOR.$PRODUCT_VERSION_MINOR.$PRODUCT_VERSION_PATCH"
doxygen docs/Doxyfile
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{github.workspace}}/source/docs/doxygen/html
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
# Permissions for deploying the page
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
@@ -20,6 +20,10 @@ on:
schedule:
- cron: '42 8 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
@@ -43,6 +47,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Install required packages
with:
packages: libopenal-dev libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
version: "0.1"
# Setup SDL
- name: Set up SDL
id: sdl
-63
View File
@@ -1,63 +0,0 @@
name: Publish artifacts
on:
push:
tags:
- "v*.*.*"
env:
RELEASE_TYPE: ${{ vars.RELEASE_TYPE || 'test' }}
RELEASE_IS_PRERELEASE: ${{ vars.RELEASE_IS_PRELEASE }}
permissions:
contents: write
jobs:
build-all:
uses: ./.github/workflows/build-cmake.yml
deploy_all:
strategy:
# Set the maximum number of parallel jobs to 1, to avoid a race-condition
# while creating a new release
max-parallel: 1
matrix:
target_os: [
'linux-amd64',
'linux-i686',
'linux-arm64',
'linux-armhf',
'linux-powerpc',
'linux-ppc64',
'linux-ppc64el',
'windows-x64',
'windows-x86',
'windows-x64-pdb',
'windows-x86-pdb',
'windows-arm64',
'windows-arm64-pdb'
]
runs-on: ubuntu-22.04
environment: release
needs: [build-all]
env:
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}-${{matrix.target_os}}
steps:
- uses: actions/download-artifact@v4
with:
name: 'out-${{matrix.target_os}}'
path: ${{github.workspace}}/${{matrix.target_os}}
- name: Zip
working-directory: ${{github.workspace}}/${{matrix.target_os}}
run: zip -r ../${{ env.RELEASE_NAME }}.zip ./
- name: Release
uses: softprops/action-gh-release@v2
with:
name: '${{github.ref_name}}-${{env.RELEASE_TYPE}}'
prerelease: ${{env.RELEASE_IS_PRERELEASE}}
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.zip
+260
View File
@@ -0,0 +1,260 @@
##########################
#
# Linux
# Ubuntu 22.04
#
# Using this version instead of 24.04 to use a lower GLIBC version (2.34).
# ARM is used for more efficiency, and x64 is used for legacy architectures like PowerPC.
##########################
name: "Linux Builds"
on:
workflow_call:
inputs:
environment:
required: true
type: string
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
jobs:
build:
strategy:
matrix:
architecture: [
{name: 'amd64', os: "ubuntu-22.04-arm", package: 'x86-64-linux-gnu', triple: 'x86_64-linux-gnu', arch_option: 'linux-x86_64'},
{name: 'i686', os: "ubuntu-22.04-arm", package: 'i686-linux-gnu', triple: 'i686-linux-gnu', arch_option: 'linux-x86'},
{name: 'arm64', os: "ubuntu-22.04-arm", package: 'aarch64-linux-gnu', triple: 'aarch64-linux-gnu', arch_option: 'linux-aarch64'},
{name: 'armhf', os: "ubuntu-22.04-arm", package: 'arm-linux-gnueabihf', triple: 'arm-linux-gnueabihf', arch_option: 'linux-armv4'},
{name: 'powerpc', os: "ubuntu-22.04", package: 'powerpc-linux-gnu', triple: 'powerpc-linux-gnu', arch_option: 'linux-ppc'},
{name: 'ppc64', os: "ubuntu-22.04", package: 'powerpc64-linux-gnu', triple: 'powerpc64-linux-gnu', arch_option: 'linux-ppc64'},
{name: 'ppc64el', os: "ubuntu-22.04-arm", package: 'powerpc64le-linux-gnu', triple: 'powerpc64le-linux-gnu', arch_option: 'linux-ppc64le'}
]
name: "Building for platform linux-${{matrix.architecture.name}}"
runs-on: ${{ matrix.architecture.os }}
environment: ${{ inputs.environment }}
env:
wolfssl-version: 'v5.7.6-stable'
curl-version: '8_12_1'
openal-soft-branch: '1.24.3'
sdl2-branch: 'release-2.32.8'
steps:
###
# Packages
###
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Install required packages
with:
packages: flex bison ninja-build cmake clang libpulse-dev portaudio19-dev libasound2-dev libjack-dev libpipewire-0.3-dev qtbase5-dev libdbus-1-dev
version: "${{ runner.os }}-${{ runner.arch }}-v1"
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "HOST_TRIPLE=$(gcc -dumpmachine)" >> $GITHUB_ENV
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Install required cross-platform packages (${{ matrix.architecture.package }})
if: env.HOST_TRIPLE != matrix.architecture.triple
with:
packages: gcc-12-${{ matrix.architecture.package }} g++-12-${{ matrix.architecture.package }}
version: "${{ runner.os }}-${{ runner.arch }}-v1"
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "CFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
echo "CXXFLAGS='--target=${{ matrix.architecture.triple }}'" >> $GITHUB_ENV
###
# SDL
###
# Cache SDL
- name: Cache SDL2
id: cache-sdl2
uses: actions/cache@v4
with:
path: 'thirdparties/SDL2/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-sdl2-${{ env.sdl2-branch }}-v1
# SDL2 setup
- name: Checkout SDL2
if: steps.cache-sdl2.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'libsdl-org/SDL'
path: 'thirdparties/SDL2'
ref: '${{ env.sdl2-branch }}'
- name: Configure and install SDL2
if: steps.cache-sdl2.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/SDL2
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL2/install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# OpenAL
###
- name: Cache OpenAL
id: cache-openal-soft
uses: actions/cache@v4
with:
path: 'thirdparties/soft-oal/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
# soft-oal setup
- name: Checkout soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '${{ env.openal-soft-branch }}'
- name: Configure and install soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build \
-DALSOFT_UTILS=OFF \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# WolfSSL
###
- name: Cache WolfSSL
id: cache-wolfssl
uses: actions/cache@v4
with:
path: 'thirdparties/wolfssl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-wolfssl-${{ env.wolfssl-version }}-v1
# WolfSSL setup
- name: Checkout WolfSSL
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'wolfssl/wolfssl'
path: 'thirdparties/wolfssl'
ref: '${{ env.wolfssl-version }}'
# WolfSSL build
- name: Configure and install wolfssl
if: steps.cache-wolfssl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/wolfssl
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/wolfssl/install' \
-DCMAKE_C_FLAGS="$CFLAGS -fPIC" \
-DCMAKE_CXX_FLAGS="$CFLAGS -fPIC" \
-DBUILD_SHARED_LIBS=OFF -DWOLFSSL_OPENSSLEXTRA=ON -DWOLFSSL_ASM=OFF -DWOLFSSL_EXAMPLES=OFF -DWOLFSSL_CURL=ON
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# cURL
###
- name: Cache cURL
id: cache-curl
uses: actions/cache@v4
with:
path: 'thirdparties/curl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
# cURL setup
- name: Checkout cURL
if: steps.cache-curl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'curl/curl'
path: 'thirdparties/curl'
ref: 'curl-${{ env.curl-version }}'
# cURL build
- name: Configure and install curl
if: steps.cache-curl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/curl
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' \
-DCURL_USE_LIBPSL=OFF \
-DCURL_USE_WOLFSSL=ON \
-DCURL_ZLIB="" \
-DCURL_BROTLI="" \
-DCURL_ZSTD="" \
-DCMAKE_SHARED_LINKER_FLAGS="-lm" \
-DWolfSSL_ROOT='${{github.workspace}}/thirdparties/wolfssl/install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# Project
###
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-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
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Copy libraries
mkdir ${{github.workspace}}/package
cp -l ${{github.workspace}}/thirdparties/SDL2/install/lib/libSDL2-2.0.so.0 '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.so.1 '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/curl/install/lib*/libcurl.so.4 '${{github.workspace}}/package/'
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
###
# Artifacts
###
- uses: actions/upload-artifact@v4
with:
name: out-linux-${{matrix.architecture.name}}
if-no-files-found: error
compression-level: 9
path:
${{github.workspace}}/package
+257
View File
@@ -0,0 +1,257 @@
##########################
#
# Apple macOS
# macOS 15
#
# This version is used as the OS, as it's faster than other versions.
##########################
name: "macOS Builds"
on:
workflow_call:
inputs:
environment:
required: true
type: string
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
jobs:
build:
strategy:
matrix:
architecture: [
#{name: 'x86_64', triple: 'x86_64-apple-macos10.8'},
#{name: 'arm64', triple: 'arm64-apple-macos11'}
#{name: 'x86_64', build_name: 'x86_64'},
#{name: 'arm64', build_name: 'arm64'},
# Compile into an universal binary
{name: 'multiarch-arm64-x86_64', build_name: 'arm64;x86_64' }
]
name: "Building for platform macos-${{matrix.architecture.name}}"
runs-on: "macos-15"
env:
openal-soft-branch: '1.24.3'
wolfssl-version: 'v5.7.6-stable'
curl-version: '8_12_1'
sdl2-branch: 'release-2.32.8'
steps:
###
# Packages
###
- name: Install required packages
run: |
brew install flex bison llvm
# Those packages are already installed
#brew install git ninja cmake perl
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV
###
# SDL
###
# Cache SDL
- name: Cache SDL2
id: cache-sdl2
uses: actions/cache@v4
with:
path: 'thirdparties/SDL2/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-sdl2-${{ env.sdl2-branch }}-v1
# SDL2 setup
- name: Checkout SDL2
if: steps.cache-sdl2.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'libsdl-org/SDL'
path: 'thirdparties/SDL2'
ref: '${{ env.sdl2-branch }}'
- name: Configure and install SDL2
if: steps.cache-sdl2.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/SDL2
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL2/install' \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# OpenAL
###
- name: Cache OpenAL
id: cache-openal-soft
uses: actions/cache@v4
with:
path: 'thirdparties/soft-oal/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
# soft-oal setup
# Use GCC instead of Clang because of missing SSE intrinsics
# It also doesn't enable altivec support on PowerPC by default
- name: Checkout soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '${{ env.openal-soft-branch }}'
# soft-oal build
- name: Configure and install soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
-DCMAKE_VERBOSE_MAKEFILE=on
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# WolfSSL
###
# FIXME: Figure out how to compile WolfSSL cross-architecture
#
# - name: Cache WolfSSL
# id: cache-wolfssl
# uses: actions/cache@v4
# with:
# path: 'thirdparties/wolfssl_install'
# key: ${{ runner.os }}-${{ matrix.architecture.name }}-wolfssl-${{ env.wolfssl-version }}-v1
#
# # WolfSSL setup
# - name: Checkout WolfSSL
# if: steps.cache-wolfssl.outputs.cache-hit != 'true'
# uses: actions/checkout@v4
# with:
# repository: 'wolfssl/wolfssl'
# path: 'thirdparties/wolfssl'
# ref: '${{ env.wolfssl-version }}'
#
# # WolfSSL build
# - name: Configure and install wolfssl
# if: steps.cache-wolfssl.outputs.cache-hit != 'true'
# working-directory: ${{github.workspace}}/thirdparties/wolfssl
# run: |
# cmake -B ./build \
# -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/wolfssl_install' \
# -DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
# -DBUILD_SHARED_LIBS=OFF -DWOLFSSL_OPENSSLEXTRA=ON -DWOLFSSL_ASM=OFF -DWOLFSSL_EXAMPLES=OFF -DWOLFSSL_CURL=ON
# cmake --build ./build --config Release --parallel
# cmake --install ./build --config Release
###
# cURL
###
- name: Cache cURL
id: cache-curl
uses: actions/cache@v4
with:
path: 'thirdparties/curl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
# cURL setup
- name: Checkout cURL
if: steps.cache-curl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'curl/curl'
path: 'thirdparties/curl'
ref: 'curl-${{ env.curl-version }}'
# cURL build
- name: Configure and install curl
if: steps.cache-curl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/curl
run: |
cmake -B ./build \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
-DCURL_USE_LIBPSL=OFF \
-DCURL_USE_WOLFSSL=OFF \
-DCURL_USE_LIBSSH2=OFF \
-DUSE_LIBIDN2=OFF \
-DUSE_NGHTTP2=OFF \
-DCURL_ENABLE_SSL=OFF \
-DCURL_ZLIB="" \
-DCURL_BROTLI="" \
-DCURL_ZSTD="" \
-DWolfSSL_ROOT='${{github.workspace}}/thirdparties/wolfssl_install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# Project
###
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DCMAKE_VERBOSE_MAKEFILE=on \
-DCMAKE_OSX_ARCHITECTURES='${{ matrix.architecture.build_name }}' \
-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
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Create hard-link and copy symbolic links
mkdir ${{github.workspace}}/package
cp -l ${{github.workspace}}/thirdparties/SDL2/install/lib/libSDL2-2.0.0.dylib '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/soft-oal/install/lib/libopenal.1.dylib '${{github.workspace}}/package/'
cp -l ${{github.workspace}}/thirdparties/curl/install/lib*/libcurl.4.dylib '${{github.workspace}}/package/'
if [ -d ${{github.workspace}}/install/bin ]; then cp -r ${{github.workspace}}/install/bin/openmohaa/. '${{github.workspace}}/package'; fi
if [ -d ${{github.workspace}}/install/lib ]; then cp -r ${{github.workspace}}/install/lib/openmohaa/. '${{github.workspace}}/package'; fi
###
# Artifacts
###
- uses: actions/upload-artifact@v4
with:
name: out-macos-${{matrix.architecture.name}}
if-no-files-found: error
compression-level: 9
path:
${{github.workspace}}/package
+294
View File
@@ -0,0 +1,294 @@
##########################
#
# Microsoft Windows
# Windows Server 2025
#
##########################
name: "Windows Builds"
on:
workflow_call:
inputs:
environment:
required: true
type: string
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
jobs:
build:
strategy:
matrix:
architecture: [
{name: 'x64', os: 'windows-2025', config: 'x64', toolset: 'x64', arch_option: 'VC-WIN64A' },
{name: 'x86', os: 'windows-2025', config: 'Win32', toolset: 'x64_x86', arch_option: 'VC-WIN32' },
{name: 'arm64', os: 'windows-11-arm', config: 'ARM64', toolset: 'x64_arm64', arch_option: 'VC-WIN64-ARM' }
]
name: "Building for platform windows-${{matrix.architecture.name}}"
runs-on: ${{ matrix.architecture.os }}
environment: ${{ inputs.environment }}
env:
flexbison-branch: 'v2.5.25'
wolfssl-version: 'v5.7.6-stable'
curl-version: '8_12_1'
openal-soft-branch: '1.24.3'
sdl2-branch: 'release-2.32.8'
steps:
###
# Packages
###
- name: Cache Flex/Bison
id: cache-flexbison
uses: actions/cache@v4
with:
path: 'thirdparties/winflexbison-install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-flexbison-${{ env.flexbison-branch }}-v2
- name: Install Flex/Bison
if: steps.cache-flexbison.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}
run: |
mkdir thirdparties && cd thirdparties
git clone --depth 1 --single-branch --branch ${{ env.flexbison-branch }} https://github.com/lexxmark/winflexbison.git
cmake -B winflexbison-build -DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/winflexbison-install' -DCMAKE_POLICY_VERSION_MINIMUM="3.5" ./winflexbison
cmake --build winflexbison-build --config Release --parallel
cmake --install winflexbison-build --config Release
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $env:GITHUB_ENV
echo "CC=cl.exe" >> $env:GITHUB_ENV
echo "CXX=cl.exe" >> $env:GITHUB_ENV
pushd "$($env:PROGRAMFILES)\Microsoft Visual Studio\*\*\VC\Auxiliary\Build"
cmd /c "vcvarsall.bat ${{ matrix.architecture.toolset }} & set" | ForEach-Object {
if ($_ -match "=") {
# Split into key=value
$var = $_.split("=", 2);
echo "$($var[0])=$($var[1])" >> $env:GITHUB_ENV
}
}
popd
- name: Cache Required Packages
id: cache-required-packages
uses: actions/cache@v4
with:
path: 'C:\Packages'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-required-packages-v1
- name: Install required packages
if: steps.cache-required-packages.outputs.cache-hit != 'true'
run: |
$DownloadPath="$($env:USERPROFILE)\Downloads"
if ("${{ matrix.architecture.config }}" -ieq "ARM64") {
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-winarm64.zip" -OutFile "$DownloadPath\ninja-win.zip"
} else {
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$DownloadPath\ninja-win.zip"
}
Expand-Archive -Path "$DownloadPath\ninja-win.zip" -DestinationPath "C:\Packages\ninja"
Invoke-WebRequest "https://download.qt.io/official_releases/jom/jom.zip" -OutFile "$DownloadPath\jom.zip"
Expand-Archive -Path "$DownloadPath\jom.zip" -DestinationPath "C:\Packages\jom"
- name: Setup required packages path
run: |
$env:PATH += ";C:\Packages\ninja;C:\Packages\jom;"
echo "PATH=$($env:PATH)" >> $env:GITHUB_ENV
if ("${{ matrix.architecture.config }}" -ieq "ARM64") {
# Workaround against linking errors related to interlocked functions
echo "CFLAGS=/forceInterlockedFunctions-" >> $env:GITHUB_ENV
}
###
# SDL
###
# Cache SDL
- name: Cache SDL2
id: cache-sdl2
uses: actions/cache@v4
with:
path: 'thirdparties/SDL2/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-sdl2-${{ env.sdl2-branch }}-v1
# SDL2 setup
- name: Checkout SDL2
if: steps.cache-sdl2.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'libsdl-org/SDL'
path: 'thirdparties/SDL2'
ref: '${{ env.sdl2-branch }}'
- name: Configure and install SDL2
if: steps.cache-sdl2.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/SDL2
run: |
cmake -B ./build `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/SDL2/install'
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# OpenAL
###
- name: Cache OpenAL
id: cache-openal-soft
uses: actions/cache@v4
with:
path: 'thirdparties/soft-oal/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-openal-soft-${{ env.openal-soft-branch }}-v1
# soft-oal setup
- name: Checkout soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'kcat/openal-soft'
path: 'thirdparties/soft-oal'
ref: '${{ env.openal-soft-branch }}'
# soft-oal build
# Statically link the CRT runtime into OAL as a workaround to prevent crashes
- name: Configure and install soft-oal
if: steps.cache-openal-soft.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/soft-oal
run: |
cmake -B ./build `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/soft-oal/install' `
-DALSOFT_BUILD_ROUTER=OFF `
-DALSOFT_REQUIRE_WINMM=ON `
-DALSOFT_REQUIRE_DSOUND=ON `
-DALSOFT_REQUIRE_WASAPI=ON `
-DCMAKE_C_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_C_FLAGS_MINSIZEREL="/MT /O2 /Ob2 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_MINSIZEREL="/MT /O1 /Ob1 /DNDEBUG" `
-DCMAKE_C_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /Zi /O2 /Ob1 /DNDEBUG"
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
# Unfortunately soft-oal produces a binary called OpenAL32 even in 64-bit
if (("x64", "ARM64") -icontains "${{ matrix.architecture.config }}") { Rename-Item -Path '.\install\bin\OpenAL32.dll' -NewName 'OpenAL64.dll' }
###
# cURL
#
# Uses Schannel as SSL backend, native CAs are used
###
- name: Cache cURL
id: cache-curl
uses: actions/cache@v4
with:
path: 'thirdparties/curl/install'
key: ${{ runner.os }}-${{ matrix.architecture.name }}-curl-${{ env.curl-version }}-v1
# cURL setup
- name: Checkout cURL
if: steps.cache-curl.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'curl/curl'
path: 'thirdparties/curl'
ref: 'curl-${{ env.curl-version }}'
# cURL build
- name: Configure and install curl
if: steps.cache-curl.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/thirdparties/curl
run: |
cmake -B ./build `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/thirdparties/curl/install' `
-DCURL_USE_LIBPSL=OFF `
-DCURL_USE_SCHANNEL=ON
cmake --build ./build --config Release --parallel
cmake --install ./build --config Release
###
# Project
###
- uses: actions/checkout@v4
with:
path: 'source'
- name: CMake Settings
run: |
echo "CMAKE_PARAM= `
--log-level=VERBOSE `
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' `
-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/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
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Install
working-directory: ${{github.workspace}}
# Install to the directory defined in CMAKE_INSTALL_PREFIX
run: |
cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
New-Item -ItemType Directory '${{github.workspace}}/package'
Copy-Item '${{github.workspace}}/thirdparties/SDL2/install/bin/*.dll' -Destination '${{github.workspace}}/package'
Copy-Item '${{github.workspace}}/thirdparties/soft-oal/install/bin/*.dll' -Destination '${{github.workspace}}/package'
Copy-Item '${{github.workspace}}/thirdparties/curl/install/bin/*.dll' -Destination '${{github.workspace}}/package'
if (Test-Path ${{github.workspace}}/install/bin) { Copy-Item '${{github.workspace}}/install/bin/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
if (Test-Path ${{github.workspace}}/install/lib) { Copy-Item '${{github.workspace}}/install/lib/*' -Include '*.dll','*.exe','*.pdb' -Destination '${{github.workspace}}/package' }
- name: Generate setup files
working-directory: ${{github.workspace}}
run: |
Copy-Item -Path '${{github.workspace}}/package' -Destination 'source/misc/setup/windows/app/files' -Recurse
dotnet build -p Platform=${{matrix.architecture.config}} -c Release -o out source/misc/setup/windows/app
###
# Artifact
###
- uses: actions/upload-artifact@v4
with:
name: out-windows-${{matrix.architecture.name}}
if-no-files-found: error
compression-level: 9
path: |
${{github.workspace}}/package
!${{github.workspace}}/package/**/*.pdb
- uses: actions/upload-artifact@v4
with:
name: out-windows-${{matrix.architecture.name}}-pdb
if-no-files-found: error
compression-level: 9
path: |
${{github.workspace}}/package
- uses: actions/upload-artifact@v4
with:
name: out-windows-${{matrix.architecture.name}}-installer
if-no-files-found: error
path: |
${{github.workspace}}/out/en-us/Setup.msi
${{github.workspace}}/out/en-us/Setup.wixpdb
+24
View File
@@ -0,0 +1,24 @@
name: Shared build workflow
on:
workflow_call:
inputs:
environment:
required: true
type: string
jobs:
build-platform-linux:
uses: ./.github/workflows/shared-build-linux.yml
with:
environment: ${{inputs.environment}}
build-platform-windows:
uses: ./.github/workflows/shared-build-windows.yml
with:
environment: ${{inputs.environment}}
build-platform-macos:
uses: ./.github/workflows/shared-build-macos.yml
with:
environment: ${{inputs.environment}}
+109
View File
@@ -0,0 +1,109 @@
name: "Publish Release"
on:
push:
tags:
- "v*.*.*"
env:
RELEASE_STAGE: ${{ vars.RELEASE_STAGE || 'unstable' }}
RELEASE_IS_PRERELEASE: ${{ vars.RELEASE_IS_PRELEASE }}
permissions:
contents: write
jobs:
build-all:
uses: ./.github/workflows/shared-build.yml
with:
environment: "release"
# Initially create a release with 1 job
# so multiple files can be uploaded at the same time afterwards
create-release:
runs-on: ubuntu-24.04
environment: 'release'
needs: [build-all]
steps:
- name: Release
uses: softprops/action-gh-release@v2.3.2
with:
name: '${{github.ref_name}}-${{env.RELEASE_STAGE}}'
prerelease: ${{env.RELEASE_IS_PRERELEASE}}
deploy-all:
strategy:
matrix:
target_os: [
'linux-amd64',
'linux-i686',
'linux-arm64',
'linux-armhf',
'linux-powerpc',
'linux-ppc64',
'linux-ppc64el',
'windows-x64',
'windows-x64-pdb',
'windows-x86',
'windows-x86-pdb',
'windows-arm64',
'windows-arm64-pdb',
#'macos-x86_64',
#'macos-arm64',
'macos-multiarch-arm64-x86_64',
]
runs-on: ubuntu-24.04
environment: 'release'
needs: [create-release]
env:
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}-${{matrix.target_os}}
steps:
- uses: actions/download-artifact@v4
with:
name: 'out-${{matrix.target_os}}'
path: ${{github.workspace}}/${{matrix.target_os}}
- name: Zip
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
run: zip -9 -r "../${{ env.RELEASE_NAME }}.zip" ./
- name: Release
uses: softprops/action-gh-release@v2.3.2
with:
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.zip
deploy_installer_windows:
strategy:
matrix:
target_os: [
'windows-x64',
'windows-x86',
'windows-arm64',
]
runs-on: ubuntu-24.04
environment: "release"
needs: [create-release]
env:
RELEASE_NAME: ${{ github.event.repository.name }}-${{github.ref_name}}-${{matrix.target_os}}
steps:
- uses: actions/download-artifact@v4
with:
name: 'out-${{matrix.target_os}}-installer'
path: ${{github.workspace}}/${{matrix.target_os}}
- name: Setup
working-directory: '${{github.workspace}}/${{matrix.target_os}}'
run:
cp Setup.msi ../${{ env.RELEASE_NAME }}.msi
- name: Release
uses: softprops/action-gh-release@v2.3.2
with:
files: ${{github.workspace}}/${{ env.RELEASE_NAME }}.msi
+55
View File
@@ -0,0 +1,55 @@
name: "Unit Tests"
on:
push:
branches:
- '**'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Running unit tests"
runs-on: ubuntu-latest
environment: "testing"
steps:
- uses: awalsh128/cache-apt-pkgs-action@latest
name: Install required packages
with:
packages: flex bison ninja-build cmake clang libsdl2-dev libopenal-dev
version: "${{ runner.os }}-${{ runner.arch }}-unittest-v1"
- uses: actions/checkout@v4
with:
path: 'source'
- name: Settings
working-directory: ${{github.workspace}}
run: |
echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "CMAKE_PARAM=--log-level=VERBOSE \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install'" \
-DUSE_RENDERER_DLOPEN=OFF \
-DBUILD_RENDERER_GL2=OFF >> $GITHUB_ENV
- name: Configure CMake
working-directory: ${{github.workspace}}
run: |
cmake -B ./build ${{ env.CMAKE_PARAM }} ./source
- name: Build
working-directory: ${{github.workspace}}
run: |
cmake --build ${{github.workspace}}/build --config Debug --parallel
- name: Test
working-directory: ${{github.workspace}}
run: |
cd "${{github.workspace}}/build"
ctest -C Debug --output-on-failure
+9 -9
View File
@@ -1,7 +1,6 @@
build
mohaa-re
out
Makefile.local
build*
!/misc/android/build.gradle
!/misc/android/app/build.gradle
*.swp
*tags
*~
@@ -17,7 +16,6 @@ Makefile.local
.DS_Store
.LSOverride
Icon?
make-macosx-values.local
# Xcode
####################
@@ -44,8 +42,10 @@ profile
*.sdf
*.opensdf
*.suo
/.vs
.vs
code_unfinished/*
thirdparties/
code/parser/generated/*
out
# Flex and Bison
####################
/code/parser/generated
+934
View File
@@ -0,0 +1,934 @@
# Changelog
For **OpenMoHAA VR** changes, see the [VR release notes](https://github.com/bearstonem/openmohaa-vr/releases)
and [port status](VR_PORT_STATUS.md). Quest is the current release target;
Steam Frame integration is in development.
The changelog below is inherited from upstream OpenMoHAA and records engine
changes. Its release links and version numbers belong to the upstream project.
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
+77 -124
View File
@@ -1,138 +1,91 @@
cmake_minimum_required(VERSION 3.5)
project(openmohaa)
cmake_minimum_required(VERSION 3.25)
include(TargetArch.cmake)
target_architecture(TARGET_ARCH)
if(TARGET_GAME_TYPE)
message(SEND_ERROR "TARGET_GAME_TYPE is now unsupported, it is now done at runtime.")
if(POLICY CMP0177)
# Policy CMP0177: install() DESTINATION paths are normalized
# Introduced in CMake 3.31
cmake_policy(SET CMP0177 NEW)
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(identity)
set(TARGET_BASE_GAME "./")
set(CMAKE_DEBUG_POSTFIX "-dbg")
project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
# Treat no return type as error
add_compile_options(/we4715)
option(BUILD_SERVER "Build dedicated server" ON)
option(BUILD_CLIENT "Build client" ON)
option(BUILD_RENDERER_GL1 "Build GL1 renderer" ON)
# The original fixed function renderer needs a translation layer to reach
# OpenGL ES; see cmake/libraries/gl4es.cmake for why it is worth having.
option(USE_GL4ES "Translate the GL1 renderer's fixed function calls to OpenGL ES" ${ANDROID})
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_OPENXR "OpenXR stereo rendering and tracking" OFF)
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()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wno-comment)
# Treat no return type as error
add_compile_options(-Werror=return-type)
# 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()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# Ignore warnings for code like 'assert("Assert string")'
add_compile_options(-Wno-pointer-bool-conversion)
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 "")
set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/code)
# Enable unit testing
include(CTest)
if(DEFINED ENV{SOURCE_DATE_EPOCH})
string(TIMESTAMP PRODUCT_DATE "%b %d %Y" UTC)
add_compile_definitions(PRODUCT_DATE="${PRODUCT_DATE}")
endif()
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()
include(compilers/all)
include(platforms/all)
include(libraries/all)
include(deploy/all)
if(DEBUG_MEMORY)
add_definitions(-D_DEBUG_MEM)
endif()
include(version)
IF("${TARGET_ARCH}" STREQUAL "i386")
set(TARGET_ARCH_SUFFIX "x86")
ELSE()
set(TARGET_ARCH_SUFFIX ${TARGET_ARCH})
ENDIF()
include(server)
include(renderer_gl1)
include(renderer_gl2)
include(client)
include(basegame)
#include(missionpack)
include(launcher)
message(STATUS "Architecture detected: ${TARGET_ARCH}, suffix set to ${TARGET_ARCH_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_definitions(-D_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()
ENDIF()
# 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)
# Gamespy dependency
target_include_directories(omohaaded PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server")
set_target_properties(omohaaded PROPERTIES OUTPUT_NAME "omohaaded${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}")
set_target_properties(omohaaded PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
if (MSVC)
target_link_options(omohaaded PRIVATE "/MANIFEST:NO")
INSTALL(FILES $<TARGET_PDB_FILE:omohaaded> DESTINATION "./" OPTIONAL)
endif()
INSTALL(TARGETS omohaaded DESTINATION "./")
if (NOT BUILD_NO_CLIENT)
## Client app
add_subdirectory("code/client")
add_subdirectory("code/renderer")
add_subdirectory("code/sdl")
#include("code/renderergl2/glsl/shaders.cmake")
#file(GLOB_RECURSE SOURCES_RENDERER "code/sdl/*.c" "code/renderercommon/*.c" "code/renderergl2/*.c" "code/renderergl2/*.cpp")
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_subs.c")
#list(FILTER SOURCES_RENDERER EXCLUDE REGEX "code/renderergl2/tr_model.c")
add_executable(openmohaa "misc/dummy.c")
target_link_libraries(openmohaa PRIVATE syslib)
target_link_libraries(openmohaa PRIVATE omohserver)
target_link_libraries(openmohaa PRIVATE omohclient)
target_link_libraries(openmohaa PRIVATE omohrenderer omohsdl)
target_link_libraries(openmohaa PRIVATE qcommon qcommon_standalone)
### Gamespy dependency
target_include_directories(openmohaa PUBLIC "code/qcommon" "code/script" "code/gamespy" "code/server" "code/client" "code/uilib" "code/jpeg-8c")
set_target_properties(openmohaa PROPERTIES OUTPUT_NAME "openmohaa${TARGET_BASE_SUFFIX}${TARGET_ARCH_SUFFIX}")
set_target_properties(openmohaa PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
target_link_libraries(openmohaa PRIVATE jpeg8)
if (MSVC)
target_link_options(openmohaa PRIVATE "/MANIFEST:NO")
INSTALL(FILES $<TARGET_PDB_FILE:openmohaa> DESTINATION "./" OPTIONAL)
endif()
INSTALL(TARGETS openmohaa DESTINATION "./")
endif()
include(post_configure)
#include(installer)
+179
View File
@@ -0,0 +1,179 @@
# Contributing to OpenMoHAA VR
OpenMoHAA VR is an independent VR port of [OpenMoHAA](https://github.com/openmoh/openmohaa), with standalone Meta Quest releases and Steam Frame as a development target. There is no Steam Frame binary yet. These guidelines apply to [bearstonem/openmohaa-vr](https://github.com/bearstonem/openmohaa-vr); upstream maintains its own contribution policies and release process.
Start with the [port status](VR_PORT_STATUS.md), [repository layout](LAYOUT.md), and [renderer handoff](VR_RENDERER_HANDOFF.md). The status document separates device-tested behavior from changes that still need headset validation.
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).
- VR rendering, tracking, controller interaction, and HUD improvements.
- Performance improvements backed by measurements.
- Headset testing and reproducible regression reports.
- Documentation and build improvements.
- Steam Frame development and testing, with support claims kept explicit.
- Helping users and proposing enhancements through this repository's issues.
Discuss major features or architecture changes in a [port issue](https://github.com/bearstonem/openmohaa-vr/issues) before investing in a large implementation. Focused fixes, tests, and documentation improvements can be submitted directly.
---
## Issues
Before opening a new issue:
1. Check the [port releases](https://github.com/bearstonem/openmohaa-vr/releases) and [known issues](VR_PORT_STATUS.md). Upstream desktop releases do not include this port's VR changes.
2. Search [existing port issues](https://github.com/bearstonem/openmohaa-vr/issues).
Include the following details to help reproduce and diagnose an issue:
- A clear description and reproducible steps, including the mission/map and game edition.
- Headset model, headset OS/firmware, controllers, and OpenXR runtime/version when known.
- Port release and asset name, or the source commit and build configuration. Include the engine version from the startup log or `version` command as well.
- Relevant VR/render settings, mods, and whether the release's external `autoexec.cfg` was installed.
- Startup and failure logs, including `qconsole.log`, Android logcat, or runtime logs as appropriate. Include a backtrace for crashes.
- For visual or performance issues, whether one or both eyes are affected, and any captures or frame-time measurements.
For Quest logs, begin capture before reproducing the issue: `adb logcat -v threadtime -s openmohaa:V AndroidRuntime:E > openmohaa-vr.log`. See the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) for the full checklist.
Report port problems here first. If a problem also reproduces in upstream OpenMoHAA, provide that evidence and follow upstream's policies when reporting or contributing there.
## Tools and contribution responsibility
AI-assisted contributions are welcome in this fork. Contributors remain responsible for reviewing, understanding, and validating every submitted change, including generated code and documentation. Explain the problem, the resulting behavior, and the checks performed; distinguish source review, automated tests, and actual headset testing.
Keep changes focused and reviewable. Preserve license headers, copyright notices, and authorship attribution, and identify the source and license of imported code or assets. Do not submit proprietary game data. Tool use does not change these responsibilities.
This policy applies only to OpenMoHAA VR. It does not override upstream OpenMoHAA's independently maintained policies or authorize sending AI-assisted work upstream.
## Coding
### Compatibility
Preserve the engine's compatibility with the original game while adapting presentation and input for VR:
- 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.
- Preserve single-player campaign behavior; report which missions and expansions were actually tested.
- Keep desktop and dedicated-server builds working when changing shared code.
- Do not change existing package IDs, config/save paths, network identifiers, or binary/module names solely for display branding.
### 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.
- Build the affected targets and run relevant checks. State when a target or headset was unavailable.
- Follow the surrounding naming conventions, including engine subsystem prefixes such as `CG_`, `CL_`, `R_`, and `VR_`.
- Format changed code using the repository's `clang-format` configuration; avoid unrelated whole-file formatting.
- 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** in this port's issue tracker.
2. **Create a branch** based on this repository's current default branch, rather than upstream's `main`.
3. **Keep PRs as small as possible and focused**: One clear purpose per PR.
### Submitting a PR
- Target this repository's current default branch, unless a maintainer requests a different integration branch.
- 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.
- For VR changes, list the headset/runtime, build, and scenarios tested. A successful build alone does not establish device support or a performance improvement.
### Reviews
- Maintainers may ask for tweaks or commit changes directly to your PR, that's normal.
- Stay polite and technical.
- Maintainers decide whether and when a change is ready to merge.
### Additional Notes
- Contributions follow the same license as the project.
- Keep things consistent with existing code and docs.
- Use the [OpenMoHAA VR issue tracker](https://github.com/bearstonem/openmohaa-vr/issues) for port questions and proposals.
+36 -23
View File
@@ -1,24 +1,37 @@
# File layout
# OpenMoHAA VR repository layout
| Path | Description |
| ---------------------|-------------------------------------------------------------------
| code/ | OpenMoHAA source code |
| code/cgame | Client game code |
| code/client | Client (network stuff, snapshots, etc) |
| code/game | Server game code (game logic stuff, etc) |
| code/gamespy | Gamespy SDK |
| code/null | Null redirector (used by the OpenMoHAA Dedicated Server) |
| code/parser | Flex/Bison parser |
| code/qcommon | Global shared stuff such as maths |
| code/renderer | OpenMoHAA renderer |
| code/sdl(12) | SDL code |
| code/script | Script engine |
| code/server | Server code (network, snapshots, handling clients etc) |
| code/skeletor | Skeleton model engine |
| code/sys | Main application system |
| code/tiki | Complete TIKI engine |
| code/uilib | UI library (Ubertools stuff) |
| code/{win32,unix} | Platform-specific code |
| docker | Docker files, for compiling on various linux versions |
| docs | Documentation stuff |
| misc/ | Project stuff, definition files and various resources stuff. |
This fork contains the OpenMoHAA engine and its VR port. Meta Quest is the current standalone release target; Steam Frame is a development target with no binary available yet. Existing engine names, package IDs, and data paths remain in place for compatibility.
Start with [VR_PORT_STATUS.md](VR_PORT_STATUS.md) for current support and known issues. The older plan and renderer handoff record design decisions and historical measurements; they are not release support claims.
| Path | Description |
| --- | --- |
| [VR_PORT_STATUS.md](VR_PORT_STATUS.md) | Port status, tested behavior, known issues, and build/deployment notes. |
| [VR_PORT_PLAN.md](VR_PORT_PLAN.md) | Original Quest port survey and implementation plan. |
| [VR_RENDERER_HANDOFF.md](VR_RENDERER_HANDOFF.md) | Renderer migration and gl4es integration history. |
| [QUEST_PORTING_GUIDE.md](QUEST_PORTING_GUIDE.md) | Lessons and reference workflows from the Quest port. |
| `code/vr/` | OpenXR session, frame submission, tracking, and controller input; `vr_common.h` exposes the engine-facing API. |
| `code/cgame/` | Client game presentation, view models, and the grouped VR HUD in `cg_vrhud.cpp`. |
| `code/client/` | Client networking, snapshots, UI integration, and VR frame routing. |
| `code/fgame/` | Server game logic, including gameplay interactions used by the VR port. |
| `code/renderergl1/` | Fixed-function renderer and VR view composition; the default Android renderer uses gl4es. |
| `code/renderergl2/` | Shader-based renderer and its VR integration. |
| `code/renderercommon/` | Shared renderer interfaces, image handling, and related utilities. |
| `code/qcommon/` | Shared engine code, math, filesystem, and configuration handling. |
| `code/corepp/` | Shared C++ infrastructure. |
| `code/server/` | Server networking, snapshots, and client handling. |
| `code/null/` | Platform stubs used by dedicated-server builds. |
| `code/sdl/` | SDL input and platform integration. |
| `code/sys/` | Platform system code, including Android support under `code/sys/new/`. |
| `code/uilib/` | Widget and UI library. |
| `code/script/`, `code/parser/` | Script engine and Flex/Bison parser. |
| `code/skeletor/`, `code/tiki/` | Skeletal models, animation, and the TIKI model system. |
| `code/botlib/`, `code/gamespy/` | Bot support and inherited GameSpy SDK integration. |
| `code/thirdparty/` | Bundled third-party dependencies and their notices. |
| `misc/android/` | Gradle project, Android manifest/resources, and the external `autoexec.cfg` supplied with Quest releases. |
| `misc/linux/`, `misc/macos/`, `misc/windows/` | Desktop packaging and platform resources. |
| `cmake/`, `CMakeLists.txt` | Native build configuration and dependency integration. |
| `.github/` | Build/release workflows and issue templates for this repository. |
| `docs/` | Engine documentation and Android/VR integration notes. |
Use [CONTRIBUTING.md](CONTRIBUTING.md) for development conventions and report port issues in [bearstonem/openmohaa-vr](https://github.com/bearstonem/openmohaa-vr/issues).
File diff suppressed because it is too large. Load diff
+82 -90
View File
@@ -1,101 +1,93 @@
# OpenMoHAA
# OpenMoHAA VR
![Build](https://github.com/openmoh/openmohaa/actions/workflows/build-cmake.yml/badge.svg?branch=main) [![Release](https://img.shields.io/github/v/release/openmoh/openmohaa)](https://github.com/openmoh/openmohaa/releases) [![Downloads](https://img.shields.io/github/downloads/openmoh/openmohaa/total)](https://github.com/openmoh/openmohaa/releases)
**A standalone VR port of Medal of Honor: Allied Assault targeting Meta Quest and Steam Frame.**
![License](https://img.shields.io/github/license/openmoh/openmohaa) ![Commits](https://img.shields.io/github/commit-activity/t/openmoh/openmohaa)
[![Quest prerelease](https://img.shields.io/github/v/release/bearstonem/openmohaa-vr?include_prereleases&label=Quest%20prerelease)](https://github.com/bearstonem/openmohaa-vr/releases)
[![Downloads](https://img.shields.io/github/downloads/bearstonem/openmohaa-vr/total)](https://github.com/bearstonem/openmohaa-vr/releases)
[![License](https://img.shields.io/badge/license-GPL--2.0--or--later-blue)](COPYING.txt)
![Discord](https://img.shields.io/discord/596049712579215361?logo=discord&logoColor=white&color=5865F2)
OpenMoHAA VR brings the original game into room-scale VR: head tracking, controller-aimed weapons, tracked hands, physical interactions, and menus and HUD adapted for a headset. The game runs on the headset itself. A PC is needed for the documented sideloading workflow, not for streaming gameplay.
This is the VR development fork of [OpenMoHAA](https://github.com/openmoh/openmohaa). You must supply your own original game data; no Medal of Honor game assets are included.
```
/ _ \ _ __ ___ _ __ | \/ |/ _ \| | | | / \ / \
| | | | '_ \ / _ \ '_ \| |\/| | | | | |_| | / _ \ / _ \
| |_| | |_) | __/ | | | | | | |_| | _ |/ ___ \ / ___ \
\___/| .__/ \___|_| |_|_| |_|\___/|_| |_/_/ \_\/_/ \_\
|_|
## Platforms and current status
| Target | Status |
| --- | --- |
| **Meta Quest** | Standalone Android/OpenXR prerelease available. Quest 3 is the headset tested so far; other Quest models are unverified. |
| **Steam Frame** | Standalone VR development target. Platform integration and device validation are still pending; there is no Steam Frame release yet. |
The current VR backend uses Android, EGL, and OpenGL ES. The inherited desktop engine build is useful for development, but it does not establish Steam Frame VR support.
**This is a port in progress.** The latest code review passed desktop and Android builds and targeted regression checks. Its visual changes and performance impact have not yet been measured in a headset. Upstream campaign, expansion, mod, and multiplayer compatibility should not be read as a claim that each has been validated in this VR port.
## Download and install on Quest
Get the APK, `autoexec.cfg`, and `SHA256SUMS` from the [VR releases page](https://github.com/bearstonem/openmohaa-vr/releases). The current release is [0.2.0](https://github.com/bearstonem/openmohaa-vr/releases/tag/vr-quest3-0.2.0).
1. Install the APK:
```sh
adb install -r openmohaa-vr-quest3-0.2.0.apk
adb shell am force-stop org.openmoh.openmohaa
```
2. On a fresh installation, launch once from inside the headset to initialize the app's files directory, then close it. Supply the retail game's `main/` data under `/sdcard/Android/data/org.openmoh.openmohaa/files/main/`. See the [Quest build and installation guide](docs/markdown/04-coding/03-android.md) for the data-copy steps.
3. Copy the release configuration:
```sh
adb push autoexec.cfg /sdcard/Android/data/org.openmoh.openmohaa/files/main/autoexec.cfg
adb shell am force-stop org.openmoh.openmohaa
```
4. Launch the game from inside the headset, under Unknown Sources. Release 0.2.0 appears as **OpenMoHAA**; subsequent source builds use **OpenMoHAA VR**. Do not start it with `adb shell am start`.
**When upgrading, update the configuration too.** Reinstalling the APK keeps the old `autoexec.cfg`; back up personal changes before replacing it. The supplied configuration starts at the normal menu, disables the development cheats and test map, and includes the current lighting workaround. Let the app create its own `main/save` and `main/configs` directories.
The APK is debug-signed with optimized Release native libraries. Version 0.2.0 uses the same signing certificate as 0.1.0 for upgrades. Verify downloaded assets with `sha256sum -c SHA256SUMS`.
## VR features
- Stereo OpenXR rendering and 6DoF head tracking.
- Controller-aimed weapons, tracked hands, stick locomotion, and snap turning.
- Body holsters, grip-driven ladder climbing, and physical grenade throws.
- Menus and mission/death screens displayed on a panel in the room.
- An on-demand HUD on the off-hand **X** button: compass, objectives, health, and ammo.
- Controller-based use interaction and a weapon-selection wheel.
These systems are implemented; controller interactions, weapon alignment, and individual missions still need broader device testing.
## Known issues
- Some fonts can render as black boxes because of an unresolved font-atlas texture issue.
- Dynamic lights can darken the scenery. The supplied `autoexec.cfg` keeps `r_worldDlights 0`; the APK's defaults alone do not apply that workaround.
- Per-weapon grip alignment and remaining foliage behavior need further work.
- Fresh headset performance measurements are pending. Earlier Quest 3 measurements are historical, not benchmarks of the latest release.
- Steam Frame integration and validation remain to be done.
See [port status](VR_PORT_STATUS.md) for implementation details and the historical Quest measurements.
## Development
The active development branch is `vr-quest3`; the project targets both Quest and Steam Frame.
```sh
git clone --branch vr-quest3 https://github.com/bearstonem/openmohaa-vr.git
cd openmohaa-vr
```
## Intro
- [Quest / Android build and installation](docs/markdown/04-coding/03-android.md)
- [Documentation index](docs/README.md)
- [Source layout](LAYOUT.md)
- [Contributing](CONTRIBUTING.md)
- [Port status](VR_PORT_STATUS.md), [original Quest plan](VR_PORT_PLAN.md), and [renderer notes](VR_RENDERER_HANDOFF.md)
- [Reusable Quest porting guide](QUEST_PORTING_GUIDE.md)
- [Desktop engine build reference](docs/markdown/04-coding/01-compiling.md)
The main goal of OpenMoHAA is to ensure the future and continuity of **Medal of Honor: Allied Assault**. It has always been a dream in the community to provide patches and security fixes for the game. Thanks to the ioquake3 project, F.A.K.K SDK and other quality tools, OpenMoHAA has already reached more than half of its goal: to create an open-source version of MoH:AA (based on version 2.40) that is fully compatible with the original game (in terms of protocol, assets, and scripts).
## Feedback and credits
## Getting started
Report port bugs in [this repository's issue tracker](https://github.com/bearstonem/openmohaa-vr/issues). Include your headset, release or commit, map, steps to reproduce, and relevant logs. Steam Frame development reports should include the runtime and build configuration.
- [Installing OpenMoHAA](docs/getting_started_installation.md)
- [Running OpenMoHAA and using expansion assets](docs/getting_started_running.md)
Built on the work of the [OpenMoHAA project](https://github.com/openmoh/openmohaa), [ioquake3](https://github.com/ioquake/ioq3), and the F.A.K.K SDK. [Team Beef's RTCWQuest](https://github.com/DrBeef/RTCWQuest) is the reference for much of the VR integration. The original engine documentation, assets, and attribution remain in the tree.
## Current state
### Single-player
The entire single-player campaign can be played from start to end. There may be occasional bugs though; if you encounter any, please create a new [GitHub issue](https://github.com/openmoh/openmohaa/issues) describing them.
### Multiplayer
The Multiplayer part is almost fully stable.
Server admins can use OpenMoHAA to [host](docs/getting_started_installation.md#server) a mohaa/mohaas/mohaab server. Bugs must be reported by creating a new [issue](https://github.com/openmoh/openmohaa/issues) on the OpenMoHAA GitHub project. Players can use OpenMoHAA to [play](docs/getting_started_installation.md#client) on a mohaa/mohaas/mohaab server.
All game modes including `Tug-of-War` from Medal of Honor: Spearhead, and `Liberation` from Medal of Honor: Breakthrough are implemented and are working as intended. Mods like `Freeze-Tag` are working as well.
## Features
- [What's working](docs/features_implementation.md)
- [New features](docs/features.md)
- [Scripting commands](https://htmlpreview.github.io/?https://github.com/openmoh/openmohaa/blob/main/docs/features_g_allclasses.html)
## Compiling
- See [Compiling OpenMoHAA](docs/compiling.md)
## Screenshots
| | |
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| ![](docs/images/v0.60.0-x86_64/mohdm1_1.png) | ![](docs/images/v0.60.0-x86_64/training_1.png) |
| ![](docs/images/v0.60.0-x86_64/flughafen_1.png) | ![](docs/images/v0.60.0-x86_64/flughafen_2.png) |
| ![](docs/images/v0.60.0-x86_64/mohdm2_1.png "Playing Freeze-Tag mode with bots") | ![](docs/images/v0.60.0-x86_64/training_3.png "Single-Player training") |
*More screenshots [here](docs/images)*
## Third party
### SDL
http://www.libsdl.org/
### OpenAL
https://www.openal.org/
### LibMAD
http://www.underbit.com/products/mad/
### cURL
https://curl.se/
### Libogg
https://github.com/gcp/libogg
### Libvorbis
https://xiph.org/vorbis/
### Libopus
https://opus-codec.org/
## Communities
### URLs
- https://github.com/openmoh/openmohaa/
- https://mohaaaa.co.uk/AAAAMOHAA/index.php
- https://x-null.net/
### Discord
[![Discord Banner 1](https://discordapp.com/api/guilds/596049712579215361/widget.png?style=banner2)](https://discord.gg/NYtH58R)
Engine source is licensed under [GPL-2.0-or-later](COPYING.txt). Medal of Honor game data is separately owned and is not distributed here. This is an independent community port, not an official Electronic Arts, Meta, or Valve release.
-154
View File
@@ -1,154 +0,0 @@
set(archdetect_c_code "
#if defined(__i386) || defined(__i386__) || defined(_M_IX86)
# error cmake_ARCH x86
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
# error cmake_ARCH x86_64
#elif defined(__PPC64__) || defined(__ppc64__) || defined(__powerpc64__) || defined(_ARCH_PPC64)
# if __BIG_ENDIAN__
# error cmake_ARCH ppc64
# else
# error cmake_ARCH ppc64el
# endif
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__)
# error cmake_ARCH ppc
#elif defined __s390__
# error cmake_ARCH s390
#elif defined __s390x__
# error cmake_ARCH s390x
#elif defined __ia64__
# error cmake_ARCH ia64
#elif defined __e2k__
# error cmake_ARCH e2k
#elif defined __alpha__
# error cmake_ARCH alpha
#elif defined __sparc__
# error cmake_ARCH sparc
#elif defined(__aarch64__) || defined(__ARM64__) || defined(_M_ARM64)
# error cmake_ARCH arm64
#elif defined __arm__ || defined (_M_ARM)
# if defined(__ARM_PCS_VFP) && (__ARM_PCS_VFP)
# error cmake_ARCH armhf
# else
# error cmake_ARCH armel
# endif
#elif defined __cris__
# error cmake_ARCH cris
#elif defined __hppa__
# error cmake_ARCH hppa
#elif defined __mips__
# error cmake_ARCH mips
#elif defined __sh__
# error cmake_ARCH sh
#elif defined __riscv
# if __UINTPTR_MAX__ == __UINT64_MAX__
# error cmake_ARCH riscv64
# else
# error cmake_ARCH riscv
# endif
#else
# error cmake_ARCH unknown
#endif
")
# Set ppc_support to TRUE before including this file or ppc and ppc64
# will be treated as invalid architectures since they are no longer supported by Apple
function(target_architecture output_var)
if((APPLE AND DEFINED CMAKE_OSX_ARCHITECTURES) AND NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
# On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set
# First let's normalize the order of the values
# Note that it's not possible to compile PowerPC applications if you are using
# the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
# disable it by default
# See this page for more information:
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
set(osx_arch_ppc TRUE)
elseif("${osx_arch}" STREQUAL "i386")
set(osx_arch_i386 TRUE)
elseif("${osx_arch}" STREQUAL "x86_64")
set(osx_arch_x86_64 TRUE)
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
set(osx_arch_ppc64 TRUE)
else()
message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}")
endif()
endforeach()
# Now add all the architectures in our normalized order
if(osx_arch_ppc)
list(APPEND ARCH ppc)
endif()
if(osx_arch_i386)
list(APPEND ARCH i386)
endif()
if(osx_arch_x86_64)
list(APPEND ARCH x86_64)
endif()
if(osx_arch_ppc64)
list(APPEND ARCH ppc64)
endif()
else()
# figure out extension for the source file
if(CMAKE_C_COMPILER_LOADED)
set(TA_EXTENSION "c")
elseif(CMAKE_CXX_COMPILER_LOADED)
set(TA_EXTENSION "cpp")
elseif(CMAKE_FORTRAN_COMPILER_LOADED)
set(TA_EXTENSION "F90")
else()
message(FATAL_ERROR "You must enable a C, CXX, or Fortran compiler to use TargetArch.cmake")
endif()
file(WRITE "${CMAKE_BINARY_DIR}/arch.${TA_EXTENSION}" "${archdetect_c_code}")
# Detect the architecture in a rather creative way...
# This compiles a small C program which is a series of ifdefs that selects a
# particular #error preprocessor directive whose message string contains the
# target architecture. The program will always fail to compile (both because
# file is not a valid C program, and obviously because of the presence of the
# #error preprocessor directives... but by exploiting the preprocessor in this
# way, we can detect the correct target architecture even when cross-compiling,
# since the program itself never needs to be run (only the compiler/preprocessor)
if(DEFINED CMAKE_OSX_ARCHITECTURES)
set(TA_CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES})
else()
set(TA_CMAKE_FLAGS "")
endif()
try_run(
run_result_unused
compile_result_unused
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/arch.${TA_EXTENSION}"
COMPILE_OUTPUT_VARIABLE ARCH
CMAKE_FLAGS ${TA_CMAKE_FLAGS}
)
# Parse the architecture name from the compiler output
string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
# Get rid of the value marker leaving just the architecture name
string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
# If we are compiling with an unknown architecture this variable should
# already be set to "unknown" but in the case that it's empty (i.e. due
# to a typo in the code), then set it to unknown
if (NOT ARCH)
set(ARCH unknown)
endif()
endif()
set(${output_var} "${ARCH}" PARENT_SCOPE)
endfunction()
+249
View File
@@ -0,0 +1,249 @@
# OpenMoHAA on Quest 3 — porting plan
Getting Medal of Honor: Allied Assault running natively on a Meta Quest 3 in
VR, by way of an Android port first.
Written after surveying the tree at `a2f34019`, and carrying the lessons from
a completed Quest 3 VR port of Homeworld (1999) — the mistakes noted at the
end are ones already made once and worth not repeating.
---
## 1. What we are starting from
| | |
|---|---|
| Lineage | ioquake3-derived (`renderergl1`/`renderergl2`, `qcommon`, `botlib`, QVM options) |
| Build | CMake ≥ 3.25, modular per-directory `CMakeLists.txt` |
| Platform layer | **SDL2** (`code/sdl/`: glimp, input, sound, gamma, mouse) |
| Renderers | `renderergl1` (fixed function), `renderergl2` (GLSL) |
| Game logic | C++ (`fgame`, `cgame`, `uilib`, `skeletor`, `tiki`) — not Q3-style QVM gameplay |
| Android support | **none whatsoever** |
| Game data | Retail MOH:AA required (GOG recommended); a demo exists |
### The finding that shapes everything
**`renderergl2` already speaks OpenGL ES.** This is inherited from upstream
ioquake3 and is in far better shape than expected:
- `qglesMajorVersion` / `qglesMinorVersion` are real runtime variables
(`code/renderercommon/qgl.h`), with a `QGLES_VERSION_ATLEAST` macro
- `tr_glsl.c` emits `#version 300 es` when ES 3 is present, `#version 100`
for ES 2, and injects `precision mediump float` / `precision mediump
sampler2DShadow`
- `tr_extensions.c` branches on `qglesMajorVersion` when probing extensions
- `sdl_glimp.c` has an **`r_preferOpenGLES` cvar** and will request
`SDL_GL_CONTEXT_PROFILE_ES` contexts
This is the single biggest difference from the Homeworld port, where the
engine only spoke fixed-function GL 1.x and needed **gl4es** (a GL-over-GLES2
translation layer) underneath everything — which then dictated every later
constraint. Here the plan is to drive `renderergl2` at GLES 3 directly, so:
- no translation layer, no gl4es quirks
- real shaders, so normal mapping and post-processing stay on the table
- FBOs are already first class (`tr_fbo.c`), which matters enormously for
stereo rendering — Homeworld's port never got this and it blocked MSAA
**`renderergl1` should be considered out of scope.** It is fixed-function and
would need the same emulation layer we are avoiding. Build only `renderergl2`
(`-DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON`).
---
## 2. Phase 1 — build for Android
Goal: an APK that launches, logs, and reaches the main menu. No VR yet.
1. **Toolchain.** CMake has first-class NDK support via
`android.toolchain.cmake`; unlike Homeworld's hand-written meson cross
file, this is a supported path. Target `arm64-v8a`, `android-29` or later
(Quest 3 is Android 12).
2. **SDL2 for Android.** Build SDL2 for `arm64-v8a` and use the stock
`org.libsdl.app.SDLActivity` to load the engine as `libmain.so`. The
existing `code/sdl/*` should mostly work unchanged — this is the same
arrangement the Homeworld port used successfully.
3. **Prune the dependency surface.** Decide early, since each is a
cross-compile:
- `USE_OPENAL` — Quest wants low-latency audio; OpenAL Soft builds for
Android, but SDL audio may be simpler for a first pass
- `USE_CURL` / `USE_HTTP` — off initially, it is only for downloads
- `USE_CODEC_VORBIS` / `OPUS` / `MAD` — MOH:AA music needs at least one;
check what the retail data actually ships
- `BUILD_SERVER` — off for the client APK
4. **Game modules.** `BUILD_GAME_LIBRARIES` vs `BUILD_GAME_QVMS`. Native
`.so` modules via `dlopen` work on Android, but Android's linker
namespaces are fussy about paths — consider **static linking the game
modules into the main binary** for the first port and revisiting later.
5. **Filesystem.** Point the base path at the app's external files directory
(`SDL_AndroidGetExternalStoragePath()`), and `chdir()` there early —
exactly what the Homeworld port does. The user side-loads `main/pak*.pk3`
into it.
6. **Force the ES path.** Set `r_preferOpenGLES 1` and confirm
`qglesMajorVersion` comes back as 3. This is the moment of truth for the
whole approach and should be validated before anything else is built on
top.
**Exit criteria:** APK boots, logs to `logcat`, reaches the main menu with
retail data side-loaded, renders through `renderergl2` on a GLES 3 context.
---
## 3. Phase 2 — playable flat on the headset
Goal: the game is genuinely playable as a 2D panel app before VR is attempted.
This is deliberately a separate milestone; debugging engine problems is far
easier without a stereo compositor in the way.
- **Input:** Quest Touch controllers appear to SDL as a game controller.
Map to the existing `sdl_input.c` joystick path first; a bespoke mapping
comes later with VR.
- **Performance baseline:** measure frame time with the flat renderer before
stereo triples the cost. Establish what the Quest 3 GPU actually delivers on
a large MOH:AA map — this number decides how ambitious VR can be.
- **Config and saves:** confirm they write to the external files dir, and that
the directory is app-owned (see the ownership trap in §6).
- **Audio:** verify no dropouts; Android audio callbacks are less forgiving
than desktop.
**Exit criteria:** a mission is completable, flat, on the headset, at a stable
frame rate.
---
## 4. Phase 3 — stereo via OpenXR
Goal: the world renders in tracked stereo at 72 fps.
1. **Session and swapchains.** Link the Khronos `openxr_loader` for Android,
create an instance with `XR_KHR_opengl_es_enable`, and drive
`xrWaitFrame` / `xrBeginFrame` / `xrEndFrame` from the engine's frame loop.
2. **Two eye passes into FBOs.** `renderergl2` already renders into
framebuffer objects (`tr_fbo.c`), so each eye can target an OpenXR
swapchain image directly. **This is the piece the Homeworld port never
built**, and its absence there blocked MSAA and forced awkward blits — do
it properly from the start here.
3. **View and projection from OpenXR.** Replace the engine's projection setup
with the per-eye FOV and pose from `xrLocateViews`. In id Tech the camera
comes from `refdef` — feed eye offsets in there rather than hacking the
projection matrix downstream.
4. **Do not render the world three times.** The Homeworld port ended up with a
mono pass plus two eye passes because the 2D UI and camera capture were
entangled with the main view. Design the frame as *exactly two* eye passes
from day one; anything needing a flat image should read from an eye buffer
or render separately.
5. **The 2D UI.** MOH:AA's HUD and menus draw in screen space. Two options,
probably both eventually: render them to a texture and present as an
OpenXR quad layer (crisp, comfortable, good for menus), or project them
into the world (better for the in-game HUD).
**Exit criteria:** stereo world, correct scale and IPD, head tracking with no
mismatch, stable 72 fps, menus readable.
---
## 5. Phase 4 — VR interaction design
This is the largest and least mechanical phase, and it is where an FPS differs
completely from the RTS port. A wrong choice here causes motion sickness
rather than a bug report.
**Locomotion — the central question.**
- Smooth locomotion with comfort options (vignette, snap turn) is the
expected default for a shooter, but MOH:AA's level design assumes a fast,
free-running player
- Teleport is comfortable but destroys the pacing of firefights
- Likely: smooth movement, snap *and* smooth turn as options, adjustable
vignette. Make all of it a cvar so it can be tuned on device.
**Weapon handling.**
- Aim from the controller, not the head — this is non-negotiable for an FPS
- Two-handed hold for rifles is a large fidelity win and a large amount of
work; consider one-handed first
- Iron sights become genuinely physical: the sight has to line up with the eye
- Reloading: gesture vs button. Button first.
**The player body and camera.**
- MOH:AA moves the view for scripted sequences, cutscenes, ladder climbs and
death animations. **Any engine-driven camera motion is a nausea risk in
VR** and every instance needs auditing. This is likely the single largest
source of unpleasant surprises.
- Player height: real standing height vs the engine's fixed viewheight
- Crouch: physical vs button, ideally both
**HUD.**
- Screen-locked HUD elements are uncomfortable in VR
- Ammo and health on the weapon or wrist, as the Homeworld port did with
wrist cards — that worked well and is worth reusing
- Objectives and subtitles on a comfortable head-relative panel
**Exit criteria:** a mission playable end to end, comfortably, by someone who
is not the developer.
---
## 6. Traps carried from the Homeworld Quest port
Hard-won, all of them cost hours:
- **Never `adb shell am start` to launch after deploying.** It intermittently
strands the headset in Meta's loading environment. Install, then launch from
inside the headset.
- **`adb push` cannot create directories inside an app's data folder**, and
`chmod` must come *after* pushing or adb fails with `remote fchown failed`.
- **A directory created by `adb shell mkdir` is mode 2770 owned by `shell`**,
which the app cannot even traverse into — it fails *silently*. `chmod 775`
afterwards. Files pushed by adb are 644 and world-readable, which is why
data files work while directories do not.
- **Verify your logging works before relying on it.** A crash handler that has
been silently displaced reports nothing, and is indistinguishable from a
crash that never happened. Add a startup self-test that exercises the same
path.
- **`tombstoned` may not write backtraces to logcat.** When it does not,
`dumpsys activity exit-info` still reports the signal, and an in-process
handler using `_Unwind_Backtrace` + `dladdr` can report the stack itself —
but it needs a real `sigaltstack`, or a stack overflow silences it.
- **Only one process may hold an OpenXR session.** If the previous run has not
fully exited, the new one falls back to flat mono rendering with no error.
- **The headset must be awake** or the session never reaches
`XR_SESSION_STATE_FOCUSED` and the launch appears to hang.
- **Wireless adb ports change** every time debugging is toggled, and mDNS can
advertise a dead one.
---
## 7. Open questions to settle early
1. **Does `renderergl2` actually initialise on a Quest GLES 3 context?**
Everything above rests on this. Validate in Phase 1 before building more.
2. **What frame budget does a real MOH:AA map leave?** id Tech 3 maps are
light by modern standards, but MOH:AA's are large and the Quest 3 must
render everything twice at 72 fps.
3. **Game modules: static or `dlopen`?** Decide before the build is shaped
around either.
4. **How much engine-driven camera movement is there?** Grep for view
overrides early; it drives the Phase 4 comfort work and may be the deciding
factor in how pleasant this is to play.
5. **Which MOH:AA data edition to target first?** GOG is recommended by the
project and is the easiest for testers to obtain legally.
6. **Licensing.** OpenMoHAA is GPL; no game assets may be redistributed. Same
posture as the Homeworld port: the user supplies their own `pak` files.
---
## 8. Suggested order of work
```
1 Android build of the dedicated server or a headless client (proves the toolchain)
2 Full client APK, GLES 3 context, main menu (proves the renderer)
3 Side-load retail data, reach gameplay, flat (proves the filesystem)
4 Controller input, playable flat (baseline + perf numbers)
5 OpenXR session, one eye, correct pose (proves the XR path)
6 Two eye FBOs, correct IPD and projection (stereo)
7 UI as quad layers (menus usable)
8 Locomotion and weapon handling (VR design begins)
9 Comfort pass, camera audit, HUD (the long tail)
```
Steps 1–3 are mechanical and mostly build engineering. Step 5 onward is where
the interesting decisions live.
+419
View File
@@ -0,0 +1,419 @@
# OpenMoHAA VR — platform status
This repository develops a standalone Medal of Honor: Allied Assault VR port
for **Meta Quest and Steam Frame**. The released build is currently the Android
OpenXR port, tested on Quest 3. Other Quest models are unverified. Steam Frame
is a development target: platform integration and device validation are pending,
and no Steam Frame binary is available yet.
The notes below document the existing Quest implementation and historical device
measurements. They do not establish support or performance on Steam Frame.
Companion to `VR_PORT_PLAN.md`, which is the original survey and plan, and to
`VR_RENDERER_HANDOFF.md`, which covers the move to the fixed function renderer.
This records what has actually been built, what was learned that contradicts the
plan, and what to do next.
Branch `vr-quest3`. The historical status below records previously committed work.
### Quest release 0.2.0 — October 14, 2026
The Android package uses version code 2 and version name `0.83.0-vr0.2.0`.
The supplied `autoexec.cfg` starts at the normal menu, with cheats, automatic
weapon grants, test-map loading, and diagnostic traces disabled. Replace the
external config when upgrading: reinstalling the APK preserves the old one.
Keep `r_worldDlights 0` until the lighting defect is resolved; that workaround
is supplied by the config, not by the APK's defaults. This remains a prerelease,
and the September review changes still need headset validation.
### Code review update — September 29, 2026
These fixes remove the unconditional GPU wait after each eye;
`vr_traceGpu 1` restores that wait only for diagnostics. Normal submission flushes
commands and discards the eye's transient depth/stencil buffers. Swapchain timeouts
now retain the acquired image for retry, and stereo submission requires both eyes.
World/HUD timing now charges the first 2D transition's world flush to the world,
and backend timing accumulates all command batches in an eye.
The review also fixes desktop HUD suppression, objective initialization, HUD
resource resets, health colors, weapon-wheel placement, stereo text lifetimes,
font shader passes, and sprite culling and upright sprite disappearance when
looking vertically. CMake now tracks additions to the client-game source list.
No headset was connected for this review: the measured frame rates and visual
observations below predate these changes. Device validation is still needed.
The existing font-atlas texture issue and dynamic-light darkening remain
unresolved; `r_worldDlights 0` in `autoexec.cfg` remains the lighting workaround.
**On any problem this port is trying to solve, read RTCWQuest first.** It is
cloned at `/home/berkybear/RTCWQuest`, clean at `4c714b9`, and it is finished.
That is a standing instruction, not a suggestion; ignoring it has cost more time
here than any single bug. It is also not always live code — read what is *called*,
not what is present.
The reusable form of everything below is in `QUEST_PORTING_GUIDE.md`, which is
written for the next port rather than this one.
---
## 1. What works
The game runs on a Meta Quest 3 in stereo VR at **90 fps**: 6DoF head tracking,
stick locomotion, snap turning, menus on a panel fixed in the room, the weapon in
the player's hand aimed by the controller, and a hand on each controller. A
mission can be started and played.
| Phase | State |
|---|---|
| **1 — Android build** | Done. APK builds, boots, logs to logcat. |
| **2 — Playable flat** | Skipped deliberately; went straight to VR at the user's direction. |
| **3 — OpenXR stereo** | Done. 90 fps, 4–6 ms per eye in the back end. |
| **4 — VR interaction** | Locomotion, snap turn, menu pointer, controller aim, weapon in hand, hands on both controllers. HUD and per-weapon alignment outstanding. |
Confirmed on the device, in order of when each stopped being a question:
- the world renders — terrain, BSP, models, textures, lightmaps, fog, sky
- 90 fps at 4–6 ms per eye, against rend2's 50–60 (`VR_RENDERER_HANDOFF.md` §2)
- `XR_FB_display_refresh_rate` works; the display runs at 90 Hz
- colour is correct, and therefore darker than it was — see §2
- the start map loads straight into the world without touching a menu
- both controllers track 1:1, with no drift on head rotation and no lag on a
snap turn
- both hands are anchored on their own bones and sit upright at the right size
### Build
renderergl1 on gl4es is the default on Android; renderergl2 is still reachable
with `-DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON -DUSE_GL4ES=OFF`.
```sh
cmake -B build-gl1 -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-29 -DANDROID_STL=c++_shared \
-DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=OFF
cmake --build build-gl1 -j$(nproc)
cd misc/android && gradle assembleDebug -PnativeLibsDir=../../build-gl1/apk-libs
cd ../.. && adb install -r misc/android/app/build/outputs/apk/debug/app-debug.apk
adb push misc/android/autoexec.cfg \
/sdcard/Android/data/org.openmoh.openmohaa/files/main/autoexec.cfg
adb shell am force-stop org.openmoh.openmohaa
```
SDL2, OpenAL Soft, gl4es and the Khronos OpenXR loader are all fetched and built
from source; `-DSDL2_SOURCE_PATH=` and friends point at local trees instead. Full
instructions and the deployment traps are in
`docs/markdown/04-coding/03-android.md`.
**`adb install -r` does not kill the running process**, so force-stop after
installing or the next launch resumes the old build. **Check the APK is newer
than the `.so`** — gradle will report success while packaging the previous
library. **Never `adb shell am start`**; launch from inside the headset.
### Game data
Lives in `/sdcard/Android/data/org.openmoh.openmohaa/files/main/`. Currently
populated from a GOG War Chest install.
**Never create `main/save` or `main/configs` with `adb`.** A directory made by
`adb shell mkdir` belongs to `shell`, and no chmod makes it app-writable — the
app is `other` there. MOH:AA autosaves on mission start and treats the failure
as fatal, so the symptom is a black screen after New Game with
`FS_CreatePath: failed to create path` in the log. Let the engine create them.
### Device configuration
`misc/android/autoexec.cfg`, deployed next to the game data, not in the APK. It
is the only way to set a cvar on a device with no console: exec'd after
`omconfig.cfg`, before `R_Init`, so it beats both the stored config and the
renderer's own defaults. It cannot reach `VR_TuningCvar` cvars, which force their
value at every start.
The test harness in it ships **off**, so the game starts at its own menu. Filling
in `cheats 1`, `vr_testStart "give all"` and `vr_startMap "m4l1"` drops straight
into The Bocage with every weapon, which is how the hands were tuned; the values
and the reasoning for that map are kept in the comments beside them.
Nothing the game needs to be correct is only in this file. It is a tuning and
testing knob — the defaults compiled into the build are the values measured on
device, so an APK installed without it still behaves.
---
## 2. Where the plan was wrong
Worth reading before trusting `VR_PORT_PLAN.md` on these points.
**"Drive `renderergl2` at GLES 3 directly; `renderergl1` is out of scope" — the
opposite happened, and it was the single largest win.** rend2 ran at 10–15 fps
against a 90 Hz display: 50–60 ms of *CPU* per eye in the back end binding GLSL
programs, while the GPU finished in 3 ms. None of what that buys is visible on
art with no normal or specular maps. The port now runs renderergl1 — the plain
Quake 3 forward renderer — on gl4es, at 4–6 ms per eye. The whole of
`VR_RENDERER_HANDOFF.md` is about that swap and the gl4es boundary it dragged in.
**"`renderergl2` already speaks OpenGL ES" — nearly, but it could not start.**
`QGL_1_1_PROCS` carried five entry points that exist in no version of GLES, and
the ES 3.0 context was only requested under `#ifdef __EMSCRIPTEN__`. Both fixed
in `f3ca6230`; both would have broken any GLES target.
**"FBOs are already first class" — they were switched off on GLES**, and are
deliberately left off on Android (`r_ext_framebuffer_object 0`): in VR each eye is
already a swapchain image, so routing through `tr.renderFbo` first costs a second
full-resolution pass and resolve per eye for nothing.
**"SDL audio may be simpler for a first pass" — there is no SDL audio path.**
`snd_local_new.h` hardcodes `#define SOUND_DRIVER OPENAL`, and `USE_OPENAL=OFF`
does not compile. OpenAL Soft is built from source on its OpenSL ES backend.
**"Game modules: static or dlopen?" — static is not an option.** `cgame` and
`fgame` both compile `q_shared`, `q_math` and the script system, so linking them
into one binary collides. They ship as `libgame.so` / `libcgame.so`.
**Quest 3 is Android 14 / API 34**, not 12.
**Do not set the render resolution through cvars.** `r_mode` is `CVAR_LATCH` *and*
registered by the renderer itself, so nothing the client sets beforehand can win.
The renderer asks the client instead, via `refimport_t::GetVRRenderResolution`.
**The world is 52.5 units to the metre, not 32.** MOHAA's art is authored at 16
units per foot — its tik files say so where they convert from centimetres
(`models/weapons/bar.tik`: *"16/30.5 since world is in 16 units per foot"*), and
`MAXS_Z 94` / `DEFAULT_VIEWHEIGHT 82` agree at 1.79 m standing. `vr_worldscale`
was 32 for months, which is the id Tech number for a game built in inches and
simply the wrong engine's. Everything measured in metres was 1.64× too small, and
it presented as *the hand models being too large* rather than as a scale error,
because a correctly sized model drawn too close is the only clue and the world
gives you nothing to compare against.
---
## 3. How the VR layer is put together
`code/vr/vr_openxr.c`, plus `vr_common.h` as the engine-facing API.
**The session binds to SDL's existing EGL context**, made current against a 16×16
pbuffer because SDL unbinds it and reports success when there is no window
surface (`VR_RENDERER_HANDOFF.md` §5.6). One GL context in the process.
**Eyes are rendered by substituting the renderer's idea of the screen.**
`re.SetDefaultFramebuffer` points the renderer at the eye's swapchain image, so
the entire render path lands in the headset without knowing. Exactly two eye
passes per frame; deliberately no third mono pass.
**The session is torn down and rebuilt around renderer restarts**, and
window-resize restarts are declined outright under VR — one of those was
destroying the context five seconds into every run and was the black menu.
**Flat content goes on a quad layer** fixed in the room, drawn into one
persistent buffer and blitted into the swapchain image, because a swapchain
rotates through three images and the 2D path expects last frame's content to
still be there.
**Colour: the swapchains are `GL_SRGB8_ALPHA8` *and* sRGB write conversion is
disabled** via `GL_EXT_sRGB_write_control`. The format alone is half the fix and
looks like the whole of it — ES 3.0 converts on write into an sRGB attachment and
core ES has no switch to stop it, so the engine's already display-referred colour
was encoded a second time. It read as flat lighting. The corrected picture is
considerably darker, and that is correct.
**Orientation travels as axes, never Euler angles**, and position is measured
from where the head was when tracking started with the starting heading
subtracted.
**Head pose is applied in `RE_RenderScene`**, so it follows every camera the game
has — the player's, cutscenes, ladders, death animations.
### Placing things in the world, which is not obvious
`cg.refdef.vieworg` **is not the camera.** `R_VRComposeView` adds the head's play
space offset to it, rotated into the body's frame, after cgame is finished:
```c
bodyAngles = (0, viewYaw - baseYaw, 0);
fd->vieworg += vrView.origin[i] * bodyAxis[i];
```
Anything anchored on `vieworg` alone is displaced by exactly that offset, which
drifts as the head turns and does not survive a snap turn. So both hands are
reported measured from the **tracking origin** — the frame `VR_PoseToView` puts
the eyes in — and composed the same way the renderer composes the camera.
RTCWQuest reaches the same place by the other road: a head-relative offset,
rotated by `viewangles[YAW] - hmdorientation[YAW]` in `convertFromVR`, with its
height replaced by the `-64 + hmdposition[1] * worldScale` rebase. Either works.
**Half of each does not**: a head-relative offset composed as play space leaves
the hand at `vieworg + R*(hand - head)` while the camera is at `vieworg + R*head`,
so the head's motion is counted twice and every hand movement is amplified. That
is written up in `vr_common.h` above both accessors.
### Weapon and hands
**Aim comes from the controller, the camera stays on the head.**
`Weapon::GetMuzzlePosition` takes the controller's pitch and the yaw the hand
leads the head by, added to the view yaw the game already has — the controller's
absolute yaw is meaningless, since the player can snap turn and the play space
has an arbitrary forward. The angles reach `fgame` through `gameImport_t`, which
a dedicated server answers false for.
**The hands are separate surfaces on the first person model** — `triggerhand`,
`lefthand`, `garandhand`, `viewsleeves` on `USarmyplyr.skd` — so a hand per
controller needs no mesh work. The weapon hand's copy drops the left hand surface
and a second copy carries only that. `viewsleeves` is one mesh across both
forearms and cannot be split without re-authoring, so it stays with the weapon
hand.
**Each copy is anchored on a tag, not on the model origin**, by inverting the
composition `Entity::GetTagPositionAndOrientation` uses. The off hand anchors on
`Bip01 L Hand` and the weapon hand on `tag_weapon_right`, since what is held
there is the gun and the controller is its grip. Every candidate is measured and
logged rather than trusted — `tag_weapon_left` was assumed to be an unused slot
at the origin and is a real anchor 23.5 units out.
What is left after the frame and the anchor are right is the wrist bones' own
rotation convention, which is a constant: both hands need a roll of 180 in
`vr_weaponAdjust` / `vr_offHandAdjust`. That is the compiled default for both,
not something the config has to supply — the two hands are mirrored and were
still measured to want the same number, which is why they stay two cvars.
**Two handed hold**: off hand grip with the hands close together points the
weapon along the line between them, roll halved. **Reload** is a tap of the
weapon hand's grip. **Weapon switching** is the dominant thumbstick up and down,
gated on the sideways component and edge triggered.
### Debugging
```
vr_traceTracking 1 raw headset pose, tracking origin, world scale
r_vrTrace 1 the composed camera the renderer actually uses
vr_traceFrame 1 the per frame timing split (on by default; noisy)
vr_captureEye 1 writes the eye buffer to main/vrshotN.tga
```
**Start the logcat capture before handing the headset over.** The buffer is
shared with a shell that prints every five seconds, so a once-only startup line
is gone within a minute or two — that has cost two round trips:
```sh
adb logcat -c && adb logcat -s openmohaa:V > run.log &
```
The crash handler (`code/sys/new/sys_android_new.c`) reports the faulting address
and the `pc`/`lr` via `sigaction` + `SA_SIGINFO` on a private `sigaltstack`.
`_Unwind_Backtrace` cannot walk out of the kernel's signal trampoline, so before
that every crash reported four frames of the handler and nothing else.
---
## 4. Known problems
**A muzzle flash makes the ground darker, so the world's dynamic lighting is
off.** `r_worldDlights 0` in `autoexec.cfg`. Firing multiplies roughly a sixth
of the screen down by about 4× for as long as the trigger is held — the ground
plane, with hard polygon edges. Unsolved after seven wrong theories; every
component of the dynamic lightmap path measures correct end to end, and yet
switching the path off makes the symptom stop. Losing flashes lighting the
scenery is the smaller loss. The measurements, what is ruled out and where to
resume are in `docs/markdown/04-coding/05-dlights.md`.
The lesson worth carrying beyond this bug: **difference the frames first.**
Pulling a capture, extracting every frame and differencing a flash frame against
its neighbour gave the cadence, the 4× ratio and the affected geometry in one
step, after six rounds of reading the renderer had given nothing. Also, never
record video and read the log in the same run — the Quest's recorder floods
logcat and evicts everything.
**It does not hold 90 Hz while moving.** `vr_resolutionScale` is now 1, so the
eyes render at the full 1680×1760, and the frame budget is spent:
| | fps | eye pass |
|---|---|---|
| standing at spawn | 90.0 | 8–9 ms |
| moving in the Bocage | 77–85 | 11–12 ms |
The display period is 11.1 ms, so while moving most frames overshoot it and the
compositor reprojects them. **Kept deliberately** — it plays well, the picture is
much sharper, and the reprojection is not felt. But it is a known trade rather
than headroom, and `vr_resolutionScale` is the first thing to give back if
something later needs the time.
**There is no budget for MSAA.** It is wired up and switched off (`vr_samples 0`)
and it resolves in tile memory on Adreno so it is nearly free on the GPU — but
the GPU is not the constraint, and there is nothing spare on the CPU side. This
stays off until the frame split below is trustworthy.
**The frame split cannot be taken at face value.** It reports `world 1ms` against
`hud 5ms`, which is not credible for a full world render. `Set2DWindow` begins
with `R_IssuePendingRenderCommands()`, so the world's deferred draw calls are
attributed to the first 2D call that forces them out — the trap in
`QUEST_PORTING_GUIDE.md` §7.1. The one trustworthy figure is `gpuwait`, still
**3 ms**: the GPU finishes early and waits, exactly as it did under rend2, so
whatever the 11 ms is, it is CPU issuing draw calls and not fill rate.
**Fixing that attribution is the prerequisite to spending any budget**, because
right now nobody can say where half the frame goes.
**The HUD is still screen space during gameplay**, with the same non-convergence
the menus had before the quad layer.
**Per-weapon alignment is one global setting.** `vr_weaponAdjust` is shared
across every weapon, but a Garand, a Colt and a bazooka will not want the same
grip offset — the reference keeps `vr_weapon_adjustment_<id>` per weapon. The
Bocage hands over a Colt and a Garand at spawn, plus `give all`, which is the
place to find out how far apart they need to be.
**Not confirmed on the device**, and each is only known to compile:
- the two handed hold and the reload gesture
- off hand steering — it was mirrored, and the corrected sign has not been tried
- whether the pistol's `lefthand` surface looks right; only the Garand's
`garandhand` has been seen
**Some foliage still rotates with head movement.** `AutospriteDeform` and the
`SPRITE_PARALLEL` paths now face the viewer's position rather than the view
plane, which fixed the near foliage and the imposters behind it. At least one
more path does the same thing. `Autosprite2Deform` was left alone on purpose.
**A recurring SIGSEGV in the Adreno driver** (`gsl_memory_alloc_pure_64`, fault
address `0x90`) on a secondary thread at every launch. It **predates all VR
work** — it was in the flat builds too — and the process survives it every time.
Establish which faults are background noise before bisecting anything.
---
## 5. What to do next
1. **Fix the frame split**, so `world` and `hud` mean what they say. Half the
frame is currently attributed to a flush rather than to the work that caused
it, and every performance decision after this one depends on knowing where
the 11 ms actually goes. The GPU idling at 3 ms says there is something real
to find.
2. **Then decide about MSAA**, and about whether the CPU cost can come down far
enough to hold 90 Hz at full resolution rather than reprojecting to it.
3. **Confirm the unconfirmed** — the two handed hold, the reload tap, off hand
steering. All three are one session on the device with the harness already in
place.
4. **Per-weapon alignment.** Build the per-weapon table once the numbers for two
or three weapons are known.
5. **The HUD.** Wrist or weapon mounted readouts; `VR_WristPanelEnabled` already
exists and is off.
6. Remaining foliage paths, and the Adreno fault.
### Reference
Team Beef's RTCWQuest, `/home/berkybear/RTCWQuest`, clean at `4c714b9`.
`Projects/Android/jni/RTCWVR/`: `TBXR_Common.c` is their OpenXR layer,
`VrInputDefault.c` the movement and weapon handling, `VrInputWeaponAlign.c` the
per-weapon calibration. `rtcw/src/cgame/cg_weapons.c` has
`CG_CalculateVRWeaponPosition` and the offhand equivalents;
`rtcw/src/renderer/tr_scene.c` has `convertFromVR`, which is the frame conversion
this port arrives at from the other direction.
Ideas there worth having and not yet taken: **a projection layer and a quad layer
in the same frame** (`TBXR_Common.c:1576`), which is how a pointer ray and
controller models get drawn on a menu-only frame; and **scope zoom by narrowing
the composition layer's FOV** (`TBXR_Common.c:1557`) rather than touching the
projection matrix, which applies directly to the sniper scopes and binoculars.
Not there, so do not go looking: no foveation, no space warp, no performance
level hints. `XR_FB_display_refresh_rate` is vestigial in their tree — the
working implementation here is original.
+546
View File
@@ -0,0 +1,546 @@
# Swapping the renderer — where this stands and what to do next
Companion to `VR_PORT_STATUS.md`. That file describes the VR layer; this one is
about the move from `renderergl2` to `renderergl1` on gl4es.
Branch `vr-quest3`.
---
## 0. Status at a glance
**Working, on the device, with nothing overridden:** renderergl1 on gl4es, the
OpenXR session, both eyes and the flat panel, the menus, cutscenes, controllers
and pointer beam, **and the world** - terrain, BSP geometry, static models,
textures, lightmaps, fog and sky. **89-90 fps at 6 ms per eye**, against rend2's
50-60 ms. That is the number this whole swap existed to get.
Three bugs were behind the black screen, and each is recorded in section 8 with
what proved it:
1. A window-resize `vid_restart` tearing down the GL context and the OpenXR
session five seconds into every run. That was the black menu.
2. `RB_SurfaceFace` writing 32-bit indices through a 16-bit array. That was the
world smeared into streaks.
3. **gl4es's cached cull face drifting from the driver's**, so the engine's
`glCullFace(GL_FRONT)` was dropped as redundant every frame while the
hardware culled `GL_BACK` - exactly the faces Quake keeps. That was the
invisible world.
**The single most important lesson is section 9.** Everything the engine could
be asked about itself said the renderer was correct, because under gl4es the
engine is largely asking gl4es to repeat the engine's own values back.
---
## 1. The reference implementation — read this before solving anything
**Team Beef's RTCWQuest is cloned at `/home/berkybear/RTCWQuest`**, clean at
`4c714b9`.
Same Quake 3 engine lineage, same genre, same headset, same gl4es — and unlike
this port, it is finished. **Go to it first for any problem this port is trying
to solve.** That is a standing instruction, not a suggestion. In this session it
was violated repeatedly and cost most of the elapsed time: the answer to the
single biggest blocker (section 5.8) was sitting in their `Android.mk` the whole
time.
| Path (under `Projects/Android/jni/`) | What |
|---|---|
| `RTCWVR/TBXR_Common.c` | their OpenXR layer: session, swapchains, composition layers, frame submit |
| `RTCWVR/VrInputDefault.c` | movement, gestures, weapon handling |
| `RTCWVR/VrInputWeaponAlign.c` | per-weapon aim calibration |
| `RTCWVR/VrClientInfo.h` | their whole VR state struct |
| `rtcw/src/renderer/` | the fixed function renderer with their GLES changes (`#ifdef HAVE_GLES`) |
| `SupportLibs/gl4es/Android.mk` | **the gl4es build flags. These matter. See 5.8.** |
### Already extracted — do not re-derive
**Aiming** (`rtcw/src/game/g_weapon.c:1904`). Shot direction is computed in the
*game*, where the trace is fired:
```c
VectorCopy(gVR->weaponangles, viewang);
viewang[YAW] = ent->client->ps.viewangles[YAW]
+ (gVR->weaponangles[YAW] - gVR->hmdorientation[YAW]);
```
Pitch and roll come straight from the controller; yaw is the view yaw plus how
far the controller leads the head. The controller's absolute yaw is meaningless.
The camera stays on the head; only the trace moves to the hand.
**6DoF** (`rtcw/src/client/cl_input.c:847`). Head position delta is fed into the
usercmd as movement. Already ported here.
**The HUD.** No wrist panel. Screen space, in the eye buffers, re-centred on
each eye's off-centre frustum, given stereo parallax, scaled in from the edges.
**Hands.** No controller models. Their existing view-model hand, moved to the
controller's real-world offset from the head.
**Ladders.** Nothing at all — RTCW's are contents-based so it works for free.
**Does not transfer**: MOH:AA is entity-based with a view clamp in
`PmoveAdjustViewAngleSettings_OnLadder`.
**Not there, so do not go looking**: no foveation, no space warp, no performance
level hints. `XR_FB_display_refresh_rate` is vestigial in their tree.
---
## 2. Why the renderer was swapped
renderergl2 ran at **10–15 fps against a 90 Hz display**. Taken apart on the
device:
| Phase | Cost |
|---|---|
| `xrWaitFrame` | 0 ms |
| Building the 3D scene | 2–3 ms |
| **Issuing the scene to GL** | **50–60 ms, per eye** |
| GPU, measured with `glFinish` | **3 ms** |
The GPU finishes in 3 ms and waits. Rendering at 36% of the pixels bought only
23% back, so it is not fill rate. It is CPU in the back end issuing draw calls:
rend2 puts every surface through a GLSL program with dozens of uniforms, 139
`GLSL_BindProgram`/`GLSL_SetUniform` call sites in the surface path, once per
surface per eye.
None of what that buys is visible here — this art has no normal or specular
maps. RTCWQuest's renderer contains no GLSL at all: the original Quake 3 forward
renderer on gl4es. That is the stack being copied.
---
## 3. Measurement traps in the *old* renderer investigation
Kept because they are still true of the code.
**`backEnd.pc.msec` is assigned, not accumulated** (`tr_backend.c`). Later empty
flushes overwrite the scene's real number with 0.
**`Set2DWindow` begins with `R_IssuePendingRenderCommands()`**. The 3D scene is
*built* during the world pass but only *executed* when something forces a flush,
and the first thing that does is the HUD. The whole frame's rendering therefore
appears to any timer to be HUD cost.
**`tr.frontEndMsec` only covers `RE_RenderScene`**, not the cgame work around it.
---
## 4. Build
```sh
cmake -B build-gl1 -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-29 -DANDROID_STL=c++_shared \
-DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=OFF
cmake --build build-gl1 -j$(nproc)
cd misc/android && gradle assembleDebug -PnativeLibsDir=../../build-gl1/apk-libs
cd ../.. && adb install -r misc/android/app/build/outputs/apk/debug/app-debug.apk
```
renderergl1 + gl4es is the default on Android. renderergl2 is still reachable
with `-DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON -DUSE_GL4ES=OFF` and
still builds.
---
## 5. What was wrong, and what fixing it required
All committed. Each of these was a hard blocker in its own right.
### 5.1 renderergl1 had never compiled
`cmake/platforms/android.cmake` held `set(BUILD_RENDERER_GL1 OFF CACHE INTERNAL "")`.
**`CACHE INTERNAL` implies `FORCE`**, so the `-D` on the command line was
overwritten on every configure. The cache read `BUILD_RENDERER_GL1:INTERNAL=OFF`
and `build.ninja` never mentioned renderergl1. A previous handoff claimed this
renderer "compiles clean"; it had never been compiled at all. **Check the cache,
not the command line.**
### 5.2 gl4es was building into the source tree, under a name Android cannot load
gl4es's own CMakeLists sets `CMAKE_LIBRARY_OUTPUT_DIRECTORY` to
`${CMAKE_SOURCE_DIR}/lib`, which under FetchContent is *this* project's source
root. It also forces the suffix `.so.1`. Android has no versioned sonames and
the package manager extracts only `lib*.so`. Redirected into the build tree as
`libgl4es.so` and staged with the other APK libraries.
### 5.3 The renderer's GL entry points must come from gl4es
renderergl1 does not call GL by name. `qgl_linked.h` is dead code that nothing
includes; `renderercommon/qgl.h` declares every entry point as a **function
pointer** filled by `GLimp_GetProcAddresses` from `SDL_GL_GetProcAddress`.
On **EGL 1.5, which the Quest is**, `SDL_EGL_GetProcAddress` tries
`eglGetProcAddress` *before* the library it loaded. The driver answers for every
name OpenGL 1.x and ES have in common — `glEnable`, `glBindTexture`,
`glDrawArrays`, `glTexImage2D`, ~80 more — so only desktop-only names
(`glBegin`, `glMatrixMode`) would reach gl4es. The renderer now resolves through
`GLimp_GetProcAddress`, straight to the gl4es handle.
The **extension string** has the same problem: `SDL_GL_ExtensionSupported` reads
the driver's ES list, which names none of the desktop extensions the renderer
asks after, so `GL_ARB_multitexture` read as absent and the renderer would have
dropped to one texture unit.
### 5.4 The fixed function path asked for a context that does not exist
`GLimp_SetMode`'s `fixedFunction` branch offered exactly one context: **desktop
OpenGL 1.1**. There is no such thing on Android; window creation failed and
R_Init gave up with `Couldn't get a visual`. renderergl2 never met this because
it takes the other branch.
Under `USE_GL4ES` that branch now asks for **ES 3.0 then ES 2.0**. The renderer
is never told: it reads its version through gl4es, which reports desktop GL
(`2.1 gl4es wrapper 1.1.6`), and takes the desktop fixed function path on the
strength of it. ES underneath, desktop GL above — the whole point of the layer.
### 5.5 gl4es answers `glGetString` from constants
`GL_VERSION`, `GL_VENDOR` and `GL_RENDERER` come out of gl4es's own globals
without the driver being asked. The engine's only check that a context is live is
`GL_VERSION` coming back non-NULL, so under gl4es that check passes
unconditionally and a context created but never bound sails through `R_Init`.
`GLimp_SetMode` now asks SDL directly instead.
### 5.6 SDL unbinds the context and reports success
`SDL_EGL_MakeCurrent`, handed no surface and without `gl_allow_no_surface`:
```c
if (!egl_context || (!egl_surface && !_this->gl_allow_no_surface)) {
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
return 0; /* success, either way */
```
In a headset there is no window being presented, so that surface never arrives.
SDL then records the context as current, and SDL and EGL disagree permanently.
Asking SDL to bind it again does nothing — `SDL_GL_MakeCurrent` sees its own
bookkeeping agree and returns early with `/* We're already current. */`.
RTCWQuest never meets this because it never depends on a window surface: it makes
its context current against a **16×16 pbuffer** (`TBXR_Common.c`,
`egl->TinySurface`). Same here, with the context SDL already made. The pbuffer
outlives the session deliberately and is released in `VR_Shutdown`.
### 5.7 gl4es must own the `GL_FRAMEBUFFER` binding — and only that
gl4es keeps its own table of framebuffers it created and **renders from that,
not from the driver's binding**:
```c
gles_glBindFramebuffer(GL_FRAMEBUFFER, current_fb->id ? current_fb->id : mainfbo_fbo);
```
A framebuffer from the driver's `glGenFramebuffers` is not in that table, so
`gl4es_glBindFramebuffer` raises `GL_INVALID_VALUE`, **returns without binding**,
and leaves `current_fb` at zero. Measured directly:
```
fbo: gl4es says 0, driver says 10 | driver viewport 756 -71 403 1126
```
Zero in this process is the 16×16 pbuffer, and the viewport lies entirely outside
it — so geometry landed in nothing, with no error raised anywhere.
The VR layer now has gl4es generate, bind and delete these. **Three things must
stay with the driver:**
- the **swapchain texture attachment** — gl4es cannot attach a texture the
OpenXR runtime created. RTCWQuest hits this and documents it at
`TBXR_Common.c:290`, describing our exact symptom: *"the engine then renders
into nothing -> black eye buffer"*. (They must bypass gl4es explicitly because
ndk-build puts gl4es first in their link order; ours is already native because
`libGLESv3` precedes `libgl4es` in `DT_NEEDED`.)
- the **blit's `GL_READ_FRAMEBUFFER` / `GL_DRAW_FRAMEBUFFER` bindings** — gl4es
takes `GL_READ_FRAMEBUFFER` as a note to itself and `return`s without binding
(`framebuffers.c:238`). Routing the blit through it silently empties the blit
and **kills the cutscenes**. This was done once by accident with an
over-broad macro; do not repeat it.
- `glFramebufferTexture2D`, per the first point.
`RE_SetDefaultFramebuffer` in renderergl1 binds **nothing**. It exists only to
flush: gl4es batches geometry and issues it lazily, so work built for one target
would otherwise arrive in whichever is bound when it finally goes out. The VR
layer calls it *before* its own bind for that reason.
### 5.8 gl4es must be built the way the reference builds it
**This was the largest single blocker and it is the thing to remember.**
With CMake's own flags, gl4es **rendered no geometry whatsoever** while clearing
the same framebuffer perfectly. Measured, in the same buffer microseconds apart:
```
gl4es draw test: 144 red (clear), 0 green (drawn), 0 other
```
Matching RTCWQuest's `Android.mk` fixed it outright, with no engine-side change:
```
gl4es draw test: 108 red (clear), 36 green (drawn), 0 other
```
(36/144 is exactly the quarter the test quad covers.)
Their flags, now in `cmake/libraries/gl4es.cmake`:
```
-DBCMHOST -DNOX11 -DNO_GBM -DDEFAULT_ES=2 -DNO_INIT_CONSTRUCTOR
-O3 -fcommon -fvisibility=hidden -funwind-tables
```
**`ANDROID` is deliberately not among them.** gl4es's own CMakeLists adds
`-DANDROID` whenever the NDK toolchain is in use, and ndk-build never does — so
the reference has only ever been exercised without it. It is not cosmetic: it
selects different code in the loader, in glx, and in `hardext`, which is where
gl4es compiles a probe shader (`testGLSL`) to decide what its fixed function
pipeline may emit. It comes from `add_definitions()`, a **directory** property,
so it must be removed at the directory it was set on — overriding it on the
target does not work.
**Still to do: bisect which flag actually mattered.** `-DANDROID` is the strong
suspicion. This is currently convergence on a known-good configuration, not a
diagnosis.
---
## 6. The trap that cost this session, in bold
**Every engine-side experiment run before 5.8 was worthless, because gl4es could
not draw anything at all.**
Under that broken gl4es, *any* test that ends "and nothing was drawn" returns the
same answer regardless of what it is testing. On the strength of such results
this session wrongly concluded, and acted on:
- that 32-bit indices were the problem (changed to 16-bit — see 8.1)
- that the `glDrawElements` client-array path was broken (switched to
`qglArrayElement`; no change)
- that compiled vertex arrays were broken (disabled them — see 8.2)
- that `glDrawBuffer(GL_BACK)` on an FBO was discarding everything (stubbed it —
see 8.3)
- that immediate mode worked while arrays did not, and later that *neither*
worked — two contradictory conclusions, both from invalid data
**Before believing any negative rendering result, prove the renderer can draw at
all.** The cheapest possible check, and the one that finally cracked this:
ask gl4es for a `glClear` and then a flat untextured quad into the same buffer,
and read the pixels back. A clear needs no shaders; a draw needs the whole
pipeline. If the clear lands and the draw does not, stop looking at the engine.
A second, dumber version of the same mistake: a probe gated on
`primitives == 2` silently stopped running when a separate change flipped
`primitives` to 1, and two rounds of "nothing drawn" results were actually
"the probe never executed". **Verify instrumentation still fires after changing
anything it depends on.**
---
## 7. What is now positively proven working
Measured on the device, after 5.8. Do not re-investigate these.
- The OpenXR session, both eye swapchains and the flat quad layer. 90 fps.
- The panel framebuffer is real, complete (`GL_FRAMEBUFFER_COMPLETE`), writable
and composited — a clear to blue showed as blue in the headset.
- gl4es reaches that framebuffer: a clear to red showed as red.
- gl4es renders geometry: a flat quad rendered, verified by pixel readback.
- ~~**The engine's own geometry renders** — with a flat-red override, the intro
logo screen before the cutscene appeared red in the headset.~~ **Weaker than
it reads.** The override had disabled the colour array, and the route it went
down was `qglArrayElement`, not `glDrawElements`. It proves one array reaches
gl4es on one route, not that the renderer's geometry path works. See 8.1.
- Cutscenes render (immediate mode, `RE_StretchRaw`).
- Controllers and the pointer beam render (VR layer's own GLES).
- Both layers agree on the framebuffer: `gl4es says 10, driver says 10`.
- The 2D setup is correct: viewport `0 0 1008 1056`, ortho `0 1008 1056 0`,
full scissor, `vrView.active` false during menus (so the HUD convergence code
in `R_VRAdjust2DOrtho` is *not* involved in the menu at all).
- The geometry submitted for menu widgets is correct: 4 verts, 6 strip indices,
sensible coordinates, identity modelview, a correct ortho matching the
widget's own viewport, `glGetError() == 0` on every draw.
---
## 8. Fixed this session
**8.1 The menu was a renderer restart.** `sdl_input.c`'s `SDL_WINDOWEVENT_RESIZED`
handler compares the window against `cls.glconfig.vidWidth/Height`, which in VR
is the *eye buffer*, never the Android surface. It can never match, so it set
`r_customwidth`/`r_customheight`/`r_mode -1` and scheduled a `vid_restart` about
five seconds in - cvars the renderer then ignores, because the VR resolution
comes from `GetVRRenderResolution`. The restart destroyed and rebuilt the GL
context and the OpenXR session under a running frame loop, and section 5.7's
framebuffer agreement did not survive it. Measured: the menu drew a full
`256/256` panel samples right up to `CL_Vid_Restart_f` and nothing ever after.
Window-resize restarts are now declined under `VR_Enabled()`.
`VR_PORT_STATUS.md` called this restart "harmless ... but wasteful". It was the
entire bug.
**8.2 `RB_SurfaceFace` wrote 32-bit indices into a 16-bit array.** It declared
`unsigned *tessIndexes` and assigned `tess.indexes` to it - which is
`glIndex_t *`, i.e. `unsigned short *` under gl4es (9.1). Every index went in
four bytes apart in a two-byte array, so half the slots held the zero high
halves of their neighbours and every triangle picked up whatever vertex that
landed on. That was the stretched, smeared world that dragged its textures with
it. Models never come through this function, which is why they were perfect
throughout.
`ProjectDlightTexture`'s `unsigned hitIndexes[SHADER_MAX_INDEXES]`, passed
straight to `R_DrawElements`, had the same fault. Both fixed; a full rebuild now
reports no index-type mismatches in the renderer.
**The compiler had been saying so all along**, under sixty-odd other warnings:
```
tr_surface.c:401: warning: incompatible pointer types assigning to 'unsigned int *'
from 'glIndex_t *' (aka 'unsigned short *')
```
This is the cost of 9.1 that nobody checked for: changing `glIndex_t` is not
local to the draw call, and the only thing that finds the other users is the
warning log. **Read it after touching that typedef.**
**8.3 The frame budget, which is what the swap was for.** In-game, on the
device: **90 fps at 4 ms per eye**, against rend2's 50-60 ms (section 2). That
question is answered and `vr_resolutionScale` can go back to 1.
**8.4 Smaller, all real.** renderergl1's `R_SetupFrustum` culled against the
game's symmetric fov rather than the runtime's asymmetric per-eye frustum
(renderergl2 does not have this bug - its `R_SetupFrustum` takes the projection
edges). Every `glViewport`, `glEnable/glDisable`, `glDepthMask`, `glDepthFunc`,
`glBlendFunc`, `glColorMask`, `glCullFace` and `glScissor` in the VR layer now
goes through gl4es, because gl4es caches all of them and silently drops the
engine's next request for a value its stale copy already claims. `GfxInfo_f`
printed a different draw route than `R_DrawElements` actually took.
---
## 9. Ask the driver, not gl4es
**Written up properly in `docs/markdown/04-coding/04-gl4es.md`.** That file is
the reference; this section is the short form.
**gl4es answers state queries from its own tables.** `glGetIntegerv` for
`GL_CULL_FACE_MODE`, `GL_FRONT_FACE` and `GL_MODELVIEW_MATRIX` all come out of
`glstate`, not the driver (`src/gl/getter.c:636-902`) - the same way `glGetString`
comes from constants (5.5). So reading state back through `qgl` and comparing it
against the engine compares the engine with gl4es's copy of the engine. It
agrees by construction and proves nothing.
Two measurements in this session did exactly that and were reported as findings:
"the matrices are identical, `maxdiff 0.000`" and "GL and the engine agree on
culling". Both were vacuous. The second was actively harmful - the driver was
culling `GL_BACK` while gl4es reported the `GL_FRONT` the engine had asked for,
and that *was* the bug being hunted.
**gl4es also drops calls its cache judges redundant** - `glCullFace`
(`face.c:14`), `glDepthMask`, `glDepthFunc`, `glBlendFunc`, `glColorMask`,
`glScissor`, `glViewport`. Once its copy drifts, the engine can never correct it:
it asks for the right value, gl4es compares against the wrong copy, and the
driver never hears. Nothing raises an error and nothing looks wrong from inside.
**So: resolve `glGetIntegerv`/`glIsEnabled` out of `libGLESv3` and ask the
hardware.** A temporary `r_traceSurf` probe did this, printing both answers
side by side; it has since been removed, but the technique is
what cracked the cull bug in one run after many that measured nothing.
The same applies to setting state, which is what `GL_Cull` now does: name a
throwaway value first so the real one cannot match a stale cache.
### 9.1 Probes must be shown to reach the thing they measure
Three probes in this session had blind spots exactly where the fault was, and
each produced a confident wrong conclusion:
- the panel readback counted samples brighter than 8 against a buffer that is
never cleared, so "nothing drawn" and "drawn black" were the same number;
- `r_flatColor` did not apply to multitextured surfaces, so it covered models
only - every "the world is not drawing" reading from it was about geometry
that was never in question;
- the flat-red override restored its state inside `if (primitives == 2)`, a
branch that was never taken, so it corrupted the renderer it was measuring.
**Before believing a negative result, prove the probe reached the surfaces in
question.** This is section 6's lesson in a second form and it cost more here
than the bugs did.
### 9.2 Single runs are not evidence
The same configuration produced different results on different runs more than
once, and a bisect was built on top of that before it was noticed. Repeat a
result before building on it, and never change code and configuration in the
same step - doing so destroyed the only known-good baseline and cost several
round trips to rebuild.
## 10. Working notes
**The device configuration lives at `misc/android/autoexec.cfg`.** It holds the
nothing load bearing any more - the overrides it used to carry went with the
bugs they worked around. It is not part of the APK; deploy it next to the game
data:
```sh
adb push misc/android/autoexec.cfg \
/sdcard/Android/data/org.openmoh.openmohaa/files/main/autoexec.cfg
adb shell am force-stop org.openmoh.openmohaa
```
**`autoexec.cfg` is the only way to set a cvar on this device.** There is no
console in a headset. It is exec'd by `Com_ExecuteCfg` after `omconfig.cfg`,
cannot be loaded out of a pk3 (`FS_FOpenFileRead`'s `isLocalConfig`), and lands
*before* `R_Init` - so the renderer's `Cvar_Get` finds each cvar already present
and keeps this value instead of its own default. That covers `CVAR_LATCH` and
`CVAR_ARCHIVE` cvars too. It cannot reach `VR_TuningCvar` cvars, which force
their value at every start, and `CVAR_CHEAT` cvars get reset on map load.
**Set every knob explicitly, never by omission.** A value left out is whatever
`omconfig.cfg` last archived. `cg_shadows` cost a whole round trip that way: it
was already 0 in the stored config, so the run that was supposed to test
disabling shadows tested nothing at all. **Read the stored config before
believing a negative result** - `adb pull .../files/main/configs/omconfig.cfg`.
**`adb install -r` does not kill a running process.** The old code keeps running
and the next launch resumes it, so a run can silently test the previous build.
Always `adb shell am force-stop org.openmoh.openmohaa` after installing.
**Pull captures individually, not the directory.** `adb pull .../files/main/`
drags 1.6 GB of pk3s. `adb pull .../main/vrshot0.tga` is what you want.
**Device.** `adb connect 192.168.1.92:43105`. It sleeps and the connection dies;
`adb disconnect` then `adb connect`. **Launch from inside the headset** — never
`adb shell am start`.
A logcat wrapper that survives the sleep/wake cycle is worth keeping around; the
connection drops constantly and a plain `adb logcat` dies with it.
**Archived cvars beat a changed default.** The config is exec'd before `VR_Init`,
so `Cvar_Get` finds the cvar already there and keeps the old value. `VR_TuningCvar`
in `vr_openxr.c` exists for this: it registers unarchived and forces the default
every start. There is no console in a headset to correct a stale value with.
**There is no console in a headset.** Every question has to be answered by
something written to logcat, or by something visible enough to describe. Prefer
pixel readbacks logged as numbers over anything that has to be seen — asking
someone to catch a one-frame flash is a bad test, and was one here.
**Settled, so not re-investigated:**
- `XR_FB_display_refresh_rate` works; the display runs at 90 Hz. Ask for it from
the frame loop with the two-call enumeration, not at `xrBeginSession`.
- MSAA via `GL_EXT_multisampled_render_to_texture` works and is off
(`vr_samples 0`).
- `vr_resolutionScale` is at **0.6** and should go back to 1 once the picture is
up — fill rate was never the problem.
- A recurring `Fatal signal 11` at address `0x90` on a secondary thread at every
launch **predates all VR work** and the process survives it every time.
**Once the menu draws**, the number this whole swap was for is still unmeasured:
renderergl1's back-end cost per eye against rend2's 50–60 ms. Section 2 is the
baseline to beat. The instrumentation for splitting a VR frame into
wait/scene/issue/gpu is described in `VR_PORT_STATUS.md`.
+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>
+117
View File
@@ -0,0 +1,117 @@
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 CONFIGURE_DEPENDS
${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})
if(ANDROID)
# Shipped in the APK, so it needs the prefix to be extracted at all
# (see DLL_PREFIX in q_platform.h)
set_target_properties( ${CGAME_MODULE_BINARY_BASEGAME} PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
endif()
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})
if(ANDROID)
set_target_properties( ${GAME_MODULE_BINARY_BASEGAME} PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
endif()
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()
+157
View File
@@ -0,0 +1,157 @@
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/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})
if(ANDROID)
# SDLActivity dlopen()s the engine and calls SDL_main, so the client is a
# shared library rather than an executable. It also has to carry the lib
# prefix: the package manager only extracts lib*.so out of an APK.
add_library(${CLIENT_BINARY} SHARED ${CLIENT_BINARY_SOURCES})
set_target_properties(${CLIENT_BINARY} PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
else()
add_executable(${CLIENT_BINARY} ${CLIENT_EXECUTABLE_OPTIONS} ${CLIENT_BINARY_SOURCES})
endif()
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)
+51
View File
@@ -0,0 +1,51 @@
# 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 AND NOT ANDROID)
# For when using GLIBC versions older than 2.34
# (bionic has no librt; the same symbols live in libc)
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 AND NOT ANDROID)
# 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)
+42
View File
@@ -0,0 +1,42 @@
if(ANDROID)
# The launcher picks a game binary to exec; on Android the activity is
# the entry point instead.
return()
endif()
set(LAUNCHER_SOURCES "${SOURCE_DIR}/Launcher/launch_main.cpp")
if (WIN32)
list(APPEND LAUNCHER_SOURCES
${SOURCE_DIR}/Launcher/launch_win32.cpp
${SOURCE_DIR}/sys/win_resource.rc
)
else()
list(APPEND LAUNCHER_SOURCES
${SOURCE_DIR}/Launcher/launch_linux.cpp
)
endif()
function (create_launcher name type)
if (BUILD_CLIENT)
add_executable(openmohaa_launcher_${name} ${LAUNCHER_SOURCES})
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 ${INSTALL_BINDIR_FULL})
endif()
#add_executable(omohaaded_launcher_${name} ${LAUNCHER_SOURCES})
#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}")
#set_target_properties(omohaaded_launcher_${name} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
#
#INSTALL(TARGETS omohaaded_launcher_${name} DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_INSTALL_SUBDIR})
endfunction()
create_launcher(base 0)
create_launcher(spearhead 1)
create_launcher(breakthrough 2)
+14
View File
@@ -0,0 +1,14 @@
include(libraries/curl)
include(libraries/freetype)
include(libraries/jpeg)
include(libraries/ogg)
include(libraries/opus)
include(libraries/openal)
include(libraries/openxr)
include(libraries/gl4es)
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})
+125
View File
@@ -0,0 +1,125 @@
if(NOT ANDROID OR NOT BUILD_CLIENT OR NOT USE_GL4ES)
return()
endif()
# gl4es translates the fixed function OpenGL the original renderer speaks into
# the OpenGL ES the device actually has.
#
# This is here because renderergl1 is the renderer this game's art was authored
# for. renderergl2 is the rend2 rewrite: every surface goes through a GLSL
# program with dozens of uniforms set on it, once per surface per eye, and the
# frame timing found tens of milliseconds of CPU going into that while the GPU
# finished in three. None of what it buys is visible on content that has no
# normal or specular maps for it to read - so it costs the frame and returns a
# picture further from the original than the plain path gives.
#
# The alternative was to port renderergl1's fixed function calls to ES by hand.
# That is the same work gl4es already does, more thoroughly, and it is the same
# choice RTCWQuest made for the same reason.
include(FetchContent)
set(GL4ES_VERSION 1.1.6)
set(GL4ES_SOURCE_PATH "" CACHE PATH
"Existing gl4es source tree to build against; downloaded if empty")
if(GL4ES_SOURCE_PATH)
FetchContent_Declare(gl4es SOURCE_DIR ${GL4ES_SOURCE_PATH})
else()
FetchContent_Declare(gl4es
GIT_REPOSITORY https://github.com/ptitSeb/gl4es.git
GIT_TAG v${GL4ES_VERSION}
GIT_SHALLOW TRUE)
endif()
# No X11 and no GBM on Android, and ES 2 as the backend. NO_INIT_CONSTRUCTOR
# keeps it from initialising itself behind the engine's back: the context is
# created by SDL and handed to OpenXR, and gl4es has to attach to that one
# rather than make its own. These are the flags RTCWQuest ships.
set(NOX11 ON CACHE BOOL "" FORCE)
set(GBM OFF CACHE BOOL "" FORCE)
set(STATICLIB OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(gl4es)
# The target is called GL, because that is what gl4es presents itself as - it
# takes over the OpenGL entry points the renderer calls. Named back to gl4es on
# disk so the APK does not ship something calling itself libGL.so, which is a
# name the platform has its own ideas about.
if(NOT TARGET GL)
message(FATAL_ERROR
"gl4es did not declare its GL target; nothing would translate the GL1 "
"renderer's calls. Configure with -DUSE_GL4ES=OFF to build without it.")
endif()
# Built the way RTCWQuest builds it, because that combination is known to render
# on this device and this one does not.
#
# Their Android.mk (SupportLibs/gl4es/Android.mk) compiles with exactly:
#
# -DBCMHOST -DNOX11 -DNO_GBM -DDEFAULT_ES=2 -DNO_INIT_CONSTRUCTOR
# -O3 -fcommon -fvisibility=hidden -funwind-tables
#
# Two differences from what CMake produces on its own are worth naming.
#
# ANDROID is *not* among them. gl4es's own CMakeLists adds it whenever it is
# built with the NDK toolchain, and it is not a harmless label: it selects
# different code in the loader, in glx, and in hardext - which is where gl4es
# compiles a probe shader to decide what its whole fixed function pipeline is
# allowed to emit. ndk-build never defines it, so the reference has been
# exercised without it and this has not.
#
# BCMHOST is the Raspberry Pi switch, which looks wrong on a Quest and is
# carried anyway, because everything it gates is additionally guarded by
# !defined(ANDROID). Matching the reference matters more here than tidiness.
#
# add_definitions() in gl4es's CMakeLists is a directory property, so the
# ANDROID it adds has to be removed at the directory it was set on rather than
# overridden on the target.
foreach(GL4ES_DIR ${gl4es_SOURCE_DIR} ${gl4es_SOURCE_DIR}/src)
set_property(DIRECTORY ${GL4ES_DIR} PROPERTY COMPILE_DEFINITIONS
BCMHOST
NOX11
NO_GBM
DEFAULT_ES=2
NO_INIT_CONSTRUCTOR)
endforeach()
target_compile_options(GL PRIVATE
-O3
# gl4es is old C that expects tentative definitions to be merged. Clang has
# defaulted to -fno-common since 15; the NDK here is newer than that and the
# reference build is not.
-fcommon
-fvisibility=hidden
-funwind-tables)
# What their LOCAL_LDLIBS names. gl4es dlopen()s the driver itself, so these are
# not needed to resolve anything; they are here so the library is built against
# the same set the reference links.
target_link_libraries(GL PRIVATE EGL GLESv3 dl log)
set_target_properties(GL PROPERTIES
# Shipped inside the APK, so it needs the prefix the top level CMakeLists
# cleared for the engine's own libraries.
OUTPUT_NAME gl4es
PREFIX ${ANDROID_APK_LIBRARY_PREFIX}
# gl4es builds itself as libGL.so.1 in the manner of a system OpenGL
# (src/CMakeLists.txt forces the suffix). Android has no versioned sonames:
# the package manager only extracts lib*.so out of an APK, and the linker
# would not load the result if it did. Back to a plain suffix.
SUFFIX ".so"
# gl4es's own CMakeLists points CMAKE_LIBRARY_OUTPUT_DIRECTORY at
# ${CMAKE_SOURCE_DIR}/lib, and under FetchContent that is *this* project's
# source root - so without this the artifact is written into the engine's
# source tree, where nobody thinks to look for it and git has to ignore it.
LIBRARY_OUTPUT_DIRECTORY ${gl4es_BINARY_DIR}/lib)
# The renderer includes <GL/gl.h>, which on Android only exists because gl4es
# provides it.
list(APPEND RENDERER_INCLUDE_DIRS ${gl4es_SOURCE_DIR}/include)
list(APPEND RENDERER_LIBRARIES GL)
list(APPEND RENDERER_DEFINITIONS USE_GL4ES)
+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})
+69
View File
@@ -0,0 +1,69 @@
if(NOT USE_OPENAL)
return()
endif()
if(NOT BUILD_CLIENT)
return()
endif()
set(INTERNAL_OPENAL_VERSION 1.24.3)
set(INTERNAL_OPENAL_DIR ${SOURCE_DIR}/thirdparty/openal-soft-${INTERNAL_OPENAL_VERSION})
if(ANDROID)
# There is no system OpenAL on Android, and OpenAL is not optional here:
# it is the engine's only sound driver (see SOUND_DRIVER in
# snd_local_new.h). Build OpenAL Soft from source; its OpenSL ES backend is
# what actually reaches the headset.
include(FetchContent)
set(OPENAL_SOURCE_PATH "" CACHE PATH
"Existing OpenAL Soft source tree to build against; downloaded if empty")
if(OPENAL_SOURCE_PATH)
FetchContent_Declare(OpenAL SOURCE_DIR ${OPENAL_SOURCE_PATH})
else()
FetchContent_Declare(OpenAL
URL https://github.com/kcat/openal-soft/archive/refs/tags/${INTERNAL_OPENAL_VERSION}.tar.gz
URL_HASH SHA256=7e1fecdeb45e7f78722b776c5cf30bd33934b961d7fd2a11e0494e064cc631ce)
endif()
set(ALSOFT_EXAMPLES OFF CACHE BOOL "" FORCE)
set(ALSOFT_UTILS OFF CACHE BOOL "" FORCE)
set(ALSOFT_TESTS OFF CACHE BOOL "" FORCE)
set(ALSOFT_INSTALL OFF CACHE BOOL "" FORCE)
set(ALSOFT_INSTALL_CONFIG OFF CACHE BOOL "" FORCE)
set(ALSOFT_INSTALL_HRTF_DATA OFF CACHE BOOL "" FORCE)
set(ALSOFT_INSTALL_AMBDEC_PRESETS OFF CACHE BOOL "" FORCE)
set(ALSOFT_INSTALL_EXAMPLES OFF CACHE BOOL "" FORCE)
set(ALSOFT_INSTALL_UTILS OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(OpenAL)
# See the same note in sdl.cmake: the cleared prefix is inherited from the
# top level and has to be put back for anything shipped inside the APK.
set_target_properties(OpenAL PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
# OpenAL::OpenAL carries its own include directory, so <AL/al.h> resolves
# without the vendored copy.
list(APPEND CLIENT_DEFINITIONS USE_OPENAL)
list(APPEND CLIENT_LIBRARIES OpenAL::OpenAL)
return()
endif()
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()
+46
View File
@@ -0,0 +1,46 @@
if(NOT USE_OPENXR OR NOT BUILD_CLIENT)
return()
endif()
# The Khronos loader is the vendor-neutral one: it finds whatever runtime the
# device provides (Meta, Pico, SteamVR) rather than binding us to a vendor SDK.
include(FetchContent)
set(OPENXR_VERSION 1.1.43)
set(OPENXR_SOURCE_PATH "" CACHE PATH
"Existing OpenXR-SDK source tree to build against; downloaded if empty")
if(OPENXR_SOURCE_PATH)
FetchContent_Declare(OpenXR SOURCE_DIR ${OPENXR_SOURCE_PATH})
else()
FetchContent_Declare(OpenXR
URL https://github.com/KhronosGroup/OpenXR-SDK/archive/refs/tags/release-${OPENXR_VERSION}.tar.gz
URL_HASH SHA256=fd0834e4bc75c935248d82ac044f472ab3af4d8ff3b191a3ccace3436975a4cf)
endif()
set(BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(BUILD_API_LAYERS OFF CACHE BOOL "" FORCE)
set(BUILD_LOADER ON CACHE BOOL "" FORCE)
set(DYNAMIC_LOADER ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(OpenXR)
if(ANDROID)
# Shipped in the APK, so it needs the prefix the top level CMakeLists cleared
set_target_properties(openxr_loader PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
endif()
list(APPEND CLIENT_DEFINITIONS USE_OPENXR)
list(APPEND CLIENT_LIBRARIES OpenXR::openxr_loader)
list(APPEND CLIENT_LIBRARY_SOURCES ${SOURCE_DIR}/vr/vr_openxr.c)
if(ANDROID)
# The VR layer owns the eye framebuffers and hands the session its EGL
# context, so unlike the renderer it calls GL and EGL directly rather than
# through SDL's loader.
list(APPEND CLIENT_LIBRARIES EGL GLESv3)
endif()
# The renderer needs to know which framebuffer to draw an eye into
list(APPEND RENDERER_DEFINITIONS USE_OPENXR)
+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)
+105
View File
@@ -0,0 +1,105 @@
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_VERSION 2.32.8)
set(INTERNAL_SDL_DIR ${SOURCE_DIR}/thirdparty/SDL2-${INTERNAL_SDL_VERSION})
include(utils/arch)
if(ANDROID)
# There is no prebuilt SDL for Android, so it is built from source next to
# the engine. The same tree also carries the org.libsdl.app Java classes
# the APK needs, so the unpacked source is worth keeping hold of.
include(FetchContent)
set(SDL2_SOURCE_PATH "" CACHE PATH
"Existing SDL2 source tree to build against; downloaded if empty")
if(SDL2_SOURCE_PATH)
FetchContent_Declare(SDL2 SOURCE_DIR ${SDL2_SOURCE_PATH})
else()
FetchContent_Declare(SDL2
URL https://github.com/libsdl-org/SDL/releases/download/release-${INTERNAL_SDL_VERSION}/SDL2-${INTERNAL_SDL_VERSION}.tar.gz
URL_HASH SHA256=0ca83e9c9b31e18288c7ec811108e58bac1f1bb5ec6577ad386830eac51c787e)
endif()
# SDLActivity loads libSDL2.so from the APK by name, so it has to be shared.
set(SDL_SHARED ON CACHE BOOL "" FORCE)
set(SDL_STATIC OFF CACHE BOOL "" FORCE)
set(SDL_TEST OFF CACHE BOOL "" FORCE)
set(SDL2_DISABLE_INSTALL ON CACHE BOOL "" FORCE)
set(SDL2_DISABLE_UNINSTALL ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(SDL2)
# The top level CMakeLists clears the shared library prefix, which the
# fetched project inherits. Put it back, or the APK ships an SDL2.so the
# package manager will not extract and SDLActivity cannot load.
set_target_properties(SDL2 PROPERTIES PREFIX ${ANDROID_APK_LIBRARY_PREFIX})
# Where the APK build picks up SDLActivity and friends
set(SDL2_JAVA_DIR ${sdl2_SOURCE_DIR}/android-project/app/src/main/java
CACHE INTERNAL "")
list(APPEND CLIENT_LIBRARIES SDL2::SDL2)
list(APPEND RENDERER_LIBRARIES SDL2::SDL2)
return()
endif()
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()
+21
View File
@@ -0,0 +1,21 @@
include(platforms/android)
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}")
+95
View File
@@ -0,0 +1,95 @@
# Android specific settings.
#
# Configured with the NDK's android.toolchain.cmake, e.g.
#
# cmake -B build-android \
# -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
# -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-29
#
# Nothing here is Quest specific; a phone build works the same way.
if(NOT ANDROID)
return()
endif()
# The renderer choice is left to the top level options, which default to
# renderergl1. That is the fixed function renderer this game's art was authored
# for, and USE_GL4ES puts the translation layer underneath it that lets it reach
# OpenGL ES; see cmake/libraries/gl4es.cmake for why it is worth the layer.
#
# renderergl2 speaks GLES natively and was the first thing to run here, but it
# spends tens of milliseconds of CPU per eye binding GLSL programs for lighting
# this content has no maps to feed. It is still reachable with
#
# -DBUILD_RENDERER_GL1=OFF -DBUILD_RENDERER_GL2=ON -DUSE_GL4ES=OFF
#
# Nothing may be forced into the cache here: these are declared with option(),
# so a `set(... CACHE INTERNAL "")` implies FORCE and would silently overwrite
# whatever was asked for on the command line.
# Android's linker namespaces are particular about where a dlopen'd library
# may live. Link the renderer into the client rather than fight them.
set(USE_RENDERER_DLOPEN OFF CACHE INTERNAL "")
set(USE_OPENAL_DLOPEN OFF CACHE INTERNAL "")
# The QVM toolchain is not part of an Android build.
set(BUILD_GAME_QVMS OFF CACHE INTERNAL "")
# Only for downloading content off a server; not needed to get the game up.
set(USE_HTTP OFF CACHE INTERNAL "")
# The whole point of the Android build here is the headset.
set(USE_OPENXR ON CACHE INTERNAL "")
# There is no bundled SDL binary for Android; it is built from source.
set(USE_INTERNAL_SDL OFF CACHE INTERNAL "")
# No shell to attach a console to, and no desktop to install into.
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "" FORCE)
# Everything the engine prints ends up in logcat.
list(APPEND COMMON_LIBRARIES log)
# Android extracts only lib*.so out of an APK, so everything shipped inside one
# needs the prefix - but the top level CMakeLists clears it for the whole
# project. Targets bound for the APK opt back in individually with this.
set(ANDROID_APK_LIBRARY_PREFIX "lib")
# Gradle wants every native library for an ABI in one directory, so gather
# them there once everything has been declared.
list(APPEND POST_CONFIGURE_FUNCTIONS android_stage_apk_libraries)
function(android_stage_apk_libraries)
set(APK_LIB_DIR ${CMAKE_BINARY_DIR}/apk-libs/${ANDROID_ABI})
# Several of our libraries use the STL, so it is the shared one and has to
# be shipped alongside them.
set(APK_LIBRARIES ${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/libc++_shared.so)
set(APK_TARGETS)
foreach(APK_TARGET IN ITEMS ${CLIENT_NAME} SDL2 OpenAL openxr_loader GL ${CGAME_MODULE} ${GAME_MODULE})
if(TARGET ${APK_TARGET})
list(APPEND APK_TARGETS ${APK_TARGET})
list(APPEND APK_LIBRARIES $<TARGET_FILE:${APK_TARGET}>)
endif()
endforeach()
if(NOT APK_TARGETS)
return()
endif()
add_custom_target(apk-libs ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${APK_LIB_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${APK_LIBRARIES} ${APK_LIB_DIR}
COMMENT "Staging APK libraries in ${APK_LIB_DIR}"
VERBATIM)
add_dependencies(apk-libs ${APK_TARGETS})
# The APK needs the org.libsdl.app Java classes belonging to the very SDL
# the engine was linked against, so the gradle build reads the path from
# here rather than guessing.
file(WRITE ${CMAKE_BINARY_DIR}/android-build.properties
"# Written by the CMake build; consumed by misc/android\n"
"sdlJavaDir=${SDL2_JAVA_DIR}\n")
endfunction()
+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 OR ANDROID)
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")
+42
View File
@@ -0,0 +1,42 @@
# 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(ANDROID)
# No tty; the console goes to logcat
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/con_android.c)
elseif(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
)
if(ANDROID)
# bionic has no <execinfo.h>, so the backtrace is walked differently
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/new/sys_android_new.c)
else()
list(APPEND SYSTEM_PLATFORM_SOURCES ${SOURCE_DIR}/sys/new/sys_unix_new.c)
endif()
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,3 +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})
+71
View File
@@ -0,0 +1,71 @@
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_vr.c
${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}
@@ -54,10 +52,18 @@ if(NOT GIT_REVISION_BUILD_NUMBER)
set(GIT_REVISION_BUILD_NUMBER 0)
endif()
if(NOT PRODUCT_VERSION_STAGE)
set(PRODUCT_VERSION_STAGE "unstable")
endif()
message(VERBOSE "Git branch: ${GIT_BRANCH_NAME}")
message(VERBOSE "Git revision hash: ${GIT_REVISION_HASH}")
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")
+21
View File
@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()
-5
View File
@@ -1,5 +0,0 @@
This file identifies the version of the AL headers in this directory. If you
change or update the AL headers in any way, please make sure you also update
this file.
openal-soft-1.15.1
-355
View File
@@ -1,355 +0,0 @@
/**
* OpenAL cross platform audio library
* Copyright (C) 2008 by authors.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#ifndef AL_ALEXT_H
#define AL_ALEXT_H
#include <stddef.h>
/* Define int64_t and uint64_t types */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#elif defined(_WIN32) && defined(__GNUC__)
#include <stdint.h>
#elif defined(_WIN32)
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
/* Fallback if nothing above works */
#include <inttypes.h>
#endif
#include "alc.h"
#include "al.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef AL_LOKI_IMA_ADPCM_format
#define AL_LOKI_IMA_ADPCM_format 1
#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000
#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001
#endif
#ifndef AL_LOKI_WAVE_format
#define AL_LOKI_WAVE_format 1
#define AL_FORMAT_WAVE_EXT 0x10002
#endif
#ifndef AL_EXT_vorbis
#define AL_EXT_vorbis 1
#define AL_FORMAT_VORBIS_EXT 0x10003
#endif
#ifndef AL_LOKI_quadriphonic
#define AL_LOKI_quadriphonic 1
#define AL_FORMAT_QUAD8_LOKI 0x10004
#define AL_FORMAT_QUAD16_LOKI 0x10005
#endif
#ifndef AL_EXT_float32
#define AL_EXT_float32 1
#define AL_FORMAT_MONO_FLOAT32 0x10010
#define AL_FORMAT_STEREO_FLOAT32 0x10011
#endif
#ifndef AL_EXT_double
#define AL_EXT_double 1
#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012
#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013
#endif
#ifndef AL_EXT_MULAW
#define AL_EXT_MULAW 1
#define AL_FORMAT_MONO_MULAW_EXT 0x10014
#define AL_FORMAT_STEREO_MULAW_EXT 0x10015
#endif
#ifndef AL_EXT_ALAW
#define AL_EXT_ALAW 1
#define AL_FORMAT_MONO_ALAW_EXT 0x10016
#define AL_FORMAT_STEREO_ALAW_EXT 0x10017
#endif
#ifndef ALC_LOKI_audio_channel
#define ALC_LOKI_audio_channel 1
#define ALC_CHAN_MAIN_LOKI 0x500001
#define ALC_CHAN_PCM_LOKI 0x500002
#define ALC_CHAN_CD_LOKI 0x500003
#endif
#ifndef AL_EXT_MCFORMATS
#define AL_EXT_MCFORMATS 1
#define AL_FORMAT_QUAD8 0x1204
#define AL_FORMAT_QUAD16 0x1205
#define AL_FORMAT_QUAD32 0x1206
#define AL_FORMAT_REAR8 0x1207
#define AL_FORMAT_REAR16 0x1208
#define AL_FORMAT_REAR32 0x1209
#define AL_FORMAT_51CHN8 0x120A
#define AL_FORMAT_51CHN16 0x120B
#define AL_FORMAT_51CHN32 0x120C
#define AL_FORMAT_61CHN8 0x120D
#define AL_FORMAT_61CHN16 0x120E
#define AL_FORMAT_61CHN32 0x120F
#define AL_FORMAT_71CHN8 0x1210
#define AL_FORMAT_71CHN16 0x1211
#define AL_FORMAT_71CHN32 0x1212
#endif
#ifndef AL_EXT_MULAW_MCFORMATS
#define AL_EXT_MULAW_MCFORMATS 1
#define AL_FORMAT_MONO_MULAW 0x10014
#define AL_FORMAT_STEREO_MULAW 0x10015
#define AL_FORMAT_QUAD_MULAW 0x10021
#define AL_FORMAT_REAR_MULAW 0x10022
#define AL_FORMAT_51CHN_MULAW 0x10023
#define AL_FORMAT_61CHN_MULAW 0x10024
#define AL_FORMAT_71CHN_MULAW 0x10025
#endif
#ifndef AL_EXT_IMA4
#define AL_EXT_IMA4 1
#define AL_FORMAT_MONO_IMA4 0x1300
#define AL_FORMAT_STEREO_IMA4 0x1301
#endif
#ifndef AL_EXT_STATIC_BUFFER
#define AL_EXT_STATIC_BUFFER 1
typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei);
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq);
#endif
#endif
#ifndef ALC_EXT_EFX
#define ALC_EXT_EFX 1
#include "efx.h"
#endif
#ifndef ALC_EXT_disconnect
#define ALC_EXT_disconnect 1
#define ALC_CONNECTED 0x313
#endif
#ifndef ALC_EXT_thread_local_context
#define ALC_EXT_thread_local_context 1
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context);
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void);
#ifdef AL_ALEXT_PROTOTYPES
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context);
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
#endif
#endif
#ifndef AL_EXT_source_distance_model
#define AL_EXT_source_distance_model 1
#define AL_SOURCE_DISTANCE_MODEL 0x200
#endif
#ifndef AL_SOFT_buffer_sub_data
#define AL_SOFT_buffer_sub_data 1
#define AL_BYTE_RW_OFFSETS_SOFT 0x1031
#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032
typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei);
#ifdef AL_ALEXT_PROTOTYPES
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length);
#endif
#endif
#ifndef AL_SOFT_loop_points
#define AL_SOFT_loop_points 1
#define AL_LOOP_POINTS_SOFT 0x2015
#endif
#ifndef AL_EXT_FOLDBACK
#define AL_EXT_FOLDBACK 1
#define AL_EXT_FOLDBACK_NAME "AL_EXT_FOLDBACK"
#define AL_FOLDBACK_EVENT_BLOCK 0x4112
#define AL_FOLDBACK_EVENT_START 0x4111
#define AL_FOLDBACK_EVENT_STOP 0x4113
#define AL_FOLDBACK_MODE_MONO 0x4101
#define AL_FOLDBACK_MODE_STEREO 0x4102
typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei);
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK);
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void);
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback);
AL_API void AL_APIENTRY alRequestFoldbackStop(void);
#endif
#endif
#ifndef ALC_EXT_DEDICATED
#define ALC_EXT_DEDICATED 1
#define AL_DEDICATED_GAIN 0x0001
#define AL_EFFECT_DEDICATED_DIALOGUE 0x9001
#define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT 0x9000
#endif
#ifndef AL_SOFT_buffer_samples
#define AL_SOFT_buffer_samples 1
/* Channel configurations */
#define AL_MONO_SOFT 0x1500
#define AL_STEREO_SOFT 0x1501
#define AL_REAR_SOFT 0x1502
#define AL_QUAD_SOFT 0x1503
#define AL_5POINT1_SOFT 0x1504
#define AL_6POINT1_SOFT 0x1505
#define AL_7POINT1_SOFT 0x1506
/* Sample types */
#define AL_BYTE_SOFT 0x1400
#define AL_UNSIGNED_BYTE_SOFT 0x1401
#define AL_SHORT_SOFT 0x1402
#define AL_UNSIGNED_SHORT_SOFT 0x1403
#define AL_INT_SOFT 0x1404
#define AL_UNSIGNED_INT_SOFT 0x1405
#define AL_FLOAT_SOFT 0x1406
#define AL_DOUBLE_SOFT 0x1407
#define AL_BYTE3_SOFT 0x1408
#define AL_UNSIGNED_BYTE3_SOFT 0x1409
/* Storage formats */
#define AL_MONO8_SOFT 0x1100
#define AL_MONO16_SOFT 0x1101
#define AL_MONO32F_SOFT 0x10010
#define AL_STEREO8_SOFT 0x1102
#define AL_STEREO16_SOFT 0x1103
#define AL_STEREO32F_SOFT 0x10011
#define AL_QUAD8_SOFT 0x1204
#define AL_QUAD16_SOFT 0x1205
#define AL_QUAD32F_SOFT 0x1206
#define AL_REAR8_SOFT 0x1207
#define AL_REAR16_SOFT 0x1208
#define AL_REAR32F_SOFT 0x1209
#define AL_5POINT1_8_SOFT 0x120A
#define AL_5POINT1_16_SOFT 0x120B
#define AL_5POINT1_32F_SOFT 0x120C
#define AL_6POINT1_8_SOFT 0x120D
#define AL_6POINT1_16_SOFT 0x120E
#define AL_6POINT1_32F_SOFT 0x120F
#define AL_7POINT1_8_SOFT 0x1210
#define AL_7POINT1_16_SOFT 0x1211
#define AL_7POINT1_32F_SOFT 0x1212
/* Buffer attributes */
#define AL_INTERNAL_FORMAT_SOFT 0x2008
#define AL_BYTE_LENGTH_SOFT 0x2009
#define AL_SAMPLE_LENGTH_SOFT 0x200A
#define AL_SEC_LENGTH_SOFT 0x200B
typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*);
typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*);
typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*);
typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum);
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data);
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format);
#endif
#endif
#ifndef AL_SOFT_direct_channels
#define AL_SOFT_direct_channels 1
#define AL_DIRECT_CHANNELS_SOFT 0x1033
#endif
#ifndef ALC_SOFT_loopback
#define ALC_SOFT_loopback 1
#define ALC_FORMAT_CHANNELS_SOFT 0x1990
#define ALC_FORMAT_TYPE_SOFT 0x1991
/* Sample types */
#define ALC_BYTE_SOFT 0x1400
#define ALC_UNSIGNED_BYTE_SOFT 0x1401
#define ALC_SHORT_SOFT 0x1402
#define ALC_UNSIGNED_SHORT_SOFT 0x1403
#define ALC_INT_SOFT 0x1404
#define ALC_UNSIGNED_INT_SOFT 0x1405
#define ALC_FLOAT_SOFT 0x1406
/* Channel configurations */
#define ALC_MONO_SOFT 0x1500
#define ALC_STEREO_SOFT 0x1501
#define ALC_QUAD_SOFT 0x1503
#define ALC_5POINT1_SOFT 0x1504
#define ALC_6POINT1_SOFT 0x1505
#define ALC_7POINT1_SOFT 0x1506
typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*);
typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum);
typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei);
#ifdef AL_ALEXT_PROTOTYPES
ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName);
ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type);
ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
#endif
#endif
#ifndef AL_EXT_STEREO_ANGLES
#define AL_EXT_STEREO_ANGLES 1
#define AL_STEREO_ANGLES 0x1030
#endif
#ifndef AL_EXT_SOURCE_RADIUS
#define AL_EXT_SOURCE_RADIUS 1
#define AL_SOURCE_RADIUS 0x1031
#endif
#ifndef AL_SOFT_source_latency
#define AL_SOFT_source_latency 1
#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200
#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201
typedef int64_t ALint64SOFT;
typedef uint64_t ALuint64SOFT;
typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble);
typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble);
typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*);
typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*);
typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT);
typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT);
typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*);
typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*);
#ifdef AL_ALEXT_PROTOTYPES
AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value);
AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3);
AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values);
AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value);
AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3);
AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values);
AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value);
AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3);
AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values);
AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value);
AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3);
AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
@@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@@ -20,15 +20,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// tr_vis.cpp: visibility culling
// launch.h: Base interface for starting programs
#include "tr_local.h"
#include "tr_vis.h"
#include "../qcommon/q_platform.h"
void R_VisDebug() {
// FIXME: unimplemented
}
#include <filesystem>
#include <string>
#include <vector>
void R_VisDebugLoad(const char* szBSPName) {
// FIXME: unimplemented
}
std::filesystem::path GetProgramLocation();
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList);
+80
View File
@@ -0,0 +1,80 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
OpenMoHAA source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// main.cpp: Windows implementation of the launcher
#include "launch.h"
#include <unistd.h>
#include <spawn.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string>
#include <iostream>
extern "C" char **environ;
std::filesystem::path GetProgramLocation()
{
char path[FILENAME_MAX];
ssize_t count = readlink("/proc/self/exe", path, FILENAME_MAX);
return std::filesystem::path(std::string(path, (count > 0) ? count : 0)).parent_path();
}
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList)
{
pid_t pid;
std::string pathString = path.string();
size_t argCount = argumentList.size();
char **argv;
int status;
argv = new char *[argCount + 2];
argv[0] = (char *)pathString.c_str();
for (size_t i = 0; i < argCount; i++) {
argv[i + 1] = (char *)argumentList[i].c_str();
}
argv[argCount + 1] = NULL;
//status = posix_spawn(&pid, pathString.c_str(), NULL, NULL, argv, environ);
//delete[] argv;
//if (status != 0) {
// std::cout << "posix_spawn returned error: " << status << std::endl;
// return;
//}
//
// Using execve rather than posix_spawn
// This replaces the current process that is not needed anyway
//
status = execve(pathString.c_str(), argv, environ);
delete[] argv;
if (status == -1) {
std::cout << "posix_spawn returned error: " << errno << std::endl;
return;
}
waitpid(pid, NULL, 0);
}
+63
View File
@@ -0,0 +1,63 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
OpenMoHAA source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// main.cpp: The launcher
#include "launch.h"
#include <iostream>
#include <string>
#include <vector>
const char *targetGameList[] = {"Base", "Spearhead", "Breakthrough"};
int main(int argc, const char *argv[])
{
std::vector<std::string> argumentList;
#if !defined(DEDICATED) || !DEDICATED
const char *programName = "openmohaa" DLL_SUFFIX EXE_EXT;
#else
const char *programName = "omohaaded" DLL_SUFFIX EXE_EXT;
#endif
argumentList.push_back("+set");
argumentList.push_back("com_target_game");
argumentList.push_back(std::to_string(TARGET_GAME));
for (size_t i = 1; i < argc; i++) {
argumentList.push_back(argv[i]);
}
std::cout << "Using the target game: " << targetGameList[TARGET_GAME] << std::endl;
std::cout << std::endl;
std::cout << "Expected program name: " << programName << std::endl;
const std::filesystem::path programLocation = GetProgramLocation();
const std::filesystem::path programPath = programLocation / programName;
std::cout << "Program location: " << programLocation << std::endl;
std::cout << "Expected path: " << programPath << std::endl;
LaunchProgram(programPath, argumentList);
return 0;
}
+87
View File
@@ -0,0 +1,87 @@
/*
===========================================================================
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
OpenMoHAA source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// main.cpp: Windows implementation of the launcher
#include "launch.h"
#include <Windows.h>
#include <string>
#include <iostream>
std::filesystem::path GetProgramLocation()
{
wchar_t path[FILENAME_MAX] = {0};
GetModuleFileNameW(nullptr, path, FILENAME_MAX);
return std::filesystem::path(path).parent_path();
}
void LaunchProgram(const std::filesystem::path& path, const std::vector<std::string>& argumentList)
{
PROCESS_INFORMATION processInfo;
STARTUPINFOW startupInfo;
BOOL returnValue;
std::wstring osCommandLine;
std::wstring commandLine;
size_t argCount = argumentList.size();
memset(&processInfo, 0, sizeof(processInfo));
memset(&startupInfo, 0, sizeof(startupInfo));
startupInfo.cb = sizeof(startupInfo);
for (size_t i = 0; i < argCount; i++) {
commandLine += L"\"";
commandLine += std::wstring(argumentList[i].begin(), argumentList[i].end());
commandLine += L"\"";
if (i != argCount - 1) {
commandLine += L" ";
}
}
osCommandLine = L"\"" + path.wstring() + L"\"";
osCommandLine += L" ";
osCommandLine += commandLine;
returnValue = CreateProcessW(
path.wstring().c_str(),
(LPWSTR)osCommandLine.c_str(),
NULL,
NULL,
FALSE,
0,
NULL,
std::filesystem::current_path().wstring().c_str(),
&startupInfo,
&processInfo
);
if (!returnValue) {
std::cout << "Error in CreateProcess: " << GetLastError() << std::endl;
return;
}
WaitForSingleObject(processInfo.hProcess, INFINITE);
CloseHandle(processInfo.hProcess);
CloseHandle(processInfo.hThread);
}
-232
View File
@@ -1,232 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL.h
*
* Main include header for the SDL library
*/
#ifndef SDL_h_
#define SDL_h_
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_assert.h"
#include "SDL_atomic.h"
#include "SDL_audio.h"
#include "SDL_clipboard.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_filesystem.h"
#include "SDL_gamecontroller.h"
#include "SDL_haptic.h"
#include "SDL_hidapi.h"
#include "SDL_hints.h"
#include "SDL_joystick.h"
#include "SDL_loadso.h"
#include "SDL_log.h"
#include "SDL_messagebox.h"
#include "SDL_metal.h"
#include "SDL_mutex.h"
#include "SDL_power.h"
#include "SDL_render.h"
#include "SDL_rwops.h"
#include "SDL_sensor.h"
#include "SDL_shape.h"
#include "SDL_system.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_version.h"
#include "SDL_video.h"
#include "SDL_locale.h"
#include "SDL_misc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* As of version 0.5, SDL is loaded dynamically into the application */
/**
* \name SDL_INIT_*
*
* These are the flags which may be passed to SDL_Init(). You should
* specify the subsystems which you will be using in your application.
*/
/* @{ */
#define SDL_INIT_TIMER 0x00000001u
#define SDL_INIT_AUDIO 0x00000010u
#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
#define SDL_INIT_HAPTIC 0x00001000u
#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
#define SDL_INIT_EVENTS 0x00004000u
#define SDL_INIT_SENSOR 0x00008000u
#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
#define SDL_INIT_EVERYTHING ( \
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
)
/* @} */
/**
* Initialize the SDL library.
*
* SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the
* two may be used interchangeably. Though for readability of your code
* SDL_InitSubSystem() might be preferred.
*
* The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
* subsystems are initialized by default. Message boxes
* (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
* video subsystem, in hopes of being useful in showing an error dialog when
* SDL_Init fails. You must specifically initialize other subsystems if you
* use them in your application.
*
* Logging (such as SDL_Log) works without initialization, too.
*
* `flags` may be any of the following OR'd together:
*
* - `SDL_INIT_TIMER`: timer subsystem
* - `SDL_INIT_AUDIO`: audio subsystem
* - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
* subsystem
* - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
* events subsystem
* - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem
* - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically
* initializes the joystick subsystem
* - `SDL_INIT_EVENTS`: events subsystem
* - `SDL_INIT_EVERYTHING`: all of the above subsystems
* - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored
*
* Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
* for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
* call SDL_Quit() to force shutdown). If a subsystem is already loaded then
* this call will increase the ref-count and return.
*
* \param flags subsystem initialization flags
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_InitSubSystem
* \sa SDL_Quit
* \sa SDL_SetMainReady
* \sa SDL_WasInit
*/
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
/**
* Compatibility function to initialize the SDL library.
*
* In SDL2, this function and SDL_Init() are interchangeable.
*
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_Init
* \sa SDL_Quit
* \sa SDL_QuitSubSystem
*/
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/**
* Shut down specific SDL subsystems.
*
* If you start a subsystem using a call to that subsystem's init function
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
* SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use
* that subsystem's quit function (SDL_VideoQuit()) directly instead. But
* generally, you should not be using those functions directly anyhow; use
* SDL_Init() instead.
*
* You still need to call SDL_Quit() even if you close all open subsystems
* with SDL_QuitSubSystem().
*
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_InitSubSystem
* \sa SDL_Quit
*/
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
/**
* Get a mask of the specified subsystems which are currently initialized.
*
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
* \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
* returns the initialization status of the specified subsystems.
*
* The return value does not include SDL_INIT_NOPARACHUTE.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_Init
* \sa SDL_InitSubSystem
*/
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
/**
* Clean up all initialized subsystems.
*
* You should call this function even if you have already shutdown each
* initialized subsystem with SDL_QuitSubSystem(). It is safe to call this
* function even in the case of errors in initialization.
*
* If you start a subsystem using a call to that subsystem's init function
* (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
* then you must use that subsystem's quit function (SDL_VideoQuit()) to shut
* it down before calling SDL_Quit(). But generally, you should not be using
* those functions directly anyhow; use SDL_Init() instead.
*
* You can use this function with atexit() to ensure that it is run when your
* application is shutdown, but it is not wise to do this from a library or
* other dynamically loaded code.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_Init
* \sa SDL_QuitSubSystem
*/
extern DECLSPEC void SDLCALL SDL_Quit(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* SDL_h_ */
/* vi: set ts=4 sw=4 expandtab: */
-324
View File
@@ -1,324 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_assert_h_
#define SDL_assert_h_
#include "SDL_config.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SDL_ASSERT_LEVEL
#ifdef SDL_DEFAULT_ASSERT_LEVEL
#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
#elif defined(_DEBUG) || defined(DEBUG) || \
(defined(__GNUC__) && !defined(__OPTIMIZE__))
#define SDL_ASSERT_LEVEL 2
#else
#define SDL_ASSERT_LEVEL 1
#endif
#endif /* SDL_ASSERT_LEVEL */
/*
These are macros and not first class functions so that the debugger breaks
on the assertion line and not in some random guts of SDL, and so each
assert can have unique static variables associated with it.
*/
#if defined(_MSC_VER)
/* Don't include intrin.h here because it contains C++ code */
extern void __cdecl __debugbreak(void);
#define SDL_TriggerBreakpoint() __debugbreak()
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
#elif defined(__APPLE__) && defined(__arm__)
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
#elif defined(__386__) && defined(__WATCOMC__)
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
#include <signal.h>
#define SDL_TriggerBreakpoint() raise(SIGTRAP)
#else
/* How do we trigger breakpoints on this platform? */
#define SDL_TriggerBreakpoint()
#endif
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
# define SDL_FUNCTION __func__
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
# define SDL_FUNCTION __FUNCTION__
#else
# define SDL_FUNCTION "???"
#endif
#define SDL_FILE __FILE__
#define SDL_LINE __LINE__
/*
sizeof (x) makes the compiler still parse the expression even without
assertions enabled, so the code is always checked at compile time, but
doesn't actually generate code for it, so there are no side effects or
expensive checks at run time, just the constant size of what x WOULD be,
which presumably gets optimized out as unused.
This also solves the problem of...
int somevalue = blah();
SDL_assert(somevalue == 1);
...which would cause compiles to complain that somevalue is unused if we
disable assertions.
*/
/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
this condition isn't constant. And looks like an owl's face! */
#ifdef _MSC_VER /* stupid /W4 warnings. */
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
#else
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
#endif
#define SDL_disabled_assert(condition) \
do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
typedef enum
{
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
SDL_ASSERTION_ABORT, /**< Terminate the program. */
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
} SDL_AssertState;
typedef struct SDL_AssertData
{
int always_ignore;
unsigned int trigger_count;
const char *condition;
const char *filename;
int linenum;
const char *function;
const struct SDL_AssertData *next;
} SDL_AssertData;
#if (SDL_ASSERT_LEVEL > 0)
/* Never call this directly. Use the SDL_assert* macros. */
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
const char *,
const char *, int)
#if defined(__clang__)
#if __has_feature(attribute_analyzer_noreturn)
/* this tells Clang's static analysis that we're a custom assert function,
and that the analyzer should assume the condition was always true past this
SDL_assert test. */
__attribute__((analyzer_noreturn))
#endif
#endif
;
/* the do {} while(0) avoids dangling else problems:
if (x) SDL_assert(y); else blah();
... without the do/while, the "else" could attach to this macro's "if".
We try to handle just the minimum we need here in a macro...the loop,
the static vars, and break points. The heavy lifting is handled in
SDL_ReportAssertion(), in SDL_assert.c.
*/
#define SDL_enabled_assert(condition) \
do { \
while ( !(condition) ) { \
static struct SDL_AssertData sdl_assert_data = { \
0, 0, #condition, 0, 0, 0, 0 \
}; \
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
continue; /* go again. */ \
} else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
SDL_TriggerBreakpoint(); \
} \
break; /* not retrying. */ \
} \
} while (SDL_NULL_WHILE_LOOP_CONDITION)
#endif /* enabled assertions support code */
/* Enable various levels of assertions. */
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_disabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 1 /* release settings. */
# define SDL_assert(condition) SDL_disabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
# define SDL_assert(condition) SDL_enabled_assert(condition)
# define SDL_assert_release(condition) SDL_enabled_assert(condition)
# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
#else
# error Unknown assertion level.
#endif
/* this assertion is never disabled at any level. */
#define SDL_assert_always(condition) SDL_enabled_assert(condition)
/**
* A callback that fires when an SDL assertion fails.
*
* \param data a pointer to the SDL_AssertData structure corresponding to the
* current assertion
* \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
* \returns an SDL_AssertState value indicating how to handle the failure.
*/
typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
const SDL_AssertData* data, void* userdata);
/**
* Set an application-defined assertion handler.
*
* This function allows an application to show its own assertion UI and/or
* force the response to an assertion failure. If the application doesn't
* provide this, SDL will try to do the right thing, popping up a
* system-specific GUI dialog, and probably minimizing any fullscreen windows.
*
* This callback may fire from any thread, but it runs wrapped in a mutex, so
* it will only fire from one thread at a time.
*
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
*
* \param handler the SDL_AssertionHandler function to call when an assertion
* fails or NULL for the default handler
* \param userdata a pointer that is passed to `handler`
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_GetAssertionHandler
*/
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
SDL_AssertionHandler handler,
void *userdata);
/**
* Get the default assertion handler.
*
* This returns the function pointer that is called by default when an
* assertion is triggered. This is an internal function provided by SDL, that
* is used for assertions when SDL_SetAssertionHandler() hasn't been used to
* provide a different function.
*
* \returns the default SDL_AssertionHandler that is called when an assert
* triggers.
*
* \since This function is available since SDL 2.0.2.
*
* \sa SDL_GetAssertionHandler
*/
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
/**
* Get the current assertion handler.
*
* This returns the function pointer that is called when an assertion is
* triggered. This is either the value last passed to
* SDL_SetAssertionHandler(), or if no application-specified function is set,
* is equivalent to calling SDL_GetDefaultAssertionHandler().
*
* The parameter `puserdata` is a pointer to a void*, which will store the
* "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
* will always be NULL for the default handler. If you don't care about this
* data, it is safe to pass a NULL pointer to this function to ignore it.
*
* \param puserdata pointer which is filled with the "userdata" pointer that
* was passed to SDL_SetAssertionHandler()
* \returns the SDL_AssertionHandler that is called when an assert triggers.
*
* \since This function is available since SDL 2.0.2.
*
* \sa SDL_SetAssertionHandler
*/
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
/**
* Get a list of all assertion failures.
*
* This function gets all assertions triggered since the last call to
* SDL_ResetAssertionReport(), or the start of the program.
*
* The proper way to examine this data looks something like this:
*
* ```c
* const SDL_AssertData *item = SDL_GetAssertionReport();
* while (item) {
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
* item->condition, item->function, item->filename,
* item->linenum, item->trigger_count,
* item->always_ignore ? "yes" : "no");
* item = item->next;
* }
* ```
*
* \returns a list of all failed assertions or NULL if the list is empty. This
* memory should not be modified or freed by the application.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_ResetAssertionReport
*/
extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
/**
* Clear the list of all assertion failures.
*
* This function will clear the list of all assertions triggered up to that
* point. Immediately following this call, SDL_GetAssertionReport will return
* no items. In addition, any previously-triggered assertions will be reset to
* a trigger_count of zero, and their always_ignore state will be false.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_GetAssertionReport
*/
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
/* these had wrong naming conventions until 2.0.4. Please update your app! */
#define SDL_assert_state SDL_AssertState
#define SDL_assert_data SDL_AssertData
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* SDL_assert_h_ */
/* vi: set ts=4 sw=4 expandtab: */
-395
View File
@@ -1,395 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_atomic.h
*
* Atomic operations.
*
* IMPORTANT:
* If you are not an expert in concurrent lockless programming, you should
* only be using the atomic lock and reference counting functions in this
* file. In all other cases you should be protecting your data structures
* with full mutexes.
*
* The list of "safe" functions to use are:
* SDL_AtomicLock()
* SDL_AtomicUnlock()
* SDL_AtomicIncRef()
* SDL_AtomicDecRef()
*
* Seriously, here be dragons!
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
*
* You can find out a little more about lockless programming and the
* subtle issues that can arise here:
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
*
* There's also lots of good information here:
* http://www.1024cores.net/home/lock-free-algorithms
* http://preshing.com/
*
* These operations may or may not actually be implemented using
* processor specific atomic operations. When possible they are
* implemented as true processor specific atomic operations. When that
* is not possible the are implemented using locks that *do* use the
* available atomic operations.
*
* All of the atomic operations that modify memory are full memory barriers.
*/
#ifndef SDL_atomic_h_
#define SDL_atomic_h_
#include "SDL_stdinc.h"
#include "SDL_platform.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \name SDL AtomicLock
*
* The atomic locks are efficient spinlocks using CPU instructions,
* but are vulnerable to starvation and can spin forever if a thread
* holding a lock has been terminated. For this reason you should
* minimize the code executed inside an atomic lock and never do
* expensive things like API or system calls while holding them.
*
* The atomic locks are not safe to lock recursively.
*
* Porting Note:
* The spin lock functions and type are required and can not be
* emulated because they are used in the atomic emulation code.
*/
/* @{ */
typedef int SDL_SpinLock;
/**
* Try to lock a spin lock by setting it to a non-zero value.
*
* ***Please note that spinlocks are dangerous if you don't know what you're
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
* held.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_AtomicLock
* \sa SDL_AtomicUnlock
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
/**
* Lock a spin lock by setting it to a non-zero value.
*
* ***Please note that spinlocks are dangerous if you don't know what you're
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_AtomicTryLock
* \sa SDL_AtomicUnlock
*/
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
/**
* Unlock a spin lock by setting it to 0.
*
* Always returns immediately.
*
* ***Please note that spinlocks are dangerous if you don't know what you're
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_AtomicLock
* \sa SDL_AtomicTryLock
*/
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
/* @} *//* SDL AtomicLock */
/**
* The compiler barrier prevents the compiler from reordering
* reads and writes to globally visible variables across the call.
*/
#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
void _ReadWriteBarrier(void);
#pragma intrinsic(_ReadWriteBarrier)
#define SDL_CompilerBarrier() _ReadWriteBarrier()
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
#elif defined(__WATCOMC__)
extern __inline void SDL_CompilerBarrier(void);
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
#else
#define SDL_CompilerBarrier() \
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
#endif
/**
* Memory barriers are designed to prevent reads and writes from being
* reordered by the compiler and being seen out of order on multi-core CPUs.
*
* A typical pattern would be for thread A to write some data and a flag, and
* for thread B to read the flag and get the data. In this case you would
* insert a release barrier between writing the data and the flag,
* guaranteeing that the data write completes no later than the flag is
* written, and you would insert an acquire barrier between reading the flag
* and reading the data, to ensure that all the reads associated with the flag
* have completed.
*
* In this pattern you should always see a release barrier paired with an
* acquire barrier and you should gate the data reads/writes with a single
* flag variable.
*
* For more information on these semantics, take a look at the blog post:
* http://preshing.com/20120913/acquire-and-release-semantics
*
* \since This function is available since SDL 2.0.6.
*/
extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
#elif defined(__GNUC__) && defined(__aarch64__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__GNUC__) && defined(__arm__)
#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
/* Information from:
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
The Linux kernel provides a helper function which provides the right code for a memory barrier,
hard-coded at address 0xffff0fa0
*/
typedef void (*SDL_KernelMemoryBarrierFunc)();
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
#elif 0 /* defined(__QNXNTO__) */
#include <sys/cpuinline.h>
#define SDL_MemoryBarrierRelease() __cpu_membarrier()
#define SDL_MemoryBarrierAcquire() __cpu_membarrier()
#else
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
#ifdef __thumb__
/* The mcr instruction isn't available in thumb mode, use real functions */
#define SDL_MEMORY_BARRIER_USES_FUNCTION
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
#endif /* __thumb__ */
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
#endif /* __LINUX__ || __ANDROID__ */
#endif /* __GNUC__ && __arm__ */
#else
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
#include <mbarrier.h>
#define SDL_MemoryBarrierRelease() __machine_rel_barrier()
#define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
#else
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
#endif
#endif
/**
* \brief A type representing an atomic integer value. It is a struct
* so people don't accidentally use numeric operations on it.
*/
typedef struct { int value; } SDL_atomic_t;
/**
* Set an atomic variable to a new value if it is currently an old value.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable to be modified
* \param oldval the old value
* \param newval the new value
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_AtomicCASPtr
* \sa SDL_AtomicGet
* \sa SDL_AtomicSet
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
/**
* Set an atomic variable to a value.
*
* This function also acts as a full memory barrier.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable to be modified
* \param v the desired value
* \returns the previous value of the atomic variable.
*
* \since This function is available since SDL 2.0.2.
*
* \sa SDL_AtomicGet
*/
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
/**
* Get the value of an atomic variable.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable
* \returns the current value of an atomic variable.
*
* \since This function is available since SDL 2.0.2.
*
* \sa SDL_AtomicSet
*/
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
/**
* Add to an atomic variable.
*
* This function also acts as a full memory barrier.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to an SDL_atomic_t variable to be modified
* \param v the desired value to add
* \returns the previous value of the atomic variable.
*
* \since This function is available since SDL 2.0.2.
*
* \sa SDL_AtomicDecRef
* \sa SDL_AtomicIncRef
*/
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
/**
* \brief Increment an atomic variable used as a reference count.
*/
#ifndef SDL_AtomicIncRef
#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
#endif
/**
* \brief Decrement an atomic variable used as a reference count.
*
* \return SDL_TRUE if the variable reached zero after decrementing,
* SDL_FALSE otherwise
*/
#ifndef SDL_AtomicDecRef
#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
#endif
/**
* Set a pointer to a new value if it is currently an old value.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to a pointer
* \param oldval the old pointer value
* \param newval the new pointer value
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_AtomicCAS
* \sa SDL_AtomicGetPtr
* \sa SDL_AtomicSetPtr
*/
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
/**
* Set a pointer to a value atomically.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to a pointer
* \param v the desired pointer value
* \returns the previous value of the pointer.
*
* \since This function is available since SDL 2.0.2.
*
* \sa SDL_AtomicCASPtr
* \sa SDL_AtomicGetPtr
*/
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
/**
* Get the value of a pointer atomically.
*
* ***Note: If you don't know what this function is for, you shouldn't use
* it!***
*
* \param a a pointer to a pointer
* \returns the current value of a pointer.
*
* \since This function is available since SDL 2.0.2.
*
* \sa SDL_AtomicCASPtr
* \sa SDL_AtomicSetPtr
*/
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* SDL_atomic_h_ */
/* vi: set ts=4 sw=4 expandtab: */
File diff suppressed because it is too large. Load diff
-94
View File
@@ -1,94 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_clipboard.h
*
* Include file for SDL clipboard handling
*/
#ifndef SDL_clipboard_h_
#define SDL_clipboard_h_
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/* Function prototypes */
/**
* Put UTF-8 text into the clipboard.
*
* \param text the text to store in the clipboard
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_GetClipboardText
* \sa SDL_HasClipboardText
*/
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
/**
* Get UTF-8 text from the clipboard, which must be freed with SDL_free().
*
* This functions returns empty string if there was not enough memory left for
* a copy of the clipboard's content.
*
* \returns the clipboard text on success or an empty string on failure; call
* SDL_GetError() for more information. Caller must call SDL_free()
* on the returned pointer when done with it (even if there was an
* error).
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_HasClipboardText
* \sa SDL_SetClipboardText
*/
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
/**
* Query whether the clipboard exists and contains a non-empty text string.
*
* \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_GetClipboardText
* \sa SDL_SetClipboardText
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* SDL_clipboard_h_ */
/* vi: set ts=4 sw=4 expandtab: */
-55
View File
@@ -1,55 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_config_h_
#define SDL_config_h_
#include "SDL_platform.h"
/**
* \file SDL_config.h
*/
/* Add any platform that doesn't build using the configure system. */
#if defined(__WIN32__)
#include "SDL_config_windows.h"
#elif defined(__WINRT__)
#include "SDL_config_winrt.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
#elif defined(__IPHONEOS__)
#include "SDL_config_iphoneos.h"
#elif defined(__ANDROID__)
#include "SDL_config_android.h"
#elif defined(__OS2__)
#include "SDL_config_os2.h"
#elif defined(__EMSCRIPTEN__)
#include "SDL_config_emscripten.h"
#else
/* This is a minimal configuration just to get SDL running on new platforms. */
#include "SDL_config_minimal.h"
#endif /* platform config */
#ifdef USING_GENERATED_CONFIG_H
#error Wrong SDL_config.h, check your include path?
#endif
#endif /* SDL_config_h_ */
-585
View File
@@ -1,585 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_config_h_
#define SDL_config_h_
/**
* \file SDL_config.h.in
*
* This is a set of defines to configure the SDL features
*/
/* General platform specific identifiers */
#include "SDL_platform.h"
/* C language features */
#cmakedefine const @HAVE_CONST@
#cmakedefine inline @HAVE_INLINE@
#cmakedefine volatile @HAVE_VOLATILE@
/* C datatypes */
/* Define SIZEOF_VOIDP for 64/32 architectures */
#if defined(__LP64__) || defined(_LP64) || defined(_WIN64)
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@
#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@
/* Comment this if you want to build without any C library requirements */
#cmakedefine HAVE_LIBC 1
#if HAVE_LIBC
/* Useful headers */
#cmakedefine STDC_HEADERS 1
#cmakedefine HAVE_ALLOCA_H 1
#cmakedefine HAVE_CTYPE_H 1
#cmakedefine HAVE_FLOAT_H 1
#cmakedefine HAVE_ICONV_H 1
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_LIMITS_H 1
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_MATH_H 1
#cmakedefine HAVE_MEMORY_H 1
#cmakedefine HAVE_SIGNAL_H 1
#cmakedefine HAVE_STDARG_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDIO_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_STRINGS_H 1
#cmakedefine HAVE_STRING_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_WCHAR_H 1
#cmakedefine HAVE_PTHREAD_NP_H 1
#cmakedefine HAVE_LIBUNWIND_H 1
/* C library functions */
#cmakedefine HAVE_DLOPEN 1
#cmakedefine HAVE_MALLOC 1
#cmakedefine HAVE_CALLOC 1
#cmakedefine HAVE_REALLOC 1
#cmakedefine HAVE_FREE 1
#cmakedefine HAVE_ALLOCA 1
#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
#cmakedefine HAVE_GETENV 1
#cmakedefine HAVE_SETENV 1
#cmakedefine HAVE_PUTENV 1
#cmakedefine HAVE_UNSETENV 1
#endif
#cmakedefine HAVE_QSORT 1
#cmakedefine HAVE_ABS 1
#cmakedefine HAVE_BCOPY 1
#cmakedefine HAVE_MEMSET 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
#cmakedefine HAVE_MEMCMP 1
#cmakedefine HAVE_WCSLEN 1
#cmakedefine HAVE_WCSLCPY 1
#cmakedefine HAVE_WCSLCAT 1
#cmakedefine HAVE__WCSDUP 1
#cmakedefine HAVE_WCSDUP 1
#cmakedefine HAVE_WCSSTR 1
#cmakedefine HAVE_WCSCMP 1
#cmakedefine HAVE_WCSNCMP 1
#cmakedefine HAVE_WCSCASECMP 1
#cmakedefine HAVE__WCSICMP 1
#cmakedefine HAVE_WCSNCASECMP 1
#cmakedefine HAVE__WCSNICMP 1
#cmakedefine HAVE_STRLEN 1
#cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_STRLCAT 1
#cmakedefine HAVE__STRREV 1
#cmakedefine HAVE__STRUPR 1
#cmakedefine HAVE__STRLWR 1
#cmakedefine HAVE_INDEX 1
#cmakedefine HAVE_RINDEX 1
#cmakedefine HAVE_STRCHR 1
#cmakedefine HAVE_STRRCHR 1
#cmakedefine HAVE_STRSTR 1
#cmakedefine HAVE_STRTOK_R 1
#cmakedefine HAVE_ITOA 1
#cmakedefine HAVE__LTOA 1
#cmakedefine HAVE__UITOA 1
#cmakedefine HAVE__ULTOA 1
#cmakedefine HAVE_STRTOL 1
#cmakedefine HAVE_STRTOUL 1
#cmakedefine HAVE__I64TOA 1
#cmakedefine HAVE__UI64TOA 1
#cmakedefine HAVE_STRTOLL 1
#cmakedefine HAVE_STRTOULL 1
#cmakedefine HAVE_STRTOD 1
#cmakedefine HAVE_ATOI 1
#cmakedefine HAVE_ATOF 1
#cmakedefine HAVE_STRCMP 1
#cmakedefine HAVE_STRNCMP 1
#cmakedefine HAVE__STRICMP 1
#cmakedefine HAVE_STRCASECMP 1
#cmakedefine HAVE__STRNICMP 1
#cmakedefine HAVE_STRNCASECMP 1
#cmakedefine HAVE_SSCANF 1
#cmakedefine HAVE_VSSCANF 1
#cmakedefine HAVE_VSNPRINTF 1
#cmakedefine HAVE_M_PI 1
#cmakedefine HAVE_ACOS 1
#cmakedefine HAVE_ACOSF 1
#cmakedefine HAVE_ASIN 1
#cmakedefine HAVE_ASINF 1
#cmakedefine HAVE_ATAN 1
#cmakedefine HAVE_ATANF 1
#cmakedefine HAVE_ATAN2 1
#cmakedefine HAVE_ATAN2F 1
#cmakedefine HAVE_CEIL 1
#cmakedefine HAVE_CEILF 1
#cmakedefine HAVE_COPYSIGN 1
#cmakedefine HAVE_COPYSIGNF 1
#cmakedefine HAVE_COS 1
#cmakedefine HAVE_COSF 1
#cmakedefine HAVE_EXP 1
#cmakedefine HAVE_EXPF 1
#cmakedefine HAVE_FABS 1
#cmakedefine HAVE_FABSF 1
#cmakedefine HAVE_FLOOR 1
#cmakedefine HAVE_FLOORF 1
#cmakedefine HAVE_FMOD 1
#cmakedefine HAVE_FMODF 1
#cmakedefine HAVE_LOG 1
#cmakedefine HAVE_LOGF 1
#cmakedefine HAVE_LOG10 1
#cmakedefine HAVE_LOG10F 1
#cmakedefine HAVE_LROUND 1
#cmakedefine HAVE_LROUNDF 1
#cmakedefine HAVE_POW 1
#cmakedefine HAVE_POWF 1
#cmakedefine HAVE_ROUND 1
#cmakedefine HAVE_ROUNDF 1
#cmakedefine HAVE_SCALBN 1
#cmakedefine HAVE_SCALBNF 1
#cmakedefine HAVE_SIN 1
#cmakedefine HAVE_SINF 1
#cmakedefine HAVE_SQRT 1
#cmakedefine HAVE_SQRTF 1
#cmakedefine HAVE_TAN 1
#cmakedefine HAVE_TANF 1
#cmakedefine HAVE_TRUNC 1
#cmakedefine HAVE_TRUNCF 1
#cmakedefine HAVE_FOPEN64 1
#cmakedefine HAVE_FSEEKO 1
#cmakedefine HAVE_FSEEKO64 1
#cmakedefine HAVE_SIGACTION 1
#cmakedefine HAVE_SA_SIGACTION 1
#cmakedefine HAVE_SETJMP 1
#cmakedefine HAVE_NANOSLEEP 1
#cmakedefine HAVE_SYSCONF 1
#cmakedefine HAVE_SYSCTLBYNAME 1
#cmakedefine HAVE_CLOCK_GETTIME 1
#cmakedefine HAVE_GETPAGESIZE 1
#cmakedefine HAVE_MPROTECT 1
#cmakedefine HAVE_ICONV 1
#cmakedefine HAVE_PTHREAD_SETNAME_NP 1
#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
#cmakedefine HAVE_SEM_TIMEDWAIT 1
#cmakedefine HAVE_GETAUXVAL 1
#cmakedefine HAVE_ELF_AUX_INFO 1
#cmakedefine HAVE_POLL 1
#cmakedefine HAVE__EXIT 1
#elif defined(__WIN32__)
#cmakedefine HAVE_STDARG_H 1
#cmakedefine HAVE_STDDEF_H 1
#cmakedefine HAVE_FLOAT_H 1
#else
/* We may need some replacement for stdarg.h here */
#include <stdarg.h>
#endif /* HAVE_LIBC */
#cmakedefine HAVE_ALTIVEC_H 1
#cmakedefine HAVE_DBUS_DBUS_H 1
#cmakedefine HAVE_FCITX 1
#cmakedefine HAVE_IBUS_IBUS_H 1
#cmakedefine HAVE_SYS_INOTIFY_H 1
#cmakedefine HAVE_INOTIFY_INIT 1
#cmakedefine HAVE_INOTIFY_INIT1 1
#cmakedefine HAVE_INOTIFY 1
#cmakedefine HAVE_O_CLOEXEC 1
/* Apple platforms might be building universal binaries, where Intel builds
can use immintrin.h but other architectures can't. */
#ifdef __APPLE__
# if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
# if __has_include(<immintrin.h>)
# define HAVE_IMMINTRIN_H 1
# endif
# endif
#else /* non-Apple platforms can use the normal CMake check for this. */
#cmakedefine HAVE_IMMINTRIN_H 1
#endif
#cmakedefine HAVE_LIBUDEV_H 1
#cmakedefine HAVE_LIBSAMPLERATE_H 1
#cmakedefine HAVE_LIBDECOR_H 1
#cmakedefine HAVE_D3D_H @HAVE_D3D_H@
#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@
#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@
#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@
#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
#cmakedefine HAVE_WINDOWS_GAMING_INPUT_H @HAVE_WINDOWS_GAMING_INPUT_H@
#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
#cmakedefine HAVE_TPCSHRD_H @HAVE_TPCSHRD_H@
#cmakedefine HAVE_SENSORSAPI_H @HAVE_SENSORSAPI_H@
#cmakedefine HAVE_ROAPI_H @HAVE_ROAPI_H@
#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
/* SDL internal assertion support */
#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
/* Allow disabling of core subsystems */
#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@
#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@
#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@
#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@
#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
#cmakedefine SDL_HIDAPI_DISABLED @SDL_HIDAPI_DISABLED@
#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@
#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@
#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@
#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@
#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@
#cmakedefine SDL_LOCALE_DISABLED @SDL_LOCALE_DISABLED@
#cmakedefine SDL_MISC_DISABLED @SDL_MISC_DISABLED@
/* Enable various audio drivers */
#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@
#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@
#cmakedefine SDL_AUDIO_DRIVER_OPENSLES @SDL_AUDIO_DRIVER_OPENSLES@
#cmakedefine SDL_AUDIO_DRIVER_AAUDIO @SDL_AUDIO_DRIVER_AAUDIO@
#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@
#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@
#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@
#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@
#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@
#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@
#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@
#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@
#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@
#cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@
#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@
#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@
#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@
#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@
#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@
#cmakedefine SDL_AUDIO_DRIVER_OS2 @SDL_AUDIO_DRIVER_OS2@
#cmakedefine SDL_AUDIO_DRIVER_VITA @SDL_AUDIO_DRIVER_VITA@
#cmakedefine SDL_AUDIO_DRIVER_PSP @SDL_AUDIO_DRIVER_PSP@
/* Enable various input drivers */
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
#cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
#cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@
#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
#cmakedefine SDL_JOYSTICK_OS2 @SDL_JOYSTICK_OS2@
#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
#cmakedefine SDL_HAVE_MACHINE_JOYSTICK_H @SDL_HAVE_MACHINE_JOYSTICK_H@
#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@
#cmakedefine SDL_JOYSTICK_RAWINPUT @SDL_JOYSTICK_RAWINPUT@
#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
#cmakedefine SDL_JOYSTICK_VIRTUAL @SDL_JOYSTICK_VIRTUAL@
#cmakedefine SDL_JOYSTICK_VITA @SDL_JOYSTICK_VITA@
#cmakedefine SDL_JOYSTICK_PSP @SDL_JOYSTICK_PSP@
#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@
/* Enable various sensor drivers */
#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
#cmakedefine SDL_SENSOR_COREMOTION @SDL_SENSOR_COREMOTION@
#cmakedefine SDL_SENSOR_WINDOWS @SDL_SENSOR_WINDOWS@
#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@
#cmakedefine SDL_SENSOR_VITA @SDL_SENSOR_VITA@
/* Enable various shared object loading systems */
#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@
#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@
#cmakedefine SDL_LOADSO_OS2 @SDL_LOADSO_OS2@
/* Enable various threading systems */
#cmakedefine SDL_THREAD_GENERIC_COND_SUFFIX @SDL_THREAD_GENERIC_COND_SUFFIX@
#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@
#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@
#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@
#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@
#cmakedefine SDL_THREAD_OS2 @SDL_THREAD_OS2@
#cmakedefine SDL_THREAD_VITA @SDL_THREAD_VITA@
#cmakedefine SDL_THREAD_PSP @SDL_THREAD_PSP@
/* Enable various timer systems */
#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@
#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@
#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@
#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@
#cmakedefine SDL_TIMER_OS2 @SDL_TIMER_OS2@
#cmakedefine SDL_TIMER_VITA @SDL_TIMER_VITA@
#cmakedefine SDL_TIMER_PSP @SDL_TIMER_PSP@
/* Enable various video drivers */
#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@
#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@
#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@
#cmakedefine SDL_VIDEO_DRIVER_UIKIT @SDL_VIDEO_DRIVER_UIKIT@
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@
#cmakedefine SDL_VIDEO_DRIVER_OFFSCREEN @SDL_VIDEO_DRIVER_OFFSCREEN@
#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
#cmakedefine SDL_VIDEO_DRIVER_WINRT @SDL_VIDEO_DRIVER_WINRT@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@
#cmakedefine SDL_VIDEO_DRIVER_OS2 @SDL_VIDEO_DRIVER_OS2@
#cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@
#cmakedefine SDL_VIDEO_DRIVER_RISCOS @SDL_VIDEO_DRIVER_RISCOS@
#cmakedefine SDL_VIDEO_DRIVER_PSP @SDL_VIDEO_DRIVER_PSP@
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR@
#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES @SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@
#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@
#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@
#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@
#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@
#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@
#cmakedefine SDL_VIDEO_DRIVER_X11_XFIXES @SDL_VIDEO_DRIVER_X11_XFIXES@
#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@
#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@
#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@
#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@
#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@
#cmakedefine SDL_VIDEO_DRIVER_VITA @SDL_VIDEO_DRIVER_VITA@
#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@
#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@
#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@
#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@
#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@
#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@
#cmakedefine SDL_VIDEO_RENDER_METAL @SDL_VIDEO_RENDER_METAL@
#cmakedefine SDL_VIDEO_RENDER_VITA_GXM @SDL_VIDEO_RENDER_VITA_GXM@
#cmakedefine SDL_VIDEO_RENDER_PSP @SDL_VIDEO_RENDER_PSP@
/* Enable OpenGL support */
#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@
#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@
#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@
#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@
/* Enable Vulkan support */
#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
/* Enable Metal support */
#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@
/* Enable system power support */
#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
#cmakedefine SDL_POWER_WINRT @SDL_POWER_WINRT@
#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
#cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@
#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@
#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
#cmakedefine SDL_POWER_VITA @SDL_POWER_VITA@
#cmakedefine SDL_POWER_PSP @SDL_POWER_PSP@
/* Enable system filesystem support */
#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@
#cmakedefine SDL_FILESYSTEM_HAIKU @SDL_FILESYSTEM_HAIKU@
#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@
#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@
#cmakedefine SDL_FILESYSTEM_RISCOS @SDL_FILESYSTEM_RISCOS@
#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@
#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@
#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@
#cmakedefine SDL_FILESYSTEM_OS2 @SDL_FILESYSTEM_OS2@
#cmakedefine SDL_FILESYSTEM_VITA @SDL_FILESYSTEM_VITA@
#cmakedefine SDL_FILESYSTEM_PSP @SDL_FILESYSTEM_PSP@
/* Enable misc subsystem */
#cmakedefine SDL_MISC_DUMMY @SDL_MISC_DUMMY@
/* Enable locale subsystem */
#cmakedefine SDL_LOCALE_DUMMY @SDL_LOCALE_DUMMY@
/* Enable assembly routines */
#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
#cmakedefine SDL_ARM_SIMD_BLITTERS @SDL_ARM_SIMD_BLITTERS@
#cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@
/* Whether SDL_DYNAMIC_API needs dlopen */
#cmakedefine DYNAPI_NEEDS_DLOPEN @DYNAPI_NEEDS_DLOPEN@
/* Enable dynamic libsamplerate support */
#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@
/* Enable ime support */
#cmakedefine SDL_USE_IME @SDL_USE_IME@
/* Platform specific definitions */
#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@
#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@
#cmakedefine SDL_VIDEO_VITA_PIB @SDL_VIDEO_VITA_PIB@
#cmakedefine SDL_VIDEO_VITA_PVR @SDL_VIDEO_VITA_PVR@
#cmakedefine SDL_VIDEO_VITA_PVR_OGL @SDL_VIDEO_VITA_PVR_OGL@
#if !defined(__WIN32__) && !defined(__WINRT__)
# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
typedef unsigned int size_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
# endif /* if (stdint.h isn't available) */
#else /* __WIN32__ */
# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__CODEGEARC__)
#define HAVE_STDINT_H 1
# elif defined(_MSC_VER)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
# ifndef _UINTPTR_T_DEFINED
# ifdef _WIN64
typedef unsigned __int64 uintptr_t;
# else
typedef unsigned int uintptr_t;
# endif
#define _UINTPTR_T_DEFINED
# endif
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
# endif
# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG
# endif
# else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
# ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
# endif
typedef unsigned int uintptr_t;
# endif /* __GNUC__ || _MSC_VER */
# endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#endif /* __WIN32__ */
#endif /* SDL_config_h_ */
-491
View File
@@ -1,491 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_config_h_
#define SDL_config_h_
/**
* \file SDL_config.h.in
*
* This is a set of defines to configure the SDL features
*/
/* General platform specific identifiers */
#include "SDL_platform.h"
/* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER
#error You should run git checkout -f include/SDL_config.h
#endif
/* C language features */
#undef const
#undef inline
#undef volatile
/* C datatypes */
#if defined(__LP64__) || defined(_LP64) || defined(_WIN64)
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#undef HAVE_GCC_ATOMICS
#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET
/* Comment this if you want to build without any C library requirements */
#undef HAVE_LIBC
#if HAVE_LIBC
/* Useful headers */
#undef STDC_HEADERS
#undef HAVE_ALLOCA_H
#undef HAVE_CTYPE_H
#undef HAVE_FLOAT_H
#undef HAVE_ICONV_H
#undef HAVE_INTTYPES_H
#undef HAVE_LIMITS_H
#undef HAVE_MALLOC_H
#undef HAVE_MATH_H
#undef HAVE_MEMORY_H
#undef HAVE_SIGNAL_H
#undef HAVE_STDARG_H
#undef HAVE_STDINT_H
#undef HAVE_STDIO_H
#undef HAVE_STDLIB_H
#undef HAVE_STRINGS_H
#undef HAVE_STRING_H
#undef HAVE_SYS_TYPES_H
#undef HAVE_WCHAR_H
#undef HAVE_PTHREAD_NP_H
#undef HAVE_LIBUNWIND_H
/* C library functions */
#undef HAVE_DLOPEN
#undef HAVE_MALLOC
#undef HAVE_CALLOC
#undef HAVE_REALLOC
#undef HAVE_FREE
#undef HAVE_ALLOCA
#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
#undef HAVE_GETENV
#undef HAVE_SETENV
#undef HAVE_PUTENV
#undef HAVE_UNSETENV
#endif
#undef HAVE_QSORT
#undef HAVE_ABS
#undef HAVE_BCOPY
#undef HAVE_MEMSET
#undef HAVE_MEMCPY
#undef HAVE_MEMMOVE
#undef HAVE_MEMCMP
#undef HAVE_WCSLEN
#undef HAVE_WCSLCPY
#undef HAVE_WCSLCAT
#undef HAVE__WCSDUP
#undef HAVE_WCSDUP
#undef HAVE_WCSSTR
#undef HAVE_WCSCMP
#undef HAVE_WCSNCMP
#undef HAVE_WCSCASECMP
#undef HAVE__WCSICMP
#undef HAVE_WCSNCASECMP
#undef HAVE__WCSNICMP
#undef HAVE_STRLEN
#undef HAVE_STRLCPY
#undef HAVE_STRLCAT
#undef HAVE__STRREV
#undef HAVE__STRUPR
#undef HAVE__STRLWR
#undef HAVE_INDEX
#undef HAVE_RINDEX
#undef HAVE_STRCHR
#undef HAVE_STRRCHR
#undef HAVE_STRSTR
#undef HAVE_STRTOK_R
#undef HAVE_ITOA
#undef HAVE__LTOA
#undef HAVE__UITOA
#undef HAVE__ULTOA
#undef HAVE_STRTOL
#undef HAVE_STRTOUL
#undef HAVE__I64TOA
#undef HAVE__UI64TOA
#undef HAVE_STRTOLL
#undef HAVE_STRTOULL
#undef HAVE_STRTOD
#undef HAVE_ATOI
#undef HAVE_ATOF
#undef HAVE_STRCMP
#undef HAVE_STRNCMP
#undef HAVE__STRICMP
#undef HAVE_STRCASECMP
#undef HAVE__STRNICMP
#undef HAVE_STRNCASECMP
#undef HAVE_SSCANF
#undef HAVE_VSSCANF
#undef HAVE_SNPRINTF
#undef HAVE_VSNPRINTF
#undef HAVE_M_PI
#undef HAVE_ACOS
#undef HAVE_ACOSF
#undef HAVE_ASIN
#undef HAVE_ASINF
#undef HAVE_ATAN
#undef HAVE_ATANF
#undef HAVE_ATAN2
#undef HAVE_ATAN2F
#undef HAVE_CEIL
#undef HAVE_CEILF
#undef HAVE_COPYSIGN
#undef HAVE_COPYSIGNF
#undef HAVE_COS
#undef HAVE_COSF
#undef HAVE_EXP
#undef HAVE_EXPF
#undef HAVE_FABS
#undef HAVE_FABSF
#undef HAVE_FLOOR
#undef HAVE_FLOORF
#undef HAVE_FMOD
#undef HAVE_FMODF
#undef HAVE_LOG
#undef HAVE_LOGF
#undef HAVE_LOG10
#undef HAVE_LOG10F
#undef HAVE_LROUND
#undef HAVE_LROUNDF
#undef HAVE_POW
#undef HAVE_POWF
#undef HAVE_ROUND
#undef HAVE_ROUNDF
#undef HAVE_SCALBN
#undef HAVE_SCALBNF
#undef HAVE_SIN
#undef HAVE_SINF
#undef HAVE_SQRT
#undef HAVE_SQRTF
#undef HAVE_TAN
#undef HAVE_TANF
#undef HAVE_TRUNC
#undef HAVE_TRUNCF
#undef HAVE_FOPEN64
#undef HAVE_FSEEKO
#undef HAVE_FSEEKO64
#undef HAVE_SIGACTION
#undef HAVE_SA_SIGACTION
#undef HAVE_SETJMP
#undef HAVE_NANOSLEEP
#undef HAVE_SYSCONF
#undef HAVE_SYSCTLBYNAME
#undef HAVE_CLOCK_GETTIME
#undef HAVE_GETPAGESIZE
#undef HAVE_MPROTECT
#undef HAVE_ICONV
#undef HAVE_PTHREAD_SETNAME_NP
#undef HAVE_PTHREAD_SET_NAME_NP
#undef HAVE_SEM_TIMEDWAIT
#undef HAVE_GETAUXVAL
#undef HAVE_ELF_AUX_INFO
#undef HAVE_POLL
#undef HAVE__EXIT
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#endif /* HAVE_LIBC */
#undef HAVE_O_CLOEXEC
#undef HAVE_ALTIVEC_H
#undef HAVE_DBUS_DBUS_H
#undef HAVE_FCITX
#undef HAVE_SYS_INOTIFY_H
#undef HAVE_INOTIFY_INIT
#undef HAVE_INOTIFY_INIT1
#undef HAVE_INOTIFY
#undef HAVE_IBUS_IBUS_H
#undef HAVE_IMMINTRIN_H
#undef HAVE_LIBUDEV_H
#undef HAVE_LIBSAMPLERATE_H
#undef HAVE_LIBDECOR_H
#undef HAVE_DDRAW_H
#undef HAVE_DINPUT_H
#undef HAVE_DSOUND_H
#undef HAVE_DXGI_H
#undef HAVE_WINDOWS_GAMING_INPUT_H
#undef HAVE_XINPUT_H
#undef HAVE_XINPUT_GAMEPAD_EX
#undef HAVE_XINPUT_STATE_EX
#undef HAVE_MMDEVICEAPI_H
#undef HAVE_AUDIOCLIENT_H
#undef HAVE_TPCSHRD_H
#undef HAVE_SENSORSAPI_H
#undef HAVE_ROAPI_H
/* SDL internal assertion support */
#undef SDL_DEFAULT_ASSERT_LEVEL
/* Allow disabling of core subsystems */
#undef SDL_ATOMIC_DISABLED
#undef SDL_AUDIO_DISABLED
#undef SDL_CPUINFO_DISABLED
#undef SDL_EVENTS_DISABLED
#undef SDL_FILE_DISABLED
#undef SDL_JOYSTICK_DISABLED
#undef SDL_HAPTIC_DISABLED
#undef SDL_HIDAPI_DISABLED
#undef SDL_SENSOR_DISABLED
#undef SDL_LOADSO_DISABLED
#undef SDL_RENDER_DISABLED
#undef SDL_THREADS_DISABLED
#undef SDL_TIMERS_DISABLED
#undef SDL_VIDEO_DISABLED
#undef SDL_POWER_DISABLED
#undef SDL_FILESYSTEM_DISABLED
#undef SDL_LOCALE_DISABLED
#undef SDL_MISC_DISABLED
/* Enable various audio drivers */
#undef SDL_AUDIO_DRIVER_AAUDIO
#undef SDL_AUDIO_DRIVER_ALSA
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#undef SDL_AUDIO_DRIVER_ANDROID
#undef SDL_AUDIO_DRIVER_ARTS
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_DISK
#undef SDL_AUDIO_DRIVER_DSOUND
#undef SDL_AUDIO_DRIVER_DUMMY
#undef SDL_AUDIO_DRIVER_EMSCRIPTEN
#undef SDL_AUDIO_DRIVER_ESD
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#undef SDL_AUDIO_DRIVER_FUSIONSOUND
#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
#undef SDL_AUDIO_DRIVER_HAIKU
#undef SDL_AUDIO_DRIVER_JACK
#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC
#undef SDL_AUDIO_DRIVER_NACL
#undef SDL_AUDIO_DRIVER_NAS
#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
#undef SDL_AUDIO_DRIVER_NETBSD
#undef SDL_AUDIO_DRIVER_OPENSLES
#undef SDL_AUDIO_DRIVER_OSS
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
#undef SDL_AUDIO_DRIVER_PAUDIO
#undef SDL_AUDIO_DRIVER_PIPEWIRE
#undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC
#undef SDL_AUDIO_DRIVER_PULSEAUDIO
#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
#undef SDL_AUDIO_DRIVER_QSA
#undef SDL_AUDIO_DRIVER_SNDIO
#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
#undef SDL_AUDIO_DRIVER_SUNAUDIO
#undef SDL_AUDIO_DRIVER_WASAPI
#undef SDL_AUDIO_DRIVER_WINMM
#undef SDL_AUDIO_DRIVER_OS2
/* Enable various input drivers */
#undef SDL_INPUT_LINUXEV
#undef SDL_INPUT_FBSDKBIO
#undef SDL_INPUT_LINUXKD
#undef SDL_INPUT_WSCONS
#undef SDL_JOYSTICK_HAIKU
#undef SDL_JOYSTICK_DINPUT
#undef SDL_JOYSTICK_WGI
#undef SDL_JOYSTICK_XINPUT
#undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT
#undef SDL_JOYSTICK_MFI
#undef SDL_JOYSTICK_LINUX
#undef SDL_JOYSTICK_ANDROID
#undef SDL_JOYSTICK_OS2
#undef SDL_JOYSTICK_USBHID
#undef SDL_HAVE_MACHINE_JOYSTICK_H
#undef SDL_JOYSTICK_HIDAPI
#undef SDL_JOYSTICK_RAWINPUT
#undef SDL_JOYSTICK_EMSCRIPTEN
#undef SDL_JOYSTICK_VIRTUAL
#undef SDL_HAPTIC_DUMMY
#undef SDL_HAPTIC_ANDROID
#undef SDL_HAPTIC_LINUX
#undef SDL_HAPTIC_IOKIT
#undef SDL_HAPTIC_DINPUT
#undef SDL_HAPTIC_XINPUT
/* Enable various sensor drivers */
#undef SDL_SENSOR_ANDROID
#undef SDL_SENSOR_COREMOTION
#undef SDL_SENSOR_WINDOWS
#undef SDL_SENSOR_DUMMY
/* Enable various shared object loading systems */
#undef SDL_LOADSO_DLOPEN
#undef SDL_LOADSO_DUMMY
#undef SDL_LOADSO_LDG
#undef SDL_LOADSO_WINDOWS
#undef SDL_LOADSO_OS2
/* Enable various threading systems */
#undef SDL_THREAD_GENERIC_COND_SUFFIX
#undef SDL_THREAD_PTHREAD
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
#undef SDL_THREAD_WINDOWS
#undef SDL_THREAD_OS2
/* Enable various timer systems */
#undef SDL_TIMER_HAIKU
#undef SDL_TIMER_DUMMY
#undef SDL_TIMER_UNIX
#undef SDL_TIMER_WINDOWS
#undef SDL_TIMER_OS2
/* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_HAIKU
#undef SDL_VIDEO_DRIVER_COCOA
#undef SDL_VIDEO_DRIVER_DIRECTFB
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
#undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_WINDOWS
#undef SDL_VIDEO_DRIVER_WAYLAND
#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
#undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_RPI
#undef SDL_VIDEO_DRIVER_KMSDRM
#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC
#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM
#undef SDL_VIDEO_DRIVER_ANDROID
#undef SDL_VIDEO_DRIVER_EMSCRIPTEN
#undef SDL_VIDEO_DRIVER_OFFSCREEN
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
#undef SDL_VIDEO_DRIVER_X11_XCURSOR
#undef SDL_VIDEO_DRIVER_X11_XDBE
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
#undef SDL_VIDEO_DRIVER_X11_XINPUT2
#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
#undef SDL_VIDEO_DRIVER_X11_XFIXES
#undef SDL_VIDEO_DRIVER_X11_XRANDR
#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER
#undef SDL_VIDEO_DRIVER_X11_XSHAPE
#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
#undef SDL_VIDEO_DRIVER_NACL
#undef SDL_VIDEO_DRIVER_VIVANTE
#undef SDL_VIDEO_DRIVER_VIVANTE_VDK
#undef SDL_VIDEO_DRIVER_OS2
#undef SDL_VIDEO_DRIVER_QNX
#undef SDL_VIDEO_DRIVER_RISCOS
#undef SDL_VIDEO_RENDER_D3D
#undef SDL_VIDEO_RENDER_D3D11
#undef SDL_VIDEO_RENDER_OGL
#undef SDL_VIDEO_RENDER_OGL_ES
#undef SDL_VIDEO_RENDER_OGL_ES2
#undef SDL_VIDEO_RENDER_DIRECTFB
#undef SDL_VIDEO_RENDER_METAL
/* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL
#undef SDL_VIDEO_OPENGL_ES
#undef SDL_VIDEO_OPENGL_ES2
#undef SDL_VIDEO_OPENGL_BGL
#undef SDL_VIDEO_OPENGL_CGL
#undef SDL_VIDEO_OPENGL_EGL
#undef SDL_VIDEO_OPENGL_GLX
#undef SDL_VIDEO_OPENGL_WGL
#undef SDL_VIDEO_OPENGL_OSMESA
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
/* Enable Vulkan support */
#undef SDL_VIDEO_VULKAN
/* Enable Metal support */
#undef SDL_VIDEO_METAL
/* Enable system power support */
#undef SDL_POWER_LINUX
#undef SDL_POWER_WINDOWS
#undef SDL_POWER_MACOSX
#undef SDL_POWER_HAIKU
#undef SDL_POWER_ANDROID
#undef SDL_POWER_EMSCRIPTEN
#undef SDL_POWER_HARDWIRED
/* Enable system filesystem support */
#undef SDL_FILESYSTEM_ANDROID
#undef SDL_FILESYSTEM_HAIKU
#undef SDL_FILESYSTEM_COCOA
#undef SDL_FILESYSTEM_DUMMY
#undef SDL_FILESYSTEM_RISCOS
#undef SDL_FILESYSTEM_UNIX
#undef SDL_FILESYSTEM_WINDOWS
#undef SDL_FILESYSTEM_NACL
#undef SDL_FILESYSTEM_EMSCRIPTEN
#undef SDL_FILESYSTEM_OS2
#undef SDL_FILESYSTEM_VITA
#undef SDL_FILESYSTEM_PSP
/* Enable misc subsystem */
#undef SDL_MISC_DUMMY
/* Enable locale subsystem */
#undef SDL_LOCALE_DUMMY
/* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES
#undef SDL_ALTIVEC_BLITTERS
#undef SDL_ARM_SIMD_BLITTERS
#undef SDL_ARM_NEON_BLITTERS
/* Whether SDL_DYNAMIC_API needs dlopen() */
#undef DYNAPI_NEEDS_DLOPEN
/* Enable ime support */
#undef SDL_USE_IME
/* Enable dynamic udev support */
#undef SDL_UDEV_DYNAMIC
/* Enable dynamic libusb support */
#undef SDL_LIBUSB_DYNAMIC
/* Enable dynamic libsamplerate support */
#undef SDL_LIBSAMPLERATE_DYNAMIC
#endif /* SDL_config_h_ */
@@ -1,192 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_config_android_h_
#define SDL_config_android_h_
#define SDL_config_h_
#include "SDL_platform.h"
/**
* \file SDL_config_android.h
*
* This is a configuration that can be used to build SDL for Android
*/
#include <stdarg.h>
#define HAVE_GCC_ATOMICS 1
#define STDC_HEADERS 1
#define HAVE_ALLOCA_H 1
#define HAVE_CTYPE_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TYPES_H 1
/* C library functions */
#define HAVE_DLOPEN 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_SETENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
#define HAVE_ASINF 1
#define HAVE_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1
#define HAVE_ATAN2F 1
#define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_LROUND 1
#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_CLOCK_GETTIME 1
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_ANDROID 1
#define SDL_AUDIO_DRIVER_OPENSLES 1
#define SDL_AUDIO_DRIVER_AAUDIO 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_ANDROID 1
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_JOYSTICK_VIRTUAL 1
#define SDL_HAPTIC_ANDROID 1
/* Enable sensor driver */
#define SDL_SENSOR_ANDROID 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_ANDROID 1
/* Enable OpenGL ES */
#define SDL_VIDEO_OPENGL_ES 1
#define SDL_VIDEO_OPENGL_ES2 1
#define SDL_VIDEO_OPENGL_EGL 1
#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES2 1
/* Enable Vulkan support */
/* Android does not support Vulkan in native code using the "armeabi" ABI. */
#if defined(__ARM_ARCH) && __ARM_ARCH < 7
#define SDL_VIDEO_VULKAN 0
#else
#define SDL_VIDEO_VULKAN 1
#endif
/* Enable system power support */
#define SDL_POWER_ANDROID 1
/* Enable the filesystem driver */
#define SDL_FILESYSTEM_ANDROID 1
#endif /* SDL_config_android_h_ */
@@ -1,217 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _SDL_config_emscripten_h_
#define _SDL_config_emscripten_h_
#include "SDL_platform.h"
/**
* \file SDL_config_emscripten.h
*
* This is a configuration that can be used to build SDL for Emscripten.
*/
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#define HAVE_GCC_ATOMICS 1
/* Useful headers */
#define STDC_HEADERS 1
#define HAVE_ALLOCA_H 1
#define HAVE_CTYPE_H 1
#define HAVE_ICONV_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MATH_H 1
#define HAVE_MEMORY_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDARG_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_WCHAR_H 1
/* C library functions */
#define HAVE_DLOPEN 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_WCSLEN 1
#define HAVE_WCSDUP 1
#define HAVE_WCSSTR 1
#define HAVE_WCSCMP 1
#define HAVE_WCSNCMP 1
#define HAVE_WCSCASECMP 1
#define HAVE_WCSNCASECMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
#define HAVE_ASINF 1
#define HAVE_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1
#define HAVE_ATAN2F 1
#define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_LROUND 1
#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_FSEEKO 1
#define HAVE_FSEEKO64 1
#define HAVE_SIGACTION 1
#define HAVE_SA_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_CLOCK_GETTIME 1
/* #undef HAVE_GETPAGESIZE */
#define HAVE_MPROTECT 1
#define HAVE_ICONV 1
/* SDL internal assertion support */
/* #undef SDL_DEFAULT_ASSERT_LEVEL */
#define SDL_CPUINFO_DISABLED 1
#define SDL_HAPTIC_DISABLED 1
#define SDL_HIDAPI_DISABLED 1
#ifndef __EMSCRIPTEN_PTHREADS__
#define SDL_THREADS_DISABLED 1
#endif
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1
/* Enable various input drivers */
#define SDL_JOYSTICK_EMSCRIPTEN 1
/* Enable various sensor drivers */
#define SDL_SENSOR_DUMMY 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1
/* Enable various threading systems */
#ifdef __EMSCRIPTEN_PTHREADS__
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
#endif
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_EMSCRIPTEN 1
#define SDL_VIDEO_RENDER_OGL_ES2 1
/* Enable OpenGL support */
/* #undef SDL_VIDEO_OPENGL */
/* #undef SDL_VIDEO_OPENGL_ES */
#define SDL_VIDEO_OPENGL_ES2 1
/* #undef SDL_VIDEO_OPENGL_BGL */
/* #undef SDL_VIDEO_OPENGL_CGL */
/* #undef SDL_VIDEO_OPENGL_GLX */
/* #undef SDL_VIDEO_OPENGL_WGL */
#define SDL_VIDEO_OPENGL_EGL 1
/* #undef SDL_VIDEO_OPENGL_OSMESA */
/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
/* Enable system power support */
#define SDL_POWER_EMSCRIPTEN 1
/* Enable system filesystem support */
#define SDL_FILESYSTEM_EMSCRIPTEN 1
#endif /* _SDL_config_emscripten_h_ */
@@ -1,215 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_config_iphoneos_h_
#define SDL_config_iphoneos_h_
#define SDL_config_h_
#include "SDL_platform.h"
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
#define HAVE_GCC_ATOMICS 1
#define STDC_HEADERS 1
#define HAVE_ALLOCA_H 1
#define HAVE_CTYPE_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TYPES_H 1
/* The libunwind functions are only available on x86 */
/* #undef HAVE_LIBUNWIND_H */
/* C library functions */
#define HAVE_DLOPEN 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_SETENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
#define HAVE_ASINF 1
#define HAVE_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1
#define HAVE_ATAN2F 1
#define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_LROUND 1
#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1
#define HAVE_O_CLOEXEC 1
/* enable iPhone version of Core Audio driver */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
#define SDL_HAPTIC_DUMMY 1
/* Enable joystick support */
/* Only enable HIDAPI support if you want to support Steam Controllers on iOS and tvOS */
/*#define SDL_JOYSTICK_HIDAPI 1*/
#define SDL_JOYSTICK_MFI 1
#define SDL_JOYSTICK_VIRTUAL 1
#ifdef __TVOS__
#define SDL_SENSOR_DUMMY 1
#else
/* Enable the CoreMotion sensor driver */
#define SDL_SENSOR_COREMOTION 1
#endif
/* Enable Unix style SO loading */
#define SDL_LOADSO_DLOPEN 1
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Supported video drivers */
#define SDL_VIDEO_DRIVER_UIKIT 1
#define SDL_VIDEO_DRIVER_DUMMY 1
/* Enable OpenGL ES */
#if !TARGET_OS_MACCATALYST
#define SDL_VIDEO_OPENGL_ES2 1
#define SDL_VIDEO_OPENGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer
Also supported in simulator from iOS 13.0 and tvOS 13.0
*/
#if (TARGET_OS_SIMULATOR && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (__TV_OS_VERSION_MIN_REQUIRED >= 130000))) || (!TARGET_CPU_ARM && ((__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 90000)))
#define SDL_PLATFORM_SUPPORTS_METAL 1
#else
#define SDL_PLATFORM_SUPPORTS_METAL 0
#endif
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_RENDER_METAL 1
#endif
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_VULKAN 1
#endif
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_METAL 1
#endif
/* Enable system power support */
#define SDL_POWER_UIKIT 1
/* enable iPhone keyboard support */
#define SDL_IPHONE_KEYBOARD 1
/* enable iOS extended launch screen */
#define SDL_IPHONE_LAUNCHSCREEN 1
/* enable filesystem support */
#define SDL_FILESYSTEM_COCOA 1
#endif /* SDL_config_iphoneos_h_ */
@@ -1,280 +0,0 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_config_macosx_h_
#define SDL_config_macosx_h_
#define SDL_config_h_
#include "SDL_platform.h"
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
#include <AvailabilityMacros.h>
/* This is a set of defines to configure the SDL features */
#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif
/* Useful headers */
#define STDC_HEADERS 1
#define HAVE_ALLOCA_H 1
#define HAVE_CTYPE_H 1
#define HAVE_FLOAT_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_LIBUNWIND_H 1
/* C library functions */
#define HAVE_DLOPEN 1
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_SETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_M_PI 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
#define HAVE_ASINF 1
#define HAVE_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1
#define HAVE_ATAN2F 1
#define HAVE_CEIL 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGN 1
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_LROUND 1
#define HAVE_LROUNDF 1
#define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE_SIGACTION 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_SYSCTLBYNAME 1
#if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
# if __has_include(<immintrin.h>)
# define HAVE_IMMINTRIN_H 1
# endif
#endif
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
#define HAVE_O_CLOEXEC 1
#endif
#define HAVE_GCC_ATOMICS 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_JOYSTICK_IOKIT 1
#define SDL_JOYSTICK_VIRTUAL 1
#define SDL_HAPTIC_IOKIT 1
/* The MFI controller support requires ARC Objective C runtime */
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)
#define SDL_JOYSTICK_MFI 1
#endif
/* Enable the dummy sensor driver */
#define SDL_SENSOR_DUMMY 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1
/* Enable various threading systems */
#define SDL_THREAD_PTHREAD 1
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
/* Enable various timer systems */
#define SDL_TIMER_UNIX 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_COCOA 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#undef SDL_VIDEO_DRIVER_X11
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/opt/X11/lib/libXinerama.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib"
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/opt/X11/lib/libXxf86vm.1.dylib"
#define SDL_VIDEO_DRIVER_X11_XDBE 1
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
#ifdef MAC_OS_X_VERSION_10_8
/*
* No matter the versions targeted, this is the 10.8 or later SDK, so you have
* to use the external Xquartz, which is a more modern Xlib. Previous SDKs
* used an older Xlib.
*/
#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
#endif
#ifndef SDL_VIDEO_RENDER_OGL
#define SDL_VIDEO_RENDER_OGL 1
#endif
#ifndef SDL_VIDEO_RENDER_OGL_ES2
#define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
/* Metal only supported on 64-bit architectures with 10.11+ */
#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
#define SDL_PLATFORM_SUPPORTS_METAL 1
#else
#define SDL_PLATFORM_SUPPORTS_METAL 0
#endif
#ifndef SDL_VIDEO_RENDER_METAL
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_RENDER_METAL 1
#else
#define SDL_VIDEO_RENDER_METAL 0
#endif
#endif
/* Enable OpenGL support */
#ifndef SDL_VIDEO_OPENGL
#define SDL_VIDEO_OPENGL 1
#endif
#ifndef SDL_VIDEO_OPENGL_ES2
#define SDL_VIDEO_OPENGL_ES2 1
#endif
#ifndef SDL_VIDEO_OPENGL_EGL
#define SDL_VIDEO_OPENGL_EGL 1
#endif
#ifndef SDL_VIDEO_OPENGL_CGL
#define SDL_VIDEO_OPENGL_CGL 1
#endif
#ifndef SDL_VIDEO_OPENGL_GLX
#define SDL_VIDEO_OPENGL_GLX 1
#endif
/* Enable Vulkan and Metal support */
#ifndef SDL_VIDEO_VULKAN
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_VULKAN 1
#else
#define SDL_VIDEO_VULKAN 0
#endif
#endif
#ifndef SDL_VIDEO_METAL
#if SDL_PLATFORM_SUPPORTS_METAL
#define SDL_VIDEO_METAL 1
#else
#define SDL_VIDEO_METAL 0
#endif
#endif
/* Enable system power support */
#define SDL_POWER_MACOSX 1
/* enable filesystem support */
#define SDL_FILESYSTEM_COCOA 1
/* Enable assembly routines */
#define SDL_ASSEMBLY_ROUTINES 1
#ifdef __ppc__
#define SDL_ALTIVEC_BLITTERS 1
#endif
#endif /* SDL_config_macosx_h_ */
Loaded 100 of 2047 files, more files were not shown because too many files have changed in this diff. Show more