Compare commits

...
Author SHA1 Message Date
the-eandClaude Sonnet 5.5 c5b761ca5d Apply review feedback on softer shadows
- Bind the GL raw-depth sampler on unit 11 in the deferred pass and
  unbind it after the pass.
- Enable RTAO only when shadows are on, and remove the RTAO option when
  ray tracing is not supported.
- Use every second Poisson tap in the PCSS blocker search.
- Use TLAS-relative ray origins for RTAO.
- Gate +AngularSize: at version 27.0.
- Measure an .eff sun from its first frame, and skip the measurement
  when shadows are off.
- Guard the GL 3.3 sampler check for GLES builds.
- Restore the lab session overrides when the lab closes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-07 19:45:48 +01:00
the-e 9443c4abe0 Add shadow contact hardening via PCSS blocker search
The shadow-mapped path's penumbra width was a fixed per-cascade value
(shadow_smoothness_scale()'s ceiling), so every occluder blurred its
shadow by the same amount regardless of how close it actually was to
the receiver -- unlike the raytraced path, which gets that for free
from traceShadowRayCone()'s real occluder distance. Close that gap
with PCSS: search nearby texels for occluders, then scale the filter
radius by how far away they were.

The blocker search (pcssBlockerSearch() in shadows.sdr) needs raw,
uncompared depth reads, which the existing PCF sampler can't do -- it's
bound with a compare mode for the hardware shadow-compare instructions
the filtered sampling itself relies on. So shadow maps now get a second
sampler, shadow_map_raw, bound to the same texture with compare mode
off; on OpenGL that needs a second sampler object and GL 3.3
(shadow_contact_hardening_supported()), Vulkan can always bind it.
Where the raw sampler isn't available, or the new Graphics.ShadowContactHardening
option is off, shadows_start_render() sets Shadow_penumbra_scale[cascade]
to -1 as a sentinel and pcssPenumbraRadius() (shadows.sdr) falls straight
back to the fixed radius, bit-identical to the pre-contact-hardening
behavior and skipping the extra texture reads.

When it is on, shadows_start_render() computes each cascade's penumbra
scale from its own frustum extents and the sun's tanθ; the shader turns
that plus the blocker search's average depth into a per-pixel radius,
clamped to [1 texel, the old fixed ceiling]. A blocker search that finds
nothing doesn't fall back to "no shadow" -- a sparse 8-tap search can
miss a thin occluder, so it instead runs the full filter at the hardest
(1-texel) radius, trading a touch of extra blur for not popping a real
shadow to nothing.

Drops RT_SHADOW_SUN_SIZE_CALIBRATION accordingly: that constant existed
only to fake a blocker-distance-driven penumbra on the shadow-mapped path
by pre-scaling the raytraced cone to match it, and the shadow-mapped path
now has a real blocker search of its own, so the raytraced cone goes back
to its physically correct size.
2026-11-07 19:45:48 +01:00
the-eandClaude Opus 5 5e745f7535 Add RTAO and unify raytraced/shadow-mapped shadow softness on sun angular size
Raytraced shadow penumbras needed a hand-authored $SunAngularSize: in
stars.tbl, which no shipped content sets -- so in practice nothing ever
got a penumbra, and the shadow-mapped path's $Shadow Smoothness Factor:
had no relation to it at all. Derive a size from the sun bitmap instead
and drive both methods from the same number.

g3_render_rect_screen_aligned_2d() sizes the sun quad so its rad is the
tangent of the half-angle it subtends, making tan(angular radius) equal
to 0.05 * the mission's +Scale: * the emitting disc's fraction of the
bitmap. That fraction is the area of the pixels at or above 90% of the
brightest one, converted to an equivalent radius. Across 90 sun bitmaps
from retail, the MediaVPs, Blue Planet and BtA it lands at a median of
0.261 (retail's chunkier art at 0.487), and the threshold acts as a
constant factor rather than a per-bitmap judgement call -- Spearman rho
0.96 between a 90% and a 50% cutoff.

Taken literally that yields suns 3.9-8.5x Sol's apparent diameter once
+Scale: is folded in (median 1.55, up to 5.0 in retail's own missions),
so the measurement is scaled by 0.25 and clamped to 1.5 degrees, putting
typical content near Sol. Derivation is the default: $SunAngularSize: 0
asks for hard shadows, an explicit value still wins, and missions can
also set +AngularSize: on an individual sun to override both, with FRED
and QtFRED UI (validation and fallback included) to author it. Bitmaps
that can't be read -- and the deliberately blank sun bitmaps mods ship
to get a light source with no visible disc -- fall back to hard shadows
rather than to the widest possible penumbra.

That angular size now sizes the raytraced penumbra cone directly
(traceShadowRayCone() in shadows.sdr), with sample count following the
same Shadow_quality tier that picks the shadow map's resolution (1 ray
at Low, up to 16 at Ultra) rather than being a separate setting. The
shadow-mapped path's tabled smoothness values were tuned by eye against
Sol-sized retail/MediaVPs art, so shadow_smoothness_scale() in
shadows.cpp scales them by the active sun's size relative to Sol,
clamped to what the shadow map can represent (shadow_clamp_smoothness()).
The two methods still disagree about occluder distance -- the raytracer
uses the real one, the shadow map's tabled values stand in for a blocker
distance pinned to the cascade's own extent -- so RT_SHADOW_SUN_SIZE_CALIBRATION
in shadows.sdr is a constant factor that makes a given $SunAngularSize:
read as roughly the same softness either way; it's the number to revisit
if the shadow map ever grows a real blocker search.

Also adds RTAO (raytraced ambient occlusion) sharing the same TLAS as
the shadow rays, with lighting-profile-driven radius/strength, and lab
controls for RT shadow quality (Low/High), the local light cap, RT
shadow samples, RTAO, and an angular-size override for comparing both
shadow methods against the same sun. All are safe to change live: they
only gate which lights are picked as shadow casters or scale existing
uniforms while filling the per-frame light data.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-07 19:45:47 +01:00
the-eandClaude Opus 5.5 c165b82996 Address third round of review feedback on the profiler overlay
- Move the overlay option strings to XSTR 1940 and 1941. The touch
  overlay on master uses 1936 to 1939.
- Give FrameProfiler the main thread ID when it is made. Before, it
  used the thread of the first event, which was a race.
- Let mouse motion go to the game while the pointer is over the
  overlay, so that mouse flight does not stop there.
- Find the dynamic bindings of the PerDraw key with
  dynamic_offset_slot(), as the other call sites do.
- Make disable_inside_open_scope count the GPU timestamp queries, so
  that it fails if end() does not close the GPU event.
- Make the copy test copy the category, not bind a reference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:36:52 +01:00
Fabian WoltermannandClaude Opus 5.5 4f3a0d4cff Return size_t from Category::getCount() and tidy the registry code
- Use structured bindings and std::scoped_lock in the category registry.
- Return size_t from getCount() and update its callers and tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:36:42 +01:00
Fabian WoltermannandClaude Opus 5.5 8266392f00 Address second round of review feedback on the profiler overlay
- Make the category registry thread-safe and give categories with the
  same name one id, so the registry does not grow without limit.
- Add tests that toggle the profiler inside an open trace scope.
- Correct the next free XSTR id note to 1938.
- Use the existing Windows include block for psapi.h in osapi.cpp.
- Use list_range in ship_get_num_ships() and shorten some comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:36:42 +01:00
the-eandClaude Sonnet 5.5 68166ed419 Use wall-clock frame time and read the history without a copy
The Avg and FPS line used traced self-time, which reads too high.
Measure the time between overlay frames instead. Draw the graph with
PlotLineG so the history deque needs no per-frame copy.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-07 19:36:31 +01:00
the-eandClaude Sonnet 5.5 fa4b755b94 Address review feedback on the profiler overlay
Skip complete::end for a scope that did not start. This fixes a crash
when Lua turns the overlay on while a scope is open. Track the GPU begin
event so that turning the overlay off mid-scope still closes it.

Use XSTR 1936 and 1937 for the overlay option. Master now uses 1932
and 1933.

Remove the default value of dynamicOffsets in bindDescriptorSet. Use the
PerDraw binding constants in the PerDraw key.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-07 19:36:31 +01:00
the-e b5bcfeb8d1 Refactor profiler overlay to use snapshot-based frame timing 2026-11-07 19:36:31 +01:00
the-e b1c90ea5c5 Replace category pointers with IDs to prevent use-after-free
- Updated `trace_event` to store `category_id` instead of a pointer to prevent dangling references to category objects that may already be destroyed.
- Modified all references to category names to use `Category::getNameById()` instead of dereferencing pointers.
- Expanded memory statistics in the profiler overlay with new sound, Lua, and OS-level memory usage tracking.
- Added new tests to verify proper use of category IDs in frame profiling and event tracing.
- Improved memory safety and stability across tracing, profiling, and overlay systems.
2026-11-07 19:36:31 +01:00
the-eandClaude Opus 5 dd4a08925c Fix profiler overlay crash on a category that is not a static
The category registry kept a Category pointer for each id. The comment said that all categories
are global statics, but that is not correct. The Lua API tracing_category constructs a Category
and copies it into a script-owned object. The registry then kept a pointer to the dead temporary.
build_overlay_snapshot called getName() on that pointer, made an SCP_string from the garbage
char*, and the process stopped with SIGABRT.

The registry now keeps the name by value and never keeps a Category pointer. getById() becomes
getNameById(), which is all that build_overlay_snapshot needs. A copy of a Category keeps the id
of the original, which stays correct because the id only selects a name.

Add two tests: one shows that the name stays available after the Category object is dead, and one
drives the full path that failed, from processEvent to the overlay snapshot.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-07 19:36:13 +01:00
the-eandClaude Opus 5 647554e182 Add OpenGL memory statistics to the profiler overlay
The memory panel showed no texture bytes and no geometry bytes under
OpenGL. Only the depth renderbuffers went into the render target group.
All three groups now give a value.

Textures: GL_texture_bytes_used holds the bytes of every live texture
cache slot. opengl_texture_release_bytes() removes the bytes of a slot at
each site that drops its texture data. The bitmap render targets record
the bytes of their color texture.

Geometry: the unused GL_vertex_data_in global becomes
GL_geometry_bytes_used, which counts only vertex and index buffers. This
matches the geometry group of the Vulkan backend.
gr_opengl_delete_buffer() sets the size of the buffer to 0, because
opengl_destroy_all_buffers() calls it a second time for a buffer that the
game already deleted.

Render targets: three new functions add the scene textures, the
post-processing textures, and the shadow map to the group. They sum the
bytes at the moment of the call from the textures that exist, thus they
need no bookkeeping at the create and delete sites.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-07 19:36:13 +01:00
the-e 57c28798a7 fix ci issues 2026-11-07 19:36:13 +01:00
the-e 3c456a088c Add memory statistics and tracking to profiler overlay 2026-11-07 19:36:13 +01:00
the-e cd48b5b500 Replace exception with sentinel for non-dynamic Vulkan descriptor bindings
- Introduced `DYNAMIC_SLOT_INVALID` sentinel to replace the throw in `dynamic_offset_slot` for MSVC compatibility.
- Added `static_assert` checks to validate binding constants, ensuring compile-time validation for dynamic offsets.
- Updated comments to clarify design rationale and avoid potential misuse.
2026-11-07 19:36:13 +01:00
Fabian Woltermann f1812e212d Enable VK_KHR_portability_subset for compatibility 2026-11-07 19:36:13 +01:00
the-e 817f641478 Enable primitive restart for supported topologies in Vulkan pipeline
- Added `topologySupportsPrimitiveRestart` to determine restart eligibility for each topology.
- Updated `primitiveRestartEnable` to be conditionally set based on topology, addressing compatibility issues with Metal/MoltenVK.
- Prevented crash scenarios on macOS by ensuring pipelines are valid for strip/fan topologies requiring primitive restart.
2026-11-07 19:36:13 +01:00
the-e eec4a9ce3e Refactor Vulkan descriptor set binding to reduce dynamic offset churn
- Consolidated dynamic descriptor offset logic into `DescriptorWriter::bindSets`, replacing repetitive `vkCmdBindDescriptorSets` patterns across Vulkan modules.
- Eliminated redundant descriptor binding operations for Material and PerDraw sets by centralizing logic in `bindSets`.
- Simplified descriptors by directly splitting offset changes from descriptor contents, avoiding unnecessary updates.
- Updated comments and documentation to align with the new approach while maintaining reference consistency.
- Applied optimizations across Vulkan modules (`VulkanPostProcessing`, `VulkanDescriptorManager`, etc.) to reduce per-draw overhead and improve readability.
2026-11-07 19:36:13 +01:00
the-eandClaude Opus 5 b2de895055 Use dynamic uniform buffers to stop per-draw descriptor set churn in Vulkan
The Material and PerDraw descriptor sets were reallocated and fully rewritten on
essentially every draw call. model_draw_list::render_buffer rebinds ModelData with
a fresh uniform buffer offset for each queued draw, and that offset was part of the
Material set's memoization key, so the cache in VulkanDrawManager::applyMaterial
missed every time - taking a frame-pool allocation, a full template write, the
16-entry material texture resolution and a vkUpdateDescriptorSets with it.
GenericData/Matrices did the same to the PerDraw set. renderShadowDraw was worse
still: all three sets allocated and rewritten per shadow draw, with no memoization
at all.

A large asteroid field (Solaris m21) measured 2566 descriptor sets and 19107
descriptor writes per frame at 1606 model draws, and grew an extra descriptor pool
chunk every frame.

Declare the bindings whose offset moves per draw - MaterialBinding::ModelData,
MaterialBinding::ShadowMapData, PerDrawBinding::GenericData and
PerDrawBinding::Matrices - as eUniformBufferDynamic. DescriptorWriter::setBuffer
now splits a dynamic binding's offset out of the descriptor, writing
{buffer, 0, range} and stashing the offset for vkCmdBindDescriptorSets'
pDynamicOffsets, so an offset-only change leaves the set's contents identical and
the memoization caches start hitting. Shader sources are unchanged.

VulkanStateTracker::bindDescriptorSet now compares the dynamic offsets as well as
the set handle. This is required, not an optimization: the common case is now the
same set rebound with a new offset, and the old handle-only redundancy check would
have skipped that bind and fed every draw the previous draw's uniforms.

renderShadowDraw memoizes its three sets the way applyMaterial does. It does not
invalidate applyMaterial's caches - those record what a set contains, the shadow
pass allocates its own sets rather than overwriting theirs, and it binds through
the state tracker, so the next material cache hit still rebinds correctly.

Also switch allocateFrameSet to the non-allocating allocateDescriptorSets overload;
the vector-returning one heap-allocated once per set, thousands of times a frame.
MAX_SETS_PER_POOL stays at 1024 - the per-frame pool growth it used to log was a
symptom of the churn, and one chunk now covers the scene outright.

Measured on that mission in a Debug build, A/B on the same tree with and without
this change:

  descriptor sets/frame  @ ~1370 draws  2566   -> 250-345
  descriptor writes/frame                19107 -> ~1700-2300
  median frametime                       92.9/83.6 ms -> 72.0/66.5 ms
  Render Buffer (profiler overlay)       24.68 ms (30.8%) -> 12.73 ms (18.4%)
  Build Shadow Map                       5.44 ms -> off the top-5 entirely

Release builds already inlined most of this away and are unchanged, as expected.
Verified with the validation layers (sync validation enabled): no new VUIDs versus
the same build without the change.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-11-07 19:36:13 +01:00
the-e 7d4d61042e Refactor frame profiler to use per-category self-time accumulation
- Introduced `accumulate_self_times` for single-pass exclusive time computation, improving performance and accuracy.
- Updated `FrameProfiler` and overlay snapshot logic to leverage `Category`'s stable `getId` and `getCount`.
- Replaced pie chart with a stacked bar for frame budget visualization, optimizing rendering cost.
- Cached `get_tid` and `get_pid` with thread-local storage to minimize syscall overhead.
- Added support for unit testing frame profiling functionality and included new test cases.
- Improved code comments and clarified documentation.
2026-11-07 19:36:13 +01:00
the-e fd77b84c41 Update ImPlot to v1.1 WIP and improve internal consistency
- Adjust copyright notices for extended license coverage (2025-2026).
- Modernize constants with `constexpr` replacements, improving type safety and clarity.
- Enforce `nullptr` usage over `NULL` throughout, aligning with modern C++ practices.
- Add various enhancements to ImPlot legends, markers, and axes behavior.
- Introduce additional helper methods for time handling and timestamp calculations.
- Address UI and typo improvements in comments and documentation, refining accuracy.
2026-11-07 19:36:13 +01:00
the-e 2166d253a8 Add graphics and Vulkan debug stats to ImGui profiler overlay
- Integrated per-backend diagnostic counters into the ImGui frame profiler overlay, triggered by `-gr_debug`.
- Consolidated and cleaned up Vulkan rendering state and descriptor management for compatibility with ImGui's Vulkan pipeline.
- Enabled uniform buffer and draw statistics reporting for enhanced performance insights during debugging.
2026-11-07 19:36:13 +01:00
the-e f5b29e721b feat: add ImGui frame profiler overlay
Replaces the old text-dump frame profile display (-profile_frame_time)
with a runtime-toggleable ImGui/ImPlot overlay showing average/median
frametime, a scrolling frametime graph, and a pie chart of the top
contributors to frame time. Toggled via a new "Frame Profiler Overlay"
option, which also seeds from -profile_frame_time for backward
compatibility and now drives frame profiling collection at runtime
instead of only at startup.
2026-11-07 19:36:13 +01:00
the-e 9763c7a312 chore: vendor ImPlot library
Adds ImPlot as a build dependency, to be used for the upcoming ImGui
frame profiler overlay's frametime graph and pie chart.
2026-11-07 19:36:01 +01:00
Boutros Tawaifi 49464c56f6 Add an "On Ship Damage" script hook (#7894)
* Add an "On Ship Damage" script hook

Runs after resolved damage has been applied to a ship (lethal hits run before
the destruction callback). Hook variables: Target, Source, Attacker,
WeaponClass, WeaponSubtype, SourceKind (PROJECTILE, BEAM, SHOCKWAVE, COLLISION,
OTHER), DamageType, ShieldDamage, HullDamage, Quadrant, Ballistic, BeamWeapon
and LethalHit. Conditions can filter on the target ship. Nothing is computed
unless a script has registered the hook.

* Move the On Ship Damage hook call out of a lambda

ship_do_damage() now calls a file-level static function, ship_run_damage_hook(), that takes the values it needs as arguments instead of capturing the function state. Hook behaviour is unchanged.

* Report subsystem damage in the On Ship Damage hook

Adds SubsystemDamage, the total subsystem strength a damage application removed, so a hit absorbed by subsystems no longer looks like a small hull hit. The hook description now says it only runs where damage is applied, which excludes multiplayer clients.

* Address On Ship Damage review comments

- Remove WeaponClass, WeaponSubtype, Ballistic and BeamWeapon from the
  hook. Scripts read these from Source when it is a weapon.
- Add a "Weapon class" condition for the On Ship Damage hook. It matches
  only when the damage source is a weapon of that class; a weapon name
  that does not exist never matches.
- SubsystemDamage is now a table keyed by subsystem handle that lists only
  the subsystems that lost strength. The total is removed.
- Rename PROJECTILE to NON_BEAM_WEAPON.
- Classify SourceKind by damage source: COLLISION for ship, debris and
  asteroid collisions; EXPLOSION for ship-death and docked-ship blasts and
  asteroid blasts; WASH for engine wash; SELF for kills where the ship
  damages itself; OTHER for other ship-sourced damage.
- Reword the hook description.

* Key On Ship Damage SubsystemDamage by canonical name

Lua tables cannot use subsystem handles as keys in a usable way, so key
the SubsystemDamage table by each subsystem's CanonicalName instead.

* Tag ship-vs-prop damage as a collision and use in_bounds

The ship-vs-prop collision call didn't pass DamageSource::Collision, so
the On Ship Damage hook reported those hits as OTHER. Every other
collision path was already tagged.

Also use SCP_vector::in_bounds() for the Weapon_info and Damage_types
index checks in ship_run_damage_hook().
2026-11-06 18:41:29 -05:00
Taylor Richards 4dc0ca7878 fix VR in OpenGL on Windows (#8009) 2026-11-06 16:27:14 -05:00
2b1759e98e Vulkan: stop mirroring light shafts top to bottom (#8006)
The Vulkan light shaft pass reuses OpenGL's sun position formula, whose
texture V grows upward. The Vulkan fullscreen triangle in post-v.sdr has
V = 0 at the top of the screen, and ls-f.sdr steps from fragTexCoord
toward sun_pos in that space, so the shafts radiated from a point mirrored
vertically from the sun. Flip the vertical coordinate before upload.

Co-authored-by: Saga port <saga-port@invalid>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 20:32:01 +00:00
Shivansps 1d0dd687cd Android Build (#6992)
* android build support

* Update es_compatibility.h

* Support reporting flags in android

* include pref_path in json v2

* add vulkan headers

* shaderc includes

* remove headers

* force use prebuilt vulkan

* fix vulkan inverted screen

* fix find sdl3 precompiled android

* Update CMakeLists.txt

* replace sdl2 android function names for sdl3 versions

* change sdl includes in osapi

* fix sdl3 includes, again

* rename function to sdl3 name

* remove unused definition

* copy libshaderc_shared.so to output in android

* do not look for vulkan-loader in android

* revert changes to SDL2.cmake

* add comment to vulkan pretransform setup

* cleanup maxsize function

* rename new android functions in osapi

* android trap back button

* Remove calculate_max_resize_max_size

* touch ui opacity control

* change opacity control to int

* fix opacity slider

* Corrected android working folder fallback and set borderless mode as default

* Implement shared helper for JNI calls

* Add version tag and sha256 to android prebuilt libs

* vulkan android check eSuboptimal

* An already requested rebuild also avoids redundant Android surface queries

* add cache bool to cmakelist

* set string ids
2026-11-05 20:56:36 +01:00
Tyler Blount 705d115214 Merge pull request #7993 from MjnMixael/qtfred-classic-menu-layout
Add a classic menu layout option to QtFRED
2026-11-04 18:25:19 -07:00
Mike Nelson a3b4386b7a Add a classic menu layout option to QtFRED
FRED2 can switch to its classic menus, where every editor dialog is in a single
Editors menu. This adds the same option to QtFRED, as a Preferences checkbox on
the Appearance tab.

The classic Editors and Misc menus live in FredView.ui beside the grouped menus
and reuse the same actions, so shortcuts and checked states are shared. Turning
the option on hides the Objects, Environment, Mission, Narrative and Tools
menus and shows the classic ones.
2026-11-04 15:42:59 -06:00
dustinspace217andDustinspace217 246a6ee8f0 Vulkan: match OpenGL's depth bias in the shadow map pass (#7944)
OpenGL's shadow pass calls gr_zbias(-1024), which sets a polygon offset of
factor 1, units 1024 (gropengltnl.cpp, gropengl.cpp). The Vulkan shadow pass
set a constant bias of -1024 with no slope term: the opposite sign, on a
depth buffer that uses the same less-than test. Use OpenGL's values.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:21:55 +01:00
dustinspace217andDustinspace217 e66fe223bf Vulkan: use one rendering-finished semaphore per swap chain image (#7943)
Each VulkanRenderFrame signaled its own rendering-finished semaphore and
presented with it. The frame's fence only says the submit has finished, not
that the presentation engine has consumed the semaphore, so the next submit
on that frame could signal a semaphore that is still pending, which the
validation layer reports as VUID-vkQueueSubmit-pSignalSemaphores-00067.

Move the semaphore to the renderer, one per swap chain image, recreated with
the swap chain, and pass the one for the acquired image to submitAndPresent.
Acquiring an image again means its previous present has been consumed.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:21:32 +01:00
dustinspace217andDustinspace217 e5b591141c Vulkan: give the irradiance pass cube fallbacks for its cube binding (#7941)
irrmap-f.sdr declares the Material set's texture binding as a samplerCube,
but vulkan_calculate_irrmap filled the array with the 2D fallback and only
replaced element 0 with the environment map, which the validation layer
reports as VUID-vkCmdDraw-viewType-07752 on every irradiance pass. Fill it
with the cube fallback instead.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:21:15 +01:00
dustinspace217andDustinspace217 81b9edc2e3 Vulkan: sample the thruster distortion map with its repeat sampler (#7940)
VulkanDistortion creates a linear/repeat sampler for its noise textures,
matching OpenGL's GL_REPEAT on Distortion_texture, but getTextureInfo
handed out the post-processing linearSampler instead, which clamps. The
sampler that was built for it is now the one used.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:20:53 +01:00
dustinspace217andDustinspace217 259a58de60 Vulkan: apply each material's depth bias, like OpenGL (#7939)
Squad logos are drawn with a material depth bias of 1 so they sit on top
of the hull. Under Vulkan the bias was written to the dynamic state but
the pipeline was built with depth bias disabled, so it never applied.
applyMaterial now calls vulkan_zbias with the material's bias before
building the pipeline config, the same way opengl_tnl_set_material calls
gr_zbias.

vulkan_zbias also passed its two values in the wrong order:
glPolygonOffset takes (slope factor, constant units) while
setDepthBias here takes (constant, slope).

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:20:24 +01:00
dustinspace217andDustinspace217 b7e7949413 Vulkan: keep the swap chain pass open when irradiance setup fails (#7938)
vulkan_calculate_irrmap ended the swap chain render pass first and then
had four early returns (pipeline, UBO create, UBO allocate, UBO map)
before resumeSwapChainPass, so any of those failures left the rest of
the frame recording draws outside a render pass. End the pass only after
the setup that can fail.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:20:02 +01:00
dustinspace217andDustinspace217 32db880e94 Vulkan: retire BLASes and the TLASes built from them safely (#7937)
A BLAS was destroyed immediately when its model was unloaded or when the
vertex heap grew and the BLAS had to be rebuilt, while the TLAS of a
frame still on the GPU could reference it by device address. Queue the
acceleration structure and its buffer on the deletion queue instead, the
same way ensureTlasCapacity already retires the TLAS. The deletion queue
is flushed after ray tracing shuts down, so shutdown defers too.

A built TLAS also kept pointing at retired BLASes for later frames: the
live shadow TLAS binding is only refreshed when a mission frame rebuilds
it, and buildTlas keeps the previous TLAS when it has no instances. With
ray-traced shadows on, flying a mission and then leaving and re-entering
the tech room (which frees every model on exit) bound such a TLAS on
every tech room frame. So when BLASes are retired, the built frame TLASes
are retired with them and the binding goes back to the empty fallback
TLAS until the next rebuild. onModelUnloaded reports whether it retired
anything, so the binding refresh only runs then.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:19:40 +01:00
dustinspace217andDustinspace217 03589b49bf Vulkan: reject truncated shader cache files (#7936)
The runtime shader compiler cached SPIR-V on disk without checking the
write, and accepted any cached file whose size was a multiple of four.
A file cut short by a crash or a full disk was handed to the driver as a
shader module. With half-length cache files in place, master crashes in
the NVIDIA driver on entering SM1-01 under -vulkan.

Cached files are now checked before use: the SPIR-V magic word, and the
instruction word counts must end exactly at the end of the file on an
OpFunctionEnd. A file that fails is logged, recompiled and rewritten.
Fresh compiler output is checked the same way before it is cached, so a
module the check would reject is never written, and the log says so.

New cache files are written to a temporary file unique to the writer and
renamed over the old .spv only after a complete write and close, so a
game crash, or a second game writing the same shader, never leaves a
partial .spv. A power loss still can; the read check catches that.
purgeOldCache now also removes old temporary files.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:19:18 +01:00
dustinspace217andDustinspace217 c58a0cd307 Vulkan: give the default material's clip plane the model matrix (#7935)
The default-material shader transforms each vertex by the model matrix
before testing it against the clip plane. Vulkan always passed the
identity, so a clip plane given in world space (for example the warp
plane on a squad logo) was tested against model-space positions. OpenGL
passes gr_model_matrix_stack.get_transform(); do the same here.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:18:59 +01:00
dustinspace217andDustinspace217 0b42d0b6e7 Vulkan: upload a mission's environment map as a cubemap (#7934)
Under Vulkan a mission's $Environment Map was never uploaded: the
irradiance and lighting passes only use ENVMAP when its texture slot
already has an image view, and nothing created one for a bitmap that was
only bm_load'ed. OpenGL uploads it the first time it binds it as a
cubemap.

Add VulkanTextureManager::ensureCubemapUploaded(), called from both
passes. It locks the map the way OpenGL does for TCACHE_TYPE_CUBEMAP.
The lock uploads through bm_data(), which now sends uncompressed DDS
cubemaps (bm_is_compressed() returns 0 for them; comp_type identifies
them) to uploadCubemap() as DXT ones already went. If the slot still
holds no cube after the lock, because the data was already resident, it
uploads it directly. A map that cannot be used is remembered by bitmap
signature (handles are reused across missions) and warned about once in
debug builds, and the irradiance pass is skipped instead of sampling a
non-cube view.

uploadCubemap() also assumed uncompressed cubemaps had one mip level and
read the six faces back to back. DDS stores face0[mip0..mipN],
face1[...], so faces 1-5 read the tail of face 0's mip chain. It now
uses the file's mip count, expands 24-bit data over the whole chain,
generates a chain for a one-level uncompressed cubemap as OpenGL does
(the lighting pass samples by roughness), copies mip 0 for every array
layer, cleans up the image when the staging map fails, and clears
isCubemap as soon as it retires the old image.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:18:40 +01:00
dustinspace217andDustinspace217 030bbaa793 Fall back to the generated environment map when a mission's is not a cubemap (#7930)
A mission's $Environment Map is used as a cubemap without checking. Naming
an ordinary 2D texture made OpenGL copy six faces out of a one-face image
and crash when the mission started (issue #2245). Check the loaded bitmap
with a new bm_is_cubemap(); if it is not a cubemap, warn, release it and
build the generated environment map, as for a mission that names none.

DX10 (BC7) DDS files carry no cube flag through the loader, so they are let
through unchecked, as before.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:18:02 +01:00
dustinspace217andDustinspace217 8ca1ad9bbc P3: Vulkan: draw decals, and draw them like OpenGL does (#7879)
* Vulkan: bind all four model-matrix attribute locations for decals

The Vulkan shader input mask had one bit per listed attribute, so the
pipeline dropped the MATRIX4 attributes at locations 9-11 and the decal
vertex shader read three of its four instance-matrix columns from unbound
inputs. No decal was ever drawn in Vulkan.

The mask now covers four locations for VATTRIB_MODEL_MATRIX. It is built
by shader_vertex_input_mask() in shader_types so both Vulkan call sites
share it and a unit test covers it without a Vulkan build.

Fixes #7866

* Vulkan: build the decal pipeline with the material's shader flags

The decal pipeline config set the shader type but not the flags, so the
decal shader variant was always compiled without USE_NORMAL_MAP and fell
back to screen-space derivative normals for angle rejection. Far more of
the decal volume passed the angle test than in OpenGL, which lit the
decals brighter and wider. The pipeline now takes the flags the material
reports, as the other draw paths already do.

* Review fixes: exact input-mask test, decal flag polarity test, mask width check

Pin the full mask per shader type instead of the presence of the matrix
bits, so an expansion of any other attribute fails; pin that a decal
without a normal map is the one that reads the scene normal buffer; add a
compile-time bound on the mask width; trim two comments.

---------

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 18:17:31 +01:00
dustinspace217andDustinspace217 499b3fb38b P4: qtFRED: rotate around the centre of a multi-selection (#7843)
* qtFRED: rotate around the centre of a multi-selection

Rotate Around Object (Alt+R) and the orbit pivot both used the current
object's position, so with several ships marked the camera still
circled whichever one happened to be current. Add
EditorViewport::selectionCenter(), which returns the centroid of the
marked objects when more than one is marked and the given object's
position otherwise, and use it at the three places that chose the
point: the look-at camera update, orbitCameraGetPivot(), and the Alt+R
handler that turns the camera toward the target when the mode is
switched on.

orbitCameraGetPivot() also serves middle-mouse orbit and wheel zoom in
normal mode, so those pivot on the selection centre as well. Every
marked type counts at full weight, including waypoints and jump nodes.
With a single object marked nothing changes.

Fixes #7724

* Make EditorViewport::selectionCenter const

It only reads the marked-object list and the editor's marked count;
clang-tidy (readability-make-member-function-const) flagged it in CI.

* Mirror the multi-selection orbit pivot to FRED, trim comments

FRED gets the same selection_center() as qtFRED's selectionCenter(),
used at the same three places: the look-at camera update, the orbit
pivot, and the Rotate Around Object toggle. Also removes the qtFRED
comments flagged in review.

* Make the selection-center pivot optional and share object bounds

Look-at and orbit use the current object again unless the new option is
on (qtFRED: Preferences > Controls; FRED: View menu), and the selection
center is now the bounding-box midpoint. view_universe in both editors,
the pivot, and qtFRED's selection radius all use get_object_bounds() in
missioneditor/common.

* Reset the cached orbit pivot when the selection-center option changes

Wheel zoom reuses the orbit pivot until the camera moves, so without this
the option only took effect for scrolling after the next camera move.

* Address review: move and rename the selection-centroid option

- FRED: the option moves from the View menu to Settings (and Misc in the
  classic layout), under Move Ships When Undocking, with hover help, and is
  renamed Rotate Around Selection Centroid.
- qtFRED: the checkbox moves next to Move Ships When Undocking in the
  preferences dialog, with the same name.
- setOrbitSelectionCenter only resets the orbit when the value changes.
- get_object_bounds iterates with list_range.
- The bounds test resets the object system with obj_init and takes objects
  off the free list, so it leaves a valid state for other tests.

* Rename the option to Selection Midpoint, move it to qtFRED's Controls tab, and document it

* Fix overlapping Appearance rows in qtFRED Preferences, realign a settings line

The last commit renumbered the Viewport label size row of the Appearance
group from 4 to 3, which is the Long list menu style row, so the label
size pair fell out of the layout and its spin box drew over the group
title. Put it back at row 4.

---------

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 01:17:00 -05:00
dustinspace217andDustinspace217 12bddb8366 P3: Add weapon_info::clone (#7847)
* Add weapon_info::clone

Copies every member of a weapon class, following ship_info::clone, so a
weapon can be created from another as ship templates do. The
CLONE_UNIQUE_PTR macro moves from ship.cpp to utils/string_utils.h so
both clone functions share it.

* Group weapon_info::clone fields as the struct declares them

---------

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-04 01:16:41 -05:00
c47a8bf351 P4: Make cfread_string_len read no more than fits in the buffer (#7863)
* Make cfread_string_len read no more than fits in the buffer

The char* version only checked the stored length with an Assertion, so in
release builds a string longer than the buffer was read past its end, and a
negative length wrote before it. It now reads at most buffer_size - 1
characters, skips the rest so the next read stays aligned, always terminates
the buffer, and logs when characters are dropped.

The SCP_string version clamps a negative or past-the-end length to what the
file still holds, so a corrupt length can't cause a huge allocation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Warn when cfread_string_len cuts or rejects a string

The char* version now reads up to the full buffer, so a string that fills it
exactly without a terminator is caught rather than cut silently. Both versions
clamp the stored length to what the file still holds and check the read limit
before reading, since cfseek does not; inside a limited pilot section a corrupt
length, negative or too long, throws cfile::max_read_length so the loader can
drop the section. A cut string, a corrupt length or a failed read gets a
Warning, and a failed read no longer leaves the file position off by the bytes
it did read. A buffer size of 0 skips the string without writing to the buffer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Write the cfread_string_len warnings inline with format arguments

* Share one core between the cfread_string_len overloads

Both overloads now read the length, work out what is stored, read the
body and warn through the same three steps. A length that does not fit
the file throws inside a limited section even when the section ends at
the end of the file, a zero-size buffer still warns about a corrupt
length, and a cut-off length field warns (or throws inside a limited
section) instead of reading as an empty string.

* Share cfread's read-size check with cfread_string_len

The string reader had its own copy of the read-limit check, without the
clamp to end-of-file that cfread does first, so a truncated last section
threw where it used to load. Both now call cf_check_read_size. A negative
length still throws inside a limited section, a cut-off length field only
warns, the cut warning counts bytes, and the helpers sit in an anonymous
namespace.

* Keep cfread_string_len quiet at a clean end of file

A string read at a clean end of file now returns an empty string without a
warning, as cfread_int does; a length field cut partway still warns, so a
truncated pilot list no longer raises one warning per remaining entry. A
zero-size buffer warns when it drops a string, and an invalid file reads as an
empty string again. Adds tests for an empty string inside a limited section,
the one-short boundary, a length still past the limit after the clamp, a
length field cut by the limit, the string returned after a failed read, and
cfread at end of file.

* Warn when a length field is missing before the end of a file

A failed length read now counts as a clean end of file only when cfeof says
so, so a file whose recorded size is larger than its data still warns. Tests
now pin the read-limit check after the end-of-file clamp, cfread at the end of
file past the limit, a length field cut short on disk, the zero-buffer
Assertion in Debug, and an empty string into a zero-size buffer.

* Close the test file before removing it in the cfile temp-file guards

Windows cannot delete an open file, and a failed ASSERT returns with the
file still open, so the guard now closes it first.

---------

Co-authored-by: Dustinspace217 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-04 01:15:49 -05:00
Goober5000 3489da442a Merge pull request #7957 from BTawaifi/feature/subsystem-eq
Add __eq to the subsystem scripting handle
2026-11-04 01:04:28 -05:00
Goober5000 abf796f75f Merge pull request #7991 from Goober5000/version_26_3
bump version to 26.3
2026-11-03 23:41:25 -05:00
Goober5000 89d69189c8 bump version to 26.3 2026-11-03 22:39:54 -05:00
Goober5000andDustinspace217 b8bd1daa6e Keep the mission's own ship when a quick start finds no last flown ship (#7962)
A new pilot, or one whose last ship isn't in the current mod, has no last
flown ship. create_default_player_ship() then shows a popup and returns an
error; release builds carry on with the mission's own player ship, but
debug builds asserted. Drop the assert so both builds behave the same.

Co-authored-by: Dustinspace217 <[email protected]>
2026-11-02 22:42:30 -05:00
LuytenKy bb69b1b9db Refactor: CC_preset (#7809)
* CC_preset: Prevent post-construction type modification and handle pst duplication

* remove redundant function

* CC_preset: remove default constructor, require explicit type

* remove duplicate
2026-11-02 22:40:54 -05:00
Goober5000 9fb692f12f Merge pull request #7896 from BTawaifi/feature/noninteractive-no-focus-pause
Don't pause on lost focus in noninteractive runs
2026-11-02 22:40:15 -05:00
Boutros Tawaifi 43ba8b859e Measure afterburner cooldowns on the mission clock (#7895)
* Measure afterburner cooldowns on the mission clock

afterburners_start()/afterburners_stop() timed the +Aburn Cooldown Time delay and
the player's 1.3 s re-engage delay with timer_get_milliseconds(), the real
clock. Under time compression a cooldown therefore lasted longer in mission
time than the table says, and it kept running while the game was paused. The
cooldown was added in 2020 and reused the retail re-engage check's real-clock
"now"; the rest of the file (ABURN_DECAY_TIME, the sound timers) already uses
mission timestamps.

Both delays now use the mission clock. The mission clock does not run outside
missions, so it can still be near zero when the first mission of a session
starts; the "last stopped" and "last started" times therefore start out
invalid instead of 0, so that no delay is in effect before the afterburner has
been used.

Without time compression or pausing, the delays behave as before.

* Drop stale afterburner comment and use fl2i for the cooldown cast

The comment described an earlier startup state rather than the current
behavior. fl2i is the project's float-to-int macro and truncates the same
way the old C-style cast did.

* Remove the remaining afterburner cooldown comment

Timestamps running on mission time is the common case, so it doesn't
need a comment.
2026-11-02 22:39:31 -05:00
Shivansps 49f4b1d9c7 Support GLES in internal shaders and Vulkan software clip distance fallback (#7489)
* GLES Shaders and Vulkan Clip fallback

* clip fallback: change defined name, set from engine side and invert usage

* Proposed changes and fixes

Fixed:
-The OpenGL ES option stays on when OpenGL is off (issue #7984)
-Missing precision in copy-f, volumetric-f and smaa-resolve-f
-msaa-f including z-compress before precision quantification
-missing float literals in volumetric-f
-Fixed decals blending
-Restored glBindFragDataLocation() for use in legacy external shaders
-Enabled GL_ARB_explicit_attrib_location ext for GLSL version below 330 in GL
-Guarded enabling/disabling of GL_CLIP_DISTANCE0_EXT and GL_DEPTH_CLAMP
-Restored PI in lighting.sdr
-removed "External shaders only" indication from cmakelists.txt
2026-11-03 12:20:21 +09:00
Shivansps 9f55626272 Fix incomplete implementation of ETC2 textures in Vulkan (#7699)
* finish etc2 textures in vulkan implementation

* add etcdec implementation

* Enable textureCompressionETC2 at vulkan device creation and fixed outdated comments
2026-11-03 12:20:11 +09:00
Dustinspace217 670df9b97e Keep the mission's own ship when a quick start finds no last flown ship
A new pilot, or one whose last ship isn't in the current mod, has no last
flown ship. create_default_player_ship() then shows a popup and returns an
error; release builds carry on with the mission's own player ship, but
debug builds asserted. Drop the assert so both builds behave the same.
2026-10-29 03:50:51 -07:00
btawaifi 9a70489dbc Add __eq to the subsystem scripting handle
Two subsystem handles are equal when both are valid and refer to the same
subsystem on the same ship. Invalid handles compare as not equal, matching
the other handle types.
2026-10-29 00:56:03 +03:00
BMagnu 8afa318428 Clamp requested particle spawn time in both directions (#7927) 2026-10-27 13:00:00 +09:00
Goober5000 cf9c5590e3 Merge pull request #7926 from Goober5000/fix/jumpnode_rename
Fix jump node renames being lost in FRED2
2026-10-26 23:00:31 -04:00
Goober5000andClaude Opus 5.5 9879110c1f Fix jump node renames being lost in FRED2
The jump node dialog only copied control text into its member variables
in OnClose(), so update_data() calls from selection changes, saves, and
the dialog's own node menu applied stale values and discarded the edit.
Call UpdateData(TRUE) inside update_data(), as the waypoint path dialog
does.  This regressed when the dialog was split out of the waypoint
dialog in 78b957982.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 19:15:00 -04:00
Goober5000 a8d5b3d6f9 Merge pull request #7921 from Goober5000/fix/vulkan_texture_addressing
honor material texture addressing in Vulkan
2026-10-24 03:10:07 -04:00
Goober5000andClaude Fable 5.1 acf613c13c Fix FastDebug builds linking the non-redistributable debug CRT (#7919)
* fix FastDebug QtFRED linking the debug CRT

FastDebug builds in the DLL-runtime tree (used whenever qtFRED is
enabled) compiled with /MDd and, since #7450, linked Qt's debug
libraries.  Both import ucrtbased.dll, MSVCP140D.dll and
VCRUNTIME140D.dll, which Microsoft does not license for redistribution,
so end users could not run the FastDebug qtFRED shipped in nightlies
and releases.  Static Qt is ruled out by the LGPL, so the only shippable
shape is the release CRT plus release Qt.

On MSVC, _DEBUG is the CRT's own contract: /MTd and /MDd define it
themselves, and the STL headers select msvcprtd.lib and
_ITERATOR_DEBUG_LEVEL=2 from it.  Stop force-defining it for FastDebug
on MSVC; the engine keys its debug behaviour on NDEBUG, and the few
_DEBUG guards in code/ are switched to NDEBUG so they keep working.
The static tree is unchanged: /MTd still defines _DEBUG there.

Fixes #7915

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* derive the MSVC runtime choice once

The "DLL runtime or not" condition was spelled out in the toolchain and
twice in fred2 with "keep in sync" comments, and gtest_force_shared_crt
and antlr4's WITH_STATIC_CRT had already drifted: they only looked at
MSVC_USE_RUNTIME_DLL, so a qtFRED tree with tests enabled would have
asked both for the static CRT.  That is harmless today only because our
flag strings carry no literal /MD for them to rewrite.

Compute FSO_MSVC_RUNTIME_DLL once in toolchain-msvc.cmake and use it
everywhere.  InstallRequiredSystemLibraries deliberately stays keyed on
MSVC_USE_RUNTIME_DLL: the qtFRED deploy ships no compiler runtime.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* remove FastDebug runtime leftovers

The /MD -> /MDd substitution on the FastDebug flag strings has done
nothing since the runtime moved to CMAKE_MSVC_RUNTIME_LIBRARY: the
Release flags it copies contain no runtime switch.  The commented-out
_ITERATOR_DEBUG_LEVEL=0 lines for gtest and the OpenXR loader belong to
the scheme #7450 removed from the toolchain.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* use the release CRT for all FastDebug builds

Microsoft's documentation marks the static debug libraries (libcmtd,
libucrtd, libvcruntimed) "Not redistributable" and states that debug
versions of an application may only be copied to machines used for
testing, and the license grants distribution rights only for code on
the REDIST list, which contains no debug library in any form.  So the
statically linked FastDebug game and FRED2 are no more shippable than
the /MDd qtFRED was.

Link every FastDebug build against the release runtime.  The engine's
debug behaviour keys on NDEBUG, which FastDebug still leaves undefined,
so asserts, warnings and mprintf are unaffected; only the debug CRT's
heap checking goes, and that remains available in Debug builds.  FRED2's
static MFC library follows the CRT: the debug variant requires the debug
runtime.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* keep the debug icon, version flag and FRED2 asserts without _DEBUG

The resource compiler only ever sees the explicit definitions, so with
_DEBUG no longer defined for FastDebug the game lost its debug icon and
both editors lost the VS_FF_DEBUG version flag.  Key those on NDEBUG,
which FastDebug still leaves undefined.

FRED2 also used MFC's ASSERT, VERIFY, ASSERT_VALID and TRACE0, which are
all compiled out without _DEBUG.  Convert them to the FSO equivalents
FRED2 already uses nearly everywhere else: Assert, Verify, a null check
in place of ASSERT_VALID (AssertValid only exists in debug MFC), and
mprintf.  The AssertValid/Dump overrides and DEBUG_NEW stay under
_DEBUG, as they must.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-10-24 03:09:57 -04:00
Goober5000andClaude Opus 5.5 afd92bb3f9 honor material texture addressing in Vulkan
Vulkan never read the material's texture addressing, so MR_FORCE_CLAMP
skyboxes were sampled with a wrapping sampler, producing seams.  Set it
on every material draw, as OpenGL does in opengl_tnl_set_material().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 23:47:54 -04:00
Taylor Richards 76219fd1e2 lower Vulkan requirement and fix shaderc includes (#7902)
Lower Vulkan version requirement to 1.4.304, which should be the lowest
version supported without requiring code changes. This should also offer
out of the box support on current Linux distros, such as Debian 13 (trixie)
and Ubuntu 25.10 (questing) & 26.04 (resolute).

Also make sure that the shaderc headers are available and added to the
include path on Linux when using system libraries.
2026-10-18 05:53:10 -04:00
btawaifi 52fb1bdc8d Don't pause on lost focus in noninteractive runs
The game pauses when its window loses focus. With in-game options on, that is
governed by the Game.UnfocusedPause option (default on), and the legacy
-no_unfocused_pause flag is ignored, as other legacy flags are. An unattended
run started with -noninteractive therefore stopped as soon as another window
was in front, for example when several test instances run side by side.

-noninteractive means nobody is at the keyboard to resume the game, so
pause_if_unfocused() now returns false for it. This covers all three focus
paths (game_poll, game_pause, game_unpause). Interactive runs are unchanged.
2026-10-18 00:44:52 +03:00
Taylor Richards 12a36dc1a3 fix various macOS/Xcode project issues (#7875)
Silence CMake build type warnings when using a multi-config generator.

Fix macOS deployment target specification. It must be set before
the first project() command to work properly, and needs to be a cached
value so that it can be overridden by the user. This in particular is
required for Xcode 27 where the minimum deployment target is 12.0 and
using anything less is a hard fail rather than a warning.

Fix Xcode scheme only containing qtFred as a buildable target.

Fix various Xcode warnings when a static library contains files without
any symbols.

Allow FSO/qtFRED cmdline arguments and working directory to be set via their
respective options (FSO_RUN_ARGUMENTS & FSO_FREESPACE_PATH) in Xcode.

Fix product identifier mismatch and unset minimum system version warnings
in Info.plist file.
2026-10-17 06:16:10 -04:00
Goober5000andClaude Opus 5.5 c28032a2af Make quickstart options quick, and fix several associated bugs (#7834)
* only strip the legacy M/S suffix from the last pilot when needed

player_select_get_last_pilot_info() chopped any trailing uppercase M or S
from the LastPlayer value, a holdover from the pre-pilot-file era.  Pilots
whose callsigns end in M or S (e.g. BOSS) were never found as the last
pilot.  Now the suffix is only removed when the full callsign is not a
pilot but the shortened one is.  This also avoids indexing before the
string when LastPlayer is empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* route all pilot selection through one commit function

player_select_close() and player_finish_select() each had their own copy
of the code that loads a pilot as the active Player, and the copies had
drifted apart.  Both now call player_select_commit_pilot().

This fixes two bugs:
* -pilot did not work with the retail pilot select screen.
  player_finish_select() loaded the requested pilot, but then
  player_select_close() loaded the highlighted pilot (the most recent
  one) over it.  The close handler now skips the load if a pilot has
  already been committed.
* player_finish_select() ignored its is_multi parameter when setting
  player_was_multi, so scripted selection of a multiplayer pilot saved
  it as single-player.

Scripted selection also now saves the pilot file, as the retail screen
already did.  The background bitmap handle starts out as -1 so that the
close handler doesn't release bitmap 0 when the screen was never set up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* select pilots automatically at game init, through the normal commit path

-startgame, -connect and -almission (via Cmdline_use_last_pilot) used
player_select_get_last_pilot(), which loaded the last pilot directly
without most of the setup that a normal selection does.  It skipped
valid_pilot(), multi_options_init_globals() and saving the pilot file.
Because it never entered the pilot select state, it also turned off the
main hall's fallback for an unavailable campaign.  Meanwhile -pilot and
-benchmark_mode were handled on the pilot select screen itself, which
scripted UIs replace entirely.

All of these now go through player_select_try_auto_select() at
GS_EVENT_GAME_INIT.  It picks the -pilot callsign, else the last pilot
if it still exists, else the most recently saved pilot.  It shows the
startup warning popups, validates the pilot, and commits it through
player_select_commit_pilot().  The pilot is multiplayer if -startgame or
-connect was given, and single-player otherwise.  If there are no
pilots, or validation fails, the pilot select screen is shown as usual.

The main hall now allows the campaign fallback whenever a pilot has just
been committed, not only when coming from the pilot select state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* select a pilot automatically for -start_mission

-start_mission skips the main hall, but it still waited on the pilot
select screen.  It now uses the same automatic pilot selection as the
other quickstart options, so the screen only appears if there are no
pilots.  The pilot is committed as single-player, consistent with the
main hall forcing single-player mode for -start_mission.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* skip the intro movie for quickstart options

When the command line asks to skip pilot selection (-start_mission,
-pilot, -startgame, -connect, -almission, -benchmark_mode), the intro
movie now doesn't play either.  It could take several minutes before the
game even reached the pilot.  The OnIntroAboutToPlay hook still runs, as
it does when the mod table disables the intro.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-10-16 20:57:07 -04:00
Taylor Richards b477dd5ca9 lower required SDL3 version to 3.2.8 (#7876)
This should be a safe minimum for us when system libraries are either
required or preferred. Most current Linux distros that have SDL3 should
support this version or better.
2026-10-16 04:36:51 -04:00
Goober5000 7b80cd4897 Merge pull request #7871 from notimaginative/prebuilt_update
bump prebuilt libs for SDL 3.4.18
2026-10-15 23:19:01 -04:00
LuytenKy e76e844d02 Vulkan: Skip MSAA resolve when no deferred pass is active (#7854)
* stub check for msaa

* initialize viewport variables
2026-10-15 18:04:32 +02:00
Taylor Richards 2ab398b34a bump prebuilt libs for SDL 3.4.18 2026-10-15 03:47:06 -04:00
BMagnu 88669e4518 Fix VR cursor issues and warn about crash hazard (#7868)
* Add warning for OpenXR toolkit

* Properly handle mouse position

* GCC 9 issue
2026-10-15 00:48:46 +00:00
BMagnu f6f1aac574 Fix fullscreen with resolutions not available for modesetting (#7867) 2026-10-15 02:01:11 +02:00
Goober5000andClaude Fable 5.1 b37cfda56d Fix a model refcount bug on loadout change, and harden model_unload against stale handles (#7851)
* take a model reference when a ship changes class

ship_model_change() only loaded the model when the class had none, so a ship
switched to a class whose model had been loaded only by a select-screen
preview adopted that preview's single reference.  Closing the screen then
freed the model from under the ship, and the first simulation frame asserted
in model_get().  This is what happened on a replayed mission with a restored
loadout: ship select was skipped, the weapon-select overhead loaded the new
class once, the commit switched the player to it, and the screen close
released it.

Load unconditionally, as ship_create() already does, so the ship holds its own
reference.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* reject stale model ids in model_unload and release select-screen handles at level close

model_unload only used the slot part of the id it was given, so a handle kept
across missions would free whatever model had since been loaded into that slot.
Validate the id against the slot's occupant and warn instead.

Two holders could present such handles: the weapon-select icon models under a
scripted UI that overrides the state hooks (the native close never runs), and
the ship-select 3D model global, which was never reset between missions.
Release the select-screen handles from game_level_close, and unload the
ship-select model on screen close and on every selection change.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* consolidate the select-screen resource release

The weapon side released its icons, anims, and ship class data from two
functions keyed on whether the screen was open, and the level-close path added
a third copy.  Give the weapon side the same shape as the ship side: one
unconditional weapon_select_common_close(), with weapon_select_close() left as
pure UI teardown.  common_select_level_close() now just calls the two common
closes, and common_select_close() calls it in turn.  The ship-select 3D model
is released from ship_select_common_close() so both paths cover it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-10-13 02:19:48 -04:00
Goober5000 085ff7a70b Merge pull request #7852 from Goober5000/fix/loadout_wireframe_wipe
restore the wireframe wipe in the FS2 loadout effect
2026-10-12 23:32:32 -04:00
Goober5000 72d579e010 Merge pull request #7818 from Goober5000/fix/ai_target_recovery
apply $fix ai target recovery's pursuit filter only to targets picked for pursuit
2026-10-12 22:59:38 -04:00
Goober5000andClaude Opus 5.5 2f6bca06f7 restore the wireframe wipe in the FS2 loadout effect
During phase 1 of the FS2 ship/weapon select animation, the wireframe
is supposed to be revealed as the scanline moves down.  That relied on
the clip plane set up for the grid carrying over to the wireframe
render.  90a2676f1 replaced the grid's clip plane with line trimming,
which left the phase 1 wireframe unclipped, so it popped in all at once.

Clip the wireframe in both phase 1 and phase 2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 22:31:50 -04:00
Goober5000 904edfee44 Merge pull request #7842 from dustinspace217/qtfred/hidpi-font
qtFRED: scale viewport labels by the device pixel ratio
2026-10-12 21:35:46 -04:00
Goober5000 d9b4d81d93 Merge pull request #7844 from Goober5000/fix/mission_splash_scaling
Scale mission load screen backgrounds to fit the screen
2026-10-12 21:29:00 -04:00
Goober5000 4fcd470135 Merge pull request #7846 from scp-fs2open/dependabot/pip/ci/post/mako-1.4.2
Bump mako from 1.3.12 to 1.4.2 in /ci/post
2026-10-12 21:28:26 -04:00
Goober5000andClaude Opus 5.5 1af0eb82bf apply $fix ai target recovery's pursuit filter only to targets picked for pursuit
The actively-pursues filter added to "$fix ai target recovery:" in #7736 was applied to every target search.  But a ship's target is not only used for pursuit: it also drives the ship's turrets, other ships' guard reactions, and attacker counts.  In retail SM1-04, the friendly Knossos (which does not pursue fighters) was made to target the Behemoth instead of a Mara, which caused the Mara guards to react to the protected Knossos endlessly instead of rushing the player.

The filter now applies only where the target is chosen for maneuvering:
* find_enemy() and get_nearest_objnum() take a required for_pursuit parameter; automatic searches pass ai_targets_for_pursuit(), which is true only in AIM_CHASE or AIM_STRAFE
* guard reactions, retaliation (dynamic chase), and the retargets in ai_big_chase_attack() and ai_big_maybe_enter_strafe_mode() skip ships the attacker won't pursue, via the new ai_declines_pursuit()
* ai_attack_wing() prefers living wing members the ship will pursue; if there are none, it holds a member as an explicit order to attack an unpursued ship does
* get_nearest_objnum() holds an unpursued member of the enemy wing rather than leaving the wing

Since refused targets are no longer picked for pursuit, ai_chase() no longer needs to drop them.  Retail behavior is unchanged when the flag is disabled.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-12 21:26:53 -04:00
Goober5000 6e469a2180 Merge pull request #7837 from Goober5000/fix/ai_mode_fields
reset stale AI order state and track previous_mode through dynamic chases
2026-10-12 21:24:31 -04:00
Goober5000 f64d940963 capitalization 2026-10-12 20:09:29 -04:00
Goober5000andClaude Fable 5.1 2052dcaeb0 reset stale AI order state and track previous_mode through dynamic chases
Several ai_info fields remember which order set them up (enemy_wing,
guard_objnum/signature/wingnum) or which mode a dynamic goal interrupted
(previous_mode, resume_goal_time), but nothing cleared them when a new
order took over.  A ship that once guarded a wing would be yanked back
into AIM_GUARD whenever a wingmate died; a stale previous_mode of
AIM_GUARD could make a former guard abandon a counterattack; a stale
enemy_wing biased every find_enemy() toward a long-ago target; and a
resume_goal_time left over from a dynamic chase suppressed target
acquisition for up to 20 seconds into the next order.

Add ai_reset_order_state(), called when ai_process_mission_orders()
takes up a goal and when ai_do_default_behavior() runs.  Each order's
own setup repopulates the fields it needs.  enemy_wing is reset under
either $fix stale ai order state or $fix ai target recovery, since it
affects target selection; the rest only under the new flag.

maybe_set_dynamic_chase() wrote aip->mode into previous_submode, a
retail typo that left previous_mode untracked for dynamic chases.  Under
the flag, save both fields properly, but not when a dynamic goal is
already in progress, so a nested interruption does not clobber the mode
to return to.  Apply the same guard to the strafe/chase transitions in
aibig.cpp.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-12 20:09:29 -04:00
dependabot[bot] cba5d1822f Bump mako from 1.3.12 to 1.4.2 in /ci/post
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.3.12 to 1.4.2.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-version: 1.4.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-12 05:34:09 +00:00
Goober5000 94dd3af03c Merge pull request #7832 from notimaginative/vs2026_workflow
switch Windows workflows to Visual Studio 2026
2026-10-12 01:33:04 -04:00
Dustinspace217 0966d94dc4 Trim comments 2026-10-11 22:11:02 -07:00
Goober5000andClaude Opus 5.5 6e4a55263e Scale mission load screen backgrounds to fit the screen
The load screen background was drawn in the fixed 1024x768 layout, so an
image larger than that overshot the screen and only a corner was visible.
Set the screen scale to the background's dimensions, as the main hall and
title splash already do, and draw the loading animation in the same
layout.

The loading animation is assumed to match the default loading background
(or the default layout, if there is none).  That reference is fit into
the mission's background the way menus are fit into the screen: scaled by
the limiting dimension and centered in the other.  So a mission can use a
background of any resolution or aspect ratio without the animation
changing size or position relative to it.  Retail assets behave as
before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 23:10:06 -04:00
Dustinspace217 d5ca49f916 qtFRED: scale viewport labels by the device pixel ratio
On a HiDPI monitor with OS scaling, every Qt widget in qtFRED scales
but the ship labels, waypoint labels and coordinate readout drawn by
the engine inside the viewport do not, because the engine draws them in
physical pixels. At 200% they come out half the size of everything
around them.

FredRenderer already receives the window's device pixel ratio as the
scale argument of render_frame(). Remember it there and multiply it into
the label font scale at every label site, so the user's Preferences
value stays "100% = normal size on screen" regardless of OS scaling.

Fixes #7727
2026-10-11 03:20:33 -07:00
Goober5000 a1250d7168 Merge pull request #7836 from Goober5000/cleanup/remove_glow_warning
Remove 3D shockwave glow map warning
2026-10-09 01:39:13 -04:00
Goober5000andClaude Sonnet 5.5 014e14af6f Remove 3D shockwave glow map warning
The warning fired for any 3D shockwave model without a glow map, but it turns out that situation is fine.  Drop the warning along with the cmdline include it required.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-09 00:38:27 -04:00
Mike Nelson 0c0320bb87 Null the multi SEXP packet getters' out-pointers on failure (#7828)
get_ship(), get_wing(), get_object() and get_parse_object() only assigned
their out-pointer on success. When a lookup failed (no bytes left, or a net
signature that no longer resolves, e.g. a ship destroyed before the packet
was processed) the caller's uninitialized local was left as stack garbage,
so its nullptr check could pass and the next line would write through it.
multi_sexp_set_camera_target() used the object without checking at all.

Set the out-pointer to nullptr up front, so every caller's existing nullptr
check works. This also clears the C4701/C4703 "potentially uninitialized"
warnings MSVC 2026 reports for the callers in sexp.cpp when it inlines these
getters at link time.
2026-10-09 10:54:31 +09:00
Goober5000 82e7a0793f Merge pull request #7821 from Goober5000/fix/pof_parsing
Harden POF loading: texture limits, file handles, virtual POF failures
2026-10-08 12:06:50 -04:00
Goober5000andClaude Opus 5.5 5dd9f56deb release textures and model memory when a model load fails
The failure checks after parsing (bad detail levels, debris objects or
parents, and too many textures) run after the TXTR and GLOW chunks have
already loaded bitmaps, but model_load only deleted the polymodel, so
those bitmap slots were never released.  Page out the textures and free
the model through model_free, as the virtual POF cache already does for
models it loads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 03:04:02 -04:00
Goober5000andClaude Opus 5.5 4ff6c8c447 accept a cross section count of -1 without a warning
Retail models (111 of them in sparky_fs2.vp) store -1 as their cross
section count, meaning none, which the original loader silently accepted.
Routing the count through pof_read_count made every such model warn on
load.  Read it directly and floor it at zero, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 03:02:24 -04:00
Goober5000andClaude Opus 5.5 2f131db53a propagate POF load failures through virtual POFs
A virtual POF ignored the load status of its base POF, so a base that
failed to load (missing, bad version, or rejected after parsing) was
still built upon and reported as a successful load.  Likewise, every
operation that copies from another POF used it even if that POF had
failed to load.

Return FAIL from read_virtual_model_file when the base POF fails, and
have the operations skip, with a warning, any source POF that failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 03:02:24 -04:00
Goober5000andClaude Opus 5.5 7f71b169dd map appended-submodel textures before changing the virtual POF
When appending submodels would take the combined POF past
MAX_MODEL_TEXTURES, the limit was only noticed partway through, after the
submodel array had been grown, subsystems copied, and n_textures
incremented past the limit, which later loops over maps[] then overran.
Work out the texture mapping first, and give up before touching the model.

Also skip the -1 texture id of untextured flat polygons, which was being
assigned a texture slot, and which replace_textures_used then used to
index Num_verts and Num_polies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 03:02:23 -04:00
Goober5000andClaude Opus 5.5 1d13fc2a83 reject models with too many textures once parsing is finished
Clamping the TXTR count keeps maps[] safe, but texture indices are baked
into the BSP data, so a model declaring more than MAX_MODEL_TEXTURES
textures cannot be built correctly.  Keep the clamp so that the chunk is
still read in full, then fail the load after parsing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 03:02:23 -04:00
Goober5000andClaude Opus 5.5 2563a746aa reject out-of-range BSP texture indices when building polygon data
process_tmap and process_tmap2 used the texture index from the BSP data
to index Num_polies and Num_verts without checking it, so a corrupt
model wrote past both arrays while its vertex buffers were built.  The
collision tree parser already treats such an index as a fatal error, but
it runs afterward.  Raise the same error here, and skip the polygon in
case the error is continued past.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 03:02:23 -04:00
Goober5000andClaude Opus 5.5 604eb39519 close the model file on every exit path
The post-parse sanity checks and the bad-version check returned FAIL
without closing the POF.  Nothing reads the file after the chunk loop, so
close it there, and close it before the bad-version return too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 03:02:23 -04:00
Goober5000andClaude Opus 5.5 9ffa5192b0 stay on the v143 toolset and install its ATL/MFC
MSVC 14.50 (v145) no longer targets Windows 7, 8, or 8.1, so building
with it would quietly drop those platforms.  The VS 2026 runner images
include the v143 compiler but ship ATL and MFC only for the latest
toolset, and both are needed: ATL by SAPI speech (sphelper.h) and MFC
by FRED2.  Install the 14.44 ATL/MFC components before configuring and
keep building with v143, matching the 26.0 release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 13:02:32 -04:00
Taylor Richards 521ddcbcca bump platform toolset to 145 (Visual Studio 2026)
The Github runners do not currently include a ATL/MFC version for older
platform versions. As we still need MFC for FRED2 this is the easiest fix.
2026-10-06 23:46:02 -04:00
Goober5000 242eb19ef5 Merge pull request #7808 from Goober5000/cleanup/post_option_logging
log game settings after all tables have been parsed
2026-10-06 19:35:06 -04:00
Goober5000 6115df3e08 Merge pull request #7822 from Goober5000/fix/subsystem_dump
restore the debug subsystem dump
2026-10-06 19:34:49 -04:00
Taylor Richards f54b3fdc5c switch Windows workflows to Visual Studio 2026
All default Windows runners should now be moved over the Visual Studio 2026,
with the exception of windows-2022 (which may be retired before long). So
move to windows-2025 and update the CMake generator to use vs2026 as well.
2026-10-06 19:01:43 -04:00
Goober5000 45b9d31d76 Merge pull request #7820 from Goober5000/fix/insignia_lighting
light insignias using lights rotated into their frame of reference
2026-10-05 21:05:30 -04:00
Goober5000andClaude Opus 5.5 571e63d659 value-initialize lights when adding them
Directional, point, and cone lights left local_vec, local_vec2, and some of
the type-specific fields uninitialized until something rotated or set them.
The sun copies in Static_light were never rotated at all until the previous
commit, so light_apply_rgb's sun term read uninitialized memory.  Zero every
field up front, which also covers what the tube light did by hand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 00:17:02 -04:00
Goober5000andClaude Opus 5.5 d6c253bda3 light insignias using lights rotated into their frame of reference
light_apply_rgb works in the model's local frame, but nothing rotated the
lights into that frame before insignias were drawn: light_rotate_all() was
only called for the briefing and tech room lights, and even then it skipped
Static_light, the separate copies of the sun lights that light_apply_rgb
reads.  So the sun term used a stale, never-set direction and the point
lights were treated as if they sat at the model's origin.

Rotate the lights, including the sun copies, once the insignia's instance
is set up, and light each vertex at its actual position, which includes
the insignia's offset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 00:17:02 -04:00
Goober5000 05a3df4bdd Merge pull request #7819 from Goober5000/fix/norms_faces
store insignia normals per face, and light insignia faces with them
2026-10-05 00:16:01 -04:00
Goober5000 3c7dc9bb35 Merge pull request #7717 from JohnAFernandez/Resize-qtfred-Messages-properties
QTFRED: Event Editor, move Items to a grid layout to better utilize spacing
2026-10-04 15:23:01 -04:00
Goober5000andClaude Opus 5.5 89bad012a2 restore the debug subsystem dump
In debug builds, subsystems found in a model but missing from ships.tbl
are meant to be dumped to data/tables/<model>.subsystems as stub table
entries.  Since subsystem matching was deferred until after the model
file is read (#4590), the dump file was already closed by the time
do_new_subsystem ran, so it was always empty and deleted.  Worse, ss_fp
was left pointing at a closed CFILE slot, which another file could reuse
before do_new_subsystem wrote to it, and the dump file leaked whenever a
load failed.

Open the dump file on the first unmatched subsystem instead, and close it
once the deferred subsystems have been matched.  This also means no file
is created and deleted for models without unmatched subsystems.  Reset
the once-per-model warning flags there as well, rather than only when
the dump file opened successfully.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 14:42:50 -04:00
Goober5000 2838d25ab7 Merge pull request #7816 from TheForce172/fix/Qtfred-object-z-axis
QTFred: Object Dialog: Matches Z POS spinner limits with other axis
2026-10-04 13:21:01 -04:00
Goober5000 b666d7eebc Merge pull request #7817 from TheForce172/fix/7815
QTFRED: Fix #7815: Arrival/Departure Cue Update
2026-10-04 13:17:02 -04:00
Goober5000andClaude Opus 5.5 52e5652624 store insignia normals per face, and light insignia faces with them
The insignia normal array was declared with the vertex limit, filled in by
face index, and read by vertex index.  An insignia with more than 81 faces
therefore wrote past the array, into the following insignia or, for the
sixth and final slot, past the insignia list into the rest of the
polymodel.  And the renderer lit each vertex with the normal of whichever
face shared its index, or with a zero normal (ambient light only) when
there was no such face.

A normal belongs to a face, so size the array by the face limit and light
all three corners of each face with that face's normal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 13:14:32 -04:00
Goober5000 b483d30b20 Merge pull request #7804 from Goober5000/fix/misc
four miscellaneous fixes
2026-10-04 13:08:13 -04:00
Goober5000andClaude Opus 5.5 dd77f7afbf break submodel parent cycles when reading SOBJ chunks
A subobject that named itself, or one of its own descendants, as its parent
made the depth walk loop forever, and would have done the same to every
later walk up the hierarchy.  Since each SOBJ chunk adds only one link, any
cycle must lead back to the subobject being read, so detect that during the
walk and treat the subobject as parentless.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-03 23:48:51 -04:00
Goober5000 1db8c586c5 Merge pull request #7813 from Goober5000/fix/bay_path_speed_ramp
Fix the fighterbay speed ramp on detoured departure paths
2026-10-02 21:42:03 -04:00
The Force fc626df89b Fix #7815 2026-10-02 20:52:51 +01:00
The Force d4b868daa0 Match Z Axis spinner limits with other axis 2026-10-02 20:30:16 +01:00
Goober5000andClaude Opus 5.5 b0d8862f18 Fix the fighterbay speed ramp on detoured departure paths
When a ship flying into a fighterbay has to route around the carrier,
create_model_path puts tangent and bisect points ahead of the bay path.
The departure speed ramp treated the first point of the AI path as the
start of the bay path: it started once the ship passed that point and
measured the path length from there.  On a detoured path the ramp
therefore began slowing the ship while it was still flying around the
hull, and the ship entered the bay slower than intended.  The ramp
fraction was also not clamped, so the target speed could exceed max
speed.

Under the new ai_profiles flag "$fix fighterbay speed ramp:"
(Fix_bay_speed_ramp), the departure ramp starts at the first point of
the bay path itself and the ramp fraction is clamped to [0, 1].  The
flag is enabled by default for mods targeting 26.2.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 21:16:46 -04:00
Goober5000 a93c808df3 Merge pull request #7814 from Goober5000/fix/model_path_refresh
Fix two issues with refreshing model paths in place
2026-10-01 21:13:06 -04:00
Goober5000andClaude Fable 5.1 048310ca25 log game settings after all tables have been parsed
Settings in game_settings.tbl were logged as they were parsed, so a setting was only logged if it appeared in a table.  A setting enabled through $Target Version was never logged, and a setting that appeared in more than one table was logged once per table, possibly with different values.

The settings are now logged by mod_table_log_settings, which runs at the end of mod_table_init.  The version-gated settings that previously had no log line now have one: framerate independent turning, scripted velocity, asteroid bounding box checks, the expensive turret target check, skybox depth consistency, zero-radius explosions, and insignias as decals.

Messages that describe the table text itself, such as deprecated options, removed file extensions, and out-of-range values, are still logged at parse time.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-01 20:05:09 -04:00
Goober5000 80652b13ea Merge pull request #7807 from Goober5000/fix/moment_of_inertia
fix the collision moment of inertia rotation
2026-10-01 20:02:11 -04:00
Goober5000andClaude Fable 5.1 d2f2374f5c fix the collision moment of inertia rotation, and flag the density fix
get_I_inv converts an object's inverse moment of inertia tensor from body to world coordinates for collision physics.  It was written as though vm_matrix_x_matrix(dest, a, b) computes a * b, but that function computes b * a, so the result was (R)(I_inv_body)(Rt) rather than the (Rt)(I_inv_body)(R) stated in the comment.  The collision response therefore used the tensor of an object facing the inverse of its actual orientation.  This dates back to retail.

The result is only correct for an isotropic tensor or an unrotated object.  Every retail ship has an anisotropic tensor, with a median principal-axis ratio of about 2.5 and as high as 13 for capital ships, so the spin imparted by a collision was typically about the wrong axis.

Since this changes collision behavior for every mod, the fix is controlled by the new game_settings.tbl option "$Fix collision moment of inertia:", which defaults to true for mods targeting 26.2 or later.  The retail path is otherwise unchanged.

PR #2575 fixed a related bug in physics_ship_init: retail scaled the inverse moment of inertia by $Density rather than by its inverse, so a denser ship was easier to rotate rather than harder.  That fix was merged without a flag.  For consistency it is now controlled by "$Fix density moment of inertia:", which defaults to true for mods targeting 21.0 or later.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-01 16:59:38 -04:00
Goober5000 89dedeb08e Merge pull request #7812 from Goober5000/fix/bay_path_name
Fix bay path speed lookup reading paths[-1] on detoured paths
2026-10-01 14:54:57 -04:00
Goober5000andClaude Opus 5.5 da08ae5b6e Fix bay path speed lookup reading paths[-1] on detoured paths
set_accel_for_docking took the model path from the first point of the
AI path. When a departing ship has to route around the carrier,
create_model_path prepends detour points whose path_num is -1, so the
path name was read from pm->paths[-1]. That usually yields junk and a
missed metadata lookup, but crashes when the memory before the paths
array is unmapped. Use aip->mp_index, which both bay path builders set
to the model path index.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 13:49:26 -04:00
Goober5000andClaude Opus 5.5 6fb9312982 Fix two issues with refreshing model paths in place
When the ship a path leads into moves, modify_model_path_points
re-globalizes the path's model points in place.

It always rewrote nverts points, but create_model_exit_path can build
a path with fewer, in which case the rewrite would run past the end of
the path into Path_points entries that may belong to other ships.  No
current caller builds such a path, but the rewrite now covers only the
points the path actually holds.

A subsystem path gives its second-to-last point a random offset when
created, but the refresh did not pass that point back in, so the
offset was lost the first time the target moved.  Record the
randomized vertex in ai_info and, under the new ai_profiles flag
"$fix subsystem path randomization on refresh:"
(Fix_model_path_refresh_randomization), reapply it on refresh.  The
flag is enabled by default for mods targeting 26.2.

Also rename a parameter in `get_base_path_info` (which is currently
unused) for clarity.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 13:47:07 -04:00
wookieejedi c23c69a538 Fix primary thruster glows rendering through geometry (#7805) 2026-10-01 11:18:58 -04:00
Goober5000 b37c6bcd93 Merge pull request #7811 from Goober5000/fix/subsys_path_bounds
fix off-by-one in the subsystem path bounds check
2026-10-01 10:53:00 -04:00
Goober5000 69e5017050 Merge pull request #7803 from Goober5000/fix/misc_loadout
two loadout-related fixes for FRED and QtFRED
2026-09-30 22:08:19 -04:00
Goober5000 976edb1b0f Merge pull request #7810 from Goober5000/fix/destroyed_submodels
handle submodel repair/destruction consistently
2026-09-30 22:07:18 -04:00
Goober5000 4a633c86cb fix off-by-one in the subsystem path bounds check
Fix indexing of `pm->paths` in `ship_return_subsys_path_normal`.
2026-09-30 22:06:22 -04:00
Goober5000andClaude Opus 5.5 f7eb2ca419 restore subsystem sounds when a subsystem is repaired
A subsystem's looping sounds are now switched by ship_update_subsys_sounds, split out of ship_recalc_subsys_strength, which the support-ship and automatic repair paths now also call when a subsystem comes back from zero.  Previously those paths left the subsystem playing its dead sound.

Both the recalc and do_subobj_destroyed_stuff also cleared the dead-sound flag immediately after assigning the dead sound, so a revived subsystem never stopped it and a destroyed one gained another copy on each recalc.  They now set the flag.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-29 02:58:50 -04:00
Goober5000andClaude Fable 5.1 112ca2fc4b handle submodel repair/destruction consistently
When a destroyed subsystem was repaired, its submodels were only restored if the repair was done through a SEXP.  A subsystem repaired by a support ship, by automatic repair, by a script, or through the debug console regained its hitpoints but not its submodels, so a ship could have a working turret with no model.  Any -destroyed form also remained visible.

All of these now call restore_subsystem_submodels, which brings back the subsystem's submodels and hides the -destroyed submodel linked to a special-point subsystem.  The -destroyed form of an ordinary submodel is hidden when the submodels are next replicated.  The SEXP code uses the same function, with no change in its behavior.

Destruction outside do_subobj_destroyed_stuff now goes through a new blow_off_subsystem_submodels function, which do_subobj_destroyed_stuff also uses.  It blows off both of the subsystem's submodels and shows any linked -destroyed submodel, unless the subsystem has "no disappear".  This handles the cases where a subsystem appears destroyed without going through do_subobj_destroyed_stuff:
- the subsystem is destroyed at the start of the mission
- the subsystem was destroyed in the previous mission of a red-alert sequence
- the ship changes class while the subsystem's submodels are blown off
Previously the first two blew off only the first submodel, ignored "no disappear" for it, and never showed a linked -destroyed submodel; the third did nothing.  For red alert, subsystems with no hitpoints at all are not treated as destroyed.  For a class change, the visible state is carried over rather than inferred from hitpoints, so a subsystem set to zero without being blown up, or repaired without its submodels, keeps its appearance.

Red alert also restores the submodels of a subsystem that the mission file starts destroyed if the previous mission's data gives it hitpoints.  Ship-copy-damage now shows or hides the -destroyed submodel linked to a special-point subsystem to match the copied state.

As before, the link between special-point subsystems and -destroyed submodels requires "$Link special-point subsystems to -destroyed submodels:" in game_settings.tbl.

The multiplayer hitpoint-update path is not changed.  A client receives subsystem hitpoints separately from the notification that a subsystem was destroyed, so a hitpoint update sent just before the destruction could arrive after it and wrongly restore the submodels.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-29 02:58:02 -04:00
Goober5000andClaude Opus 5 e65145a6d6 fix qtFRED's team loadout combo in single-team multiplayer missions
qtFRED's team loadout dialog enabled its team combo and its copy-to-other-teams button on MISSION_TYPE_MULTI, which encompasses more than just Team-versus-Team.  Gate both on Num_teams, which is what FRED's own loadout editor uses, and build the team list from the teams the mission actually has.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-25 03:22:23 -04:00
Goober5000andClaude Opus 5 a159e67a10 share the loadout usage-list code between the two editors
Add generate_ship_usage_list_team alongside the weaponry twin that already existed in missioneditor/common, so both loadout editors can drop their TVT/non-TVT branches and simply iterate Num_teams.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-25 03:22:23 -04:00
Goober5000andClaude Opus 5.5 8c8620ef0f don't look up the operator of an empty SEXP list
An empty list such as `( )` leaves get_sexp() with no start node, but it still passed that -1 to get_operator_const() for the ai-chase-any-except compatibility check and, outside FRED, for preloading.  This tripped the out-of-range assertion in debug builds.  Return the empty list directly instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-25 02:28:24 -04:00
Goober5000 33c4bb0222 make is_special_sender static 2026-09-25 01:52:15 -04:00
Goober5000andClaude Opus 5 fd40df069c validate counts and indices when reading POF chunks
Element counts were taken straight from the file, so a corrupt POF could
supply a negative count (stored alongside a null array) or one larger than
the fixed-size array it feeds.  Add pof_read_count() to floor every count at
zero and clamp it to the destination's capacity, reading past the discarded
entries where more data follows in the same chunk.

The upper bounds that were checked at all were checked with debug-only
Asserts, or with an Error() that returns if the user picks Debug, so the
overflowing loop after it was reachable in both cases.

Also validate the submodel indices in SOBJ and TGUN/TMIS, the vertex indices
in insignia faces, and bounds-check the split plane array before writing to
it rather than after.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-25 01:52:15 -04:00
Goober5000andClaude Opus 5 c10df878ba remove Current_filename_sub and tidy up stop_parse
Current_filename_sub dates back to the use of *_ex() parsing functions for parsing .eff files, which were superseded by the Bookmarks feature.  Today it is entirely redundant to Current_filename.  A read that throws now leaves Current_filename naming the file that failed, rather than the file parsed before it, as it should.

Also clear Current_filename in stop_parse, so that a warning issued between the end of one parse and the start of the next no longer blames the last file parsed, and null out Mp there so it stops dangling into the freed parse buffer.  Also delete the vestigial Mp_save.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-25 01:52:15 -04:00
BMagnu 90813e3716 Mirror scp-fs2open/nightlybuild#118 (#7802) 2026-09-24 08:08:36 +00:00
Goober5000andOpenAI Codex db02a71319 three QtFred fixes (#7780)
* Fix QtFRED root notifications when inserting nested operators

Only emit rootNodeFormulaChanged when the wrapped node is a formula
root. Inserting above a nested expression previously reported a child
as an event, goal, or cutscene root, causing assertions and out-of-bounds
accesses in the receiving dialog model.

Co-Authored-By: OpenAI Codex

* Give each QtFRED ship independently owned arrival and departure cues

Pass the tree model to the cue update handlers and serialize a separate
expression for each eligible ship. Sharing one formula across selected
ships caused double frees on subsequent edits and left other ships
referencing freed nodes when only one ship was changed.

This also avoids allocating unused expressions when cue updates are
disabled or no selected ships are eligible.

Co-Authored-By: OpenAI Codex

* Synchronize QtFRED item editability after SEXP node changes

Update native Qt editability alongside the shared model flags so
variable and container references cannot be edited as plain text.
Restore inline editing when a reference is replaced with ordinary data,
and preserve item flags when moving or copying branches.

Reject edit requests for protected items before setting the editing
state, preventing later programmatic changes from being treated as
user edits.

Co-Authored-By: OpenAI Codex
2026-09-24 13:23:23 +09:00
Goober5000andClaude Opus 5.5 04ba1b2015 type SEXP variable references by the variable's declared type (#7799)
When parsing a SEXP, a variable reference's node type was decided solely by whether it was quoted: "@Var" became a string variable and @Var a numeric variable, regardless of how the variable was declared.  A hand-edited SEXP with the wrong quoting therefore produced either a misleading "Not a number" error or a silently mistyped node that was saved back with the wrong quoting.

get_sexp now takes the node type from the variable's declared type, and flags a reference whose quoting contradicts it.  check_sexp_syntax reports such references (or any variable node whose type disagrees with its variable) as the new recoverable error SEXP_CHECK_VARIABLE_TYPE_MISMATCH: FRED flags it, and the game warns but still loads the mission, which runs correctly because the node type has been corrected.  Saving from FRED writes the corrected quoting.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-24 13:21:47 +09:00
BMagnu fcf9f569af safety checks for unused hud gauges (#7800) 2026-09-24 03:12:38 +00:00
Goober5000andClaude Opus 5 c342b6df61 Warn when a 3D shockwave model has no glow map (#7795)
Check each 3D shockwave model when it is loaded and warn if none of its textures has a glow map. The check is skipped when glow maps are disabled, since they are not loaded then.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-09-24 11:23:11 +09:00
Goober5000 5d89c6cce7 Merge pull request #7796 from Goober5000/fix/3999
Stop the deferred light pass from lighting unlit models
2026-09-23 21:04:44 -04:00
Goober5000 d56e7f1bc1 Merge pull request #7797 from Goober5000/fix/shockwave_fade
Restore the 3D shockwave fade, and time animated base textures like the glow map
2026-09-23 21:04:12 -04:00
Goober5000 f51ae61551 Merge pull request #7792 from Goober5000/fix/offscreen_indicator
Fix the offscreen target indicator flickering when targeting a subsystem on a distant ship
2026-09-23 21:03:47 -04:00
Goober5000andClaude Fable 5.1 11781a5081 Offscreen indicator: read the clipped vertex before freeing it and fix the min-side clamps
The overflow flag and screen position were read from a temp vertex
already returned to the pool, which only worked because nothing
allocated in between. Copy them out first.

The clamps that keep the indicator away from the top and left of the
clip rectangle subtracted the clip origin instead of adding it, and
dropped it from the clamped value. Inert while the origin is zero, but
wrong for any other clip rectangle.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-23 00:07:19 -04:00
Goober5000andClaude Fable 5.1 b609a6857b Time an animated shockwave base texture like its glow map
A 3D shockwave's glow map already takes its frame from the shockwave's
elapsed time so the animation spans the shockwave's life.  Do the same
for an animated base texture, and skip the radius fade for it, since the
artist's frames then control the brightness the way they do for the glow.
A static base texture still fades with the radius.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 01:58:37 -04:00
Goober5000andClaude Fable 5.1 537ad2788d Stop the deferred light pass from lighting unlit models
Models drawn without lighting under deferred rendering copy their base
colour into the emissive buffer and zero the ambient occlusion factor,
but still write their real diffuse and specular data to the G-buffer.
Each direct light then adds diffuse and specular on top of the emissive
copy, and the environment map adds its specular term, so the "no
lighting" flag only appeared to work in dark scenes.

Zero the diffuse and specular outputs after the emissive copy.  The
specular alpha is the Fresnel factor, so clearing the whole vector also
removes the grazing-angle sheen.

Fixes #3999

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 01:46:29 -04:00
Goober5000andClaude Fable 5.1 1bfa46eabe Restore the fade on unlit additive model draws
3D shockwaves pass `1 - radius/outer_radius` as the warp alpha, which `model_render_determine_color` turns into the material colour for additive draws.  Since a481999a2 (SamuelCho's OpenGL Code commit in August 2016), the model fragment shader has not multiplied the diffuse sample by that colour in the unlit branch, so the base texture stayed at full brightness and vanished abruptly.  The same path carries the warp effect's radius fade and the alpha of unlit transparent weapons.

Clamp the alpha before converting it to a byte, as the pre-2016 code did; thrusters pass 1.2, and without the clamp they would now render dim.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-22 01:27:49 -04:00
Fabian Woltermann 115491f8a9 Refactor RT shadow handling and Vulkan depth operations (#7685)
- Introduced `shadow_ray_params` to simplify ray origin and cull mask management.
- Shifted shadow ray origins to TLAS-relative space for improved precision and consistency, especially for cockpit rendering.
- Refactored cascade bind functions, adding `shadow_cascade_params_bind_deferred()` for consolidated offset/count handling in deferred lighting.
- Expanded TLAS to include cockpits and additional object types, ensuring parity with rasterized shadows.
- Introduced per-instance cull masks to address cockpit self-shadowing issues.
- Improved Vulkan depth isolation for cockpit rendering via backup/restore mechanism, ensuring correct depth sampling in later passes.
- Extracted reusable helper functions for cockpit rendering state logic.
2026-09-21 05:12:55 +02:00
Goober5000andClaude Opus 5 0dcee2a6be Add scripting access for per-guarder guard ranges (#7794)
Follow-up to #7606.  Restore the MaxGuardRadius property, restore the ability to set specific ranges using set-guard-range, and add scripting functions for setting the specific ranges.

Fixes #7756

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-09-21 05:12:47 +02:00
Goober5000andClaude Opus 5 09fc7055b5 Fix FRED and qtFRED memory leaks at exit (#7784)
Neither editor had a teardown to match FSO's game_shutdown(), so the engine
data they set up was never freed.  Add editor_free_engine_data() to free it,
and call it from a new fred_shutdown() in FRED and from qtFRED's shutdown(),
before the graphics system closes.

Also:
- Delete FRED's modeless editors if they are still open at exit.
- Make FRED's dialog tooltips and sexp tree image lists members, since
  they were leaked or depended on OnDestroy() being called.
- Parent qtFRED's item models so they are deleted with their widgets.
- Enable the CRT leak report in qtFRED, which previously had none.
- In qtFRED, call shutdown() last in closeEvent(), since it destroys the
  window.
- Make the preferences path and user SID strings function-level statics,
  so MFC's leak dump no longer reports them as leaks.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-09-21 05:12:35 +02:00
Goober5000 d841f0a08b Merge pull request #7791 from Goober5000/fix/bigendian_bsp_swap
Fix big-endian swapping of SORTNORM2 and TMAP2POLY chunks
2026-09-19 14:41:08 -04:00
wookieejedi eb558395fd Update freespace.cpp (#7788)
Bug:
"No matter what value I'm setting in default_settings table with the entry below, it doesn't affect any new pilots I create."

Cause:
The skill option's table parser only sets Game_skill_level directly. Every other place that asks for "the default" ignores it and uses the hard-coded DEFAULT_SKILL_LEVEL (1, which is "Easy"), so the tabled value gets overwritten twice:

At startup (freespace.cpp:1919-1920): default_settings_init() sets Game_skill_level from your table. Then loadInitialValues() runs right after. If Game.SkillLevel isn't saved in the ini yet, it falls back to default_func. That returned the constant 1, and bind_to wrote it back over your value.
When a pilot is created (managepilot.cpp:100): init_new_pilot() does Game_skill_level = game_get_default_skill_level(), which also just returned the constant.

This PR follows the same strategy of settings like sound volume to allow modders to specify a default setting for difficulty.
2026-09-19 15:54:22 +02:00
Goober5000andClaude Fable 5.1 12323ef3f6 Fix the offscreen target indicator drawing with uninitialized position and direction
HudGaugeOffscreen::calculatePosition could return without writing its
outputs, either when the eye vertex overflowed or when the clipped
point landed a pixel or two inside the clip rectangle. The caller drew
anyway, so the indicator appeared at a random spot with a random
orientation that changed every frame. This showed up when targeting a
subsystem on a distant ship, where the clip loses enough precision to
hit the second case.

calculatePosition now returns whether it found a position, and both
callers skip drawing when it did not. The inside case falls back to
the nearest screen edge, since the point is already known to be off
screen, so the indicator stays steady instead of blinking.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-18 00:50:39 -04:00
Goober5000andClaude Fable 5.1 0f15b1b637 Store the targeted subsystem position in the current target's display list entries
The projected point was the subsystem but the stored position was the
hull centre, so the offscreen indicator sized its triangles for a
different point than the one it clipped against.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-18 00:50:39 -04:00
Goober5000andClaude Fable 5.1 b519bc8945 Set both flags when g3_project_vertex hits a vertex at zero depth
The expression used & instead of |, so neither PF_OVERFLOW nor
PF_PROJECTED was ever set on that path.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-17 23:15:11 -04:00
Goober5000andClaude Opus 5 ea75eda29d Fix big-endian swapping of SORTNORM2 and TMAP2POLY chunks
swap_bsp_sortnorm2 swapped the bounding box at offsets 8 and 20, which
re-swapped the front list offset and left the real box (at 16 and 28)
unswapped.  swap_bsp_tmap2poly never swapped the chunk's bounding box
or normal.  Both corrupted models using these chunks on big-endian
builds.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-17 22:20:31 -04:00
Taylor Richards 573ed72d4d fix prebuilt lib requirement for vulkan (#7789)
If prebuilt Vulkan was disabled, but a system-wide Vulkan install wasn't
found, then a fallback was available using prebuilt libs. Unfortunately
this does ultimately require the prebuilt libs be available which isn't
always wanted (or possible), so drop the fallback and just require Vulkan
instead.

Fixes #7786
2026-09-16 05:26:07 -04:00
Goober5000 0c33d9b90a Merge pull request #7787 from wookieejedi/fix-forum-post
Update forum.py
2026-09-15 23:30:43 -04:00
wookieejedi 8fae311924 Update forum.py 2026-09-15 09:40:48 -04:00
Fabian Woltermann 74fc04f7af silly claude, that's not how shields work (#7785) 2026-09-15 06:28:06 +02:00
Goober5000 bd5972c0ec Merge pull request #7781 from Goober5000/fix/mem_leak
Fix three memory leaks and make the debug leak check accurate
2026-09-14 21:49:21 -04:00
Goober5000andClaude Opus 5 519e3aef21 Fix three memory leaks and make the debug leak check accurate
Report leaks after static destruction via _CRTDBG_LEAK_CHECK_DF instead of calling _CrtDumpMemoryLeaks() at the end of main(), which incorrectly reported every global container as a memory leak.

Also fix the three remaining real leaks which were discovered after all the noise was cleared up:
- Mc_point_list was never freed, because its atexit cleanup was only registered by code that no longer runs.  But the list was only a temporary array of pointers used while building the collision tree, so remove it and have model_collide_parse_bsp_defpoints() copy the vertices directly into the tree's point list.
- model_batch_buffer's Mem_alloc copy was never freed.  But the copy is actually not necessary, so remove it and pass Submodel_matrices directly.
- Goal_target_names strings were only freed when the next mission was parsed, so the last mission's names leaked at exit.  Hold them in SCP_vm_unique_ptr so they are freed with the vector.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-13 14:25:01 -04:00
Goober5000 1020a19855 Merge pull request #7755 from Goober5000/feature/giveorder-dockpoints
Allow giveOrder to specify dockpoints for ORDER_DOCK
2026-09-13 12:03:21 -04:00
Goober5000 5d45ba4de9 Merge pull request #7777 from Goober5000/fix/Cockpit_active
Replace the Cockpit_active global with computed predicates
2026-09-12 03:04:29 -04:00
Kestrellius 996e2fef6b Option to disable main fireball when ship is destroyed (#7179)
* add toggle

* minimize diff

* rebase gore

* whitespace

* move line
2026-09-11 23:28:14 -07:00
BMagnu 1cd85cbd63 Reorder HID deinit (#7778)
Close spacemouse -> Close HID -> Close SDL
2026-09-12 03:57:27 +00:00
Goober5000andClaude Opus 5 e2be023f84 Replace the Cockpit_active global with computed predicates
Cockpit_active was latched inside ship_render_player_ship(), which only
runs when Viewer_obj is non-null.  External, chase, warp-chase, topdown,
free-camera and dead views all null Viewer_obj, so the flag froze at its
last cockpit-view value and cockpitinactive HUD gauges vanished.  It was
also read before being written each frame (by the show-ship check and the
shadow helpers), so those decisions lagged a frame on any transition.

Replace it with three functions computed on demand:
- ship_cockpit_enabled(sip): the ship has a cockpit model and cockpits
  aren't disabled; used by the Show_ship_only_if_cockpits_enabled checks
- ship_render_player_cockpit(sip): the above, outside topdown view;
  replaces three duplicated copies of that expression
- ship_render_player_cockpit_active(): whether the viewer's cockpit is
  being rendered this frame; used by the HUD cockpit-view-choice checks

With the predicate correct, the VM_CHASE special cases added for #4804
are no longer needed and are removed.  In chase view, cockpitinactive
gauges now also respect pop-up state, No_ets, and setRenderOverride,
which the early return in HudGauge::canRender() used to bypass.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-11 23:39:05 -04:00
Goober5000andClaude Opus 5 2addd90aed ci: run the unit tests against SDL's dummy video driver (#7779)
The Linux Debug legs fail memcheck on six "definitely lost" contexts
(480 bytes in 12 blocks), all allocated under the temporary
SDL_InitSubSystem(SDL_INIT_VIDEO) in resolution_default(). SDL probes its
real video backends, dlopens libX11, and keeps a few small blocks across
the matching SDL_QuitSubSystem().

These are the same six contexts #7657 suppressed via fun:X11_CreateDevice.
That suppression stopped matching when #7774 bumped the prebuilt libs:
62c89ef6 shipped libSDL3.so.0.2.14 with a full .symtab (433 distinct X11_*
symbols), b57636e0 ships a stripped libSDL3.so.0.4.14 (none). X11_CreateDevice
is a static function, so valgrind can no longer resolve it and every libSDL3
frame prints as ???. Every PR branch based on post-bump master fails this leg.

Rather than rewrite the suppression around object wildcards, stop allocating
the memory in the first place. The unit tests never open a window and the
runners are headless, so pin SDL_VIDEODRIVER=dummy: SDL skips backend probing
entirely, libX11 is never loaded, and the leaks do not happen. It also makes
the tests behave identically whether or not the runner has a display. No test
depends on the real desktop mode; the only resolution test sets an explicit
override.

The os_init suppression stays. That leak is from SDL_Init(SDL_INIT_EVENTS)
and SDL_hid_init(), not from video, so the dummy driver does not affect it.
The X11_CreateDevice block also stays, as a backstop for running memcheck by
hand, now with a comment recording why it is inert in CI.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-09-12 03:09:54 +00:00
Goober5000andClaude Opus 5 1fdb67649c Clear cockpit depth mask each frame so lightshafts don't use a stale one (#7775)
Views that don't render the cockpit (external, chase, topdown, etc.) left
Cockpit_depth_texture holding the last cockpit-view frame, so the lightshaft
pass painted that silhouette.  Fixes #7568.

Co-authored-by: Claude Opus 5 <[email protected]>
2026-09-12 02:59:38 +02:00
Goober5000 aee08e2bc8 Merge pull request #7759 from Goober5000/feature/remove_weapon_class_limits
Remove the weapon class limit
2026-09-10 16:29:51 -04:00
Fabian WoltermannandClaude Opus 5 9ec157833b Add command-line option overrides to options system (#7561)
* Add command-line option overrides to options system

- Extend `OptionsManager` to support storing and displaying reasons for overrides.
- Update related code paths to prioritize command-line overrides, ensure correct option resolution, and display override details in the UI.
- Add unit tests for override behavior and round-trip validation.
- Remove unused legacy functions (`removeVSyncOption`, `removeWindowModeOption`) in favor of the new system.

* Add unit tests for `Graphics.Anisotropy` option validation with and without OpenGL

* Add support for associating command-line option names to `OptionsManager` overrides

- Update HDR, shadow rendering, and graphics API option overrides to include their respective command-line flag names.
- Refactor `Graphics.RenderAPI` to use the `GraphicsAPI` enum instead of raw integers for better type safety and clarity.
- Ensure Vulkan support logic and fallback behavior function correctly with the updated options system.
- Update unit tests to validate override functionality and enum-based API configuration.

* Remove unused `removeVSyncOption` function

* Apply the PR review feedback for the command-line option overrides

Delete the unit-test run artifacts that this branch committed by mistake, and
add .gitignore rules for the files that the unittests binary writes.

Give an override priority over an in-session edit again. The options UI now
shows a disabled control for an overridden option, and setConfigValue()
refuses an edit for an overridden key. Before this change, a save wrote the
edit to the config file and applied it to the bound global, but getValue()
kept returning the override. The game and the options menu then showed
different values for the rest of the session.

Add a setOverride() overload that takes a JSON value. Every command-line flag
now builds its override with json_integer, json_real, json_true, json_false
or json_pack, in place of a hand-formatted string.

Make Graphics.CockpitFOV and Graphics.CockpitFOVToggle independent of the
order in which the options manager loads them, and remove the forced override
on the player's toggle preference. The toggle listener also replaces an
identical bind_to() call that made the listener dead code.

Add 16 to the values of Graphics.MSAASamples. The -msaa flag accepts 16, so an
override with that value made printValues() report an invalid value.

Keep the render API that the caller gives to gr_init(). Only a Default value
now comes from the Graphics.RenderAPI option, so FRED and the unit tests keep
the backend that they ask for.

Make the default_func of Graphics.Shadows and Graphics.ShadowRenderMethod
return their global. A constant discarded the value that -enable_shadows and
the mod table set. Set Max_rt_shadow_local_lights to 4, because 3 is not one
of the values that the option offers.

Also: resolve -lang one time, share the render API name with version.cpp,
correct the stale comments, and add unit tests with a fixture that clears the
overrides after each test.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UGh4ZM2u4oUGSbrP122Uyr

* Fix the order-dependent crash in the MSAA option test

The test `MsaaOverrideAcceptsEverySampleCountTheFlagAllows` calls
`getValidValues()`. `Option<T>` makes a display string for each value, and the
display function of `Graphics.MSAASamples` calls `XSTR()`. `XSTR()` runs
`Int3()` if `lcl_xstr_init()` did not run before. Only `FSTestFixture` runs it,
and `Xstr_inited` stays set for the remainder of the process. Thus the shuffled
test order decided if the test passed or if it stopped the test binary with
SIGILL.

Move that one test to a new fixture that derives from `FSTestFixture`. The
fixture initializes localization, and it also clears the overrides after each
test. Refresh the comment that told that the test binary never runs
`lcl_init()`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UGh4ZM2u4oUGSbrP122Uyr

---------

Co-authored-by: Claude Opus 5 <[email protected]>
2026-09-10 13:14:18 +02:00
Taylor Richards a6136507ff bump prebuilt version (#7774)
Updates SDL version (fixes #7710)
Updates MoltenVK to fix numerous Mac specific Vulkan issues
2026-09-10 11:23:16 +02:00
Goober5000andClaude Fable 5 ba2505c3ac preserve custom player wing arrival cues (#7160) (#7716)
FRED and qtFRED no longer overwrite a hand-edited arrival cue on the wing
containing the player start.  The cue is editable when the wing has multiple
waves (where it governs the arrival of subsequent waves) and read-only
otherwise.  Waves and threshold are now editable for the single-player
player wing, while the arrival delay remains locked; the arrival location
is editable in both editors.

Both error checkers flag a single-wave player wing with a custom cue as a
potential issue, and the engine now warns and aborts the mission load,
rather than tripping an Assert, if the player start ship was not created
at mission start.

Also fix an unguarded read of Ships[Player_start_shipnum] in both editors.

Co-authored-by: Claude Fable 5 <[email protected]>
2026-09-10 11:22:30 +02:00
wookieejedi 643576b967 Safeguard divide by 0 for extra collision avoidance (#7773)
* Safeguard divide by 0 for extra collision avoidance

Extra collision avoidance could have divided by zero, so just safeguard that possibility.

* one more div 0 failsafe
2026-09-09 12:40:38 -04:00
Goober5000andClaude Opus 4.7 190472f77e Remove the weapon class limit
With every fixed-size weapon-class-indexed structure now converted to dynamic containers, we can finally remove the `MAX_WEAPON_TYPES` limit!

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-09-08 13:20:36 -04:00
Goober5000andClaude Fable 5.1 37b0b6ea82 Standardize isValid across the Lua API by making the types auto-generate it (#7761)
* Automatically generate the isValid() Lua API function for handle types

If an ADE object's stored type has an isValid() member, ade_obj now registers an isValid function for it automatically.  An explicit ADE_FUNC(isValid, ...) declared after the ADE_OBJ replaces the generated one, so types with special semantics (e.g. sound) keep their own.  The 67 hand-written functions that merely delegated to the member are removed, and 26 types that previously exposed no isValid() gain one.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* Add ADE_OBJ_VALIDATOR for index-based Lua handles

Int-index handles (shipclass, weaponclass, team, etc.) can now declare their validity predicate with a single ADE_OBJ_VALIDATOR or ADE_OBJ_VALIDATOR_RANGE line after the ADE_OBJ.  The registered validator drives the generated isValid() function and is also honored by ade_set_args when the mod table asks for nil instead of invalid objects, which previously never applied to these handles.  The 19 hand-written range-check functions are replaced, and loadout_ship, default_primary, default_secondary, and support_rearm_pool_team gain isValid().  Add a validator to HudGauge while we're at it.

Also fully qualify the scripting namespace in LuaConvert.h so its templates can be instantiated from the unit tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-09-08 10:50:53 -04:00
Goober5000andClaude Opus 4.7 a168f5a9c0 Store the support rearm pool sparsely (#7758)
`support_ship_info::rearm_weapon_pool` was a dense per-weapon-class array where -1 = unlimited (the default), 0 = not rearmable, and >0 = remaining stockpile.  Convert it to a sparse per-team map:

  `std::array<SCP_map<int, int>, MAX_TVT_TEAMS> rearm_weapon_pool;`
  `int rearm_pool_default() const;  // -1, or 0 under rearm_pool_from_loadout`

Mission-file format and save output are unchanged.  Also tightens the two weapon-class bounds checks in ship.cpp.  This removes another `MAX_WEAPON_TYPES` sized structure on the way to lifting the weapon class limit.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
2026-09-08 10:50:22 -04:00
Shivansps 8e60b69922 Fix unused param warnings when compiling with openxr off (#7770) 2026-09-08 10:48:50 -04:00
BMagnu a73e2565c8 Add Vulkan + Wayland init logic for OpenXR (#7767)
* Add Vulkan + Wayland init logic for OpenXR

* typo

* clang tidy
2026-09-08 10:48:33 -04:00
wookieejedi 3ac8be273e fix jump in chase view (#7771)
Chase view deltas are not reset on mission init, so ensure they are reset to prevent the viewing jumps that can be seen at the start of mission in chase view. Also ensure perspective and slew lock are properly resotred.
2026-09-08 10:48:13 -04:00
Shivansps d8afb71d41 Clear bsp_data from bsp_info after it has been used (#7754)
* clear bsp_data from bsp_info after has been used

* fix redundant redeclaration

* remove continue on null bsp_data
2026-09-08 10:47:55 -04:00
Goober5000 8aa07a3e9a Merge pull request #7764 from Goober5000/fix/firingpoints_followup
fix weapon substitution bank attribution and turret ammo accounting
2026-09-06 14:53:14 -04:00
Goober5000 66d468d611 Merge pull request #7766 from Goober5000/fix/virtual_pof_glowpoints
fix copying multiple glow point banks into a virtual POF
2026-09-06 14:12:41 -04:00
BMagnu 95f63218d8 Also set custom gauges + dradis radar to slew (#7769) 2026-09-06 14:39:07 +00:00
Goober5000andClaude Opus 5 086c553339 fix copying multiple glow point banks into a virtual POF
Every copied bank was written to the same array slot, so all but the last
were lost, and the slots left behind kept their zero-initialized contents.
A zeroed bitmap handle is slot 0 rather than -1, so the paging code would
then page out an unrelated bitmap.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-06 00:49:33 -04:00
Goober5000andClaude Fable 5.1 04e698c29b fix weapon substitution bank attribution and turret ammo accounting
Follow-up to #7635.

Pass the firing bank explicitly through weapon_create() and beam_fire()
instead of searching the ship's banks by weapon class, which could
attribute substitution patterns to the wrong bank.  Factor the
substitution logic into get_weapon_substitution_tuple() and only apply
linked/dual-fire pairing to ship-level fire, not turret fire.  Skip
substitution on multiplayer clients, since the server already resolved it.

Derive turret bank indices from the weapon slot being fired rather than
the turret's bank cursor, so ammo and substitution state are tracked on
the bank that actually fired.  Previously a single-selection turret could
consume ammo from a bank it never fired, and non-ammo turrets (whose
cursors stay at -1) would have skipped substitution entirely.

Use the Player_ship object flag rather than Player_obj in
ship_secondary_bank_can_dual_fire() so the server and clients agree on
dual fire for remote players, and guard ship_secondary_has_ammo() against
a negative bank index.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 19:22:45 -04:00
Goober5000 1a48c2d2a6 Merge pull request #7760 from Goober5000/fix/fred_label_line_spacing
Scale font line and tab advance by the font scale factor
2026-09-03 15:49:25 -04:00
Goober5000andClaude Opus 4.8 f3817c80fa Scale font line and tab advance by the font scale factor
Multi-line and tabbed strings drawn with a scaleMultiplier != 1 overlapped
or misaligned because the font code advanced newlines and tabs by the
unscaled font height/tab width -- most visible in FRED's viewport labels
now that they honor an adjustable font scale.

Scale the newline and tab advance in both the rendering and measurement
paths of each backend: the NVG path (gr_string and NVGFont::getStringSize)
and the VFNT path (gr_string_old and VFNTFont::getStringSize), which also
gains tab handling.  The tab width is hoisted onto the shared FSFont base
so both backends share it.

While here, pass the FSFont wrapper to gr_string_old instead of a bag of
scalars, make its font pointer const, and consolidate the
get_char_width_old externs into a single declaration in font_internal.h.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-09-03 01:55:03 -04:00
Goober5000 7e91fd00f7 Merge pull request #7746 from Goober5000/feature/remove_ship_class_limits
Remove the ship class limit
2026-08-30 23:44:24 -04:00
Goober5000 b08ab184ff Merge pull request #7757 from Goober5000/fix/flagset_64bit
Fix 32-bit truncation in the flagset u64 round-trip
2026-08-30 23:36:54 -04:00
Goober5000andClaude Opus 4.7 f353ca7d18 Remove the ship class limit
With every fixed-size ship-class-indexed structure now converted to dynamic containers, we can finally remove the `MAX_SHIP_CLASSES` limit!

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-30 23:00:29 -04:00
Goober5000 3db90491ab Merge pull request #7739 from Goober5000/refactor/loadout_ui
Refactor selection screen data storage to remove fixed arrays
2026-08-30 20:21:40 -04:00
Goober5000 e4ea11b95c Merge pull request #7735 from Goober5000/cleanup/sexp_syntax_checking
clean up check_sexp_syntax and improve caching
2026-08-30 19:58:52 -04:00
Goober5000andClaude Opus 4.8 3f5cf1c87c Release all teams' select-screen icon handles
Fix bitmap and model handle leakage in the ship/weapon select screens, and make release symmetric with load:

 * Initialize each team only once in `ship_select_common_init`
 * Unload every team's map in `ss_unload_team_icons`, not just the active one.
 * Add a per-team unload helper and use it in the load-all functions

Also drop the stray per-icon Cur_Anim unload, and call `wl_free_ship_class_data` before loading in `wl_init_ship_class_data`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-30 19:08:55 -04:00
Goober5000andClaude Opus 4.7 3f335b2b89 Store selection-screen UI data sparsely
Convert the mission ship/weapon select screens' per-class UI state from dense MAX_SHIP_CLASSES / MAX_WEAPON_TYPES arrays to sparse containers keyed by loadout-pool membership, matching the Ss_pool / Wl_pool maps they shadow:

  ss_icon_info Ss_icons_teams[][MAX_SHIP_CLASSES] -> SCP_map<int, ss_icon_info>[]
  wl_icon_info Wl_icons_teams[][MAX_WEAPON_TYPES] -> SCP_map<int, wl_icon_info>[]
  wl_ship_class_info Wl_ships[MAX_SHIP_CLASSES]   -> SCP_map<int, wl_ship_class_info>
  int Plist[] / Slist[] + manual size counters    -> SCP_vector<int>

The ship-select active list is replaced outright by a vector of ship classes rebuilt on each interface sync, plus the existing scroll offset.  active_list_remove() was dead code and is deleted.

Behavior fixes required by the conversion:

 * wl_set_disabled_weapons now computes usability flags for the pool
   weapons plus every weapon currently in a slot's banks, instead of all
   weapon classes.  (Bank weapons are not guaranteed pool members.)

 * The two mouse-region handlers that read Plist[Plist_start+index] for
   raw indices 0..3 now bounds-check against the list size (as does
   ss_get_ship_class_from_list).

 * wl_unload_icons and the ss unloaders early-return on a null team
   pointer instead of asserting and dereferencing.

The ship side loads icons for every pool class including exhausted 0-count entries while the weapon side loads only positive counts, preserving the existing asymmetry.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-30 19:08:55 -04:00
Goober5000andClaude Opus 4.7 ba7aa70794 Fix 32-bit truncation in the flagset u64 round-trip
Mission flags are saved to the mission file as the full 64-bit flagset value, but three issues prevented anything larger than 32 bits from being saved as intended:

 * `stuff_flagset` parsed the value with `stuff_long`, where `atol` clamps anything above `LONG_MAX`
 * `flagset::from_u64` cast the incoming value to `unsigned long`, truncating bits 32-63
 * `flagset::to_u64` used `bitset::to_ulong` where it should use `bitset::to_ullong`

Fix these issues and add `static_assert` in the flagset functions to defend against future issues.  Also use the proper UINT64_T_ARG where it should be used.

This was first triggered by `Limited_support_rearm_pool`, the first mission flag to occupy bit 31.  Only mission flags are affected; the other flagset serialization paths were audited and are safe.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-30 16:46:11 -04:00
Goober5000andClaude Opus 4.8 659cb18e07 Allow giveOrder to specify dockpoints for ORDER_DOCK
The giveOrder scripting function now accepts optional DockerPoint and
DockeePoint arguments for ORDER_DOCK, each given as a dockpoint name or
one-based index (matching the setDocked convention).  DockerPoint refers
to a dockpoint on the ordering ship and DockeePoint to one on the target.

If only one point is specified, a compatible point is chosen automatically
on the other ship using the same dock-type precedence as the existing
automatic dockpoint negotiation.  When neither is specified, behavior is
unchanged.

Fixes #7119

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-29 19:03:48 -04:00
Fabian Woltermann 68e9a30463 Fix a couple of oversights in prop collisions (#7753)
* Fix estimate_ship_speed_upper_limit to handle non-ship objects gracefully

* Add collision handling for OBJ_PROP objects

Implement OBJ_PROP-specific collision messaging and logic: update player death messages, fix incorrect argument usage in collision checks, and set killer attributes for PROP collisions.
2026-08-29 11:17:07 +02:00
Goober5000 98b416183b Merge pull request #7743 from Goober5000/refactor/alt_ship_class_dlg
Store alt-ship-class combobox indices as item data
2026-08-28 16:49:17 -04:00
Goober5000 6309515d3e Merge pull request #7742 from Goober5000/refactor/shield_sys_types
Store the shield-system editor types in a map
2026-08-28 16:49:01 -04:00
Goober5000 b53fde2a1d Merge pull request #7741 from Goober5000/refactor/weapon_classes
Remove MAX_WEAPON_TYPES from AI and ship-parse weapon buffers
2026-08-28 16:48:52 -04:00
Goober5000 1c817b5965 Merge pull request #7737 from Goober5000/refactor/team_data
refactor team loadout data structures in preparation for lifting the ship class limit
2026-08-28 16:48:39 -04:00
Goober5000andClaude Fable 5 d413e52b33 External weapon model refactor: consolidate per-bank state, fix design issues (#7634)
* consolidate per-bank external weapon model state into one struct

The state for a bank's external weapon model was scattered across two
structs and three naming schemes: the model instance and its weapon in
ship_weapon, the firing-point chain counter in a combined array indexed
with the bank + MAX_SHIP_PRIMARY_BANKS packing convention, and the
gatling spin rate/angle on ship itself.

Gather them into external_weapon_state, with one array for primary
banks and one for secondary banks in ship_weapon.  This removes the
index-packing convention (ship_get_external_model_fp_offset now takes
the bank's state directly), and ship_delete now also frees secondary
instances should a future weapon ever create one.

No behavior change.

Co-Authored-By: Claude Fable 5 <[email protected]>

* update external weapon model spin in per-frame processing

The gatling spin state was integrated inside ship_fire_primary (spin-up)
and ship_stop_fire_primary_bank (spin-down), which entangled a per-frame
visual/state update with the firing event paths and had two quirks:

- Spin-down only ran when something called the stop-fire path, so a bank
  could freeze mid-spin (e.g. AI ships that stop calling
  ship_fire_primary without going through ship_stop_fire_primary).
- The spin angle only advanced when the ship class set
  $Show Primary Models:, so identical weapon state evolved differently
  per ship class even though the rate (which gates firing) always ran.

Banks that try to fire now just request spin-up, and
update_external_weapon_spin() -- called from ship_process_post next to
update_reload_percent(), which was moved out of the physics code for
the same reason -- integrates the rate and angle every frame.  The
firing gate (no shots until the barrels reach full speed) is unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>

* make external_model_num mean what it says; gate firing offsets on drawn models

Since the original 2005 implementation, external_model_num was bashed
to model_num at parse time when no $External Model File: was given, so
every POF-rendered weapon appeared to have an external model.  All the
checks downstream therefore tested 'has any model' while reading as
'has an external model', and two paths leaked the fallback into
gameplay:

- ship_fire_secondary applied the external-model firing point offset
  without checking $Show Secondary Models: (unlike the primary path),
  so any missile whose own in-flight POF contained gun points would
  have its launch position offset on every ship in the game.
- The AI line-of-sight check, copied from ship_fire_secondary,
  applied the offset with no draw check for either bank type, so for
  primaries it could disagree with the actual firing path.

external_model_num now stays -1 unless $External Model File: was
given.  Rendering code (ship_render_weapon_models, the HUD hardpoints
gauge, and the gatling instance helper) falls back to the weapon's own
model at the point of use, preserving the existing display of missiles
on hardpoints.  Firing point offsets now require a dedicated external
model *and* the bank's models to actually be drawn, in all three
paths.  In practice this does not change firing behavior, because GPNT
chunks are never added to weapon models except when explicitly built
as external models.

Co-Authored-By: Claude Fable 5 <[email protected]>

* warn on external weapon model conventions that are silently ignored

Two load-bearing conventions of the external weapon model feature had
no diagnostics:

- Only the first gun bank of an external model supplies firing points;
  additional banks are silently ignored.  Warn when an external model
  has more than one gun bank.
- $Show Primary Models: / $Show Secondary Models: must list exactly
  one bool per weapon bank; missing entries silently default to not
  drawing.  Warn when the list length doesn't match the bank count.

Co-Authored-By: Claude Fable 5 <[email protected]>

* orient external weapon models along their slot's firing normal

External weapon models were always rendered pointing ship-forward, and
reloading missiles slid backward along fixed -Z, regardless of the gun
or missile point's normal -- so a bank angled 45 degrees outward fired
along its normal while its mounted model pointed dead ahead.  The
per-slot angle offset was also applied as a roll about ship-forward
rather than about the firing axis.

ship_get_weapon_model_slot_transform now builds the slot orientation
from the firing normal (identity for the usual dead-ahead normal, so
existing forward-facing mounts render exactly as before) with the
angle-offset roll applied about that axis, and slides reloading
missiles along the normal.

Correspondingly, ship_get_external_model_fp_offset now rotates the
external model's firing-point offset by the same slot transform, so
shots continue to emerge from the drawn barrels on angled mounts, and
now also respect the angle-offset roll (previously the offset was
added unrotated, mismatching rolled models).

Co-Authored-By: Claude Fable 5 <[email protected]>

* address review: same-frame spool-up gating; optional slot transform outputs

Move the update_external_weapon_spin() call from ship_process_post() to the top of ship_process_pre().  The update now happens before any firing attempt in the frame, so the spool-up firing gate sees the current frame's spin rate, as it did on master where the update happened inside the firing code.  This also makes the ordering consistent for the AI regardless of Framerate_independent_turning.

Also make both outputs of ship_get_weapon_model_slot_transform() optional.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-27 22:08:06 -07:00
Goober5000andClaude Opus 4.8 947d3d9bdd Fix qtFRED crash when opening ship texture dialog on placeholder slot (#7748)
The ship texture replacement dialog builds parallel per-slot arrays sized to pm->n_textures, but only populates the "main"/subtype map entries for real textures; blank and duplicate texture slots are left as empty-map placeholders (with an empty default name). The dialog constructor then force-selected row 0, and getMap()/setMap() raised a fatal error_display when "main" was absent, so any ship whose first texture slot is blank or a duplicate crashed the dialog on open.

getMap()/setMap() now treat an empty default name as a non-editable placeholder.  The constructor also selects the first real texture row rather than blindly row 0.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-27 19:26:09 +00:00
Goober5000 87189525e0 clean up check_sexp_syntax and improve caching
- Clean up `check_sexp_syntax` to use `eval_ship` (and incidentally `eval_wing` and `eval_prop`) rather than the old lookups.
- Disable SEXP node caching while FRED is running.  Also use smart pointers and fix a cache memory leak.
2026-08-27 14:21:30 -04:00
Goober5000 814b8592a2 Merge pull request #7734 from Goober5000/fix/ship_registry_rename
a few parsing and infrastructure upgrades
2026-08-27 14:20:26 -04:00
wookieejedi dd2be3dfbd Fix path that could lead to unnormalized vector (#7747)
* Fix path that could lead to unnormalized vector

TLDR:
Within `ai_chase` the value for `predicted_enemy_pos` could remain unitialized because not every else branch was accounted for. This could lead to downstream effects and trigger unnormalized vector asserts.

More Detail:

The trigger
`predicted_enemy_pos` is declared with no initializer — `aicode.cpp:8991`
The lead-prediction gate at `9110` falls through: needs `real_dot_to_enemy >= 0.25f and target_time >= 1.0f`, and not seek-lock-with-aspect.
`ai_get_weapon` returns `nullptr` — 9125 → 7113, which bails on `current_primary_bank < 0`
Every assignment lived inside `if (wip)`, and there was no else — so the variable stayed unwritten
First read of uninitialized stack memory at 9167
Passed to `ai_chase_attack` at 9198, becomes the goal point
Target beyond 500m selects the `rvec` branch, which routes into `vm_vector_2_matrix_norm` and the `fvec` assert

Commonly this uninitialized value would result in a plausible float. In that case nothing asserts and the ship just flies at a garbage point — so this was likely causing erratic no-primary AI behavior far more often than it was crashing. The assert only fired on the subset where the residue happened to be NaN, Inf, or astronomically large.

This PR adds that final else branch, though given it's an AI change it is via flag. The flag is auto-enabled for 26.2 and onward though.

Happy to discuss!

* fix typo

* no need for flag
2026-08-27 13:25:53 -04:00
Goober5000andClaude Opus 4.8 f235517a36 Remove MAX_WEAPON_TYPES from AI and ship-parse weapon buffers
Two unrelated weapon-indexed buffers dropped their MAX_WEAPON_TYPES dependency, by different means since they have different natural bounds:

 * ai_select_secondary_weapon and update_aspect_lock_information declared weapon_id_list / weapon_bank_list as [MAX_WEAPON_TYPES], but these are filled only by get_available_secondary_weapons, which appends at most one entry per secondary bank -- so they never hold more than MAX_SHIP_SECONDARY_BANKS!

 * parse_allowed_weapons' allowed_weapons[MAX_WEAPON_TYPES] is genuinely weapon-class-bounded, so it becomes an SCP_vector<int> filled by the vector overload of stuff_int_list

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-27 13:17:54 -04:00
Goober5000 a7999b1a00 Merge pull request #7719 from Goober5000/fix/events_in_campaign_editor
restore mission/goal/event listing in FRED2's campaign editor
2026-08-27 13:12:51 -04:00
Goober5000 66add9f9e8 Merge pull request #7745 from Goober5000/feature/fred_font_scaling
Add adjustable viewport label font size to FRED and QtFRED
2026-08-27 12:06:00 -04:00
Goober5000andClaude Opus 4.7 47b2f0b3ca Consolidate the starting-wing usage builders in missioneditor
FRED2, qtFRED, and the shared mission save code each carried their own copy of the loadout usage builders.  The weaponry pair already had shared versions in missioneditor/common; this converts those to the SCP_map<int,int> signature the editors now use, adds the missing ship builder alongside them, and deletes both editors' private copies.

FRED2's playerstarteditor/freddoc and qtFRED's Editor/ErrorChecker all call the shared functions now, following the update_custom_wing_indexes consolidation precedent.  missionsave's used_pool becomes a map as well, which removes its MAX_WEAPON_TYPES stack array.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-27 00:58:20 -04:00
Goober5000andClaude Opus 4.7 49a9141073 Convert team_data to sparse loadout entry vectors
team_data was the last persistence-adjacent structure sized by MAX_SHIP_CLASSES: four parallel ship arrays plus four parallel weapon arrays (one slot per mission-file loadout line, holding a class or a sexp variable name, and a count or a sexp variable name) with manual num_*_choices counters, plus a dense per-class weapon_required flag array.  Convert all of it to the sparse-container family:

  ship_list / ship_list_variables / ship_count / ship_count_variables
    -> SCP_vector<loadout_entry> ship_choices
  weaponry_pool / weaponry_count / weaponry_pool_variable /
  weaponry_amount_variable
    -> SCP_vector<loadout_entry> weapon_choices
  bool weapon_required[MAX_WEAPON_TYPES]
    -> SCP_set<int> required_weapons

where loadout_entry is {class_index, count, class_variable, count_variable}, with empty variable strings meaning the value was given literally.  num_ship_choices / num_weapon_choices become .size().

Intentional behavior fixes, all previously latent memory errors or
data bugs:

 * is_ship_assignable stored an alt ship CLASS in a variable used as a
   loadout list INDEX when default_to_this_class was false, then
   swapped to ship_list[class] - garbage for any mission where the two
   domains diverge.  It now swaps to the alt class itself, per the
   evident intent.

 * The default-ship fallback read ship_list[0] even when a team had
   zero ship choices; it now leaves default_ship at -1, and
   ss_fixup_team_data guards its append of the default ship accordingly.

 * FRED2's dumpstats indexed Ships[] with a ship class when printing
   loadout entries; it now prints the entry's class or variable name
   directly.

 * Team parse now clears the previous mission's entries explicitly
   rather than relying on overwrite-in-place.

This clears the largest remaining cluster of MAX_SHIP_CLASSES references on the way to lifting the ship class limit.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-27 00:58:20 -04:00
Goober5000andClaude Fable 5 2b01cebd57 fix AI ships getting permanently stuck after losing or refusing a target (#7736)
Generalize the unreleased "$fix target updating with strafe:" ai_profiles flag
into "$fix ai target recovery:", which now also covers two more ways a ship
holding a standing chase order could park in AIM_NONE forever:

* a ship already in AIM_NONE with a standing chase order (attack-any etc.) now
  clears its active goal so the order is re-processed, closing the window where
  retargeting finds a new enemy before the strafe clause can fire
* target selection (find_enemy/get_nearest_objnum) now skips ships outside the
  attacker's actively-pursues list, and ai_chase() drops self-chosen targets it
  refuses, instead of holding a target it will never attack

Retail behavior is unchanged when the flag is disabled; explicit orders on
non-pursued targets are still declined as before.

Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-26 19:30:13 -04:00
Goober5000andClaude Opus 4.8 e3674834a0 Add adjustable viewport label font size to FRED and QtFRED
The text labels drawn in the main editor viewport were always rendered at the fixed FONT1 size.  Add options to scale the font from 50% to 400%.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-25 19:57:47 -04:00
wookieejedi e0e3e9dff2 Fix CTD with ship-percent sexp edge case (#7738)
`sexp_percent_ships_arrive_depart_destroy_disarm_disable_scan` could have an edge case where the total value (ie the denominator) is 0 and thus crashes FSO. This could happen if `Cancel_future_waves_of_any_wing_launched_from_an_exited_ship` is used and the death or departure of a mothership triggers the total of a wing to change that is later checked in a sexp such a 'percent-destroyed` or other similar sexps.

Fix is just to add an early out if the total value is 0.
2026-08-25 15:11:40 -04:00
wookieejedi 4c48e180aa Fix do_view_track (#7731)
Root cause
Commit 87ea04fa5 "change atan2_safe to atan2" (July 2024) replaced FSO's custom atan2_safe with the standard atan2. The old function returned a different range:

range returned
old atan2_safe	(-PI/2, 3PI/2)
standard atan2	(-PI, PI]

do_view_track_target() in playercontrol.cpp:417 computes the padlock heading as a raw subtraction of two extracted headings:

chase_slew_angles.h = forward_angles.h - view_angles.h;

The forward vector rotated into the player's own frame is always (0,0,1), so forward_angles.h is always PI/2. With the old range that subtraction landed in (-PI, PI) — symmetric, and the ±120° neck clamp below applied evenly. With standard atan2 it lands in [-PI/2, 3PI/2) instead: -90° to the left, but +270° to the right.

Leftward travel dead-ends at 90° (straight abeam) instead of 120°, and the moment a target crosses just past the player's left shoulder the value wraps to a large positive number and gets clamped to +120° — the camera snaps hard right.

The fix
Rather than reverting atan2_safe (standard atan2 is correct, and other callers depend on the new range), this PR wraps the heading difference back into (-PI, PI] before the neck clamp, using the same "over-the-top correction" idiom already used by do_view_external() a few hundred lines down:

	// Do over-the-top correction.
	// Headings are extracted with atan2, so each one lies in (-PI, PI] and their difference can be
	// nearly a full circle in either direction.  Without wrapping it back into (-PI, PI], a target just
	// past the left shoulder reads as being almost all the way around to the right instead.
	if (chase_slew_angles.h > PI)
		chase_slew_angles.h -= PI2;
	else if (chase_slew_angles.h < -PI)
		chase_slew_angles.h += PI2;
2026-08-25 15:10:42 -04:00
Fabian Woltermann f241ddb3e3 Use the OS-specific path separator when saving missions (#7744) 2026-08-25 07:30:29 +00:00
Goober5000andClaude Opus 4.8 e677709247 Store alt-ship-class combobox indices as item data
FRED2's AltShipClassDlg kept two fixed-size parallel arrays mapping combobox rows back to engine indices:

  int ship_class_indices[MAX_SHIP_CLASSES]       // row -> Ship_info index
  int string_variable_indices[MAX_SEXP_VARIABLES] // row -> Sexp_variables index

Both are pure UI plumbing. Delete them and attach each index to its combobox row via CComboBox::SetItemData/GetItemData.  Besides removing the arrays, this drops the num_string_variables index offset math the parallel arrays forced and bounds the reverse lookups by the combobox item count instead of MAX_SHIP_CLASSES.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-25 01:37:46 -04:00
Goober5000andClaude Opus 4.8 8d94cb5417 Store the shield-system editor types in a map
Shield_sys_types (the per-ship-class shield status in the FRED2/qtFRED Shield System dialog) was a dense array/vector sized to MAX_SHIP_CLASSES, one of the last cap-blocking structures.  It is a poor fit for a dense container: it is derived, ephemeral editor state, and sparse in practice, since only the ship classes present in the mission ever get a meaningful value.  Its default (HasShields) is exactly the "absent" case.

Convert it to a map keyed by ship class:

  FRED2:  int Shield_sys_types[MAX_SHIP_CLASSES]            -> SCP_map<int, int>
  qtFRED: SCP_vector<GlobalShieldStatus> Shield_sys_types   -> SCP_map<int, GlobalShieldStatus>
          (and the ShieldSystemDialogModel::_types copy likewise)

No file-format or behavior change: shield status is still derived from and applied to the same ship flags.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-25 00:15:12 -04:00
Goober5000andClaude Fable 5 c99ee7c741 restore mission/goal/event listing in FRED2's campaign editor
The sexp tree refactor (#7301) moved the OPF listing logic into a shared
model that asks the editor for campaign-aware lists via virtual methods
on SexpTreeEditorInterface.  QtFRED's campaign editor got the necessary
overrides, but FRED2's never did, so its OPF_MISSION_NAME /
OPF_GOAL_NAME / OPF_EVENT_NAME dropdowns fell back to the currently
loaded mission's data instead of the campaign's.

Backport the overrides to FRED2, restoring its pre-refactor behavior
(including listing only missions at earlier campaign levels), and hoist
QtFRED's loadAndFindCampaignMission helper into missioneditor/common so
both editors share one copy.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-24 21:07:10 -04:00
Goober5000 a34788ef1a a few parsing and infrastructure upgrades
- A parse flag to indicate when the mission is being parsed, and a new `ship_class_index()` accessor in the ship registry, both currently unused
- Make the ship registry more robust, especially in FRED: properly update it when ships are renamed or deleted
2026-08-23 22:24:21 -04:00
Goober5000 7f6fb5e1eb Merge pull request #7732 from Goober5000/fix/wing_hash_compatibility
wing name format compatibility
2026-08-23 22:22:10 -04:00
Goober5000 41884cb1a3 wing name format compatibility and other cleanup
Following PR #7429, ships belonging to wings were hashed the same way as every other ship, instead of the original hackish format where the hash was juggled around the number.  This was a mostly transparent upgrade, and ship names were automatically converted from the legacy format to the new format.  However, missions that referenced ships *in subsequent waves* broke; the converter only handled ships in the first wave.

This PR adds compatibility checks to `eval_ship` and `ship_registry_get` to accommodate legacy names.
2026-08-23 21:38:52 -04:00
Goober5000 ee4b554dd4 standardize and update the various _INDEX macros 2026-08-23 21:38:52 -04:00
Fabian Woltermann 234219d88b Fix invalid model/instance access for OBJ_RAW_POF and OBJ_PROP (#7733)
Ensure proper checks for model_num and instance validity when accessing OBJ_RAW_POF and OBJ_PROP objects. Prevents crashes from out-of-bounds or missing data in Pof_objects and Props.
2026-08-23 13:34:44 +02:00
Goober5000 f9c136ad8b Merge pull request #7720 from Goober5000/feature/classic_menu_toggle
add a toggle to switch FRED2 between the classic and current menu layouts
2026-08-21 22:34:08 -04:00
John Fernandez 1b1e0af2a5 Fix Campaign Editor Crash (#7722)
And a little minor cleanup
2026-08-20 16:32:22 -04:00
Goober5000andClaude Opus 4.8 96e1b1a092 add a toggle to switch FRED2 between the classic and current menu layouts
PR #7082 rearranged the FRED2 menu layout to match qtFRED (see issue #6985),
but some users preferred the previous Editors/Misc layout.  This adds a
"Classic menu layout" toggle (under Settings in the current layout, and under
Misc in the classic layout) that swaps the whole menu bar on demand.  The
choice is persisted to the registry and reapplied on startup.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-18 03:20:19 -04:00
Goober5000 99bf34074a Merge pull request #7712 from Goober5000/fix/fred_ship_dialog
handle ship editor re-entrancy in FRED
2026-08-18 01:03:35 -04:00
Goober5000 5a67e8e952 Merge pull request #7711 from Goober5000/fix/sexp_parsing
patch a hole in SEXP syntax checking
2026-08-18 00:52:21 -04:00
John Fernandez 9b2fedbf65 Move Items to a grid layout for easy sizing 2026-08-17 14:18:05 -04:00
Goober5000 6684be3ee3 Merge pull request #7713 from Goober5000/7688_followup
tiny tweak fix to the comm menu
2026-08-16 15:55:46 -04:00
Goober5000 1ea98b19d5 tiny tweak fix to the comm menu
Reset the selected item when we open a new menu.  This keeps the display state and internal state in sync if the player mixes arrow presses and number presses.  Follow-up to #7688.
2026-08-16 15:10:35 -04:00
Goober5000 3f6a9f12fa Merge pull request #7688 from wookieejedi/fix-skip-hidden-menu-items
Fix COMMS_MENU_SELECT control usage with 'Hide  Rearm/Repair items' and cleanup selection visibility
2026-08-16 14:57:20 -04:00
Goober5000 860604a726 Merge pull request #7683 from wookieejedi/forward-speed-launch
Add weapon launch curve input 'Target Forward Speed'
2026-08-16 14:42:49 -04:00
Goober5000 a9f797d3f2 Merge pull request #7689 from wookieejedi/more-multi-fixes
Fix various multi bugs
2026-08-16 14:42:25 -04:00
Goober5000 cdd477fddf Merge pull request #7704 from wookieejedi/fix-ai-ramming-big-targets
More Fixes for AI Ramming into Stationary Targets
2026-08-16 13:20:59 -04:00
wookieejedi 4a1f16c453 update to new version 2026-08-16 13:06:10 -04:00
The Force 54caf6ec25 New guard-range sexp (#7606)
* New guard-range sexp

New guard-range sexp which allows different ranges for different guarders

* cast value

* Clang

* bugfixes

* fix CI

* Address Feedback

* address feedback

* typo
2026-08-16 17:53:41 +01:00
wookieejedi 0f3f80b03a Merge branch 'master' into fix-skip-hidden-menu-items 2026-08-16 08:56:40 -04:00
Kestrellius 1967daffd3 Vectorize MsgItems (#7687)
Convert MsgItems from an array to a vector, and remove the associated limit value and counter.

* vectorize msgitems

* appeasement

* leave me alone clang

* remove optional

* cleanup

* changes requested

* clang

* clang what is WRONG with you

* feedback

* remove flag in .h
2026-08-16 02:04:50 +00:00
Goober5000 9baddcb25a handle ship editor re-entrancy in FRED
Prevent the mission from being modified via the ship editor's window update when it is already being cleared or loaded.  This mirrors existing guards in `delete_object` and `delete_ship`.

No other FRED2 dialogs are vulnerable.  QtFRED uses a different ship editor mechanism which is not affected by this issue.
2026-08-15 17:06:27 -04:00
Goober5000 da4f4e70ac patch a hole in SEXP syntax checking
An operator that isn't enclosed in parentheses could trigger an UNREACHABLE, which crashes in Debug and is undefined behavior in Release.  Catch it in a more appropriate way.
2026-08-15 15:21:03 -04:00
Goober5000 a4e33109a0 Merge pull request #7707 from Goober5000/fix/local_ssm
remove an unneeded SSM assertion and fix some parent checks
2026-08-15 12:13:01 -04:00
Goober5000 7418bf5f42 Merge pull request #7702 from wookieejedi/prop-type-fix
Update type Prop to ensure it's on object list
2026-08-14 18:01:27 -04:00
Goober5000 d5d4a16664 remove an unneeded SSM assertion and fix some parent checks
Contrary to the comment, local SSMs do not actually need a parent.

Also fix two other places where a parent was assumed but may not exist.
2026-08-14 15:11:10 -04:00
Fabian Woltermann f840e545b9 Fix base angle calculation for ventral turrets without custom matrices (#7706) 2026-08-14 20:45:18 +02:00
wookieejedi d5c371c7a2 clang 2 2026-08-12 16:20:17 -04:00
wookieejedi e983dfbe15 clang 2026-08-12 16:18:55 -04:00
wookieejedi 891a63420c fix old copy paste bug and power usage 2026-08-12 15:43:19 -04:00
wookieejedi 0107e1b25f clang 2026-08-12 13:35:41 -04:00
wookieejedi 9295d1a796 More Fixes for AI Ramming into Stationary Targets
TLDR: This is a long description, but it boils down to exposing 2 hardcoded AI values and updating 1 value in the optional 'better collision avoidance' behavior allows mods to substantially fix fighters ramming into capital ships they are attacking.

AI accidentally ramming into big ships while trying to evade fire from a hostile turret or a dogfight makes some sense given a chaotic combat situation. What does not seem good though is AI not being able to attack a large stationary target that is not shooting back and has no fighters around. This is especially evident in mods that use the new strafing AI fields, where AI will fly to a distant point then turn around to do an attack run, then once close enough pick another strafing run to conduct. In these situations, AI will commonly not pull up from the attack run in time, especially for mods that use different speeds or AI damp values compared to retail.

Fortunately, there exposing two values to the AI profiles allows modders to tune these values, the strafe retreat time and strafe retreat distance. By default these values are 2 seconds and 100 meters, which is commonly far too short for mods with higher speeds or larger damp values. Exposing these values allows modders to make the AI far more effective and virtually eliminate ramming into stationary ships they are attacking. For example, on current 26.0 with FotG testing we register 2-4 rams of a stationary target per minute. Using the new exposed values in this branch eliminates the ramming (after 10 minutes of firing no ramming occurs across multiple runs of this and other test missions).

Furthermore, this PR helps `better_collision_avoidance_triggered` function (enabled by using `better collision avoidance` in the `ai_profiles.tbl` fix an edge case with predicting collisions. On current master the `delta_time` value used in this function was `0`, which was only ever used eventually downstream in the `will_collide_with_big_ship` function call. This `will_collide_with_big_ship` function had an early return on line 7620:

```
int will_collide_with_big_ship(object *objp, vec3d *goal_point, object *big_objp, vec3d *collision_point, float delta_time)
{
	float		radius;
	vec3d	end_pos;

	radius = big_objp->radius + delta_time * objp->phys_info.speed;

	if (vm_vec_dist_quick(&big_objp->pos, &objp->pos) > radius) {
		return 0;
	}
```

This early return and the passing of `0` to the `delta_time` from `better_collision_avoidance_triggered` meant that the early out radius distance was only the big object's radius, and did not project any forward time. In other words, better collision avoidance only actually checked or triggered when the small ship was within the radius distance of the large ship. Thus, with ships that had geometry reach right to the edge of the object radius, it could result in the small ship not having enough time to react to avoid a collision. Notably, all other calls to `will_collide_with_big_ship` use a `delta_time` of 5-10. As such, this PR also fixes that edge case by ensuring the better collision avoidance also incorporates some lead travel time by passing a non-zero value for delta time. Given `better_collision_avoidance_triggered` aggression factor is 3.5 by default, it fit well in testing to pass this value to `delta_time`. That aggression factor is already tuneable for mods, so also using it here provides extra adaptability.

Overall these values and updates were tested and substantially remove collision accidents, especially with ships with high speeds and/or higher damps. The PR boils down to exposing two values to the AI profiles table and updating values in the optional 'better collision avoidance' flag, so it will not affect retail. Happy to discuss as well, thanks!
2026-08-12 12:57:29 -04:00
wookieejedi 075e1226b7 Update type Prop to ensure it's on object list
Seems like props were missing from the object type list, so adding them in this relatively small PR. Happy to edit or do something differently if folks want though!
2026-08-10 22:15:32 -04:00
wookieejedi 35d8c6ea4e Fix two small issues (#7690)
* Fix two small issues

Fix copy-paste bug where setting `$Ask Help Hull Percent:` never properly got set. Fortunately this does not affect the AI, only when the AI sends a message to the player asking for help.

Fix edge-case issue: in `find_turret_enemy`, the `turret-tgt-ship-tgt` shortcut takes the parent ship's target and indexes Ships[] with it unconditionally, but `aip->target_objnum` could be a weapon or asteroid, which could be at an index higher than the ships index, and then trying to look up team could lead to bad data.

* comment formatting
2026-08-08 10:26:53 -04:00
Goober5000 745398e6b9 Merge pull request #7679 from Goober5000/refactor/loadout_pools
refactor loadout pools for vectorized ship and weapon classes
2026-08-07 22:09:26 -04:00
Mike Nelson 96d5182bb1 Add text-to-speech Lua API to briefing/debrief/tech room UI sections (#7629)
Bind the existing fsspeech_* wrappers into the ui.Briefing, ui.CommandBriefing,
ui.Debriefing, and ui.TechRoom scripting sections so Lua UIs (e.g. SCPUI, which
overrides the native screens) can drive synthesized speech again.

Each section gets playTextToSpeech, stopTextToSpeech, pauseTextToSpeech,
isTextToSpeechPlaying, and isTextToSpeechEnabled. Briefing/command-brief/debrief
use FSSPEECH_FROM_BRIEFING; the tech room uses FSSPEECH_FROM_TECHROOM. fsspeech_play
already self-gates on the Speech.* options, so these are no-ops when speech is off.
2026-08-07 16:42:05 -04:00
Goober5000 4d50a1bef8 un-consolidate model flags (#7693)
Restore the original flag values that were consolidated in #7588.  Since the flags are saved in the mission file as an integer, the original values must be preserved.

Since `MR_ATTACHED_MODEL` was removed in the original PR, that is renamed to `MR_EMPTY_SLOT6`.
2026-08-07 08:41:43 +02:00
Goober5000 0e7f1c4d74 Merge pull request #7678 from Goober5000/refactor/static_alias
clean up static alias lists used for name lookups
2026-08-06 15:18:26 -04:00
wookieejedi 2e712f8e2e Fix various multi bugs
PR addresses various small but longstanding mutli-related bugs. In draft status pending additional testing.
2026-08-06 12:52:24 -04:00
wookieejedi 23f4a1ca1f Fix COMMS_MENU_SELECT control usage with 'Hide Rearm/Repair items'
The game settings flag '$Hide main Rearm/Repair items in Comms Gauge:' hides the 'Rearm and Repair' lines in the HUD Comms menu from appearing, which is useful for mods that do not have repair ships and thus those lines confuse players. Unfortunately, the newer `COMMS_MENU_SELECT` control bindings do not properly account for hidden menu items, so using those controls on a comms menu with 'Rearm and Repair' hidden means the selection index gets off and also confuses the player.

This PR fixes that by allowing `hud_squadmsg_selection_move_down()` and `hud_squadmsg_selection_move_up()` to skip hidden menu items. Tested and works as expected.

For folks using the COMMS_MENU_SELECT controls, there is also a current UI confusion when the comms menu is first brought up because the first item is selected, but the `Display_selector` does not show. Thus, players are unsure what item is actively selected even though one is actively selected. In the original comms menu select PR this was set to on by default, but then switched to off by default by a different developer a bit later. This choice is especially useful for mods that have many players with gamepads such as Event Horizon. Alternatively, mods that already have many number keys utilized for other gameplay aspects seem to prefer to keep the comms menu visuals as is and only show the selection if the player uses those keys. Given there is clearly arguments for both reasons, ideally modders should be able to choose how it displays for their own mods (always or off for the first pop-up of the Comms menu).  Thus, this PR adds that as a cleanup game option, too. This also was tested and works as expected.
2026-08-06 11:06:41 -04:00
wookieejedi 50935e540e Fix scripting copy-paste bug and other minor optimizations (#7684)
* Fix scripting copy-paste bug

The iterators for secondary banks for lua access had a copy-paste bug from primaries, so we should fix that. The early == -1 break masks it whenever a ship uses 3 or fewer secondary banks, which is probably why it went unnoticed.

Also add some additional low-hanging fruit optimizations.

* radar distance and other cleanup

* clang
2026-08-05 23:09:57 -04:00
Goober5000 304dbb60c5 Merge pull request #7680 from Goober5000/refactor/dense_class_data
store campaign allowed-class lists in sets
2026-08-04 23:10:07 -04:00
Goober5000 b1ada89f8d Merge pull request #7630 from Goober5000/claude/extract-name-conflict-checker
Extract common name conflict checker for FRED2 and qtFRED
2026-08-04 22:24:05 -04:00
Goober5000andClaude Opus 4.7 30d81a83fb store campaign allowed-class lists in sets
Convert the allowed-ships and allowed-weapons lists to sets, rather than naive vectors that stored a true/false for every class.  Since these are ordered sets, iteration occurs in the same sequence as iteration of `Ship_info` or `Weapon_info`.  Associated data structures such as `Granted_ships` and `Granted_weapons` are converted as well.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-04 22:14:58 -04:00
wookieejediandGoober5000 2821eb8ccf Update code/network/multi.h
Co-authored-by: Goober5000 <[email protected]>
2026-08-04 21:55:08 -04:00
wookieejedi 08bb369e46 fix order and multi bump 2026-08-04 16:07:06 -04:00
Taylor Richards 6d3c2873c4 improve support for gamepads (#7655)
Use the SDL gamepad API to add full gamepad support. Adds rumble for supported
gamepads and changes the FF in-game options to take immediate effect instead
of requiring a restart.

Additionally this makes changes to allow gamepad triggers to be used as both
an axis and a button. This support is specific to gamepads since we can
explicitly identify the trigger with the API and act on it accordingly. FSO
control config doesn't currently support such an action directly however so
we have to hack it in just a bit. Due to this the control binding will show
the trigger axis name bound to a button control only while a gamepad is
connected, otherwise it shows a button name associated with the trigger.
2026-08-04 15:49:46 -04:00
wookieejedi acd868fa49 one more multi clang 2026-08-04 09:56:21 -04:00
wookieejedi 4c4cc44310 multi packets 2026-08-04 09:05:08 -04:00
wookieejedi 61b7c9f3f1 clang auto format typo 2026-08-04 07:56:44 -04:00
wookieejedi af7a2f37ed clang again 2026-08-04 07:36:38 -04:00
Fabian Woltermann 45dd750e0c Secure forum posting by adding authentication header support (#7676)
* Secure forum posting by adding authentication header support

* Add check for missing FORUM_SECRET environment variable in ci/post/main.py

* also error out when the forum secret is not supplied
2026-08-04 08:25:52 +02:00
Goober5000 cb8dec1fd6 Merge pull request #7656 from Goober5000/cleanup/rpavlik
clean up submodule references
2026-08-03 23:51:49 -04:00
wookieejedi 208cfdfed3 clang 2026-08-03 23:18:03 -04:00
wookieejedi 9ccfe9d9e3 Add weapon launch curve input 'Target Forward Speed'
Following style of 'target radius' and other useful weapon launch curve inputs, this PR adds 'Target Forward Speed' which can be useful to use as an input and then use FoF as an output to do things like make turrets have a tougher time having dynamic FoF depending on target speed.
2026-08-03 23:03:35 -04:00
Goober5000 3bfe71d834 Merge pull request #7670 from Goober5000/fix/msg_arg_count
send-message-list arg-count forgiveness, plus better error checking
2026-08-03 22:21:13 -04:00
BMagnu 09de3f1fb8 Fix deferred lighting on vulkan (#7682) 2026-08-03 15:52:34 +02:00
Goober5000andClaude Opus 4.7 77186c72fc refactor loadout pools for vectorized ship and weapon classes
Convert ship/weapon loadout pools from naive per-class arrays to ordered maps that list loadout entries.  Each entry represents a ship/weapon class and its count.  An absent entry means the class is not in this mission's loadout.  Since these are ordered maps, iteration of the map keys occurs in the same sequence as iteration of `Ship_info` or `Weapon_info`.

Includes several bugfixes:
- `csg_read_loadout` now clears both pools before reading.  Previously the pools were only zeroed in `mission_campaign_init`
- `restore_wss_data`: non-transmitted classes are now absent rather than memset to 0
- a copy-paste bug where the weapon pool entries were bounds-checked against MAX_SHIP_CLASSES
- `wss_maybe_restore_loadout`: the pool write-back now preserves loadout membership instead of writing a count for every class
- `ss_dump_to_list`/`ss_swap_list_slot`: returning a slot ship whose class is not in the pool now makes it available instead of silently losing it.  Unreachable in retail but reachable via script
- off-by-one errors in the Lua `Ship_Pool`/`Weapon_Pool` indexers

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-08-03 01:28:28 -04:00
Goober5000 3afa3293c8 Merge pull request #7672 from Goober5000/enhancement/containsKey
add contains, at_or, and value_or to the SCP maps
2026-08-03 01:25:50 -04:00
Goober5000 6bc6426672 clean up static alias lists used for name lookups
Refactor `Ship_class_names`, `Iff_info_names`, and `Ai_class_names` to be populated once at parse time, as opposed to ad-hoc and possibly many times.

Also make `Ai_classes` and `Spawn_names` proper SCP_vectors.
2026-08-02 18:26:47 -04:00
Fabian Woltermann cb284b7f13 Update shader logic for shadow handling and Vulkan large shader configurations (#7659)
Refactor shadow flag handling in shaders to improve compatibility with small-shader mode. Add support for Vulkan's `-no_large_shaders` switch to split model ubershaders for better driver compatibility. Adjust related comments and preprocessor checks for clarity.
2026-08-02 06:29:02 +02:00
Goober5000 10edea2291 add contains, at_or, and value_or to the SCP maps
Extend the various maps to add a `contains` function, just as several other containers already add `contains`.

Also add `at_or` and `value_or` functions to provide ways to query for map values without inserting anything by default, as `operator[]` does.  If the map does not contain the key, the default value is returned.  Use `at_or` to return a const reference and `value_or` to return a value.  (These are only added to `SCP_map` and `SCP_unordered_map`; a `SCP_multimap` equivalent isn't as clearly useful.)

Also add Class Template Argument Deduction (CTAD) guides, per existing precedent.  And delete function overloads that are intrinsic footguns.
2026-08-01 23:49:27 -04:00
BMagnu 9320ed7e19 Reasonably generic mouse position handling (#7674) 2026-08-01 19:46:57 +02:00
Mike Nelson 319e926bf4 Qtfred briefing map widget fixes (#7663)
* qtfred: render briefing map via offscreen target for an accurate view

The briefing map widget rendered directly into the window at the widget's
size, which broke at display scaling > 100% (the briefing filled only the
top-left 1/dpr of the surface) and never matched the in-game framing or
icon proportions.

Render the briefing once into an offscreen render target at the reference
resolution (Briefing_window_resolution, retail default 888x371) using the
same setup the game uses, then letterbox-blit that finished image into the
widget. Scaling a canonical image means icon sizes, grid, line thickness
and text all scale together, so the editor view is a faithful WYSIWYG copy
of the briefing at any widget size or DPI.

Mouse picking and dragging now map input into reference-resolution space
via the blit rectangle. Selection brackets are drawn as a crisp window-
space overlay after the blit (editor UI, not part of the briefing image).

* qtfred: make the briefing map a resizable plain widget

The briefing map used a native QWindow embedded via createWindowContainer.
Native child windows paint over their siblings and won't shrink inside a
constrained layout, so the map couldn't resize with the dialog without
overlapping the surrounding controls.

Now that the briefing renders into an off-screen render target, read the
finished frame back into a QImage and paint it (aspect-fit, letterboxed)
in an ordinary QWidget. Selection brackets are drawn as a QPainter overlay
and mouse input maps through the paint rectangle. The widget participates
in the layout like any other, so it clips and resizes cleanly.

Drop the map's aspect-ratio pin and minimum size (the image scales to any
size), leaving the left pane free to shrink so the dialog resizes in every
direction without clipping.

* qtfred: pin briefing map resolution to the retail map size

The briefing map was composed at Briefing_window_resolution (the "$FRED
Briefing window resolution" table setting). That setting is only consumed
by FRED2 (an icon-scale-vs-window-size hack) and is ignored by the game
and SCPUI, so honoring it in QtFRED could only make the editor preview
diverge from the shipped briefing.

Pin the compose/render resolution to Brief_grid_coords[GR_1024] instead --
the retail briefing map size, and what Lua's ui.drawBriefingMap() defaults
to -- so the editor is an unconditional WYSIWYG preview of the game and
follows retail automatically if that constant ever changes. BriefingViewport
getSize() is the single source of truth; renderFrame() reads it rather than
duplicating the lookup.

* qtfred: cycle through stacked briefing icons on repeated clicks

Clicking the briefing map always selected the top-most icon under the
cursor, so overlapping icons underneath were unreachable.

The hit-test now collects every icon under the cursor (top-most first).
A plain click advances to the next icon underneath the currently-selected
one, wrapping bottom to top, so repeated clicks roll through the whole
stack; if nothing in the stack is selected it takes the top-most.
Shift-click and empty-space clicks are unchanged.

* qtfred: themed checkerboard matte behind the briefing map

Fill the briefing map's letterbox/pillarbox bars with a subtle,
theme-appropriate grey checkerboard so the (pure-black) map's edges are
clearly distinguishable from the surrounding matte. Two close grey shades
per theme keep it quiet; the tile is cached and rebuilt only when the
editor theme changes.

Add a shared Theme::currentThemeIsDark() that returns the effective dark
state from the applied theme preference (resolving System against the OS
scheme) and adopt it here, in VariableDialog's row tints, and in the help
browser's isDarkMode() in place of three separate palette-lightness checks.
2026-08-01 08:21:20 +02:00
Goober5000andClaude Opus 4.8 41ce07b33a Extract common name conflict checker for FRED2 and qtFRED
The ship editor, wing editor, waypoint path dialog, and jump node
dialog all had near-identical code to check whether a new name
conflicts with an existing ship, wing, waypoint path, jump node, or
target priority group (or is empty, or begins with '<').  Both FRED2
and qtFRED carried their own copies of this logic.

Extract it into a single check_name_conflict() function in
code/missioneditor/common.cpp, shared by both editors, and replace the
duplicated validation at each call site with a one-line call:

  - FRED2:  shipeditordlg, wing_editor, waypointpathdlg, jumpnodedlg
  - qtFRED: ShipEditorDialogModel, WaypointEditorDialogModel,
            JumpNodeEditorDialogModel, and Editor::validate_wing_name

This also aligns a few small behavioral differences that had crept in
between the two editors: the waypoint and jump node dialogs now skip
empty wing slots (wave_count == 0) when checking for wing-name
collisions, and the qtFRED wing editor now rejects names beginning
with '<'.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-31 00:26:07 -04:00
John Fernandez 92384b3c60 More Search UI/UX Enhancements (#7612)
* Prioritize items that begin with search string

Items that begin with the search string should be prioritized before those that simply contain the search string.

* Add Search Operators option

* Add Safety to Action Handler

I didn't see any crashes, but this matches the pattern of other keyboard shortcuts.

* Allow search for numeric nodes

The working code existed already

* Limit matches on operator search

This limits matches on operator searches by setting a minimum size that a string match has to meet.  Function returns -1 on failure, and the warning has been removed to allow this behavior.

* Try this option name better

* Add keyboard shortcut for search

This allows ctrl+s (which can be listed instead of spacebar) to initiate search.  There is a new menu item added as well.

* Put this in the correct place

* Address Feedback

* Wrong state

We want the item to be inserted here, not ignored.
2026-07-30 12:59:33 -04:00
Goober5000 6180173fe8 Merge pull request #7487 from Goober5000/feature/format_classes
Convert CSG/PLR fixed ship/weapon arrays to SCP_vector
2026-07-30 03:23:56 -04:00
Goober5000andClaude Fable 5 5fa6674688 send-message-list arg-count forgiveness, plus better error checking
Due to a long-standing bug, the groups-of-4 argument count check for
send-message-list and send-message-chain never actually worked, so
missions through 25.0 could includes sexps with truncated argument lists
that recovered gracefully at runtime.  Now that the check works, don't
punish those missions: introduce SEXP_CHECK_BAD_ARG_COUNT_BENIGN, which
warns but does not prevent the mission from loading.

To make sexp tree validation more robust, check_sexp_syntax now defers
recoverable errors rather than returning them immediately; otherwise
a recoverable error could mask a fatal error deeper in the tree.

Also fix a stale-variable bug in FRED's fred_check_sexp that could
produce a bogus empty dialog.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-30 01:03:06 -04:00
Goober5000 bb1948abeb Merge pull request #7660 from Goober5000/fix/gtbc_disable
fix crash when a ship with no primary banks is ordered to disable/disarm
2026-07-29 22:50:17 -04:00
Goober5000 1971931649 Merge pull request #7666 from Goober5000/fix/subsystem_targets
fix player subsystem targeting from sexps and scripting
2026-07-29 22:36:25 -04:00
Goober5000 53e31c9f70 Merge pull request #7667 from Goober5000/fix/keycontrol
fix keycontrol unsetting dual-fire
2026-07-29 22:32:32 -04:00
Mike Nelson ec798feb5d Fix space mouse detection under SDL_hidapi (#7665)
Since #7646 switched from the bundled hidapi to SDL_hidapi, no space mouse is
found. SDL_hid_enumerate() nominally auto-inits HIDAPI, but in practice it only
reliably reports an already-connected device when SDL_hid_init() has been called
up front. Call SDL_hid_init() once in os_init() (before SDL_Init), balanced by
SDL_hid_exit() in os_deinit(). io::spacemouse (qtFRED's only consumer) then
enumerates the device correctly.
2026-07-29 21:03:35 -04:00
Mike Nelson bcf3c3182e qtfred: fix and align keyboard shortcuts with FRED2 (#7661)
Fix reported bug where pressing D did not toggle Show Distances: the menu
and toolbar actions both claimed D, producing an ambiguous shortcut
overload. Removed the duplicate from the toolbar action. Applied the same
fix to Space (Selection Lock), which was owned by both a QAction and the
configurable ControlBindings; ControlBindings now owns it exclusively.

Restore/align several FRED2 accelerators and reshuffle dialog keys:
- X = Rotate Locally (routed through the transform local-axes button)
- Ctrl+Shift+P/Shift+P = Props, Shift+L = Team Loadout
- Shift+V = Variables & Containers, Ctrl+Shift+V = Toggle Viewpoint
  (new action mirroring FRED2's OnToggleViewpoint)
- Shift+U = Volumetric Nebula, Shift+M = Shield System

Add Shift+F1 to toggle the sexp help pane for the session (without
changing the saved preference) in the Ship, Wing, Mission Events, Goals,
and Cutscenes editors.

Add F6 / Shift+F6 to cycle Next / Prev in the Ship, Wing, Waypoint,
Jump Node, and Prop editors.
2026-07-29 21:03:04 -04:00
Mike Nelson 2f8b4f2962 Clear stale Prop_info model handles when a model is unloaded (#7669)
Repro: create a prop, File -> New Mission & Discard, then create the same prop
again. Asserts in model_get with "Index collision between model <other>.pof and
requested model N".

model_unload() walks Ship_info and Weapon_info clearing any cached model_num
that pointed at the model being freed, but never did the same for Prop_info.
props_level_close() only clears the prop instances, so prop_info::model_num
survived the discard pointing at a freed slot. Placing that prop class again hit
EditorViewport::create_object_on_grid, which reads pip->model_num directly to
size the placement distance, and by then the slot had been reused by an
unrelated model.

Adds the matching Prop_info pass. Doing it in model_unload rather than
props_level_close mirrors how the two closest analogues are handled -- Ship_info
and Weapon_info are likewise class tables holding a cached handle for placeable
objects -- and covers any unload path, not just level close. (asteroid_level_close
solves the same problem for Asteroid_info from the other direction.)

This is not OFP-specific; SCP master has props and the same missing pass.
2026-07-29 21:02:37 -04:00
Mike Nelson dd1792f28b Fix erroneous "doesn't have a valid target" error on new waypoint orders (#7664)
New initial orders start with no committed target (_object == -1). The
target combo visually defaults to its first item, but with signals blocked
that selection is never pushed to the model, and re-picking the already-shown
item emits no change signal. Ship/player targets auto-commit their first
valid entry inline during population; waypoint paths, individual waypoints,
ship classes, and wings did not, so a new order of those types stayed
uncommitted and failed validation on apply.

Add a uniform fallback after the target combos are populated: if a new order
has no committed target, commit the currently-shown default. No-op for ships
(already committed) and existing orders (loaded with a target already set).
2026-07-29 12:48:49 -04:00
Goober5000andClaude Fable 5 d40fcd16c0 fix player subsystem targeting from sexps and scripting
Fix a regression from #7393: `last_targeted_subobject` must be updated when the player's target and target subsystem are changed, or the subsystem will be retargeted due to `hud_target_change_check`.

Also fix related issues:
- the `ship.Target` and `ship.TargetSubsystem` scripting setters now use the standard `set_target_objnum` function and also correctly handle the new target subsystem
- fix an indexing error in `order.TargetSubsystem`

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-28 23:09:24 -04:00
Goober5000 fb13f1aec5 fix keycontrol unsetting dual-fire
Quick follow-up to #7635.  Even though you can't set dual-fire when a non-dual-fire bank is active, you should be able to *un*set it.  Reorder the conditions so this is possible.
2026-07-28 22:57:54 -04:00
Goober5000 4e26511055 Merge pull request #7635 from Goober5000/fix/firingpoints
fix dual fire handling for banks that cannot use it
2026-07-28 19:42:24 -04:00
Goober5000andClaude Fable 5 60c554354c fix dual fire handling for banks that cannot use it
The Secondary_dual_fire flag is per-ship, but not every secondary bank
can dual fire.  Previously the HUD drew the dual fire link icon even
when the armed bank had only one firepoint, and firing such a bank
cleared the flag entirely, silently discarding the player's dual fire
preference for the other banks.

Extend the ignored-rather-than-cleared approach already established
for no-doublefire weapons to the single-firepoint case:

- add ship_secondary_bank_can_dual_fire() as the single source of truth
  for bank validity, No_doublefire, ai_profiles restrictions, and
  firepoint count
- ship_fire_secondary() now fires single and leaves the flag alone when
  the bank cannot dual fire, instead of removing the flag
- the weapons gauges and the hardpoints gauge consult the helper, so the
  link icon and second-firepoint highlight are no longer drawn for
  incapable banks
- the dual fire toggle on a single-firepoint bank now explains why it
  cannot dual fire and leaves the preference untouched
- restoring the saved dual fire preference no longer depends on bank 0's
  firepoint count, since incapable banks now simply ignore the flag
- key control and force feedback also consult the helper

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-28 01:08:07 -04:00
Fabian WoltermannandClaude Opus 5 6e6b5141f3 clang tidy pipeline fixes (#7657)
* ci: run clang-tidy on macOS and Linux clang builds

Install a version-matched clang-tidy on macOS and make the shared runner portable across both CI environments.

* ci: keep valgrind compatible with clang debug builds

Emit DWARF4 debug information and suppress SDL's one-time initialization allocation so memcheck can report actionable failures.

* ci: suppress SDL3/libX11 video backend leaks under valgrind

Now that the `[ "$CONFIGURATION" = "Debug" ]` typo is fixed, valgrind
actually runs on the Linux Debug legs again, and memcheck fails the build
on six "definitely lost" contexts (480 bytes) that all originate inside
SDL3's X11 backend at X11_CreateDevice, reached from SDL_VideoInit.

These aren't ours to fix: both call sites (os_init's SDL_Init and the
temporary video init in resolution_default(), reached via gr_init) already
pair their init with a matching quit, and the allocations are made and
kept by SDL/libX11 across SDL_VideoQuit. Collapsing the repeated init/quit
cycles would only reduce the block count, not the number of leak contexts,
so the build would still fail.

The suppression is truncated at X11_CreateDevice on purpose: it stays
caller-agnostic (covering both the os_init and gr_init paths) and avoids
matching on SDL_InitSubSystem_REAL.part.0, whose .part.0 suffix is a
partial-inlining artifact of how SDL3 happened to be built.

Co-Authored-By: Claude Opus 5 <[email protected]>

* ci: suppress glibc dlopen loader leaks under valgrind

The Linux clang-16 Debug leg fails memcheck on a single zero-byte block
lost in glibc's `_dl_find_object_update()`, reached from `dlopen()` while
SDL probes its video backends. It is loader bookkeeping that glibc keeps
by design, and it only shows up on some legs because it depends on how
many objects the loader has mapped by that point.

The file already carried three suppressions for this class, but each
pinned a full, exact glibc stack, so every new loader code path costs
another CI round. Replace them with a single block matching on
`_dl_open`: nothing of ours runs below that frame, only loader internals
and the static constructors of shared libraries the loader brings in, so
this gives up no coverage we care about while retiring the whole class.
All three removed blocks contain `_dl_open` themselves and are therefore
subsumed by it.

Both new suppressions match `definite,possible` rather than `definite`
alone, since `--errors-for-leak-kinds` defaults to `definite,possible`
and the same allocations would otherwise fail the build if valgrind ever
reported them as possibly lost instead.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
2026-07-27 21:54:29 +02:00
Goober5000andClaude Opus 4.8 b7cd9765a1 fix crash when a ship with no primary banks is ordered to disable/disarm
Gunships and other custom ship classes may run through the primary weapon code despite having no primary banks.  Add a few guards to prevent this from causing crashes.

Fixes a crash reported in Causality: The Great War.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-27 12:12:10 -04:00
Goober5000andClaude Opus 4.8 5bbf00f327 remove rpavlik-cmake-modules submodule and dead cotire references
Vendor the CMake modules FSO actually used from the ~150-file rpavlik
submodule into cmake/, then drop the submodule:

  - EnableExtraCompilerWarnings.cmake (toolchain warning flags)
  - CreateLaunchers.cmake + its CleanDirectoryList.cmake dependency and
    launcher-templates/ (IDE launcher generation for the game and FREDs)
  - MSVCMultipleProcessCompile.cmake + its ListCombinations.cmake dependency

Also remove the dead cotire module-path entry and the vestigial
ENABLE_COTIRE option (cotire is never invoked and its directory no longer
exists), and repoint the submodule-initialized check at libRocket.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-26 15:54:07 -04:00
Taylor Richards 29116e7ba4 remove hidapi lib in favor of SDL_hidapi (#7646)
* remove hidapi lib in favor of SDL_hidapi

Funtionally identical under the hood, but offering maximum capability and
compatability without adding any system dependencies. The main difference on
our side is that hidapi functions and types will be prefixed with "SDL_". And
SDL will dynamically load in the hidapi features best supported by the running
operating system.

* remove residual SDL_hid_exit call
2026-07-26 13:57:57 -04:00
Mike Nelson e1ad0deaa2 expanded data list menu usage (#7645) 2026-07-26 09:34:05 -04:00
The Force da05081405 Fix C4709 Warnings In modern VS (#7576)
* Fix C4709 Warnings on latest VS

* more

* suppress false positive

* Switch to using any/none_of

* Address Feedback

* Fix Line endings?

* Fix commits and strip out flag_combinator

* more fixes

* nolint
2026-07-26 14:33:00 +01:00
Mike Nelson 5227826357 align object dialog initialization (#7644) 2026-07-24 21:10:06 -04:00
Fabian Woltermann 09ab04193b Merge pull request #7651 from The-E/fix/resolution-initialization-on-empty-config
Fix resolution_default to handle uninitialized SDL video subsystem
2026-07-24 21:16:10 +02:00
Fabian Woltermann d0cefc87bd Fix inverted scpui icons and 3d ship/weapon select models rendering in the wrong place (#7647)
* Fix Vulkan render target readback orientation to match OpenGL behavior

* Add render target pass resumption after Vulkan shadow rendering

Ensure that Vulkan render targets resume rendering properly after shadow passes, particularly for off-screen targets like SCPUI's 3D previews, to prevent unintended content leakage onto the screen.

* Skip alpha writes for additive batched bitmaps in render targets to preserve coverage and prevent opaque artifacts.

* Add external subpass dependencies to Vulkan render passes to fix read/write hazards

Introduce explicit memory dependencies for color attachments sampled between passes to prevent flickering and graphical artifacts caused by read-after-write and write-after-read hazards.

* Support fractional alpha values in createColor function and preserve 0-255 compatibility
2026-07-24 21:10:13 +02:00
the-e 9eb11aec7f Fix resolution_default to handle uninitialized SDL video subsystem
Ensure SDL video is temporarily initialized if needed during startup to safely query desktop display mode, preventing reliance on a potentially dead subsystem and avoiding silent fallback to invalid resolutions.
2026-07-24 20:38:14 +02:00
Fabian Woltermann 8c0787016d Merge pull request #7642 from JohnAFernandez/Remove-Unused-File
Remove unused file
2026-07-24 17:43:44 +02:00
Fabian Woltermann 6ae666d10a Merge pull request #7643 from Shivansps/vulkan-etc2
ETC2 textures support in Vulkan
2026-07-24 17:43:16 +02:00
Fabian Woltermann a6e4ec8df5 Merge pull request #7648 from notimaginative/extra_log_info
add some helpful system info to debug log
2026-07-24 17:42:57 +02:00
Taylor Richards aaa48d4374 fix uniform type mismatch error in shadow_map shader (#7649) 2026-07-24 04:18:48 +00:00
Taylor Richards 826ca2758e add some helpful system info to debug log 2026-07-23 15:35:15 -04:00
Taylor Richards 039880491a port to SDL3 (#7220)
Basic port from SDL2 to SDL3. Also updates imgui to 1.92.5.
2026-07-23 15:52:27 +02:00
Fabian Woltermann 1abbea499b Merge pull request #7640 from The-E/fix/various-scpui-issues-in-vulkan
Fix various issues in SCPUI when using Vulkan
2026-07-23 09:12:20 +02:00
John Fernandez 2dbc6f79ad Change Tab Orders (#7641)
Quick audit of tab orders to improve usability
2026-07-22 20:31:56 -04:00
Mike Nelson e75f72456e QtFRED add object reorder dialog (#7636)
* Add Reorder Objects dialog to QtFRED

* clang

* clang again

* address feedback
2026-07-22 20:31:38 -04:00
Mike Nelson 19cd71d643 Add searchable submenu style in event editor (#7628) 2026-07-22 20:31:16 -04:00
Mike Nelson 91fc1fbf43 QtFRED Layer Updates (#7631)
* Add layer rename and bold current layer in Move to Layer menu

Bold the object's current layer in the Move to Layer context menus
instead of marking it with a checkbox.

Add a Rename Layer button to the Layer Manager dialog. Renaming
rewrites the per-object fred_layer string on every object assigned to
the layer. The Default layer cannot be renamed.

* Add layer rename to Scene Browser right-click menu

Right-clicking a layer row in the Scene Browser now shows a small
context menu with Rename Layer, which opens a rename box and applies
the rename through the same viewport path as the Layer Manager dialog.
The Default layer cannot be renamed.
2026-07-22 20:30:46 -04:00
Salvador Cipolla a40868497e ETC2 textures support in vulkan 2026-07-22 19:45:29 -03:00
Fabian Woltermann 2c3e052ec6 Fix Vulkan FXAA/SMAA handling and ensure proper Scene_ldr transitions (#7639)
Address FXAA/SMAA shader selection logic by aligning it with the current anti-aliasing mode. Fix undefined behavior for discarded non-edge pixels during the FXAA main pass by transitioning Scene_ldr to a load-preserving layout. Optimize compatibility across IMR and tiled GPUs, preventing visual artifacts.
2026-07-23 00:38:44 +02:00
the-e 1e5bf66c84 Remove unsupported graphics options for non-raytracing renderers
Disable raytraced-shadow and HDR settings in the options menu when unsupported by the current renderer, reducing UI clutter and ensuring only relevant options are displayed.
2026-07-22 20:41:24 +02:00
John Fernandez b65f7b1fc3 Remove unused file
Someone attempted to rename this file and then did not delete the old one, so just remove to avoid confusion.
2026-07-22 14:33:29 -04:00
Mike Nelson 28b8be69db QtFred add object select menu dropdown (#7627)
* add object select menu dropdown

* clang
2026-07-22 14:15:46 -04:00
the-e 0d64f7f237 Add load-variant render pass support for Vulkan render targets
Introduce load-variant render passes to Vulkan textures, enabling content preservation during mid-frame readbacks. Changes include creating `renderPassLoad`, flushing command buffers for readbacks, and resuming rendering into targets with `loadOp=eLoad` to avoid clearing previously rendered content.
2026-07-22 19:57:10 +02:00
the-e 334682c44d Add depth/stencil support to Vulkan render targets
This commit introduces optional depth/stencil attachments for Vulkan render targets, enabling z-testing and addressing earlier limitations where depth-tested geometry rendered in submission order without depth attachments. Changes include resource allocation, attachment handling, and layout transitions.
2026-07-22 19:18:01 +02:00
Fabian Woltermann 22eefdd0ec Merge pull request #7637 from The-E/fix/missing-include-in-voicerec
Include cmdline.h in voicerec.cpp for command-line argument handling
2026-07-21 20:56:23 +02:00
the-e 52fd215b3f Include cmdline.h in voicerec.cpp for command-line argument handling 2026-07-21 19:57:54 +02:00
b26b9cf743 Add Vulkan rendering backend, with HDR10 output and raytraced shadows (#7554)
* Shadow overhaul round 2: PCSS, dynamic cascades, cockpit/instanced shadows

Squashed snapshot of lafiel/shadow_overhaul_2's continuation work
(d3922aa87..010f9d2d9), which has no separate upstream PR of its own.

* Add Vulkan rendering backend

Squashed snapshot of the Vulkan backend as vendored into this branch
(ce2d1e85f..6ce539463, authored by Mara van der Laan with build/CI
fixes by Taylor Richards). This work has its own upstream PR #7553
(notimaginative:vulkan-pr-new) and is not otherwise original to true-hdr.

* Add true HDR output, RT shadows, and PCSS shadows for Vulkan

Squashed snapshot of true-hdr's own integration work: true HDR
framebuffer output, wiring the shadow overhaul into the Vulkan
backend (raytraced + cascaded shadow maps), logging refactors, log
filter UI, and CI/build fixes.

* refactor: update Vulkan logging calls to use `nprintf` for scoped logging

* fix: correct shadow cascade count in Vulkan logging calls

* fix: fall back to PATH-resolved ccache when CCACHE_PATH is stale

CI hardcodes /usr/local/bin/ccache, but macOS runners on Apple Silicon
hosts install Homebrew (and ccache) under /opt/homebrew instead,
causing all four Mac configs to fail with "No such file or directory".

* Fix vulkan texture readback to correctly handle transparent pipelines

* Put the pixel swizzles into a util file

* OOB safety check

* Fix fog handling

* Fix MSAA in Vulkan

* fix: enable SMAA for vulkan

* adapt the post-processing AA shaders to hdr

* fix clang-tidy warnings: concatenate nested namespaces, static methods

pixel_swizzle.{h,cpp}: collapse `namespace graphics { namespace util {`
into `namespace graphics::util {` (modernize-concat-nested-namespaces).

VulkanState.h/VulkanDraw.h: getClearColor()/setClearColor() only touch
gr_screen and other globals, no instance state, so make them static
(readability-convert-member-functions-to-static) and drop the
top-level const on getClearColor()'s return type
(readability-const-return-type).

* fix clang-tidy warning

* Extend raytraced shadows to all directional lights

RT shadows previously only shadowed the first directional light in the
scene, even though multi-sun missions push more than one directional
light into the engine. The TLAS raytraced shadows query against is
already light-agnostic, so this extends both the deferred lighting
pass and the forward MODEL shader to shadow every directional light
(capped by a new Max Raytraced Shadow Lights option, configurable via
the in-game Options menu or the Lab's Scene rendering options).

Cascaded shadow maps are untouched: they're built for a single light
only, so the deferred pass still limits itself to one shadowed
directional light whenever CSM (not raytracing) is the active method.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016DA6JHJ3twz2oHGQcZ1Udc

* refactor: improve shader flag handling and render target finalization in Vulkan backend

- Consolidate shader flag setup logic in VulkanPostProcessingLighting to simplify configuration.
- Fix dead field usage in VulkanDraw by ensuring correct image view selection for environment maps.
- Add mip chain regeneration in VulkanRenderer::endRenderTarget to ensure correct mip levels for cubemaps.

* fix: ensure correct mip chain initialization in cubemap rendering

- Add mip chain generation to VulkanDraw for cubemaps with multiple mip levels.
- Fix potential issue with uninitialized mip levels above level 0 in deferred-f.sdr sampling paths.

* fix: don't crash on startup when environment locale is unavailable

std::locale("") pulls in the process's environment locale categories
(LC_CTYPE, LC_MONETARY, LC_PAPER, etc.), and throws std::runtime_error
if any of them names a locale not installed on the host (e.g.
mismatched regional-format overrides). Since SCP_default_locale is
constructed during static initialization, before main() and before any
of our own exception handling exists, an uncaught throw here aborted
the whole process before the game even started. Fall back to the
classic "C" locale instead, which is sufficient since this locale is
only ever used for ASCII case-folding (SCP_toupper/tolower/isdigit).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* `feat: add raytraced shadows for local lights and optimize TLAS management`

* Make the Commandline authoritative for -res and -vulkan / -opengl

* address BMagnu's comments on the original PR

* update prebuilt version hash to 62c89ef6

* refactor: standardize graphics API handling and document Vulkan limitations in qtFRED

- Updated `AboutDialogModel.cpp` to use `GraphicsAPI` enum for better clarity.
- Ensured qtFRED falls back to OpenGL when Vulkan is requested.
- Added detailed documentation in `qtfred/README.md` regarding Vulkan backend limitations and requirements.

* chore: include cmdline library in main and mission management modules

* docs: add known issue for blank render viewport under Wayland in README.md

* fix CI issues

* chore: add `GR_DEBUG_SCOPE` markers across Vulkan post-processing and rendering paths for improved debugging

* feat: improve Vulkan HDR pipeline with separate encode paths for SDR and HDR10

- Added an HDR10-specific output encode pass in `VulkanRenderer` and `VulkanPostProcessor` that applies PQ/BT.2020 transfer.
- Introduced an optimized SDR fallback path with direct blit support for devices that can skip shader draws.
- Updated `m_sceneLdrCompressed` to provide [0,1]-clamped proxies for HDR edge detection.
- Refactored `copyImageToImage` and added `blitImageToImage` to allow format conversions and optimized transfers.
- Replaced `hdr_mode` with explicit HDR10 flags and data structures for clearer state handling.

* refactor: encapsulate SMAA processing and refactor VulkanPostProcessor

- Moved SMAA-specific logic into `VulkanSMAA` class for better separation of concerns.
- Simplified `initSMAA`, `shutdownSMAA`, and `executeSMAA` logic by leveraging `VulkanLDR` and `PostProcessContext` abstractions.
- Improved initialization and cleanup code with clearer resource lifecycle management.
- Updated debug markers and messages to reference `VulkanSMAA`.
- Enhanced flexibility of fullscreen triangle rendering API with additional parameters (`sampleCount`, `bindGlobalSet`).

* Update Vulkan porting credits in AboutDialogModel

* fix CI issues again

* fix: correct Y-flip in viewport setup for Vulkan light volumes

- Adjusted viewport height to negative value to account for G-buffer render pass's negative Y-axis convention.
- Ensured proper alignment of point and tube light volumes with actual light positions.

* feat: add user-adjustable gamma correction to SDR and HDR10 output paths

- Added gamma correction to HDR10 path, applying user settings before PQ/BT.2020 encode.
- Replaced the SDR blit-only path with an encode pass that applies gamma correction, ensuring consistent behavior across devices.
- Refactored VulkanPostProcessor and associated shaders to support gamma slider adjustments for both SDR and HDR output.

* fix: ensure proper uniform and cull mode setup for Vulkan sphere rendering

- Added uniform buffer setup and default material uniforms in `vulkan_draw_sphere`.
- Disabled face culling in material definition for sphere rendering to align behavior with OpenGL.

* Ensure memory flushes after UBO updates and add explicit pipeline barrier for MoltenVK compatibility.

* fix: add clear pass for SMAA edge detection to prevent persistent artifacts

* feat: add Vulkan debug-utils messenger, opt-in sync validation, frame diagnostics

Groundwork for the renderer-review fix series (.agents/plans/
vulkan-renderer-review-fixes.md, Phase 0):

- Register a VK_EXT_debug_utils messenger (preferred) instead of only the
  deprecated VK_EXT_debug_report callback, which is kept as a fallback for
  loaders without debug-utils. The messenger config is also chained into
  instance creation so vkCreateInstance-time messages are captured.
  Validation errors/warnings now go to the main log via mprintf.
- New -gr_sync_validation cmdline flag (implies -gr_debug): chains
  VkValidationFeaturesEXT with synchronization validation into instance
  creation when VK_LAYER_KHRONOS_validation is available. This is the
  regression net for the synchronization fixes in the following commits.
- Frame stats now report descriptor sets/writes allocated per frame and the
  total pipeline count (descriptor-manager counters; DescriptorWriter::flush
  moved out-of-line to report into the manager).

Co-Authored-By: Claude Fable 5 <[email protected]>

* refactor: unify Vulkan render-pass begins, clamp in-pass clears, add per-frame UBO ring

Phase 1 of the renderer-review fix series: shared helpers that the
correctness fixes build on.

- New VulkanRenderer::beginTrackedRenderPass(PassBeginDesc): every render-pass
  begin on the frame command buffer now records vkCmdBeginRenderPass and
  updates the state tracker (pass, color attachment count, sample count,
  render area, viewport) in one place. Converted: setupFrame,
  beginSceneRendering (both branches), resumeSceneRendering,
  endSceneRendering, beginRenderTarget (viewport kept for gr_set_viewport),
  resumeSwapChainPass, plus new resumeScenePassAfterCopy() shared by
  copyEffectTexture/copySceneDepthForParticles and
  rebeginSwapChainPassAfterReadback() shared by both readbackFramebuffer
  exits (~200 lines of duplicated begin/clear/viewport blocks removed).
- The state tracker records the active render area; all four
  vkCmdClearAttachments sites clamp their rects against it and skip empty
  results. Previously gr_screen-sized clear rects could exceed a smaller
  off-screen render target's render area, which is invalid API usage.
- New PerFrameUboRing utility (VulkanPerFrameUbo.h/.cpp): a persistently
  mapped uniform buffer with one slot region per frame in flight and a
  self-flushing alloc(). Used by the next commit to fix the cross-frame
  UBO races.

Deliberate behavior deltas (all safe-direction): the helper always sets
colorAttachmentCount/sampleCount (some sites previously inherited stale
values), and resumeSwapChainPass/resumeSceneRendering now also reset the
standard flipped viewport instead of leaving the previous one.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix: eliminate Vulkan cross-frame UBO/buffer races, make gr_sync honest

Phase 2 of the renderer-review fix series: with two frames in flight, several
host-visible resources were rewritten by the CPU while the previous frame's
GPU work could still be reading them.

- The post-processing scratch UBO is now a PerFrameUboRing (per-frame-in-
  flight slot regions, persistently mapped, self-flushing alloc). All the
  per-pass map/unmap/cursor bookkeeping in bloom/LDR/fog/SMAA is deleted;
  the cursor resets exactly once per frame via the new
  VulkanPostProcessor::beginFrame() hook in setupFrame.
  This also fixes two latent bugs: (a) fog consumed scratch slots mid-scene
  and bloom's later same-frame cursor reset overwrote them before submission
  whenever fog+bloom were both active; (b) volumetric_fog_data (288 bytes)
  overflowed the 256-byte slots - the memcpy spilled into the neighboring
  slot and the shader's bound range ended before the aspect/fov/noise
  fields. Slots are now 512 bytes (static_assert at the fog call site) and
  the per-frame budget is 32 slots.
- The dedicated tonemap, output-encode, and MSAA-resolve UBOs (each a single
  instance rewritten per frame, i.e. racy; the MSAA one also never flushed)
  are deleted entirely - those passes build their structs on the stack and
  allocate from the scratch ring.
- Static-buffer rewrites orphan instead of racing: getVkBuffer() stamps a
  last-used frame number, and a full-content updateBufferData() on a Static
  buffer used within the last MAX_FRAMES_IN_FLIGHT frames defers the old
  VkBuffer to the deletion queue and writes a fresh one. Offset writes
  (GPU-heap appends to fresh regions) and PersistentMapping buffers (the
  engine holds their mapped pointer and syncs via gr_sync) are exempt.
- gr_sync_wait now honors its contract: VulkanRenderFrame::waitForFinish
  takes a timeout and reports expiry without consuming the fence;
  VulkanRenderer::waitForFrame returns false for fences taken during the
  still-recording frame (previously it waited on a stale or idle slot and
  reported success) and resolves the frame->slot mapping correctly. This
  makes UniformBufferManager's segment-fence throttling actually protective
  on Vulkan for the first time.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Refactor framebuffer and target lifecycle: centralized creation/resizing logic, improved resource management across Vulkan post-processing subsystems.

* Improve Vulkan cross-frame sync with explicit access masks and validation updates

- Unified Vulkan validation flag handling in setup, separating engine debug output from synchronization validation.
- Specified access masks and stage flags to address cross-frame WRITE_AFTER_WRITE vulnerabilities, notably in G-buffer, post-processing, and MSAA resolve paths.
- Adjusted subpass dependencies and image layout transitions to prevent read-after-write and write-after-write hazards, detected using `-gr_sync_validation`.
- Fixed uniform buffer and barrier transitions to ensure proper ordering in render passes across frames.

* Refactor Vulkan render-pass dependencies and sync stages for clarity and future testing

- Clarified dependency logic for cross-pass and cross-frame synchronization, ensuring explicit stage and access flag comments match observed behavior.
- Adjusted subpass dependencies to decouple render-pass compatibility definitions from dependency assumptions.
- Highlighted MoltenVK-specific issues and retained workarounds with notes for re-testing on macOS hardware.
- Updated synchronization barriers and validation notes to address historical inconsistencies across platforms.

* Remove transfer queue support; consolidate all operations into the graphics queue

- Removed transfer queue handling, simplifying buffer and queue logic to use the graphics queue for all transfer operations.
- Updated buffer sharing modes and removed related code paths and parameters for transfer queue families.
- Introduced exclusive buffer access, noting async transfer and queue ownership transfers are future work.
- Limited enabled device features to only those actively used by the renderer, reducing unnecessary feature requests (e.g., robustBufferAccess).

* Refactor frame advancement and descriptor management in VulkanRenderer

- Removed `endFrame()` from `VulkanDescriptorManager`, replacing it with `setCurrentFrame(frameIndex)` for explicit frame synchronization.
- Centralized frame index advancement within `VulkanRenderer` to ensure consistency across components.
- Invalidated cached descriptor set bindings at render-pass boundaries to handle raw recorder staleness correctly.
- Optimized pipeline descriptor rebind logic by removing redundant clears during pipeline changes.

* Refactor `PipelineConfig::hash` and Global descriptor set management for improved hashing and memoization efficiency

- Replaced inefficient shift-based hashing in `PipelineConfig::hash` with a robust `hashCombine` strategy to minimize bucket collisions.
- Introduced `maskBits` helper to streamline bitmask creation for boolean fields.
- Implemented memoization for Global (Set 0) descriptor sets, reducing redundant rebuilds across frames and improving performance.
- Added dirty state tracking (`m_globalSetDirty`) and invalidation logic for Global set updates following relevant input changes (e.g., TLAS or UBO modifications).

* Refactor Vulkan post-processing output logic: extracted shared `encodeToSwapChainPass` method to streamline HDR and SDR output paths.

* Optimize Vulkan descriptor set management with per-frame memoization

- Added memoization for Material (Set 1) and PerDraw (Set 2) descriptor sets to reuse cached sets across frames if inputs remain unchanged.
- Implemented precise input tracking for Material and PerDraw descriptor sets to detect and rebuild only when necessary.
- Reduced redundant Vulkan descriptor allocations and writes, improving performance on repeated or batched draw calls.

* Fix Vulkan access masks for G-buffer and scene pass transitions

- Added `eColorAttachmentRead` to access masks in multiple barriers to ensure proper synchronization for load operations (e.g., `loadOp=eLoad`) across render passes.
- Prevented `READ_AFTER_WRITE` synchronization validation issues in deferred and multi-pass rendering scenarios.
- Updated comments to clarify the reasoning behind the access mask changes and load dependencies.

* Refactor Vulkan resource management and indexed draw logic

- Consolidated destruction queue methods in `VulkanDeletionQueue` using a shared `queueHandle` template to reduce redundancy.
- Introduced `ModelDrawParams` structure and `computeModelDrawParams` function to unify indexed draw parameters for models and shadows.
- Simplified draw logic by eliminating repeated calculation of indexed draw parameters and improving code reuse.

* Add `releaseAnimationSlotRef` for ref-count handling of shared animation texture arrays

- Introduced `releaseAnimationSlotRef` to manage reference counting for shared animation texture-array slots, preventing premature destruction of shared resources.
- Updated `flushTextures` and related methods to integrate `releaseAnimationSlotRef` for shared slot cleanup.
- Refactored staging buffer creation into `createStagingBuffer` for 3D texture uploads and shared path consistency.
- Enhanced texture upload logic with improved tracking and logging for re-upload cases, aiding preloading gap analysis.
- Added instrumentation for on-demand mid-frame texture uploads in `FrameStats`.

* Refactor Vulkan resource and texture management, extend debug logging

- Updated smart pointer usage for consistency across Vulkan resource managers (`std::make_unique`).
- Removed redundant `cubeImageView` member and related cleanup logic; unified sampling view management.
- Added per-instance debug log counters (avoiding static state) for Vulkan texture uploads and bindings, improving visibility during initialization and run-time.
- Optimized `VulkanRenderer` property/feature getters by caching physical device properties and features during device creation.
- Improved memory region flushing logic for out-of-date offsets, aligning with Vulkan Memory Allocator behavior.
- Refactored render pass state tracking to reapply dynamic state reliably after mid-frame render passes.
- Enhanced validation and error handling for mismatched update texture formats.

* fix CI build warning

* Fix on-demand YUV texture locking and set alpha uniform for movie rendering in Vulkan

- Corrected bitmap lock type from `BMP_TEX_OTHER` to `BMP_AABITMAP` for YUV textures during on-demand loading.
- Updated movie rendering to bind alpha from the `MovieData` UBO (set 2, binding 4) for Vulkan, aligning behavior with OpenGL implementation.

* revert inadvertent changes introduced by a squash commit

* address ci issues

* remove wip stuff from code comments that make no sense to people who aren't me

* Remove unused LD_LIBRARY_PATH export and fix shader shadow map sampling.

* Refactor batched rendering uniform setup in Vulkan

- Removed unused fields from `genericData` uniform block, simplifying shader definitions.
- Updated Vulkan material uniform handling to align with OpenGL's batched rendering logic.
- Introduced `batched_data` struct for streamlined UBO updates, improving maintainability and clarity.

* Add `-hdr` command-line option for HDR nits configuration

- Introduced `-hdr` parameter to set paper white and peak luminance in nits, overriding in-game HDR settings.
- Added input validation with error feedback for incorrect format.

* Remove unused `MODEL_SDR_FLAG_SHADOW_MAP` macro from shader flags

* clean up unrelated changes

* Invalidate Vulkan state tracker bindings after external command buffer modifications

- Added `invalidateExternalBindings()` to `VulkanStateTracker` to handle stale pipelines, descriptors, and dynamic states caused by external Vulkan commands (e.g., ImGui renders mid-pass).
- Updated ImGui rendering flow to call `invalidateExternalBindings()` post-draw, ensuring consistent pipeline state for subsequent engine renders.
- Adjusted image usage flags to account for `eTransferSrc` in texture readbacks.
- Fixed barrier `dstAccessMask` and pipeline stage flags to ensure proper synchronization for image transitions.

* Add a few more generically useful lines to the log

* Simplify Qt deployment logic and improve handling for system-installed Qt on Linux

* add cmdline headers to make qtFred compile

* use VK_KHR_synchronization2 for sync and barrier purposes

* Simplify and clean up Qt deployment logic in CMake for qtfred

* update get_bitmap_from_texture to match the new API

* Enhance `-hdr` command-line option to force HDR output and support optional nits configuration with improved input validation and overrides.

* Improve Vulkan robustness, add device feature checks, and refine memory/logging.

- Added depth clamping support gated by device feature checks, with fallback where unsupported.
- Improved deferred lighting UBO overflow handling with user-accessible warnings and buffer size adjustments.
- Enhanced Vulkan logging for validation, allocation, and debugging:
  - Automatic logging for descriptor pool exhaustion/fragmentation.
  - Vertex format and resource destruction checks.
  - Notifications for generic layout transitions and volumetric texture uploads.
- Consolidated shader logic to ensure Vulkan and OpenGL parity.

* Remove HDR10 encode shader and consolidate gamma correction logic for SDR and HDR10. Replace `Verify` assertions with `Assert`

* Add braces to conditional in object lighting logic for clarity

* Refine Vulkan memory allocation checks with `Verification` for improved error handling and messaging.

* Refine VulkanBuffer resize logic to preserve contents with CPU-side copy and add safeguards for non-coherent memory scenarios.

* Add detailed comments explaining descriptor array capacity constants in VulkanDescriptorManager

* Gate shadow support on depth clamp feature availability and clarify its necessity with improved comments.

---------

Co-authored-by: BMagnu <[email protected]>
Co-authored-by: Mara van der Laan <[email protected]>
Co-authored-by: Claude <[email protected]>
2026-07-21 16:58:21 +00:00
Goober5000 3e317d9734 Merge pull request #7515 from Goober5000/feature/reorder_ships_wings
add a Reorder Ships and Wings editor to FRED
2026-07-20 23:56:30 -04:00
Goober5000 47d5ccca35 Merge pull request #7588 from Goober5000/cleanup/external_weapons
External weapon model cleanup: consolidate duplicated logic, fix several longstanding bugs
2026-07-20 23:40:35 -04:00
Goober5000andClaude Fable 5 52763935c7 add a Reorder Ships and Wings editor to FRED
Accessible from the Tools menu, this dialog lists all ships or all
wings (selectable via a drop-down) and provides Move to top/up/down/
bottom buttons.  Moves are applied immediately via the slot
reassignment utilities in missioneditor/common.h, using adjacent swaps
so the relative order of other entries is preserved.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-20 23:15:16 -04:00
Goober5000andClaude Opus 4.7 175f414c03 add Wings[] slot reassignment utilities for FRED/qtFRED
reassign_wing_slot moves a wing between Wings[] slots, fixing up every
back-reference: Ships[i].wingnum, the Starting/Squadron/TVT_wings caches
(via update_custom_wing_indexes), the FRED-side parallel array
wing_objects, and cur_wing (passed via FredWingSlotConfig so non-FRED
callers can opt out).  swap_wing_slots wraps it as a three-leg swap
through a temporary empty slot.

Also consolidates update_custom_wing_indexes (previously duplicated
verbatim in fred2/management.cpp and qtfred Editor) into common.cpp so
the new utility — and any future caller — has one shared implementation.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-07-20 23:04:56 -04:00
Goober5000andClaude Opus 4.7 74b2776c00 add Ships[] slot reassignment utilities for FRED/qtFRED
reassign_ship_slot moves a ship between Ships[] slots, fixing up every
back-reference: Objects[].instance, Ai_info[].shipnum, Wings[].ship_index[],
Player_start_shipnum, Ship_registry's cached shipnum, and the FRED-side
parallel arrays Fred_alt_names/Fred_callsigns plus cur_ship (passed via
FredShipSlotConfig so non-FRED callers can opt out).  swap_ship_slots
wraps it as a three-leg swap through a temporary empty slot.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-07-20 23:04:56 -04:00
Goober5000andClaude Fable 5 7b241812ed make ship move-correct
Ship's implicit move operations compiled but were semantically broken in
two ways: moving copied the subsys_list sentinel's links verbatim,
leaving the bookend nodes of the intrusive subsystem list pointing at
the old sentinel address; and the raw owning warpin_effect /
warpout_effect pointers were copied without nulling the source, so a
vacated Ships[] slot aliased live WarpEffects that ship::clear() (on
slot reuse) or ship_close() (which walks every slot) would delete out
from under the destination ship.

Fix both at the member level so the compiler-generated moves are
correct by composition:

- Add ship_subsys_sentinel, derived from ship_subsys, whose move
  operations re-link the bookend nodes (handling the null-linked,
  self-referential-empty, and populated source states) and leave the
  moved-from sentinel as an initialized empty list.  Copying is
  deleted.  Public inheritance keeps &ship::subsys_list convertible to
  ship_subsys*, so list_init, GET_FIRST, and every other call site is
  unchanged.

- Convert warpin_effect and warpout_effect to std::unique_ptr.  The
  delete-and-null blocks in ship::clear(), ship_close(), and
  ship_set_warp_effects() collapse into reset(); call sites that borrow
  the pointer into a raw local now use get().

With the members handling themselves, declare ship's special member
functions: defaulted default constructor and moves, deleted copies
(previously implicit via the unique_ptr members, now stated intent).
The moves are deliberately not declared noexcept because members like
SCP_map and std::deque do not have standard-guaranteed nothrow moves;
the computed exception specification is used instead.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-20 23:04:56 -04:00
Mike Nelson 1281871694 Reduce mouse travel when naming new event-editor messages (#7633)
Move the New/Insert/Delete message buttons directly above the message
name field so creating a message and naming it no longer requires
travelling past the message text box.

Also focus and select the name field after New Msg and Insert Msg so
the placeholder name can be replaced by typing immediately, without an
extra click.
2026-07-20 22:57:46 -04:00
Mike Nelson 533aa66ac2 Enforce single instance for non-modal editor dialogs (#7632)
Menubar entries and keyboard shortcuts (e.g. Shift+E for the event
editor) created a new dialog instance on every activation. Route the
non-modal dialog slots through a showSingleInstanceDialog helper that
raises and focuses an already-open instance instead of creating a
second one.

Ship/Wing/Prop and the error checker keep their existing member-pointer
guards since other code references those open instances.
2026-07-20 22:56:39 -04:00
Mike Nelson b1c3022144 signal and slot cleanup (#7621) 2026-07-20 22:55:33 -04:00
Mike Nelson 25132986e0 use ship index, not objnum (#7625) 2026-07-20 22:55:22 -04:00
Mike Nelson ec7ea78c2a make width of orders dropdowns smarter (#7626) 2026-07-20 22:55:04 -04:00
Goober5000 820048bda8 Merge pull request #7608 from Goober5000/fix/vector_movable_collections
fix move semantics for data loaded from .tbl and .tbm files
2026-07-20 19:15:31 -04:00
Goober5000 cdb11f7357 patch mission format compatibility for new support features (#7624)
Although #7249 added the new support features to `check_for_25_1_data()`, the new fields were still written to the mission file in all formats except retail.  Use a version check when writing the fields too.
2026-07-20 16:51:46 -04:00
Goober5000 e8d9b5f77c Merge pull request #7432 from Goober5000/claude/CJumpNode_vector
refactor CJumpNode to use SCP_vector
2026-07-19 23:58:52 -04:00
Goober5000 4b28f92d42 Merge pull request #7622 from Goober5000/fix/port_to_fred
port several QtFRED fixes to FRED
2026-07-19 22:41:23 -04:00
Goober5000 b82fa2a996 refactor CJumpNode to use SCP_vector
Jump nodes previously used SCP_list; refactor to use SCP_vector.  Also improve resource handling and life cycle management.

Follow-up to #7431.
2026-07-19 22:25:33 -04:00
Mike Nelson 23efd03d1c save shine effect (#7620) 2026-07-19 21:50:49 -04:00
Goober5000 69c6ce3b5f Merge pull request #7617 from Goober5000/fix/texture_upload
Exempt user bitmaps from texture detail culling
2026-07-19 01:47:28 -04:00
Goober5000andClaude Fable 5 914c8b6f39 Handle props in the Object Orientation editor
The object list in orient_editor::OnInitDialog() predates props, so
every prop in the mission fired the "Unknown object type" warning when
the dialog opened, and props could not be selected as point-to targets.
Add them to the list like qtFRED does since #7402.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-19 00:19:57 -04:00
Goober5000andClaude Fable 5 2d5eb3f9b6 Render team colors on ships in the FRED viewport
render_one_model() never passed the ship's team color to the model
renderer, so ships with an assigned team color displayed with their
class defaults.  Set it the same way qtFRED does since #7403.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-19 00:19:57 -04:00
Goober5000andClaude Fable 5 b80895c75e Don't wipe a ship's team color when the Initial Status combo is disabled
The team color combo box is only populated and enabled in single-edit
mode for a ship class that uses team colors.  In multi-edit (or for a
class without team colors) the combo stays disabled, and OnOK() fell
into the unconditional else branch that reset the current ship's
team_name to none.  Only apply the combo selection when the combo is
actually enabled, matching the qtFRED fix in #7403.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-19 00:19:57 -04:00
Goober5000andClaude Fable 5 5d66e4ce61 Don't apply reinforcement or destroy-before-mission to player starts
The ship flags dialog disables these checkboxes only when the selection
consists solely of player starts.  In a mixed selection (player start plus
regular ship), OnOK() ran update_ship() on the marked player starts too,
and set_reinforcement() would emplace a reinforcement entry for the player
before the ship_name_lookup() (which skips player starts) failed, leaving
a bogus Reinforcements entry that persisted into the saved mission, plus
an Int3() in debug builds.  Skip both flags for OBJ_START, matching the
qtFRED fix in #7402.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-19 00:16:49 -04:00
Goober5000andClaude Fable 5 35312d379c Check texture bind results in the volumetric nebula pass
gr_opengl_tcache_set() leaves the previous binding active when it
fails, so the glTexParameteri calls that follow would modify the filter
state of an unrelated texture.  Only set the parameter when the volume
texture actually bound.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-19 00:12:21 -04:00
Goober5000andClaude Fable 5 61a217c462 Exempt user bitmaps from texture detail culling
At texture detail below maximum, opengl_create_texture() culls texture
dimensions on upload, but user bitmaps are streaming surfaces
(streamed animations, video) whose frames are updated through
gr_update_texture() with the bitmap's own dimensions.  Once culled, the
glTexSubImage3D update exceeds the texture's actual size, so OpenGL
rejects it with GL_INVALID_VALUE and the animation silently freezes on
its first, downsampled frame.  Culling them also saves nothing, since
full-size frame data is streamed every frame regardless.

Also assert in gr_opengl_update_texture() that the update dimensions
match the texture, so any future mismatch of this kind is caught in
debug builds instead of failing silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-19 00:12:21 -04:00
Goober5000 831f3a4c92 Merge pull request #7539 from Goober5000/feature/reorder_messages_events
Add event and message reordering to the FRED event editor
2026-07-18 23:59:13 -04:00
wookieejedi 47726f21d0 Fix AI Bug with Strafing (#7619)
* Fix AI Bug with Strafing

Bug:
When a fighter or bomber enters strafe mode attacking a large ship, that large ship may die or depart, which results in the fighter/bomber AI slowing down to 0 and then not moving until another order is issued. This is most apparent in mods that force strafe to be used more via the ai profile flags (such as FotG).

Cause:
This bug is caused by the following. A fighter/bomber whose strafe target is destroyed drops to AIM_NONE (see ai_execute_behavior) with its active_goal still set, so a standing order like attack-any is never re-processed and the ship slows to zero and remains still until another order is issued.

Fix:
If we're chasing or strafing against large ship but have lost our target, we need to clear the active goal to ensure ai_process_mission_orders() re-evaluates our orders next frame. Of course gate this behind a flag.

Tested and update fixes the issue. We are very much hoping this can be a part of a point-release since it is substantially needed for FotG missions and we want to release in the next month or so. Happy to answer any questions or discuss, too!

* target 26.2
2026-07-18 22:44:34 -04:00
Mike Nelson 3c63e756e7 Qtfred event/campaign editor enhancements (#7613)
* add move to top and move to bottom

* enable or disable log states based on selection

* add move to top and move to bottom to campaigns
2026-07-18 16:16:43 +01:00
Mike Nelson e182280d88 Qtfred minor fixes and tweaks (#7615)
* Fix window leaks

* Fix chain delay not saving

* add last saved to the status bar
2026-07-18 16:16:09 +01:00
Goober5000andClaude Fable 5 6f4825c45e Fix heap overrun in texture readback for the model transparency scan (#7616)
* Fix heap overrun in texture readback for the model transparency scan

gr_opengl_get_bitmap_from_texture() sized its readback buffer from the
texture cache slot dimensions and the bmpman frame count, but
glGetTexImage() returns whatever the bound GL texture actually contains.
When texture detail below maximum culls textures on upload, the two can
disagree, and the readback overruns the buffer (observed as heap
corruption when loading Zeus.pof with Texture Detail: Minimum).  Size
the readback from the dimensions and layer count OpenGL itself reports
for the texture, and pad the staging buffer to 4x4 block granularity in
case a driver writes tiny compressed mips back in whole blocks.

The readback now also allocates the returned buffer and reports the
dimensions of the data it returns, because the second half of the bug
was on the consumer side: bitmap_lookup indexed the readback data by
the bitmap's own dimensions, so with any culling in effect the
transparency scan read mostly uninitialized memory.  bitmap_lookup (and
its cache) now carries the actual readback dimensions, and it skips the
texture cleanly if the readback fails.

Also pairs the cache's vm_malloc allocations with vm_free instead of
free, and no longer ignores a failed tcache_set before reading back.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Harden the transparency-scan texture readback

Return fully opaque from bitmap_lookup::get_channel_alpha() when the
bitmap has no alpha channel, since indexing channel 3 of a 3-channel
buffer reads out of bounds (currently unreachable because the only
caller checks bm_has_alpha_channel() first, but no longer a trap).

Per review, also assert at maximum texture detail, where no culling
occurs on upload, that the readback dimensions OpenGL reports match the
texture cache slot, so any future slot mismatch is caught immediately
in debug builds instead of surfacing as corruption.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Fix inverted dimension check in opengl_export_render_target

The validation rejected the export only if both the width and the
height mismatched the texture cache slot, so a texture wrong in one
dimension passed through into opengl_get_texture, which trusts the
caller-supplied dimensions for its mipmap loop.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-18 09:50:46 +02:00
wookieejedi 86a4af4fc3 Fix fighter/bomber AI remaining stationary if engines repaired (#7609)
* draft both options

* cleanup

* authors

* whitespace
2026-07-17 20:42:14 -04:00
BMagnu 856e676e79 Add render path to dispatch Particles as Decals (#7507)
* Add path to dispatch particles as decals

* Testing and bugfixing

* Address feedback

* Fix Typo

* Fix obj attachment
2026-07-17 13:38:45 +09:00
Mike Nelson 446e8942ca fix volumetric related crash (#7610) 2026-07-15 18:53:00 -04:00
Fabian Woltermann ba002c5797 Merge pull request #7611 from MjnMixael/qtfred-theme-follow-system
QtFRED follow system theme mode
2026-07-15 23:22:55 +02:00
Mike Nelson 0b6647ff52 follow system theme mode 2026-07-15 15:22:05 -05:00
BMagnu fcaa9dd998 Allow trail particles to be parented to their spawner (#7528)
* Adapt particle at runtime

* Refactor EffectHosts

* fix issues

* cleanup

* Remove live transitive particles

* paticle hosts now do local correctly

* Fix effecthostparticle local mode

* again

* Set particle host orientation

* I don't like mixed local and global vectors

* agaiiin

* Fix validity check

* parent foo

* Fix bugs, hopefully finally

* refactor

* Flip new table option for intuitiveness

* Fix support for GCC9 due to issues with LWG3052

* Address feedback
2026-07-15 15:10:15 +09:00
The Force 7a69e3ec2f Show Table based texture replacements when adding ship in FRED (#7607)
* Load table Based texture replacements on ship create

* do FRED as well
2026-07-14 20:07:20 -04:00
Goober5000andClaude Fable 5 9bebf2592f give the "Set as Player Ship" button exclusive semantics in both editors (#7605)
In single-player missions, the "Set as Player Ship" button is supposed to make
the selected ship the one and only player start.  FRED did this correctly, but
qtFRED routed the button through the same setPlayer() toggle used by the
multiplayer "Player Ship" checkbox, which only promoted the selected ship and
never demoted the previous player start.  Since the checkbox is disabled in
single player, there was no way to demote the old start, so single-player
missions could accumulate multiple player starts.

Consolidate the exclusive logic into a shared helper,
set_single_player_start() in missioneditor/common.cpp, and call it from both
FRED's OnSetAsPlayerShip() and a new qtFRED model method,
makeSolePlayerStart(), which the button now uses.  This also avoids
setPlayer()'s early return on stale dialog state, which could cause the button
to silently do nothing.

Follow-up to #7600.

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-14 20:05:13 -04:00
John Fernandez 57be2eb333 Merge pull request #7603 from JohnAFernandez/Add-double-click-to-events
Allow double click to initiate search for sexp view items
2026-07-14 13:38:50 -04:00
Goober5000andClaude Fable 5 da24cdae38 store glowpoint override indices instead of pointers
glowpoint_bank_override_map stored raw pointers into the growable global glowpoint_bank_overrides vector.  Store indices instead, which survive vector reallocation.  The readers also lose a redundant second map lookup (they previously called find() and then operator[] on the same key), and prop_info's parallel map gets the same conversion.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-14 13:23:37 -04:00
Goober5000andClaude Fable 5 473630ed85 make ship_info's subsystems a unique_ptr and default the moves
The hand-written ~350-line memberwise move existed only to manage the
one raw owning pointer, and silently left any member it didn't mention
uninitialized in the destination.  With subsystems as a unique_ptr, the
defaulted moves and destructor are correct by composition.  Copies
become explicitly deleted (use clone()).  n_subsystems stays a plain
int because it is passed to varargs functions.  The moves are not
declared noexcept because libstdc++ computes a potentially-throwing
implicit specification; NOLINT suppresses clang-tidy accordingly.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-14 13:23:37 -04:00
Fabian WoltermannandClaude Fable 5 583192b9f8 Add intermediate framebuffer for gamma correction to prevent flickering (#7589)
* Add intermediate framebuffer for gamma correction to prevent flickering

* Fix frozen SCPUI briefing screen by resetting color mask before gamma pass

A masked draw pass inside the briefing map render leaves the GL color
mask fully disabled, and the Rocket UI material path never restores it.
Before cc63bfa7 this didn't matter: the frame was presented with a pure
glBlitFramebuffer, which ignores the color mask. The gamma-by-shader
change turned presentation into a regular draw, which respects the
mask, so every flip wrote nothing and the screen froze on stale
swapchain content while the engine kept rendering correctly underneath.
Hovering a briefing icon appended draws whose materials re-enabled
color writes, which is why the screen only updated while hovering.

Neutralize color mask and stencil state before the gamma draw, matching
the blend and depth-buffer neutralization already done there.

Fixes #7590

Co-Authored-By: Claude Fable 5 <[email protected]>

* Skip the gamma-correction pass when gamma is 1.0

The gamma shader is an identity transform at gamma 1.0, so present
Back_framebuffer directly via glBlitFramebuffer in that case (the same
present path used before the gamma shader was introduced), saving a
fullscreen draw per frame. The shader pass through GammaBlit_framebuffer
only runs when the effective gamma actually differs from 1.0.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Reuse Scene_ldr_texture as the gamma-correction pass target

Scene_ldr_texture is dead scratch by flip time: all of its consumers
(tonemap, FXAA/SMAA, the final post-process pass) write before reading
within gr_opengl_post_process_end(), which completes before the flip,
and the gamma pass fully overwrites it before blitting it to the
window. Attaching it to GammaBlit_framebuffer instead of allocating a
dedicated texture saves a screen-sized RGBA8 allocation (~8 MB at
1080p, ~33 MB at 4K).

The dedicated allocation remains as a fallback for the case where the
scene textures were clamped to GL_max_renderbuffer_size and don't cover
the screen.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-14 07:28:41 +00:00
John Fernandez 9adfa66bba Allow double click to initiate search
This allows double click to initiate search when a non-parent item is double clicked.  Double clicking a parent will still expand/contract an item.  Spacebar will also still initiate edit.
2026-07-13 20:20:43 -04:00
Goober5000andClaude Fable 5 e51db2ad49 fix builtin_message's defaulted moves and copy-assignment
The defaulted moves copied the conditionally-owned name and its
ownership flag without clearing the source, so reallocation of
Builtin_messages (mods append custom types via #Message Types) freed
every strdup'd name out from under the surviving elements.  Hand-write
the moves to reset the source and free the destination's old name.
Also fix copy-assignment, which leaked the old name and was unsafe
under self-assignment.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 14:45:52 -04:00
Goober5000andClaude Fable 5 009529b235 guard against empty weapon banks in external model render paths
ship_render_weapon_models(), HudGaugeHardpoints::render(), and
ship_stop_fire_primary_bank() indexed Weapon_info[] with the bank's
weapon index without checking for an empty bank (-1).  Banks within
num_*_banks are normally populated, but other code that iterates banks
treats them as possibly empty and guards accordingly (e.g.
ship_do_cargo_hidden, ship_page_in), so these paths now do too.  In
the hardpoints gauge an empty primary bank still draws its firing
point circles.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 13:19:23 -04:00
Goober5000andClaude Fable 5 6578217008 revive $Weapon Model Draw Distance; fix attached weapon model LOD depth
The draw-distance cull for attached external weapon models checked
MR_ATTACHED_MODEL, but nothing has set that flag since commit
1ef7688fa1, so $Weapon Model Draw Distance: has been dead for years.
The check also needed the ship resolved from the render params' object
number, which is deliberately not set while weapon models render
(setting it would make model_render_queue clobber the explicitly
passed gatling model instance), and it compared against a depth
computed as if the weapon model's ship-local position were in world
space.

Carry the distance in model_render_params instead
(set_attached_model_draw_distance, negative = not an attached model),
set by ship_render_weapon_models from the ship's tabled value.  When
set, model_render_queue measures depth from the eye position expressed
in the parent's frame (model_draw_list::get_view_position), which is
correct under the pushed parent transform, culls against the tabled
distance, and uses that same corrected depth for detail level
selection -- previously attached weapon models picked their LOD from a
garbage depth (roughly the eye's distance from the world origin).

MR_ATTACHED_MODEL is removed; nothing else referenced it. The unused
flags are also removed and the remaining flags are consolidated.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 13:19:23 -04:00
Goober5000andClaude Fable 5 90ea116d0f recreate external weapon model instance when a bank's weapon changes
The model instance used to spin Gun_rotation submodels (gatling
barrels) was created lazily on first render, guarded by a
once-per-bank bool that nothing ever reset.  If a primary bank's
weapon changed mid-mission (set-primary-weapon SEXP, scripting, rearm
precedence swap, multiplayer sync), the old weapon's instance leaked
until the ship was deleted and was silently discarded at render time
by the model/instance mismatch guard, while the new weapon never got
an instance, so its barrels never spun.

Replace the bool with a record of which weapon the instance was
created for, and move the logic into
ship_get_external_weapon_model_instance(), which recreates the
instance whenever the bank's weapon differs.  This self-heals after
every swap path without needing hooks in each of them.  The HUD
hardpoints gauge now goes through the same function instead of reading
the possibly-stale instance array directly.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 13:19:23 -04:00
Goober5000andClaude Fable 5 368a6a9053 consolidate external weapon model slot placement; fix HUD launcher position
The per-slot placement math for rendered external weapon models (the
angle-offset yaw plus the reload slide-back for missiles) was
duplicated four times across ship_render_weapon_models() and
HudGaugeHardpoints::render().  Extract it into
ship_get_weapon_model_slot_transform() so that future changes (such as
submodel-attached weapon banks) only need to touch one place.

This fixes a bug in the hardpoints gauge: the launcher-style secondary
branch computed the view-rotated world position but then rendered the
model at the untransformed local point, misplacing launcher models in
the rotated top/front views.

Also: hoist per-bank invariants out of the slot loops, drop the
redundant render_flags parameter of ship_render_weapon_models() (it
always equaled the flags already set on the render params), remove
long-dead commented-out code, and read the reload percentage once per
slot.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 13:19:23 -04:00
Goober5000andClaude Fable 5 741ed0e0f1 consolidate external weapon model firing point selection; fix two bugs
The logic for offsetting a shot by the external weapon model's firing
points was duplicated in ship_fire_primary(), ship_fire_secondary(),
and the AI's line-of-sight check.  Extract it into
ship_get_external_model_fp_offset().

This fixes two bugs that were present in all three copies:

1. The chain counter for "chain external model fps" weapons was reset
   when it reached weapon_model->n_guns (the number of gun banks)
   rather than the number of firing points in the bank being indexed.
   For the typical model with one gun bank the counter reset after
   every shot, so chaining never advanced past the first firing point;
   for a model with several gun banks the counter could index past the
   end of the first bank's point array.

2. The AI line-of-sight check advanced the chain counter even though it
   is only a query, desyncing the counter from the shots actually
   fired.  It now reads the current firing point without advancing.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 13:19:23 -04:00
Goober5000andClaude Fable 5 ea0e4feafa consolidate duplicated per-weapon page-in code
weapons_page_in(), weapons_page_in_cheats(), and weapon_page_in() each
duplicated the same ~60-line block for loading a weapon's models and
graphics.  Extract it into a weapon_page_in_one() helper; the cheats
variant passes load_graphics = false to preserve its behavior of
loading only model geometry.

Also fix the tautological Assertion in the default render_type case:
the old condition was always true inside that branch, so it could never
fire.  It now asserts render_type == WRT_NONE, which is the only other
legitimate value (invisible weapons).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-13 13:19:22 -04:00
wookieejedi 2e57072b57 Skip particle parsing to speed up FRED loading (#7602)
FRED takes a long time opening mods that have a lot of particle entries in the particles table such as FotG (can take over a minute or more sometimes), so given FRED never renders or pages in particles, just skip the parsing.
2026-07-13 11:57:01 +09:00
wookieejedi 1ca6c6a188 Fix shockwave damage bug (#7601)
* Fix two shockwave bugs

Bug:
Ship and SEXP created shockwaves with 0 speed last forever. A shockwave speed <= 0 is an "instant" shockwave, but the speed is used as a denominator for total_time. Dividing by 0 that creates in infinite shockwave (frozen at its initial radius of 1.0).

Fix:
Thus, add a safeguard to protect against the infinite duration. Note, ship-death and sexp shockwave run shockwave straight to shockwave_create(), whereas weapon shockwaves run weapon_do_area_effect() if <= 0 speed.

Bug:
It is possible the shockwave may have lifetime shorter than one frame (e.g. high speed, small radius), which by default results in shockwave applying no damage.

Fix:
Provide optional fix to ensure shockwave is not killed until after this frame's damage pass has run.

Tested and work as expected.

* just the 1expire fix

* comment cleanup
2026-07-12 22:56:37 -04:00
Goober5000 071677cff5 Merge pull request #7578 from Goober5000/cleanup/list_range
clean up and extend the linked list iterator adapter
2026-07-12 21:36:35 -04:00
Goober5000 dab690eab8 Merge pull request #7600 from Goober5000/fix/ship_demotion
fix a bug with player ships being demoted to common ships
2026-07-12 20:15:54 -04:00
Goober5000andClaude Opus 4.8 7d5bab25e3 fix a bug with player ships being demoted to common ships
If a player ship is changed to a regular ship, be sure that
Player_start_shipnum does not still point to the old ship.

Consolidate the several near-duplicate copies of the "repoint
Player_start_shipnum to a valid player start" logic, in both FRED and
qtFRED, into a single shared helper, ensure_valid_player_start_shipnum()
in missioneditor/common.cpp.

Also add some guards in situations where Player_start_shipnum might
be -1.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-12 19:32:39 -04:00
Goober5000 5c17ab6352 Merge pull request #7599 from Goober5000/fix/misc
miscellaneous small fixes
2026-07-11 22:22:07 -04:00
Goober5000 b66582e6f2 Merge pull request #7597 from Goober5000/cleanup/sexp_tree_const
const-qualify read-only sexp tree methods
2026-07-11 21:46:11 -04:00
Goober5000 4b761447e3 Merge pull request #7598 from Goober5000/fix/prop_selection
fix prop selection using model geometry instead of bounding sphere in FRED
2026-07-11 21:45:30 -04:00
Goober5000 b4a321d456 Merge pull request #7591 from Goober5000/fix/icon_propagation
fix several bugs related to icon propagation, mostly in FRED
2026-07-11 21:43:44 -04:00
Goober5000 25139fded8 Off is 1286 2026-07-11 21:02:36 -04:00
Goober5000 50f62b3ccf fix an Assertion and a latent campaign option 2026-07-11 21:02:36 -04:00
Goober5000 39c806771e when disbanding a wing, delete its reinforcement entry
Also rename `remove_wing` to `disband_wing` for clarity.
2026-07-11 21:02:36 -04:00
Goober5000 b9e43f2907 when sorting by fuzzy cost, use a stable sort 2026-07-11 21:02:36 -04:00
Goober5000andClaude Sonnet 4.6 dd83a20984 fix prop selection using model geometry instead of bounding sphere in FRED
In both FRED2 and QtFRED, object_check_collision() only dispatched to
model_collide() for OBJ_SHIP and OBJ_START, leaving OBJ_PROP to fall
through to fvi_ray_sphere().  For flat, wide props the bounding sphere is
much larger than the visible geometry, making it impossible to
click-deselect without clicking far outside the model bounds.

Add an OBJ_PROP branch that calls model_collide() with the prop's model
and instance numbers, consistent with how OBJ_SHIP and OBJ_START are
handled, and move the mc.model_instance_num default initialisation above
the dispatch so the prop branch can override it with the real instance
number.  In FRED2, also add an early-out guard for unoccupied prop slots
(QtFRED already gates on Show_props).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-07-11 20:57:29 -04:00
Goober5000andClaude Fable 5 fa9c20d6d7 clean up and extend the linked list iterator adapter
Clean up volition_linked_list / list_range in linklist.h:

* Merge the copy-pasted iterator and const_iterator classes into a
  single basic_iterator template.

* Make operator* and operator-> return the element pointer by value
  and const-qualify them.  Previously operator* returned a mutable
  reference to the iterator's own internal pointer, so writing through
  a dereference silently reseated the iterator rather than modifying
  the list, and a stored reference could dangle.

* Add the five iterator traits typedefs plus a default constructor so
  the iterators work with non-modifying <algorithm> functions such as
  std::find_if, std::distance, and std::reverse_iterator.

* Add the implicit iterator -> const_iterator conversion and allow
  iterator/const_iterator comparisons in either order, as the
  standard's container requirements specify.

* Deduce list_range's node type from the head's next pointer rather
  than from the head pointer itself (preserving the head's constness),
  so that a list headed by a type derived from the node type -- such
  as the self-relinking ship subsystem sentinel -- iterates as its
  node type.

* Make the constructors explicit, remove a stale <utility> include,
  and document that elements must not be removed from the list (nor
  freed) inside a range-for loop, since the iterator reads the current
  element's next pointer when it advances.

No behavior change at any existing call site; all existing loop
binding patterns compile unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 20:28:45 -04:00
Goober5000andClaude Fable 5 35e1686c2f const-qualify read-only sexp tree methods
Add const to query methods that the sexp_tree refactor left non-const:

- FRED2/qtFRED views: node, type, handle, and root lookups; label-edit
  eligibility; annotation key resolution and comment getters; qtFRED's
  validOperatorsForNode
- SexpTreeOPF: all instance get_listing_opf_* functions plus the
  dispatcher and get_default_value (the class holds only a reference
  to its model, so these are read-only by construction)
- SexpTreeModel: compute_context_menu_state and the two remaining
  ctx_* helpers, which write only their state out-parameter
- ISexpTreeUI: the two read-only navigation callbacks
  (ui_get_child_item, ui_has_children) in the interface and both
  frontend implementations

Also convert the four listing functions that use no editor state at all
(species, language, functional_when_eval_type, wing_formation) to
static, removing the NOLINT suppressions that had silenced clang-tidy's
convert-to-static warning since before the refactor.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 17:11:05 -04:00
Goober5000andClaude Opus 4.8 63b26ade93 Add event and message reordering to the FRED event editor
Add "Move to top / up / down / to bottom" controls -- vertical icon-button
strips beside both the event tree and the message list -- so events and
messages can be reordered in place.

Also add an "Insert Msg" button that inserts a message at the current
selection, mirroring the existing "Insert Event".

Tweak the message-area layout, drop the "Messages" label, and edit the
AFX_DIALOG_LAYOUT table for proper behavior when the dialog is resized.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-11 15:46:43 -04:00
John Fernandez 56dddef32a Merge pull request #7585 from MjnMixael/qtfred-sexp-tree-icons
Qtfred better sexp tree icons
2026-07-11 12:27:50 -04:00
John Fernandez add4f72179 Merge pull request #7581 from MjnMixael/qtfred-documentation-updates
Qtfred documentation updates
2026-07-11 12:26:51 -04:00
John Fernandez 1612233c01 Merge pull request #7594 from TheForce172/QTFred/missed-doc
Adds documentation for #7573
2026-07-11 12:25:10 -04:00
Goober5000andClaude Fable 5 50de61cf74 prevent zombie annotations and restore help box root-label comments
Root-label annotations (event-name comments/colors) that lose their
node — e.g. because their event was deleted — could survive
indefinitely and surface on the wrong items:

- saveToGlobal's root-key branch kept an unresolvable annotation in
  Event_annotations with an empty path instead of marking it for
  pruning, so once a zombie was persisted in a mission file it
  survived every save/load cycle.
- getByKey(-1) matched annotations whose node_index had been reset to
  the unresolved sentinel, so such a zombie's comment could display on
  any item that has no annotation key of its own.

Guard findByKey against the -1 sentinel, and prune any annotation
whose rebuilt path is empty at save time.  (The complementary
in-session fixes — removing a root-label annotation when its event is
deleted and re-keying it when insert-operator changes the formula
node — are handled in the shared model and actions by 'Keep event
annotations attached to their node across tree mutations'.)

Also restore root-label comments in the FRED2 help box: update_help
resolved comments by model node index, which is -1 for labels.  Route
it through a get_item_comment virtual that the event editor's tree
overrides with its annotation key lookup, matching pre-refactor
behavior.  (qtFRED renders comments per-item via NoteRole, which
already covers labels; its help box does not show comments by design.)

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 01:17:31 -04:00
Goober5000andClaude Fable 5 a7cb9bbf32 Restore pre-refactor on-disk format for event annotation paths
Annotation +Path: values written by pre-refactor FRED were built over
the UI tree, where each event's root item is the event-name label and
every element after the event index is a child position at successive
levels below it: [event] is the label, [event, 0] the top operator
(the label's only child), [event, 0, k...] its descendants.  The
refactored SexpAnnotationModel built paths over tree_nodes[], which
represents the label's single child directly as the formula node, so
paths came out one level shallower: existing missions' annotations
resolved one level too deep (and were re-saved wrong), and a
top-operator annotation produced the length-1 path that decodes as a
root-label key, silently migrating onto the event label.

Emit and consume the label-level child position in
buildPath/resolveFromPath to preserve the on-disk contract.  Child 0
resolves to the formula node and any other index fails resolution,
matching the old traverse_path behavior of walking off the label's
sibling list.  Annotations on the event label itself are unaffected:
they remain the length-1 path handled by the root-key branch.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 01:17:31 -04:00
Goober5000andClaude Fable 5 6825100f42 Keep event annotations attached to their node across tree mutations
Post-refactor successor of fix/annotations, rebuilt for the shared sexp
tree model introduced by the sexp_tree refactor (#7301).  The refactor
re-keyed annotations from UI item handles to tree_nodes[] indices, which
fixed most of the original decoupling by construction and already prunes
regular-node annotations in free_node2().  Two gaps remained, plus one
qtFRED regression:

- free_node2() only removed annotations keyed by node index, never a
  root-label annotation keyed rootKey(formula).  Deleting an event left
  that annotation live, so a later event whose formula reused the slot
  inherited the deleted event's annotation.  Remove the root key too;
  since the global Event_annotations are only rewritten at save, the
  removal still survives a Cancel.

- Inserting an operator above a labeled root changes the event's formula
  node, orphaning the root-label annotation keyed to the old index.
  Re-key it in insert_operator() so it follows the event.  (This is the
  only such flow: replace_operator() reuses the node in place.)

- qtFRED reorderByRootFormulaOrder() reloaded annotations from the
  global state, discarding any annotation edits made since the dialog
  was opened.  A root reorder changes neither node indices nor formulas,
  so drop the reload.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-11 01:17:31 -04:00
Goober5000 00c8b0f63b Merge pull request #7583 from Goober5000/fix/lua_secondary_bank_fields
fix Lua weapon bank setter writing primary fields for secondary banks
2026-07-10 23:53:17 -04:00
Goober5000 11debd5c0c Merge pull request #7596 from Goober5000/fix/various_sexp_tree_issues
Fix various sexp tree issues
2026-07-10 23:50:50 -04:00
Taylor Richards 309419b518 fix compile error in shadow shader (#7592)
A change introduced by #7529 caused a shader compile error on Mac due to an
attempted swizzle of texture(sampler2DArrayShadow,...), which returns a single
float value rather than a vector.
2026-07-11 02:46:18 +02:00
The Force 539eacf7d7 Adds documentation for #7573 2026-07-10 21:21:58 +01:00
Goober5000 3a1e802965 nullptr and SIZE_T_ARG 2026-07-10 13:42:41 -04:00
Goober5000andClaude Fable 5 8ab9f907b5 remove vestigial text_buf parameter from get_default_value()
The buffer round-trip was left over from the pre-refactor char-array
days: *item = *list already copies the text, and no caller reads the
buffer after the call. Removing it also removes the unbounded strcpy
into the callers' 256-byte stack buffers.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-10 13:42:41 -04:00
Goober5000andClaude Fable 5 c6e2603e19 fix move_branch() reparenting to root when parent index is 0
The only caller, SexpTreeActions::insert_operator(), passes a freshly
allocated tree_nodes index as the parent, and allocate_node() reuses
freed slots, so 0 is a valid parent index. The old 'if (parent)' test
(and qtFRED's 'parent > 0' copy of it) treated node 0 as attach-at-
tree-root, visually reparenting the wrapped branch to the root while
the model data placed it under node 0. Since the assertion already
requires parent >= 0, attach to the parent's handle unconditionally.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-10 13:42:41 -04:00
Goober5000andClaude Fable 5 1aeb6a6957 delete copy/move on the sexp tree model, OPF, and actions classes
SexpTreeOPF and SexpTreeActions hold references to their owning model
and UI, and SexpTreeModel owns an OPF member back-referencing itself,
so a copy would compile (copy construction was not implicitly deleted,
only copy assignment) but leave the copy's _opf silently bound to the
original model.  Nothing copies or moves these classes today; delete
the operations so nothing can.

The other sexp tree types were checked and are correct as-is:
SexpContextMenuState already deletes copy and implements move via
swap; SexpAnnotationModel and the item structs are deliberate value
types; sexp_list_item's shallow copy with manual destroy() is the
inherited idiom its callers rely on; the views are non-copyable via
their MFC/Qt base classes.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-10 13:42:41 -04:00
Taylor Richards 495e2965ce fix Qt6 fallback lib usage message (#7593)
When Qt6 falls back to using prebuilt libs force the option to enabled to
avoid an erroneous, but otherwise harmless, system lib usage message during
reconfigure.
2026-07-10 13:36:41 -04:00
Mike Nelson 0c48f7bd9e Update DESIGN_GUIDE.md 2026-07-10 08:49:53 -05:00
Mike Nelson 5ea93a0eb6 Update README.md 2026-07-10 08:43:34 -05:00
Mike Nelson 180af80b29 clean up preferences and add tooltips (#7582) 2026-07-10 08:13:59 -04:00
Mike Nelson e02af94e80 fix audio handle guards (#7575) 2026-07-10 08:13:34 -04:00
Goober5000andClaude Fable 5 b82a10a7ae Install a fallback editor interface in FRED2 sexp_tree_view
Only the event, goals, cutscenes, and campaign dialogs install a
SexpTreeEditorInterface; the ship, wing, message, briefing, and
debriefing editors left _model._interface null, and the shared OPF
code dereferences it unconditionally (getMessages, getMissionNames,
getMissionGoals, getMissionEvents).  Right-clicking e.g. the
event-name argument of is-event-true-delay in a ship arrival cue
crashed FRED.

Install a default-constructed interface at construction, mirroring
qtFRED initializeEditor.  The base implementations match the old
m_mode == 0 global fallbacks and the empty flag set keeps all
flag-gated paths behaving as before; dialogs that provide editor
context overwrite the fallback as they always did.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-10 00:11:24 -04:00
John Fernandez 98ddaea0b1 Merge pull request #7573 from TheForce172/QTFred/missing-warp-flag
QTFred: Add missing warp flag to ship editor
2026-07-09 22:12:28 -04:00
Goober5000andClaude Fable 5 978e3bea93 add briefing icon ID collision validation to qtFRED
FRED2 rejects an icon ID edit that would collide with another icon,
warning and reverting the field, but qtFRED's setIconId() applied the
value unconditionally. Two icons could be given the same ID in a stage
(making find_icon and forward propagation ambiguous), or a global rename
could merge two distinct icon chains by reusing a downstream ID.

setIconId() now mirrors FRED2:

- An ID is a single-icon concept, so it operates on the current icon
  rather than the whole selection (applying one ID to several selected
  icons would itself create a same-stage collision).

- Rejects an ID already used by another icon in the current stage.

- When propagating forward (Change Locally off), rejects an ID already
  used in a later stage, since the rename would merge two icons.

- Otherwise applies the change and renames the icon's forward copies by
  matching the old ID, respecting Change Locally.

It returns false when a change is rejected; the dialog resets the spin
box to the model's value. The spin box is switched to non-keyboard-
tracking so validation runs when the edit is committed (focus-out/Enter)
rather than on every keystroke, avoiding a modal warning on a transient
value mid-typing.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-09 00:12:35 -04:00
Goober5000andClaude Fable 5 48db13d883 fix minor briefing icon editor issues in FRED
- OnMakeIcon() left closeup_label uninitialized. The icon arrays are
  only cleared at mission reset, and delete_icon shifts structs down
  leaving stale copies behind, so a newly created icon could inherit a
  deleted icon's closeup label and then propagate/save it. Clear it,
  matching qtFRED's makeIcon.

- Case-only label edits (e.g. "alpha" to "Alpha") did not propagate
  forward: the change detection used stricmp, so a case-only change was
  treated as no change and applied only locally. Use strcmp for both
  label and closeup_label. qtFRED already compares case-sensitively.

- OnPropagateIcons() propagated a snapshot that could predate the text
  typed into the icon fields, since it never committed pending dialog
  edits first. Call update_data(1) before propagating.

- copy_stage() copied every stage field except draw_grid, so inserting,
  deleting, or reordering stages reset the grid-disabled flag. Copy it
  through (and default it to true for freshly created stages). qtFRED's
  copyStageData already preserves it.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-08 23:56:53 -04:00
Goober5000andClaude Fable 5 c6654dc3f7 prevent invalid briefing icon IDs in FRED and qtFRED
- Negative icon IDs are now rejected. FRED2 assigned the ID edit box
  value unconditionally even though it only validated collisions for
  non-negative values, so a negative ID could slip through and silently
  break find_icon()/propagation. It now reverts to the previous ID (with
  a warning, but only when the value was actually changed, to avoid a
  message-box loop on refresh). qtFRED gets a matching defensive guard in
  setIconId().

- OnMakeIcon() now skips IDs that are already in use. It previously used
  Cur_brief_id++, but Cur_brief_id is only advanced at mission parse, so
  a manual ID edit that raised an icon ID above it would cause the next
  new icon to silently collide. The new get_unused_briefing_icon_id()
  helper advances Cur_brief_id past any value already taken by an icon in
  the current briefing. qtFRED's makeIcon() already computes maxId + 1,
  which inherently skips existing IDs.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-08 23:43:01 -04:00
Goober5000andClaude Opus 4.8 c6c403ea54 fix briefing icon propagation bugs in FRED
- get_next_icon() used `stage_loop > num_stages` as its terminating
  check, allowing it to read one stage past the live range. On a full
  MAX_BRIEF_STAGES briefing this is a genuine out-of-bounds array
  access; below capacity it reads a non-live stage. Changed to `>=`.

- Icon scale_factor and the editable flag bits (highlight, mirror,
  wing, cargo) were always written locally, ignoring the "Change
  Locally" checkbox and never propagating forward like the other
  attributes. Route them through the same reset_icon_loop/get_next_icon
  propagation so they match id/label/type/team/ship_class (and qtFRED).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-08 23:18:55 -04:00
Goober5000andClaude Opus 4.8 bed228d264 avoid undefined behavior from UNREACHABLE on reachable code paths (#7555)
* avoid undefined behavior from UNREACHABLE on reachable code paths

UNREACHABLE expands to __assume(false) / __builtin_unreachable() in
release builds, which is undefined behavior if the code is ever actually
reached. Many UNREACHABLE sites only guard against unexpected-but-
possible runtime states (values from tables, mission/save files, network
packets, scripting, or user input), so reaching them should degrade
gracefully rather than invoke UB.

Replace UNREACHABLE with Assertion(false, ...) at all such sites. It
still pops an error in debug builds, but in release it is a harmless
no-op that simply falls through to the following code. Sites that are
genuinely unreachable by local invariants (e.g. a switch over a bounded
random number) are left as UNREACHABLE.

A few converted sites had no safe fall-through -- an uninitialized read,
null dereference, or null call would have followed -- so they also get a
minimal recovery: initialize the value, guard the dereference, return
early, or skip the offending item.

Where the converted site was a simple guard of the form
    if (x) { Assertion(false, ...); return; }
hoist the check onto the invariant instead:
    Assertion(!x, ...);
    if (x) { return; }
This states the expectation directly and shows the offending value in
the debug popup, while keeping the same graceful runtime degradation.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* addendum

After consultation with Lafiel, use UNREACHABLE in situations that are effectively impossible even if not provably impossible.  UNREACHABLE = "this shouldn't ever happen"; Assertion = "if this ever happens, it's a coding error".  Also fix a few other sites and change a couple to Warnings.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-09 11:20:25 +09:00
wookieejedi c05c06db95 Fix CockpitFOV and CockpitFOVToggle missing in default table (#7547)
* Update camera.cpp

* order cleanup
2026-07-09 11:20:16 +09:00
BMagnu b26c8e42f9 Double Tree Build for Windows Nightlies / Release to avoid issues with /MT /MD linkage (#7586) 2026-07-09 02:17:57 +00:00
John Fernandez 91dc178036 Merge pull request #7584 from MjnMixael/qtfred-ui-adjustments
Qtfred adjust ui based on feedback
2026-07-08 22:13:29 -04:00
John Fernandez 99dee5ab25 Merge pull request #7587 from MjnMixael/qtfred-sexp-tree-controls
Qtfred adjust tree controls
2026-07-08 22:12:50 -04:00
Goober5000 d7e1153c61 Merge pull request #7580 from Goober5000/remove_pending_messages
remove FRED's unused pending message mechanism
2026-07-08 21:28:24 -04:00
Goober5000 f143990fb2 Merge pull request #7579 from Goober5000/fix/spinning_orion
fix big ship waypoint completion (the "spinning Orion" bug)
2026-07-08 21:18:08 -04:00
Mike Nelson d94a895a1f adjust controls based on feedback 2026-07-08 19:04:38 -05:00
Mike Nelson fc6ce91106 clang 2026-07-08 18:52:18 -05:00
Mike Nelson e65d0d354b Better sexp tree icons for qtfred 2026-07-08 16:48:45 -05:00
Mike Nelson 39eab6fd92 adjust ui based on feedback 2026-07-08 12:14:22 -05:00
Goober5000andClaude Fable 5 da7e5b563b fix Lua weapon bank setter writing primary fields for secondary banks
The SWH_SECONDARY case of the ship_bank setter was copy-pasted from the
primary case and still assigned primary_bank_* fields; it now assigns
the secondary_bank_* fields.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-08 12:18:18 -04:00
Mike Nelson a8c68fb605 cleanup 2026-07-08 08:51:34 -05:00
Mike Nelson f578063833 add missing help text 2026-07-08 08:50:19 -05:00
Mike Nelson b1a6cc0866 update readme and add design guide 2026-07-08 08:50:07 -05:00
Goober5000andClaude Opus 4.8 48569f271c remove FRED's unused pending message mechanism
Never called from anywhere, even dating back to retail FRED.  It also
contained a latent bug: add_pending_message was missing a break, so it
would have filled every free slot in the buffer with the same message.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-08 03:05:21 -04:00
Goober5000andClaude Fable 5 9ea9f51ce1 fix big ship waypoint completion (the "spinning Orion" bug)
Since FS1 retail, a large ship could get permanently stuck circling its
final waypoint.  Waypoint completion requires the ship center to pass
within MIN_DIST_TO_WAYPOINT_GOAL + sqrt(radius) of the point (~37m for
a 1000m-radius capital ship), and the check only runs when the ship
covers 0.1m in a single frame (a framerate-dependent minimum speed).
At any speed that passes that gate, a capital ship turning at
2PI/(3*rotation_time) has a turning circle of hundreds of meters, so
once it overshoots a misaligned final leg it can never re-aim into the
completion bubble: an endless overshoot-turnaround-miss loop.

Add ai_profiles flag "$fix big ship waypoint completion:"
(Fix_big_ship_waypoint_completion), enabled by default for mods
targeting 26.2.  With the flag set:

- big/huge ships complete a waypoint anywhere within their own radius
  of it (matching what the docking path code has always done), while
  small ships keep the retail sqrt(radius) tolerance; and
- the completion check runs every frame instead of requiring 0.1m of
  travel per frame, removing the framerate-dependent minimum speed
  (which at 240fps is 24 m/s, enough to affect fighters too).

With the flag unset, behavior is unchanged from retail.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-08 00:48:24 -04:00
Goober5000 4fc444162e Merge pull request #7519 from Goober5000/move_fixes
several fixes to move semantics
2026-07-08 00:15:01 -04:00
Goober5000 2fc4ff10c0 Merge pull request #7557 from Goober5000/fix/brief_stage_move
make brief_stage non-copyable and non-movable; provide swap() and reset()
2026-07-08 00:14:46 -04:00
Mike Nelson 0d33ac8378 fix missing scene browser menu option (#7574) 2026-07-07 22:35:00 -04:00
Mike Nelson e1ac0e61bd fix docking mem leak (#7577) 2026-07-07 22:34:41 -04:00
The Force 07bd7f9d21 Add missing warp flag to ship editor 2026-07-07 18:24:33 +01:00
Goober5000 455ac462c0 fix translation/rotation bugs (#7544)
For standard translation offsets, the wrong axis was being used for translation.  Fix that.  Also fix a string offset when parsing a custom axis.

Follow-up to #4582 and #3056.
2026-07-07 14:47:44 +02:00
Goober5000andClaude Fable 5 22be26492e fix briefing lines when deleting an icon (#7556)
When an icon is deleted, remove any lines that reference it, and fix the
indexes of lines that reference the icons shifted down to fill the gap.
Previously stale lines silently reattached to the wrong icons.  This
matches the behavior of qtFRED's deleteCurrentIcon.

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-07 14:47:18 +02:00
Goober5000andClaude Fable 5 3dcd8e655b two loadout fixes (#7558)
* fix stale color_to_draw causing draw_model_icon crash with model_id of -1

In draw_wing_block(), color_to_draw was initialized once outside the
slot loop while bitmap_to_draw was reset every iteration.  Once any
slot in the wing took the model-icon path, color_to_draw stayed
non-NULL for all remaining slots.  A later slot whose icon had no
model (model_index == -1) and no bitmap frame to draw (e.g. a carried
icon that has not moved yet, or an icon ani with missing frames) then
fell into the color branch and called draw_model_icon() with a model
index of -1, crashing in model_clear_instance().

Reset color_to_draw each iteration, and give draw_model_icon() the
same model_id guard that draw_model_rotating() already has.

Co-Authored-By: Claude Fable 5 <[email protected]>

* guard against NULL color_to_draw when an icon ani is missing frames

In draw_ship_icon_with_number() and wl_render_icon(), a bitmap-based
icon takes the bitmap branch initially, so color_to_draw is never
assigned.  If a hot/selected/disabled state then swaps in an icon ani
frame that does not exist (e.g. a single-frame or truncated icon ani),
the frame index is -1, the final dispatch falls into the color/model
branch, and gr_set_color_fast() dereferences a NULL color.

Fall back to the normal icon color in that case.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-07 14:46:53 +02:00
Goober5000andClaude Fable 5 8f69542d4f call object_moved() in the FRED and qtFRED wing Align handlers (#7559)
The Align button repositions wing members by assigning objp->pos and objp->orient directly, skipping the post-move bookkeeping that the viewport drag and orient editor paths perform.  A wing member with a docked partner (e.g. an attached support ship) would be moved to its formation slot while the partner stayed behind with broken dock geometry.

Fix by calling object_moved() for each repositioned member, which resets the Docked_already_handled flags and drags docked partners along.  No-op for undocked ships.

Verified in FRED by docking a ship to a wing member and pressing Align.

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-07 14:46:46 +02:00
BMagnu e625f70a3b Move inline static to global static (#7572) 2026-07-07 14:46:26 +02:00
Goober5000 ccbbc0f33b fix wing display names in a single wave wing (#7565)
As noticed by @Achille44, wing display names were handled properly for multi-wave wings, but were inadvertently skipped for single-wave wings.
2026-07-07 14:44:37 +02:00
BMagnu d995b7d72e Ensure props survive mission restarts (#7571) 2026-07-07 14:44:26 +02:00
Goober5000 73fae42ede fix FRED indexing of Props (#7546)
Get the Prop class from the list, in the same way that a Ship class is gotten, which accounts for the no_fred flag.  Fixes #7545.
2026-07-07 14:44:06 +02:00
Goober5000andClaude Opus 4.8 d27582bbcb Fix FRED resetting the grid position after saving a mission (#7552)
When FRED2 saves a mission, OnSaveDocument() reloads it via
load_mission(MPF_FAST_RELOAD).  That reload calls clear_mission() ->
fred_render_init() -> create_default_grid(), which rebuilds The_grid as
the default origin-centered XZ plane, discarding any adjustments made in
the Adjust Grid dialog (e.g. the X-Z Plane Y Level).  The grid is editor
display state and is not stored in the mission file, so the reload had
nothing to restore it from.

The camera (view_pos/view_orient) is already preserved across this reload;
apply the same preserve-and-restore pattern to the grid by capturing its
orientation, center, dimensions, and square size before clear_mission()
and rebuilding it with create_grid() afterward.

qtfred is unaffected because its save path does not reload the mission.

Fixes #7548

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-07 14:43:54 +02:00
Asteroth 51aa9cf7eb change version (#7570) 2026-07-07 14:28:55 +09:00
Goober5000 4d2d4944ce fix "mesage" (#7569)
The CMake misspelling is a bug; the others are cosmetic; but might as well fix all of them.

Small follow-up to #7029.
2026-07-07 01:38:44 +00:00
John Fernandez 79279b26ff Merge pull request #7029 from TheForce172/QTFred/translate
Update To QT6
2026-07-06 20:17:46 -04:00
The Force 9477ca997e One more 2026-07-06 20:05:23 +01:00
Taylor Richards b050f985af fix cache workflow (#7567)
I somehow added an older, broken version of the cache-master workflow during
the recent workflow update. This should fix the architecture bug preventing
the Mac cache from working properly, as well as increasing the max cache size
from 500 MiB to 750 MiB.
2026-07-06 14:59:41 -04:00
The Force ecddd783f9 3 Clang Fixes 2026-07-06 19:43:20 +01:00
The Force 703bf7ac4f Merge pull request #8 from notimaginative/qtfred_at_night
fix PR checks and add QtFRED to nightly builds
2026-07-06 18:56:27 +01:00
Goober5000andClaude Fable 5 a733748615 fix geometry_batcher copy semantics and add move operations
clone() allocated fresh vert/radius_list buffers without freeing the
ones already owned, so assigning over a live batcher leaked both.  It
also never copied buffer_offset, and the copy constructor called it
with no member initialization at all -- so every copy-constructed
batcher carried an uninitialized buffer_offset.  Free the existing
buffers in clone(), copy buffer_offset, and delegate the copy
constructor to the default constructor so clone() sees initialized
members (which is also what makes its new frees safe on that path).

Also add noexcept move operations, which the user-declared copy
operations had suppressed, so by-value handling can transfer the
buffers instead of deep-copying them.

None of these defects were reachable from current callers (the static
batch maps mutate entries in place); this closes the latent hazards.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-06 13:33:49 -04:00
Goober5000 3e7e707b07 store special_message in a unique_ptr, which also makes the training_message_queue struct safe for moves 2026-07-06 13:33:49 -04:00
Goober5000 5749f1294e remove CombinedVariable code, which was never finished and is not called anywhere 2026-07-06 13:33:49 -04:00
Goober5000andClaude Fable 5 f90a0b3c70 fix four more shallow-ownership hazards in by-value types
A sweep for the w_bank pattern (raw owning handles in types that are
copied, moved, or shifted by value) found four more instances:

p_object: the destructor frees dock_list, which suppresses the implicit
move operations, so Parse_objects growth copied elements -- safe only
because dock lists happen to be built after parsing finishes.  Wrap
dock_list in the new util::reset_on_move<> (a handle whose move resets
the source) and explicitly default the rule of five (with a user-defined
move assignment that frees any existing dock list before the memberwise
transfer), so moves now transfer the dock list.

DecalDefinition: the defaulted moves copied the bitmap handles without
resetting the source, so destroying a moved-from element would
bm_release live handles -- safe only because DecalDefinitions grows
before loadBitmaps runs.  Wrap the handles in reset_on_move<int, -1>.

cmission: FRED's remove_mission overwrote the removed slot's five
vm_strdup'd strings without freeing them (a leak on every removal) and
left the vacated slot aliasing the surviving copy (a double-free if the
slot is later reused without reassigning every string).  Factor the
string cleanup out of mission_campaign_clear into
mission_campaign_free_mission_strings and call it before the overwrite,
nulling the vacated slot afterward.

Undo_stack: the destructor deletes the tracked items, but the implicit
shallow copy was used to transfer stacks into the undo system, kept safe
only by an immediately-following untrack() call.  Delete the copy
operations, default the move constructor and implement move assignment
as clear-then-exchange, so an assigned-over stack deletes its own items
first and the source is guaranteed empty.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-06 13:33:49 -04:00
Goober5000andClaude Fable 5 9bf5b6acf4 harden move operations in w_bank and LuaThread
w_bank: add a move constructor.  object_copy_including_array_member
returns by value, and without a move constructor the return fell back
to the shallow copy constructor whenever NRVO was not applied (e.g.
MSVC debug builds), after which the local's destructor deleted the
freshly allocated arrays -- leaving the stored bank dangling and
double-deleting at model unload.  Also add noexcept to the move
operations, replace the destructor call in move-assignment with
explicit delete[]s (using an object after its lifetime has ended is
undefined behavior), guard against self-move, and document that the
defaulted copy constructor is intentionally shallow for
object_copy_including_array_member's copy-then-replace pattern.

LuaThread: declare the defaulted move operations noexcept.  This
exposed that LuaTable was not movable at all (its user-declared
destructor suppressed the implicit moves), so LuaThread's implicit
move spec was formally throwing -- a hard error on gcc 9, which
still requires the spec on a defaulted redeclaration to match the
implicit one.  Restore LuaTable's rule of five and declare the
LuaValue and LuaFunction copy operations noexcept (they only copy a
shared_ptr, a raw pointer, and an enum), making the noexcept claims
hold throughout the hierarchy.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-06 13:33:49 -04:00
Taylor Richards ffd6a0ac7f address standard c++ lib issues
Disable static libstdc++/libc++ by default now that we've moved to using a
base of Ubuntu 22.04. Using a static c++ library also poses a possible issue
with our prebuilt Qt6 libs since they are dynamically linked.

Disable automatic use of libc++ when static c++ library is enabled. The
options can and should be used independently.

Disable using libc++ for clang by default since it conflicts with the prebuilt
Qt6 libs as well as the system Qt6 libs on most Linux distros. An message has
been added to QtFRED config to error/warn if this is likely to be a problem.
2026-07-06 10:54:11 -04:00
Goober5000 ae4c3495e0 Merge pull request #7520 from Goober5000/fix/std_exchange
use std::exchange in move ctors/assignment operators
2026-07-06 03:11:12 -04:00
Goober5000andClaude Opus 4.6 285e971aec Remove redundant m_pos from CJumpNode; add GetRadius() accessor (#7431)
CJumpNode stored a private m_pos field that duplicated the position
already held by its Objects[] entry.  The field was set once during
construction and never updated afterward, so any subsequent movement
(e.g. FRED dragging) would leave m_pos stale while Objects[m_objnum].pos
held the authoritative value.  Every external caller already used
GetSCPObject()->pos instead; GetPosition() had zero call sites.

- Remove the m_pos field and its initialization in both constructors,
  the move constructor, and the move-assignment operator.
- Pass the constructor's position argument directly to obj_create()
  instead of routing through m_pos.
- Repoint GetPosition() at Objects[m_objnum].pos so it always returns
  the live, up-to-date position.
- Add GetRadius() to expose the cached m_radius, and use it in
  jumpnode_get_which_in() instead of the redundant model_get_radius()
  call.

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-06 01:49:10 +02:00
Taylor Richards 8dfc27afbf fix compile error 2026-07-05 17:39:33 -04:00
Taylor Richards ceb6cd89ef fix lib fallback 2026-07-05 16:42:36 -04:00
Taylor Richards 7186c4d415 set QtFRED option before toolchain is included 2026-07-05 15:34:02 -04:00
The Force cd8ab9f8f0 Clang Fix 2026-07-05 20:29:06 +01:00
Taylor Richards 5d4577acae add prebuilt fallback if system Qt not available 2026-07-05 14:46:14 -04:00
Taylor Richards 192b4ebe55 bump prebuilt version 2026-07-05 14:23:42 -04:00
Taylor Richards acba81535d fix prebuilt issue when used outside of /lib 2026-07-05 14:23:42 -04:00
Taylor Richards e458420612 use prebuilt Qt libs for CI 2026-07-05 14:23:42 -04:00
Taylor Richards 99b7368863 update prebuilt ref to Qt6 version 2026-07-05 14:23:42 -04:00
Taylor Richards 9b00a851ae enable QtFRED by default
Note that Win32 is not supported by Qt6 and so QtFRED is forcibly disabled
on 32-bit Windows.
2026-07-05 14:23:42 -04:00
The Force bb81f70d43 One more depreciation 2026-07-05 18:01:33 +01:00
The Force 69b4a7c273 Fix more deprecations that somehow managed to slip by. 2026-07-05 18:01:32 +01:00
The Force 00ae863a2a Reapply #7450 2026-07-05 18:01:31 +01:00
Taylor Richards 44bd129f14 remove broken imported config mapping 2026-07-05 18:01:30 +01:00
Taylor Richards 2e41035cf3 stop installation of runtime libs (KNet does it) 2026-07-05 18:01:28 +01:00
Taylor Richards 2e04b76bf5 fix cmake policy warning 2026-07-05 18:01:27 +01:00
Taylor Richards 824368656b stop install of things we don't need 2026-07-05 18:01:26 +01:00
Taylor Richards 9892726042 remove AppImage hack for broken Wayland in Qt5 2026-07-05 18:01:25 +01:00
Taylor Richards aabad874a8 add custom fonts for Linux and fix platform check 2026-07-05 18:01:23 +01:00
Taylor Richards 47939dda88 switch to universal deployment setup
Use Qt deployment cmake script for all platforms. This uses the platform
specific method where possible (windeployqt/macdeployqt) and a generic
deployment script on other platforms.

This also uses a crazy RPATH hack on Linux, which is necessary for it to
find the prebuilt Qt libs and deploy them. Qt does not appear to allow
passing tool options for the generic deployment script so we can't tell
the relavent cmake functions where to look for our libraries even though
they support such functionality.
2026-07-05 18:01:22 +01:00
Taylor Richards 6b7c4bd5dc add warning to not distribute builds using system Qt install 2026-07-05 18:01:21 +01:00
Taylor Richards 18efd09123 Mjn's help cache fix 2026-07-05 18:01:20 +01:00
Taylor Richards 221926346b fix binary identification in AppImage script
With the new QtFRED help changes it gets the filename wrong, including the
names of multiple files by mistake. This tweaks the find command to ignore
those other files.
2026-07-05 18:01:18 +01:00
Taylor Richards 8c1c2d3822 add Mac app bundle info for qtFRED 2026-07-05 18:01:17 +01:00
Taylor Richards bfc8d65c59 place help files in proper location on Mac 2026-07-05 18:01:16 +01:00
Taylor Richards aa45bd8e07 fix finding of qhelpgenerator on Mac/Linux 2026-07-05 18:01:15 +01:00
Taylor Richards f6c4b908d9 fix executable type for Windows/Mac 2026-07-05 18:01:13 +01:00
Taylor Richards 9e3da3bd63 add support for precompiled Qt libs 2026-07-05 18:01:12 +01:00
Taylor Richards 00335726a3 bump macOS deployment target to 10.15 2026-07-05 18:01:11 +01:00
The Force ed090fa858 Try and disable console on non dev machines 2026-07-05 18:01:10 +01:00
The Force 1ce15a6b45 supress dpi context warning 2026-07-05 18:01:09 +01:00
The Force 61b9546dff Try to fix briefing editor 2026-07-05 18:01:07 +01:00
Mike Nelson 28f0231629 fix qtfred help 2026-07-05 18:01:06 +01:00
The Force 4ef290957b Build qthelp for QT6 2026-07-05 18:01:05 +01:00
The Force 9e88c3bf02 Not entirely Sure why but VS studio debug needs this to run 2026-07-05 18:01:03 +01:00
The Force 405d1290e5 Qt6 Changes 2026-07-05 18:01:02 +01:00
The Force 5aab5a1cf9 Fix Merge Error 2026-07-05 18:01:01 +01:00
The Force f6fcbf9745 Fix Several Crashes on close
Move shutdown to run before Qt destroys the opengl context

disconnect visibility changes as it accidently runs after windows destruction due to QT weirdness
2026-07-05 18:00:59 +01:00
The Force 236ad7547e Fix more illegal Chars 2026-07-05 18:00:58 +01:00
The Force 8f762038a7 Build Fix and remove illegal chars 2026-07-05 18:00:56 +01:00
The Force 8976616ba4 Fix Deprecations 2026-07-05 18:00:55 +01:00
The Force 17c676ec28 Add back in RCC 2026-07-05 18:00:54 +01:00
The Force 9414f36a01 Fix Main Window For DPI Scaling 2026-07-05 18:00:52 +01:00
The Force 875a57097d Enable Qt6 2026-07-05 18:00:46 +01:00
Fabian Woltermann 7122489c59 Merge pull request #7563 from Baezon/kamikaze-no-collision-avoidance
No collision avoidance for kamikaze fighters
2026-07-05 18:51:17 +02:00
Fabian Woltermann da1b045ad2 Merge pull request #7472 from MjnMixael/qtfred-fix-image-picker-dds
QtFRED support dds files in the image picker
2026-07-05 18:45:28 +02:00
Fabian Woltermann 2cb9227012 Merge pull request #7564 from The-E/fix/ai-manage-bay-doors-stale-parent
Fix crash in ai_manage_bay_doors from stale destroyed parent ship
2026-07-05 13:43:50 +02:00
the-eandClaude Sonnet 5 90f29236c1 Fix crash in ai_manage_bay_doors from stale destroyed parent ship
If the carrier a fighter launched from was destroyed earlier in the
mission, its Ships[] entry retains stale bay door state while its
object and model instance are already freed (objnum/model_instance_num
== -1). When the fighter later departs, ai_manage_bay_doors would still
try to animate the dead carrier's bay doors, calling
model_get_instance(-1) and asserting/crashing.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-07-05 12:08:48 +02:00
Taylor Richards 7e6b8594e7 clean, fix, and update workflows (#7562)
* clean, fix, and update workflows

Add support for Windows ARM64 builds.

Try to rely on build defaults for various options so that workflow
modifications aren't required for basic feature changes.

Remove Vulkan and Qt setup from workflow, instead relying on new
prebuilt libs.

Update SFTP image and Linux build image to newer release.

Add ccache setup for macOS.

Update ccache action to a version compatible with Node v24.
2026-07-04 22:36:32 -04:00
Shivansps 30955e88b4 Support Android TTS (#7497)
* add tts support

* correct type

* more robust method binding and hide volume option

* missing ifndef

* thread safe jnienv

* check jni env before use it

* remove opt in volume option and cleanup

* cleanup
2026-07-05 04:15:32 +02:00
BMagnu ca5a8f54ab Add flag to limit particles during animation to a direction (#7511) 2026-07-05 04:14:49 +02:00
BMagnu 7da707de7f Add particles on death of particles (#7504) 2026-07-05 04:14:41 +02:00
Goober5000 598c5c71a3 clean up ship status after mission (#7523)
Create a `ship_level_close()` function and call it from `game_level_close()`.  Among other tasks, this clears out any PRESENT or DEATH_ROLL statuses to prevent SEXPs or scripts from obtaining references to ships that have been deleted.

Follow-up to #7522.
2026-07-05 04:13:06 +02:00
Asteroth 90d04903fe no collision avoidance for kamikaze 2026-07-04 22:04:26 -04:00
BMagnu 25eebd96de Shadow Overhaul (#7529)
* Extract shadows into own shader and render pass

# Conflicts:
#	code/def_files/data/effects/main-g.sdr

* Consolidate render queue code

* More cleanup

* Fix missing clear of shadow buffer inter frame

* Request capability for viewport layer rendering

* instanced shadows

* Fix issues

* Switch to PCF+PCSS and proper textures for it

* Smooth PCSS toggle

* Fix for windows

* Fix OGL error

* Cleanup of old flag

* Expose shadow smoothness

* Fix missing uniform

* Make number of shadow cascades dynamic

* Progress on cockpit shadow integration

* Wrangle Cockpit and show-ship shadows into correct behaviour

* Cleanup

* make player ship shadow table options more intuitive

* Cleanup

* Only read from correct set of shadow maps, also stretch first main-scene map to 0

* Remove now non-necessary validation

* Make shadow cascade buffer more typesafe and less wasteful

* Don't allocate cockpit cascades if not used

* Cleanup

* Final fixes

* Fix Warnings

* clang tidy

* Fix missing fallback for shader precaching

* That weird FOV multiplier that always ruins your day

* Avoid shadow geometry artifacts by using hardware depth clamping

* Correctly handle shadow cascade overrides with hardcoded length

* GCC9 and its sad state of C++17 support.

* Address Feedback

# Conflicts:
#	code/graphics/shadows.cpp
2026-07-04 16:08:41 +02:00
BMagnu cc63bfa7c1 Gamma by Shader (#7484)
* Replace SDL gamma with a blit shader gamma

* Window_res comment

* Fixes

* Gamma command line flag
2026-07-04 15:28:52 +02:00
Goober5000 8b80541046 Merge pull request #7560 from Goober5000/version_26_1
bump version to 26.1
2026-07-03 23:04:34 -04:00
Goober5000 fd5c6fe4ed bump version to 26.1 2026-07-03 22:38:41 -04:00
Mike Nelson 4d8538e5cc Qtfred sexp tree refactor (#7301)
* long project will be long

* add shared foundation files

* unify some shared types across both editors

* sexptreemodel framework

* move opf functions to the model

* move shared functions into the model

* move variable/container stuff to the model

* sexptreeactions and ui interface

* wire the model into the ui

* move some shared logic to the model

* move more methods to the model

* move clipboard to model

* create new right click menu model

* begin connecting the new right click menu

* wire up the new right click menu in fred

* wire up the new right click menu in qtfred

* move help text and visuals to model

* move menu option enable disable to model

* wire up sexp_tree to the model

* rename sexp_tree files to sexp_tree_ui

* fix build errors

* fix warning

* remove all opf forwarders

* remove some forwarder methods

* connect qtfred events editor directly to model

* wite plan for unifying tree types

* replace legacy m_mode with treeflags

* fix qtfred campaign dialog

* fix qtfred ship/wing dialog trees

* build error

* documentation

* more documentation

* even more documentation

* move more opf functions to opf file

* clean up context menu function

* move default argument to opf file

* build errors

* fix qtfred dialogs and annoations

* new shared annotations model

* sexp_tree_ui to sexp_tree_view

* documentation pass

* document annotations model

* delete the plan

* move event annotations to the new model

* generic cleanup

* remove some old defines

* cleanup includes

* more cleanup

* parenthesis

* more parenthesis

* variable collisions

* too many parenthesis this time

* clang modernization

* variable names again

* more clang and assertions

* static cast

* clang again

* fix some bugs and issues

* Refactor sexp tree action duplication into SexpTreeActions

* fix a few more minor issues

* avoid clang false positive

* rebase tweaks

* fix annotations issue

* fix typo and two small bugs claude found

* fix event editor tree widget loading

* fix ship and wing sexp tree editors in qtfred

* fix qtfred briefing and debriefing trees

* fix a regression Claude found

* address feedback

* fix annotations for root items in qtfred by copying fred's method

* address feedback

* rescope variables

* clang
2026-07-04 02:12:34 +02:00
Goober5000andClaude Fable 5 82750105c7 make brief_stage non-copyable and non-movable; provide swap() and reset()
brief_stage owns its icons and lines buffers through raw pointers, so the
implicitly generated copy/move operations silently alias those buffers
across two stages.  Delete them and provide a custom swap() that
exchanges members (keeping each slot with a distinct buffer), plus a
reset() that restores the default-constructed state.

Update brief_compact_stages, the only code that assigned brief_stage
objects: shift stages down by swapping (equivalent, since the removed
stage buffers were already freed and the tail is cleared afterward) and
clear the tail entries with reset().

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-02 16:23:26 -04:00
Goober5000andClaude Opus 4.8 09c19f7094 use std::exchange in move ctors/assignment operators
Replaces the copy-then-reset idiom with std::exchange in five
steal-and-reset move constructors and assignment operators.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-20 20:54:52 -04:00
Goober5000 d15cadc47b Merge pull request #7537 from Goober5000/fix/defensive_unicode
more graceful degradation of invalid unicode
2026-06-20 20:50:27 -04:00
BMagnu 21b8035e63 Fix possibly negative pspew value init (#7541)
* Fix possibly negative pspew value init

* fix math
2026-06-21 01:59:20 +02:00
Goober5000andClaude Opus 4.8 fd2ebaf941 allow -1 sound index in OPF_GAME_SND syntax check (#7540)
The numeric branch of the OPF_GAME_SND check in check_sexp_syntax never
actually ran until the type2 variable-overload bug was fixed, so missions
using a sound index of -1 ("no sound" / "default") loaded fine.  Now that
the check is live, explicitly allow -1, which the runtime already treats as
an invalid (unset) sound.  Also return the more descriptive
SEXP_CHECK_INVALID_GAME_SND / SEXP_CHECK_INVALID_FIREBALL error codes, and
let nested-operator (SEXP_ATOM_LIST) arguments fall through since their type
is already validated upstream.

Also route the Lua SEXP soundentry argument through sexp_get_sound_index so
it accepts a table index, an operator, or a name like the core SEXPs do,
instead of only a name.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-21 01:59:08 +02:00
Goober5000 43b4724240 more graceful degradation of invalid unicode
If invalid UTF-8 is encountered, return the standard Unicode replacement character 0xFFFD.  When incrementing or decrementing, make a best effort to follow the code's instructions.  It might produce one or more � characters, but that's better than an Error and a hard crash.

Also move character constants to standardized locations.
2026-06-20 16:22:21 -04:00
Taylor Richards d5093cf799 Node v24 workflow update (#7536)
* update workflows for Node v24 support

* fix safe-directory issue
2026-06-18 21:40:20 +02:00
Goober5000 e71e9494d8 "change atan2_safe to atan2" followup (#7531)
Follow-up to #6255.  Partially restore use of `atan2_safe` from 87ea04fa53: keep special case while delegating most cases to atan2.

Fixes #7530.
2026-06-18 10:34:16 +09:00
BMagnu b65a92f358 Fix misbehaviour of Volume Point Towards (#7535) 2026-06-18 10:33:22 +09:00
BMagnu 7afbed8a3b Fix shadow artifacts by employing hardware clamping (#7532) 2026-06-18 00:46:33 +02:00
Goober5000 a7a2b9c9b1 Merge pull request #7518 from Goober5000/cleanpup/waypoint_move
remove empty destructors so waypoints can be moved
2026-06-15 23:43:06 -04:00
Goober5000andClaude Opus 4.8 1c079a79c1 Fix FRED play/media button transparency and disabled state (#7524)
CButton::SetBitmap blits a bitmap verbatim and does not perform the
magic-color substitution MFC applies when loading toolbar bitmaps. So a
button bitmap's background -- the legacy C0C0C0 gray baked into play.bmp
et al., or a magenta transparency key -- was drawn literally, reading as
a dark/colored rectangle instead of matching the real button face
(~F0F0F0 on modern Windows), and a disabled bitmap button embossed its
whole opaque rectangle into a solid gray square.

Add load_button_icon() to management.{cpp,h}, which builds an icon from
a button bitmap by keying out a background color into a transparency
mask. Driven through BS_ICON/SetIcon, the OS blends it with the button
face and grays it correctly when disabled. Route every play/media button
through it (event editor, briefing, debriefing, command brief, music
player, sound environment). Also add load_btnface_mapped() -- a
toolbar-style color remap -- kept as a lighter alternative for
always-enabled buttons.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-15 22:33:37 -04:00
Goober5000andClaude Fable 5 9be8c62f82 add move semantics for message media references (#7517)
MMessage's avi_info/wave_info unions hold strdup'd filenames in FRED
(indices in the game), but moves copied the pointers without nulling
the source, so every vector shift on Messages left moved-from elements
aliasing live allocations -- one careless edit away from a double-free.

Wrap each union in a MessageMediaRef struct whose moves null the source
and whose copies stay shallow (the event editor's backup pattern copies
then re-strdups).  MMessage keeps its implicit copy and gains a correct
implicit move; access syntax at all use sites is unchanged.

Add a message_free_media_names() helper and use it at the FRED
delete/wipe sites.  Two fixes ride along: messages_init() now frees
mission messages' media names before discarding them, closing a leak
that fired on every mission load in FRED; and the message editor's
OnDelete now uses the move-based array_remove_slot instead of a
copy-shift that left a stale aliasing tail.

No destructor: the active union member depends on Fred_running, and
shallow copies alias, so freeing remains explicit.

Co-authored-by: Claude Fable 5 <[email protected]>
2026-06-15 22:33:30 -04:00
wookieejedi 43387caf4a Fix flickering turrets in techroom (#7527)
Turrets with initial animations flip animation angles every frame in the techroom.  The commit returns TriStateBool from model_get_cached_ui_render_instance specifically so callers can run setup only when a new instance is created, but only `render_tech_model` (the Lua path) actually checks it.

Since the instance is cached and persists across frames, every frame re-runs clearShipData + initial-animation start on an already-animated instance, re-applying the initial animations relative to the current (already-animated) pose. This is what seems to produces the per-frame flip/jitter.

This PR caches it to prevent this, and fixes #7526. Tests confirm it works as expected.
2026-06-15 07:30:07 -04:00
wookieejedi 3e41e5ba2d Fix center reticle firepoints swaying (#7525)
Center reticle does not move if player is looking around, but there is a bug where the drawn firepoints of the center reticle do impromperly sway when the player is looking around. This is b/c the live global Eye_matrix, which has the free-look rotation baked into it by `object_get_eye()` then `compute_slew_matrix(eye_orient, &Viewer_slew_angles)`

Thus, do note use `Eye_matrix` b/c firepoints will sway if looking around, instead just use 'object_get_eye' with the properly set values.

Tested and fire-points work as normal but also fix the issue when looking around in free-look or TrackIR.
2026-06-15 07:29:51 -04:00
Goober5000 741693aa84 Merge pull request #7522 from Goober5000/fix/modelinstance_teardown
more robust handling of modelinstance teardown
2026-06-13 01:42:40 -04:00
Goober5000 ee50cde0e1 more robust handling of modelinstance teardown
Set model instances to -1 when objects are deleted, and guard against null model instances in `modelinstance_replace_active_texture`.  This may fix a crash in Event Horizon.
2026-06-12 22:39:50 -04:00
Goober5000andClaude Opus 4.7 e4c7c730cc null out editor-dialog globals on DestroyWindow (#7512)
Several dialogs already null their global at the top of DestroyWindow, but a few do not: briefing, debriefing, event, background, message, cutscene, goal, and Fred_view_wnd.  OnClose nulls in those five cover the user-initiated close path, but any teardown that bypasses OnClose leaves a dangling pointer that could be dereferenced.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
2026-06-12 07:45:21 -04:00
Goober5000andClaude Fable 5 9f27adc31d remove empty destructors so waypoints can be moved
A user-declared destructor, even an empty one, suppresses the implicit
move operations, so waypoint and waypoint_list were silently copy-only:
every Waypoint_lists erase, insert, and reallocation deep-copied entire
lists, and inserting a waypoint mid-path copied every shifted waypoint.
Removing the destructors restores the implicit moves (correct and
noexcept, since the members are vec3d/int and SCP_vector/SCP_string),
turning those shifts into pointer steals.  The implicit deep copies
remain available and unchanged.  Waypoint identity is index-encoded in
Objects[].instance and renumbered on insert/erase, so relocation
semantics are unaffected.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-12 04:05:57 -04:00
Goober5000 5c110b5a87 Merge pull request #7516 from Goober5000/fix/6529
fix copy-paste error
2026-06-12 02:14:30 -04:00
Goober5000 0b7ded2407 fix copy-paste error
Due to a copy-paste error, the event editor would always be marked modified.  Fix the comparison.

This bug originally appeared in QtFRED also, but no longer does.

Follow-up to #6529.
2026-06-12 01:43:41 -04:00
wookieejedi 0076cdb74d Fix 'ignore if dead' flag (#7509)
* Fix 'ignore if dead' flag

Fixes #7508.

The subsystem flag "ignore if dead" that many mods use is supposed to "prevent homing weapons from attempting to hit the now destroyed submodel and instead tells them to home on the main hull of the target."

Though, in actuality, the code makes the weapon dumb fire instead of home. This bug means if you destroy a subsystem with this flag, then lock onto it with an aspect weapon and fire the weapon, the weapon will just dumb fire.

With `wp->homing_subsys` cleared as this PR does, the homing code at `weapons.cpp`:5730 falls into its else branch and picks an attack point on the ship body (`ai_big_pick_attack_point / hobjp->pos`) — which is what the flag promises. Javelins, which can only home on engines, will still correctly try to re-acquire another engine in the block just below and drop lock if there's none.

This fix is tested and now the flag works as expected.

* fix for javelins
2026-06-09 12:15:29 -04:00
Goober5000 d4c21eca0a Merge pull request #7514 from Goober5000/fix/7513
invalidate UI render instance cache when freeing model instances
2026-06-08 22:51:56 -04:00
Goober5000andClaude Opus 4.7 96d1988a54 invalidate UI render instance cache when freeing model instances
Fixes a startup assertion failure in Star Fox: Event Horizon, where a Lua
call to gr.freeAllModels() wiped Polygon_model_instances but left the UI
render instance cache holding stale indices. The next state transition
called model_clear_cached_ui_render_instances() which asserted in
model_delete_instance().

Closes #7513

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-06-08 22:02:45 -04:00
Goober5000 60203b6bae std::move in a few more places (#7502)
Follow-up to #7308.
2026-06-05 11:36:50 +02:00
Goober5000andClaude Opus 4.7 f184997572 fix ship select roster scroll-up getting stuck after list shrinks (#7501)
After a drag-drop that consumed the last unit of a roster class, the
active list could shrink while SS_active_list_start was non-zero,
making items above the stuck offset (including default ships returned
to the pool, such as Seth fighters) unreachable: the up-arrow handler
short-circuits when size <= max_show without resetting the offset.

- Clamp the preserved scroll offset in ss_synch_interface() against
  SS_active_list_size - MAX_ICONS_ON_SCREEN.
- Harden common_scroll_down_pressed() to reset *start to 0 when the
  whole list fits on screen.

Fixes #6240

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
2026-06-05 11:36:29 +02:00
Mike NelsonandJohn Fernandez 880bfb11a7 Upgrade lua enumeration handling (#7423)
* upgrade lua enumeration handling

* some cleanup

* add lua enum descriptions

* minor fixes

* Update code/scripting/api/objs/enums.cpp

Co-authored-by: John Fernandez <[email protected]>

* include name

---------

Co-authored-by: John Fernandez <[email protected]>
2026-06-05 11:33:42 +02:00
Mike Nelson f4d84ec47a Support Rearm Pool, Limits, and Other Features (#7249)
* framework for support ship rearm pool and flags

* scripting api

* FRED support

* QtFRED support

* do not save non-player-allowed weapons

* tvt and mission versioning

* fix variable name

* minor fixes and clarity

* oops

* add qtfred help docs

* fixes and cleanup

* clang and readability

* address feedback

* address feedback
2026-06-05 11:33:19 +02:00
Mike Nelson 31f77e5a32 Mines weapon type & weapon proximity triggers (#7461)
* new mine weapon type

* some fixes and cleanup

* fix some parsing issues

* make sure mines get plotted

* make mine spawned objects can get a correct target

* some cleanup and additional features

* chasing mines

* some Lua tweaks

* generalize proximity detonations

* minor tweaks

* collapse namespace

* address feedback
2026-06-05 14:06:00 +09:00
Mike Nelson d17bb56d3c Qtfred ship texture replace refactor (#7441)
* ship texture replacement stylization pass

* refactor UI to be dynamic

* properly save textures and load them on apply

* clang

* address feedback

* clang
2026-06-05 14:05:22 +09:00
Goober5000 1dd48f7c84 Merge pull request #7498 from Goober5000/fix/ets_crash
set ETS indexes despite power level
2026-06-04 08:53:25 -04:00
Mike Nelson 03ea836f86 Qtfred autosave system (#7463)
* remove legacy undo system from QtFRED

* implement timed autosave feature

* clang

* undo comments change
2026-06-04 13:35:13 +02:00
Goober5000andClaude Opus 4.6 1240d2eb11 add orbit camera support to FRED2 and qtFRED (#7310)
Implement a spherical-coordinate orbit camera for both the MFC (FRED2)
and Qt (qtFRED) editors, providing intuitive 3D viewport navigation
similar to other 3D editing tools.

Controls:
- Middle mouse drag: orbit rotate around pivot point
- Shift + middle mouse drag: pan the pivot point
- Right mouse drag: orbit rotate (alternative to middle mouse)
- Shift + right mouse drag: pan (alternative to shift + middle mouse)
- Mouse wheel: zoom in/out
- Right click without drag: context menu (preserving existing feature)

Camera pivot selection:
- If an object is selected, orbit around that object
- Otherwise, intersect the camera forward ray with the current grid
  plane to find a natural pivot point
- Falls back to grid center if the camera is parallel to the grid

Grid-plane awareness:
- Orbit axes are derived from The_grid->gmatrix using vm_vec_rotate
  and vm_vec_unrotate, so the camera orbits correctly on all three
  grid planes (XZ, XY, YZ), not just the default XZ plane
- The look-at matrix uses the grid's up vector (uvec) rather than a
  hardcoded world-up direction

Robust zoom/pan scaling:
- Zoom uses an exponential formula (powf) so the distance multiplier
  is always positive regardless of physics_speed setting (1-500)
- Pan uses a clamped speed factor to avoid excessive movement at high
  physics_speed values

State management:
- Keyboard camera movement (process_controls) invalidates orbit state,
  so the next mouse drag re-initializes from the current view
- Orbit state is per-viewport in qtFRED (EditorViewport members) and
  global in FRED2 (matching existing conventions in each codebase)

Implementation:
- FRED2: orbit math in fredrender.cpp, mouse handlers in fredview.cpp
- qtFRED: orbit math in EditorViewport.cpp, mouse/wheel handlers in
  renderwidget.cpp; RenderWindow::event() updated to forward middle
  button and wheel events to RenderWidget

Also fix an AND vs OR bug in FRED's process_controls().

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-04 13:34:44 +02:00
Goober5000 2a998f182f set ETS indexes despite power level
Fixes a crash of the player ship has a power level of 0.
2026-06-03 23:12:46 -04:00
Goober5000 343bc173bb Merge pull request #7496 from Goober5000/fix/7206
fix CTD when LuaSEXP evaluates a subsystem on an absent ship
2026-06-03 21:29:23 -04:00
Goober5000andClaude Opus 4.7 876a1d36e9 fix CTD when LuaSEXP evaluates a subsystem on an absent ship
The OPF_SUBSYSTEM argument-conversion path in LuaSEXP only verified
has_shipp() before calling ship_entry->objp().  A ship registry entry
retains its shipnum after the ship is destroyed or departed, but its
objnum is reset to -1, so objp() either asserts (debug) or dereferences
Objects[-1] (release) when the entry is looked up by Lua scripting
during, for example, an OnMissionAboutToEnd hook.

Tighten the check to has_objp() so absent ships short-circuit to an
empty handle, and correct the early-return type from l_Ship to
l_Subsystem.  Apply the matching type correction to OPF_DOCKER_POINT,
which has the same return-type mismatch but no CTD because it never
dereferences objp().

Fixes #7206.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-06-03 16:40:59 -04:00
Goober5000 8a174c5ea4 Merge pull request #7462 from Goober5000/fix/mongoose_crash
Fix crash when restarting mongoose server on Windows
2026-06-03 11:53:04 -04:00
Goober5000 7145b3cb7e Harden Lua matrix and ParticleEffectAction against non-orthonormal inputs (#7490)
Two related fixes flagged by an audit of vm_vector_2_matrix_norm callers:

ParticleEffectAction: locals.direction defaulted to vmd_zero_vector,
which would trip vm_vector_2_matrix_norm's unit-length assertion (and
divide by zero in release) when an action program emitted a particle
effect without first running a Set Direction action.  Default to
vmd_z_vector so the unset-direction path always feeds a unit vector.

matrix_h / Lua orientation type: the element indexer (m[1..9] = x)
wrote arbitrary floats straight into mtx.a1d[idx] and the resulting
non-orthonormal matrix could flow into obj->orient via the Orientation
virt-vars on object/modelinstance/subsystem, breaking downstream engine
code that assumes the basis vectors are unit length.  getInterpolated
had the same problem by design (pure linear interp, no normalization).

Adds a fourth MatrixState, NeedsOrthonormalize, which the indexer
setter and getInterpolated use to flag their output.  ValidateMatrix
and ValidateAngles now call vm_orthogonalize_matrix when they observe
that state, so any consumer that reads through GetMatrix/GetAngles
gets a valid orientation without each call site needing its own guard.

getInterpolated is also marked ADE_FUNC_DEPRECATED at FSO 26.0 in
favor of rotationalInterpolate; mods targeting older versions keep
the legacy linear blend (now safely orthonormalized on use).
2026-06-03 16:52:30 +02:00
BMagnu 4246b761e7 FIx shadow banding on cockpits (#7495) 2026-06-03 11:06:21 +09:00
Mike Nelson 05534f709e Qtfred & FRED fix object cloning (#7460)
* fix ship duplication

* prop and jump node duplication

* make sure objects on layers are properly registered

* waypoint duplication

* some cleanup

* address feedback

* assertion for clang
2026-06-02 17:30:38 -04:00
Mike Nelson 970912f76e shield system dialog ux clarity (#7473) 2026-06-02 17:30:11 -04:00
Goober5000 96a60eb0bc Merge pull request #7492 from Goober5000/fix/fred_ship_registry
fix ship registry updating in FRED
2026-06-02 11:12:10 -04:00
Goober5000 8114a4c9bd Merge pull request #7493 from Goober5000/fix/supernova_clip
clip the supernova whiteout to the letterbox
2026-06-02 11:11:59 -04:00
BMagnu 0856b8211e Fix Shadow "Halo" (#7494)
* Attempt at removing the 'shadow-halo'

* Tidy up and rename old variable

* Tune bias for cockpits
2026-06-02 16:09:09 +02:00
Goober5000andClaude Opus 4.7 49d6f7a528 extract dead-view letterbox helpers
Per @BMagnu's review feedback on #7493: factor the yborder calculation
and clip-rect application into two file-local helpers so future changes
to the letterbox proportions live in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-06-02 02:27:21 -04:00
Goober5000andClaude Opus 4.7 31eb87becf clip the supernova whiteout to the letterbox
game_render_hud calls gr_reset_clip() before game_flash_diminish, so the
sunspot palette flash was painting over the black bars during the
supernova camera cut. Re-apply the letterbox clip around gr_flash when
it would otherwise overdraw the bars (supernova HIT+ or GM_DEAD),
matching the condition already used in game_set_view_clip.

Partial fix for #4152.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-06-02 01:56:06 -04:00
Goober5000 781bf0d7f2 fix ship registry updating in FRED
When a ship is renamed in FRED/QtFRED, its ship registry information should be updated.
2026-06-01 23:55:20 -04:00
Goober5000 d52ba4e5b7 Merge pull request #7491 from Goober5000/fix/freezespace
Move SDL joystick scanning off the main thread
2026-06-01 21:45:47 -04:00
Mike Nelson 434d4fb968 fix arrival distance checks in qtfred (#7470) 2026-06-01 09:02:47 -04:00
Mike Nelson e38bab2e4a add qtfred themes for checked push buttons (#7471) 2026-06-01 09:02:25 -04:00
Goober5000 870e567fe4 Move SDL joystick scanning off the main thread
Setting SDL_HINT_JOYSTICK_THREAD=1 before SDL_InitSubSystem(SDL_INIT_JOYSTICK)
tells SDL2 to run joystick polling and HID device-detection on a dedicated
background thread, rather than processing them inline inside SDL_PollEvent
on the main thread.

Without this hint, every WM_DEVICECHANGE broadcast (which Windows sends when
*any* HID device wakes, sleeps, or pulses the USB bus) causes SDL to walk
every HID device class via SetupAPI / cfgmgr32 from inside SDL_PollEvent,
stalling the frame loop for multiple seconds on machines with many HID
peripherals - especially wireless Logitech mice and keyboards that
periodically pulse the bus. Diagnosed via ProcMon stack capture on one
affected user's machine, with the slow frame's call chain ending in
SDL2.dll -> SETUPAPI.dll -> cfgmgr32.dll -> kernel registry queries against
HKLM\System\CurrentControlSet\Enum\HID\*.

With the hint enabled, that work happens on SDL's own thread and the main
thread just dequeues already-collected events.
2026-06-01 02:14:08 -04:00
Goober5000 f831251cbd Merge pull request #7321 from scp-fs2open/dependabot/pip/ci/post/requests-2.33.0
Bump requests from 2.32.4 to 2.33.0 in /ci/post
2026-05-31 16:41:49 -04:00
dependabot[bot] 107b6bb35b Bump requests from 2.32.4 to 2.33.0 in /ci/post
Bumps [requests](https://github.com/psf/requests) from 2.32.4 to 2.33.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.4...v2.33.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-05-30 23:55:54 +00:00
Goober5000 cb1cb5641d Merge pull request #7445 from scp-fs2open/dependabot/pip/ci/post/mako-1.3.12
Bump mako from 1.3.11 to 1.3.12 in /ci/post
2026-05-30 19:52:44 -04:00
BMagnu 6b43cabff6 Fix CTD when an interface sound is shared with a gameplay sound (#7488) 2026-05-30 23:45:22 +02:00
Goober5000 14b0edcb95 Merge pull request #7486 from Goober5000/fix/stats_alltime_kills
fix stats sync in multiplayer
2026-05-30 17:28:11 -04:00
Goober5000andClaude Opus 4.7 237516c08c Convert CSG/PLR fixed ship/weapon arrays to SCP_vector
Ship_info is already an SCP_vector but MAX_SHIP_CLASSES (500) is held in
place by fixed-size structures throughout the engine and editors. This
converts the seven file-format-adjacent arrays whose persistence touches
the .csg campaign save and .plr pilot file formats:

  campaign::ships_allowed         [MAX_SHIP_CLASSES] -> SCP_vector<ubyte>
  campaign::weapons_allowed       [MAX_WEAPON_TYPES] -> SCP_vector<ubyte>
  loadout_data::ship_pool         [MAX_SHIP_CLASSES] -> SCP_vector<int>
  loadout_data::weapon_pool       [MAX_WEAPON_TYPES] -> SCP_vector<int>
  scoring_struct::kills           [MAX_SHIP_CLASSES] -> SCP_vector<int>
  scoring_struct::m_kills         [MAX_SHIP_CLASSES] -> SCP_vector<int>
  scoring_struct::m_okKills       [MAX_SHIP_CLASSES] -> SCP_vector<int>

The CSG and PLR file formats already store explicit counts and key by
ship/weapon names, so no on-disk format change is needed. Existing
read/write loops already iterated by ship_info_size() / weapon_info_size()
and just compile through against the new vector types.

Vectors are sized to ship_info_size() / weapon_info_size() in
scoring_struct::init(), mission_campaign_clear(), player_loadout_init(),
and the campaign-pool reset paths in csg.cpp and multi_campaign.cpp.
All of these run after weapon_init() / ship_init(), so the sizing
invariant holds. scoring_struct globals constructed at static-init time
start with empty vectors; first index access is always post-table-parse.

Multiplayer stats sync (multimsgs.cpp) now derives offsets and counts
from the vector size; added USHRT_MAX assertions on the sender side
since the wire protocol packs offset/count as USHORT. The FSTracker
sync (multi_fstracker.cpp) clamps vmt->num_ships down to the local
mod's kills.size() before transmission and guards the receive-side
write so a tracker payload with more ship slots than this mod has won't
overrun the vector.

The MAX_SHIP_CLASSES cap itself stays in place at ship.cpp:2327; this
is one prerequisite toward lifting it. The other ~25 fixed-size
ship-class-indexed structures (team_data, Ss_pool_teams, Wl_ships,
FRED2 editor arrays, qtFRED Editor::_ship_usage, etc.) remain to be
addressed in follow-up PRs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-30 02:21:22 -04:00
Shivansps c3f9ce37e4 Default TTS to be disabled (#7485) 2026-05-30 08:16:55 +02:00
Goober5000 10288c16ad fix stats sync in multiplayer
A quick bugfix, thanks to Claude.  Make sure the end of the loop is correctly offset from the start.
2026-05-29 23:59:47 -04:00
Mike Nelson 2fcf1ba686 Lab camera snapping widget (#7400)
* camera control widget with snapping

* fresh brain, fresh tweaks

* clang
2026-05-30 05:46:43 +02:00
Shivansps 3bd934ee96 Add glClampColor() and GL_DEPTH24_STENCIL8 (#7478) 2026-05-29 09:44:52 +09:00
BMagnuandGoober5000 20c8417e8b Fullneb Revamp (#7352)
* change to new fog system

* Fix fog conversion issues

* remove unused old neb values

* Update scripting API

* temporary old-value round trip

* Rewrite nebula fog with four explicit parameters

Replace the legacy `+Fog Near Mult` / `+Fog Far Mult` model — which
depended on fixed engine constants — with four parameters that map
directly to renderer behavior:

  +Fog 1000m Visibility    fraction of light surviving 1000m of fog
  +Fog Near Distance       meters from camera where fog begins
  +Fog Skybox Clip Distance  max render distance for the skybox in fog
  +Fog Clip Distance       max render distance for the scene in fog

The deferred-lighting fog shader, material system, model renderer,
object sort, and the Lua mission API all consume the new parameters
directly. The legacy `Neb2_fog_near_mult` / `Neb2_fog_far_mult`
globals are removed.

Mission parsing accepts either the legacy keys or the modern keys.
Legacy values are converted to the modern set at parse time, and a
per-mission flag (`Neb2_fog_use_legacy_values`) records which keys to
write back on save. The flag is cleared only when something actually
changes, so opening and OK'ing an unmodified legacy mission preserves
its on-disk format. Saving uses `optional_string_fred` to preserve
user comments through edit cycles.

FRED2 and QtFRED background editors both expose the four parameters
in place of the old multipliers, with friendly labels and tooltips.
Both editors validate input (visibility clamped to [0, 1]; near
distance must be > 0; skybox and scene clip distances may be 0 to
disable fog at that range) and use a snapshot-and-compare at close
time so that a no-op open-then-OK never spuriously rewrites a legacy
mission in the modern format.

FRED2's background dialog is also reorganized so that "Display bg
bitmaps in nebula", "Override nebula fog palette", the RGB row, and
the four fog parameters all sit inside the Nebula group box; the
"Old Nebula" group box is restored below it with its Pattern, Color,
Pitch, Bank, and Heading controls back inside the frame. The dialog
now overrides PreTranslateMessage so that the new fog tooltips —
and the previously broken "Save sun/bitmap angles in correct format"
tooltip — actually fire.

QtFRED's BackgroundEditor.ui adds four QDoubleSpinBox controls in
the existing nebula form layout, with per-field decimals chosen to
avoid scientific notation, and per-field min/max declaring the
validation rules. The QtFRED help page is updated to describe the
new fields.

* fix tooltips

* restore forward-renderer fog

* Clang Tidy

* address feedback

* Refine nebula fog rewrite

- Rename Neb2_fog_use_legacy_values to Neb2_fog_save_legacy_values
  to reflect that the flag governs save format, not runtime
  behavior.
- Decide both the save flag and the legacy-to-modern conversion
  purely from whether the file contains modern fog keys, dropping
  the prior heuristic based on required_fso_version. A mission
  without modern keys (legacy- or retail-format) converts on load
  and saves back in legacy format; missions with modern keys are
  saved as modern.
- Snapshot the four fog values as floats at editor open and use
  fl_equal for the no-change comparison in both FRED2 and QtFRED,
  replacing the FRED2 CString comparison and the QtFRED strict
  inequality.
- Document the on-disk invariant in missionsave: when not saving
  legacy keys, the four modern keys must always be written (never
  gated on "only if non-default"), since the parser uses their
  presence to decide whether to run the conversion on next load.

---------

Co-authored-by: Goober5000 <[email protected]>
2026-05-28 14:43:48 +09:00
Goober5000 74dad95054 Merge pull request #7479 from Goober5000/fix/more_misc_bugs
miscellaneous fixes
2026-05-28 01:42:51 -04:00
BMagnu a715542405 Make beam impacts trigger even without beam flash / pierce effects (#7480) 2026-05-27 09:50:48 -04:00
Goober5000 11a58f4600 miscellaneous fixes
-weapon_spew_stats terminology, cfile fix, trigger count fix
2026-05-26 22:08:04 -04:00
Mike Nelson 3af8fa801d QtFred Render volumetric (#7467)
* render volumetric in qtfred

* warn for bad model files
2026-05-27 10:43:41 +09:00
Goober5000 fddedb3f42 Merge pull request #7449 from Goober5000/feature/dynamic_reinforcements
make the reinforcements collection dynamic
2026-05-26 20:10:57 -04:00
Mike Nelson 474f62b21e address feedback 2026-05-26 16:10:33 -05:00
Goober5000 b532a7b855 properly initialize each reinforcement 2026-05-26 10:55:05 -04:00
Goober5000 81695b36db qtfred support 2026-05-26 10:55:05 -04:00
Goober5000 7545e5d035 make the reinforcements collection dynamic
As requested by a FREDder who has a plausible situation where more than 32 reinforcements might be handy. :)
2026-05-26 10:55:05 -04:00
Shivansps fe18b474a9 KTX1 / ETC2 Compressed textures support (#7070)
* Initial KTX1/ETC2 support

* Conditional glad include

* remove unused function

* define glenum for non opengl build

* remove unused param

* fix qtbuild

* change ktx format to enum

* use nullptr

* ktx: support the same etc2 formats available in amd compressonator

* add comments and missing include

* correct flag type

* clarify variable name for clang

* cleanup

* update glad loader to GL4.3
2026-05-26 12:21:43 +02:00
Goober5000 04f0410408 Merge pull request #7299 from Goober5000/fix/fred_subsys_bbox
FRED and qtFRED quality-of-life improvements for highlighted models
2026-05-25 23:58:36 -04:00
Goober5000 4e0ae62e13 FRED and qtFRED quality-of-life improvements for highlighted models
A few visual improvements requested on Discord:
1. Use a configurable LOD to draw the outline wireframe, defaulting to LOD 1
2. Draw subsystem names with a dark outline to make them more visible
3. Draw the subsystem boundary boxes with thicker lines
2026-05-25 23:33:32 -04:00
Mike Nelson 712e10f778 only change theme if the pref changed (#7469) 2026-05-25 22:06:55 -04:00
BMagnu b70657a190 Moveable Instant Finish (#7476)
* Expose functions to instantly finish current moveable

* Fix IK crash
2026-05-25 01:31:53 +02:00
Mike Nelson 85f00be6f0 Optimize UI model instance (#7246)
* UI model caching feature

* do this with frames instead of timestamp
2026-05-25 01:31:21 +02:00
Mike Nelson 0ffc33c50b fix clipping issues on mirrored bitmaps (#7465) 2026-05-25 01:31:08 +02:00
Shivansps ff892b2ca7 Add OpenGL ES Compatibility Layer (#7137)
* initial changes

* add GLAD_ES loader

* Implement basic es compatibility header

* re-add accidentally deleted break

* Add GLES BC7 extension to glad and improve extension support report

* fix some enum mappings

* Use the ARB name for geo shader check

* Add es espand shader includes

* Fix glbufferstorage mapping

* fix some gl errors on opengl es

* Enable GL_CLIP_DISTANCE

* Add format conversions

* add bgba 8888 to rgba 8888 converter

* disable GLAD_GL_ARB_timer_query

* Properly handle wgl + opengl es on windows

* initial enable imgui gles

* add GL_BGR to GL_RGBA conversion

* inform opengl es on menu

* small corrections to the es header

* small refactor of glTexSubImage3D

* remove expandincludes, existing code already did that better

* change default graphic values for opengl es

* compile imgui with opengl es 3 on linux

* allow qtfred to run on opengl es

* improve es compatibility header and remove shader precision quantification

* add compiler hints

* remove unused structs

* Fix imgui crashing on windows with gles, use angle lib

* Do not use MSAA under OpenGL ES, at least for now

MSAA will need an alternative path for GL ES using GL_EXT_multisampled_render_to_texture and GL_EXT_multisampled_render_to_texture2

* add missing profile handler

* cleanup

* revert color_attachment_4/5 fbo workarounds

* Adjustments to log output and enable GL_BLEND

* Implement glGetQueryObjectui64v on es layer

* Fix deferred and decals support

Also added glGetTexImage(), glQueryCounter() and some additional comments

* Revert changes to default values of graphics options

* Minor improvements to glTexSubImage3D()
2026-05-25 01:30:42 +02:00
Taylor Richards 312a31feda add missing fontconfig dependency for ccache workflow (#7475) 2026-05-23 10:59:27 -04:00
Goober5000 cc9b7ad678 Merge pull request #7474 from Goober5000/fix/length_limit
fix wing name length checks
2026-05-22 20:55:44 -04:00
Goober5000 53db82a55f FRED fix - don't automatically give the ship a display name when the wing has a display name 2026-05-22 17:14:43 -04:00
Goober5000 b842e1774e fix wing name length checks
Handle wing names with any ordinal digit length.  Also fix a bug in `multi_ts_get_shipname` which passed a 0-based index instead of a 1-based index.
2026-05-21 22:46:17 -04:00
Taylor Richards 15c4141a1d always use newest appimagetool version (#7468)
This will download the appimagetool utility as part of the install step so
that the newest version of both the tool and the runtime is always used. Moving
it out of the build image allows us to take advantage of newer capabilities,
such as no longer having an external dependency on libfuse2.
2026-05-21 00:32:59 -04:00
Goober5000 295291e4ce Merge pull request #7456 from Goober5000/fix/openal_underrun
fix audiostream cutouts from openal buffer underrun
2026-05-20 22:03:15 -04:00
Mike Nelson 65a5c1f54c trim the fat (#7457) 2026-05-20 15:53:22 -04:00
Goober5000 70c4010389 add wing display names (#7429)
* add wing display names

Adds display name capability for wings, matching the pattern and infrastructure of display names for ships.  As in #7234, wing display names take precedence over ship display names, if both are provided; because if ship display names took precedence, a ship would have the same display name in every wave.

All the relevant display locations are handled, including the HUD, escort list, message box, and mission log.  Lua API support is provided as well.

Adds full support for both FRED and QtFRED, including the always-save-display-names setting.

Addresses #7189 and the last request from #1730.

* add help text from #7234
2026-05-20 15:16:08 -04:00
Mike Nelson 5a2ffd9f9c alt2 path mode with shortcutting (#7322) 2026-05-20 03:21:44 +02:00
Mike Nelson 9a843f3420 support dds images in qtfred image picker 2026-05-19 11:47:25 -05:00
BMagnu c8ea9c6035 Model surface particles (#7447)
* Pick model surface particle by sampling random vertex

* Parse and keep buffers

* Add local position scaling

* Fix warning

* Fix warning 2

* Fix warning 3

* Fix warning 4

* Add scale parameter

* Incorporate feedback
2026-05-18 13:23:41 +09:00
wookieejedi 15e7528d41 Expose new Max Guard Range to scripting (#7451)
Follow-up to #7251, which added `set-guard-range`
This PR exposes that value to scripting, so scripters do not have to use the more expensive `runSEXP` to use it.

The value is initialized as -1 (`max_guard_radius = -1.0f;` line 7913 in ship.cpp), hence the default value for the script is -1.
2026-05-18 11:34:19 +09:00
Goober5000 a6dc9de647 Merge pull request #7464 from Goober5000/fix_6793
two fixes for issue 6793
2026-05-17 19:25:59 -04:00
Mike Nelson 9de7315b38 move waypoint and jump node to their own dropdown category (#7455) 2026-05-16 10:41:59 -04:00
Mike NelsonandThe Force b4c5c7b781 Qtfred ship weapons dialog (#7453)
* Release Build Safety

* Move to using standard models.

* Avoid using .indexes() to fix heap coruption

* More work on selection function

* major cleanup and refactor

* enable drag and drop

* multi edit support

* cleanup

* fix build issue on linux

* revert non-weapons dialog changes

* clang

* clang

* update help doc

* better model/dialog code split

* further cleanup

* static

* keep primary and secondary banks aligned

---------

Co-authored-by: The Force <[email protected]>
2026-05-16 10:41:48 -04:00
Goober5000 4bc45b3481 Merge pull request #7459 from Goober5000/fix/comm_node
fix the Shivan Comm Node
2026-05-15 22:17:34 -04:00
Goober5000 1b8a79c64e two fixes for issue 6793
1. more robust handling of missing fireball graphics
2. fix handling of error dialogs on Linux so that the engine doesn't silently continue on an error!

Fixes #6793.
2026-05-15 22:09:29 -04:00
wookieejedi 0018f55c55 Fix edge case in switching from None AA to MSAA (#7454)
If you set AA level to None, save, then close the game, then re-enter the game and switch the AA mode to an MSAA mode, then the screen will just be black until the game is restarted. This does not happen when switching from None to FXAA because FXAA works because its post-pass uses `Scene_luminance_texture` and `Scene_ldr_texture`, which are always created as part of standard scene setup.

There are two ways to fix this, either require AA mode to require a game restart (though that may complicate the lab) or allow resource allocation for SMAA always.

Honestly I like the idea of keeping the lower-end machines optimized and not allocating for SMAA but simply running it always but for this PR have just allowed it always run.

Happy to discuss whichever option folks think is best!
2026-05-15 08:46:28 -04:00
Mike Nelson 946d15c1e5 ship special stats stylization pass (#7440) 2026-05-15 07:33:53 -04:00
Mike Nelson b8a3c9cae0 QtFred Ship initial status stylization pass (#7439)
* ship initial status stylization pass

* suppress false positive
2026-05-15 07:33:46 -04:00
Mike Nelson 4741869bbe QtFRED Jump Node Dialog Upgrade (#7420)
* make jump node multi select and direct edit

* clang

* update qtfred help docs

* fixes
2026-05-15 07:32:59 -04:00
Goober5000 c3b8922fe3 address feedback 2026-05-14 23:35:00 -04:00
Goober5000 3455b0f983 Merge pull request #7458 from Goober5000/cleanup/coverity_and_claude
a bit of cleanup
2026-05-14 11:16:43 -04:00
Shivansps 20b55eb58c TTS Speech rework (#7357)
* add imgui speech options

* adapt existing windows sapi speech implementation

* adapt existing mac speech integration

* add speech linux stubs

* add speech support in linux

* Add array checks

* Use dlopen for speech-dispatcher

* corrrect lib name

* missing includes and static cast

* do not change mac file type

* fix clang tidy warnings 1

* set tts rate

* set localization ids

* fix clang tidy warnings 2

* correct symbol name

* Remove voice cache and fix win enumerate_voices overriding voice selection

* fix mac rate

Done by notimaginative

* requested changes

* re-add voice cache for linux

* Open connection for linux get flags

* fix missing }

* change voice option combobox to std::pair

* delete duplicated voice id sanitizer on windows set voice

* Use pairs for speech_enumerate_voices() and adapt linux speech

* use reference

* actually free vector memory

* Clear voice cache when ingame options closes

* Use extern to call fsspeech_options_cleanup()

* update localization ids

* Fixing some linux and window speech oversights

* Apply volume and rate after a voice change, correct voice, volume and rate apply order
2026-05-14 08:07:11 -04:00
Mike Nelson 6ddc6c519d qtfred always generates sexps file (#7452) 2026-05-14 07:55:47 -04:00
Mike Nelson 3d43ddbcef QtFred Ship goals stylization pass (#7438)
* ship goals stylization pass

* clang

* static access
2026-05-14 07:55:32 -04:00
Mike Nelson 17b08706c1 ship flags stylization pass (#7437) 2026-05-14 07:53:23 -04:00
Mike Nelson 05619eba9d ship custom warp stylization pass (#7436) 2026-05-14 07:53:14 -04:00
Mike Nelson 2c62cb2089 ship alt class stylization pass (#7435) 2026-05-14 07:53:05 -04:00
Goober5000 8f916174be clang 2026-05-14 03:30:53 -04:00
Goober5000 1245546bb7 clang-tidy 2026-05-14 01:51:10 -04:00
Goober5000 bed223c5c7 second part of comm node fix
Fix #4089, part 2:
- properly link special-point subsystems with -destroyed submodels, if such a relationship exists and a game_settings.tbl flag is set
- add some helper functions for -destroyed variants of submodels (and now subsystems)
2026-05-14 00:04:31 -04:00
Goober5000 246213a4be first part of comm node fix
Fix #4089, part 1:
- give the `my_replacement` and `i_replace` fields clearer names
- for submodels with the `Is_damaged` flag (representing -destroyed variants or debris), initialize them to blown-off (the true fix for #3078, fixing a regression introduced in the model instance refactor)
- roll back the de-parenting of live debris from #3089 (726ce953c7), because it was a wrong fix to the initialization bug and introduced its own subtle bug when positioning live debris
- roll back the `Can_move` flag skipping from #4138 (063d7afcfe), because it was another wrong fix to the initialization bug
- add some clarifying comments
2026-05-14 00:04:31 -04:00
Goober5000 f8fa1e4775 a bit of cleanup
Fix a few items flagged by Coverity and Claude:
- properly check for an unassigned ship node, rather than just Asserting, since this could be affected by mission data
- properly check for null containers for the same reason
- rename `ai_goal_find_empty_slot` to `ai_goal_allocate_slot` and edit comments to reflect its not-quite-side-effect-free role
2026-05-13 23:29:31 -04:00
Goober5000andClaude Opus 4.7 e4af84e79a fix audiostream cutouts from openal buffer underrun
When a streaming OpenAL source plays through all queued buffers it
transitions to AL_STOPPED. Per the spec, queueing more buffers after
that does not auto-resume playback -- alSourcePlay must be called
again. This is the likely cause of music and briefing voices cutting
out.

To fix this, check for underrun and call alSourcePlay if needed. Also
double MAX_STREAM_BUFFERS from 4 to 8, bumping the margin to ~2s
of queued audio.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-13 21:20:31 -04:00
Mike Nelson e6d8835b72 Qtfred Ship editor stylization pass (#7434)
* ship editor stylization pass

* proper enable/disable fixes
2026-05-13 07:41:03 -04:00
Mike Nelson 9b57cc7a26 wing editor stylization pass (#7433) 2026-05-13 07:40:54 -04:00
Mike Nelson ddb6c2eaed QtFRED Waypoint Dialog Upgrade (#7419)
* make waypoint multi select and direct edit

* clang

* update qtfred help docs

* fixes

* static

* address feedback
2026-05-13 07:40:44 -04:00
Goober5000 ce28df46ca Merge pull request #7448 from Goober5000/feature/unlimited_title
unlimited mission titles
2026-05-12 21:17:40 -04:00
Goober5000 ef73e2572d unlimited mission titles
Some code refactoring to allow mission titles to be strings of any length.  Titles that are too long to actually display (based on string width) will be visibly truncated using `font::force_fit_string`, but the underlying title will not be affected.  Multiplayer is still subject to the 31-character length limit, so titles sent over the network will still have characters truncated.

Also removes some redundant calls to `gr_get_string_size`, since `font::force_fit_string` returns the fitted string width.
2026-05-12 11:31:20 -04:00
BMagnu 1cbfb34a43 add findWorld / findObject for objects (#7443) 2026-05-12 07:52:28 -04:00
Mike Nelson 975ce277a7 QtFRED large ship collision group mission flag (#7425)
* large ship collision group mission flag

* update help doc
2026-05-12 07:51:00 -04:00
Mike Nelson 6c0d490489 Qtfred error checker (#7389)
* new qtfred error checker

* fix some issues

* clang

* more clang

* clean up and fixes

* missed a comment

* add help documentation

* surface auto corrected issues more clearly

* some cleanup
2026-05-12 07:49:27 -04:00
Goober5000andClaude Opus 4.7 1a34123f0c fix qtfred heap corruption in FastDebug builds (#7450)
FastDebug FSO compiled with /MDd (debug CRT) but imported Qt's Release
libraries via CMAKE_MAP_IMPORTED_CONFIG_FASTDEBUG = Release Debug. Qt
Release ships /MD, so any allocation crossing the qtfred <-> Qt boundary
went into one heap and came back out of the other, tripping
_CrtIsValidHeapPointer on a perfectly-valid std::string dtor. Latent for
ages because it only surfaces when an allocation actually crosses;
opening a mission file is one such path.

To paper over the resulting STL layout difference, FastDebug also forced
_ITERATOR_DEBUG_LEVEL=0 so qtfred's std::string matched Release Qt's.
Not needed once we link Debug Qt, and keeping it would introduce a fresh
mismatch (qtfred IDL=0 vs Debug Qt IDL=2).

Fix:
  - Map FastDebug imports to "Debug Release \"\"" in qtfred/CMakeLists.
    Debug picks Qt's debug libs; Release is a defensive fallback; the
    empty entry falls back to plain IMPORTED_LOCATION, required because
    Qt's host tools (uic/moc/rcc/qhelpgenerator) ship a single variant
    with no IMPORTED_LOCATION_<CONFIG>. Must precede find_package(Qt5):
    CMake snapshots the variable into each target's MAP_IMPORTED_CONFIG
    property at creation time. (Also why the prior "Release Debug" was
    silently a no-op -- set after find_package, ignored; CMake fell
    back to Release on its own.)
  - Extend the qwindows/qsqlite plugin POST_BUILD copies' "d"-suffix
    generator expression to match FastDebug as well as Debug, so the
    Debug Qt runtime finds qwindowsd.dll / qsqlited.dll alongside.
  - Drop the FastDebug-only _ITERATOR_DEBUG_LEVEL=0 from the MSVC
    toolchain file. Qt was the sole consumer; pure-C deps don't care.

Cost: FastDebug STL containers pick up MSVC's debug-iterator overhead.
Reasonable trade for a config named "Debug with optimizations".

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-12 07:48:27 -04:00
wookieejedi 2046f9b5ac Update ParticleEffect.h (#7446)
Curve input follow-up to #6926 and #6889, in that it adds two new curve input Nebula and Particle Detail Levels for use within the particle effects table. These new inputs will allow modders to develop effects that can properly be optimized per varying particle and nebula detail levels.
2026-05-11 07:55:15 -04:00
Mike Nelson 76c00dbc06 Add set-guard-range sexp (#7251)
* set-guard-range

* make sure old path remains unchanged

* address feedback again
2026-05-11 07:53:58 -04:00
Mike Nelson 5f6309be49 make prop dialog true direct edit (#7418) 2026-05-09 10:50:51 -04:00
Mike Nelson d6509d81ab QtFRED Camera Class (#7408) 2026-05-09 10:50:30 -04:00
Mike Nelson 9180ff364e icon closeup zoom and pos (#7398) 2026-05-09 10:50:03 -04:00
Mike Nelson f02c01a81e fix gauges not respecting table flags (#7426) 2026-05-08 12:58:57 -04:00
dependabot[bot] 5fa6cb1677 Bump mako from 1.3.11 to 1.3.12 in /ci/post
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.3.11 to 1.3.12.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-version: 1.3.12
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-05-08 10:46:56 +00:00
BMagnu 4086db15d9 Fix randomrange init slowdown (#7444) 2026-05-08 17:43:40 +09:00
Goober5000 165c4d3e6b Merge pull request #7307 from Goober5000/debriefing_modeless
convert debriefing editor to modeless; add focus_sexp(); fix bugs
2026-05-08 04:35:18 -04:00
Goober5000 6885bdc523 Merge pull request #7442 from Goober5000/7334_followup
fix FRED2 MFC linkage when building qtFRED
2026-05-08 01:53:40 -04:00
Mike Nelson 98aac12213 fix unpause issue (#7427) 2026-05-08 14:38:28 +09:00
Goober5000 f4c76dcee1 fix FRED2 MFC linkage when building qtFRED
PR #7334 caused an unintended side effect when building both FRED and QtFRED.  With QtFRED enabled, FRED2 sources were compiled with _AFXDLL defined while still linking against static MFC, causing a crash on startup.  To fix this, keep the conditionals in sync between cmake/toolchain-msvc.cmake and fred2/CMakeLists.txt.

Also, do not explicitly add static MFC libraries if we are using dynamic linking.
2026-05-08 00:54:40 -04:00
Mike Nelson fdef3eaa38 Share texture type names from model.h (#7395)
* share texture type names from model.h

* signed unsigned mismatch

* clang

* stop yur whining
2026-05-07 08:03:27 -04:00
Goober5000andClaude Opus 4.6 3f85d6172a use std::move() for local variables that are copied but not reused (#7308)
* use std::move() for local variables that are copied but not reused

Addresses ~140 Coverity "Variable copied when it could be moved"
defects across 74 files.  Every std::move() targets a local variable
whose value is consumed by push_back, emplace, assignment, lambda
capture, or a function call and is never read again afterward.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* clang: use std::make_shared

* clang: use std::make_unique

* address feedback

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-07 14:40:38 +09:00
Goober5000 0e1e05552a Merge pull request #7421 from Goober5000/fix/anchor_model
fix a few bugs in model loading
2026-05-06 22:41:26 -04:00
Goober5000 4b157fe992 Merge pull request #7424 from Goober5000/fix/cmake_toolchain
fix cmake warning
2026-05-06 22:41:16 -04:00
BMagnu 1b0e63d924 Add animation support for particle spawning (#7416)
* Add particle during animation

* cleanup
2026-05-07 09:54:07 +09:00
Goober5000 9129a5871b fix cmake warning
Per Claude:
> The `IF` opens with `(MSVC_USE_RUNTIME_DLL OR FSO_BUILD_QTFRED)` but the `ELSE` and `ENDIF` only reference `(MSVC_USE_RUNTIME_DLL)`. CMake requires the argument in `ELSE`/`ENDIF` to match the `IF` exactly (or be omitted).
2026-05-05 23:29:11 -04:00
Mike Nelson 811b41252f Make showing 2D radar icons a toggle-able option (#7409)
* Make showing 2D radar icons a toggle-able option

* better options
2026-05-05 07:39:03 -04:00
Goober5000 2b6e20360d assign sip->model_num from inside model_load, plus a few tweaks 2026-05-05 00:19:47 -04:00
Goober5000 0642dcceab fix a few bugs in model loading
Each time `model_load` is called with a `ship_info` pointer, which causes it to load subsystems, the model number MUST be assigned to the ship_info.
2026-05-05 00:19:47 -04:00
LuytenKy 09a848a224 Refactor player-set-target SEXP (#7393)
* Refactor of logic based on feedback

* resolve requested changes
2026-05-03 12:26:45 -04:00
Mike Nelson d8131ab901 QtFRED help dialog and documentation (#7380)
* help dialog and documentation

* compile help in headless mode

* scene browser help file

* attempt to get CI working for linux

* debug attempt

* Fix split method to use QString::SkipEmptyParts

* Revert "debug attempt"

This reverts commit cb046e1b3305577ff50e95d5b748f6d1dbf025fb.

* clang

* update help

* correct name

* Inject sexps.html into help and add find in page controls

* update help based on recent commits

* better tutorial asset loading

* no const

* update help again
2026-05-03 12:26:06 -04:00
Mike Nelson 1d63244753 add escort to ship flags (#7404) 2026-05-02 12:04:01 -04:00
Mike Nelson 4416dfc3b0 make sure we don't set modified during init (#7417) 2026-05-02 12:03:20 -04:00
Goober5000 2b48778307 Merge pull request #7410 from Goober5000/documentation/4148
add documentation for issue 4148
2026-05-01 21:08:06 -04:00
The Force 0e43b1970c Fix Heap Alloction issues in QTFred (#7334)
* Build using /MD flag if building QTFred and on windows

Fixes Multiple QTFred heap crashes due to mismatched runtime types.

* Actually Change Right value
2026-05-01 14:56:09 -04:00
Mike Nelson 636390b727 Fix assert for flag list and ship starts (#7415) 2026-05-01 08:37:12 -04:00
Mike Nelson 683b533467 Qtfred Upgrade checkbox dialog (#7405) 2026-05-01 08:36:45 -04:00
BMagnu 37ecbe439a Gate correct insignias behind flag / version (#7406)
* Gate correct insignias behind flag / version

* Move flag to graphics settings
2026-05-01 16:16:40 +09:00
Goober5000 3a556d9413 Merge pull request #7412 from Goober5000/fix/asteroids
fix asteroid field undefined behavior
2026-04-30 22:02:27 -04:00
Goober5000 29bb47402f Merge pull request #7411 from Goober5000/fix/7327_followup
small followup to 7327
2026-04-30 22:01:11 -04:00
Goober5000andClaude Sonnet 4.6 6e5e342575 fix asteroid field undefined behavior
Three out-of-bounds/UB fixes for issue #6793:

- asteroid_create_all: skip field_debris_type[idx] == -1 entries when
  building the DG_DEBRIS odds table and loading models; iterate only
  over valid table slots during spawn. Matches the guard already present
  in asteroid_frame.
- missionparse: bounds-check subtype before indexing colors[] in the
  obsolete +Field Debris Type: parsing path.
- verify_asteroid_list: guard the asteroid_list[0] fallback access
  against an empty list.
- asteroid_init: emit an mprintf when no asteroids are defined instead
  of returning silently.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-30 02:10:49 -04:00
Goober5000 4235e4f252 small followup to 7327
Submodel `collision_tree_index` should be reset to -1 when removed, not 0.
2026-04-30 01:35:07 -04:00
Goober5000 e2707549f4 add documentation for issue 4148
Per Claude:

The key things the new comments add that the old ones were missing:

1. Palette RGB colors are completely ignored — only the index value is used as alpha. This is the non-obvious invariant that @notimaginative described.
2. Exact mapping table — makes the * 18 / * 17 math immediately readable, and clarifies the ANI vs PCX difference (> 15 clamps to opaque in ANI but transparent in PCX).
3. The broken-palette consequence — explicitly states that a reversed palette causes a white square, linking to #4148 so future readers understand the context.
2026-04-30 00:35:19 -04:00
Goober5000 7e74e35240 Merge pull request #7258 from Goober5000/split_str_once_preliminary_cleanup
preliminary cleanup for split_str_once refactor
2026-04-29 21:53:12 -04:00
Goober5000 f0ed5c88b8 Merge pull request #7407 from Goober5000/fix/coerce_to_utf8
fix coerce_to_utf8
2026-04-28 22:39:14 -04:00
Goober5000 abc5e87914 Merge pull request #7365 from Goober5000/fix/sexp_type_checking
improve SEXP syntax checking
2026-04-28 22:37:10 -04:00
Goober5000 66eb4702e1 fix coerce_to_utf8
Fix a bug that Claude caught: conversion from Latin-1 would fall through, truncate, and emit a spurious warning.
2026-04-28 01:26:11 -04:00
Mike Nelson ad4424984a Qtfred generic fixes (#7403) 2026-04-26 08:25:05 -04:00
Mike Nelson 681e9b73c6 Qtfred misc ship editor fixes (#7402)
* fix hotkey not saving/loading

* fix docking setup flow

* fix all/none in flags list not updating ui

* fix tri-state flag issues with multi selection

* fix initial status checkboxes

* fix no warp effect

* more fixes

* fix flag hiding

* allow any flag to be skipped for player starts

* another fix for no warp effect

* smarter context menu

* fixes for object orient editor
2026-04-25 10:40:46 -04:00
Mike Nelson be6594d786 QtFred layer dropdowns in object dialogs (#7385)
* layer dropdowns in object dialogs

* fix rebase issue

* silence Claude
2026-04-24 07:31:14 -04:00
wookieejedi 46d136c548 Follow-up fix to 7360 (#7399)
Turns out 7360 causes cockpits to not render. That PR had updated `GL_DEPTH_ATTACHMENT` to `GL_DEPTH_STENCIL_ATTACHMENT` but missed two spots. This PR fixes that and tests show cockpits now work.  (Root cause was the save/restore zbuffer swap using the old GL_DEPTH_ATTACHMENT point — once the scene texture became a combined depth-stencil, re-binding just the depth slot left stencil dangling and made the FBO incomplete.)
2026-04-23 10:25:51 -04:00
Mike Nelson 7fa37f3542 make sure toolbars can't be hidden (#7397) 2026-04-23 07:54:44 -04:00
Mike Nelson 86281e52b8 Qtfred custom data scripting parity (#7396)
* mirror scripting behavior from fred2

* apply scripted default custom data on new mission
# Conflicts:
#	qtfred/src/mission/dialogs/MissionSpecDialogModel.cpp
#	qtfred/src/ui/dialogs/MissionSpecs/CustomDataDialog.cpp
2026-04-23 07:53:58 -04:00
Mike Nelson 68aad508fb QtFred Combined spooled music selector/player widget (#7377)
* combined spooled music selector/player widget

* clang

* private members

* case insensitive compare
2026-04-23 07:53:16 -04:00
Mike Nelson 3d18cf4e5e Qtfred quick action bars (#7375)
* Add quick action bars to qtfred FredView

* always use trimmed

* make sure the layer list stays updated
2026-04-22 09:40:06 -04:00
BMagnu 7e09961f01 Fix stencil attachment for RTT textures and enable depth/stencil for cockpit RTT (#7386) 2026-04-21 12:17:53 +09:00
BMagnu 7590eaa371 Fix dirty modelcollide state in shipfx and harden with assert (#7390) 2026-04-21 12:15:27 +09:00
Mike Nelson d98b117316 qtfred event msecs checkbox (#7388) 2026-04-20 07:52:33 -04:00
Mike Nelson 09029030c2 Qtfred unify flag lists (#7384)
* convert wing flags to the flags widget

* set tooltips on flags using flag descriptions

* add missing descriptions

* clang
2026-04-20 07:52:24 -04:00
Mike Nelson b1cefade1a Qtfred cargo title and scanning fields (#7387)
* implement newer cargo fields and clarify subsystem cargo settings

* static
2026-04-20 07:52:16 -04:00
Mike Nelson cf5b50fe4b Qtfred visual tweaks (#7381)
* color variable or container rows based on type

* add props and jump nodes to layer filters

* make goals dialog dynamic and fix bugs

* cleanup

* missed these
2026-04-19 12:05:23 -04:00
Taylor Richards bd6ae390e6 add missing libfontconfig dependency for PR test workflow (#7382)
Fix issue with our Linux build image where libfontconfig1 isn't installed, but
is needed by some Qt5 libs. Since aqt is used to install a more up-to-date
Qt5 version than what's provided by the distro we don't have the usual
dependency resolution needed to prevent this.

This is a stop-gap measure to fix testing of pull requests for QtFred, and
only applies to that specifc workflow. The arm64 Linux image also has a broken
Qt install so this workaround is useless with normal workflows. A proper fix
will require updating the Linux build image to fix the Qt dependency problem
and related issues.
2026-04-18 21:42:52 -04:00
Goober5000 ced4fd3ed9 Merge pull request #7370 from Goober5000/fix/repulse
Fix stale subsystem model_num references across mission boundaries
2026-04-18 21:21:46 -04:00
Goober5000 1c25ed7fab Merge pull request #7383 from scp-fs2open/dependabot/pip/ci/post/mako-1.3.11
Bump mako from 1.2.2 to 1.3.11 in /ci/post
2026-04-18 13:37:33 -04:00
Mike Nelson efb1a62e86 Qtfred fixes and tweaks (#7379)
* fix mission stats message count

* fix texture replace for retail textures

* fix heap issue in ship alt class

* fix props menu item

* some ui clarity

* unify up/down buttons to use our painted icons

* fixup ship and wing cues toggles

* rename and move Object Orientation menu item

* menu seperator styling for dark mode
2026-04-18 10:43:29 -04:00
Mike Nelson 86ef1ff8a7 cleanup and persist preferences (#7376) 2026-04-17 07:46:35 -04:00
dependabot[bot] 5b84cef369 Bump mako from 1.2.2 to 1.3.11 in /ci/post
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.2.2 to 1.3.11.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-version: 1.3.11
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-04-16 21:56:10 +00:00
Mike Nelson 4084c75678 Qtfred Dockable object list (#7368)
* qtfred dockable objects list

* fix jumpnode rendering

* more ouline panel features

* fix for wings

* remember list expansions

* clean up wing selection and layer handling

* disable top and bottom docking

* give scene outliner some padding

* replace old selection dialog with the scene browser

* fix some minor issues

* right click for wings and waypoint paths

* clang

* clang again

* fix status bar message

* 25 1 checks

* clang

* more clang

* address feedback
2026-04-15 23:07:01 -04:00
LuytenKy 2894ddb1fa Feature: Implements the SEXPs that set the player's target and or clear it if necessary (#7349)
* draft set-target-player-sexp

* Missed a few entries and duplicates

* Missed another entry

* Yet another missed entry

* Fix subsystem not showing up being targeted

* Fix subsystem targeting in set-player-target SEXP

* remove reduntant return

* change sexp category to better suit feature
2026-04-15 11:57:40 -04:00
LuytenKy e9c86b1e0e OpenGL: Consolidate depth–stencil buffers (Strategy 2) (#7360)
* Remove redundant unused stencil code

* switch Back_depth_texture to GL_DEPTH24_STENCIL8

* manage the clang-tidy error

* Remove redundancies and possible handle shutdown leaks
2026-04-15 07:52:20 -04:00
Mike Nelson c941963972 Qtfred ships dialog direct edit (#7369)
* fix some issues and convert to direct edit

* fix some comments

* some fixes

* var clash

* loops

* re add missing warning
2026-04-15 07:47:15 -04:00
Mike Nelson abb9dfb783 lua copy color (#7374) 2026-04-13 01:30:31 +02:00
Mike Nelson 243dc9237b QtFRED better file dialog handling (#7364)
* better file dialog handling

* fix copy/paste error

* not static for a change
2026-04-12 11:35:16 -04:00
Mike Nelson ec3f5ccc54 QtFred viewport code cleanup (#7361) 2026-04-11 08:28:47 -04:00
Mike Nelson 076d3849af Qtfred dark mode (#7362) 2026-04-11 08:28:31 -04:00
Goober5000andClaude Opus 4.6 2dcf851236 Fix stale subsystem model_num references across mission boundaries (#3147)
Fixes the long-standing intermittent bug where the GTD Orion#Repulse in
Silent Threat: Reborn's "Forced Hand" mission spawns with all subsystems
unlinked, leaving the ship untargetable and undisableable.  The same root
cause has been reported since at least 2015 (HLP topic 89403) and was
provisionally closed in #3147 as fixed by #3858, but #3858 was an unrelated
parse_ship_values memory leak fix and never actually addressed this
behavior.  Recently the underlying check at ship.cpp ~8043 was promoted
from Warning to Error (#5591), which is why Release players are now
hitting a hard error dialog instead of just seeing missing subsystems.

Root cause
----------
model_unload() walks Ship_info and resets si.model_num = -1 on every
ship_info that referenced the model, but does not touch
si.subsystems[k].model_num.  Subsystem entries are left pointing at the
freed model id.  When a subsequent mission reloads the same pof under a
new id, ship variants that share the model rely on
ship_copy_subsystem_fixup() to re-link their subsystem arrays, but the
fixup matches by name via model_copy_subsystems() and any unmatched
destination subsystem stays at -1.  The mismatch case in
model_copy_subsystems() was guarded only by Int3(), which is a no-op in
Release builds, so the failure was completely silent until subsys_set()
errored out much later with no useful context.

The bug is intermittent because it depends on three independent ordering
factors: which prior mission was last played, which Orion variant that
mission used, and the iteration order of Ship_info during the next
mission's ship_page_in().

Changes
-------
* model_unload(): when clearing si.model_num for an unloaded model, also
  clear every si.subsystems[k].model_num that pointed at the same id.
  This is the structural fix and eliminates the entire class of stale
  subsystem pointers surviving across mission boundaries.

* model_copy_subsystems(): replace the silent Int3() in the name-mismatch
  branch with Error(LOCATION, ...) naming the unmatched subsystem.  This
  surfaces a failure mode that has been invisible in Release builds for
  over a decade and gives modders an actionable diagnostic when sibling
  ship classes that share a model have inconsistent subsystem names.

* ship.cpp: introduce verify_ship_subsystems_linked() helper that checks
  every model_subsystem on a ship_info is linked into the same model the
  ship is using, and fails with Error(LOCATION, ...) naming both
  polymodels if not.  This is the canonical post-condition for both
  ship_copy_subsystem_fixup() and model_load() (which is supposed to
  link subsystems via do_new_subsystem()).

* ship_create(): call verify_ship_subsystems_linked() after
  ship_copy_subsystem_fixup() so that any failure to link a subsystem
  is surfaced with full context (ship name, subsystem name, both model
  filenames) instead of propagating to a generic error in subsys_set()
  much later.  This closes a long-standing asymmetry where ship_page_in()
  had a guard (added by zookeeper in 2015) but ship_create() did not.

* ship_page_in(): three post-fixup verifications were gated by
  #ifndef NDEBUG with Warning() or Assertion() calls, both of which are
  no-ops in Release builds.  Replace each with a verify_ship_subsystems_linked()
  call so they fire in Release as well.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-11 02:10:01 -04:00
Cliff GordonandClaude Opus 4.6 035ff3e111 Fix standalone web UI crash when polling player data before ship selection (#7367)
playerGet() indexed Ship_info with ship_class without bounds checking.
Before ship selection, ship_class is -1, which as an unsigned index
causes an out-of-bounds access. Add bounds check using ship_info_size(),
matching the pattern used elsewhere in the codebase. Also update the
Windows standalone GUI to use ship_info_size() for consistency.

Fixes #7366

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-10 12:41:45 -04:00
Mike Nelson 1dd8f76861 Qtfred bugfix pass (#7363) 2026-04-10 09:03:52 -04:00
Mike Nelson 35e7bcf23b Qtfred toolbar and image asset cleanup (#7356) 2026-04-10 09:03:34 -04:00
Mike Nelson 3ccec4b9c6 Qtfred right click menu (#7354) 2026-04-10 09:03:18 -04:00
Mike Nelson 35ce84ebff Qtfred briefing map (#7338) 2026-04-10 09:02:54 -04:00
Mike Nelson 187906549c QtFRED waypoint path generator tool (#7335) 2026-04-10 09:02:37 -04:00
Mike Nelson 18fd87062f Allow rendering tech models with destroyed subsystems (#7218)
* allow rendering tech models with destroyed subsystems

* fix copy/paste error
2026-04-09 08:10:14 -04:00
Goober5000 56341002c8 improve SEXP syntax checking
Clean up the syntax checker, using clearer variable names for each check, and most importantly unique variable names.  Fixes several bugs where syntax checking failed because the same variable was overwritten with incompatible type information.

Also fixes a bug in `check_operator_argument_count` where the count check never ran due to a mixup of `op_index` and `op_const`.
2026-04-08 23:09:20 -04:00
Goober5000 219f692660 Merge pull request #7339 from Goober5000/claude/waypoint_position
remove redundant waypoint position by delegating to the game object
2026-04-08 21:12:04 -04:00
Mike Nelson 36d05ba9d8 Implement Photo Mode (#7287)
* Implement Photo Mode

* fix gr string errors

* return raw char array

* control conflict groups and better photo param defines

* better param identification in real time

* make photo mode hude dynamically sized

* fix xstrs after all changes

* missed a few

* use modern loop
2026-04-08 10:33:51 -04:00
Mike Nelson bbf527bae3 grant lua access to closeup values (#7342) 2026-04-08 10:32:32 -04:00
Cliff GordonandClaude Opus 4.6 c8201660d5 Fix multi sync screen showing wrong player status for non-host players (#7359)
Net_player[idx] (pointer arithmetic from current player) was used instead
of Net_players[idx] (global array index), causing the status display to
read from wrong offsets. This coincidentally worked for the host at index 0
but showed incorrect status for all other players — most visibly on
standalone servers where no client is at index 0.

Fixes #7358

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-07 13:23:57 -04:00
Mike Nelson 7826b96ed2 QtFRED Cleanup and parity pass on view and object menus (#7348)
* Cleanup and parity pass on view and object menus

* some more view menu cleanup

* fix outline rendering for ships

* clang
2026-04-07 09:37:46 -04:00
Mike Nelson 703988942c QtFRED - wire up file and edit menu controls (#7347)
* wire up file and edit menu controls

* linux

* more linux

* backup files don't go into the recent files list
2026-04-07 07:59:35 -04:00
57eec4d015 multithreaded collision fixes (#7311)
* rename misleading variable check_again to never_check_again

The first element of collision_result means "never check again" per the
typedef comment, but was destructured as check_again (opposite meaning).
Rename to never_check_again to match the actual semantics and prevent
future confusion.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix data races in ship-weapon collision threading

Two thread-safety bugs in ship_weapon_check_collision, which runs on
worker threads:

1. update_danger_weapon() wrote to Ai_info[] (danger_weapon_objnum,
   danger_weapon_signature) without synchronization. Multiple weapons
   targeting the same ship would race on the same Ai_info entry.

2. Homing missile detonation logic wrote wp->lifeleft and
   wp->weapon_flags directly on the Weapons[] global array.

Fix: defer both writes to the main-thread post-processing phase via
new flags in ship_weapon_collision_data. Also convert the collision
data from a 6-element tuple to a named struct for readability.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix data race in ship-ship collision submodel checking

ship_ship_check_collision() toggled pmi->submodel[].collision_checked
flags on the heavy ship's polymodel_instance to selectively enable/
disable submodel collision checks. When two collision pairs shared the
same heavy ship, worker threads would race on the same pmi entries.

Fix: add a collision_checked_override pointer to mc_info that lets
callers provide a thread-local array of collision_checked values.
model_collide() uses the override when set, falling back to the
pmi->submodel[] field otherwise. ship_ship_check_collision() now
builds a local SCP_vector<char> and passes it via the override,
completely avoiding writes to shared polymodel_instance state.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* Ensure threads have spun down before continuing non-threaded execution

* address review feedback for ship-weapon collision threading

- postproc flag now accumulates incrementally instead of being OR'd
  at the final return, ensuring all return paths respect it
- early return for predictive collisions now preserves the
  should_update_danger_weapon flag in the collision data
- moved nprintf detonation debug print to the main-thread process
  pass for thread safety

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* move collision_checked from pmi into mc_info for thread safety

collision_checked flags were transient per-collision-pass state that
didn't belong in the shared polymodel_instance. Now mc_info owns an
SCP_vector<char> that model_collide auto-initializes from pmi when
empty. All collision callers (ship-ship, asteroid, debris, prop)
updated to manipulate mc.collision_checked instead of pmi->submodel[].

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* Convert to CV and spinup counter

* Update comment

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: BMagnu <[email protected]>
2026-04-07 11:24:32 +09:00
Mike Nelson affd625262 fix menubar on windows (#7351) 2026-04-06 19:18:51 -04:00
wookieejedi 43a475a7e6 Merge pull request #7346 from MjnMixael/qtfred-about-dialog
Qtfred about dialog
2026-04-05 12:39:11 -04:00
wookieejedi c69a1aaa05 Merge pull request #7306 from notimaginative/multi_interp_fixes
Collection of fixes for multiple issues with the multi code found by Claude AI (by way of Goober5000), plus additional issues noted by myself while checking the code. These fixes are primarily focused on the interpolation code.

These changes should not be breaking and are largely exclusive to server-side handling, but still need to be tested thoroughly before being merged. Any tests must be done with at least the server (master) using the fixes.
2026-04-05 11:10:09 -04:00
Mike Nelson 41a8b18fad Qtfred visibility layers (#7314)
* add visibility layers

* save/load object layers using the mission file

* use fill

* fix rebase error
2026-04-04 09:11:55 -04:00
Mike Nelson f991bf14a8 Qtfred cleanup pass (#7345)
* set line edit fields to max length in code

* fix some dialog window titles

* remove unused context help button on Windows

* address some easy todo items

* static access
2026-04-04 09:11:31 -04:00
Mike Nelson de07dc6042 Qtfred settings dialog (#7316)
* working preferences dialog

* some cleanup

* clang ignore

* fix rebase issue
2026-04-03 14:03:07 -04:00
Mike Nelson f70d07a41e Qtfred general table viewer dialog (#7344)
* qtfred reusable table viewer dialog

* better error messages

char
2026-04-03 14:02:36 -04:00
Cliff GordonandClaude Opus 4.6 cfd9e0087c Fix multiplayer standalone crash: client stats race + host accept code (#7319)
* Fix multiplayer standalone crash: client stats race + host accept code

Fixes a crash in multiplayer PXO/tracker games hosted on a standalone
server where clients crash at debrief close after scoring a kill:

  pilotfile.cpp:295: Ship kills of '<ship class>' not found,
  should have been added by pilotfile::update_stats

Two independent root causes were found, both of which must be fixed for
correct behavior:

--- Root cause 1: race condition in multi_sexp_end_mission() (sexp.cpp) ---

The previous code called send_debrief_event() before
multi_handle_end_mission_request() as a "hack" to skip the warp-out
sequence when an end-mission SEXP fires. On standalone servers this is
a race condition: scoring_eval_kill only runs on the master, and the
master hasn't broadcast m_okKills to clients yet at the point
multi_sexp_end_mission() is called. Entering debrief this early causes
scoring_level_close() to run with zeroed m_okKills, so
Pilot.update_stats() creates no kill entries for that session.
When debrief_close() later calls scoring_backout_accept() it cannot
find those entries and hits the UNREACHABLE.

Fix: Remove the send_debrief_event() call entirely. The normal flow
via multi_handle_end_mission_request() has the server broadcast stats
first and then send MISSION_END, which causes the client to enter
debrief with correct kill data already populated. The master enters
debrief through sexp_end_mission() -> send_debrief_event() as before.

The behavioral side-effect of removing this hack: clients that go
through the normal warp-out sequence will no longer skip it on
end-mission. Clients in a state where they cannot warp still receive
immediate debrief via multi_handle_sudden_mission_end().

--- Root cause 2: host accept code never set on PXO standalone (multiui.cpp) ---

In multi_debrief_accept_hit() and multi_debrief_esc_hit(), when the
game is a PXO/tracker game and the local player is the game host
(NETINFO_FLAG_GAME_HOST), the code calls send_store_stats_packet() to
tell clients to record their stats. It then sets
Multi_debrief_stats_accept_code = 1 via the per-client response path
inside the NETINFO_FLAG_AM_MASTER block.

On a standalone server the game host is NOT the master
(NETINFO_FLAG_AM_MASTER is false for the client-side host). The
NETINFO_FLAG_AM_MASTER block is skipped entirely, and
send_store_stats_packet() uses multi_io_send_to_all_reliable() which
skips the local player — so the host never receives its own packet.
Multi_debrief_stats_accept_code stays at -1 (unset).

When debrief_close() checks this value and sees it is not 1, it
assumes stats were tossed or the window was closed without accepting,
and runs scoring_backout_accept() unconditionally. With fix 1 in place
this no longer crashes (entries exist), but silently strips all session
kill credit from the host's pilot record.

Fix: After the send_store_stats_packet() block, call
multi_debrief_stats_accept() unconditionally for the game host so the
accept code is set locally regardless of whether the host is also the
standalone master.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* Preserve end-mission warp-out skip via deferred debrief entry

The previous fix removed send_debrief_event() from
multi_sexp_end_mission() entirely, which was correct for the stats
race condition but had a side effect: clients would no longer skip the
warp-out sequence when an end-mission SEXP fires.  The warp-out skip
was an intentional feature — process_endgame_packet() checks whether
the client is already in debrief state and, if so, bypasses
multi_warpout_all_players().

Restore the original behavior by deferring the send_debrief_event()
call to process_endgame_packet() rather than eliminating it.
multi_sexp_end_mission() now sets Multi_sexp_end_mission_pending=true
before calling multi_handle_end_mission_request().  When the client
receives the MISSION_END packet, process_endgame_packet() checks the
flag, calls send_debrief_event() there, then falls through to the
debrief-state check which skips the warp-out exactly as before.

This is safe because send_endgame_packet() calls multi_broadcast_stats()
before sending MISSION_END.  Both use reliable delivery, so stats are
guaranteed to be received and applied before MISSION_END is processed,
meaning scoring_level_close() now sees correct kill data when
send_debrief_event() fires.

Alt-J-initiated mission ends are unaffected: the flag is never set,
so the warp-out proceeds normally for those paths.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* Revert multiui.cpp accept code change — tracker master owns stats

The previous change added multi_debrief_stats_accept() calls for the
game host in multi_debrief_accept_hit() and multi_debrief_esc_hit() to
work around Multi_debrief_stats_accept_code staying -1 on a standalone
server.  This was based on incorrect analysis.

In PXO tracker games the standalone master is intentionally the sole
authority for stat storage (via multi_fs_std_tracker_store_stats() in
multi_standalone_postgame_close()).  The host and clients must not save
stats to their local pilot files independently.  Multi_debrief_stats_
accept_code remaining -1 and triggering scoring_backout_accept() on the
host is correct behavior: kills are backed out of the local pilot file
because the tracker holds the authoritative record, not the local file.

The race condition fix (deferred send_debrief_event()) is sufficient to
prevent the crash: Pilot.update_stats() now creates kill entries with
correct m_okKills data, so scoring_backout_accept() can find and remove
them cleanly rather than hitting the UNREACHABLE.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* Move Multi_sexp_end_mission_pending from multiutil to multi and reset in multi_vars_init()

Addresses review feedback: the flag has no relation to multiutil, and
resetting it in multi_vars_init() ensures it is always cleared between
missions regardless of which code path was taken.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
2026-04-03 09:26:23 -04:00
Goober5000andClaude Opus 4.6 92a46c9dad Fix SEXP references for shifted waypoints after single waypoint deletion (#7337)
When a waypoint is deleted from a list, the remaining waypoints after it shift down (e.g. Path:3 becomes Path:2). SEXP and AI goal references were properly invalidated for the deleted waypoint, but were not updated for any subsequent waypoint to reflect the new numbering.

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-03 08:04:07 -04:00
Mike Nelson bca2721791 lab orthographic projection (#7336) 2026-04-03 08:02:41 -04:00
Mike Nelson 5acc748c2d Qtfred head ani picker (#7312)
* add head animation picker dialog for event messages

* get animations working

all previewing all head anis

cleanup

* reorganize files

* make these static

* no const

* more static

* updated var name

* missed one
2026-04-03 08:02:22 -04:00
Mike Nelson 54f0b410e7 Qtfred waypoint features (#7328)
* waypoint drawing features

* use ints

* parse and save as ints
2026-04-03 08:02:06 -04:00
Mike Nelson 9caec00b21 this goes here, silly 2026-04-02 16:13:31 -05:00
Mike Nelson 977db8ffa7 clang 2026-04-02 15:42:30 -05:00
Mike Nelson 170a4a82cc Add mission templates to QtFRED (#7320)
* add mission templates

* fix for unique_ptr
2026-04-02 16:42:22 -04:00
Taylor Richards 3f265054b8 add options to control rollback and fps on standalone
Adds multi.cfg options to allow easy tweaking of standalone servers to better handle mods
with faster ships and/or weapons that don't behave reliably with rollback or lower fps.
2026-04-02 16:31:57 -04:00
Taylor Richards 7d1983e74d fix log spam erroneously triggered by packet index fixes 2026-04-02 16:31:57 -04:00
Taylor Richards aef736643a fix ship whack sync issue in multi
Put ships getting whacked by weapons or other objects into simulation mode to avoid odd
position changes when client-side whacks get overridden by server interoplation updates.
2026-04-02 16:31:57 -04:00
Taylor Richards a7b29f339a use proper elapsed time for non-homing multi weapons
Fixes timing bug that used the wrong timestamp for primary and secondary weapon shots on
clients. This resulted in a discrepancy between client and server timing which caused weapon
shots to bypass the rollback system and become unreliable.
2026-04-02 16:31:57 -04:00
Taylor Richards f6db96a543 fix inverted interpolation scale
Could cause ships to jump backwards during position updates.
2026-04-02 16:31:57 -04:00
Taylor Richards ad356891f0 use the correct frame in reinterpolate_previous() 2026-04-02 16:31:56 -04:00
Taylor Richards 4ed03ad1d6 add safety checks and index updates to interpolation packet handling
Add safety checks for signal updates to avoid array boundary issues. And be sure to reasses
packet indexes when a new packet arrives instead of waiting a frame for index updates.
2026-04-02 16:31:56 -04:00
Taylor Richards d999d72065 add safety check for interpolation packet replacement 2026-04-02 16:31:56 -04:00
Taylor Richards 5a5082b4e9 fix crash if system_info is null 2026-04-02 16:31:56 -04:00
Taylor Richards 78fe2b5179 make sure to update client info interpolation frame 2026-04-02 16:31:56 -04:00
Taylor Richards bcf290877d fix afterburn hack and document why it's there
Afterburn hack is to fix trails and model animations getting triggered so that clients and hosts
see them. The hack needs to be reset before multi_oo_unpack_client_data() though, not after.

Fixes behavior that was broken in #2752
2026-04-02 16:31:56 -04:00
Taylor Richards 8dc0b724df continue processing ship records when gaps exist
If a ship is destroyed we still need to continue processing any other ships in the list.
2026-04-02 16:31:56 -04:00
Taylor Richards 396e065ad4 remove dead code for ai modes
The check was expanded and moved below this, but the old version remained.
2026-04-02 16:31:56 -04:00
Taylor Richards 041c9db2c5 add interpolation frame check for support ships 2026-04-02 16:31:55 -04:00
Mike Nelson 3d4502359b this goes here 2026-04-02 15:11:43 -05:00
Mike Nelson 4824a5d79c clean up the credits and styling 2026-04-02 15:03:30 -05:00
Mike Nelson 93fb8abaf0 make about dialog match qtfred styling 2026-04-02 13:58:25 -05:00
Mike Nelson 409421a0e4 Shared table viewer (#7235)
* Unify table viewer text loading across lab and editor UIs

* add some error messages
2026-04-02 08:00:28 -04:00
Goober5000 185b0f3dd4 Merge pull request #7296 from Goober5000/cleanup/weapon_spew_stats_refactor
refactor -weapon_spew_stats
2026-04-01 19:24:16 -04:00
Goober5000 e173fe17c6 Merge pull request #7341 from Goober5000/fix/mission_loop_music
fix mainhall music continuing to play during mission loop brief
2026-04-01 19:23:23 -04:00
Goober5000andClaude Opus 4.6 4a4ca20481 Fix crash when restarting mongoose server on Windows
mg_start() calls InitializeCriticalSection(&global_log_file_lock) on
every invocation, but mg_stop() never calls DeleteCriticalSection.
Re-initializing an already-initialized critical section is undefined
behavior on Windows and corrupts the heap, causing the next allocation
to throw an exception.

Make the Win32 initialization (WSAStartup + InitializeCriticalSection)
one-shot via a static flag, and remove the asymmetric WSACleanup from
mg_stop so resources remain valid across mg_start/mg_stop cycles.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-01 13:25:36 -04:00
Mike Nelson 95a7537b3d QtFRED mission stats dialog (#7333)
* qtfred mission stats dialog

* clang

* fix float division
2026-04-01 09:13:05 -04:00
Goober5000andClaude Opus 4.6 c745925821 fix mainhall music continuing to play during mission loop brief
When a player enters the mission loop screen from the main hall, there was no code to handle the stopping of main hall music and ambient sound.  Add code to handle this specific case.

Also fix `Loop_sound` not being initialized to -1 `in loop_brief_init()`, which caused an assert when closing the loop brief screen if no branch brief sound was defined for the mission.

Fixes #7330.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-01 00:34:35 -04:00
Goober5000 cc26887774 Merge pull request #7300 from Goober5000/cleanup/enhance_utility_h
enhance utility functions
2026-03-31 21:22:23 -04:00
Goober5000andClaude Opus 4.6 3c6df26da2 remove redundant waypoint position by delegating to the game object
The waypoint class stored its position in m_position separately from the game object's pos field, requiring callers to manually keep both in sync. Now get_pos() and set_pos() delegate to the object position when the game object exists, falling back to the parsed position only if the object does not exist.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-31 20:08:59 -04:00
Mike Nelson bd3855570b fix some issues with qtfred's ship list dialog (#7329) 2026-03-31 14:25:24 -04:00
Mike Nelson 7f61517aae Unified briefing map render paths (#7309)
* merged map rendering methods

* merge init and close methods

* nullptr

* assertions and nullptr

* fix comments
2026-03-31 10:07:34 -04:00
BMagnu 1f5525e04f Fix virtual POF crashes (#7327)
* Ensure model data isn't deleted twice

* shared_ptr-ify model data

* fix virtual pof filename issue

* Fix tests

* remove redundant memsets

* Clang Tid
2026-03-31 10:02:24 -04:00
BMagnu 7361417050 Cache Animation submodel by model id (#7331) 2026-03-31 00:41:01 +02:00
Taylor Richards 99585310b6 fix memory error when culling active games list (#7332) 2026-03-30 17:34:34 -04:00
wookieejedi 150b0c2d15 Fix targest nearest attacking ship in multiplayer (#7326)
* Fix `targest nearest attacking ship` in multiplayer

Pressing 'Target Nearest Attacker` in multiplayer does not work when a ship has spontaneously targeted another ship. This is because within, `multi_oo_pack_data` `goals[0].target_name` only covers explicitly ordered goal targets and is empty for spontaneous IFF-based engagements, which means `target_signature` does not return the proper value. This PR adds an extra check for that to pefer the live target_objnum so clients know who is actually being attacked.

Tested and works as expected.

* comment cleanup

* comment cleanup
2026-03-30 10:20:32 -04:00
Taylor Richards 96af51b56c fix error handling in libpcp to prevent endless loop (#7313) 2026-03-30 09:49:46 -04:00
Mike Nelson d3a8759257 Campaign Lua functions for branching (#7298)
* campaign lua functions for branching

* clang

* address feedback
2026-03-30 09:16:20 -04:00
Mike NelsonandBirk Magnussen 812769df7f Fix models rendering incorrectly when using RTT (#7239)
* Fix models rendering incorrectly when using rtt

* Add condition to depth attachment

---------

Co-authored-by: Birk Magnussen <[email protected]>
2026-03-30 15:06:47 +09:00
Mike Nelson 97a6c6314b Match editor wave thresholds to in-game limits (#7243) 2026-03-29 23:01:05 -04:00
Mike Nelson f2e8df4c69 Lua access to puncture flag status (#7323)
* lua access to puncture flag status

* disallow setting flag

* and don't grab the value even

* fix
2026-03-29 12:07:01 -04:00
Mike Nelson afc1db7563 Lab camera controls upgrade (#7219)
* Add lab panning controls and align to pof tools

* pan based on camera view coords not world coords

* reset view option

* change scrolling to use mouse wheel

* Better ui for controls reference

* clang
2026-03-29 08:04:03 -04:00
Goober5000 73715b823e Merge pull request #7317 from Goober5000/coverity/siof
Suppress Coverity GLOBAL_INIT_ORDER false positives for safe globals
2026-03-26 11:25:07 -04:00
wookieejedi 10ff64eb1d Tune ups for standalones (#7315)
* Tune ups for standalones

Fixes two warnings from building in standalone and also provide, also adds needed function to actually tell if game is in standalone mode.

* better fix for armor flags
2026-03-25 17:42:45 -04:00
Mike Nelson 240a9123c0 make fred's sound environment dropdown a full list (#7303) 2026-03-23 10:29:21 -04:00
Goober5000andClaude Opus 4.6 fa86575606 Suppress Coverity GLOBAL_INIT_ORDER false positives for safe globals
Add coverity[GLOBAL_INIT_ORDER] annotations to ~50 global variables
across 27 files. These were all analyzed and confirmed safe:

- ~48 OptionBuilder::finish() globals use a Meyers singleton
  (OptionsManager::instance()), which guarantees safe init order.
  Destruction is also safe due to shared_ptr ref-counting.
- 6 default-constructed container globals (vectors, maps) have no
  cross-TU dependencies at construction or destruction time.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-22 15:00:25 -04:00
Mike Nelson c2462d059a Qtfred viewport controls (#7304)
* fix viewport controls

* allow cancelling drag events

* reverse forward backward movement

* fix some bugs

* ensure main window retains focus

* combine namespaces
2026-03-22 10:52:15 +01:00
Goober5000 6a20c0f549 Merge pull request #7117 from Goober5000/anchor_refactor
refactor ship anchors
2026-03-22 02:59:47 -04:00
Goober5000 2690cb078f Merge pull request #7183 from Goober5000/fred_fractional_pbh
allow more granular background orientations
2026-03-22 02:59:37 -04:00
Mike Nelson 7adcf9fe14 track mission modified and prompt to save (#7305) 2026-03-21 11:46:21 -04:00
Mike Nelson ff28a9c38e fix HDR and Alpha issues in screenshots (#7294) 2026-03-21 11:41:45 -04:00
Goober5000 a56bded919 convert debriefing editor to modeless; add focus_sexp(); fix bugs
Convert `debriefing_editor_dlg` from a modal stack-allocated dialog to a modeless heap-allocated dialog, matching the pattern of the briefing editor.  Update FRED infrastructure accordingly.

Add `focus_sexp(int node)` to `debriefing_editor_dlg`, mirroring the existing method in `briefing_editor_dlg`.  Fix both `focus_sexp()` implementations to search all team debriefings/briefings instead of only the currently selected team, so nodes in non-zero teams are found correctly in TVT missions.

Fix `debriefing set_modified()` calls to only set the flag if the debriefing data actually changes, rather than every time the editor was opened.
2026-03-21 01:29:13 -04:00
Goober5000 77954055df allow more granular background orientations
Since bitmaps, suns, and skyboxes store their coordinates as floating-point numbers, we can allow mission designers to specify floating-point numbers in the FRED UI.  This PR modifies the dialogs in FRED and QtFRED to allow two decimal places for pitch, bank, and heading.

Implements #7170.
2026-03-20 15:02:03 -04:00
Goober5000 05054f89f6 Merge pull request #7222 from Goober5000/text_replacement_updates
consistent handling of text token replacement
2026-03-20 15:00:16 -04:00
Goober5000 b76e652e0c Merge pull request #7282 from Goober5000/const_char_lookup
assorted `const` fixes
2026-03-20 14:59:04 -04:00
Goober5000 a47d34c739 assorted const fixes
1. Change `ai_profile_lookup` and `multi_xfer_lookup` to use `const char *`, since all the other lookup functions do
2. Remove several unneeded `const_cast`s, some of which are now made possible by the non-const `data()` overload in C++17
3. Change `campaign_link` to use `const char*`
4. Use better string management in `test::FSTestFixture::init_cmdline()`
2026-03-20 11:33:54 -04:00
Goober5000 49f00019a7 enhance utility functions
1. Add optional `start_index` and `num_items` parameters to the find/count functions in utility.h.
2. Fix an accidental recursion bug.
3. Change appropriate parameters to `size_t` and cast appropriately.
4. Add two forms of `SCP_vector_contains_lcase`.
5. Enhance `sprintf` and add `sprintf_concat` for `SCP_string`.
2026-03-20 02:22:20 -04:00
Mike Nelson f01eec903a check, assert, and skip as needed (#7297) 2026-03-19 07:45:54 -04:00
wookieejedi 100b8971a1 Fix gr.drawOffscreenIndicator (#7295)
The scripted `gr.drawOffscreenIndicator` was missing a critical `resetClip();` which meant it was using whatever the previous stack's clipping distance was, and thus not draw in the actual correct location.

This 1 line PR fixes that and the fix works as intended.
2026-03-18 07:33:15 -04:00
Goober5000 ba1f11f80a Merge pull request #7280 from Goober5000/campaign_optional_string_fred
optional_string_fred fixes
2026-03-17 23:34:29 -04:00
Goober5000 7de18842ef Merge pull request #7291 from Goober5000/fix/misc-fixes
miscellaneous fixes
2026-03-17 23:34:16 -04:00
Mike Nelson b09f7a26ce Qtfred props support (#7240)
* Add props support and dialogs

* Enable prop navigation when no prop is selected

* no lint

* clang

* oops
2026-03-17 08:53:23 -04:00
Mike Nelson ca1634bb5d Lua isDockLeader function (#7286)
* lua isDockLeader function

* address nitpicks
2026-03-17 08:21:12 -04:00
Goober5000 50a4febe88 refactor -weapon_spew_stats
This splits out the stat calculation and MediaVP text generation into their own functions so that they can be used elsewhere.
2026-03-17 00:22:50 -04:00
Mike Nelson 7b4b544ee7 Unify parsing of this param between TTF and bitmap fonts (#7288)
* unify parsing

* allow both
2026-03-16 14:47:25 -04:00
Goober5000 fc48fac60e miscellaneous fixes
1. When loading and saving lighting profiles, treat an empty string as equivalent to the default name
2. Remove unused fields from the mission struct
3. Properly guard union initialization in `add_message`
2026-03-15 03:25:38 -04:00
Mike Nelson 8fb7a058e8 grant lua ability to force a ship to call for support (#7250) 2026-03-14 18:50:13 -04:00
Mike Nelson 6120f7e6d6 update librocket reference (#7283) 2026-03-14 13:53:28 -04:00
Kestrellius 2211945f2d Merge pull request #7281 from Kestrellius/det-range-optimization
Optimize detonation range and detonation radius checks
2026-03-13 23:41:14 -07:00
Goober5000 ce31a33029 fix persistent variables and containers (#7192) 2026-03-13 08:16:28 -04:00
Mike Nelson b4c98defc6 Fix incorrect param order (#7284) 2026-03-12 20:51:46 -04:00
Goober5000 52081e20e6 Merge pull request #7279 from Goober5000/fred_campaign_fixes
fix a few campaign editor bugs
2026-03-12 20:42:30 -04:00
Goober5000 5639662e12 Merge pull request #7273 from Goober5000/more_fred_fixes_b
more FRED fixes when dialogs pop up, part 2
2026-03-11 23:01:42 -04:00
Kestrellius df7413ad4f address review 2026-03-11 19:55:41 -07:00
Goober5000 0073532a70 more FRED fixes when dialogs pop up, part 2
Follow-up to #7272 to add props handling.  This allows the original PR to be merged separately to 25.0.1.
2026-03-11 22:25:10 -04:00
Goober5000 780de87c04 Merge pull request #7272 from Goober5000/more_fred_fixes
more FRED fixes when dialogs pop up
2026-03-11 22:22:08 -04:00
Kestrellius 1fc7dd1fc5 dist squared 2026-03-11 18:42:34 -07:00
Taylor Richards d6c1b36c56 fix issues with imgui backend/renderer cleanup (#7278)
If the graphics system fails to fully init for some reason then it's possible
for the imgui backend and/or renderer to not be initialized. Those subsystems
*must* be initialized before being shut down so we need to check for that to
avoid hitting assertions inside of imgui.

Also add a safety check for making sure that an imgui context exists before
attempting to initialize the backend/renderer. A simple assertion should work
for this as it would take a coder messing something up in order to trip it.
2026-03-11 21:06:03 -04:00
Goober5000 b9c0a1ddd6 fix a few campaign editor bugs
1. Properly initialize campaign links and elements so that stale values don't stick around from previously loaded campaigns.
2. Clear internal flag bits from campaign missions to prevent invalid state from being loaded from a campaign file.
3. Properly check the main hall when saving flags in retail format.
4. Clean up parsing and saving of mission loop data, which had been broken ever since retail.  Add compatibility checks for the old format.
2026-03-11 20:45:00 -04:00
Goober5000 cbb30f9d7e optional_string_fred fixes
Not using the return value from `optional_string_fred` triggers Coverity warnings, but it turns out those "consume token" blocks aren't actually needed.

While we're at it, make the token parsing a little more robust in campaignsave.cpp and clean up the newline behavior.
2026-03-11 13:20:37 -04:00
CRGorman 3c3a3850ca Apply a wait for named pipe after verification (#7275) 2026-03-10 04:38:40 +00:00
BMagnu 8438af20e9 Make window_res buffer have a stencil attachment (#7274) 2026-03-10 00:58:14 +01:00
Goober5000 fbf58703b4 Merge pull request #7271 from Goober5000/particle_fixes
particle fixes and subsystem speedup
2026-03-08 23:24:50 -04:00
Taylor Richards 78f60c6f15 fix AppImage setup for fso and qtfred (#7154)
- generate appimage for qtfred if it's available
 - separate fso and qtfred install roots
 - move fso appimage files out of global space
 - fix qtfred appimage launch script
 - prefer X11 Qt backend for qtfred
2026-03-08 23:11:12 -04:00
Goober5000 d8a6d68482 more FRED fixes when dialogs pop up
FRED can get into a weird state if a warning appears while a ship is being created, e.g. if the ship has a null moment of inertia.  So, prevent FRED from rendering a ship if it hasn't been fully initialized yet.
2026-03-08 22:50:13 -04:00
Goober5000 89e7fd91da particle fixes and subsystem speedup
1. Modify `ship_get_subsys_for_submodel` to use the subsystem indexer.  This changes the operation from O(n) to O(1) and also allows the function to work with turret gun barrels.
2. Add an `isValid` check to `ParticleSource::finishCreation` to prevent unknown state from being accessed if the source is not valid.
3. Tweak `EffectHostTurret` and make sure it works for fighter beams.
4. Prevent `createOnTurret` from running on submodels that are not turrets.
2026-03-08 20:15:02 -04:00
Goober5000 35ed88c57f make anchors type-safe, and adjust support_ship_info accordingly 2026-03-06 22:00:32 -05:00
Goober5000 33d5f7ed3c refactor ship anchors
Testing in FotG exposed a bug that dates back to retail.  During mission parsing, arrival and departure anchors were represented by indexes into `Parse_names`.  After parsing, they were converted to ship indexes -- but only in FRED.  Since some functions are shared between FRED and FS2, this can produce inconsistent results, which can be hard to detect since parse indexes and ship indexes are usually the same.

This refactors arrival and departure anchors to be represented by ship registry indexes in all cases.  It also adds conversion functions for the benefit of FRED and QtFRED since those dialogs were designed with ship indexes in mind.
2026-03-06 22:00:32 -05:00
The Force 14a900e554 Properly Invert flag check (#7270)
Fixes #7269
2026-03-06 14:09:52 -05:00
Mike Nelson ad03fa5900 Capture ImGui in screenshots (#7236)
* capture imgui in screenshots

* revert buffer changes

* request a screenshot for end of frame

* full revert for cleanliness
2026-03-06 07:47:28 -05:00
Goober5000 785bd36986 make clang-tidy happy 2026-03-06 00:03:00 -05:00
Goober5000 3aff98e5e3 preliminary cleanup for split_str_once refactor
String processing enhancement prerequisites for the upcoming `split_str_once` PR.

1. Add overloads of some string processing functions with a length parameter, to allow processing of substrings of C-strings
2. Add overloads of gr_printf that work with string lengths
3. Add constructors to `HUD_message_data` and `line_node`
4. Rename "size" to "len" in `vm_strndup` for clarity
5. Fill in some string attribute annotations
6. Make the rest of the HUD render functions `const`
7. Removed unneeded circular #includes in code/globalincs/memory/
2026-03-06 00:03:00 -05:00
Mike Nelson 8e23ce837f Add feature to customize how CMs are launched (#7224) 2026-03-05 15:15:56 -05:00
Mike Nelson f6588f802e allow repositioning the mainhall version strings (#7257) 2026-03-05 07:48:13 -05:00
Mike Nelson 21a3c80b45 Lua access to volumetric params (#7262)
* Lua access to volumetric params

* lua documentation error

* address feedback

* clang

* typo
2026-03-05 07:47:57 -05:00
BMagnu 5fc84d533d Actually load model if necessary (#7265) 2026-03-04 12:04:09 +09:00
Goober5000 ffa1bb2903 Merge pull request #7261 from Goober5000/fix_assert
fix waypoint list assertions
2026-03-02 23:25:16 -05:00
Goober5000 baf2f9521a fix waypoint list assertions
Followup to #7104.
2026-03-02 23:00:29 -05:00
Goober5000 1869b00af4 Merge pull request #7242 from Goober5000/props_missionsave
mission save compatibility
2026-03-02 21:53:44 -05:00
Mike Nelson e1d67cebbc Allow defining a default profile to use in non-mission rendering (#7238)
* allow defining a default profile to use in non-mission rendering

* Correct comment typo in lighting_profiles.h
2026-03-01 23:11:02 -05:00
BMagnu 252655cee5 Don't magic a model instance out of thin air (#7259) 2026-03-02 02:34:43 +00:00
Goober5000 e39a900223 Merge pull request #7241 from Goober5000/fred2_fixes
fix a FRED2 crash
2026-02-28 19:46:11 -05:00
Goober5000 135d84ebac Merge pull request #7255 from Goober5000/7104_followup
fix some waypoint bugs
2026-02-28 17:31:07 -05:00
Goober5000 482c5a5cc0 fix some waypoint bugs
1. The `waypoint_stuff_name` function used the wrong length when building the waypoint name, causing the number to be written past the end of the string in most cases.  Not sure how this escaped testing.
2. Change two Assertions, which had no effect due to the comma operator, to Errors, which match their counterparts in their respective functions.
3. Make `internal_error` consistent between the campaign editor, the mission editor, and qtFRED, and prune an unnecessary string copy.

Follow-up to #7104.  Fixes #7254.
2026-02-28 16:59:23 -05:00
Taylor Richards 31ad18fe3f fix portfwd issue when dealing with server response failures (#7252)
An upstream bug in libpcpnatpmp caused it to not pass along ping failure
messages in the internal state which then triggered multiple issues with
both the library itself and FSO. This fixes the bug in the pcp library
and takes care of the portfwd log spam issues in FSO as well.
2026-02-27 23:57:34 -05:00
Mike Nelson 5c2e5a261b Stop select model rendering destroyed subsystems (#7225) 2026-02-26 10:10:26 -05:00
Asteroth f23d35c7ec add scripted flight cursor sensitivity (#7149) 2026-02-25 08:30:42 -05:00
wookieejedi ff11370c56 Fix forever flashing threat gauge (#7247)
This one would be good for the upcoming point release, as on Stable 25.0, if your threat gauge is flashing during a mission and then you quit the mission and go to the HUD Config screen, then the gauge remains flashing.

This PR fixes that by simply not flashing the gauge while in configure mode. Tested and fixes the bug as expected.
2026-02-25 08:28:50 -05:00
BMagnu 7412e14575 Add Z-Compression shader to better use position buffer's FP16 (#7245) 2026-02-25 12:59:30 +09:00
Mike Nelson 8e44f355f0 Make sure to delete any dead objects before processing (#7223) 2026-02-25 00:48:28 +01:00
Goober5000 bbca63da8f Merge pull request #7185 from Goober5000/cannot_perform_scan_show_cargo
show and hide cargo variants of cannot-perform-scan
2026-02-24 00:14:48 -05:00
Goober5000 849acf200e show and hide cargo variants of cannot-perform-scan
The existing `cannot-perform-scan` flag prevents the cargo from being shown on the HUD, but some modders would like to see the cargo while still preventing a ship from being able to perform a scan.  So, this renames the existing flag to `cannot-perform-scan-hide-cargo` and adds a new `cannot-perform-scan-show-cargo` flag.  Compatibility code in both mission parsing and flag evaluation ensures that missions using the old flag will still work.

Note that if both `cannot-perform-scan-hide-cargo` and `cannot-perform-scan-show-cargo` are set, the former will take precedence.
2026-02-23 22:03:22 -05:00
Goober5000 2436ef2a3f Merge pull request #7129 from Goober5000/fix_scannable_ship_types
enhance and clean up scannable ship types
2026-02-23 22:00:34 -05:00
BMagnu 176330023c Add metatable to correctly handle FSO objects (#7190)
* Add metatable to correctly handle FSO objects

* Avoid infinite recursion
2026-02-23 09:56:15 -05:00
Mike Nelson 405de8d0f3 Allow setting custom gauges as message gauges (#7217) 2026-02-23 09:53:34 -05:00
Goober5000 512021d7f5 Merge pull request #7116 from Goober5000/ship_enhancements
some ship utility enhancements
2026-02-21 00:39:08 -05:00
Goober5000 c4efdfb77b Merge pull request #7104 from Goober5000/waypoint_stuff_name
add waypoint_stuff_name
2026-02-20 23:14:10 -05:00
Goober5000 418af70ea3 some ship utility enhancements
Add a useful function for getting a ship_info pointer from a ship registry entry.  Also rename `ship_has_dock_bay` to `ship_has_hangar_bay` for clarity, since docking bays and docking points are not the same thing.  Finally, add a `model_has_hangar_bay` function.
2026-02-20 23:11:07 -05:00
Mara van der Laan 239e0274ee io: Fix crash on SDL joystick disconnect (#7216)
Check that `pJoystick[i]` is non-null before dereferencing it.
2026-02-20 09:12:08 -05:00
Goober5000 82e50f82c1 Merge pull request #7155 from notimaginative/prebuilt_download_fix
stop download of prebuilt libs when using override
2026-02-19 13:00:05 -05:00
Goober5000 0666749ab6 mission save compatibility
Make sure that missions without props will still be compatible with earlier mission file formats.  If props are included, bump the mission file version.  Also, fix some newline behavior in the save code.
2026-02-19 09:54:26 -05:00
Mike Nelson e05bf3c3c7 Make sure we actually set old_class when changing classes (#7221) 2026-02-19 08:17:53 -05:00
Mike Nelson 125377f362 do not reset lab state when going to options (#7226) 2026-02-19 08:17:22 -05:00
Mike Nelson 6ae95c663b fix edge cases for mission background loading in the lab (#7237) 2026-02-19 08:16:53 -05:00
Goober5000 3763a29b16 Merge pull request #7098 from Goober5000/utility_enhancements
several utility enhancements
2026-02-19 00:31:45 -05:00
Goober5000 1832fa0397 fix a FRED2 crash
Fix a crash caused in part by some missing UI calls in FRED2 and in part by subtle object life cycle issues.  Depending on whether FRED receives the focus during mission load (which can happen if the autosave dialog appears) it could access props that were in the process of being cleaned up but were still referenced.  This isn't specifically a props issue; it could happen to any FSO object stored in a SCP_vector, since the vector can be cleared.

The quick mission init is to prevent a whole bunch of unnecessary and risky processing during a transient loading state, but it has the nice side effect of making mission list loading noticeably faster.
2026-02-19 00:29:53 -05:00
BMagnu e827011113 Particle source duration curve + life remaining input (#7231)
* Add curve to control the duration of a particle source

* Also add fractional Life Left curve input for sources

* Actually register new particle curve output
2026-02-17 12:09:13 +01:00
Mike Nelson 4fbfa84c6e fix logic checking for invalid ship or prop (#7232) 2026-02-16 17:07:41 -05:00
Mike NelsonandAsteroth 070a8e18fa Adds Props as a new object type (#6836)
* First draft of prop object type

* Add prop editor dialog in FRED

* prop sexps

* lua table prop support

* lab support

* lua mission access to props

* prop collision support

* use std::optional so the object->instance id is always valid

* allow props to block suns

* minor cleanup and remove arbitrary limit. Still limited to 500 objects.

* Sort props by category

* cleanup

* implement collision hooks

* parse prop flags and further ensure props are inited and closed correctly

* Add Cyborg's multi suggestions

* fix missing header

* add props to empty slots if available

* add multi signature

* fix rebase issues and match collisions to the new multithread style

* appease Clang the Conquerer

* save/parse mission prop classes by name

* Clean up comments and finish TODOs

* fix string errors

* clang wants this to be static now

* address feedback

* address feedback

* Use model num from prop info instead

* merge prop and ship collision group sexps together

* fix rebase bug

* address feedback

* fix name shadowing

* ship heavy submodel

* clang

---------

Co-authored-by: Asteroth <[email protected]>
2026-02-16 14:41:34 +01:00
Mike Nelson 37df4ba479 QtFRED Generalized Mission/Campaign Save (#7045)
* Generalize mission save from original FRED

* make qtfred use the new generalized missionsave

* split campaign save into a sister class

* allow unlimited campaign description length to be saved

* have the campaign editor pass the links to save properly

* cleanup

* future todo

* fixes

* more fixes

* cleanup vars

* clang

* add missing guardian threshold and fix var name

* more clang

* conflict resolution error

* update qtfred to use the new campaign save
2026-02-15 07:38:55 +01:00
Goober5000 7277fc11ff Merge pull request #7186 from Goober5000/ship_class_display_name
make ship and weapon class display names SCP_string
2026-02-14 21:23:50 -05:00
Goober5000 2e6b38ee06 Merge pull request #7204 from Goober5000/asteroid_debris_iterators
add getAsteroidList and getDebrisList script API iterators
2026-02-14 21:23:40 -05:00
Goober5000 b341e85e55 fix a few SEXP tree problems with variables and containers (#7203)
1. Add default strings for variables and containers, providing something more appropriate than `<new default required!>`.
2. Replace the `Assert` in `add_default_operator` with a check for a valid variable index.  This prevents a crash if FRED adds an operator that takes a variable as an argument and there are no variables in the mission.
3. Add the correct variable type to `get_listing_opf_variable_names()` to fix SEXP tree construction in certain circumstances.

Apply the same fixes to QtFRED as well.
2026-02-13 08:53:57 -05:00
Goober5000 c193a920d0 several utility enhancements
These were coded for the `split_str` refactor, but are generally useful elsewhere as well.

1. Use SCP_string in some utility functions where appropriate
2. Avoid copying C-strings in some utility functions where it isn't necessary
3. Add concat functions to `SCP_vector`
4. Change return type `int` to `bool` on some common parselo functions
5. Add `find_white_space` and `find_gray_space` parselo functions
2026-02-13 01:10:01 -05:00
Goober5000 68075dfbd5 consistent handling of text token replacement
Just as special tokens are replaced in debriefings, replace them in command briefings and briefings as well.

Change `string_replace_tokens_with_keys` to `message_translate_tokens` (since it's the same thing) and add a `replaceContainers` script API function to complement `replaceVariables` and `replaceTokens`.

Also replace every category of token in `sexp_modify_variable` and add comments to places where token replacement might be expected but happens elsewhere.
2026-02-13 00:56:41 -05:00
Goober5000 c428a22150 Merge pull request #7097 from Goober5000/snprintf_size
fix the size parameter of snprintf and vsnprintf
2026-02-13 00:50:38 -05:00
Goober5000 f78ac499e2 Merge pull request #7195 from Goober5000/timestamp_elapsed_fix
fix two timestamp bugs
2026-02-12 00:23:41 -05:00
Asteroth 1a7ee078f9 assume beam and shockwave creation is falliable (#7174) 2026-02-11 07:54:03 -05:00
Goober5000 ddb50fbbc9 Merge pull request #7207 from Baezon/start-loop-end-snds-fix
Misc fixes to start/loop/end sounds
2026-02-11 00:59:09 -05:00
Goober5000 2d4ca569be Merge pull request #7113 from Goober5000/zero_rad_skip_fireball
add Zero_radius_explosions_skip_fireballs
2026-02-11 00:56:18 -05:00
Goober5000 a0b6e1a0e2 Merge pull request #7115 from Goober5000/configurable_sets
configurable sets
2026-02-11 00:55:52 -05:00
Mike Nelson c51c5a3b0c don't assert for scripted animations (#7209) 2026-02-10 12:18:14 -05:00
BMagnu 0f45fa8209 Fix change ship class edgecases (#7210)
* Clear Decals and Recreate Model instance

* Also reset the PMI if the new model has no cockpit
2026-02-10 12:17:39 -05:00
BMagnu 6c67f348ac Bump version to 25.1 (#7215) 2026-02-10 05:29:40 +00:00
Goober5000 38c28d2c6f Merge pull request #7099 from Goober5000/filtered_sexps_speedup
filtered SEXP operator speedup
2026-02-09 21:19:51 -05:00
Goober5000 cc82766a11 Merge pull request #7112 from Goober5000/splodeing_removal
remove the splodeing code
2026-02-09 21:18:22 -05:00
Goober5000 427ab77b0a Merge pull request #7107 from Goober5000/unicode_enhancements
upgrade Unicode `text_iterator` for C++17
2026-02-09 21:14:44 -05:00
Asteroth d313cf8ca6 copy paste error 2026-01-30 00:40:46 -05:00
Asteroth 42e85df9f9 use obj snds for start and end too 2026-01-30 00:14:27 -05:00
Asteroth c47e0826e7 misc fixes to start/loop/end snds 2026-01-29 19:28:17 -05:00
Goober5000 73dd6c04e6 remove unneeded detour into Objects array 2026-01-29 01:34:13 -05:00
Goober5000 72f57ffe93 add getAsteroidList and getDebrisList script API iterators
These are similar to the existing iterators for in-game objects.
2026-01-29 01:34:13 -05:00
wookieejedi 5eea353952 Fix Select All HUD Color Slider (#7202)
#6670 added support for custom gauges and also cleaned up the color setting of hud gauges when using 'Select All'. It seems two copy paste bug slipped through the cracks (ie the order of colors was copied from red to blue/green, when really the order should have been updated).

This PR restores the proper order and fixes the bug.
2026-01-26 23:05:08 -05:00
wookieejedi 319e573637 Fix #7199 (#7200) 2026-01-25 19:37:08 -05:00
BMagnu 83f08291af Rollback insignia fix (#7196)
* Revert "Move insignia post-processing to model load"

This reverts commit 665d7145b6.

* Revert "Cleanup of old insignia stuff"

This reverts commit fdf98a1f3a.

* Revert "render insignias as decals"

This reverts commit 24cdeb3c95.

* Isolate reverts to insignias

* Fix oversight

* clang tidy
2026-01-23 11:11:47 -05:00
Goober5000 66a07fe0e1 fix two timestamp bugs
A timestamp set to 1 means an immediate timestamp, and so the `int` version of `timestamp_elapsed` should account for that, just as it does in the `TIMESTAMP` and `UI_TIMESTAMP` versions.  Normally the number comparison means the check will still work, but during mission initialization the timestamp code is not running.  This caused destroy-before-mission ships to be added to the arrival list when they shouldn't have been.

Also fix logic in `timestamp_elapsed_safe`, where the `TIMESTAMP` and `UI_TIMESTAMP` versions were correct, but the `int` version had a bug dating back to retail that caused it to return true for uninitialized (zero) timestamps rather than false.  Practically speaking, this fix has no effect because the function is only used in multiplayer and none of the instances use integer-0 to indicate uninitialized, but this will at least fix any uses in the future.
2026-01-21 00:06:25 -05:00
Asteroth 2813ceb5e9 Fix for ships blowing up with live debris submodels (#7139) 2026-01-20 08:32:03 -05:00
wookieejedi a2c05009dc Fix asteroids toggling (#7188) 2026-01-15 23:15:31 -05:00
Daniel Cazares 2af0aefd91 fix(eye): guard missing model instance (#7180) 2026-01-15 23:15:17 -05:00
wookieejedi d9a6330d9e Fix regression from #7051 (#7191) 2026-01-15 23:14:23 -05:00
Mike Nelson 634eece877 make this check less stringent (#7182) 2026-01-15 23:13:43 -05:00
Goober5000 add9c46868 configurable sets
Add the ability to configure the `less` operator for `SCP_set`, `SCP_map`, and so forth.  Add comparison operators to the type-safe `ID` class so that it can be used with these data structures.
2026-01-10 13:10:05 -05:00
Goober5000 b4d9c3e9c4 make ship and weapon class display names SCP_string
All other display names are `SCP_string`, so make these `SCP_string` as well to be consistent and to allow arbitrary-length display names.

Also fix a few infelicities with German translation and the script API.
2026-01-05 23:13:35 -05:00
Daniel Cazares e5c4c58eba fix(graphics): measure ellipsis before shrinking in force_fit_string (#7165)
* fix(graphics): measure ellipsis before shrinking in force_fit_string

* chore(comments): clarify why ellipsis measurement is needed before shrinking
2026-01-03 19:33:40 -05:00
wookieejedi e567ae7c81 Fix warning of unbound keys for newer controls (#7173)
* Fix warning of unbound keys for newer controls

Under some circumstances, FSO will warn the player if a key is unbound if that they need to press to complete a training event. This logic though only works for keys with XSTRs from 507-619. Any control that was added with a different XSTR will not be picked up correctly, and thus the message displayed to the player will be incorrect, confusing, and not helpful.

To fix this `missiontraining.cpp` around line 757 needs to account for the newer controls as well.

This PR adds those needed checks, and this fixes the issue. This fix is especially needed for mods that use training missions with newer controls such as FotG. Note, we do ship with a full default controls table with all the needed keys bound, but we have found players will be players and simply change all their controls before even starting the training missions. Thus they unbind key training controls, and with this bug they are unable to correct their controls. With this fix they are properly able to update their controls as needed to complete the training missions.

Fixes #7172.

* var name update
2026-01-03 18:19:10 -05:00
Kestrellius 46d3e490bb Render reorder (#7177)
Move the rendering of ships with effects to immediately after rendering of ships. This fixes rendering in several edge cases where, currently, additively-rendered items, among others, are incorrectly obscured by ships with effects. This affects anything that doesn't render to the depth buffer -- nebula poofs, particles, lasers, beams, engine glows, etc.

Forward-rendered objects (due to transparency) still interact incorrectly with full nebula fog, but that's out of scope for this PR.
2026-01-03 15:37:28 -05:00
Daniel Cazares 4dfdddf4d2 fix(model): capture driver inputs by value (#7163) 2025-12-28 05:14:22 +09:00
Mike Nelson 1da50c738f medal display name should be distinct from name (#7148) 2025-12-26 19:14:36 +09:00
Daniel Cazares a8f4be1d34 fix(math): correct vector assignments in vm_vector_2_matrix_gen_vectors (#7162) 2025-12-26 19:14:24 +09:00
Goober5000 306f34a574 update force_fit_string and bounds in calling functions (#7161)
Rewrite `force_fit_string` to be more robust and to remove the potential for memory access violations.  Also audit all of the length parameters in the calling functions - some of them were the buffer size, not the length.  This should fix the mysterious crash in the mission log screen.
2025-12-25 08:08:46 +09:00
Taylor Richards fb52a8861e fix fullneb lightning glows (#7153) 2025-12-23 07:10:16 -05:00
Goober5000 587e6f4c21 Merge pull request #7150 from notimaginative/macos_ninja_ci_fix
fix macOS ci warning regarding ninja
2025-12-22 23:17:46 -05:00
Goober5000 06d1514a47 Merge pull request #7151 from notimaginative/cmake_path_variable_fix
replace FILEPATH with PATH where appropriate
2025-12-22 23:17:06 -05:00
Goober5000 f483a92329 Merge pull request #7152 from notimaginative/macos_debug_flag_fix
disable compiler optimizations on Mac debug builds
2025-12-22 23:15:09 -05:00
Goober5000 db69cb8395 Merge pull request #7157 from Baezon/uvec-dominant-frame-of-ref
Uvec dominant frame of ref for submodels
2025-12-22 23:14:08 -05:00
Asteroth e803d8a0e9 move some stuff 2025-12-21 23:36:25 -05:00
Asteroth 761b97529a comments and assertions 2025-12-21 22:12:28 -05:00
Asteroth 1cd45aa1b4 uvec dominant frame of ref for submodels 2025-12-20 20:53:54 -05:00
Taylor Richards 542b3d3643 stop download of prebuilt libs when using override
Fix bug where prebuilt libs were downloaded even when an override was used.
2025-12-19 03:09:20 -05:00
Goober5000 5f110962e3 use pm->autocenter when drawing weapon lines (#7147)
In the weapon loadout screen, the model's visual center should be taken into account when calculating coordinates for weapon banks.  Fixes #7145.
2025-12-19 17:01:16 +09:00
Taylor Richards 0dea8d2904 disable compiler optimizations on Mac debug builds
Clang treats -Og the same as -O1, which prevents the viewing of many variables
while debugging, so we need to use -O0 directly.
2025-12-19 02:46:18 -05:00
Taylor Richards 381eda672b replace FILEPATH with PATH where appropriate
Fix issue setting path cmake variables in the gui due to the incorrect
type being specified.
2025-12-19 02:44:21 -05:00
Taylor Richards cbf2693d33 fix macOS ci warning regarding ninja 2025-12-19 02:39:18 -05:00
Goober5000 6c96d12133 slight fix to "Always save display names" (#7146)
A ship which has a display name and belongs to a wing will display that name no matter what wave it appears in.  Since this should only be done when the mission designer deliberately wants it to be done, omit this case from the cases covered by the "Always save display names" feature.  (To always save a display name in this case would require saving one for the wing, but a wing display name feature does not yet exist.)

Fixes #7140.  Followup to #6810.
2025-12-15 15:50:09 -05:00
BMagnu cb3819309b Make sunglows respect detail boxes (#7141)
* Add flag to respect detailboxes in model collide checks

* Don't check detailboxes that are invisible for sunglare checks

* Use local coords

* Actualyl also run the check for cockpits & show ship

* Be less stupid
2025-12-13 11:15:23 +01:00
wookieejedi 8fb0cbe08c Fix Message Line Positioning (#7144)
Message Lines were not being rendered to the proper position for certain resolutions per issue #7143.

#6575 seemed to be the commit it broke on, and looking at that commit it showed that code added `x` and `y` to the render string positions, even though `x` and `y` did not exist there before.

This 1-line PR fixes that issue, and it is confirmed to fix the issue by KamiGaAtaeta. Also I checked and on more standard resolutions the message lines still display as expected in both mission and the HUD Config screen.
2025-12-12 23:16:57 +01:00
Kestrellius ce0fe088eb Fix 'on edge' parameter for ring volumes not doing anything (#7142) 2025-12-11 01:30:52 +00:00
wookieejedi 86ef459cf6 Fix shadow shader for Mac (#7138)
Turns out Mac shader does not support the cleaner bracket style
2025-12-07 18:30:55 -08:00
Kestrellius cb19fecc36 Fix culling for particles that have length (#7136)
* fix culling

* further check

* rotate check

* fix error

* bithackery
2025-12-05 13:29:56 +09:00
wookieejedi af7bb154d3 Fix shadow shader update oversight (#7135) 2025-12-04 21:03:46 +01:00
wookieejedi 937091ee77 Fix haloing in cockpit shadows (#7134)
* Fix haloing in cockpit shadows

Cockpits can use shadows, but the small geometry of cockpits and the current shadow pass methods result in bad looking shadow halos and poor quality. The issue is that small scale geometry, like cockpit struts/pillars, cast overlapping shadows--and these overlapping shadows need to use a different shadowing method then the default larger external shadows.

I made a small edit the to the shadows file to fix it for small scale shadows (external shadows, IE those at longer ranges, remain using their method since that method works better at longer ranges). In FotG we have been using this update for years and it works very well.

KamiGaAtaeta was having these halo issues on the FS Ship Interiors project, and this shader update fixed those issues. Thus, per suggestion from Lafiel, I'm PRing this fix so everyone can easily use it.

* remove dead code
2025-12-03 23:59:38 +01:00
BMagnu dd0add946b load single frame motion debris from the correct file name (#7133) 2025-12-03 14:03:59 +00:00
BMagnu 2e4d97ce4e Properly initialize max_life when no lifetime is available (#7131) 2025-12-02 12:15:36 +09:00
Goober5000 32c07ef847 enhance and clean up scannable ship types
The `$Scannable` field in objecttypes.tbl controls whether a ship can be targeted by the "target unscanned ship" key.  This is independent of which ship types can actually be *scanned*, which is not connected to any field in objecttypes.tbl.

So, this PR renames the `$Scannable` field to `$Targetable as unscanned:` to be clearer about what it actually does, and it adds the missing counterpart `$Scannable by default:` flag to specify which ship types can actually be scanned.

Note that this is only relevant for legacy scanning behavior.  Mods which use `$Unify scanning behavior:` do not need either of the ship type flags.
2025-11-29 13:48:46 -05:00
Goober5000 88c3cea753 fix scannable ship types (#7130)
The `$Scannable` field in objecttypes.tbl controls whether a ship can be targeted by the "target unscanned ship" key.  In retail, these were cargo containers and freighters.  This is independent of which ship types can actually be *scanned*, which in retail were cargo containers and *transports*.  Since the targetability is meaningless without the ability to scan, this fixes the retail inconsistency by moving the targetability from Freighter to Transport.

Note that this is only relevant for legacy scanning behavior.  Mods which use `$Unify scanning behavior:` do not experience the inconsistency.
2025-11-29 12:02:13 +01:00
wookieejedi 4d184d501a Two 1-line fixes for new particle lights (#7125)
* Two 1-line fixes for new particle lights

This PR provides 2 semi-fixes for the particle lights with 2 simple conditionals.

------------
First, it fixes #7124. In sum, it fixes the issue that new particle lights not affected by light quality slider. This fix is done by adding a conditional check so that particle lights only render when weapon lights do, at the highest lighting setting. This ensures that lower end machines can properly turn off particle lights to help with performance.

------------
Second, this PR adds an extra conditional to ensure that the system does not attempt to render particle lights if the radii is <= 0.

Light emitters logically do not cast light if the light emit radius is <= 0. In 2015, there are assertations in each of the `light_add` functions that trigger if the radii are <= 0.

With the new particle lights and addition of curves for particle lights, this can make result in light radii <= 0. This approach is useful to allow things like hit effects to only give off light if the hit effect is large enough (IE if it hits a large ship scale the radii to be larger, and if it is too far away or a small ship scale the radii to 0). So, in those situations of <= 0 light radii, the modder would expect that the light point is just not shown and simply not attempted to be rendered. Unfortunately, this is not quite the case, as any light radii <= for particle lights will trigger the assertation within the `light_add` functions.

The fix for this is simply to have early conditional checks for light radii. There is already precent for this in the code in 3 locations--1) within the weapon light code in `object.cpp` line `1365`; 2) within the beam light code in `beam.cpp` at line `2009`; and 3) within the fireball light code in `object.cpp` line `1457`. Note these sections also early out if the light intensity is <= 0 as an optimization step, which also makes sense.

This PR simply follows that precedence for particle lights by adding an early out if the light radii are 0. This allows modders to properly use a range of radii and helps ensure internal consistency with the code mentioned above that already does this early out for weapon and beam lights.

----------
Given the benefits listed above, having this PR in before stable would be fantastic (or a relatively quick point release after stable).

Tested and fixes the issue as expected. Happy to answer any questions and/or discuss!

* comment signpost
2025-11-26 22:38:26 +01:00
BMagnu 702e8f430d Fix rendertargets being incorrectly invalidated (#7126) 2025-11-26 22:38:17 +01:00
Goober5000 5941d5ed8b Merge pull request #7123 from Goober5000/ship_cleanup_tweak
tweak ship_cleanup
2025-11-21 20:05:13 -05:00
Goober5000 879b1f43ad Merge pull request #7121 from Goober5000/fix_font_crash
fix a font crash
2025-11-21 20:04:56 -05:00
Goober5000 fff480e101 tweak ship_cleanup
The object and ship indexes held by the ship registry do not actually need to be cleared until `ship_cleanup` completes.  This will allow the ship to be referenced in any functions (via script hooks or otherwise) that are called during cleanup.

Tweak related script documentation while we're at it.

Follow-up to #7120.  Fixes #7122.
2025-11-21 02:32:20 -05:00
Goober5000 406f8e58ca fix a font crash
The `setAutoScaleBehavior` function call should go after the null check to prevent crashing FSO if the font fails to load.

Also, if a font fails to load, skip over it so that subsequent fonts can be parsed.
2025-11-20 21:16:22 -05:00
Goober5000 2af19b6605 Merge pull request #7120 from Goober5000/scripting_ship_access
remove ship_name_lookup in scripting code
2025-11-16 13:10:57 -05:00
Goober5000 59e8742c84 remove ship_name_lookup in scripting code
Use the ship registry rather than `ship_name_lookup`.  Also, be sure to check that ships, targets, and subsystems exist.

Fixes #7109.
2025-11-16 02:41:24 -05:00
Goober5000 849a4f6d4e Merge pull request #7118 from Goober5000/reuse_sound_handles
reuse sexp audio handles
2025-11-15 14:42:51 -05:00
Goober5000 8c4849aaee reuse sexp audio handles
The `play-sound-from-file` sexp did not have any way to automatically recycle audio handles, instead relying on other sexps to explicitly close them.  It is more modder-friendly to implicitly free any handles of streams that have finished playing, so this PR adds that capability.  It also adds a Warning in the event that an unused audio handle cannot be found.

Fixes #7108.
2025-11-14 18:02:32 -05:00
Goober5000 a06da31c6a Merge pull request #7114 from Goober5000/quick_anchor_fix
quick fix to arrival anchor bug
2025-11-12 22:27:47 -05:00
Goober5000 77c7569f68 quick fix to arrival anchor bug
Fix the wing arrival anchor check when ships are cleaned up.  This resolves bug #7110.  A more comprehensive refactor will be done post-25.0.
2025-11-12 21:42:22 -05:00
Goober5000 adfb8200a5 remove the splodeing code
This dates back to commit `300d5fc2c1`.  It probably did something at some point, but with various upgrades over the years, it no longer has any effect.

It looks like a lot of the model interp code (e.g. `model_interp_defpoints`, which isn't called anywhere) can be removed as well, but that's a bit more involved.
2025-11-12 03:47:28 -05:00
Goober5000 8d7a56c3a8 add Zero_radius_explosions_skip_fireballs
Addresses a behavior idiosyncrasy encountered by Solaris.  If this flag is enabled, explosions with a visual radius of 0 do not have fireballs created, and do not have the fireball lifetime added to the explosion lifetime.
2025-11-12 02:17:25 -05:00
BMagnu fb229ccbb1 Fix texture slot 0 incorrectly being considered invalid in a lot of cases (#7106) 2025-11-06 09:34:03 +09:00
Goober5000 395d434f59 upgrade Unicode text_iterator for C++17
Add member types, tweak function signatures, and add a couple functions
2025-11-05 00:13:29 -05:00
Goober5000 1dc68b28c2 add waypoint_stuff_name
A consistent friendly way to get a waypoint name.  Follow-up to #7103.
2025-11-02 01:00:57 -04:00
Goober5000 be2045013b Merge pull request #7103 from Goober5000/fred_waypoint_names
fix FRED and QtFRED handling of waypoint names
2025-11-02 01:00:12 -04:00
Goober5000 5659243766 Merge pull request #7100 from Goober5000/message_log_add_seg_fix
fix multi-line display in mission log
2025-10-31 22:18:48 -04:00
Goober5000 6d03ce1c13 make clang happy 2025-10-31 21:12:49 -04:00
Goober5000 cb3a17a404 fix FRED and QtFRED handling of waypoint names
First, fix a crash reported in Discord: prevent FRED or QtFRED from giving a waypoint list a name that is too long.

Also fix the updating of references, including for the constituent points, if a waypoint list is renamed.
2025-10-29 00:24:09 -04:00
Goober5000 f4a3a885dd fix multi-line display in mission log
At some point the mission log became unable to display entries that wrapped around to subsequent lines.  Fix that by keeping track of how many lines each entry occupies and adjusting the display accordingly.

This will correctly display mission log segments on multiple lines, but it uses the current string splitting technique which does not split properly in all cases.  The splitting will work properly once the `split_str_once` refactor is merged.
2025-10-26 00:13:37 -04:00
Goober5000 5b4a4dd5cc filtered SEXP operator speedup
Improve the speed of the SEXP filter by not redrawing the combo box until the box is fully populated.
2025-10-25 13:11:55 -04:00
BMagnu 1fe175b523 Make FSO not crash if invalid options get displayed (#7096)
* Make FSO not crash if invalid options get displayed

* Add release warning
2025-10-24 00:45:23 +02:00
Goober5000 5f8e2c9475 fix the size parameter of snprintf and vsnprintf
These functions accept a size parameter that *includes* the null terminator, so tweak function calls accordingly.
2025-10-23 12:41:44 -04:00
Goober5000 2ceb523954 Merge pull request #7089 from z64555/issue_7088
Adds doxy and warnings to control_used() and check_control_used()
2025-10-17 12:36:04 -04:00
wookieejedi 349b353bbe Fix 'has parent' case for apparent size input curve (#7094)
Thanks for lafiel for catching this: the "has parent" case of that #7090 needs to account for the parents rotation
2025-10-17 12:30:02 +00:00
Kestrellius c0cc43f558 add input (#7090) 2025-10-17 07:43:50 -04:00
Asteroth c3980b7aa6 patch split_str_once (#7093) 2025-10-17 15:26:29 +09:00
Asteroth 5d78e3ee63 Temporary perpetual shudder (#7092)
* perpetual shudder should only last for the mission

* reset other variables too
2025-10-17 00:44:41 +02:00
wookieejedi 38acf9ae15 Allow mods to easily tune 'Target Hostile Bomb or Bomber' control (#7048)
* Allow mods to easily tune 'Target Hostile Bomb or Bomber' control

The `Target Hostile Bomb or Bomber` control targets bombs or bombers, though in mods may want a way to easily set exactly what this control does while still leveraging the utility of the 'bomb' flag for weapons and/or 'bomber' flag for ships (both of which affect AI behavior in various ways).

For example, in Solaris, Darius wants a way a way to allow players to only target bombs, while still allowing ships to be classified as as 'bomber'. In this case, the 'only bombs' option can be used. This PR adds a `$Behavior for pressing 'Target Hostile Bomb or Bomber' control:` to allow mods to set the behavior to `default` `only bombs` or `only bombers`.

For example, in FotG we want to allow players to target just bombers, as bombs themselves are hard to shoot down (critically though we still want the player to be able to manually target a bomb via 'target object in reticle'. This allows players to prioritize and easily target bombers while allowing skilled pilots to retain the option of manually shooting down bombs if they want an extra challenge. In this case the 'only bomber' option can be used.

Tested and works as expected in all cases.

* update using cleaned up function

* extra alt option for default case

* warning cleanup

* update default message

* whitespace clang

* appease clang with brackets
2025-10-15 16:47:45 -04:00
z64555 10cdf2d367 Add some more doxy, since we're here 2025-10-15 09:08:31 -05:00
z64555 d84600356a Adds doxy and warnings to control_used() and check_control_used() 2025-10-15 08:52:44 -05:00
wookieejedi a0b4ae1a2e Mouse Wheel Cleanup Option (#7079)
* Adds an optional bool to `mouse_down()` for `must_be_mousewheel` to only process mousewheel events.
* Used within `controlsconfig.cpp::check_control_used()` to handle a special case with the mousewheel to allow using it for `CC_TYPE_TRIGGER` controls.
2025-10-15 08:27:35 -05:00
Taylor Richards 6a9b6a38e9 fix several uninitialized variable warnings (#7087)
Initialize structs as appropriate in PXO and mdns code that were reported by
gcc/clang/coverity.
2025-10-14 13:51:53 -04:00
Goober5000 ea985b6455 Merge pull request #7081 from Goober5000/wing_destruction_updates
add flag to automatically cancel future waves if a mothership is destroyed
2025-10-13 22:51:04 -04:00
wookieejedi 6b5f9c9be7 Cleanup and fix hud_target_missile (#7051)
* Cleanup and fix `hud_target_missile`

The function `hud_target_missile` is what runs when the `Target Hostile Bomb or Bomber` control is pressed. Notably, it does not work if there is only 1 hostile bomber. The issue is that the loop within `hud_target_missile` is designed to search for the "next" target, but when there's only one valid target, the loop logic skips over it. But, `hud_target_missile` correctly will target if there is only 1 bomb though, so the fix is to just update the ship bomber logic similarly. This PR updates the logic of the bomber search so it matches the bombs search, that way the bomber search can target a bomber if there is only 1 present in the mission (just as how the existing bomb search will let you target 1 bomb if there is only 1 bomb in the mission currently).

This PR also takes the opportunity to cleanup the function with more clear variable and function naming, along with two new internal bools which will be very helpful for later planned PRs.

Fixes #7050. Tested and works as expected.

* rework hud_target_hostile_bomb_or_bomber

* appease clang

* additional cleanup and modernization

* more cleanup for select previous
2025-10-13 21:51:50 -04:00
Goober5000 eca894e732 add flag to automatically cancel future waves if a mothership is destroyed
Infamously, in FSO, a wing whose mothership is destroyed will not, itself, be considered destroyed if it has more waves remaining, because wing cleanup and logging typically only happen when the last ship in the last wave exits the mission.  Instead, with no mothership to arrive from, waves will simply no longer arrive.  Events that check to see if the wing is destroyed or departed will never fire.

This PR fixes that behavior, ensuring that the wing is cleaned up and logged properly, by using the same logic as the enhanced `cancel-future-waves` SEXP operator.  This is tied to a new `$cancel future waves of any wing launched from an exited ship:` AI profiles flag which is enabled by default on 25.0+.
2025-10-13 21:00:14 -04:00
Goober5000 beaeafeb97 Merge pull request #7086 from Goober5000/vectorize_subsys_hits
vectorize subsystem damage/heal list
2025-10-13 20:58:15 -04:00
Goober5000 d77f413f39 vectorize subsystem damage/heal list
When checking for subsystems within range of a hit, more than one subsystem is unusual, and 32 (the original `MAX_SUBSYS_LIST` value) is so unlikely as to be impossible.  So bumping it to 200 was not needed here -- DTP might have confused it with one of the other subsystem limits.  But rather than reducing the limit again, we can simply make the array into a vector.
2025-10-11 19:13:18 -04:00
BMagnu a243052f4c Fix Particles Hosted on Particles Which Themselves Are Parented (#7085)
* Allow particles serving as particles hosts to provide their own parent to their children

* Fix parent particles with parents
2025-10-11 23:12:46 +02:00
Goober5000 05bf43bfcc Merge pull request #7082 from Goober5000/fred_menus
rearrange FRED2 menus to match qtFRED
2025-10-11 13:05:45 -04:00
LuytenKy 1b8f920529 Implement a new ai_profiles.tbl field that allows the maximum number of allies allowed to be rearming to be modified (#7065) 2025-10-11 11:41:53 -04:00
Goober5000 ea1a3707ad Merge pull request #7084 from Goober5000/initialize_fields
initialize some fields
2025-10-10 19:18:55 -04:00
Goober5000 cd2ff46541 initialize some fields
Handle some uninitialized fields recently flagged by Coverity.
2025-10-10 18:52:49 -04:00
Goober5000 17feb28d29 rearrange FRED2 menus to match qtFRED
See issue #6985 and PR #7064.
2025-10-10 01:29:27 -04:00
Goober5000 897429e239 Merge pull request #6630 from Goober5000/form_on_wing_and_stay_still_updates
form-on-wing and stay-still updates
2025-10-09 22:48:58 -04:00
Goober5000 712491696f Merge pull request #7080 from Goober5000/patch_cancel_future_waves
patch cancel-future-waves to handle absent waves
2025-10-08 22:48:58 -04:00
Goober5000 b8fa52097c patch cancel-future-waves to handle absent waves
If the `cancel-future-waves` sexp is called when a wave is not present, it would previously not handle wing cleanup, such as setting flags and updating the mission log.
2025-10-08 21:56:42 -04:00
wookieejedi 7eff7900a6 Allow mods to tune generic debris generation (#7027)
* Allow 'No Impact Debris' to also apply to explosions

The ship/subsystem flag `no impact debris` prevents the default debris shards from spawning, which is very valuable especially now that impact effects can be completely customized via the -particles table. Now that particle effects are also an option for ship and subsystems explosions, it is also invaluable to have the ability to turn off the spawning of shards when either of those explosions happen.

This PR uses the same flag of `no impact debris` and simply does not spawn the default shards for ship explosions or subsystem explosions of that flag is enabled. I thought about adding two new flags, but that would add to the flag clutter, and most folks who use these flags to turn off impacts I would estimate also want them off for actual explosions. Also, a new flag called `no explosion debris` would likely be confusing, so if a new flag were to be added it should be called something like `no default explosion debris shards` or something. Overall I've opted with the simpler and cleaner solution to just have it all under the impact flags. If two new flags are desired though I can easily add them.

Tested and works as expected.

* throw clang a bone

* use two different flags

* update flag name

* typo and logic fix

* allow custom generic debris to always work

* update to better methods

* cleanup logic

* clang
2025-10-07 07:42:44 -04:00
BMagnu 2808606b84 Fix Cross Compilation (#7077)
* Fix a few libraries for functional cross compilation

* include timeval
2025-10-06 14:12:40 +00:00
BMagnu 84d3cdf847 Fix anim executables when animations wrap around (#7076) 2025-10-06 13:53:44 +00:00
Asteroth b1e4bd7ef8 flight cursor aiming for secondaries (#7075) 2025-10-06 15:49:16 +02:00
Goober5000 f087c8adbb Merge pull request #7072 from Goober5000/colour_followup
fix required_string_either bug
2025-10-03 13:55:11 -04:00
Goober5000 8a8d7222f2 fix required_string_either bug
`optional_string_either` advances the parser by default, but `required_string_either` does not advance the parser by default.  So be sure to advance the parser here.

Followup to #7069.
2025-10-03 12:42:38 -04:00
Goober5000 9c353e71da Merge pull request #7067 from Goober5000/fireball_parse_lookup
Updates to fireball parsing
2025-10-01 23:36:55 -04:00
Goober5000 5a3cfa5f19 add ability to parse fireball type using its ID 2025-10-01 21:47:03 -04:00
Goober5000 afcb4871a3 upgrade stuff_int_list with enum class types
For type safety, use enum class rather than int.

Also make a few miscellaneous tweaks such as adding a new casting macro and making detail level settings a bit cleaner.
2025-10-01 21:47:01 -04:00
Goober5000 2589d8c542 Merge pull request #7069 from Goober5000/color_colour
color/colour updates
2025-10-01 21:42:53 -04:00
Mike Nelson 2374da528f Fix Asteroid Table Parsing (#7068)
* Zero initialize the string

* Initialize Radius
2025-09-30 13:56:30 +09:00
Goober5000 3d8174d0d8 color/colour updates
Add Colour as a recognized parsing option in several more places where Color is used
2025-09-29 02:05:49 -04:00
BMagnu dc50aaa86b Particle Scripting API (#7061)
* Expose particle effects to scripting

* Allow creation of particle sources

* Add API for particle sources

* bugfixes
2025-09-28 10:40:46 +02:00
BMagnu 2c04313c59 Fix copy and paste error (#7066) 2025-09-27 12:55:22 +00:00
Mike Nelson e6e551121f Modernize QtFRED menus (#7064) 2025-09-26 15:22:50 +00:00
Mike Nelson aadf1c5f8b QtFRED Briefing Dialog (#7032)
* initial cleanup

* rough in more code by copying from debrief

* make buildable

* prep the briefing data model

* completed data model

* activate the ui

* unused param

* stub this

* cmake list is important

* set max cam transition higher

* static cast
2025-09-26 08:56:28 -04:00
Mike Nelson 6cb49fa245 QtFRED Campaign Editor (#7030)
* refactored campaign dialog model

* begin setting up the ui code

* work on available missions list

* available missions filter

* working state

* better available missions list

* add tooltip

* handle the retail file format

* add custom data button

* prep for mission graph

* prep for campaign graph widget

* basic functioning nodes

* Basic edges implementation

* path arrows and names

* graph view upgrades

* fixup mode handling

* clean comments

* add some styling

* drag to connect

* add and remove mission nodes

* minor cleanup

* edge emphasis based on selection

* style tweak

* cleanup some graph and tree interactions

* clean out old code

* add getters for lists

* implement the rest of the detail controls

* custom data

* cleanup

* add branch manipulation controls

* branch move buttons

* set as first command

* linux is soooo sensitive (to case)

* more case

* unused param

* fixes

* more terminator checks

* namespaces are fun for the whole family

* Clang

* Private, you're fired!
2025-09-26 08:56:10 -04:00
Mike Nelson d0737926bd QtFRED Variables Dialog (#7020)
* refactor variables/containers model and variables ui

* get containers working

* switch to tab view and add filters

* fix the filters

* fixes

* ooo

* static casts

* more static cast

* unused

* clang
2025-09-26 08:55:43 -04:00
Goober5000 cfc1088ed0 Merge pull request #7056 from Goober5000/docked_wing_fixes
for docked wings, initialize some data before the wing is created
2025-09-25 13:17:29 -04:00
Mike Nelson 0d4c222a97 QtFRED Debriefing Dialog (#7018)
* qtfred debriefing dialog

* explicit flags

* clang
2025-09-25 07:51:08 -04:00
BMagnu 22b5f8148d Fix Beam Particles (#7057) 2025-09-25 07:49:49 -04:00
Goober5000 e3ff08ea46 for docked wings, initialize some data before the wing is created
Docked wings are created with a sort of reverse-bootstrapped initialization sequence, since normally wings are created first and the wing creates the ships.  Issue #7041 found a hole in this sequence, as the mission log entry was added before the IFF was assigned.  Fix this bug, and potential future bugs, by moving the assignment of certain fields to immediately before the docked wing is brought in.  AI can't be moved that easily, so fix AI setup by calling a separate function.

Fixes #7041.
2025-09-24 23:47:14 -04:00
Goober5000 e6da70a0ff Merge pull request #7053 from Goober5000/check_for_hangar_bay
check missions for missing hangar bays
2025-09-22 22:49:51 -04:00
Goober5000 ac03c1a612 Merge pull request #7046 from Goober5000/nebula_poofs_sexps
add more advanced sexps for nebula poofs
2025-09-22 22:49:28 -04:00
BMagnu 5903dc7e9d Filter out invalid particles (#7055) 2025-09-23 04:06:09 +02:00
Mike Nelson a5dc72c56c localize language names for SCPUI (#7052) 2025-09-22 07:50:15 -04:00
Goober5000 c1444781e8 check missions for missing hangar bays
It's possible for ships to be designated as arrival or departure anchors when these ships do not actually have hangar bays.  This cannot normally happen in the interface but can happen when missions are edited in a text editor, or are imported, or the modpack is changed.  So add warnings and checks for this situation.
2025-09-22 00:37:38 -04:00
Goober5000 300cd8a1cf Merge pull request #7049 from Goober5000/fix_anchor_error_handling
fix handling of invalid arrival/departure anchors
2025-09-21 15:36:07 -04:00
Goober5000 60b8876eb0 fix handling of invalid arrival/departure anchors
Missions with invalid anchors would previously cause crashes, so update the anchor code to fail gracefully:
1. Negative anchors (especially -1) could trip up the bitwise-AND in the mission saving code, so check for negative anchors *before* checking the special-anchor flag
2. In the event a mission runs with a negative anchor (which shouldn't happen because even `<error>` is added as a recognized anchor), handle the situation with if()s as well as Asserts
2025-09-20 23:59:34 -04:00
BMagnu 3c939f5cc4 Particle Curves with access to host object & ship properties (#7047)
* Add parent / host input curves

* reorder some includes to allow particles access to ship.h

* Allow modular_curves to deal with functions returning optionals

* Add convenience function to return an optional from an objp and an instance type

* Add a bunch of particle curve inputs

* Fix internal linkage warning

* Add hitpoint and shield fraction (albeit limited to ships)
2025-09-21 02:52:22 +02:00
The Force db4f9e4370 QTFred: Ship Editor Modernization 2 Part 2 (#7026)
* Switch to using signals/slots rather than connect

* Adds coloured persona box

Adds coloured persona box/ fixes persona loading, and reduces amount of data reset on model change

* Update To new flags widget

Updates To new flags widget this reqires moving several non flag items to other dialogs, which also lead to adding a new feature that lets a custom guardian threshold be set in editor

* Switch to size_t

* Make Mission Spec work with changes to Flaglist

* Remove Duplicate member

* Clang Appeasement

* Make static

* Properly initialise guardian threshold

* Convert Player Orders dialog to Checklist box

Unfortunately also formats Shipeditordialogmodel

* Update Custom warp to modern style

* Update Initial status to modern style

* Missed a file

* Update Ship Flags Closing

* Remove QT Code from model

* Update Ship Goals Closing

* Update Special Stats Closing

* Minor Changes

* Replace Paths Dialog With generic checkbox dialog

* Update Texture Replace to modern style

* Cast to int

* Initialize then append

* Clang Fixes

* Two didn't save

* More Clang

* Tighten NOLINT's

* Remove dead code

* Change to built in buttons
2025-09-20 08:18:40 -04:00
Goober5000 fa250c5ff6 add more advanced sexps for nebula poofs
1. Add new SEXP operators for setting and fading poofs that will work with one or more arguments, or no arguments (which will affect all poofs at once).
2. Update SEXP help, including clarification that the three `nebula-change-` operators require a nebula to be active to have any effect.
2025-09-19 22:55:09 -04:00
Goober5000 0c736b7bca address feedback 2025-09-18 21:30:45 -04:00
Goober5000 440c6fda4c restore original squad-commanded priority by removing lines added in 09d116f 2025-09-18 21:30:45 -04:00
Goober5000 aad6c84684 add $purge player-issued form-on-wing after subsequent order: flag 2025-09-18 21:30:45 -04:00
Goober5000 7f8674c532 enhance goals with additional parameters 2025-09-18 21:30:43 -04:00
Goober5000 40b4294b13 add Clear_all_goals_first goal flag, allow it to be used with any goal, and adapt goal assignment accordingly 2025-09-18 21:27:43 -04:00
Goober5000 54ee4a30d6 Preliminary cleanup of goal code. 2025-09-18 21:27:41 -04:00
Goober5000 a3691ed481 Merge pull request #7043 from Goober5000/disable_form_on_wing_at_mission_start
add ai_profiles flag to disable form-on-wing at mission start
2025-09-18 21:25:14 -04:00
BMagnu 973bd5570e Small particle copy-paste fixes (#7044)
* Use correct curve

* Properly init animation data
2025-09-18 12:49:46 +00:00
BMagnu 15445408f9 Particles can now emit light (#7040)
* Add backend for paticles to emit light

* Parse new light options

* Modular Curves account for light

* Actually apply curves

* remove comment

* Add cone mode
2025-09-18 13:39:12 +02:00
Goober5000 337b0402ce add ai_profiles flag to disable form-on-wing at mission start
By default, the player's wing will be issued a form-on-wing order at the beginning of the mission if the wing has no other initial goals.  Wings in the "starting wings" list that are not the player's wing will also be issued this goal if they arrive after mission start and have no other initial goals.  This PR adds a flag to disable this behavior.
2025-09-17 23:19:36 -04:00
Mike Nelson 8ee96781b3 QtFRED Team Loadout Dialog (#7016)
* unify naming and some ui cleanup

* sidetracked by a typo

* another sidetrack

* show team list as dropdown like other dialogs

* This is a mess

* cleanup model init and apply

* tweaks

* clear string vars

* validate variables

* some cleanup

* refactor data model

* finish the model and begin the ui

* start getting the ship list working

* fix multi select issues

* activate all 4 lists

* activate teams, filters, selection stuff

* fixes

* clang

* one more cleanup
2025-09-17 16:39:55 -04:00
wookieejedi 58ff297495 Update to #7023 (#7042)
From Sept 15 onward in fast debug I hit this error when using weapon create
ASSERTION: "cur_frame < part->nframes" at particle.cpp:371

Assert: "cur_frame < part->nframes"
File: particle.cpp
Line: 371

Thanks to lafiel, `that assert should have an `|| (part->nframes == 0 && cur_frame == 0) appended beaause while we need to stay inbounds for animations, frame 0 for both is valid for static images`
2025-09-17 15:16:24 +09:00
BMagnu 7875e5f7c7 Supply normals for edge hits (#7039)
* Pass out normals for edge hits

* Remove now-obsolete comments

* Also add third instance of disabled particle normal
2025-09-16 13:45:12 +09:00
Shivansps 8057b52a04 Do not set IS_X86 when target cpu is armv7 (#7033) 2025-09-16 13:38:02 +09:00
Mike Nelson ce3597f5a6 QtFRED Relative Coordinates Dialog (#7031)
* qtfred relative coords dialog

* clang
2025-09-15 15:56:58 -04:00
wookieejedi d42789decd Add new option for 'better combat collision avoidance' (#7036)
The `$better combat collision avoidance for fightercraft:` flag is incredibly useful in preventing AI from hitting large ships while attacking, and the ability to tune the collision avoidance aggression factor further helps mods tune behavior based on their ship speeds (tuning that value is via `+combat collision avoidance aggression for fightercraft:` ). Nevertheless, the improve collision avoidance still is not performed for that actual fightercraft's actual target, so there can be situations where a fast fighter attacks a large ship with high speed, and then when that fighter break off from the attack they turn directly into the large ship's hull. Allowing the target to be incorporated into the `better_collision_avoidance_triggered` check prevents this from happening. To allow the target to be a part of the checks we just simply need to not pass an 'ignor_ship` argument to `maybe_avoid_big_ship`.

This PR adds that ability via flag. This new flag is tested and works as expected. For example, without the flag a squadron of TIEs in FotG would literally ram themselves to death attacking some of our larger capital ships because they would break off attack too late, but with this flag they no longer accidentally collide at all. In discussion with Asteroth it was decided to make this enhanced behavior behind a flag, too.

This PR also fixes a small oversight from the original #2810 where `next_check_time` was never actually used within the `else` block of `maybe_avoid_big_ship`.
2025-09-15 07:31:02 -04:00
Goober5000 a32c3187de Merge pull request #7037 from Goober5000/save_fix
fix load/save mismatch in missions
2025-09-14 23:12:11 -04:00
BMagnu 1e7431a044 Give Particles Access to Their Spawner Effect (#7034)
* Make particles aware of the effect that spawned them

* Allow modular curves to call global functions from submember inputs

* Add more in and outputs for particle lifetime curves

* Allow post-curve velocity as a curve input

* fix warning and incorrect assig

* Disable CheckTriviallyCopyableMove

* Clang Tidy
2025-09-15 04:42:06 +02:00
Goober5000 b0166dd6a6 fix null vector assertion in slash beam collisions (#7038)
Beams in general, and slash beams most likely, can collide with the edge of a model, which will cause a non-normalized vector assertion when particle effects are created.  So comment out the normal assignment until a more comprehensive fix can be coded.
2025-09-15 04:42:00 +02:00
Goober5000 a023a1a82f Merge pull request #7014 from Goober5000/cinematic_followup
modular table fix for cinematic warp
2025-09-14 19:43:53 -04:00
Goober5000 bf51f8ee91 fix load/save mismatch in missions
When `$Contrail Speed Threshold:` and `+Volumetric Nebula:` are used in a mission, builds since 23.1 would throw an error, since the fields were loaded in a different order than they were saved.  It turned out that the save order was the correct order, so this fixes the load order.
2025-09-14 16:50:11 -04:00
Goober5000 f89cd69ad9 Merge pull request #7024 from Goober5000/event_double_quotes
restore double quote conversion in event editor
2025-09-08 22:04:07 -04:00
Taylor Richards 9d3ba25606 fix various issues with DDS decompression (#7022)
Fix heap corruption with smaller mipmaps due to decompression output
always being a 4x4 block rather than actual mipmap size. It's necessary to
pad the allocated data size to allow for the overflow.

Fix heap corruption with DXT1 due to using improper data offsets for the type.

Fix data offsets not always taking the depth value into account.

Adjust code for slight increase in decode performance.

Update bcdec to 0.98
2025-09-08 21:49:48 -04:00
Goober5000 0ee8c4b01a restore double quote conversion in event editor
The double quote conversions added in #7008 were removed in #6961, probably inadvertently due to the branch merge.  This adds them back.
2025-09-07 23:23:02 -04:00
Goober5000 fc102056b8 make legacy particle spews more robust (#7023)
If a pspew specifies a single-frame image, be sure that it is loaded correctly.  Fixes a particle crash in Inferno.
2025-09-07 02:32:07 +00:00
wookieejedi 877373f257 Fix for modern Thruster Particles (#7021)
Allows `$Thruster Effect:` by fixing copy-paste bug. Tested and fix confirms to work.
2025-09-06 06:31:55 +02:00
combatlombax 31d73b7ed5 Removing block that prevented volumetric and background nebulae from rendering simultaneously (#6853)
* Removing block to allow volumetric and background nebulas to render at the same time

* Updating code from feedback on pull request #6853

* What the... did I miss a line?

* Dual fog layering should now work when both nebula types are active
2025-09-06 00:00:06 +02:00
Goober5000 e4bba0c7f2 Merge pull request #7010 from Baezon/direct-fire-lead-target
Add 'direct fire lead target' beam flag
2025-09-03 23:27:27 -04:00
Goober5000 0d0574df0f Merge pull request #7013 from vmedea/vulkan-build-fixes
Fix build issues with Vulkan SDK 1.3.301+
2025-09-03 23:27:19 -04:00
Goober5000 f2bc71c13a small optimization 2025-09-03 22:45:31 -04:00
Goober5000 f88e5c475e modular table fix for cinematic warp
Small and subtle fix: move the CINEMATIC options inside the preceding if() block in the same way that the flare style options are inside their preceding if() block.  This prevents the CINEMATIC options from being reset to their default values in subsequent modular table parsing.  Followup to #6500.
2025-09-03 22:04:48 -04:00
Mara Huldra 5848df31dd Fix build issues with Vulkan SDK 1.3.301+
This fixes two build issues:

- `vk::PFN_DebugReportCallbackEXT` takes `vk::DebugReport*EXT` not C
  type `VkDebugReport*EXT` since version 1.3.304.
  (KhronosGroup/Vulkan-Hpp@d5a18dc87e)
- `vk::ObjectDestroy` was moved to namespace `vk::detail` in version
  1.3.301.
  (KhronosGroup/Vulkan-Hpp@6e5489fcd9)

Guard them with version checks, so that compiling with older verions
of Vulkan keeps working.

Closes #6416.
2025-09-03 20:26:29 +00:00
wookieejedi 2820532ab3 Expose value of idle circling with 'attack-any' (#7011)
* Expose value of idle circling with 'attack-any'

The attack-any order is extremely useful and utilized order, and there was one aspect that was ripe for exposure to modders: the `CHASE_CIRCLE_DIST` that was used to determine how big of a circle to fly around while the AI waited for new hostiles to arrive. For ships with high speeds, like FotG and others, the default radius of 200 m was a bit on the small side, which lead to ships flying in tight circles. This was was counterproductive to goals of tuning the AI to have a more cinematic style, such as where AI would fly around in large distances while waiting for enemies to arrive. Fortunately, this value is easy to expose and allow modders to tune with just a new ai_profiles value.

Tested and works as expected.

* improve name and use correct distance
2025-09-02 22:55:03 -04:00
Goober5000 32084cfe59 Merge pull request #7012 from Shivansps/check-mod-nullptr
Fix crashing if mod uses custom hud gauge and no -mod cmdline is passed
2025-09-02 20:59:26 -04:00
Salvador Cipolla 7a75aaa172 Check cmdline_mod for nullptr before using it 2025-09-02 19:17:16 -03:00
John Fernandez c50cffae17 Merge pull request #6998 from MjnMixael/qtfred_background_dialog
QtFRED Background Editor Dialog
2025-09-01 22:50:12 -04:00
Mike Nelson b7aa53dd79 address feedback and fix some ui issues 2025-09-01 18:54:15 -05:00
Asteroth 90e1f18fa2 add recoil for secondaries (#7007) 2025-08-31 10:01:31 -04:00
John Fernandez 19a6a1aa97 Merge pull request #7000 from MjnMixael/qtfred_volumetric_nebula_dialog
QtFRED Volumetric Nebula Dialog
2025-08-31 09:09:56 -04:00
Asteroth 730b294d7b add 'direct fire lead target' 2025-08-29 20:39:06 -04:00
The Force 42eae002d2 Fix Permanent Guardian (#7009)
* Switch to using signals/slots rather than connect

* Adds coloured persona box

Adds coloured persona box/ fixes persona loading, and reduces amount of data reset on model change

* Update To new flags widget

Updates To new flags widget this reqires moving several non flag items to other dialogs, which also lead to adding a new feature that lets a custom guardian threshold be set in editor

* Switch to size_t

* Make Mission Spec work with changes to Flaglist

* Remove Duplicate member

* Clang Appeasement

* Make static

* Properly initialise guardian threshold
2025-08-29 15:01:11 +00:00
Mike Nelson b3db62cf25 QtFRED Mission Events Editor (#6961)
* Match file framework of mission events to the rest

* first pass at splitting up the model and ui layers

* fix up message side of event editor

* fix event selection

* fix lots of event bugs

* Get event annotations working

* type to search for operators

* control annotations

* Add event dragging and fix event deletion

* cleanup

* Event and Msg order manipulation

* implement some remaining message todos

* minor cleanup

* prep for browse ani dialog picker

* basic file browser for now

* cleanup

* unused var

* more unused

* clang

* static member access

* rebase error

* fix rebase error

* address feedback

* missing parenthesis
2025-08-29 09:05:11 -04:00
Mike Nelson 689d184869 commit error 2025-08-28 22:54:35 -05:00
Mike Nelson 772920b727 static method 2025-08-28 22:54:34 -05:00
Mike Nelson 2b2320ffe7 volumetric nebula dialog 2025-08-28 22:54:34 -05:00
Mike Nelson b9229cd713 more static 2025-08-28 22:54:12 -05:00
Mike Nelson 886b54c298 more clang 2025-08-28 22:54:12 -05:00
Mike Nelson ca4540a821 clang 2025-08-28 22:54:12 -05:00
Mike Nelson 0f73a59155 clean 2025-08-28 22:54:12 -05:00
Mike Nelson 1d1ed1905b minor fix 2025-08-28 22:54:11 -05:00
Mike Nelson 917b4547ec save swap with index 2025-08-28 22:54:11 -05:00
Mike Nelson 614f510d0a misc group stuff 2025-08-28 22:54:11 -05:00
Mike Nelson aa7fc6dafd skybox section 2025-08-28 22:54:11 -05:00
Mike Nelson cb4e132df2 ambient controls 2025-08-28 22:54:11 -05:00
Mike Nelson fe17997ca3 nebula groups 2025-08-28 22:54:11 -05:00
Mike Nelson f691966675 sun section 2025-08-28 22:54:10 -05:00
Mike Nelson a531fd9fed wire up the bitmap section 2025-08-28 22:54:10 -05:00
Goober5000 9c65e1c9b5 Merge pull request #7008 from Goober5000/more_fred_replace_stuff
add additional double quote conversion to FRED and qtFRED
2025-08-28 19:11:03 -04:00
Goober5000 69dfe8194d Merge pull request #7006 from Goober5000/parse_error_fixes
fix some parse error handling
2025-08-28 19:10:50 -04:00
Goober5000 2d37a24b4d fix formatting of alt names and callsigns when saving a mission 2025-08-28 01:20:51 -04:00
Goober5000 b970e22410 add additional double quote conversion to FRED and qtFRED
Any place in FRED that uses XSTR is susceptible to double quotes interfering with the standard XSTR format, not just the expected briefing, debriefing, messages, etc.  This PR adds `lcl_fred_replace_stuff()` - which handles not only quotes but semicolons and slashes as well - to the other places where XSTR is used.

(Note that quotes are handled just fine in non-XSTR fields.  Semicolons will still truncate non-XSTR fields, but addressing that is beyond the scope of this PR as it would require editing every text field in FRED.  Fortunately, errant semicolons merely modify the text as opposed to corrupting the mission file.)

Fixes #7005 in both FRED and qtFRED; tested in both.  Caveat aedificator: the briefing editor is not yet implemented in qtFRED, so the relevant fixes to briefing icon labels and closeup labels cannot yet be ported over.
2025-08-28 01:02:06 -04:00
Goober5000 289de86eb9 fix some parse error handling
Parse errors that are actually errors should use `error_display(1, ...)`, rather than merely logging them (which doesn't abort parsing) or using `Error` (which omits the line number and file name).

Fixes #7002.  Tested with a modified script file that produces the same error.
2025-08-27 22:48:39 -04:00
Kestrellius 1d561a1f1e Merge pull request #6999 from Kestrellius/cockpit-brightness-adjust
Cockpit-specific light intensity adjustment for lighting profiles
2025-08-27 17:59:56 -07:00
The Force 1310c38642 QTFRED Ship editor Modernisation 2 Part 1 (#6989)
* Switch to using signals/slots rather than connect

* Adds coloured persona box

Adds coloured persona box/ fixes persona loading, and reduces amount of data reset on model change

* Update To new flags widget

Updates To new flags widget this reqires moving several non flag items to other dialogs, which also lead to adding a new feature that lets a custom guardian threshold be set in editor

* Switch to size_t

* Make Mission Spec work with changes to Flaglist

* Remove Duplicate member

* Clang Appeasement

* Make static
2025-08-27 12:38:43 -04:00
John Fernandez b090e5d09c Merge pull request #7004 from MjnMixael/qtfred_fix_loadout_again
Fix QtFRED Weapon usage for real
2025-08-27 12:37:43 -04:00
Mike Nelson e9311ec828 use correct array throughout 2025-08-27 10:58:04 -05:00
wookieejedi eaafd8cb13 Merge branch 'master' into cockpit-brightness-adjust 2025-08-26 18:02:29 -04:00
wookieejedi 5f899634c2 Fix new deferred check (#7001) 2025-08-26 17:33:40 -04:00
Kestrellius 7918797eec more bugfixing 2025-08-26 00:37:30 -07:00
Kestrellius d279e477b3 bugfixing 2025-08-25 21:33:00 -07:00
Kestrellius d2f842494d setup 2025-08-25 21:00:05 -07:00
Kestrellius a6f9337d5a add check (#6997) 2025-08-25 22:48:13 -04:00
Asteroth 1a1d3f040c fix interpolate matrices (#6996) 2025-08-25 17:17:52 +00:00
Mike Nelson 109c2b5a81 QtFRED Music Player Dialog (#6994)
* qtfred music player dialog

* cleanup

* int comparisons

* clang wins
2025-08-25 09:59:16 -04:00
Mike Nelson c2b92410aa QtFRED Global Ship Flags Dialog (#6993)
* Global Ship Flags Dialog

* modernize old fred code
2025-08-25 07:44:07 -04:00
Mike Nelson 16926a4395 QtFRED Shield Sys Dialog (#6991)
* refactor global shield sys dialog

* I win this time, Clang

* Or not...
2025-08-25 07:43:53 -04:00
Mike Nelson 76440ddfd1 QtFRED Reinforcements Dialog (#6990)
* cleanup reinforcements dialog

* unused
2025-08-25 07:43:41 -04:00
Mike Nelson 08a73c1ed7 QtFRED Voice Acting Manager Dialog (#6962)
* revise Voice Acting Manager dialog

* fixes

* clang

* make window modal
2025-08-25 07:43:10 -04:00
Mike Nelson 9f30d3001c QtFRED Command Briefing Dialog (#6968)
* refactor the qtfred command briefing dialog

* clang
2025-08-24 10:10:52 -04:00
Mike Nelson 6c101fe52a QtFRED Fiction Viewer Dialog (#6965)
* refactory qtfred fiction viewer dialog

* do this more efficiently
2025-08-24 10:10:40 -04:00
Mike Nelson bc083dc61b QtFRED Mission Specs Dialog (#6945)
* refactor mission specs dialog

* clang

* Stub in all the sub dialog files

* custom strings dialog

* custom strings dialog cleanup

* custom data dialog

* sound environment dialog

* move custom wing names into mission specs subfolder

* custom wings dialog

* unused

* clang tidy

* clean return

* refactor mission specs dialog

* move custom wing names into mission specs subfolder

* custom wings dialog

* rebase error

* remove a couple empty functions

* select after creating
2025-08-24 10:10:22 -04:00
Taylor Richards 9755d44c5f update mdns to v1.4.3 (#3973) 2025-08-23 20:32:18 -04:00
wookieejedi 9502af6f20 Fix gr.createParticle with parent velocity (#6970) 2025-08-23 17:40:21 -04:00
wookieejedi 5eb80f55bc Fix conversion of old muzzle flash to new type (#6972)
Fixes the updated name of `Pixel Size At Emitter`
2025-08-23 16:31:39 +00:00
Mike Nelson 4b9ccfc68f QtFRED Asteroid Dialog (#6908)
* begin asteroid dialog rewrite

* activate fields

* clean up connections

* clean up and rearrange files for consistency

* use constructor to zero out the field when needed

* fix checks errors

* remove duplicate lines

* add missing z
2025-08-23 15:20:38 +00:00
Mike Nelson 9db567ea40 QtFRED Mission Goals Dialog Cleanup (#6951)
* cleanup and bugfixes of mission goals editor

* redundant specifier

* static casts
2025-08-23 10:58:14 -04:00
Mike Nelson 7d8b437847 Qtfred Wing Editor Dialog (#6939)
* wing editor dialog base functionality

* flags and path masks plus some cleanup

* squad logo selection

* custom warp params using the ship editor version

* some cleanup

* some finalization

* cleanup, fixes, and clang

* remove duplicate lines after rebase

* merge namespaces
2025-08-23 10:57:54 -04:00
Mike Nelson e9d4f322d0 QtFRED Waypoint Path Dialog (#6935)
* cleanup qtfred waypoint dialog

* range based loops

* typo
2025-08-23 10:57:35 -04:00
Mike Nelson 080aa65ec8 QtFRED Object Orientation Editor Dialog (#6932)
* refactor and cleanup the qtfred object dialog

* clang is being pedantic

* BRAAAACE FOR IMPACT

* clang

* switch statement
2025-08-23 10:57:18 -04:00
Kestrellius 1207dfcae9 Merge pull request #6946 from Kestrellius/asteroid-effects
Particle effects for asteroid death
2025-08-23 07:00:43 -07:00
Kestrellius 8db0a44d7d Merge pull request #6938 from Kestrellius/deathroll-effects
Particle effect hooks for ship deathroll explosions, pre-death explosions, and propagating explosions
2025-08-23 07:00:32 -07:00
Goober5000 9ba88ca163 fix error in error reporting routine (#6969)
The `_s` functions throw an exception if the string's length is exceeded.  But in an error reporting routine, we are far more interested in the string than the exception, and we'd rather get a partial error message than a crash.  Plus this bit of code is already set up to truncate the string anyway.
2025-08-23 09:37:47 -04:00
John Fernandez c451a82f87 Merge pull request #6966 from MjnMixael/fix_qtfred_variables_strings
QtFRED Fix variables heap corruption crash
2025-08-22 22:00:05 -04:00
Mike Nelson eb36b56f1d fix 2025-08-22 12:10:52 -05:00
Mike Nelson c39d6b290f convert tostdstring to const data 2025-08-22 11:31:19 -05:00
John Fernandez 56a3ddd5d3 Merge pull request #6150 from JohnAFernandez/qtFRED-variables-editor
qtFRED variables editor
2025-08-22 10:44:39 -04:00
John Fernandez 89219df6af And move this 2025-08-22 09:40:49 -04:00
John Fernandez fa80fc3278 APPEND THIS 2025-08-22 09:36:19 -04:00
John Fernandez 84897636cd Hopefully last of clang warnings 2025-08-22 09:14:07 -04:00
Kestrellius 9e618f6632 Particle effect hooks for subsystem destruction (#6937)
* add particle hook

* partial bugfixing

* bugfixing

* appeasement

* syntax fix
2025-08-22 07:19:15 -04:00
Taylor Richards 43e85dd8fd update libpcp to lastest main (#6963)
This should fix build issues on ARM64 Windows.

Note that the project name changed from libpcp to libpcpnatpmp and is in
active development again after a multi-year period of inactivity. There
are currently no versioned releases. This is hash b5fe5e2.
2025-08-22 07:18:48 -04:00
Taylor Richards a12c1de012 fix memory access error with active games list (#6964)
During maintenance of the active games list it's possible for the list to be
cleared before a stale item is removed leading to a access violation. So we
need to confirm the list isn't empty when attemping to erase the stale  entry.

This also fixes a bug where the list entry index is incremented even when an
entry is removed which can cause an improper selection index being used.
2025-08-22 07:18:38 -04:00
The Force b1247042ac QTFred: Alt Ships Class dialogs (#6959)
* Add Files and UI

* Initial Setup of dialog

* Finish Dialog

* Obey Rule of 3(Possibly)

Why Cant the compiler do this?

add const

* Fix use of default keyword

* bit more

* Remove unused Vars

* Missed one

* Clang work

* Remove future proofing as the compiler doesnt like it

* Make static/ Apply de morgans

* Lets try this one

* Revert to inital and supress warning

Also switch to Assertions
2025-08-22 07:18:30 -04:00
John Fernandez 3725f27a5c Match header 2025-08-21 23:54:18 -04:00
John Fernandez 55efbe73b3 Forgot that VS doesn't have auto save 2025-08-21 23:41:48 -04:00
John Fernandez 40b9924892 More clangy 2025-08-21 23:39:40 -04:00
John Fernandez c21cbb3067 Handle shadowing 2025-08-21 11:57:06 -04:00
John Fernandez 7b9b237a66 No clever commit message this time
How long must I attempt to satisfy the endless hunger of clang
2025-08-20 23:45:42 -04:00
John Fernandez f15a6bc3e8 Handle more clang warnings 2025-08-20 23:37:11 -04:00
John Fernandez 3a7269275e blarg 2025-08-20 22:58:10 -04:00
John Fernandez 81656e8dff Add back missing closing markup 2025-08-20 22:37:04 -04:00
John Fernandez 7c2deb6761 Merge branch 'qtFRED-variables-editor' of https://github.com/JohnAFernandez/fs2open into qtFRED-variables-editor 2025-08-20 22:29:56 -04:00
John Fernandez 552817b8e1 Missing Parentheses 2025-08-20 22:29:30 -04:00
John Fernandez 555a413d7e Merge branch 'master' into qtFRED-variables-editor 2025-08-20 22:26:57 -04:00
John Fernandez 0241c9f4b9 Scare off DeMorgan 2025-08-20 22:25:34 -04:00
John Fernandez c93c91013c Do what clang says or else 2025-08-20 22:17:36 -04:00
John Fernandez 81d08cd6f3 More Clang 2025-08-20 22:13:16 -04:00
John Fernandez 4efcd82940 Make sure to use empty 2025-08-20 22:05:52 -04:00
John Fernandez a4014ea985 According to the internet this should work 2025-08-20 22:02:40 -04:00
wookieejedi 83dee2eab4 Spare future modders (#6960) 2025-08-20 18:56:16 -04:00
Mike Nelson 39f80289c2 QtFRED Mission Cutscenes Dialog (#6956)
* Mission cutscenes dialog

* fixes

* getter for now private member

* missed some cleanup

* assertion
2025-08-20 22:51:53 +00:00
Mike Nelson cbd491e277 QtFRED Jump Node Editor Dialog (#6940)
* qtfred jumpnode editor dialog

* unused function

* clang

* and and use SCP_trim
2025-08-20 18:08:52 -04:00
John Fernandez 1a60eff319 And try this 2025-08-20 17:31:20 -04:00
John Fernandez 7713e1b09b Don't overzealously mark this 2025-08-20 17:17:33 -04:00
John Fernandez c85876d0d3 don't forget headers 2025-08-20 14:46:33 -04:00
John Fernandez 6cadc350b1 Start fixing myriad clang issues 2025-08-20 14:40:10 -04:00
Kestrellius 806bb77298 Particle effect hooks for subsystem debris trails and debris explosions (#6944)
* add hooks

* parsing

* add particle hooks

* appease clang

* readability
2025-08-20 09:49:00 -04:00
Taylor Richards e5fccc0b19 fix conversion of Missiontime to milliseconds (#6957)
Broken in #6948 but the original didn't work properly either due to conversion
to int32_t and the resulting size limit.

Big assist from Goober5000 for noticing the bug and helping to sort out the
wonky values.
2025-08-19 12:12:55 -04:00
Kestrellius 0bf632ceae Add apparent size input for particle source curve (#6947)
* functional method

* add input
2025-08-18 22:36:17 -04:00
Kestrellius bd9ea61e9d appease clang 2025-08-18 19:17:18 -07:00
Kestrellius 836d7d4f2d switch include 2025-08-18 19:02:07 -07:00
Taylor Richards 5ea4a4c014 remove extra config bind on joystick axes (#6955)
Fixes fail sound due to the control set not changing between calls.
2025-08-18 21:50:15 -04:00
Taylor Richards dd71838715 fix array index bug in ship_get_subsys_index (#6954) 2025-08-18 21:49:35 -04:00
Taylor Richards b16854796a fix custom mouse cursors (#6953)
UI elements with custom mouse cursors wouldn't show them due to the cursor
being reset at the start of each frame. To fix this we need to be sure that
we only reset when the element is no longer active.
2025-08-18 21:48:51 -04:00
Taylor Richards 1142e7d9bc force proper ordering of joystick options (#6952) 2025-08-18 21:48:24 -04:00
John Fernandez 212c91c72f Merge pull request #6942 from MjnMixael/qtfred_flag_list_widget
QtFRED Flag List Widget
2025-08-18 18:39:02 -04:00
Kestrellius 4e75114479 Fix parented line sprite particles appearing in the wrong place (#6950)
* account for parenting

* fix p1 position
2025-08-18 16:45:17 -04:00
Taylor Richards e1ae938553 Merge pull request #6948 from notimaginative/compile_warnings
address various build warnings
2025-08-18 16:36:08 -04:00
Taylor Richards af833f059c fix avcodec deprecation warnings 2025-08-18 12:01:00 -04:00
Taylor Richards d9b7710f92 properly set some macOS bundle properties 2025-08-18 12:00:40 -04:00
Taylor Richards fc7389f95a fix various compiler warnings 2025-08-18 11:59:22 -04:00
Taylor Richards 908f306985 fix some abs() type conversion warnings 2025-08-18 11:56:39 -04:00
Taylor Richards 21c9b65c99 add _WIN32 guard to trackir/freetrack 2025-08-18 11:56:26 -04:00
Goober5000 f92bc15fc6 Merge pull request #6941 from Goober5000/6882_followup
restore inadvertently deleted code
2025-08-17 21:53:17 -04:00
Kestrellius 6539fc9aeb clean up control flow 2025-08-17 16:06:32 -07:00
Kestrellius a0730f601c add particle hook 2025-08-17 15:36:38 -07:00
Taylor Richards 59a362ed1d fix end-mission sexp in multi (#6943)
A previous attempt to fix the end-mission sexp in multi such that it wouldn't
trigger the jump out sequence was horribly broken. Notable safety checks, state
changes and server/client syncing was skipped over. This caused, as one
particular bug, a standalone server to stop communicating with the game host.
When this happened stats couldn't be accepted/tossed and you were stuck at the
debrief screen, being forced to disconnect from the standalone in order to
continue.

A proper fix for this is to use multi sexps to tell clients to enter a debrief
state before the standard end mission request is handled. This will allow it
the bypass the actual warp out animation for players while still doing the
normal end of mission handling.

NOTE: This is a breaking, but not fatal, multi change and should be safe
considering the recent version bump in early June. As such an additional
version bump is not required with this for 25.0.
2025-08-16 22:14:51 -04:00
Mike Nelson dadb91889f clang 2025-08-16 15:10:54 -05:00
Mike Nelson 41dc187456 add flag list widget 2025-08-16 14:51:32 -05:00
wookieejedi 7780769ba5 Add 'Nebula Usage Score' curve input (#6926)
Background:
Many mods, especially Event Horizon, have highlighted how versatile and useful using nebula are for creating a wide variety of immersive effects beyond just nebula, including weather, volcanic ash, specialty debris falling from the sky, and more. In addition volumetric nebula have opened another realm of possibilities for modders to creatively utilize. Furthermore, modders can not leverage the powerful updates to the particle system to create a wide diversity of effects, which can be also utilized within nebula (or any mission) by making weapons with those effects and then spawning those weapons with scripts/sexps. Just one creative example is exploding rock debris from a volcano (like in Event Horizon). The visuals of nebula poof though are of course spawned in density according to the `Nebula Detail Level` graphics slider in the Graphics tab of the Options menu. Thus, what the player sets will affect visuals of the nebula. As a modder creating visuals, this can have the effect where particle effects spawned from weapons used in nebula may look different in less dense fields. Ideally there could be a way for the modder to incorporate this Nebula slider detail into the development of their effects, to ensure that the effect visuals properly reflect and integrate with the nebula density that the player might see. The solution to this problem is luckily not difficult, as PR #6889 shows how it can be dealt with. That PR added a particle curve input `Particle Usage Score` which is incredibly useful to allow particle effects to scale visually according to the `Particle Detail Level` that the player has set in the Graphics tab of the Options menu. As such this utility could also be extended to the Nebula detail level to allow modders to develop weapon spawned effects for nebula missions that properly visually integrate with the nebula detail level.

This PR
This PR follows and extends the relatively simple approach of #6889, in that it adds a new curve input `Nebula Usage Score` for use within the particle effects table. This new input will allow modders to develop effects that can properly mesh with varying nebula detail levels--all with the aim to further expand the visuals and range of nebula utility for environmental effects.
2025-08-16 12:03:00 +02:00
wookieejedi c535108708 Allow background option to completely work (VR useful) (#6930)
From discussion with VR players, it appears that being able to toggle off the skybox/starfield/planet background is very useful to some players to prevent motion sickness. Currently, FSO has the toggle in the Graphics Options window for `Planets/Backgrounds` but it only turns off planet bitmaps. This PR suggests it should be expanded into an accessibility role for players, and properly turn off all background elements--so planets, plus skybox rendering (especially now since most mods also use skyboxes as backgrounds, whereas in early days this was not primarily the case).

Happy to discuss and/or add as a flag if folks think that would be needed.
2025-08-16 12:02:46 +02:00
Goober5000 dde16a54c6 restore inadvertently deleted code
This has an interesting history.  In the original Volition source release, global damage was set to originate from the shockwave position, which would have avoided the fireball issue fixed by #6882.  (Technically, though, this was only done for huge ships which would have still left the problem for smaller ships.)  In c2716d4ee8, this code was changed to run in non-HTL mode in an attempt to fix a bug.  Then in 70529dbd5a, as part of the removal of non-HTL mode, the code was entirely deleted.  So, this restores the code.

The #6882 fix is still valid, both because it works for non-huge ships, and because shockwaves may not necessarily originate from the subobject being destroyed.  The #6882 fix also subsumes the effect of the restored code, but it's still good to restore the code in case future development may depend on it.
2025-08-16 01:14:45 -04:00
Kestrellius 09b6888bc6 fix normals 2025-08-15 20:45:05 -07:00
Kestrellius be4d4eb1d5 add hooks 2025-08-15 19:09:12 -07:00
John Fernandez f0ecd88da9 Merge pull request #6934 from MjnMixael/qtfred_loadout_bug
Fix QtFRED weapon quantities
2025-08-14 22:35:36 -04:00
John Fernandez 6d9e590996 Merge branch 'master' into qtFRED-variables-editor 2025-08-14 22:32:35 -04:00
John Fernandez fe3dce092a Merge pull request #6169 from TheForce172/feature/weaponsDialog
Weapons Editor Dialog and Table Viewer
2025-08-14 22:31:05 -04:00
Mike Nelson 0b6150e961 Qt fred misc bugs (#6933)
* fix main window title

* Fix loadout dialog crashing
2025-08-14 22:14:27 -04:00
John Fernandez ebe2d235da Merge pull request #6931 from MjnMixael/qtfred_utils
Merge Recent QtFRED Generalized Dialogs
2025-08-14 21:53:43 -04:00
Mike Nelson 9ecc158aee initialize used_pool 2025-08-13 16:53:54 -05:00
Mike Nelson 4d8dbcb457 Cherry pick recent qtfred generalized dialogs 2025-08-13 08:49:13 -05:00
Mike Nelson 966ac4d878 Allow testing bay paths in the lab (#6902)
* allow testing bay paths in the lab

* unused param

* static member methods
2025-08-13 08:36:53 -04:00
Mike Nelson 1ffcaafc89 Allow customizing the fs2 selection effect (#6868)
* allow customizing the fs2 selection effect

* undo color color shift
2025-08-13 07:26:55 -04:00
John Fernandez 06f576bfa6 Merge pull request #6925 from wookieejedi/fix-skybox-zbuffer
Fix/enhance skybox submodel rendering
2025-08-12 10:36:18 -04:00
Taylor Richards d0c5fe6bcc fix series of bugs due to improper multi targeting (#6916)
Multiple issues were discovered to be from improper targeting data in multi
tracing back to the addition of multi-lock. This was due to differences in
how targeting works in single/multi and de-sync of this info between server
and client. Collecting accurate targeting data on the server and making sure
that the client will use that data resolves the tracking and sync issues.
2025-08-11 11:06:46 -04:00
wookieejedi f903180411 Fix/enhance skybox submodel rendering
Background:
Currently, skybox models can be set in FRED to have `No Z-Buffer` on or off. It is off by default, which is good because it ensures ships and other game objects cannot be rendered behind a skybox. Critically though, skybox models may have sub-models, especially now that animated sub-models are a feature (thanks to BMagnu!). If a skybox is using sub-models and `No Z-Buffer` is turned off, then there will be no proper model occlusion for the skybox and there will be ugly z fighting. Overall, BMangu stated "we could clear the depth buffer after the skybox with another flag".

Update
This PR fixes that issue by adding a new FRED game settings flag, `$Skybox internal depth consistency:` which when set to yes properly ensures there is internally consistency z-sorting with the skybox and any submodels it may have while at the same time ensuring that if `No Z-Buffer` is set in FRED that the skybox still correctly is always drawn behind mission objects like ships/debris.

Many thanks to @Bmagnu for the discussion and help in identifying and creating a proper fix for this issue that is clean, surgical, and supports all existing uses of `No Z-Buffer`.

Tested and works as expected. Fixes #6913.
2025-08-11 10:56:28 -04:00
The Force 726c954e37 Fix Crash On selecting different ship types (#6920) 2025-08-10 13:25:02 -04:00
The Force 1a72471543 Last One 2025-08-09 19:31:04 +01:00
The Force a7ec8d958b And now Clang 2025-08-09 18:35:57 +01:00
The Force c1c16c2fcf GCC Apeasment 2025-08-09 17:14:14 +01:00
The Force ec3fc3477d Refresh UI on Drag Drop 2025-08-09 16:59:27 +01:00
The Force 3524679c9e Fix Copy/Paste Error 2025-08-09 16:11:15 +01:00
The Force cf4f1b2ac6 Missed this 2025-08-09 16:09:14 +01:00
The Force 95fea193ae Couple More 2025-08-09 16:05:00 +01:00
The Force 8bf7f66483 Adress Feedback and other bug fixes 2025-08-09 15:53:58 +01:00
The Force 38f7479500 Appease GCC / Clang
Appease GCC

This is a silly error

AAAAAGH

Fix Model

Sick of this

Fix Supposed Shadowing

Hopefully the last

Or maybe not

Please
2025-08-09 15:53:56 +01:00
The Force f5b2b1bbd0 Add Comments 2025-08-09 15:53:54 +01:00
The Force 1a1d4bb057 Add TBL Viewer 2025-08-09 15:53:53 +01:00
The Force 858c116b3e Add Weapons Dialog
Move Ship Files To there own folder for legibility
Set File stucture

Create Layout

Rough outline established

Ship data fully loading

limit multiselection to one type

Add in missing conditon

Add weaponlist loading and move Bank model to its own file

Delete Missed file

Fix Cmake file

Change to size_ts

Fix Arrivals

Partial Drag and drop / better multi-select

Finish drag and drop / add ammo editing

Add Saving

Feature Complete
2025-08-09 15:53:09 +01:00
Mike Nelson b8b24a67e0 pass an initialized var instead of a temp var (#6917) 2025-08-09 13:16:52 +02:00
Kestrellius df0279869c Allow shockwave orientations to be relative to their parents (#6919)
* initial setup

* various orientations
2025-08-09 13:14:22 +02:00
Taylor Richards 85b37e098e remove "safe" versions of FD_SET/FD_ISSET (#6918)
The socket is a value to be assigned, not an index to be used. As such there
is no safety check to be done here and doing so just breaks things.

Fixes networking on Windows.
2025-08-08 20:43:34 -04:00
Taylor Richards 515beef61a fix cleanup of empty model.subsystems files (#6915) 2025-08-08 20:43:11 -04:00
Taylor Richards 7281f71da4 clear screen going to PXO lobby (#6914)
Widescreen mainhalls can still be visible on the sides when going to the PXO
lobby so we need to be sure the screen is cleared.
2025-08-08 20:42:47 -04:00
Mike Nelson 7c29656c7c let the model decide if the apply was successful and should close (#6912) 2025-08-08 10:36:19 -04:00
Mike Nelson 3900faac87 Fix issue where QtFred could have multiple Ship Dialogs open (#6909) 2025-08-08 07:30:37 -04:00
Kestrellius 5cd3b3a308 Extend particle interpolation to lifetime (#6910)
* the naive method

* the correct method
2025-08-08 07:29:59 -04:00
Mike Nelson 75b61efbd1 Custom Data for Campaigns (#6906)
* campaign custom data

* Assertion instead of assert
2025-08-07 09:56:52 -04:00
LuytenKyandwookieejedi b8c3c560d2 Implementation for an AI order to chase ship types -Second Attempt- (#6828)
* Back in business hopefully

* Refactor

* Resolve CI issue in aigoals.cpp

* Updating order.cpp

* Whoops

* Updated objecttypes.tbl to incorporate attack ship type

* Fix clang-tidy issue

* Forgot one other instance

---------

Co-authored-by: wookieejedi <[email protected]>
2025-08-07 09:56:18 -04:00
John Fernandez 94744e9d69 Merge pull request #6899 from MjnMixael/lab_detail_level
Show current detail level in the lab
2025-08-05 17:14:10 -04:00
John Fernandez 04c2913f07 Merge pull request #6903 from MjnMixael/lab_misc_fixes
Misc Lab Fixes
2025-08-05 17:13:37 -04:00
John Fernandez 75a7fc5755 Merge pull request #6901 from wookieejedi/debris-cleanup-2
Debris Cleanup
2025-08-05 17:12:26 -04:00
wookieejedi 6132f8bfc1 Another particle fix for standalones (#6905)
* Another particle fix for standalones

Fix more standalone crashes from particles by "allowing the code to create particles, and just silently quit if in standalone. I.e., accept an invalid effect handle if in standalone and that'll just quit out the source on its first frame of processing." Thanks to @Bmagnu for the fix! Putting here to allow taylor and chief to more easily test.

* add needed include

* and another fix
2025-08-05 16:25:16 -04:00
wookieejedi 32183f5e71 update comments 2025-08-04 18:43:06 -04:00
Mike Nelson 3f0c33046c unused params 2025-08-04 15:17:28 -05:00
Mike Nelson 1c482d76df default case 2025-08-04 14:55:11 -05:00
Mike Nelson e5a5c30fbf misc lab fixes 2025-08-04 14:24:03 -05:00
wookieejedi 4ddcaec027 Debris Cleanup
In current master the debris creation logic was really showing some rust, which resulted in inconsistent behavior when using `Lifetime Min` and `Lifetime Max` for debris in the `ships.tbl`. Specifically, by default debris can randomly be set as `DoNotExpire` if the check `(Random::next() < (Random::MAX_VALUE / 6))` is false. This was set *before* the code that set the lifetimes from `Min` and `Max` from the table though, which could randomly result in debris with infinite lifetimes even if a min and max were specified (and the ship was small, since large ships trigger infinite debris by default always).

Also, by default, ships with a radius larger than 50 meters always had infinite debris lifetimes because of `MIN_RADIUS_FOR_PERSISTENT_DEBRIS`. Thus, this PR also allows modders to set that value in the game settings table.

Tested and works as expected.
2025-08-04 12:05:54 -04:00
John Fernandez a68b22a9d8 Merge pull request #6900 from notimaginative/fixup_client_multi_data
cleanup and fix issues with multi client data
2025-08-04 00:49:44 -04:00
Taylor Richards d7a531d449 properly this time 2025-08-04 00:18:09 -04:00
John Fernandez 8d2895d3c2 Merge pull request #6898 from MjnMixael/fix_lab_animations
Still allow subsystem animations in the lab
2025-08-03 23:52:50 -04:00
Taylor Richards 255f3773c1 address clang-tidy issues 2025-08-03 22:57:03 -04:00
Taylor Richards 8748109eaf cleanup and fix issues with multi client data
Fix use of incorrect data macro
Fix packet size safety check
Fix sequence order issue with client data packet (Cyborg)
Cleanup code to address readability and maintence issues
2025-08-03 20:08:25 -04:00
Mike Nelson 6abfddfea5 show current detail level in the lab 2025-08-02 18:59:45 -05:00
Mike Nelson 32905ac841 still allow subsystem animations in the lab 2025-08-02 16:36:27 -05:00
Taylor Richards 671a7586e7 fix nullptr crash when debris collides with ship (#6896) 2025-08-02 10:10:31 -04:00
Taylor Richards 9718e7008c fix mipmap resizing bug (#6895)
The if statement wouldn't trigger as defined which caused the incorrect data
offsets to be used. This resulted in corrupted textures and invalid memory
reads of uncompressed textures if the hardware texture detail slider was set
to anything other than max.
2025-08-01 22:36:54 -04:00
Taylor Richards ab438116d3 remove old os_sleep() hack for Mac (#6894)
SDL 1.2 had an issue using SDL_Delay() on Mac where it caused bad stuttering
and freezes. A hack was added to avoid this, but it causes 100% CPU usage when
it should be a sleep state, so it wasn't ideal.

With SDL 2 this issue was resolved with the underlying code being unified for
all *NIX variants and that problematic Mac-specific code was removed. So now
we can remove the hack to offer a little better performance on Macs.
2025-08-01 22:35:43 -04:00
wookieejedi dce9e1c031 Allow mods to cap rotational velocity from collisions (#6890)
The `+Rotation Factor:` value in the ship collide section of the ships table has been around for many years, but raising that value beyond the default of 0.2 results in ship collisions that can result in the colliding ship spinning at ludicrous rotational velocities that last for over 10 seconds (this is especially evident with long ships with high speeds).

This PR adds a field after `+Rotation Factor:` called `+Rotation Magnitude Maximum:` which serves as a maximum for the resulting rotational velocity from a ship collision in degrees per second. By default this is -1 and thus disabled.

Tested and works as expected, and now properly allows mods to have ships spin out if they have collision while not spinning out at wild speeds that look immersion breaking.
2025-08-01 22:31:40 -04:00
wookieejedi b5f3edc019 Fix engine not updating with change-ship (#6893)
* Fix engine not updating with change-ship

Yet another caveat of the change-ship function was discovered by Darius, who found that that both the 3D assigned engine sounds and the 2D throttle/cockpit engine sounds do not properly updated when a ship type is changed via sexp/script.

This PR fixes this by properly calling the respective clearing functions and it also resets the throttle sound check timestamp to ensure the 2D sounds are indeed updated on the next frame.

Tested and works as expected. Fixes #6892.

* cleanup for safety
2025-08-01 22:31:09 -04:00
BMagnu e28b3bb592 Remove unused enum in particle code (#6891)
* Remove unused enum

* remove comment as well
2025-08-01 01:33:29 +00:00
BMagnu 0a7fac447d Add particle curve input for number of existing particles (#6889)
* Add code to process global starts for modular curves

* Add particle curve input for number of existing particles
2025-08-01 02:05:08 +02:00
Taylor Richards 4c7e4feaf3 fix double dumbfire missiles for multi clients (#6888)
Dumbfire missiles are client fired for rollback purposes. However players would see
their missiles fire twice due to the server also sending a fire packet back to the player.
So we need to prevent the player that fired the missile in question from getting that
extra packet.
2025-07-31 15:09:30 -04:00
Taylor Richards bf84dbf34f fix invalid array index crash in debug message (#6887) 2025-07-31 15:08:56 -04:00
Taylor Richards b19c3e565b fix more particle issues with standalone (#6886) 2025-07-31 15:06:11 -04:00
Mike Nelson ffcf078f03 Preload asteroids and debris when config-field sexps are used (#6874) 2025-07-30 22:45:38 +02:00
Mike Nelson e52fa1edeb No need to display debris label on objects in the Debris list (#6877)
* No need to display debris label on objects in the Debris list

* remove the unnecessary loop
2025-07-30 14:04:04 -04:00
Mike Nelson 44952eb2d6 Fix some minor hud config color errors (#6881) 2025-07-30 14:03:34 -04:00
BMagnu 95d21a4085 Minor Particle Fixes (#6884)
* Fix scripted particle velocity

* Add error if no bitmaps were defined
2025-07-30 20:53:26 +09:00
Kestrellius 8f835fe34b check for global (#6882) 2025-07-30 07:52:46 -04:00
wookieejedi c26b0caeb8 Ensure Aspect_invulnerability_fix always works (#6879)
#6248 added an extra subtraction line to calculating when a bomb can be shot down `extra_buggy_time`, but that value should only be calculated if  `Aspect_invulnerability_fix` is off. Specifically, the `else if` checks on lines 79 and 97 of `collideweaponweapon.cpp` were getting hit even when `Aspect_invulnerability_fix` was enabled, so ensure that if that flag is on that it correctly keeps the `extra_buggy_time` at 0.

Fix works as expected, happy to edit or tune however.
2025-07-30 20:17:54 +09:00
Mike Nelson 85ebd316e1 Only show one warning for skipped fonts (#6880) 2025-07-30 20:17:09 +09:00
Kestrellius abc82bd323 Handle impacts for obscure code paths (#6848)
* handle healing weapons

* incorporate shield threshold features

* fix piercing sign error

* use function
2025-07-30 20:12:35 +09:00
BMagnu f374eadb45 Fix load order guarantees (#6883) 2025-07-29 18:24:51 -04:00
Kestrellius 3e77e1370d fix copy-paste error (#6878) 2025-07-29 15:24:32 -04:00
Mike Nelson 2ce4bdd55c get font scale options for lua (#6876) 2025-07-29 07:41:45 -04:00
Mike Nelson bbb838a332 custom data for personas (#6861) 2025-07-28 19:21:14 -04:00
wookieejedi 7a655e44da Fix p-spew with homing weapons (#6875)
#6808 converted all Pspews to use the new particle effects, though that in turn lead to a fun little visual bug. Overall, particles on weapons will only be rendered if they are valid, and the is valid check included a `weapon_state == m_weaponstate` check (IE states had to match between what the weapon object held and what the particle held. When a weapon switches to homing that particle state was never updated, b/c before 6808 it never needed to be. This lead to the particle effects from pspews not rendering when a missile was in homing mode.

This PR fixes that issue by also updating the particle host status whenever the weapon state changes (uses the same logic as when the particle spawns the first time).

Tested and works as expected.
2025-07-28 22:20:40 +00:00
Goober5000 2ed608b303 add smoothing field to volumetrics dialog (#6865)
FRED support for the smoothing field added in #6854.
2025-07-26 17:46:10 +02:00
John Fernandez b49dbfeaa4 Merge pull request #6832 from MjnMixael/team_colors_followup
Get, set, browse team colors with Lua
2025-07-26 07:54:21 -04:00
Asteroth bfacc16a51 Fix for single segment trails (#6864)
* fix single segmen trails when interrupted on both ends

* cleaner case handling

* remove wip stuff
2025-07-26 12:46:10 +02:00
BMagnu f96c73faac Fix unlit shader flag (#6873) 2025-07-26 01:22:44 +00:00
Taylor Richards 5fd06b40fe fix multi crash loading campaigns (#6871)
A minor bug in #6077 resulted in a crash loading campaigns on the multi ui.
The bug itself was not fatal, however it triggered a cascade of poor error
handling which led to a crash. A lot of these issues date back to retail.
This fixes the minor bug, and hopefully adds enough error handling to
preemptively squash a repeat of the crash problem.
2025-07-25 21:15:31 -04:00
Taylor Richards 21e35d0ded fix issue with turret/flak multi packets (#6870)
Normalized vectors sent over multi are never guaranteed to still be normalized
on the other side.
2025-07-25 21:14:39 -04:00
Taylor Richards 9dc6eb7248 fix particle related standalone error (#6869)
Standalone doesn't create particles so these checks will always fail.
2025-07-25 21:14:09 -04:00
BMagnu fcb257db59 Fix calculation of apparent size (#6872) 2025-07-26 03:04:44 +02:00
BMagnu fa5ee72770 Consider current RTT state for screenToBlob (#6867) 2025-07-26 02:53:44 +02:00
BMagnu 72ed863700 Prevent lua from garbage collecting possibly-stale subframes (#6866) 2025-07-25 22:06:00 +02:00
Kestrellius d6cb9892de account for add state (#6858) 2025-07-24 19:01:05 -04:00
Mike Nelson 021eb8e49a Fix two HUD Config preset issues (#6830)
* always use exact match

* custom gauges should use the type for colors with old preset files
2025-07-24 16:51:45 -04:00
Mike Nelson 487cac6456 Lua func to check if in game options are enabled (#6862) 2025-07-24 16:51:14 -04:00
wookieejedi f76bf1b8c4 Fix 'show-ship` not working (#6860)
Small one-line fix that follows up #6849. That PR removed the `!(Viewer_mode & VM_EXTERNAL))` check within a section of `ship_render_player_ship` to optimize insignia rendering, but turns out that check is needed to ensure `show-ship` properly works. This PR restores that check to fix this bug, and ideally the thoughts about slightly optimizing insignias can be considered later.

Tested and works as expected.
2025-07-24 22:33:52 +09:00
BMagnu 755c4c4e29 Fix Volumetric Nebula Bugs and Add Smoothing (#6854)
* Fix 3d tex generation

* Fix blending and emissive

* Add Smoothing

* Add smoothing parameter

* Correctly calculate fractional smoothing
2025-07-24 22:33:37 +09:00
wookieejedi 168b3310ab Cleanup of Shield Hitpoint Threshold (#6851)
* Cleanup of Shield Hitpoint Threshold

Overall cleanup that does a few things:

1) Changes `ship_is_shield_up` from integer to bool.

2) `ship_is_shield_up` was only ever called to look at one quadrant, never for all quadrants, so took the opportunity to update the 'all-quadrant' block to account for ships with a non-standard number of shield quadrants.

3) ` MAX(2.0f, Shield_percent_skips_damage * shield_get_max_quad(ship_objp)` was used many times throughout the code (and will be used at least 2 more times with #6848), so simply consolidated all of those uses into a new function called `ship_shield_hitpoint_threshold`. Happy to edit the name however.

4) Removed un-needed redundant comments from `ship_is_shield_up` definition in `ship.h` since those comments were already present in the actual function within `shield.cpp`, and all the other functions used comments in that file instead.

Again happy to tune or edit with any other choices.

* use proper default arg style

* actually commit the updated files

* appease modern clang

* clang round 2
2025-07-24 08:39:58 -04:00
Kestrellius 365d9c57e3 gate hull and subsys impacts (#6855) 2025-07-23 08:07:42 -04:00
John Fernandez 1d5fa5eef1 Merge pull request #6852 from MjnMixael/fix_rocket_ani_assertion
Remove rocket ani assertion
2025-07-22 21:15:35 -04:00
John Fernandez 05624b5092 Merge pull request #6856 from MjnMixael/fix_get_mod_root_name
Prevent string ops on nullptr char*
2025-07-22 20:50:50 -04:00
Mike Nelson 8be619db7e prevent string ops on nullptr char* 2025-07-22 19:19:31 -05:00
BMagnu 9b82daeefc Proper Ambient Light (#6849)
* Remove ambient handling from amin / decal pass

* Add ambient light to deferred pass

* Make decals work and fix double insignia rendering

* Fix decal vertex shader

* render insignias as decals

* Cleanup of old insignia stuff

* Move insignia post-processing to model load

* perform envmap lighting in deferred shader

* Remove Envmapping from main shader

* Fix MSVC warning

* exclude def_files from clang tidy
2025-07-22 00:17:22 +02:00
Mike Nelson c53daa325c Remove rocket ani assertion 2025-07-21 15:32:25 -05:00
wookieejedi 86622e1ce0 Fix Edge-case with $Preload briefing icon models: (#6850)
Found a very interesting edge case bug with `$Preload briefing icon models:.`

Situation: Mission 1 has a briefing which has a ship class A as the class (and thus loads the model), but the ship class A is not actually in that mission so no subsystems are loaded. Then in mission 2, the ship class A is actually in the mission but FSO tries to reuse the slot that was loaded, but realizes no subsystems were loaded and makes an error message. I that is because the preload code for the briefing icons on `missionparse.cpp` line 6664 just calls `model_load` but does not specify the subsystem argument.

 I've also attached a retail mod reproducible campaign (2 missions, first is 5 seconds long). When the second mission loads the incorrect subsystem warning appears.

This PR properly loads the subsystems and fixes the bug. Tested and works as expected.
2025-07-20 15:00:47 -04:00
Kestrellius 199c7b79ef Make sure global damage doesn't spawn impact effects (#6842)
* check whether damage is global

* use static

* remove extraneous arguments
2025-07-20 07:45:27 -04:00
wookieejedi 26e9ecab0e Allow mods to set threshold at which shield stops taking damage (#6847)
* Allow mods to set threshold at which shield stops taking damage

FSO logic dictates that shields collisions and any related sound or visuals related to shields are skipped if the shields are under 10%. This is rather unintuitive especially for mods, so this PR creates a game setting value that allows mods to set this value.

Also, this PR fixes a bug where the HUD shield gauge would try and incorporate this feature but did not do it correctly. Specifically, the gauge skips shield segment rendering if the raw shield strength was 0.1 not the percent. Incorrectly using the raw value results in HUD shields being rendered (albeit faintly) even if the damage was skipping the shield and directly damaging the hull. In other words, if the shield segment was 8%, the shield segment would show faintly even the shield is skipping damage.

Tested and works as expected. Also happy to discuss or answer any questions!

* update local variable name for clarity

* rename `ship_quadrant_shield_strength`

* cleanup with updated get percent function

* more cleanup

* wording and safety tuning

* use correct default number
2025-07-19 18:24:49 -04:00
Goober5000 d746ae4f1a Merge pull request #6844 from Goober5000/modular_poofs
allow modular nebula tables to not define bitmaps
2025-07-18 00:46:33 -04:00
Goober5000 5fbce060e6 Merge pull request #6845 from Goober5000/check_for_bools
make the `check_for_*` functions return bool
2025-07-18 00:46:25 -04:00
Kestrellius cb20a05967 Fix inverted piercing impact logic (#6843)
* fix piercing sign error

* more robust solution
2025-07-17 10:59:01 -04:00
Goober5000 07db2aabf5 allow modular nebula tables to not define bitmaps
This allows the first half of a modular -neb.tbm to be skipped, allowing just poofs to be specified without the need for a preceding empty bitmap section.  It's a follow-up to #5128 which allowed just bitmaps to be specified without the need for a subsequent empty poof section.
2025-07-16 22:57:23 -04:00
Goober5000 be46706081 make the check_for_* functions return bool
Small cleanup.
2025-07-16 22:56:34 -04:00
BMagnu 83282b6427 Actually take the power of 3 (#6837) 2025-07-16 03:06:54 +02:00
Goober5000 a4eeaa706e Merge pull request #6831 from Goober5000/fix_play_sound_from_file
fix play-sound-from-file with multiple variable-controlled streams
2025-07-14 20:19:12 -04:00
wookieejedi a224736543 Slots for custom post processing effects (#6827)
* Slots for custom post processing effects

Post processing effects such as tint or dithering have their uniforms hardcoded, which means the only want to create new post-process effects for a mod is to overwrite an existing effect.

Requested for DEM2, this PR creates 4 blank slots for mods to create new post processing effects--2 floats and 2 vec3. This approach to create blank slots for modders follows the successful strategy used for Custom_Controls 1-5.

Note, this PR also adds `tint` to the default `post_processing.tbl` which had it missing (even though tint is a valid effect with a valid uniform buffer already).

Happy to discuss more or edit however.

* fix ordering
2025-07-14 13:44:18 -04:00
Taylor Richards d055d03e53 get proper number of physical cpu cores on macOS (#6835)
* get proper number of physical cpu cores on macOS

macOS has an easy way to get the physical cpu count so let's use it. Also with
Apple Silicon there are performance and efficiency cores so we need to make
sure we ignore those low-perf cores when getting the count.

* improve error handling
2025-07-14 13:41:36 -04:00
BMagnu 4c80ad7243 Fix Thread Count Detection on Windows (#6834) 2025-07-14 14:01:24 +00:00
BMagnu 53394093a4 Limit the number of threads spawned (#6833)
* Limit the number of threads spawned

* Conversion on msvc
2025-07-14 22:14:40 +09:00
Mike Nelson ef631f9fe0 nested namespaces 2025-07-13 19:44:44 -05:00
Mike Nelson d58d924f3e Get, set, browse team colors 2025-07-13 19:23:02 -05:00
Goober5000 8375b33998 Merge pull request #6810 from Goober5000/display_name_update
update handling of display names
2025-07-13 20:11:09 -04:00
Goober5000 3be99b2480 fix play-sound-from-file with multiple variable-controlled streams
Since this sexp was implemented, there has been a bug that prevented multiple variable-controlled audio streams from working.  One default and one variable-controlled stream could coexist, but any subsequent variable-controlled stream would reuse a previous stream's handle if the variable's current value was a valid handle.  This adjusts the code to properly create a new handle for every invocation of the sexp with a variable.

The following cases have been tested and now all work properly:
1. The default handle by itself
2. One variable handle by itself
3. One variable handle with one default handle
4. Multiple variable handles
5. Multiple variable handles with one default handle

Follow-up to #2115.
2025-07-13 20:02:06 -04:00
Taylor Richards 7811207ca9 fix decal shader compile error (#6829)
On macOS the new decal shaders (#6813) fail to compile with the following
message: "interpolation qualifier 'flat' must precede storage qualifiers".
2025-07-13 23:19:32 +02:00
Goober5000 dd72784f28 Merge pull request #6826 from Goober5000/sexp_help_newlines
ensure SEXP help has appropriate newlines or spaces
2025-07-12 19:40:04 -04:00
Goober5000 22feeddc6f ensure SEXP help has appropriate newlines or spaces
Some SEXP help did not have newlines separating what should be separate lines of text, or spaces separating what should be separate words.  Add newlines or spaces where appropriate.  (Regexes are A-1 SUPAR.)
2025-07-12 18:43:17 -04:00
BMagnu 6c35dac535 Allow autodetection of number of cores for threading (#6824)
* Allow autodetection of threads

* cleanup
2025-07-12 22:19:23 +02:00
BMagnu 8e64845cf1 Make sure to close the g3 frame (#6825) 2025-07-12 19:02:40 +00:00
BMagnu bdde909fa6 Threading Framework & Threaded Collisions (#6814)
* Dispatch ship weapon collisions and defer handling

* multithread ship weapon collision

* properly spin

* proper memory order

* externalize generic threadpool settings

* Wait for threads to shut down

* Add result pipelining

* cleanup

* incorrect nullopt type

* randomrange todo

* parallelize ship ship collisions

* bogus debug return

* remove warnings

* clang tidy
2025-07-12 11:41:30 +02:00
Kestrellius 6921f550c1 Enhanced functionality for conditional impacts (#6785)
* add new conditions

* don't worry about it

* implement new conditions

* bugfixing

* handle pokethrough differently

* clang for the clang god

* appeasement

* to the last i grapple with thee

* from hell's heart etc

* bugfixing

* support hits while dying

* fix shield math, cleanup

* fix memory error
2025-07-12 11:40:53 +02:00
Goober5000 06eaf94cb3 Merge pull request #6804 from Goober5000/stably_sorted_map
sort map keys before saving a container
2025-07-12 00:42:05 -04:00
Goober5000 d7fdf7b079 Merge pull request #6820 from Goober5000/fix_newlines_on_comments
fix broken newline behavior when FRED saves missions
2025-07-11 23:56:43 -04:00
Mike Nelson b9b64fe49d Show team colors with Lua rendering methods (#6802)
* get set team colors with lua's rendering methods

* fix for checks

* tweak

* add includes
2025-07-11 22:01:33 -04:00
BMagnu 218d8c09be Rely on bound vai's rather than try to retrieve them (#6822) 2025-07-11 16:13:25 -04:00
BMagnu bda54ffe83 Fix some things in the particle code coverity flaggedf (#6821) 2025-07-11 14:35:07 +00:00
Goober5000 b03301897e Merge pull request #6816 from Goober5000/model_memory_safety
memory safety for model parsing
2025-07-10 22:02:07 -04:00
Goober5000 32fcb8ccba fix broken newline behavior when FRED saves missions
Ever since retail, when encountering a comment, FRED would add an extra newline and mix `\r` with `\r\n`, often causing other bugs.  The reason for this is subtle.  C and C++ library functions will automatically convert `\n` to `\r\n` and back again when reading and writing in text mode, but FRED mission files are read in binary mode and written in text mode.  Normally the parsing code can accommodate reading raw newlines of any type, but comments are copied verbatim from what is read to what is written.  A comment ending in `\r\n` will therefore be written as `\r\r\n` which will add an extra incompatible newline.

At one point (in commit a988f5eab2) a fix was made for this, but it only applied to multiline comments, not all comments.  Therefore, this PR moves the fix to a common function and uses it for all comment styles.
2025-07-10 21:57:17 -04:00
Goober5000 86851fe0d2 make other compilers happy by only using the comma trick on debug mode 2025-07-10 15:10:19 -04:00
Goober5000 a565c8e76d memory safety for model parsing
Add assertions to the model parsing macros to guard against accessing out-of-bounds memory.  Patch the model parsing routines to avoid going out of bounds, even if the out of bounds situations are temporary and benign.
2025-07-10 15:10:19 -04:00
BMagnu 44ed242aee Make pspew warning a bit less annyoing (#6819) 2025-07-10 21:26:12 +09:00
Goober5000 145a34eeac Merge pull request #6806 from Goober5000/script_eval_multiline
make script-eval-num and script-eval-bool multiline
2025-07-09 20:38:18 -04:00
Goober5000 1e27a6bed3 Merge pull request #6817 from Goober5000/fix_qtfred_crash
fix qtfred memory corruption
2025-07-09 20:37:20 -04:00
Goober5000 84905f0789 Merge pull request #6818 from Goober5000/qtfred_cleanup
qtfred cleanup
2025-07-09 20:36:48 -04:00
BMagnu a52f31f748 Instanced Decals (#6813)
* prepare instancing

* Render single decal with instance-like buffer

* encode per-instance data in the instance matrix

* Actually render decals instanced

* Update todo commit

* actually add stubs

* Gate decal preparation behind GPU capability flag

* Fix MSVC warnigns

* remove explicit layout

* Fix MSVC warnigns 2

* Clang Tidy
2025-07-10 00:51:04 +02:00
Kestrellius 62c8260d26 add flag (#6815) 2025-07-09 12:08:53 -04:00
BMagnu 82dfdbc962 Cleanup of Level 0 Particles (#6808)
* Make scripting use the full-blown particle system

* Add reverse option

* Add animation reversal as an option to modern particles

* Start implementation of beam particles

* Add multi-emission particle source API for legacy particles

* Attach beam muzzle particles to the correct host

* Reorder code in order to facilitate apparent visual size as modular curve input for particles

* fix lua api

* Typo

* Fix scripting and beam muzzle particles

* Remove muzzleflash code, prepare to replace with particles

* Begin mflash effect conversion

* Pass final parameters to mflashes and fix curve

* Remove deprecated particle function

* Add debris flame particles

* remove weapon_explosion table

* Convert shield explosion particles

* Fix modular curve full inputs and convert particle curve inputs accordingly

* Allow particle volume offset and rotation with curve-based rot around fvec

* Add Ring and Point Volumes

* Convert PSPEW to new system

* Make particle curve timing aware of interp

* Update todos

* get rid of performance waste

* Add last parameter for converted pspews

* Fix pspew bugs

* Fix direction for default pspew

* Fix order for voluem rotation

* particle vel interp

* particle vel interp 2

* Make beam muzzle stay parented to the firing ship, as it's likely the more commonly intended variamnt

* fix scripting particle lifetime

* Allow beam muzzle particle override

* Skip invalid pspews

* remove pspew dcf code

* Fix sparkler stretch

* Correct sparkler bia

* General sparkler weirdness

* Tune distribution of sparklers

* Convert Asteroid particles

* Fix conversion warning

* Fix conversion warning again

* Fix conversion warning again again

* Really clang?
2025-07-09 16:47:14 +09:00
Goober5000 220ff6752b Merge pull request #6805 from Goober5000/warn_about_bitmap_fonts
change this WarningEx to a Warning
2025-07-09 02:40:11 -04:00
Goober5000 bd767ece09 qtfred cleanup
Various cleanup associated with the `toStdString()` function in qtFRED.  Now that `lcase_equal` exists, it is no longer necessary to compare the C strings.  Additionally, QString has its own `isEmpty()` function.
2025-07-08 23:06:20 -04:00
Goober5000 f60fe6dfc2 Merge pull request #6807 from Goober5000/subsystem_enhancements
subsystem scripting enhancements
2025-07-08 23:01:30 -04:00
Goober5000 342958b99f fix qtfred memory corruption
Fix a qtFRED memory access bug when checking for autosaved files.  Passing a temporary variable to a function as a reference, then returning it, led to a dangling reference access.  Rewrite the `maybeUseAutosave` function to avoid this.
2025-07-08 22:31:56 -04:00
BMagnu 497b834766 Speed up random range creation (#6812) 2025-07-08 14:26:43 +02:00
Kestrellius 8989b6e925 make change (#6809) 2025-07-08 11:05:26 +02:00
BMagnu 650b8d4f07 Disable uneccesary raycast (#6811) 2025-07-08 11:05:11 +02:00
Goober5000 672aa7f81f apply display name updates to jump nodes too 2025-07-07 03:25:35 -04:00
Goober5000 d99c4ca172 add display name text field to ship editor 2025-07-07 03:25:35 -04:00
Goober5000 fe1540c8a4 add 'Always save display names' option 2025-07-07 00:17:24 -04:00
Goober5000 df1126923d alphabetize accelerator keys, sort editor menu, sort ship dialog 2025-07-07 00:17:24 -04:00
Goober5000 8dc03b0fff additional submodel scripting enhancements
4. `__eq` functions for models and submodels
5. Store model and submodel IDs, not pointers
2025-07-05 16:05:19 -04:00
Goober5000 1b75fea06c subsystem scripting enhancements
Add several API features to improve scripting support for subsystems.

1. A `CanonicalName` virtvar to provide a clear way to get subsystem names for indexing and referencing
2. `Submodel` and `SubmodelInstance` virtvars to get the submodel information associated with the subsystem, if it exists
3. A `getSubsystemList()` function to provide a subsystem iterator
2025-07-05 16:05:19 -04:00
Goober5000 87021dd1d2 make script-eval-num and script-eval-bool multiline
These sexp operators can be enhanced to allow multiline scripts while retaining backwards compatibility, so do so.
2025-07-02 01:39:51 -04:00
Goober5000 3a380a05c9 change this WarningEx to a Warning
I just finished helping a modder debug his mod, and it would have saved him a lot of time and trouble if this WarningEx had been a Warning.
2025-07-01 23:20:18 -04:00
Goober5000 2e7f37ef7a sort map keys before saving a container
Applies a stable sort to the keys of a map container before saving the container to the mission file.  The underlying container is not modified.  Implements #6803.

(Lists are not sorted because the mission designer might have a particular order in mind for them.)
2025-07-01 21:57:04 -04:00
wookieejedi dbe0af1a24 Allow Custom Gauges to fully use parent type colors (#6799)
* Allow Custom Gauges to fully use parent type colors

#6670 allowed for custom coloring of HUD gauges, so this PR follows that up with fixing a few edge cases where mods with custom gauges that are linked to parent gauge types accurately reflect the color of their parent gauge type in both the new saved HUD file and the in-mission HUD.

This ability to link color to parent gauges for custom gauges the player cannot edit is what the behavior has always been, so this PR does not change any expected behavior it simply ensures that the new HUD updates and various combinations of table entries for `Config` are all robustly accounted for. For example, in FotG we have multiple non-configurable custom gauges all tied to the center reticle, so if the player changes the color of the center reticle all the custom gauges set to that type also automatically change color.

Tested and works as expected.

* appease clang

* one more clang

* clang needs to calm down

* instruct clang to be calm

* fix comment typo
2025-06-30 12:53:13 -04:00
wookieejedi f95ae0b1bd Prevent Potential Memory Problems with squadmsg hook function (#6801)
* Prevent Potential Memory Problems with squadmsg hook function

Within `hud_squadmsg_run_order_issued_hook` it is possible for the calling code to pass `nullptr` as the target parameter, which would cause memory problems with the several instances of `Objects[target->objnum]`. This PR mitigates that potential while testing of  `hud_squadmsg_run_order_issued_hook` still works as expected.

* add more safety
2025-06-30 12:14:28 -04:00
wookieejedi 94dac6b3d2 Prevent Bad Preset Names by Tuning Allowed Characters (#6800)
On current master players have the ability to name their control preset `...` which creates issues with Windows. This 1-line PR allows that the only non-alphanumeric characters allowed in the control preset name are `-` or `_`.

Tested and works as expected.
2025-06-30 08:22:27 -04:00
Goober5000 11a33fe42e Merge pull request #6347 from Goober5000/electrical_arc_enhancements
Enhancements to the FSO electrical arc system
2025-06-29 23:38:24 -04:00
Goober5000 821e48d188 Merge pull request #6798 from Goober5000/message_memory_fix
fix builtin_message memory usage
2025-06-29 22:49:56 -04:00
Goober5000 c68f8d71e4 Merge pull request #6796 from Goober5000/comm_menu_update
a few refinements to the new comm node selection feature
2025-06-29 17:11:18 -04:00
Goober5000 5380d88680 small optimization to get_builtin_message_sender() 2025-06-29 16:32:03 -04:00
Goober5000 3605f66e6d fix builtin_message memory usage
Since `builtin_message` might store strdup'd names, we might need to free them when the struct is destroyed.  Add a destructor for this purpose, and add corresponding constructors per the Rule of 5.

(Use `vm_strdup` rather than `strdup` for enhanced memory tracking.)
2025-06-29 16:32:03 -04:00
Goober5000 329974b4bf a few refinements to the new comm node selection feature
1. Don't display the selection arrows until the selection is actually moved, to avoid interfering with the standard selection feature
2. Use static variables and the new `TIMESTAMP` data type
3. Minor cleanup

Follow-up to #6736.
2025-06-29 00:05:48 -04:00
BMagnu 06227bbc80 fix cmake for debugging (#6795) 2025-06-27 12:24:35 +00:00
BMagnu a918ef0b6f Allow slot 0 hud RTT (#6794) 2025-06-27 14:07:31 +02:00
wookieejedi 9e731279eb AI Cleanup and Flag Fixes (#6788)
* AI Cleanup and Flag Fixes

This PR does 3 things.

1) Cleanup `ship_subsystem_in_sight` so it properly returns a bool, which is the return type of the function. Also update `ai_big_maybe_follow_subsys_path` to be a bool instead of int.

2) Adds `+subsystem attack pathing extra distance:` for use within `"$improved subsystem attack pathing:"`. FotG found, especially with the new strafing values we use, could really use the ability to set at what distance `ai_new_maybe_reposition_attack_subsys()` determines if it wants to pick a new point or not. By default the value was 2000.

3) In FotG we started using the `standard_strafe` mode more now thanks to #6511, but we have now discovered some inherit issues with it, namely that it will prematurely trigger `ai_big_strafe_maybe_retreat` because the distance it uses for determining if a collision is going to occur is `dist_normal_to_target`, which commonly resulted in the AI flying to a point to start a strafe, then thinking it would collide with the target and then retreating from strafe mode, only to realize it was now far enough to re-engage strafe mode, which commonly resulted in AI just flying around not accomplishing much. This PR adds a flag which instead uses the `distance_to_target` and a check to see if the ship is even facing the target.

Overall all are tested and work as expected. Happy to change or tune however requested, especially regarding point 3.

* clang cleanup

* cleanup copy paste name

* remove un-needed exposed float
2025-06-26 08:05:31 -04:00
wookieejedi 742dd074ee Allow Display Name to be used in Kills Stats by Ship Class (#6791)
* Allow Display Name to be used in Kills Stats by Ship Class

Currently, the display that is shown for kills by ship type does not use display name of the ship class, which makes the ship classes look different than the other areas where they are displayed throughout the game. This PR fixes that by using display name when rendering the kill stats. Note, this PR does not edit the pilot file structure at all, it simply just tunes how the names are displayed/rendered.

Importantly though, display names do not have to be unique, while the ship class names do. Thus, this PR also consolidates the number of kills of ship classes with the same display name (For example, FotG uses classes like `X-wing#Red` and `X-wing#Blue`, but both have the same display name of `X-wing`, so this consolidation means FSO will simple display `X-wing` with the sum. Overall, mods not using display name will be unaffected, while mods that do use display name will now have it properly work in the barracks and debrief rendering.

Tested and works as expected.

* remove flag for now

* move assert

* use handy get_display_name
2025-06-26 08:01:15 -04:00
wookieejedi f1a25ab47d Per Request add flag for $Disabled or disrupted engines are silent: (#6792)
* Per Request add flag for `$Disabled engines are silent:`

Follow-up to #6781 as there are modders who use engine sound as ambient sound. Also cleans up the sound engine disabled logic.

* cleanup name

* update flag name
2025-06-25 07:50:46 -04:00
wookieejedi d3db542640 Expand collision avoidance to strafing (#6789)
Currently, the `$better combat collision avoidance for fightercraft:` flag only checks for possible big ship collisions when in normal chase mode (`AIM_CHASE`), but strafing a big ship is a separate AI mode (`AIM_STRAFE`). Per discussion with Asteroth, strafe attacking should also check for better collision avoidance, as the modder likely would expect that to fall under this AI flag. Also took the chance to make the collision avoidance check into a function to improve maintenance and usability.
2025-06-24 23:01:47 -04:00
Goober5000 74beab5177 Merge pull request #6790 from Goober5000/order_fixes
clean up Target virtvar in order.cpp
2025-06-24 21:56:06 -04:00
Goober5000 2a62f04d72 clean up Target virtvar in order.cpp
Several refinements:
1. Make the case labels consistent between the setting and getting of the virtvar, for ease of comparison and troubleshooting.
2. Consolidate CHASE_WING and GUARD_WING for setting, like they already are for getting.
3. Consolidate STAY_STILL for getting, using one simple trick.
4. Remove the KEEP_SAFE_DISTANCE goal, since it has no target. Fixes #6761
5. Fix CHASE_SHIP_CLASS which put the getting case in the setting section, and consequently did not handle setting.
2025-06-24 02:14:20 -04:00
wookieejedi acf367e66a Edge case fix for Always_show_directive_value_count (#6787) 2025-06-23 20:26:22 -04:00
Goober5000 c5d5a93766 address feedback 2025-06-22 01:37:54 -04:00
Goober5000 f0ee1e2f7c electrical arc upgrade, stage 4: add a new ModifyElectricArcPoints function with a handy valueToVec3d utility function 2025-06-22 00:46:14 -04:00
Goober5000 47025a79d7 electrical arc upgrade, stage 3: add support for customizing segment depth and using persistent arc points 2025-06-22 00:46:14 -04:00
Goober5000 305af2a1ce electrical arc upgrade, stage 2: make arrays dynamic 2025-06-22 00:46:14 -04:00
Goober5000 5732183471 rename debris spark timestamps, per Asteroth 2025-06-22 00:46:14 -04:00
Goober5000 611de4d060 fix scope of ship arc sound generation
The code for generating spark sounds was incorrectly copied from debris to ships, dating all the way back to retail.  The sound should be played once per generation event, not once for every electrical arc active on the ship.  This fixes a bug that caused overlapping electrical arc sounds.
2025-06-22 00:46:14 -04:00
Goober5000 8270a38505 electrical arc upgrade, stage 1: refactor data structures 2025-06-22 00:46:14 -04:00
Goober5000 73e82d9440 Merge pull request #6786 from Goober5000/schroedinger_goals
schroedinger AI goals
2025-06-22 00:43:33 -04:00
Mike Nelson 6a1ae81bcb Add method to get a font's font family (#6782)
* Add method to get a font's font family

* nullptr

* add more safety checks

* pass font data instead of font data members

* return an empty string instead of unknown
2025-06-20 14:27:34 -04:00
Goober5000 035334878b schroedinger AI goals
The new enum class collection of AI goal modes did not handle the superposition of states that could occur when multiple ships were selected in FRED.  Add a special FRED-only state for this purpose.
2025-06-20 03:40:30 -04:00
wookieejedi 54c00ce205 Two Sound Updates (#6781)
* Two Sound Updates

On current master, destroyed engines still make noise and the `Engine Minimum Volume` is not used by big ships. This PR makes two new game settings flags which allow mods to mitigate those issues (`$Unify minimum engine sound:` and `$Disabled engines are silent:`).

Tested and works as expected.

I also added both of these to the 25.0 default, but happy to alter however.

* disabled eng snd does not need flag fix

* ensure retail large ships still sound loud
2025-06-19 22:38:12 -04:00
John Fernandez a9664ff22f Merge pull request #6752 from Goober5000/stay_near_target_fix
fix STAY_NEAR_TARGET_ITEM
2025-06-19 19:44:55 -04:00
Mike Nelson b5f4942cd3 fix hud config sliders (#6784) 2025-06-19 16:41:45 +00:00
wookieejedi 9141f1e9ed Allow Mouse Wheel to work with trigger type controls (#6779) 2025-06-18 17:35:28 -04:00
wookieejedi 26477276da Allow modders to tune Comms Styling (#6776)
This PR adds two new localization strings, which allow modders to change how the numbers in the comms menu are displayed, and it incorporates styling for the comms selection controls from #6736, too.

Tested and works as expected.
2025-06-17 22:58:45 -04:00
Asteroth 821d16192f guard against no model viewer object (#6780) 2025-06-16 07:57:49 -04:00
Mateusz Uberna 5864ec4e7e Comms menu controls (#6736)
* Added new keybinds, keycontrol handlers,  hudsquadmsg methods for alternate communication menu control scheme

* .gitignore update. CMake in VStudio places builds in [Oo]ut/ folder by default

* Added support for menu pages

* Small formatting cleanup

* code cleanup

* removed unecessary variable

* Updates after code review

* Updated comments

* XSTR_SIZE correction
2025-06-14 13:27:01 +00:00
wookieejedi c31c258679 Allow +Debris Density: (#6775)
* Allow `+Debris Density:`

Looks like when `+Debris Density` got added it never accounted for a colon like the other fields

* comment
2025-06-13 22:14:48 +00:00
wookieejedi c307ef7600 Allow ship debris pieces hitpoints depend on radius (#6771)
* Allow ship debris pieces hitpoints depend on radius

Currently, ship debris pieces have their hitpoints set via a Max and Min range. This constricts modders by needing all debris pieces to have somewhat the same size, otherwise the uniform random hitpoints assignment will could make small pieces much stronger than big pieces.

This PR adds a new field `+Hitpoints Radius Multiplier:` which is just a value that multiplies the debris radius, this value, and the debris hitpoints to calculate a final hitpoints value for the spawned debris piece.

This multiplier thus allows modders to have debris pieces that are very large have much strong hitpoints then debris pieces that are very small.

* incorporate feedback fix

* match other logical checks
2025-06-13 12:43:08 -04:00
Kestrellius 2701544822 Improve 'laser anim state add' curve output (#6773) 2025-06-12 21:33:29 -04:00
Mike Nelson 4ad015881d Lab dock tester (#6715)
* Add docking and undocking test to the Lab

* address feedback
2025-06-12 14:46:20 -04:00
Mike Nelson 43b36fad20 fix fred view not rendering (#6772) 2025-06-12 14:32:26 -04:00
John Fernandez 3dd2c38cef Merge pull request #6764 from scp-fs2open/dependabot/pip/ci/post/requests-2.32.4
Bump requests from 2.32.0 to 2.32.4 in /ci/post
2025-06-11 21:42:50 -04:00
BMagnu cfd3b716ba Fix FastDbg builds (#6770)
* Actually pr-test fastdbg

* Set embedfile msvc runtime

* Restructure toolchain files so that embedfile is also built accordingly

* Conditional AFXDLL

* Set iterator level globally
2025-06-11 22:21:51 +09:00
BMagnu d76f38320a Properly adapt the other workflow runs as well (#6769) 2025-06-11 06:41:46 -04:00
BMagnuandTyler Blount da58556787 Library updates, Win2022 CI, CMake 4 Compat (#6766)
* Update nightly build to use windows 2022

* Update build-release.yaml

* Update build-test.yaml

* Update test-pull_request.yaml

* Upgrade to CMake 3.21+

temp commit

* remove cotire due to incompatibilities

* Update dependencies to compile on CMake 4 with no warnings

* Update ANTLR4

* Update GTest

* Fix Windows CI

* Fix case sensitive ANTLR include

* Fix naming issues and disable shared ANTLR+

* Include Mess for MSVC

* fix new windows signed/unsigned compare warning

* FRED2 linking settings

* Don't clang tidy gtest

---------

Co-authored-by: Tyler Blount <[email protected]>
2025-06-11 02:00:23 +02:00
Mike Nelson 78d6a4b881 Ensure lua context is used for image drawing and string sizes (#6765) 2025-06-10 19:04:06 -04:00
BMagnu 1180f8762a Fix them oopsies (#6768) 2025-06-11 00:23:33 +02:00
BMagnu f342925763 Always enable window_res (#6767) 2025-06-11 00:23:25 +02:00
wookieejedi 2ec1553898 Fix few small bugs (#6755)
* Fix two small visual-based bugs

PR fixes/cleans up two small visual bugs/clean-up aspects.

1) If a mod uses the autoaim frame feature of the center reticle (IE the center reticle switches to a second bitmap if a target is within the autoaim cone), then there is currently an edge case bug where if the player's target dies while in the autoaim cone, the value tracking whether or not to use the autoaim frame is never reset to false. This results in the autoaim frame remaining even when the target is dead and long destroyed. This PR properly resets the autoaim bool to false if the target is not valid, and overall works now as expected.

2) #6555 moved warp options to tables instead of via in-game options, but there was a line of code that still referenced `WarpFlash`, where that option was forced off in standalones. This PR properly removes that line and instead puts the standalone check as part of the input warp queue function.

* also cleanup techroom subsystem loading
2025-06-10 14:45:50 -04:00
dependabot[bot] bfb8c70831 Bump requests from 2.32.0 to 2.32.4 in /ci/post
Bumps [requests](https://github.com/psf/requests) from 2.32.0 to 2.32.4.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.0...v2.32.4)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.32.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2025-06-10 08:18:07 +00:00
BMagnu e8bb54c36d Add "Move End Position by target velocity" (#6760)
* add "Move End Position by target velocity"

* Enable the functionality for slashbeams as well
2025-06-10 03:29:36 +02:00
Mike Nelson 6115a34d13 fix hudmessage rand (#6758) 2025-06-09 17:06:33 -04:00
Mike Nelson cc7f067e0f Use RAII guard to ensure lua context is always closed (#6757) 2025-06-09 17:06:18 -04:00
Mike Nelson 8410ed0249 Lab asteroid viewer (#6710)
* Allow viewing asteroid and debris objects in the Lab

* Address feedback

* Minor UI string tweak
2025-06-08 14:37:12 -04:00
Mike Nelson 4d39287de1 LuaLS meta file generation (scripting.lua) (#6516) 2025-06-08 11:29:30 -04:00
Kestrellius ad5b2372fa A couple of particle-related fixes (#6754) 2025-06-07 10:49:49 -04:00
Goober5000 546d0af38b Merge pull request #6751 from Goober5000/scripted_movie_audio
enable audio in movie files with this one simple trick
2025-06-07 00:45:56 -04:00
Goober5000 939d6a50c2 additional fix for STAY_NEAR_TARGET_ITEM
When issuing the stay-near-target order via hud squad message, default to a distance of 300, the same as the sexp.
2025-06-07 00:09:36 -04:00
Goober5000 3783cb0d1d fix STAY_NEAR_TARGET_ITEM
1. Allow "Stay near me" and "Stay near my target" to work even if the teams do not match
2. Allow "Stay near my target" to be issued regardless of team
3. Avoid divide-by-zero errors when running `ai_stay_near()`
2025-06-07 00:06:19 -04:00
BMagnu 0399e13e3d Fix window_res related bugs (#6753) 2025-06-06 19:33:55 +02:00
Goober5000 0bf5714dd5 Merge pull request #6725 from Goober5000/time_lib_stuff
enhance scripted time library a bit
2025-06-05 23:15:55 -04:00
Goober5000 6ddb57b6c2 Merge pull request #6744 from Goober5000/script_debug_console_commands
add a few debug console commands for running scripts
2025-06-05 23:15:46 -04:00
Taylor Richards 552f9990d9 remove support for memory mapped files (#6748)
FSO doesn't appear to use this any longer. And even when it was enabled the
requirements made it largely useless anyway. Removing to clean up cfile a
bit and so we don't have to keep maintaining it.
2025-06-05 17:53:13 -04:00
Taylor Richards 9e9fc22b13 fix type conversion issue in vecmat (#6749) 2025-06-05 08:02:02 -04:00
Goober5000 c04a23e4f9 add a few debug console commands for running scripts
We have debug commands for sexps, so here are a few for scripts.  These will be very useful for script developers to perform diagnostics and troubleshooting.
2025-06-05 00:40:52 -04:00
Goober5000 a3aea10889 enable audio in movie files with this one simple trick
Turns out, audio works in scripted movies just fine.  So, add a parameter to the Lua API to allow movies to play audio.
2025-06-04 23:58:58 -04:00
Mike Nelson 829edaaa3e Fix Lua API polluting the game context (#6739)
* split rendering values into lua and fso contexts

* address feedback
2025-06-04 09:43:33 -04:00
Kestrellius 3cf3aa9ecd Launch curves followup (#6742)
* this went very badly

* fix burst mult bug

* increment multi

* fix uninitialized variable

* fixes

* further fixes

* concision
2025-06-04 07:07:14 -04:00
wookieejedi 6e7128f26c Mod setting to disable shield effects (#6746)
Mods like FotG do not use the FS style shield hit effects, and simply disabling the shield rendering and checking is useful with one simple global variable.

Tested and works as expected.
2025-06-04 07:06:46 -04:00
Goober5000 921c597f30 Merge pull request #6709 from vmedea/fix-vulkan-build
Fix Vulkan build issues, enable Vulkan build in CI
2025-06-03 21:44:29 -04:00
wookieejedi 66a85113a7 Very small debug log cleanup (#6747) 2025-06-03 21:07:05 -04:00
Asteroth 7502cf37da Stationary jump types should not try to avoid collision (#6738)
* no sweeper jump collision avoidance

* few adjustments

* only use short range distance check
2025-06-02 21:57:41 -04:00
Kestrellius 787c19e71f Fix laser frustum culling (#6741)
* the naive method

* bugfixing

* respect radius
2025-06-03 00:46:27 +02:00
Mara Huldra 20ad23396c clang-tidy: Pass Vulkan defines
`clang-tidy` doesn't pass in the compilation flags normally provided by cmake,
so add the vulkan flags manually to make sure that everything is checked
as it should be, and thus prevent it from choosing the static dispatcher
and complaining about `.init()` being used.
2025-06-02 10:20:37 +00:00
Goober5000 4bc0a21432 Merge pull request #6745 from Goober5000/object_flag_documentation
update object flag documentation
2025-06-01 22:16:31 -04:00
Goober5000 d55061981e update object flag documentation
Fix one copy-paste error (for `Object_Flags::Collides`), and update the other descriptions as these flags can apply to any object, not just ships.
2025-06-01 21:25:49 -04:00
Goober5000 2cb76e8d70 revise documentation 2025-06-01 21:04:15 -04:00
BMagnu e1810ed522 Allow curves to be tabled inline (#6674)
* Add inline curve definitions

* Fix comma parsing

* Fix cast

* Incorporate feedback

* Fix parsing call
2025-06-02 01:41:06 +02:00
BMagnu dd62bc2033 Fix type mismatch (#6743) 2025-06-01 19:25:24 -04:00
BMagnu b3a1b8fc62 Get cross-compilation working again. (#6652)
* Get cross-compilation working again.

* Improve user handling
2025-06-02 00:48:54 +02:00
Tyler Blount 6c193860b5 Add Vulkan Build Checks 2025-06-01 13:30:53 +00:00
Mara Huldra b8634ec7eb ci: Switch to new Linux docker image
Switch to the new Linux docker image with Vulkan headers from
scp-fs2open/docker-images#7, for all github builds.
2025-06-01 13:30:01 +00:00
Mara Huldra 566d8f3e21 Explicitly ignore return values from Vulkan functions in RenderFrame
Because these functions can return statuses that aren't strictly an
error (and thus don't raise an exception), but might have to be handled,
they return a `vk::Result` that's `[[nodiscard]]`. Ideally some of the
result statuses would be handled here, but to get it to compile, cast
the result to void.
2025-06-01 13:30:01 +00:00
Mara Huldra 2f74acad1c Fix invalid assignment in Vulkan renderer
In 133b033ea0, SCP_vector was made into a
subclass, so direct assignment from the vulkan-hpp result isn't possible
anymore. Use an intermediate vector.
2025-06-01 13:30:01 +00:00
wookieejedi 78d2e663d7 One fix and one enhancement to AI shield behavior (#6737)
* One fix and one enhancement to AI shield behavior

This PR adds one fix and one enhancement to AI shield behavior.

1) Fix: Testing, especially in FotG, revealed an edge-case bug with shield management where the AI will not direct shield energy to a quadrant if it was hit when that quadrant was down. In other words, if a shield quadrant is knocked down to 0 and continues to be shot the AI will not realize it needs to direct energy to that quadrant. This is because `quadrant` is set to -1 if a shield segment is down. This ensures that the resulting effects and damage calculations properly ignore that quadrant downstream, but it also results in `aip->last_hit_quadrant` being set to -1. This PR adds a fix to properly record which shield was actually hit, so that the AI knows to direct energy to that quadrant.

2) Enhancement: In combat situations with fire coming from many directions, it is good practice to keep shields equalized, so this PR adds a flag for the AI to always attempt to balance shields, even if it is being fired upon (instead of the current behavior to always direct energy to the hit shield quadrant).

Both flags are tested and work as expected.

* fix copy paste

* rename to avoid previous confusion

* also make as ai class flag
2025-05-30 21:24:01 -04:00
Kestrellius 106afbe2ee scale effects for muzzle and hits (#6731)
* scale effects for muzzle and hits

* move calcs into if block

* aesthetics
2025-05-27 12:04:15 -04:00
Mike Nelson 25dbfc666b Misc hud config fixes (#6727)
* Fix crash when clicking inside the hud area but not on a gauge

* add dogfight_variant weapon flag for sorting purposes

* fix weapon display for default hud and skip dogfight weapons on auto-select

* cleanup the mouse check function
2025-05-27 08:55:12 -04:00
Kestrellius 66d9335dab Weapon launch curves (#6732)
* it's broken and i don't like it

* it's fixed and i approve

* add multi support maybe

* appease clang

* appease clang ii: electric boogaloo

* const refs

* increment multi version
2025-05-27 00:48:40 +02:00
BMagnu b3c3627f54 Allow using seeded noise for particle velocity and spawn position offset (#6675)
* Add noise backend for particles

# Conflicts:
#	code/particle/ParticleEffect.cpp

* noise frontend

* Proper scaling for noise

* make normalize safe
2025-05-26 20:43:56 +09:00
Mike Nelson 5078826340 Lab Weapon Viewer (#6704)
* Activate Lab Weapon viewer

* Allow displaying weapon tech models

* check for a valid tech model when switching

* enable render options for weapons and tech models

* Some cleanup

* Clang

* address feedback
2025-05-26 07:40:08 -04:00
Kestrellius ce4522d4bd tiny optimization (#6733) 2025-05-26 07:39:18 -04:00
Goober5000 778e2a5cb9 enhance scripted time library a bit
1. Add __tostring functions for both the `l_Timestamp` and `l_TimeSpan` types
2. Add a `getSeconds` function for the `l_Timestamp` type
2025-05-21 23:37:04 -04:00
Goober5000 2e65831fa2 add int64 support to toolchain, and fix errors
Add `UINT64_T_ARG` and `INT64_T_ARG` macros for printf arguments, similar to `SIZE_T_ARG` and `PTRDIFF_T_ARG`.

In the process, fix some issues with the toolchain: in certain CI runs the toolchain headers were being #included multiple times, and certain CI runs produced collisions between clang definitions and gcc definitions.  Resolve these issues with `#pragma once` and preprocessor guards in the event of both gcc and clang being active.

Also remove toolchain.h from sexp_container.cpp since it is already #included via pstypes.h.
2025-05-21 23:32:35 -04:00
wookieejedi 381f9fde58 Mod Specific Visual Culling Size for Lasers (#6729)
* Mod Specific Visual Culling Size for Lasers

Currently, lasers will not render if the length or both head and tail radii are < `0.0001`. This is very small, and in many mods the smallest visual size is `0.01`, so this PR exposes that culling size value to allow mods to optimize and tune visual culling of lasers, which can be quite useful especially in laser heavy missions.

* update names

* actually push all files
2025-05-21 17:56:55 -04:00
Kestrellius 61b3d82ecf make particle curves respect weapon curves (#6728) 2025-05-19 22:01:06 -04:00
Kestrellius 5ca64215c6 Weapon curves followup (#6722) 2025-05-19 22:00:53 -04:00
Goober5000 a28b152b2c Merge pull request #6726 from Goober5000/add_comment
add an ETS comment
2025-05-18 23:27:44 -04:00
Goober5000 26fd770c97 add an ETS comment
Clarify the conditions here.
2025-05-18 22:58:47 -04:00
Goober5000 a1a453a217 Merge pull request #6671 from Goober5000/ets_updates
ETS updates
2025-05-18 22:55:37 -04:00
Goober5000 6503b878fc Merge pull request #6723 from Goober5000/coverity_things
Various more Coverity issues
2025-05-17 17:37:26 -04:00
Goober5000 17a91273d1 FIELD_T is assumed to be a pointer here, so mark it as such 2025-05-17 17:14:26 -04:00
Goober5000 4b2a2d747b array and iterator bounds 2025-05-17 17:14:26 -04:00
Goober5000 7702d53fd7 string length 2025-05-17 17:14:26 -04:00
Goober5000 3b51c890fc these lines are things we want to allow 2025-05-17 17:14:26 -04:00
Goober5000 298869e517 properly convert main hall 2025-05-17 00:27:00 -04:00
Goober5000 4422821ff5 avoid accessing variable outside of scope 2025-05-17 00:27:00 -04:00
Goober5000 9c2f080235 initialize fields 2025-05-17 00:27:00 -04:00
Goober5000 d5e3325bef fix unsigned check 2025-05-16 23:32:32 -04:00
Goober5000 85f7ccc083 fix use-after-move 2025-05-16 23:32:13 -04:00
wookieejedi 8102febb08 Extra Visual Indication for Scramble Missions (#6720)
* Extra Visual Indication for `Scramble` Missions

Currently, if a mission is set as scramble then there is no visual way for the player to see that the Ship Selection and Weapon Loadout screens are locked, instead the player has to click on the buttons and hear the fail sounds or assess that the hover states are not triggering. This PR adds a text line right below the words Weapons Loadout that states "Ships/Weapons Locked" (XSTR 749) if the mission is scramble thus the player can easily see this right away and not have to check the buttons on every mission.

Tested and works as expected. Happy to put behind a flag if desired.

* whitespace

* incorporate feedback
2025-05-15 07:42:54 -04:00
wookieejedi 4b7817e5ab Fix highlighting color discrepancy for player ship in loadout screen (#6716)
* Few Minor Visual Indicator Enhancements to Loadout

This PR adds a few visual indicator tune-ups to the loadout screens.

1.
Currently, if a mission is set as `scramble` then there is no visual way for the player to see that the Ship Selection and Weapon Loadout screens are locked, instead the player has to click on the buttons and hear the fail sounds or assess that the hover states are not triggering.

This PR adds a text line right below the words `Weapons Loadout` that states "Ships/Weapons Locked" (XSTR 749) if the mission is `scramble` thus the player can easily see this right away and not have to check the buttons on every mission.

2.
Currently there is a nice orange coloration of the player ship icon in the Ship Selection wing loadout. This immediately shows the player which ship is theirs, but this usefulness does not translate to the Weapon Loadout screen.  The player must select another ship, besides the player ship, to have the player ship show up as orange.

This PR adds a bool `always_highlight_ply` which is specifically for the weapon `draw_wing_block` function when called as as part of the weapon loadout routine.

Both PRs are tested and work as expected. I currently have these PRs on without a flag, but if folks really do not want the PRs or would prefer them to be behind a flag, then I'm happy to do that, too.

* separate PRs
2025-05-15 07:42:34 -04:00
Mike Nelson f1f95717d1 Support Custom Gauges in HUD Config UI (#6670)
* Support coloring custom gauges

* remove NULL
2025-05-14 13:18:03 -04:00
Goober5000 9ea44f0479 ETS updates
Two updates to the energy transfer system.
1. Previously, for fighters missing a system (e.g. shields), the energy would be treated as if all energy from that system was routed to the other systems.  So, for example, a fighter's typical speed would be faster without shields than with shields.  A new AI profile flag now treats the other systems as if the energy had not been transferred.
2. At some point in development, Volition intended the `$Power Output` ships.tbl field to affect ETS.  A new AI profile flag now treats the power output as a factor of energy applied to energy systems.
2025-05-14 01:33:28 -04:00
Goober5000 42dd1eb3c2 Merge pull request #6713 from Goober5000/various_small_issues
Various Coverity issues
2025-05-13 23:18:43 -04:00
Goober5000 1e8ea06854 Merge pull request #6711 from Baezon/small-turret-swarm-fix
Small fix for turret swarm stuff
2025-05-12 21:59:22 -04:00
Goober5000 49cd8c3158 Merge pull request #6717 from Goober5000/improve_scripted_waypoints
improve scripting support for waypoint lists
2025-05-12 21:59:06 -04:00
Goober5000 a294559ee2 improve scripting support for waypoint lists
1. Add an explicit `mn.createWaypointList` function
2. Allow `mn.createWaypoint` to be used with an empty waypoint list
3. Update documentation of `mn.createWaypoint` to clarify optional arguments
2025-05-10 23:36:22 -04:00
Goober5000 04a671c836 simplify list index 2025-05-10 21:43:17 -04:00
Goober5000 ceee045b35 coverity: move instead of copy 2025-05-10 01:15:46 -04:00
Goober5000 e0082447d1 coverity: integer division, string resize, printf arg, float/double 2025-05-10 01:15:46 -04:00
Goober5000 067c65773a coverity: possible use of invalid iterator (especially with jump nodes) 2025-05-10 01:15:46 -04:00
Goober5000 d7796b3767 coverity: use references to avoid unnecessary copies 2025-05-10 01:15:46 -04:00
Goober5000 11b085ca66 Merge pull request #6714 from Goober5000/goto_considered_useful
goto considered useful
2025-05-09 20:36:12 -04:00
Goober5000 aabc0df3be Merge pull request #6686 from Goober5000/enhance_look_at
enhance look_at
2025-05-09 20:35:10 -04:00
Goober5000 56d8c48927 Merge pull request #6712 from Goober5000/a_few_fixes
A few fixes
2025-05-09 20:35:03 -04:00
Mike Nelson 1f7903fb23 add a few hud lua methods (#6692) 2025-05-08 09:33:21 -04:00
Goober5000 3d68bf2c7a goto considered useful
The `continue` statement in these error checks had no effect because the error checks are macros implemented in a `do` ... `while (false)` loop.  So, use `goto`.  There is precedent with other instances of `OpenAL_ErrorCheck` in the code.

This may fix the issue where sound would occasionally randomly stop, requiring a pause or a screen change to get it back.  This would be difficult to verify though.

Thanks to Coverity for flagging this situation!
2025-05-08 02:50:29 -04:00
Goober5000 e0c4c3033f fix bounds check 2025-05-08 02:37:33 -04:00
Goober5000 6c42d9cc82 prevent negative array index when AI has no target 2025-05-08 02:37:24 -04:00
Goober5000 a9ff3c55b9 fix compiler warning 2025-05-08 02:36:47 -04:00
Goober5000 80384e00b3 fix a copy-paste error 2025-05-08 02:36:19 -04:00
Asteroth c085f87e6f clean up condition 2025-05-07 23:31:22 -04:00
Asteroth 447119ed7e small fix for turret swarm stuff 2025-05-07 23:07:33 -04:00
wookieejedi 2576515040 Allow Trigger Radius curve input to work with muzzle effects (#6706)
The Input of `Trigger Radius` for curves within new particle effects was never hooked up for muzzle flashes, so this PR adds in the necessary lines to get it working. This allows modders to make a muzzle effect that can scale to the weapon radius through curves, and thus modders can simply make one curve scaled muzzle flash and avoid making a many muzzle flashes for each sized weapon that uses the same base effect.

Tested and works as expected.
2025-05-04 12:36:27 -04:00
Goober5000 c2314f6a04 Merge pull request #6708 from Goober5000/dockpoint_fix
check dockpoints when changing ship class
2025-05-03 13:54:57 -04:00
Goober5000 d79f5062bf Merge pull request #6698 from Goober5000/update_shield_saving
fix hull/shield checks in missionsave
2025-05-03 13:54:30 -04:00
Goober5000 1f813717e6 check dockpoints when changing ship class
If a ship changes class, the dockpoints on the new model may not match the dockpoints on the old model.  This is most likely to happen when changing a docked ship in FRED to an incompatible ship class, but it can also happen when using the `change-ship-class` SEXP.  So check the dockpoints, update them if they should be updated, and undock them if they can't.
2025-05-02 16:53:45 -04:00
Goober5000 2296d7d330 check for null item array 2025-05-02 14:45:00 -04:00
Tyler Blount 099fc3790d Merge pull request #6705 from TRBlount/update/changelog_script
Update Changelog script to sort by labels
2025-05-02 11:28:31 -07:00
Mike Nelson 1977c083c7 Allow defining separate player and target shield icons for config (#6691)
* Allow defining separate player and target shield icons for config

* rename define to prevent confusion with a similar define in shield.cpp

* address some feedback
2025-05-02 07:58:25 -04:00
DahBlount 98bad1201f Update Changelog script to sort by labels 2025-05-01 16:22:56 -07:00
Mike Nelson 36d6fbe7e5 Lab firing upgrades (#6703)
* Fix some issues preventing various secondary types from firing in the lab

* Add ability to fire turrets from the lab

* const char*, mjn please

* more cleanup

* range-based for loop

* Update comment
2025-05-01 09:50:27 -04:00
Mike Nelson 4c209f83ad Add mission name as hook variable (#6699) 2025-04-25 11:09:48 -04:00
Goober5000 84c8892015 Merge pull request #6701 from Goober5000/eye_script_virtvars
add a few eye virtvars
2025-04-24 23:02:40 -04:00
Goober5000 e409d19365 Merge pull request #6702 from Baezon/fix-2d-camera
Fix for 2d mission camera
2025-04-24 23:02:08 -04:00
Asteroth 1a38350797 2d camera fix 2025-04-24 13:59:21 -04:00
Goober5000 dcd1c97b42 also getMagnitudeSquared 2025-04-23 21:25:07 -04:00
Goober5000 6aa449c8e1 add a few eye virtvars
For displaying things in a scene, because the eye position is not necessarily the ship position.
2025-04-23 21:25:07 -04:00
Goober5000 1abb96a835 Merge pull request #6700 from Goober5000/set_absolute_relative
add Absolute/Relative coordinate selector
2025-04-23 01:33:04 -04:00
Goober5000 321ace9ad3 Merge pull request #6695 from Goober5000/eyepoint_normal_flag
add flag to control model eyepoint normal usage
2025-04-23 01:32:53 -04:00
Goober5000 3d062cb873 add Absolute/Relative coordinate selector
This enhances the Object Position/Orientation Editor to set relative coordinates and angles in addition to absolute coordinates and angles.
2025-04-22 21:15:54 -04:00
Goober5000 d98a90e74a fix hull/shield checks in missionsave
Both the hull and shield save conditions have had benign bugs since the original retail release.  Fix the conditions and use the `fl2i` macro.
2025-04-22 00:42:06 -04:00
Goober5000 7a2f254680 Merge pull request #6696 from Goober5000/animation_set_speed
add setSpeed for animations
2025-04-20 20:32:00 -04:00
Goober5000 354c57cd5c add setSpeed for animations
Most of the functions in ship.cpp that operate on submodel animations are mirrored in animation_handle.cpp, but `setAnimationSpeed` was overlooked.  Add this function so it can be called from a submodel animation handle.
2025-04-20 00:13:49 -04:00
Goober5000 42a973acf9 add flag to control model eyepoint normal usage
PR #6598 caused eyepoint normals to be used for viewing direction, whereas previously the host object's orientation was used for viewing direction.  Since this could cause compatibility issues, return to the previous behavior and make the new behavior depend on a flag that is set in post-25.0 builds.  (This only applies to eyepoint normals; eyepoint *positions* were respected both before and after #6598).
2025-04-19 02:01:20 -04:00
Goober5000 fd194d4bd6 Merge pull request #6694 from Baezon/fix-eye-normals
Some fixes to eye point normals
2025-04-19 01:45:20 -04:00
Asteroth 7e3971a77e some fixes to eye point normals 2025-04-18 11:25:11 -04:00
Asteroth 3b5668c4e5 Add freespace 1 style missile behavior (#6681)
* add fs1 style missile behavior

* add weapon flag, and various tweaks

* remove superfluous check
2025-04-17 21:45:45 -04:00
Goober5000 b755d61381 Merge pull request #6690 from Goober5000/fowarders_supplemental
add supplemental code to forwarders.lua
2025-04-17 20:51:09 -04:00
Mike Nelson d41cb49661 make sure drop shadows don't polute the color context (#6689) 2025-04-17 08:33:15 -04:00
Mike Nelson 524d36332d per-hud config weapons and shield gauge ship (#6651) 2025-04-17 08:31:48 -04:00
Mike Nelson aef3e014c0 Display scrollback with even one message (#6687)
* Display scrollback with even 1 message

* use .empty()
2025-04-17 08:22:02 -04:00
Mike Nelson f9d91d568e Add disable intro movie flag (#6688) 2025-04-17 08:21:49 -04:00
Goober5000 88e6542441 add supplemental code to forwarders.lua
The `println` function is a semi-recent addition to zLoadFirst-sct.tbm, while the `Globals` table should have the vector and orientation values.  The `string.starts` and `string.ends` functions were in the original version of zLoadFirst-sct.tbm but were not included in #6545, and `string.ends` is required by cfile_include.lua.
2025-04-16 23:58:28 -04:00
wookieejedi df445fa8a6 Wingmen and Squad Message QoL Updates (#6682)
* Wingmen and Squad Message QoL Updates

This PR adds a few assorted HUD updates/quality of life enhancements. FotG will be using these, though they relatively general and are likely useful to most other mods, too.

1) Adds a 'Ship Name Max Width:' to the Squad Message Gauge (following the same logic as the Escort Gauge). The Escort Gauge will truncate display names of ships if they are too long, that way all the text fits in the gauge without spilling over. It would also be very useful to do this with the Squad Message Gauge, as long display names can overflow out of the gauge's boundaries currently.

2) Adds `Wingname Align Mode:` to the Wingmen Gauge, which allows modders to set how the wingnames are aligned. Currently they are centered on the calculated x-position, though this PR also adds right and left justification options (which is useful especially if displaying the full wing names).

All options are tested and work as expected.

* appease clang

* whitespace

* more safety and error checking

* and extra error helpfulness

* use safer str copy
2025-04-16 22:47:14 -04:00
Goober5000 3fb82e5ac3 enhance look_at
Some QoL improvements:
1. Update `$fvec` and `$uvec` parsing to also allow parsing `$rvec` and to allow only `$fvec` to be specified; also make parsing more robust against failure
2. Allow `$fvec` and `$uvec` to specify the "facing" direction if `$look_at_offset` is not specified
3. Add a few additional warnings for incomplete or invalid POF data
2025-04-15 21:52:13 -04:00
wookieejedi eb60a87b28 Allow mods to hide main Rearm/Repair items in Message Gauge (#6684)
* Allow mods to hide main Rearm/Repair items in Message Gauge

Adds a game_settings option to hide/disable the Rearm/Repair commands in the Squad Message Gauge. FotG does not use repair ships, so it is somewhat confusing to players to always see the `Rearm/Repair` order options (IE 5. Rearm/Repair Subsys and 6. Abort Rearm) and never be able to use them.

I wanted to make this PR as surgical as possible, while still giving some degree of generality, thus I went with the solution to use `active` as a true integer instead of simply an old int in the bool style. Now -1 is hidden, 0 is greyed out, and 1 is bright.

Tested and works as expected.

* update comment

* update with better name

* add another clarifying comment
2025-04-14 07:22:10 -04:00
Taylor Richards a2d3e6aeb7 add arm64 Linux builds to workflow (#6683)
Github runners for Linux arm64 are now in public beta with the same
free limits as normal github runners. Our Linux build images already
have arm64 support so this finally enables it as part of the official
workflow.
2025-04-13 22:05:40 -04:00
Goober5000 72b7ea9bd3 Merge pull request #6678 from Goober5000/particle_orientation_fix
fix bogus direction vector in particle code
2025-04-13 18:19:12 -04:00
John Fernandez 5f3f7efe7d Merge pull request #6545 from MjnMixael/lua_load_first
Build in the common z load first methods and forwarders
2025-04-12 17:42:45 -04:00
Goober5000 596f6e75da check in more places in the particle code 2025-04-12 15:38:57 -04:00
wookieejedi 0964ee5e23 Fix wingmen custom dot for starting ships (#6677) 2025-04-10 21:14:10 -04:00
Goober5000 77cbee7bcb fix bogus direction vector in particle code
This was discovered thanks to the new assertions from #6596.  For particles with 0 velocity, the code would attempt to normalize a 0,0,0 vector with predictably undesirable results.  So, pick the global `z` vector in these cases, while normalizing in the usual case.
2025-04-10 19:57:06 -04:00
John Fernandez cc50010b8f Merge pull request #6340 from MjnMixael/enhance_vasudan_cheats
Enhance Vasudan Mainhall Cheats
2025-04-10 11:53:51 -04:00
Goober5000 c17560a0d8 Merge pull request #6665 from Goober5000/intrinsic_no_shields_fix
refine intrinsic_no_shields behavior
2025-04-09 21:46:10 -04:00
Mike Nelson 8f6f4d7834 address feedback 2025-04-09 20:02:27 -05:00
wookieejedi a88d34151b Fix wingmen custom dot for ship changes (#6676) 2025-04-09 20:47:59 -04:00
Goober5000 ec8416c582 prevent negative array access when ship has no weapons 2025-04-09 20:40:11 -04:00
Goober5000 2d86572b36 initialize the Pre_player_entry flag to false in case anything checks it before the first mission 2025-04-09 20:40:11 -04:00
Goober5000 982a550211 don't save the no-shields flag in the mission file for intrinsic-no-shields ships 2025-04-09 20:40:11 -04:00
Goober5000 9cef39dab6 enhance shield checks to consider shield strength in addition to the Intrinsic_no_shields ship class flag 2025-04-09 20:40:11 -04:00
Goober5000 78b556a672 Merge pull request #6667 from Goober5000/player_use_ai_fix
fix chaotic player targeting in rare situations
2025-04-09 20:34:06 -04:00
Goober5000 42b837bd63 Merge pull request #6672 from Goober5000/weapon_editor_tweak
tweak weapon editor UI
2025-04-09 20:33:28 -04:00
Taylor Richards 1a642185fe fix text input crash on Linux, and plug memory leak (#6648)
Linux iconv does not support "UCS-2-INTERNAL" and conversion will fail if SDL
is compiled with native iconv support. SDL version 2.32.2 fixed this by
changing the macro to use "UCS-2" instead. Unfortunately in my tests this
worked perfectly in Linux but was broken on Mac in the rocket_ui code. However
simply using proper endianess appears to work on all test platforms.

Additionally this fixes a bad memory leak as SDL_iconv_string() allocates it's
return string and this was never free'd before. So every character of text
input resulted in a memory leak of 6+ bytes.
2025-04-08 04:41:20 -04:00
BMagnu 01b09aae1c Fix SoundDuring animation segments with the loop flag set (#6669)
* Properly stop sounds even with the non-interrupt flag

* Respect tabled flags
2025-04-08 10:00:04 +02:00
Goober5000 b6c7a4c28f tweak weapon editor UI
Widen the weapon editor UI fields by KJakker's request.
2025-04-08 01:18:43 -04:00
Taylor Richards d49f3ca743 update and fix force feedback code (#6664)
Update haptic code with changes from icculus.org tree which optimizes
effect loading to better support low-memory devices and no longer
requires full support of every haptic effect type. Additionally...

 - avoids attempting FF init for non-haptic devices
 - avoids attempting FF init for gamepads
 - properly resets FF when device is hot-plugged
 - better start/stop/update of effects
 - avoid stopping effects unless really needed
 - use timestamp for dir effect restarts instead of sys calls
 - avoid playing FF effects when window is in background
 - general code cleanup
2025-04-08 01:01:54 -04:00
Goober5000 7246bc331a Merge pull request #6659 from Goober5000/supernova_stage_and_missionsave_tweaks
add sexp to get the current supernova stage
2025-04-07 18:06:50 -04:00
Goober5000 67a4244152 add sexp to get the current supernova stage
Return the current supernova stage.  This sexp, in conjunction with mission cutscene editor, makes it possible to reproduce the FreeSpace 2 end-of-campaign cutscene behavior purely in FRED.  The resulting cutscene section looks like this:
```

$Campaign End Cutscene: endpart1.mve
+formula: ( true )

$Campaign End Cutscene: endprt2a.mve
+formula: ( < ( get-supernova-stage ) 3 )

$Campaign End Cutscene: endprt2b.mve
+formula: ( >= ( get-supernova-stage ) 3 )

```
Also add a new status subcategory and fix newline behavior when saving the cutscene section.

Fixes #6657.
2025-04-06 22:37:01 -04:00
BMagnu 2043a079c4 Fix scaling of subspace glows (#6668) 2025-04-06 17:53:27 +02:00
Mike Nelson cacf1fb002 match get/set colors for gauges to graphics (#6563) 2025-04-06 11:10:16 -04:00
Mike Nelson 1a503faa6b Better color preset handling (#6655) 2025-04-06 11:09:43 -04:00
Goober5000 052dfd8c14 clean up AI state when turning off player AI 2025-04-06 02:45:17 -04:00
Goober5000 60b676cba9 change Player_use_ai from int to bool 2025-04-06 02:11:52 -04:00
Goober5000 3bf6d43022 Merge pull request #6649 from Goober5000/update_yaml_again
update workflows to use official release of setup-vulkan-sdk
2025-04-04 00:02:40 -04:00
Mike Nelson a7b47e7a34 Hash check retail strings and weapons tables (#6662)
* hash check retail strings and weapons tables

* const
2025-04-03 21:56:28 +02:00
Taylor Richards 2764d06fdb update zlib to 1.3.1 and libpng to 1.6.47 (#6661) 2025-04-03 14:34:20 -04:00
Goober5000 0097355dc2 Merge pull request #6654 from Goober5000/red_alert_weapon_fix
fix a subtle red-alert weapon bug
2025-04-02 19:39:34 -04:00
Goober5000 15cbe259f4 Merge pull request #6663 from TRBlount/coverity_large_build
Update coverity workflow to use large build endpoint
2025-04-02 19:39:15 -04:00
Mike Nelson 7c38273f5b Lua hooks for the comm board (#6450)
* lua access to the comm board menu

* On Order Issued Lua Hook

* Some cleanup and safety checks

* Add mn.sendBuiltinMessage and perform more cleanup

* Send the correct ship to the hook for Sender

* clang cleanup

* address feedback

* fix build errors introduced from upstream

* basic hook conditions

* properly link the condition and the oswpt struct

* some requested cleanup

* allow for sending custom built-in messages

* address more feedback

* more prefix
2025-04-03 00:55:20 +02:00
wookieejedi c6f2d05998 Allow normal, AO, and misc maps at higher detail settings (#6658)
Previously, FSO did not show normal, AO, or misc maps at LODs 3 or higher. This was  a relic from original retail days, so this PR allows players to see those textures if the model detail level is at 3 or 4. I put this under the model slider because it is related to LODs, and b/c changing the model slider is something folks actually use compared to the other hardware tex slider which really makes things look ancient if turned to anything other than the max.
2025-04-02 07:44:16 -04:00
DahBlount bb904dd37d Use github ref instead of rev-parse HEAD 2025-04-01 19:19:15 -07:00
DahBlount 9331f25b79 Initial test commit for using large build endpoint 2025-04-01 18:53:03 -07:00
wookieejedi 4a7bbc5b24 Tune how the default_settings.tbl handles options it cannot find (#6656)
In-game options may be removed/inaccessible, such as VR mode removing the Window, but still valid for listing in the `default_settings.tbl` table.

In other words, we don't want error messages displaying if a player is playing  in VR mode (which will remove the Window option for that instance) but the window option is listed in the table.

Thus, downgrade the error to a debug print for options within the `default_settings.tbl`. As MJN stated, the table itself controls the parser here, so downgrading the warning is the best choice.
2025-04-01 13:58:14 -04:00
BMagnu 893fb9fef9 Add an ingame setting to disable sunglare (#6645)
* Add an ingame setting to disable sunglare

# Conflicts:
#	code/localization/localize.cpp

* Update XSTR
2025-04-01 12:56:23 +00:00
wookieejediandBirk Magnussen 46e7df7941 Make VR mode more seamless (#6636)
* Make VR mode more seamless

Works to make the `-vr` command flag more seamlessly work (which means the new KNet button, `Play in VR` will also now actually work). Fixes #6430.

First, creates a new in-game option called VR Resolution and have the default be 2500x2500, with a range that goes from 1000x1000 to 6000x6000.

Second, if `-vr` flag is used, then it auto sets flags of `-capture_mouse` `-stretch_menu` and `-window_res 1000x1000` (or anything that's for sure smaller than the screen but not too small, to maintain mouse precision).

It also overrides settings of `-vysnc` and `-window` to off, by ignoring the in-game values (and does not show these options in menu while in VR mode).

Finally, it reads the in-game value of `VR Resolution` instead of `Resolution`. It also shows the `VR Resolution` in-game option in the menu, while hiding the options of `Resolution`, `Windowed Mode` and `Vsync`.

If the game is run in standard mode then FSO does what it current does, including using the `Resolution` value for screen resolution. It also does not display the new in-game option for `VR Resolution`.

* actually use the vr_enumerator

* use emplace_back instead

* update res vr importance

* Fixes for VR one-button mode

* try reordering removes for clang

* fix string ids

* test to see if clang is being weird

* revert clang test

* strings index update

* cleanup options manager

---------

Co-authored-by: Birk Magnussen <[email protected]>
2025-04-01 14:18:19 +02:00
Goober5000 7b0a5d6daa fix a subtle red-alert weapon bug
Ships that red-alerted, but that departed before red-alert was triggered, would have 0 weapons on the subsequent mission.  Since exited ships do not store weapon information, that information was never saved in the red-alert status, and so `num_primary_banks` and `num_secondary_banks` would inadvertently be set to 0.  This bug has been around since the pilotfile upgrade in 2013, and apparently was common knowledge among several players, but was never reported. :-/  The fix is easy enough: skip setting weapon information if that information is not saved in red-alert status.  (We should also skip setting subsystem information in the same circumstances, although that did not cause any subsystem misbehavior.)
2025-03-31 00:40:23 -04:00
Goober5000 44ff94a72f Merge pull request #6622 from Goober5000/move_semantics
audit move semantics in the codebase
2025-03-30 18:40:05 -04:00
BMagnu 7aeee3d569 Make faraway objects actually render faraway (#6653) 2025-03-30 01:00:44 +01:00
Goober5000 86f75c5d17 fix normalized vector handling (#6650)
Although normalized vectors in FSO are supposed to stay normalized, occasionally small floating point errors can pop up.  In most cases these do not cause a problem, but in certain cases these errors can rapidly accumulate and corrupt an otherwise well-behaved matrix.  This can most easily be seen with daisy-chained dock sequences or docked ships with angled dockpoints.

This PR audits the usage of `vm_vector_2_matrix_norm` to re-normalize vectors in cases where floating point errors could accumulate.  There are also a few new Assertions for extra vigilance.

Follow-up to #6596.  Fixes #6634.
2025-03-28 23:54:51 +01:00
Goober5000 750348a4c0 Merge pull request #6643 from Goober5000/skipmemymissionyo_in_space
skipmemymissionyo fixes
2025-03-26 23:24:32 -04:00
Goober5000 f86a28a274 update workflows to use official release of setup-vulkan-sdk
The official 1.2.1 release of humbletim/setup-vulkan-sdk was recently published.  Update the repo version and, incidentally, also the vulkan version.  See https://github.com/humbletim/setup-vulkan-sdk

Follow-up to #6582.
2025-03-26 23:09:58 -04:00
Goober5000 8613ccde76 skipmemymissionyo fixes
Improve skipmemymissionyo in several ways, based on RedMageJoe's recent experience:
1. Allow spaces to be accepted in the mission prompt
2. If the requested mission can't be found, just abort rather than restarting the entire campaign
3. Clarify that the prompt needs a filename and add a message if the mission can't be found
4. Improve handling of the .fs2 extension
5. Fix a bounds check in `popup_input`
2025-03-26 22:56:21 -04:00
Goober5000 c5f17bf7c3 Merge pull request #6646 from Goober5000/player_start_check
handle starting shipname mismatch
2025-03-26 22:46:49 -04:00
Taylor Richards cd77ec0c51 fix compilation on linux arm64 (#6647) 2025-03-26 12:47:45 -04:00
Goober5000 a5308d67d3 handle starting shipname mismatch
If the player starting ship name does not refer to an actual ship, gracefully fail to load the mission instead of crashing.
2025-03-26 01:11:51 -04:00
BMagnu 285b385a67 Don't override blend mode for skyboxes (#6644) 2025-03-25 16:19:03 +01:00
John Fernandez 783f495091 Merge pull request #6555 from MjnMixael/remove_warp_options
Move warp options to tables
2025-03-25 09:49:33 -04:00
wookieejedi 310a170bca Fix/cleanup using intrinsic no shields and ship loadout switching (#6641)
* Fix/cleanup using `intrinsic no shields` and ship loadout switching

The flag `intrinsic no shields` is used to allow switching between both shielded and unshielded craft in loadout. There is one edge case that was not accounted for though, which is that if a ship has no shields, and is switched to a ship with shields, the mission will start with that ship having a current shield strength of 0 and only slow get it's shield strength up via shield recharge.

This is not expected behavior, so this PR adds the extra conditional check that if that flag is on, then treat shield percent as full instead of empty. This ensures that switching to a ship with shields in loadout will begin the mission with full shield strength (instead of 0 and waiting for a full recharge).

Tested and works as expected. If desired I can put this behind a game settings flag, but I figured this was the expected behavior (and I'm not even sure how many mods besides FotG uses `intrinsic no shields`.

* also fix initial ets setting with intrinsic no shields

* format consistency
2025-03-24 08:20:08 -04:00
wookieejedi f2108ab4d8 Fix fire-point and flight cursor positions (#6642)
Fixes a bug where the fire-point and flight cursor position components of the center reticle were improperly calculated. Also fixes bug where the fire-point component was missing an argument for `renderCircle`.

Tested and fixes work as expected.
2025-03-23 21:24:50 +01:00
Mike Nelson 60777154be Hud config upgrades (#6581)
* base working version

* localization and minor tweaks

* add retail UI controls

* Add way to hide gauges from Config view

* convert hud config from index matching to id matching

* clang
2025-03-22 22:47:38 -04:00
John Fernandez 9f38451fd4 Merge pull request #6631 from Dark-Visor/change_ship_display_name
Change ship display name
2025-03-22 11:44:38 -04:00
BMagnu 95d1cd5d47 Actually return the correct field (#6639) 2025-03-18 20:18:01 +00:00
Goober5000 4b3894c0a5 audit move semantics in the codebase
For every move and move-assignment constructor, do the following:
1. Make it default if possible
2. Add or delete where appropriate
3. Check for move-onto-self
4. Apply `std::move` where needed

Also fix problematic moves in `player_h`
2025-03-17 00:31:59 -04:00
Dark-Visor 600b6def7b Updates to change-ship-display-name
Update to allow changes to alt name, callsign and display name.
2025-03-16 21:41:55 +00:00
Dark-Visor e82d3936ce Improve code
Make changes to change_alt_name_or_display_name_or_callsign both single
and multi.
2025-03-16 21:41:54 +00:00
Dark-Visor 9c87f08832 Create sexp for change-ship-display-name
Copy existing code from change-ship-alt-name into new sexp
change-ship-display-name and likewise from OP_SHIP_CHANGE_ALT_NAME to
new OP_SHIP_CHANGE_DISPLAY_NAME. Create new blank function
"sexp_ship_change_alt_name_or_callsign" and a function for multi too.
2025-03-16 21:41:16 +00:00
Goober5000 737f4f2b47 Merge pull request #6633 from Goober5000/normalize_orientations
ensure matrices are well-behaved
2025-03-16 01:31:55 -04:00
Goober5000 819404f791 ensure matrices are well-behaved
When an orientation matrix is constructed using one or more vectors, all such vectors must be normalized.  Previously, the code did not enforce this for matrices parsed from a mission or table file.  Although FRED will use correct matrices, it also truncates floating point values to six decimal places, so non-normalized vectors might be written to the mission file as happened in #6632.  And there is always the possibility that someone could manually edit the mission file to corrupt the matrices.

While we're at it, per suggestions from Asteroth and qazwsxal, make sure the matrix is orthogonal as well.  The `vm_fix_matrix` function handles all relevant calculations.

Fixes #6632.  Follow-up to #6596.
2025-03-15 23:01:29 -04:00
Goober5000 a92368da96 Merge pull request #6624 from Goober5000/shield_tweaks
some refinement of shield quadrants
2025-03-11 00:58:50 -04:00
Goober5000 9716bdbbc1 Merge pull request #6629 from Goober5000/coverity_upload_fix
attempt to fix Coverity
2025-03-11 00:58:08 -04:00
Goober5000 32f979d3c6 attempt to fix Coverity
Coverity hasn't run since September 27.  A close look at the log shows that the workflow makes it almost all the way through but fails on the "Upload to Coverity" step:
`fatal: detected dubious ownership in repository at '/__w/fs2open.github.com/fs2open.github.com'`

There are various questionable ways that people have tried to fix this, but it might be possible to completely avoid the issue by not using `git` in that step.  So let's try to get the commit hash from GitHub context rather than by running `git rev-parse HEAD`.
2025-03-11 00:27:57 -04:00
wookieejedi 303070d76e Fix script setting of subsystem hitpoints max (#6628)
Currently if you try to set a subsystem's hit points via scripting it only sets the value to 0 b/c of what was likely a copy paste bug. This 1 line PR fixes that. Tested and fix works as expected.
2025-03-09 21:09:46 -04:00
Mike Nelson a7754e637a Fix hud errors (#6627)
* fix weapon energy text in config mode

* fix x,y  mismatch

* fix squad message copy/paste error
2025-03-09 21:09:37 -04:00
wookieejedi e89917e20d Allows mods to fully disable energy transfering (#6623) 2025-03-08 17:41:12 -05:00
wookieejedi 10d59399c6 Fix mini-shield custom filename (#6625) 2025-03-08 17:40:53 -05:00
Goober5000 44cdb29135 some refinement of shield quadrants
Remove the `n_quadrants` field because it is entirely redundant to the size of `shield_quadrant`.  Also, be more rigorous about the difference between `shield_get_quad(i)` (which can fluctuate) and `shield_quadrant[i]` (which gives the exact quadrant strength).  Finally add some C++ casts and move some checks to better places.
2025-03-08 01:10:59 -05:00
wookieejedi eaebcf8ee6 Fix asteroids spawning outside active fields (#6615)
* Fix asteroids spawning outside active fields

Found an interesting edge case bug with active asteroid fields that has been present since retail:  if a large ship is just outside an active asteroid field, that field will end up spawning asteroids outside the field bounds. This is because the game thinks that the large ship is within the asteroid field when it is actually not. Specifically, the check `asteroid_is_ship_inside_field` does not properly account for the ship the addition of the ship's diameter to the bounding box check.

This PR adds a flag to fix that bounding box check and fix the bug of spawing asteroids outside the asteroid field bounds. Note, `asteroid_is_ship_inside_field` is used twice in the code, once within `set_asteroid_throw_objnum` and once following that call within `maybe_throw_asteroid`. Also note, `asteroid_in_inner_bound` uses a delta of 0 in all cases except when being called within `asteroid_is_ship_inside_field`.

Tested and this fixes the bug while still having asteroid fields work as expected. (Also took this chance to rename a local variable for newly create asteroids to more descriptive name).

* enable by default for 25.0
2025-03-07 08:19:21 -05:00
Goober5000 5bd9f705ac Merge pull request #6618 from Goober5000/fred_fixes
a few minor fixes
2025-03-06 21:53:27 -05:00
Mike Nelson 32befb83a9 fix ets copy/paste error (#6619) 2025-03-06 10:47:22 -05:00
Goober5000 25aa3d71aa a few minor fixes
1. `Neb2_poof_flags` is a ubyte array, and so should be of type ubyte[], not ubyte
2. Save the substitute main hall in qtFRED
2025-03-05 22:12:24 -05:00
wookieejedi d9f93d1ca9 Update conditional check for wingmen dots (#6617) 2025-03-05 21:00:45 -05:00
Goober5000 a99aa35c7c Merge pull request #6614 from Goober5000/parse_line_updates
upgrade line parsing and end-of-line checks
2025-03-05 19:38:20 -05:00
Mike Nelson 44d3ea9353 Fix small non-config oversights (#6616) 2025-03-05 13:13:02 -05:00
Goober5000 c1910b210a Merge pull request #6607 from Goober5000/unique_ptr_ships_weapons
std::unique_ptr refactoring
2025-03-04 23:26:41 -05:00
Goober5000 343d9a36d4 std::unique_ptr refactoring
Use `std::unique_ptr` rather than `vm_malloc` and `vm_free` to handle optional strings in ship classes.  This makes the code more robust and increases memory safety.  This also allows several string variables to be consolidated in the ship class and weapon class script APIs.

Also add new `stuff_string()` overloads and a new `F_TRIMMED` string parsing type to handle the new fields and the string trimming done inside `stuff_malloc_string()`.
2025-03-04 22:52:53 -05:00
Goober5000 f4099f5000 a few cleanup and efficiency tweaks
1. Use `const char *flag_desc` because constructing a SCP_string for each flag description is not needed
2. Make `VALID_FNAME` check for nullptr
3. Modify the signature of `coalesce()` to allow capturing of mixed `const` and non-`const` arguments
4. Use `std::for_each` (via `SCP_tolower`) rather than `std::transform` to fix compilation warnings
2025-03-04 22:48:20 -05:00
Mike Nelson cf57df37d3 config rendering methods for orb and standard radar gauges (#6579) 2025-03-04 13:31:56 -05:00
Mike Nelson 7a5f4b1d80 HUD Config Rendering Methods PR 6/7 (#6578)
* config rendering methods for wingman status and training msg gauges

* table define example wing names
2025-03-03 21:56:57 -05:00
Goober5000 9e4287e7b0 Merge pull request #6596 from Goober5000/vm_vector_2_matrix_norm
use vm_vector_2_matrix_norm on normalized vectors
2025-03-03 21:00:02 -05:00
Mike Nelson 681206a356 config rendering methods for 3d targeting gauges (#6577) 2025-03-03 08:24:05 -05:00
Goober5000 4797ce55a2 use vm_vector_2_matrix_norm on normalized vectors
Most places in the code that use `vm_vector_2_matrix` do so on already-normalized vectors.  Changing these to `vm_vector_2_matrix_norm` avoids redundant normalization.
2025-03-02 23:07:09 -05:00
wookieejedi 1756648322 Fixes cursor not restoring when exiting IMU GUI (#6613)
Currently, the cursor does not revert correctly after visiting F3 options screen or lab due to IMGUI unsetting the FSO cursor image.

This PR reloads the FSO cursor image when those screens end. Fixes #6436.

Tested and works as expected.
2025-03-02 17:02:21 -05:00
Mike Nelson 94587100df config rendering methods for reticle and target box gauges (#6576) 2025-03-02 16:17:53 -05:00
Goober5000 791c250c30 upgrade line parsing and end-of-line checks
Upgrade `parse_get_line` to detect all three EOL types: CR, LF, and CRLF.  The function is now more robust against line ending mismatches and will now also warn the modder if a file contains mixed line endings.

Fixes #6395.
2025-03-02 12:48:02 -05:00
Mike Nelson acc382d169 config rendering method for messages, talking heads, and shield gauges (#6575) 2025-03-02 08:02:09 -05:00
Goober5000 f2b9a99bed Merge pull request #6610 from Goober5000/model_parsing_enhancements
enhance detection of model property errors
2025-03-02 01:10:34 -05:00
Goober5000 93a816bc39 Merge pull request #6599 from LuytenKy/model_eyepoint_for_set_camera_host
Model eyepoint for set camera host flag
2025-03-02 01:10:26 -05:00
wookieejedi 67b2987e20 Hide Disabled Controls in the F1 Screen (#6612) 2025-03-01 21:33:31 -05:00
wookieejedi fad0dce530 Fixes missing XSTRs for Joysticks (#6611)
There were rather prominent strings shown for joysticks that were never localized. This PR localizes them to allow for proper translation support.

Tested and works as expected.
2025-03-01 08:36:21 -05:00
LuytenKy 3c907f2607 Add eyepoint flag for set-camera-host
Original issue post #6509. This flag controls if set-camera-host sexp uses the model's eyepoint for the camera position and orientation when no submodel is specified.
Without the flag, the camera will use the model's origin position and orientation.
2025-03-01 08:45:43 +02:00
Mike Nelson 22f34e7d91 config rendering for escort and ets gauges (#6574) 2025-02-28 21:36:24 -05:00
Goober5000 c2829ceb23 enhance detection of model property errors
1. Trim trailing whitespace on any property values, just as leading whitespace is trimmed.  All places where `get_user_prop_value()` is used implicitly or explicitly require this.
2. Warn the user if an invalid `$special` value is parsed.  This would have caught #1, and will now catch related errors, such as misspellings, in the future.
3. Enhance `string_lookup()` with the ability to print the list being searched, if desired.  Remove an unused version of `string_lookup()`.
4. Check for lower-detail submodels being recognized as subsystems.
2025-02-28 01:52:05 -05:00
Mike Nelson 36819bf8b2 config rendering for gauges in hud.cpp (#6573) 2025-02-27 17:16:08 -05:00
Goober5000 f8d71f704a Merge pull request #6603 from Goober5000/qol_audio
audio QoL update
2025-02-26 23:58:26 -05:00
wookieejedi ff85d13709 Create scripting hooks On HUD Config Menu Close and On Control Config Menu Close (#6608) 2025-02-26 19:30:34 -05:00
wookieejedi f854947abc Localize a missing Controls Popup text string (#6605)
There were two rather prominent strings shown in popup windows related to the more modern control presets that were never localized. This PR localizes them to allow for proper translation support.

Tested and works as expected.
2025-02-24 22:54:09 -05:00
wookieejedi dd9144f3f6 Create scripting hook: 'On Options Menu Closed' (#6604)
* Create scripting hook: 'On Options Menu Closed'

Complements #6591. This PR creates a hook, 'On Options Menu Closed' that provides a hook variable of `hv.OptionsAccepted` which is true if the options are accepted/saved, false if the options are discarded and not accepted/saved.
2025-02-23 12:59:02 -05:00
Goober5000 4337ec822f Merge pull request #6598 from Goober5000/ship_get_eye
refactor ship_get_eye
2025-02-22 22:35:37 -05:00
Goober5000 e30690475e Merge pull request #6602 from Goober5000/ship_sparks_fixes
several fixes to ship sparks
2025-02-22 22:35:29 -05:00
Goober5000 b2c44e1a71 clarify which sound type is being parsed when warning about retail-style sounds 2025-02-22 21:12:58 -05:00
Goober5000 1cfe107ef2 audio QoL update
When searching to see if there is an extension mismatch for a soundtrack audio file, go ahead and substitute the mismatched extension if found.  Matching extensions is important, so continue to display a Warning; but for the benefit of players and out-of-maintenance mods, it is more friendly to play the mismatched file even if the audio data is inaccurate.
2025-02-22 21:12:29 -05:00
wookieejedi 0cb01f50ca Fix changes to Options not properly discarding when escape key pressed (#6597) 2025-02-22 20:55:01 -05:00
Goober5000 b1e69023ef rename ship_get_eye to object_get_eye and consolidate object/ship cases where appropriate 2025-02-22 19:29:11 -05:00
Goober5000 29804918dd refactor ship_get_eye
1. Allow `ship_get_eye` to be used for any objects, not just ships
2. Remove the unused `from_origin` parameter and add `local_pos` and `local_orient` instead
3. Simplify the implementation and take advantage of upgrades to `model_instance_local_to_global_*` functions
4. Consolidate `ship_get_eye_local` into `ship_get_eye`
2025-02-22 19:29:11 -05:00
Goober5000 d31f0a1b79 several fixes to ship sparks
1. Refactor `num_hits` to `num_sparks` and `MAX_SHIP_HITS` to `MAX_SHIP_SPARKS` to be consistent with their current (since FS1 pre-release) usage.
2. Remove the unused `HP_SCALE`.
3. Always initialize at least one spark pair.  If `choose_next_spark()` was entered when `num_sparks` was 1, `num_spark_pairs` would be 0 and none of the spark pairs would be initialized.  Consequently, accessing the pair at index 0 would return garbage data.
4. Iterate through `num_spark_pairs` when counting the indexes, rather than the hardcoded (and incorrect) magic number 6.

Fixes a crash discovered by Dawnesya that can only occur when a ship has both the "fighter" and "cruiser" flags.  Normally, fighters never enter the `choose_next_spark()` function and 'big' ships always have at least 3 sparks.
2025-02-22 01:59:07 -05:00
Goober5000 5e156d7055 Merge pull request #6601 from Goober5000/list_box_tweak
change the selection style on the nebula poof list box
2025-02-21 23:17:55 -05:00
Goober5000 b413ed388f change the selection style on the nebula poof list box
With the old style, `LBS_MULTIPLESEL`, clicking once allows the user to select/deselect a poof, and multiple selection/deselection is done by clicking multiple times.  With the new style, `LBS_EXTENDEDSEL`, clicking once changes to a new single selection, but clicking and dragging, or clicking with Shift or Ctrl, creates or modifies a multiple selection.  This should be a more user-friendly selection style for lists with large numbers of poofs.
2025-02-21 17:18:31 -05:00
BMagnu ae501e21c9 Fix particle name assignment when using legacy-type composite effects that address child effects by name (#6600) 2025-02-21 21:37:21 +01:00
wookieejedi 5392131a09 Option to unify setting options with easy flag (#6595)
* Option to unify setting options with easy flag

Most modern UIs, including KNet 1.3, have options that are always set and do not require the user to click save, or on the few cases where options will not be saved automatically, the program shows a popup telling the user the changes are not saved. In addition, the user experience of setting many options then forgetting to press save is far more common and annoying then the opposite. As a last example, even the F3 in-game options menu presents Escape as the leave and save button, not the leave and discard button.

Currently, there are two screens where FSO allows users to press escape after setting options and leave without warning. The main options screen and the HUD screen. As it turns out, half of the options in the main options screen get saved even if the player presses escape (all the detail slider options along with the joystick and mouse sensitivity and dead zone settings), so current behavior is inconsistent to users.

This PR, aimed to be strategic and efficient, creates a game settings table option that allows mods to set so that the escape key for the HUD and Options screen does the same thing as pressing Ctrl-Enter/Accept. This optional setting unifies behavior, so that setting an option sets it whenever the user leaves that screen (whether it is pressing Escape, Ctrl-Enter, or the Accept button). The other screen that involves options and an escape is the control config menu, but that already methods in place to deal with escape in a consistent way.

Tested and everything works as expected.

* fix oversight of saving when going to F3 menu

* update to enum for future additions

* cleanup with better naming

* update warning message

* one more warning cleanup
2025-02-20 08:35:24 -05:00
Goober5000 facaae79a7 Merge pull request #6593 from Baezon/linked-loop-firing-snd
add linked loop firing sounds
2025-02-19 20:44:15 -05:00
wookieejedi bfd8463f30 Make Cockpit Deferred an In-game Option (#6594)
* Make Cockpit Deferred an In-game Option

After testing and consideration, this PR adds the Cockpit Deferred setting to the in-game options. Also adds a parser to the new default_settings.tbl.

* cleanup comments
2025-02-19 07:51:57 -05:00
wookieejedi 881520b225 Update in-game joystick settings to work without restarting FSO (#6592)
* Setting in-game joysticks does not require restart

* have unsetting now work too

* use opportunity to cleanup og setting
2025-02-19 07:51:42 -05:00
Mike Nelson a1e0fe9f13 Add many options to default settings table (#6517)
* Add many options to default settings table

* typo

* clang
2025-02-16 21:55:07 -05:00
Asteroth 8c95178d19 add linked loop firing sounds 2025-02-15 22:33:20 -05:00
wookieejedi 7f506377bf Create scripting hook: 'On Options Menu Tab Changed' (#6591)
* Create scripting hook: 'On Options Menu Tab Changed'

It would be very useful to know which options tab is active (IE Options, Multi, Detail) but it's all under one single Game State `GS_STATE_OPTIONS_MENU`.

This PR creates a hook,  'On Options Menu Tab Changed'  that returns the value of the newly switched to options tab. Lafiel and I both discussed making this an ENUM, but the ENUM list is already quite bloated and this integer value seems like the cleanest solution.

Tested and works as expected.

* fix description typo
2025-02-14 21:37:47 -05:00
wookieejedi 07aedd195f Unify AI Usage of Shield Manage Delay (#6589)
* Unify AI Usage of Shield Manage Delay

`$AI Shield Manage Delay:` can be set in the AI profiles, but also set for AI specific classes. Currently, The values set for the specific AI class are only used `if (iff_x_attacks_y(Player_ship->team, Ships[objp->instance].team))`, otherwise the values in the AI profile are used.

Being able to have the shield delay work in a unified way according to the AI class values is very useful, especially for friendly wingmen that you want have different shield manage delays.

This PR adds a AI profiles flag to unify Shield Manage Delay behavior, so that it always works in the same way regardless of AI team conditions.

* cleanup unifying behavior along with CM firing chance

* restore what sushi had for now
2025-02-12 14:29:23 +00:00
Goober5000 271c83575d Merge pull request #6590 from Goober5000/optional_string_either_fix
fix two uses of optional_string_either
2025-02-11 23:22:55 -05:00
Goober5000 47c538f1be fix two uses of optional_string_either 2025-02-11 22:50:00 -05:00
Goober5000 43b8b579a1 Merge pull request #6582 from Goober5000/update_yaml
update workflows to accommodate actions/cache deprecation
2025-02-11 19:37:29 -05:00
BMagnu 7f13cb6287 Fix incorrect position calculation for thruster glows. (#6588) 2025-02-11 08:27:59 -05:00
Goober5000 e3d11dfb31 Merge pull request #6570 from Goober5000/order_updates
update script API for AI orders
2025-02-10 22:01:21 -05:00
Goober5000 55706d8937 Merge pull request #6569 from Goober5000/smol_tweaks
misceallaneous small fixes and tweaks
2025-02-09 15:17:31 -05:00
wookieejedi c76cb554c3 Allow modders to always show first game tip at start (#6585)
* Allow modders to always show first game tip at start

This PR adds a simple boolean that allows mods the ability to always show the game tips in the same order, starting with the first entry. This is particularly useful if the mod is introducing something to new players.

The current behavior is to pick a random starting location, so this PR just always starts at tip index 0.

Tested and works as expected.

* add comment clarification

* make into integer instead of bool

* better tips index setting method

* spelling and static cast

* one more static cast

* make actual warning

* clang and consistent order
2025-02-09 20:01:07 +00:00
Goober5000 6421116760 Merge pull request #6586 from Goober5000/weapon_detonation_addendum
addendum to fixed missile detonation
2025-02-09 14:45:41 -05:00
wookieejedi 1342f17a2d Allow mods to Always Show Directive Value Count (#6584)
* Allow mods to Always Show Directive Value Count

Previously, directive counts were not shown if the value was <= 1.
This PR adds a flag to always show the value, and tests work as expected. It also fullfills a longstanding statement from Mage

```
given that, aside from directive-value, all the code involving Directive_count seems to be volition:-original, it really is past time for a flag skipping this > 1 check
```

* cleanup
2025-02-09 13:45:37 -05:00
Goober5000 ad8dee0f2b addendum to fixed missile detonation
As discovered by PDFCommand and tracked down by Asteroth, there was another "missed target" check in `ship_weapon_check_collision()`, in addition to the more comprehensive check in `weapon_home()`.  Since the check is redundant and there is an existing `$Fixed Missile Detonation:`, skip the check if the flag is active.
2025-02-09 01:28:33 -05:00
Goober5000 e4553855ba update to a specific git commit, pending official v1.2.1 release 2025-02-07 22:27:58 -05:00
Goober5000 76b54c7be1 Merge pull request #6583 from Goober5000/lcase_stringcost
allow stringcost to be case-insensitive
2025-02-07 21:13:29 -05:00
Goober5000 97a06bda71 allow stringcost to be case-insensitive
Allow `stringcost()` to use a specified function to check equality, and provide both case-sensitive and case-insensitive sample functions.  Use case-insensitive checks for sexp operator lookup.
2025-02-07 00:39:50 -05:00
Goober5000 531494c4a3 update workflows to accommodate actions/cache deprecation
As reported by MjnMixael and tracked down by qazwsxal, actions/cache V2 is being removed at the end of the month:
<https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down>

Quoting qazwsxal:
> It's being hit inside humbletim/[email protected] as that's the last line before the error was hit. I've investigated that repo and a version bump to 1.2.1 should fix it as humbletim has updated the actions/cache version.

So, this bumps all the relevant humbletim repository references to 1.2.1.
2025-02-06 20:56:46 -05:00
Goober5000 ced716df35 Merge pull request #6580 from Goober5000/fix_6572
fix wing creation dialog
2025-02-05 20:28:35 -05:00
Goober5000 3b54488d3b Merge pull request #6565 from Goober5000/utility_functions
add some utility functions
2025-02-04 22:05:05 -05:00
Goober5000 3d1fce99ac fix wing creation dialog
When forming a wing, if there is a name conflict but the ship will actually be used in the wing, don't report the conflict.  Fixes #6572.
2025-02-04 00:36:51 -05:00
Goober5000 811507c62f update tostring functions 2025-02-04 00:34:39 -05:00
Goober5000 85cb0480e7 fix waypoint scripted sexp type to return a waypoint 2025-02-04 00:34:39 -05:00
Goober5000 1492e9c785 smol cleanup 2025-02-04 00:34:37 -05:00
Goober5000 417ba3bd25 Merge pull request #6566 from Goober5000/substitute_main_hall_fred
add Substitute Main Hall field to FRED campaign editor
2025-02-04 00:31:41 -05:00
Goober5000 c1c2079e46 fred support for substitute main hall 2025-02-03 22:14:58 -05:00
Goober5000 21531a2825 fix spelling and update dialog 2025-02-03 22:14:58 -05:00
Goober5000 5f73220cd1 Merge pull request #6559 from Goober5000/mission_goal_scripted_sexps
enable mission goals for scripted sexps
2025-02-03 21:42:07 -05:00
Goober5000 e7029c2ddb Merge pull request #6469 from Goober5000/vmallocator_update
some upgrades to vmallocator.h
2025-02-03 21:35:37 -05:00
BMagnu 23dc22e172 Unify Particle Attachment (#6571)
* Fix incorrect ship legacy particle curve assignment

* Setup trigger radius

* Properly attach particle sources to objects and subobjects

* Add trigger velocity for weapon impacts

* Onetime particle source timing fix

* Warnings

* Allow global_to_local to work with no submodel

* Allow global_to_local to work with no submodel, again
2025-02-03 22:14:19 +01:00
Mike Nelson 5b736b1ddc Hud config framework (#6495)
* Add scaling for vfnts and scale multipler to gr_string

* nullptr

* Add scaling to a couple other string operations

* Add scaling features to additional bitmap drawing methods

* Implement framework for rendering hud gauges in config mode

* fix merge error

* address feedback
2025-02-03 07:01:47 -05:00
Goober5000 f7396d53a8 Merge pull request #6567 from Goober5000/collect_magic_numbers
reduce magic numbers in missionweaponchoice
2025-02-02 22:28:40 -05:00
Goober5000 a533300b9e add getters for waypoint information 2025-02-02 15:25:47 -05:00
Goober5000 133b033ea0 some upgrades to vmallocator.h
Make `SCP_vector`, `SCP_list`, `SCP_set`, and `SCP_multiset` subclasses of their STL counterparts.  This allows helper functions to be added to each, including the `contains()` function which is not available until C++20.  (This has minor effects on other parts of the codebase that treated `SCP_` and `std::` as synonyms.)  Since there is now a nontrivial amount of code that needs to be in a .cpp file, create vmallocator.cpp.

Note that `SCP_string` truncation has been refactored to use length rather than C-string size to be consistent with other `std::basic_string` functions.

Also, remove some enum class hashing code which is no longer necessary now that the codebase is at C++17.
2025-02-02 14:54:26 -05:00
Goober5000 89e2f264fd update script API for AI orders
Allow waypoint orders to target a specific waypoint and go in reverse.  Add script access to waypoints and waypoint lists belonging to orders.

Fix assignment of targets and goal start times.  Assign targets when they are different (and thus need to be assigned), not when they are the same.
2025-02-02 12:04:43 -05:00
Goober5000 0a4ca56268 Merge pull request #6557 from Goober5000/update_gitmodules
update .gitmodules references
2025-02-02 11:33:02 -05:00
Mike Nelson 103ad70587 Allow preloading briefing icons (#6548)
* allow preloading briefing icons

* nullptr

* oops

* Fix from rebase
2025-02-02 16:42:36 +01:00
Mike Nelson 8afb41a368 allow scripted gauges to be off by default (#6562) 2025-02-02 11:05:35 +01:00
BMagnu 7c37e9932d Merge pull request #6564 from BMagnu/cpp_17_cleanup
C++17 cleanup followup
2025-02-02 18:31:14 +09:00
Goober5000 adf9ac0e22 Merge pull request #6561 from Goober5000/subsystemname
add subsystemname scripted sexp type
2025-02-02 02:31:02 -05:00
Goober5000 34e467b3a7 also update 2d.cpp to reduce warnings 2025-02-01 23:16:33 -05:00
Goober5000 2ec344d826 add some utility functions
Useful functions for utility.h and string_utils.h.  Adapt existing code accordingly.
2025-02-01 23:16:33 -05:00
Goober5000 8dc2d49e6a reduce magic numbers in missionweaponchoice
Use the existing definitions to improve code readability.
2025-02-01 23:04:20 -05:00
Goober5000 95a6438a77 change _SETTINGS to _LAYOUTS as it's more descriptive 2025-02-01 23:04:20 -05:00
Goober5000 5323cc32d6 Merge pull request #6506 from Goober5000/pstypes_changes
a few pstypes changes and refinements
2025-02-01 21:07:28 -05:00
Birk Magnussen ea002628a7 Clang Tidy 2025-02-01 22:46:43 +01:00
Birk Magnussen d9b9863e2a Clang Tidy 2025-02-01 22:26:11 +01:00
Birk Magnussen ada62c6c59 missing includes 2025-02-01 13:33:43 +01:00
Birk Magnussen 540d841f06 Remove any and variant libs 2025-02-01 13:26:28 +01:00
Birk Magnussen 1f2a8dce2a remove optional 2025-02-01 13:17:26 +01:00
Mike Nelson 7bb85b8604 Allow VFNTs to auto scale and disallow auto scaling in FRED (#6546)
* allow VFNTs to auto scale and disallow auto scaling in FRED

* fix shadowing

* Update FSFont.cpp

* don't code from your phone, mjn

* refactor to use one central method
2025-01-31 09:35:57 -05:00
Mike Nelson 65c4e333a4 this should be local 2025-01-31 08:18:00 -06:00
Goober5000 2a6017cb73 enable mission goals for scripted sexps
Add "goal" as a type recognized by scripted sexps.  Also add `mn.Goals` as a collection to complement `mn.Events` and move the goal type to goal.cpp and goal.h to match event.cpp and event.h.  The new `mn.Goals` collection contains the same data as the existing `Objectives` collection in the briefing UI library, so the latter could be deprecated.
2025-01-30 22:09:29 -05:00
Goober5000 ca624f86e2 a few pstypes changes and refinements
Several changes related to the volumetrics model fix:
1. Update the `model_load()` prototype with better parameter names, including a new `ErrorType` enum defined in pstypes.h
2. Update the `MIN`, `MAX`, and `CLAMP` macros, all of which were susceptible to performance issues because they duplicated their tokens.  This could cause functions or calculations to be re-run unnecessarily.  Since the codebase is now on C++17, `std::clamp()` can be used.
3. Update the rest of the codebase to fix any associated issues.
2025-01-30 21:35:03 -05:00
Goober5000 2f75155721 add subsystemname scripted sexp type
This type for subsystems is analogous to the shipname type for ships.  Sometimes it is useful to refer to a subsystem even if its parent ship is not present.  Whereas the subsystem object would be invalid, the subsystemname string still contains the string that the mission designer specified.

Relatedly, upgrade the parsing of `+Parent Parameter Index:` to be checked on both parented and non-parented parameters.  This will help both modders who put the field in the wrong place and programmers who may want to add a parented parameter in the future.
2025-01-30 21:05:38 -05:00
Goober5000 028a03748f Merge pull request #6556 from Goober5000/fix_sidethrust
fix random sidethrust call
2025-01-30 20:31:15 -05:00
BMagnu b4905d111f Fix outputs being not passed along in input-only derive case (#6558) 2025-01-30 17:52:18 +00:00
BMagnu 82236ccd9f Merge pull request #6465 from BMagnu/particle_cleanup
The definitive Particle Effect rework
2025-01-30 17:20:42 +09:00
Goober5000 de7345c710 update .gitmodules references
Use the repository URLs, rather than @asarium's user-specific URLs.  Follow-up to #6552.
2025-01-29 17:39:14 -05:00
Mike Nelson 922ff160e2 Check for invalid player progress (#6554)
* check for invalid player progress

* clarity

* requested change
2025-01-29 13:37:01 -05:00
BMagnu d9e859aac0 Remove Typo and fix volumetrics merge issue 2025-01-29 09:30:43 +01:00
Goober5000 88d7bbf57b fix random sidethrust call
This function call checked the acceleration of the targeted object, rather than the active object as it should have.  Fix it to check the active object.  For mods that use `$Random Sidethrust Percent:` (such as Inferno), this fixes a bug that could cause an invalid memory access in situations where the targeted object is -1.
2025-01-29 02:32:44 -05:00
Mike Nelson 4f503ec419 fix countermeasure virtvars (#6553) 2025-01-28 17:14:52 -05:00
Mike Nelson 949a37267b move warp flash option to table 2025-01-28 15:33:54 -06:00
Mike Nelson 7e5a07dc0f move 3d warp option to table 2025-01-28 15:25:21 -06:00
Goober5000 3f44bf4f9f Merge pull request #6552 from Goober5000/update_libRocket
update libRocket reference
2025-01-27 18:12:31 -05:00
Goober5000 f2c2fd2644 Merge pull request #6547 from Goober5000/campaign_tree_fix
fix crashing in campaign tree in FRED
2025-01-27 18:12:16 -05:00
Goober5000 f25b57851e update libRocket reference
Update the libRocket commit hash to the latest revision in scp-fs2open/libRocket.  Fixes #6551.
2025-01-26 22:49:07 -05:00
BMagnu 64bfc4a329 Allow Submodel hosts for non-ship objects 2025-01-26 23:42:19 +01:00
Goober5000 51c485ea23 Merge pull request #6550 from jg18/fix/issue-6549
Fix map container mutation issues
2025-01-26 17:26:28 -05:00
Joshua Glatt 19b849fd71 disallow all forms of add-to-map with a container used in special arg 2025-01-25 16:47:05 -08:00
Joshua Glatt 05e1a7a429 fix map container mutation issues 2025-01-25 16:08:49 -08:00
Goober5000 a76d3528fc fix crashing in campaign tree in FRED
Occasionally a link endpoint could be -1, such as with End of Campaign links, but there were no checks in the `add_link` and `remove_link` functions to protect against array accesses with a -1 index.  Add checks in several places for this.
2025-01-24 21:45:27 -05:00
wookieejedi c4341518bb Allow Modders to Tune Guarding (#6544) 2025-01-23 19:14:51 -05:00
Gamma39er ab004848ee Table based warp parameters and new custom warp animations. (#6500)
* Made lens flare size proportional to model size.

* Updated fireball_wormhole_intensity function to be smooth and unbreakable

* Added variable frame frate warp and new lens flare animation.

* Last animation changes made since I stopped coding.

* Made cinematic animation, warp-size ratio, and flare-size-ratio parameters configurable by table. New exp_to_line function to be more consistent and to fix a bug.

* Made everything configurable by table.

* Updated default values for cinematic warp animation.

* Fixed the usage of MAX() so that it assigns to the variable.

* Fixed obvious freakin' double to float casting warnings.

* Made requested changes. Flare animation can now be specified with an enum and default else statements will not override earlier entries.

* Changed warp table parameters to Warp flare style and Warp model style.

* Added defaults to switch statements, and made this backwards compatible with older mediavps.

* Removed commented code.

* Opened up flare flickering for table editing.

* Restored cinematic warp flare ratio default.
2025-01-24 00:35:38 +01:00
Mike Nelson 9271da7e7c build in the common z load first methods and forwarders 2025-01-23 10:42:19 -06:00
Mike Nelson 2047bfacd0 Fix child enums in lua sexps (#6543)
* fix child enums in lua sexps

* variable shadow

* comments
2025-01-22 07:55:06 -05:00
Goober5000 f102cc3ebf Merge pull request #6537 from Goober5000/functional_if_then_else_fix
fix NaN for functional-if-then-else
2025-01-21 23:06:58 -05:00
wookieejedi a80dfd8961 Cleanup few In-game Defaults (#6542) 2025-01-21 20:25:28 -05:00
Goober5000 39438e1049 Merge pull request #6514 from Goober5000/hitpoint_fixes
make hitpoint sexps safer to use in debriefing
2025-01-20 20:28:23 -05:00
Goober5000 57fb8dbf8a Merge pull request #6541 from Goober5000/sexp_documentation
update sexp documentation
2025-01-20 20:27:54 -05:00
Goober5000 584e9e85d5 update sexp documentation
Clarify some sexp help descriptions.
2025-01-20 18:07:19 -05:00
wookieejedi 750c3845ff Fix more Popup Button Alignments (#6539)
There were 2 popup dialogs that were missing an `Affirmative` flag, which mean the button was not in the right position and thus showed a visual misalignment. This PR fixes that and in tests works as expected.
2025-01-20 15:41:31 -05:00
wookieejedi bd2094c2b6 Ensure that Ext Game Popup sends Affirmative and Negative Flags (#6538)
`On Dialog Start` (used in SCPUI and within `popup_init`) reads popup options by affirmative or negative flags, and the popup for exiting the Mainhall did not set these flags. Notably, most popups that use `POPUP_NO` or `POPUP_YES`  already, so this PR sets those flags for this popup. Now `On Dialog Start` within `popup_init` has access to the correct flags.

PR tested and works as expected, both in retail UI and SCPUI
2025-01-20 15:41:16 -05:00
Goober5000 a606ed73a4 fix NaN for functional-if-then-else
Any NaN encountered in the evaluation of functional-if-then-else should be isolated to the branch on which it occurs.  Fixes #6536.

Also improve some help text for clarity.
2025-01-20 08:47:04 -05:00
BMagnu 5ce7881a27 Merge branch 'master' into particle_cleanup 2025-01-19 19:56:18 +09:00
Goober5000 1c821412cf Merge pull request #6529 from Goober5000/fix_event_editor_modification_check
fix event editor modification check
2025-01-18 13:41:25 -05:00
Goober5000 b1406bcb3e Merge pull request #6535 from Goober5000/set_with_breed
make line-of-sight objects aware of its subclasses
2025-01-18 13:41:10 -05:00
Mike Nelson adb0fa6ade fix input text string rendering (#6533) 2025-01-18 08:04:08 -05:00
Mike Nelson bcea174509 Mission goals hook (#6534)
* mission goals hook

* Change hook name

* text
2025-01-18 08:03:50 -05:00
Goober5000 1c2117095a make object aware of its subclasses
Looking through all places in the scripting API where `l_Object.Set()` is called, here is one where we might want to know about the object's breed.

(Normally we would return the result of `ade_set_object_with_breed()`, but the `testLineOfSight_internal()` function has multiple return arguments.)
2025-01-17 18:00:27 -05:00
Goober5000 5f2cefd130 Merge pull request #6527 from Goober5000/kamikaze_ships_attack_subsystems
fix kamikaze attack of subsystems
2025-01-17 17:00:19 -05:00
Goober5000 f63c550e03 Merge pull request #6530 from Goober5000/update_window_2
re-remove Update_window check
2025-01-17 17:00:09 -05:00
Goober5000 af11d1c8c6 fix event editor modification check
The `query_modified()` function in FRED did not correctly check whether messages were modified, although interestingly, it did so in qtFRED.  Even in qtFRED, there were a few minor omissions.  Overall, this fixes FRED and syncs up the FRED and qtFRED versions.

Fixes #6528.
2025-01-16 21:27:30 -05:00
Goober5000 9a0fa3c289 re-remove Update_window check
At some point between 2002 and 2006, the Update_window code was removed, but since we don't have FRED history from that period, we don't know the exact rationale.  However, since FRED appears to have no difficulty rendering every frame, and since there may be parts of FRED that don't set Update_window when they need to (for example, the background editor), let's keep this disabled.

Follow-up to #6435.  Fixes the background not updating when a bitmap is moved in the background editor.
2025-01-16 21:22:55 -05:00
Goober5000 c4d17053d6 Merge pull request #6524 from Goober5000/object_model_functions
tweak object model/instance convenience functions
2025-01-16 21:00:43 -05:00
Goober5000 04068fc83a fix kamikaze attack of subsystems
Kamikaze ships entering broadside mode (`ai_cruiser_chase()`) would always point toward the center of the ship.  With this fix, they will point toward a subsystem if attacking one.  (In practice this situation had not been encountered before, since by default the ai-destroy-subsystem order is only available to fighters and bombers, which do not use broadside mode.)
2025-01-16 15:47:49 -05:00
Mike Nelson c9ccace89a Lua set mainhall (#6498)
* lua set mainhall

* boolEAN

* tidy
2025-01-16 07:44:38 -05:00
Mike Nelson b367fe8441 Some minor Control Config UI changes for SCPUI (#6508)
* allow preset override from Lua and change a warning to a popup if we're in the UI

* const it up

* headers might help, too, dummy
2025-01-16 07:44:16 -05:00
Goober5000 fa10f8e8eb tweak object model/instance convenience functions
Make these convenient functions even more convenient:
1. Change `object_get_model()` to `object_get_model_num()` and `object_get_model_instance()` to `object_get_model_instance_num()` to more accurately reflect what they do
2. Add new `object_get_model()` and `object_get_model_instance()` functions to return `polymodel*` and `polymodel_instance*` values.
2025-01-16 01:10:53 -05:00
Goober5000 9880694dcc Merge pull request #6526 from wookieejedi/failsafe-for-tex-replace-fix
Add failsafe check for new texture replace fix
2025-01-16 00:29:21 -05:00
wookieejedi 454b80e3eb Add failsafe check for new texture replace fix
One line failsafe condition
2025-01-15 16:50:20 -05:00
Goober5000 a4d9b23802 Merge pull request #6523 from Goober5000/fix_precedence_per_bank
fix player weapon precedence to include per-bank restriction
2025-01-15 15:02:25 -05:00
mjn-mixael 15c4e35ac4 match updated signature 2025-01-15 08:52:58 -06:00
mjn-mixael 9fc0f35cc7 Merge branch 'master' into enhance_vasudan_cheats
# Conflicts:
#	code/graphics/2d.cpp
#	code/graphics/2d.h
2025-01-15 08:46:02 -06:00
Mike Nelson f94e12db4a Add missed popup for on dialog frame and add text hook var (#6522)
* add missed popup for on dialog frame and add text hook var

* int to bool

* redundant bool
2025-01-15 09:42:58 -05:00
Mike Nelson a42a3fb49d Add scaling features to additional bitmap drawing methods (#6487) 2025-01-15 09:42:21 -05:00
Mike Nelson 8a09caab97 Fix font multiplier in release builds (#6525)
(cherry picked from commit 763616f824b86d74bd7e2ded7abc48770e3e8d1c)
2025-01-15 09:41:20 -05:00
Mike Nelson d27f735588 Add scaling for vfnts and scale multipler to gr_string() (#6481)
* Add scaling for vfnts and scale multipler to gr_string

* nullptr

* Add scaling to a couple other string operations

* Don't scale fonts in FRED
2025-01-14 15:05:06 -05:00
wookieejedi b29e397fa7 Fixes Debris not inheriting parent ship texture replacements (#6519)
* Fixes Debris not inheriting parent ship texture replacements

Debris chunks that use the same texture as the actual hull model are not updated when `texture-replace` methods are used. For example, a clean grey base textures that has texture replace via table or FRED is changed to red/brown. But when the ship is destroyed the debris objects are using the original lighter texture instead of the newer darker one.

#6154 provided the groundwork to fix this, but one step fell through the cracks; setting the debris hull textures to what the parent ship used.

This PR sets the debris texture replacements when debris is created to fix this (and fixes #2462).

Fix is tested and works as expected.

* cleanup setting shared

* get pmi correctly
2025-01-14 07:42:46 -05:00
Goober5000 60ed388826 give loop counter variable a better name 2025-01-13 22:35:55 -05:00
Goober5000 f9aa53c569 fix player weapon precedence to include per-bank restriction
Inferno reported a bug where the unavailability of weapon A could result in weapon B being assigned to a particular weapon bank, even if weapon B was disallowed for that bank.  Add a per-bank restriction check to fix this.
2025-01-13 22:26:31 -05:00
wookieejedi 7a07c995ca Add Mod Option to Limit 'Show Ship' when Toggling Cockpits (#6513)
* Add Mod Option to Limit 'Show Ship' when Toggling Cockpits

FotG uses cockpits and 'show ship', and also provides a way for players to toggle off cockpits. Unfortunately, if the player disables cockpits, 'show ship' still appears and looks very odd (since it appears the player is flying a ship with a hole in the center where the cockpit would be). Other mods have made entire ships with their cockpits, but FotG needs to use 'show ship' to match team colors and moving external ship animations.

This PR adds a game_settings option that allows mods to set to only use 'show ship' if cockpits are enabled.

Tested and works as expected.

* simplify logic

* fix typo
2025-01-13 19:30:30 +00:00
Mike Nelson feb0932015 lua access to max ships per wing (#6510) 2025-01-14 00:57:08 +09:00
Asteroth 48e5ea0688 shrink minimum warning for modelss (#6515) 2025-01-14 00:56:52 +09:00
EatThePath 976ac04369 updating my own name (#6518) 2025-01-14 00:56:24 +09:00
Goober5000 cecfd9f7ff fix calculation of percent_killed
This has been broken ever since commit 6c17ef09ab in 2005.  Since `get_hull_pct()` did not return negative values, `percent_killed` was always 0.  Allow negative values in this case.
2025-01-12 16:52:16 -05:00
Goober5000 0e98d01ce5 use the ship pointer version of shield_get_max_strength() where appropriate 2025-01-12 16:52:16 -05:00
Goober5000 eeffbd692f make hitpoint sexps safer to use in debriefing
There is a rather large design flaw in FreeSpace debriefings... debriefing SEXPs can refer to in-mission ship data, while all ships (and all objects) are deleted as soon as the mission completes.  Specifically, `obj_delete()` is called which sets all objects to `OBJ_NONE` and marks them as freed, although the data still exists in the various arrays.  This is the use-after-free problem, but applied to the in-game object system, rather than memory accessed by pointers.

It's probably best to defer fixes to an as-needed basis.  As for hitpoint SEXPs, this change updates them to use the object and ship references from the ship registry, since the ship registry is not cleared by the time the debriefing is loaded.  (Using `objp->instance` and `shipp->objnum` at this point would be problematic.)  Since subsystems are also cleared at this point, this also updates the warning messages in those functions.

Fixes an Assert seen in debug mode in Inferno.
2025-01-12 16:52:16 -05:00
Goober5000 7cf7f0ea4e Merge pull request #6512 from Goober5000/looping_sound_fixes
fix volume updates for looping sounds
2025-01-12 16:00:12 -05:00
mjn-mixael 0326db10ff Merge branch 'master' into enhance_vasudan_cheats
# Conflicts:
#	code/utils/string_utils.cpp
2025-01-12 12:20:59 -06:00
Mike Nelson 4dfaa85b6f Default settings tbl (#6491)
* initial version of default_settings.tbl

* Add a way to change player detail level defaults and implement a couple more options to detail_settings.tbl

* support the rest of 2d.cpp options

* Allow enforcing options to a specific value

* modernize detail defaults, levels, and values

* Fix parsing issue and remove lambda capture by reference

* fix print

* clang

* More efficient +Enforce parsing

* cleanup

* typo

* don't negate this

* error_display

* clarify language between presets, levels, and values

* add default case

* small fix

* use a map to minimize string lookups
2025-01-12 11:29:11 -05:00
wookieejedi de969b5e76 Allow Modders to Tune Strafing (#6511)
* Allow Modders to Tune Strafing

Many mods change ship velocities and damp values, but this commonly leads to poor behaviors attacking large ships within strafe mode (which is the main method for attacking big ships in a sustained way). As an example, FotG has damp and velocity values that are higher than base FS, thus the defined strafe values result in behavior where fighters never can complete a sustained firing pass against a large ship unless they are sitting and parking (which does not fit our goals to match the movie).

The values for dictating how strafe behavior occurs are easily editable by changing some key values, which this PR exposes to modders. Furthermore, mods may give large ships very long range weapons, so being able to set how far away a ship should do a strafe run begins is very valuable.

In testing it was very easy to get desired behavior of having AI do long sustained strafing runs. I estimate other mods will likely be able to leverage these values to tune strafing behavior.

I did numerous tests and evaluations finding the best balance of values to expose. I would be happy to discuss these changes in detail too, as I know this exposes a number of values.

* clang

* incorporate feedback
2025-01-12 08:08:05 -05:00
Goober5000 acfe6a17ac fix volume updates for looping sounds
Now that `snd_do_frame()` has been tightened up to specifically only adjust audio for the adjust-audio-volume sexp, the redundancy-avoiding code in `snd_set_volume()` is obsolete.  So, set the sound volume immediately, even if it is a looping sound.

This is a two-for-one fix; the proper setting of volume fixes both #6504 and #6507.
2025-01-11 15:23:57 -05:00
Goober5000 b40fab6739 update looping sound data structures
Change `currentlyLoopingSoundInfos` and `currentlyLooping3dSoundInfos` from lists to maps.  The data structure should keep track of the volumes currently, as opposed to historically, associated with each sound handle.

Since the map requires `util::ID` and its derivatives to be hashable, add `util::ID_Hash`.
2025-01-11 15:23:57 -05:00
Goober5000 a2141865e1 Merge pull request #6467 from Goober5000/ai_goal_refactor
Ai-goal refactor
2025-01-11 15:10:48 -05:00
Goober5000 49de71d269 Merge pull request #6505 from Goober5000/hull_pof_graceful_fail
gracefully fail if volumetrics model is not found
2025-01-06 13:02:18 -05:00
Mike Nelson b49db4ef7b Add Lua global variables library (#6472)
* add global variables library

* nested namespaces
2025-01-06 17:36:59 +09:00
Goober5000 1527824f77 gracefully fail if volumetrics model is not found
If the volumetrics model cannot be loaded, fail gracefully by warning and not generating volumetrics.  This prevents a hard exit in the event of a model problem, particularly when a mission is being edited in FRED.
2025-01-06 01:56:46 -05:00
wookieejedi 65dd3a72d6 Fix offset dialog option image with controls preset confirmation (#6502) 2025-01-05 16:55:46 -05:00
Mike Nelson 402ca07c13 Allow per-stage briefing grid colors (#6448)
* Allow per-stage briefing grid colors

* parameter name

* remove redundant initializer

* const const const

* check for 25_0 mission data

* 24.3 instead of 25.0

* clang
2025-01-05 22:48:32 +01:00
Birk Magnussen 467bc32633 Merge branch 'particle_cleanup' of github:BMagnu/fs2open.github.com into particle_cleanup 2025-01-05 17:04:13 +01:00
Birk Magnussen 45c7ee1a45 Get rid of cast warnings on MSVC 2025-01-05 17:03:16 +01:00
Mike Nelson 297a9389cd Func to get a ship's persona directly (#6497)
* func to get a ship's persona directly

* virtvar instead of func

* get persona index

* lua index
2025-01-05 10:22:32 -05:00
BMagnu a0e9f0d450 Merge branch 'master' into particle_cleanup 2025-01-03 05:50:23 +09:00
Goober5000 8baee0470a refactor AIG_TYPE_* into enum classes 2025-01-02 14:05:21 -05:00
Goober5000 423042bf11 refactor AI_GOAL_* #defines into enums, and remove bitwise operations on them [FRED and qtFRED] 2025-01-02 14:05:21 -05:00
Goober5000 c38882a51e refactor AI_GOAL_* #defines into enums, and remove bitwise operations on them [non-FRED] 2025-01-02 14:05:21 -05:00
wookieejedi fa8e5845af Merge pull request #6493 from TheForce172/fix/QTFRED_Title_Bar
QT Fred Boillerplate Removal and Memory Safety
2025-01-02 13:30:58 -05:00
Asteroth ca243a0a6a Make explicit shield hit radius for ships and weapons (#6478)
* allow shield effect radius overrides

* this should be a float

* change variable name

* skip rendering 0 radius
2025-01-02 12:56:46 +01:00
wookieejedi fe722cbab7 Fix Mouse XSTR Index in In-game options (#6501)
In the In-game options for `mouse_mode` the XSTR index for "Mouse" was set to 1774, which is already used for "Glide When Pressed". Luckily "Mouse" XSTR already exists with Index 1373, so this PR changes it to that.
2025-01-02 12:53:39 +01:00
Mike Nelson 369ed0f5c0 prefer ship tech model if it exists (#6499) 2025-01-01 09:54:32 -05:00
Goober5000 a8a9fea4dc Merge pull request #6451 from Goober5000/set_squadron_wings
add set-squadron-wings sexp
2024-12-30 21:06:23 -05:00
Goober5000 8a86254aeb Merge pull request #6496 from daftmugi/fix-antlr4-cmake-deprecation-warnings
Fix antlr4 CMake deprecation warnings
2024-12-30 21:05:40 -05:00
Goober5000 ca9edc0c6b Merge pull request #6483 from daftmugi/add-campaign-cmdline
Add '-campaign' cmdline option to set current campaign
2024-12-30 21:03:13 -05:00
The Force 77de5c0aa7 Address Feedback 2024-12-30 17:37:05 +00:00
Daft Mugi cda02de4a0 Fix antlr4 CMake deprecation warnings
The deprecation warning that required changes:

* CMP0054: Only interpret if() arguments as variables/keywords when unquoted.

The deprecation warnings that did NOT require changes as those
features were not used:

* CMP0026
* CMP0042
* CMP0045
* CMP0059
2024-12-29 17:45:30 -06:00
Goober5000 c3e9099e9d Merge pull request #6492 from Goober5000/immobile_flag_migration_checks
add safeguards to the "immobile" flag migration
2024-12-29 18:32:53 -05:00
Mike Nelson a99dd120f7 Merge branch 'master' into enhance_vasudan_cheats 2024-12-29 11:07:44 -06:00
Mike Nelson f1271cde03 fix warp flash option (#6494) 2024-12-29 12:01:59 -05:00
Goober5000 755512ca00 Merge pull request #6488 from Goober5000/adjust_audio_volume_adjustments
adjust-audio-volume adjustments
2024-12-29 00:35:01 -05:00
Goober5000 9770888376 Merge pull request #6480 from daftmugi/ensure-pref-path-trailing-slash
Ensure custom preferences path ends with path separator
2024-12-29 00:34:18 -05:00
The Force 22ec235c22 Add missing override 2024-12-28 15:53:36 +00:00
The Force 5b3df07473 And unused 2024-12-28 15:39:05 +00:00
The Force d6c9ff43d7 Asteroid editor and add delete on close to a few more unchanged dialogs 2024-12-28 15:17:23 +00:00
The Force 76abb2819d Update Command Briefing Dialog 2024-12-28 14:52:53 +00:00
The Force bb589059c5 Update Wing names dialog 2024-12-28 14:44:31 +00:00
The Force 30bc3c78ac Add delete on close to dialogs that don't need other changes 2024-12-28 14:29:11 +00:00
The Force 68c2fcc31c Update Ship editor dialog 2024-12-28 14:28:32 +00:00
The Force abdef2ca07 Update Object Orientation dialog 2024-12-28 14:26:45 +00:00
The Force 2b1bf2c1bb Update Mission Goals dialog 2024-12-28 14:23:35 +00:00
The Force d94da96ca4 Update Shield Dialog 2024-12-28 14:22:16 +00:00
The Force 5892edaf57 Update Reinforcements dialog 2024-12-28 14:17:41 +00:00
The Force 069a30c190 Update Mission Spec dialog 2024-12-28 14:16:27 +00:00
The Force 5b23d9d3b8 Update loadout dialog 2024-12-28 14:15:14 +00:00
The Force 24590dd548 Update Fiction Viewer 2024-12-28 14:09:48 +00:00
The Force a26d52dcea Revert "Slightly off topic but remove C style casts from selection dialog"
This reverts commit 2a7806d690.
2024-12-28 14:07:11 +00:00
wookieejedi 7931a55744 Update JOY_NUM_BUTTONS to 128 (#6479)
Follow-up to #6371 (and replaces #5960 since the goal of that PR was already taken care of with #6371 adding the procedural translation).

Overall tagging this as 25.0 since multiple folks have asking about bumping the limit
2024-12-28 08:37:22 -05:00
wookieejedi 0832667744 Fixes Joystick Hat Labeling (#6486)
* Fixes Joystick Hat Labeling

Fixes mislabeling of joystick hat names that appeared in #6371. Tested and confirms this fixes the issue.

* fix ordering oversight
2024-12-28 08:37:07 -05:00
Goober5000 2f18741258 add safeguards to the "immobile" flag migration
When a mission is loaded in FRED the "immobile" flag is migrated to "don't-change-position" and "don't-change-orientation".  So, notify the FREDder that this is happening, and add checks to the "potential issues" checker to guard against mixing the old and new flags.

Follow-up to #6304.  Resolves #6489.
2024-12-27 17:07:47 -05:00
Goober5000 04d36a31c8 add the FredOnMissionLoad hook (sync with original FRED) 2024-12-27 01:03:22 -05:00
Goober5000 e3393c1bea adjust-audio-volume adjustments
Make some modifications to the adjust-audio-volume infrastructure:
1. Add an `aav_volume` array for ease of access to all three volume variables.  Refactor `snd_adjust_audio_volume()` to use this array to avoid duplicating code.
2. Move `update_looping_sound_volumes()` to be handled in parallel with `audiostream_set_volume_all()`, and for the same reason: avoid setting the sound volume for every looping sound on every frame if the volume has not changed.
3. If the volume is to be adjusted immediately, apply the relevant changes without waiting for `snd_do_frame()` to be called on the next frame.  Resolves #6291.
4. Fix some edge cases in `adjust_volume_on_frame()`.
2024-12-24 22:36:31 -05:00
Goober5000 7c82072f0c Merge pull request #6484 from Kestrellius/weapon-light-followup
Weapon light followup
2024-12-24 19:31:27 -05:00
Goober5000 08b24dba62 use range-based for 2024-12-24 15:52:50 -05:00
Goober5000 d73eaf08ca add set-squadron-wings, part 3
Move a lot of the logic into hudwingmanstatus, and preserve the wing information that is common from one display to the next.
2024-12-24 15:52:50 -05:00
Goober5000 123d68d94d add set-squadron-wings, part 2
Refresh the ship position and HUD status for the new wings.
2024-12-24 15:52:50 -05:00
Goober5000 7af523bdf3 convert ignore and used to bool 2024-12-24 15:52:50 -05:00
Goober5000 e58573158c add set-squadron-wings, part 1
SEXP infrastructure and partial implementation, excluding refresh of ship position and HUD status for the new wings.
2024-12-24 15:52:48 -05:00
Goober5000 6487abd57f put operators in proper category; add newlines to sexp help 2024-12-24 15:51:21 -05:00
Goober5000 82304a2a2d Merge pull request #6482 from daftmugi/cmake-build-with-discord-option
Add FSO_BUILD_WITH_DISCORD cmake option
2024-12-24 13:46:58 -05:00
Goober5000 a3b709cd12 Merge pull request #6453 from Goober5000/add_remove_goal_sexp_updates
enhance the add-goal and remove-goal sexps
2024-12-24 13:42:15 -05:00
Goober5000 5c737a5bf9 improve campaign file extension handling (#6443)
As discovered by WouterSmits, campaigns with periods in their filenames caused issues with FSO's campaign handling.  Specifically, in The Babylon Project, the EA-Minbari war v1.0.fc2 campaign would not save progress because FSO expected EA-Minbari war v1.fc2 in certain places.  This is because the `_splitpath()` function attempted to remove an extension from a filename that already had it removed.  For most campaigns this did not matter, but WouterSmits found a campaign where it did.

To solve this, there is now a new `util::get_file_part()` function to remove the path without removing the extension.  This replaces `_splitpath()` for campaign files, as well as the similar `clean_filename()` and `GetFilePart()` functions in other places.  All code paths were inspected for any chance of inadvertent extension adding, and Assertions were added to verify future code.  The only potential problem area was `player:loadCampaignSavefile()` which now pre-removes the campaign extension if needed.
2024-12-22 22:31:58 +01:00
Daft Mugi 642ff82833 Add FSO_BUILD_WITH_DISCORD cmake option 2024-12-21 22:50:51 -06:00
Kestrellius 2375ea380e Cleans up weapon light casting. 2024-12-21 19:09:10 -08:00
mjn-mixael 75a8e8ca9c remove duplicates from rebase 2024-12-21 12:51:13 -06:00
Mike Nelson 9781da6bad hardcode the retail details at parse time instead of run time 2024-12-21 12:45:52 -06:00
Mike Nelson 9f41075adf manually merge pr 6426 2024-12-21 12:45:51 -06:00
Mike Nelson 72c2d7b25f Fix rebase error 2024-12-21 12:45:15 -06:00
Mike Nelson bdb2e7cd8c Only change sounds for headz regions 2024-12-21 12:45:15 -06:00
mjn-mixael 734e3e25bd a little additional cleanliness and clarity 2024-12-21 12:45:14 -06:00
mjn-mixael 09d1461b06 Clang clang clang! Clanging on muh brain! 2024-12-21 12:45:14 -06:00
mjn-mixael 463cac74bd Upgrade fishtank to allow for all anim types and allow mainhalls to manually set the fish anim file 2024-12-21 12:45:14 -06:00
mjn-mixael f82f86ca82 Expose fish and headz cheat for custom mainhalls to use 2024-12-21 12:45:14 -06:00
Goober5000 c20ec965c0 fix a few bugs in the Vasudan heads cheat (#6426)
There were several bugs and design issues in the Vasudan headz cheat, probably due to being coded in a hurry right before release:
1. Although the cheat activated on the main hall, it was not immediately apparent, requiring the player to switch screens and come back
2. The detection of whether the main hall is Vasudan did not work after the cheat was activated, due to the background filename changing (this one is actually not Volition's fault)
3. The implementation of the cheat was actually in the wrong section of code, resulting in some confusion

These are now fixed.  The cheat can be enabled or disabled from one function, the graphics are reloaded properly, and the main hall detection includes the cheat-active version of the main hall.  Also, the door sounds have been slightly refactored to use a `std::pair` rather than a vector, since there are exactly two sounds, an open and a close.
2024-12-21 12:43:41 -05:00
Daft Mugi 440eed69d2 Ensure custom preferences path ends with path separator
Example:
  Given: FSO_PREFERENCES_PATH='./config' fs2_open
  Path becomes: './config/'
2024-12-21 02:35:01 -06:00
Kestrellius d81b48bd74 Weapon light bugfix (#6474)
* Fixes weapon light bug.

* Improves elegance.

* Extends fix to missiles.

* further elegance

* more cleanup

* optimization
2024-12-21 02:28:21 +01:00
Mike Nelson 6ca9555218 Upgrade head ani handling (#6338)
* null -> nullptr

* always loop head anis feature

* Add newer head ani choice method

* properly handle death messages
2024-12-20 09:04:32 -05:00
Daft Mugi c7025f47e0 Add FSO_BUILD_WITH_OPENXR cmake option (#6477)
* Windows and Linux default to ON
* macOS defaults to OFF
* User can override default on the command line
2024-12-20 12:06:29 +01:00
Daft Mugi 32a71e6b55 Add '-campaign' cmdline option to set current campaign
This allows the current campaign to be set on FSO launch so that the
player isn't interrupted by the "The currently active campaign cannot
be found" dialog when changing mods.

Example usage:
  fs2_open -campaign freespace -mod fsport
2024-12-19 16:05:11 -06:00
Mike Nelson 7f48375a6d Add underlining as a custom decorator (#6399)
* add underlining and corner border custom decorators

* some cleanup

* CLANG
2024-12-18 17:33:39 +09:00
Goober5000 9b1d4258e9 Merge pull request #6464 from Goober5000/fix_engine_wash
fix engine wash
2024-12-17 14:25:11 -05:00
BMagnu f4bd6aa003 Correctly process ImGUI flags (#6468) 2024-12-17 10:56:29 +01:00
The Force 2a7806d690 Slightly off topic but remove C style casts from selection dialog 2024-12-17 08:32:08 +00:00
Goober5000 91b54c759e Merge pull request #6424 from Goober5000/credits_substitute_music
add $Substitute Music: for credits.tbl
2024-12-16 12:15:49 -05:00
Goober5000 b7c676132a Merge pull request #6446 from Goober5000/docked_warpIn
fix ship:warpIn() behavior for docked ships
2024-12-16 12:12:46 -05:00
Goober5000 1c9066485c STL fixes and cleanup (#6455)
* fix some usages of std::transform

* change parse_string_flag_list to use a reference

* add a variant of parse_string_flag_list that can use a SCP_set, and make a templated version of flag_def_list
2024-12-16 18:12:30 +01:00
Goober5000 2456f02b23 Merge pull request #6463 from Goober5000/subsystem_flag_fix
fix sexp_ship_deal_with_subsystem_flag()
2024-12-16 12:11:56 -05:00
Birk Magnussen 284fb4a305 Even More MSVC warnings 2024-12-16 15:53:07 +01:00
Birk Magnussen a2a1910826 More MSVC warnings + clang tidy 2024-12-16 15:29:40 +01:00
Birk Magnussen 05259a5b6c Make sure that clang does accept implicit random range copy constructors 2024-12-16 15:06:26 +01:00
Birk Magnussen aecc2ab31f Fix macos target 2024-12-16 15:01:17 +01:00
Birk Magnussen 6ab3d5310a Fix template deduction for GCC pre 14 2024-12-16 15:01:01 +01:00
Birk Magnussen 55bb2095bb Clang tends to have weird behaviour for is_convertible apparently 2024-12-16 14:45:37 +01:00
Birk Magnussen d19f36a58d Remove incorrect forward 2024-12-16 14:24:01 +01:00
Birk Magnussen ec0e55d077 De-movify random ranges 2024-12-16 14:22:29 +01:00
Birk Magnussen ec027bde87 Fix compile issues 2024-12-16 13:26:47 +01:00
Birk Magnussen 8323d9ed2f Fix parsing 2024-12-16 13:05:38 +01:00
Birk Magnussen b22716a4d2 remove no longer required delay restriction 2024-12-16 12:55:19 +01:00
Birk Magnussen 783ebba5ac Finish parsing 2024-12-16 11:17:17 +01:00
Goober5000 dfbf4da3fb fix engine wash
An idiosyncrasy of the original implementation of `timestamp_until()` is that "immediate" timestamps that expired would be negative.  Only one remaining spot in the codebase relied on this: engine wash.  When #6258 fixed `timestamp_until()` to return 0 for immediate timestamps, engine wash broke.  Changing the comparison from `<` to `<=` fixes it.  I searched the code and there are no similar uses of `timestamp_until()` or `timestamp_since()`.

In the process of searching, though, I found two uses of `timestamp_since()` that were converted from `timestamp_until()` in PR #4286.  These particular conversions more properly include the 0 rather than exclude it, so I changed these as well.
2024-12-16 02:07:57 -05:00
Goober5000 17706a0a6d fix sexp_ship_deal_with_subsystem_flag()
Due to broken node iteration, the `sexp_ship_deal_with_subsystem_flag()` function incorrectly treated the first sexp node as a subsystem, but previous versions of the function would fail silently and ignore it, and subsequent nodes would work as expected.  With the new `process_ship_subsystems()` function, this error is properly flagged (and the incorrect node is again bypassed).  So, fix the error by fixing the node iteration.

Follow-up to #6221.
2024-12-15 23:52:59 -05:00
Birk Magnussen bcaac067f5 Modern basic particle parsing 2024-12-16 00:40:23 +01:00
Goober5000 e37763f8a6 Merge pull request #6452 from Goober5000/6402_followup
default the connection speed to Fast even if it has been set to None
2024-12-13 22:15:24 -05:00
Goober5000 376be3652e Merge pull request #6459 from Baezon/fix-mtp-init
Fix maneuvering thruster initialization
2024-12-13 22:15:15 -05:00
BMagnu 621d88e9b7 Make length a modular curve output 2024-12-13 16:44:49 +01:00
BMagnu 7390e686cc Allow actual cones 2024-12-13 14:35:38 +01:00
The Force 104847c4bd Apply #6457 and #6458 to Ship sub-editors 2024-12-13 09:19:40 +00:00
Asteroth 326d8e5bdc reorder init 2024-12-12 18:26:48 -05:00
Asteroth 4d278097e3 change reset to a constructor 2024-12-12 18:18:03 -05:00
Goober5000 6b18caa965 Merge pull request #6322 from TheForce172/feature/customWarp
QtFRED: Custom Warp Dialog
2024-12-12 15:59:32 -05:00
Birk Magnussen a2e14b0580 Add parser modules for everything 2024-12-12 19:02:20 +01:00
Birk Magnussen df4c12330e Volume Parsing 2024-12-12 18:38:53 +01:00
Goober5000 58f90c22a8 warn and adapt when adding and removing NaN priorities 2024-12-12 11:35:52 -05:00
Birk Magnussen 40312e7419 Add modular curve sets to volumes 2024-12-12 16:44:34 +01:00
Birk Magnussen 5272604c83 Integrate type_traits
# Conflicts:
#	code/globalincs/type_traits.h
2024-12-11 22:14:46 +01:00
BMagnu 7773b429dc Typo 2024-12-11 16:03:28 +01:00
BMagnu 2aac63e0a9 Allow particle volumes to have access to the source for modular curves 2024-12-11 16:01:07 +01:00
BMagnu 2ed3b62e03 Curvify thruster particles 2024-12-11 15:04:35 +01:00
BMagnu 13e3f577ef Deal with split particle velocity curves 2024-12-11 14:14:03 +01:00
BMagnu c2051578d6 Basic modular curves for particles 2024-12-11 13:55:36 +01:00
BMagnu 6050821343 make modular_curves work with member funcs and smart pointers 2024-12-11 11:00:27 +01:00
Goober5000 09552bb195 bypass the SEXP caching code if running in FRED 2024-12-10 23:28:09 -05:00
Goober5000 02cbfbc347 enhance the add-goal and remove-goal sexps
1. Allow the goal priority to be an evaluated number, not just a literal number.  This allows the goal priority to be obtained from operators or calculations.
2. Since the priority can now be evaluated, it can be NaN.  In that case, default to the max priority.
3. Consolidate `CDR(CDR(...))` to `CDDR()` in the aigoal implementation
4. Clarify that `remove-goal` removes the first goal of a given type and priority, not necessarily the first fully matching goal.
5. Enhance `remove-goal` to remove all goals matching the constraints, not just the first goal.
6. Allow `remove-goal` to disregard priority when checking for matching goals.
2024-12-10 23:28:09 -05:00
Birk Magnussen e955a7f1be Merge branch 'master' into particle_cleanup 2024-12-10 23:41:07 +01:00
KestrelliusandBMagnu 228fd17ff1 Modular curves for weapon attributes during lifetime (#6319)
* Partially builds weapon curves.

* Further curve implementation

* Implementation of more output types.

* Cleanup

* Adjusts warning.

* Appeases clang.

* further appeasement

* Appeasement and time-traveling review changes

* change the enum branch too that'd be good

* More requested changes

* Basic abstraction for generic modular curves

* Make curve list by output statically sized

* Make instance-randomization consistent and mapless

* Add parsing

* Add derived modular curve sets

* Fix incorrect unpack

* Split modular curve set and definition, properly comment struct usage

* Split off specific type-traits into own file

* Fix modular curves for multi-derive case

* Implement some basic weapon curves, as well as the damage multiplier hit curve

* Merges in generified system built by Lafiel.

* Fills out beam curvesets.

* Renames curvesets.

* Removes launch curves for now.

* Testing, bugfixing.

* Various cleanup

* Returns extern do_subobj_hit_stuff

* Fixes compile errors

* Beam flag checking

* Rearranges beam flag checking.

---------

Co-authored-by: BMagnu <[email protected]>
2024-12-10 23:32:46 +01:00
The Force 43c153c127 Address Feedback 2024-12-10 20:49:39 +00:00
Goober5000 a742b6c067 add missing newline 2024-12-10 15:46:50 -05:00
The Force 91221d7dce Fix new C++17 Clang issues 2024-12-10 09:48:05 +00:00
The Force b1e96bd49e Address Review
Spelling Fix, Add explanatory note, Change Dialog title based on Warp In/Out
2024-12-10 09:31:46 +00:00
The Force 3965e1f327 Appease Clang and fix cancelling 2024-12-10 09:31:44 +00:00
The Force 5bbb74151f Add documentation and fix gcc errors 2024-12-10 09:31:42 +00:00
The Force 59f66a9d24 Finish Up 2024-12-10 09:31:40 +00:00
The Force 3bcc6b8c65 Load data 2024-12-10 09:31:29 +00:00
BMagnu 12ad35e10a restore shield_impact_explosion_radius 2024-12-09 13:28:16 +01:00
Goober5000 bcdcba7b8f default the connection speed to Fast even if it has been set to None
A connection speed of "None" is really just the default used by launchers if the user hasn't explicitly set the speed yet.  Additionally, `CONNECTION_SPEED_NONE` isn't really used by the engine except for error checking.  So, fall back to the default connection speed even when the speed has been set to "None".

Follow-up to #6402.
2024-12-08 23:34:58 -05:00
Goober5000 25a04fca53 Merge pull request #6438 from Goober5000/mod_string_tweak
allow the mod title and version to be displayed independently
2024-12-08 23:27:37 -05:00
Goober5000 de5421d241 Merge pull request #6449 from Goober5000/nebula_set_range
add nebula-set-range
2024-12-08 23:25:43 -05:00
Goober5000 d83f6ccdaf add nebula-set-range
Add a simple SEXP operator for changing the range of the current nebula.  Also, slightly reorder the existing nebula operators.
2024-12-02 12:41:26 -05:00
Goober5000 2b84233b91 Merge pull request #6439 from Goober5000/weapon_script_enhancements
add scripting support for weapon class "turret names"
2024-12-02 12:39:51 -05:00
Goober5000 5526f757ed Merge pull request #6221 from Goober5000/turret_ai_enhancements
create a `process_ship_subsystems` routine for subsystem operations
2024-12-02 00:18:18 -05:00
Goober5000 b2204a50a5 Merge pull request #6447 from Kestrellius/beam-cycle-fix
Beam cycle fix
2024-11-29 23:22:52 -05:00
Goober5000 8115589941 address feedback 2024-11-29 23:22:43 -05:00
Goober5000 c33e21f1c2 create a process_ship_subsystems routine for subsystem operations
Many SEXP operators that work on subsystems use very similar code.  This new function allows the operator implementations to be streamlined and makes future modifications easier.  For example, the `change-ai-class` operator now works with names such as `<all turrets>` as well as specific subsystems.
2024-11-29 21:39:29 -05:00
Goober5000 6bdd80bed3 fix ship:warpIn() behavior for docked ships
As described in #6445, the `warpIn()` script function did not work correctly for docked ships because the dock leader flag was not set.  So, set the flag, but make sure to set it only for the first ship for which `warpIn()` is called.  And make sure the flag is removed after the ship finishes arriving.

Also remove an `Int3()` in `shipfx_warpin_start()`.  (This Int3() was not actually in the original Volition source code release.)

Fixes #6445.
2024-11-29 21:32:04 -05:00
Kestrellius 2735404b18 Makes it actually cycle properly 2024-11-29 10:16:21 -08:00
Kestrellius 630f6c29d7 Gives Type 3s higher priority. 2024-11-29 10:03:49 -08:00
Kestrellius 2fe9c94f63 Adds fix for missing Type 3 beam behavior. 2024-11-29 10:02:00 -08:00
Goober5000 d21fb62207 Merge pull request #6387 from Shivansps/custom-preferences-path
Support custom preferences path
2024-11-28 20:18:38 -05:00
Goober5000 fa30b464a2 Merge pull request #6385 from Goober5000/which_personas_to_sync
allow voice acting manager to handle non-wingman personas
2024-11-28 20:15:01 -05:00
Mike Nelson 0a312263cb Allow defining custom overhead line colors (#6341)
* Allow defining custom overhead line colors

* Update asserts
2024-11-27 18:50:47 +09:00
Mike Nelson 06b0966580 Ttf font scaling option (#6330)
* Add option to set a font size multiplier for ttf fonts

* remove the option if we have no scaling fonts

* Clang the conquerer strikes again

* Update XSTRs

* clang

* Clarify comments
2024-11-27 18:50:35 +09:00
Goober5000 5e57e5ec64 Merge pull request #6440 from Goober5000/small_fixes
several small fixes
2024-11-26 22:46:36 -05:00
Goober5000 0332bae95c fix bolt texture checks
Having a missing bolt texture is not fatal; TBP uses it for `b_invisible`.  Modify the bolt checks to display a non-fatal warning if the bolt texture is explicitly specified but not found.
2024-11-26 14:10:26 -05:00
Goober5000 403a067103 fix compile warnings for briefing icon scaling 2024-11-26 14:10:26 -05:00
Goober5000 c254f39247 remove these Verifys since new already throws an exception; use std::move since sorting does not require copying 2024-11-26 14:10:26 -05:00
Goober5000 854b9abc89 fix distinction between lasers and beams
Many beams are lumped into the #Primary Weapons section of weapons.tbl, which will mark them as WP_LASER.  Fix the few instances of code that are intended for beams that may have omitted most beams by mistake.

Randomization of weapon impact particle radius is also affected, but since this affects existing visual effects, it was not changed.
2024-11-26 14:10:26 -05:00
Asteroth c28842739e Allow beams to do energy leeching (#6377)
* allow beams to do esuck

* dont forget to use mult

* consistent comments
2024-11-26 19:13:54 +01:00
Goober5000 df6de0e0b8 enhance help text for script functions that do weapon category checks 2024-11-26 12:51:50 -05:00
Goober5000 d31c33ac29 allow $Distance Unit Multiplier: as a synonym for $Length Unit Multiplier: 2024-11-25 21:12:09 -05:00
Mike Nelson e31100da95 Add hud-set-xstr sexp (#6406) 2024-11-25 17:45:34 -05:00
Goober5000 089c870ad8 add scripting support for weapon class "turret names"
A recent-ish FSO feature, `$Turret Name:`, allows turrets to be displayed differently on the HUD depending on the weapon they carry.  It is useful for scripts to be aware of this, so this PR adds a `TurretName` virtvar for weapon classes, as well as a `NameOnHUD` virtvar for subsystems.  The `NameOnHUD` virtvar shares exactly the same code as the HUD uses, so any future HUD modifications will be reflected in scripting as well.  This required a small amount of refactoring: changing `get_turret_subsys_name()` to return a value rather than stuffing a string, renaming it to `ship_subsys_get_name_on_hud()`, and moving it to ship.cpp.
2024-11-25 16:35:00 -05:00
BMagnu 68f3fa6d8c Actually compile with proper optimizations in a release build. (#6336)
* Change optimization to O3 and enable LTO

* Remove ODR violations

# Conflicts:
#	code/menuui/playermenu.cpp
#	code/osapi/osregistry.cpp

* Fix uninitialized structs

* Remove negative alloc warning

* O3 for mac

* Remove GCC13 warnings

* Fix warning

* Properly fix weapon alloc size

* Try to placate GCC9's Psnet_socket estimation

* remove warnin

* Fix safe fd set check
2024-11-25 20:10:38 +01:00
Goober5000 0bf30db7cd Merge pull request #6315 from Goober5000/fontmanager_improvements
fix memory management in FontManager
2024-11-25 13:30:55 -05:00
Goober5000 1f8227b990 Merge pull request #6435 from Goober5000/update_window
re-add Update_window tracking
2024-11-23 14:37:41 -05:00
Goober5000 84f1b2be9f Merge pull request #6411 from Goober5000/all_the_consts
all the consts!
2024-11-23 14:36:56 -05:00
Goober5000 d3addfcf5b clang overuses the [[nodiscard]] attribute; it should be used conservatively: see C++17 standard at https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf 2024-11-22 23:40:05 -05:00
Goober5000 94e7ac84a5 use initializers and initialize m_specialCharacters; use default constructors and destructors 2024-11-22 23:32:48 -05:00
Goober5000 b3470af307 fix memory management in FontManager
This refactors FontManager to improve it in several ways:
1. Change all the dynamic memory management to use `new`, rather than mixing `new` and `vm_malloc`
2. Change the current font to use an index rather than a pointer
3. Take advantage of more C++11 features to avoid redundant lookups
4. Use case-insensitive name comparison
5. Avoid overflowing the `fnt->filename` field
6. Use `Warning` rather than `Error` in a non-critical error situation
2024-11-22 20:12:17 -05:00
Goober5000 c0ca5ff63d allow the mod title and version to be displayed independently
Tweak the mod string to display one or the other if both are not present.
2024-11-22 19:48:14 -05:00
Goober5000 0373db6b30 Merge pull request #6437 from Goober5000/weapon_bank_followup
improve bank-compatibility check
2024-11-22 14:05:41 -05:00
Goober5000 f89085b5e9 improve bank-compatibility check
1. Don't set the `can_use_for_bank` flag to FALSE if the bank is primary but the weapon is secondary, or vice versa
2. Make sure to only restrict the weapons by bank if the ship has per-bank restrictions

In support of this, add `is_primary()` and `is_secondary()` helper functions to `weapon_info` and use them in logical places.

Follow-up to #6434.  Fixes a few subtle bugs from that PR.
2024-11-22 00:35:10 -05:00
Salvador Cipolla aadd55e501 Check portable_mode flag before get_flags
Because -get_flags prints the value of pref_path, and this changes depending if portable_mode is also set.
2024-11-21 20:13:41 -03:00
Birk Magnussen 50ac2b8105 remove redundant function 2024-11-21 23:43:27 +01:00
Goober5000 54c2bb95b1 Merge pull request #6434 from Goober5000/per_bank_weapon_enabling
enable or disable weapon icons according to bank compatibility
2024-11-21 17:21:51 -05:00
Goober5000 bcf23dbfe6 Merge pull request #6419 from Goober5000/barracks_stats
use proper stats in barracks (take two)
2024-11-21 17:21:27 -05:00
Goober5000 1ac580b9d3 enable or disable weapon icons according to bank compatibility
When clicking on a weapon bank, mark the weapons as enabled or disabled according to their compatibility for that bank.  Do not actually prevent the weapons from being selected and dragged, as they may be dropped on a bank that isn't selected.

Also add a new `TriStateBool` for situations where the value is true, false, or unknown.

Fixes #6398.
2024-11-21 00:33:47 -05:00
Goober5000 1af285e1fe re-add Update_window tracking
FRED has code to keep track of whether the main window should be rerendered on each frame.  It looks like this was accidentally removed at some point.

(Discovered by comparing FRED source files while investigating #5568.)
2024-11-20 19:51:06 -05:00
Goober5000 3e055ec33e Merge pull request #6428 from Goober5000/mfc_ddv_fixes
fix DDV_ validation in FRED, especially DDV_MaxChars
2024-11-20 16:57:44 -05:00
Goober5000 e853dc29c2 Merge pull request #6433 from Goober5000/6364_followup
Cycle expansion followup
2024-11-20 16:42:46 -05:00
Goober5000 a939d5e15a Cycle expansion followup
A few addenda to PR #6364:
1. Use `std::swap` in the move constructor, since the fields are specifically being moved, not assigned
2. Fix off-by-one error when parsing firing patterns, and make the pattern count non-fatal
3. Standardize the setting of fire points since it's done in three different places, and in the case of `ship_set_default_weapons()`, `primary_firepoint_next_to_fire_index` was not reset to 0.  It might be useful to refactor this code into its own function.
4. Make the setting of `primary_firepoint_next_to_fire_index` consistent between forward and reverse cycling
5. Remove a couple redundant `.clear()` calls and fix a typo
2024-11-19 19:49:58 -05:00
Goober5000 e2065f50b5 Merge pull request #6432 from Kestrellius/firing-pattern-increment-fix
Fixes pattern_index oversight.
2024-11-19 19:46:36 -05:00
Kestrellius 51fb24f558 Fixes pattern_index oversight. 2024-11-19 14:22:42 -08:00
Goober5000 4026d30bdc fix DDV_ validation in FRED, especially DDV_MaxChars
Any DDV (Dialog Data Validation) routine must appear immediately after the field it validates in order for the enforcement to work in real-time.  If the DDV_ routine is not linked to the field, it will perform validation after-the-fact by displaying a dialog box and returning an error.  This is an alternate way of handling validation, but in order for the dialog box not to generate an endless loop, it would be necessary to check the return value of every `UpdateData(TRUE)` call in the FRED codebase (or at least the first `UpdateData(TRUE)` in a pair of them) and then, if the return value is `FALSE`, doing an early return from the enclosing function.

Fixes #6427 as well as all similar cases in FRED.
2024-11-18 23:01:21 -05:00
Goober5000 c8210c9bac Merge pull request #6422 from Goober5000/protect_weapon_bank_overflow
protect against weapon bank overflow
2024-11-18 13:24:07 -05:00
Goober5000 8de03d1d27 Merge pull request #6425 from wookieejedi/fix-cycle-weapon-update
Fix CTD from recent cycle expansion
2024-11-18 13:23:51 -05:00
Goober5000 97bf652774 address feedback 2024-11-17 23:07:16 -05:00
Goober5000 e60d44a366 Merge pull request #6371 from z64555/controls/moreaxis
More Axes!
2024-11-17 22:48:13 -05:00
wookieejedi 47fa82ef3f Update localize.cpp with xstr size comment 2024-11-17 14:34:28 -05:00
wookieejedi 217982b92c update xstrs for U and V axes 2024-11-17 14:33:32 -05:00
wookieejedi 24b0020e16 Merge branch 'master' into controls/moreaxis 2024-11-17 14:27:52 -05:00
wookieejedi 5e7af132fc Fix CTD from recent cycle expansion
The recent cycle expansion PR (#6364) causes a CTD when change-ship-type is used. This PR fixes that crash by using `pm->n_guns` instead of 'MAX_SHIP_PRIMARY_BANKS' and clarifies the definition comment for the  `pm->n_guns` to help avoid this kind of quandary in the furture.

Tested and works as expected.
2024-11-17 12:15:45 -05:00
Goober5000 b9964f3be3 Merge pull request #6403 from Goober5000/run_freespace_update
revise Run FreeSpace menu option
2024-11-14 19:54:46 -05:00
Goober5000 2c60b532a0 Merge pull request #6423 from Goober5000/mainhall_ambient
allow ambient sound to be specified on a per-main-hall basis
2024-11-14 19:53:04 -05:00
Goober5000 f612677b3e Merge pull request #6378 from Goober5000/fixed_ai_avoid_weapon_shockwave
fix ai behavior when avoiding ship and weapon shockwaves
2024-11-14 19:47:20 -05:00
Goober5000 b412d93032 add $Substitute Music: for credits.tbl
Similar to Substitute Music in other places, this allows the credits music to be changed if an optional music pack is present.
2024-11-14 19:46:30 -05:00
Goober5000 b72d67c074 default to using Vasudan ambient sound in the Vasudan main hall 2024-11-14 19:30:19 -05:00
Goober5000 0deafdcb5c allow ambient sound to be specified on a per-main-hall basis
Adds a new `+Ambient Sound:` field to mainhall.tbl, allowing any interface sound (or even no interface sound) to be used for the main hall ambient sound.  The default ambient sound, as well as the sound played on the pilot select screen, is interface sound 12.

Implements #6421.
2024-11-14 13:39:39 -05:00
Goober5000 a8245a8fb4 protect against weapon bank overflow
If the mission is edited in a text editor, and a ship is given too many weapon banks, this can cause issues in the weapon firing code.  Protect against this by checking the number of banks when the ship is created.
2024-11-14 12:07:50 -05:00
BMagnu 189803a6a4 Allow modern particles for ship / thruster particles 2024-11-14 14:52:53 +01:00
Goober5000 1bcad06461 remove the avoid-shockwave flag when too far away from a weapon; and add a should-be-dead check 2024-11-14 00:07:26 -05:00
Goober5000 722ed575d2 only refine the expected homing pos if it really does need to be refined 2024-11-14 00:07:18 -05:00
Goober5000 5dfe398af2 add a cache for the expected homing pos 2024-11-14 00:07:06 -05:00
Kestrellius d6b444c9e6 Cycle expansion (#6364)
* Adds different firing patterns for weapons.

* cleanup

* further cleanup

* appeasement

* appeasement^3

* Requested changes.

* Deals with targeting flag issue.

* Resolves merge conflicts.

* blood for the blood god, tidy for the tidy throne

* Increments XSTR again.
2024-11-13 08:05:06 -05:00
Mike Nelson 17e857c819 Define whether or not to render the game strings on the mainhall 2024-11-12 10:59:38 -08:00
Goober5000 124293a92e use proper stats in medals screen
Related to the previous two commits, the medals screen should use the actual all-time stats from the pilot file instead of the active campaign stats.  This required tweaking the DCF "medals" debug command to work with the exported stats.  Also, some C casts were changed to C++ and an obsolete variable was removed.
2024-11-12 01:14:08 -05:00
Goober5000 b407681c5a use proper stats in debriefing
Related to the previous commit, the debriefing should use the actual all-time stats from the pilot file instead of the active campaign stats.  In multi, however, use the active campaign stats; because the debriefing can display stats for different players, and all-time stats are only available for the local player.

Also, clean up and slightly refactor `show_stats_label()` and `show_stats_numbers()`.  Duplicate code has been removed, string output has been streamlined, and a few bugs with percentages (especially divide-by-zero checks) have been fixed.
2024-11-12 01:14:08 -05:00
Goober5000 03bf756d5c fix ai behavior when avoiding ship and weapon shockwaves
The FreeSpace AI includes behavior to run away from shockwaves to try to avoid explosion damage.  This is implemented for both ships and missiles, although the missile implementation has been buggy ever since retail.  There are several issues:

1. The AI attempts to evade a weapon immediately upon launch.  Many missiles have a period of free flight before they start homing on their target.  During the free flight period, the homing position is not set.  Consequently, the AI will not know the position to avoid and will make assumptions.
2. The AI assumes the shockwave-producing weapon will detonate at the center of the ship it is targeting, although missiles detonate on the surface.  A capital ship is likely to be significantly larger than the weapon's blast radius, leading the AI to believe the detonation will be much farther away than it actually is.
3. When avoiding ship shockwaves, the `shockwave_object` field is not cleared when avoiding is complete.  This can result in stale references (though not crashes, due to object type checks), causing AI to not avoid future explosions in certain cases.
4. When avoiding ship shockwaves, the code does not check the correct ship for the amount of damage caused by the shockwave.

All of these issues are now fixed.  Since this is a change in AI behavior, these fixes are tied to a new AI profiles flag.
2024-11-12 00:40:05 -05:00
Goober5000 86afcb3405 use proper stats in barracks (take two)
The barracks should use the actual all-time/multi stats from the pilot file instead of the active campaign stats.  Export the all-time stats from the pilot file in order to populate the barracks.

Follow-up to #6238.
2024-11-11 19:17:04 -05:00
Goober5000 ad3fc5c0b7 Merge pull request #6418 from Goober5000/check_for_hud_drawing
add hud drawing and pre-player-entry checks
2024-11-11 10:56:11 -05:00
Goober5000 ad08452307 Merge pull request #6409 from Goober5000/generic_all_subsystems
enhance sexp handling of generic subsystems
2024-11-11 10:54:16 -05:00
Goober5000 753d1225a9 Merge pull request #6417 from pastalian/fix-odr
Fix ODR violations
2024-11-11 10:53:40 -05:00
Takuya Wakazono c78e252509 Replace NULL with nullptr
Make clang-tidy happy.
2024-11-11 14:17:16 +09:00
Goober5000 e2f8de72e7 add hud drawing and pre-player-entry checks
1. add `hu.isOnHudDrawCalled()` and clarify documentation for `hu.HUDDrawn`
2. add `mn.isPrePlayerEntry()`
2024-11-10 12:58:02 -05:00
Takuya Wakazono 6c623266a2 Fix ODR violations
```
code/menuui/barracks.cpp:188:8: error: type ‘struct barracks_buttons’ violates the C++ One Definition Rule [-Werror=odr]
  188 | struct barracks_buttons {
      |        ^
code/menuui/playermenu.cpp:82:8: note: a different type is defined in another translation unit
   82 | struct barracks_buttons {
      |        ^
code/osapi/osregistry.cpp:478: error: type ‘struct Section’ violates the C++ One Definition Rule [-Werror=odr]
  478 | typedef struct Section
code/pilotfile/FileHandler.h:18: note: a different type is defined in another translation unit
   18 | enum class Section {
```
2024-11-10 16:40:07 +09:00
Goober5000 df4ad18009 Merge pull request #6415 from Goober5000/is_true_for_duration
add is-true-for-duration sexp
2024-11-09 23:39:20 -05:00
Goober5000 57b966cbee add is-true-for-duration sexp
This adds a sexp to allow any boolean condition, or series of conditions, to be evaluated not only instantaneously, but also for a period of time.  For example, this can be used with `is-facing` to check if a ship has been facing another ship for a specified duration.  Previously this had to be done through scripting or through a group of sexps.

Implements #5754.
2024-11-08 13:01:06 -05:00
Goober5000 524ecbe826 handle clang warnings 2024-11-07 23:33:13 -05:00
Goober5000 31a86e3f3d all the consts!
Some experimentation resulted in a lot of const-cascading.  This PR applies `const` to a large number of functions.
2024-11-07 23:33:13 -05:00
Goober5000 9f61a6b7f5 Merge pull request #6414 from Goober5000/skip_mission_tweak
make mission skipping more robust
2024-11-07 23:20:52 -05:00
Goober5000 a0b26bdc0a Merge pull request #6241 from Goober5000/some_collision_optimizations
optimize collision code a bit
2024-11-07 23:20:40 -05:00
Mike Nelson 0e88007571 auto size font for screen resolutions (#6342) 2024-11-07 22:48:08 -05:00
Mike Nelson 53653fd03b Remove model_pointer in favor of using model_number (#6337) 2024-11-07 22:46:41 -05:00
Goober5000 8bbe0a0364 make mission skipping more robust
When a player tries to skip a mission during a campaign, all goals and events are marked true.  Thus it's possible for the campaign condition to unexpectedly *not* evaluate to the next mission (e.g. `if is-previous-goal-false` or `is-previous-event-false` is used without the optional argument).  So add a failsafe check, with a warning, to handle this case.  Also update the documentation to clarify that the optional argument is checked for the mission-skipped case.

Fixes an endless skip-to-the-same-mission loop discovered by ShivanSlayer in Shrouding the Light.
2024-11-05 15:15:16 -05:00
Mike Nelson 1a1bd84290 Grant lua access to countermeasure parameters (#6345)
* grant lua access to countermeasure parameters

* you win this round, Clang

* and Wookie wins the next round
2024-11-05 08:29:02 -05:00
Goober5000 9eba363ddf Merge pull request #6413 from Goober5000/update_github_artifact
sync upload and download artifacts
2024-11-05 01:16:14 -05:00
Goober5000 611fa1ffd8 sync upload and download artifacts
PR #6335 did not update actions/upload-artifact; both upload and download need to use the same major version number.

Also move from v4.1.7 to just v4 because that appears to be the common practice.
2024-11-05 00:51:03 -05:00
Goober5000 89605651ca Merge pull request #6359 from Goober5000/waypoint_pointer_to_index
replace waypoint pointers with waypoint indexes
2024-11-04 13:37:20 -05:00
Goober5000 6cbde28858 Merge pull request #6412 from Goober5000/connection_speed
handle connection speed in a user-friendly way
2024-11-04 13:37:05 -05:00
Goober5000 37a24b2a14 handle connection speed in a user-friendly way
1. Use a sensible default for the connection speed
2. Remove the `Psnet_connection` variable which is now obsolete: "its only purpose now is to change the default object update value for a player if it's set to dialup, and that's easily done in-game already"

The "You must define your connection speed" popup will now no longer appear unless it has been explicitly set to an invalid value.

Applies recommendations from, and fixes, #6402.
2024-11-03 23:09:32 -05:00
Goober5000 1493774f80 Merge pull request #6261 from Goober5000/timestamp_valid_tweak
refine timestamp_valid
2024-11-03 22:31:14 -05:00
Goober5000 b48a55e825 Merge pull request #6410 from Goober5000/hide_variable_index_operators
hide variable -index SEXP operators in FRED
2024-11-03 22:31:04 -05:00
Goober5000 f71f02e0b1 Merge pull request #6376 from Goober5000/malformed_xstr_release_warning
make malformed XSTR a release warning
2024-11-03 17:11:47 -05:00
Birk Magnussen fe815f89ca Set pre-curve lifetime for damage-spew and similar to 1 2024-11-03 21:54:35 +01:00
Birk Magnussen 32835b06fd Small cleanups 2024-11-03 21:00:39 +01:00
Birk Magnussen 1f7909112c Remove particle properties 2024-11-03 20:22:34 +01:00
Goober5000 2507ada110 hide variable -index SEXP operators in FRED
Hide these SEXP operators to reduce confusion for FREDders.  They still work, but using them properly requires a certain amount of knowledge of the inner workings of variables, and the operators can break if new variables are added causing the list to be re-indexed.

Implements half of #6400.
2024-11-03 14:02:35 -05:00
Goober5000 0d543b0ed4 Merge pull request #6335 from scp-fs2open/dependabot/github_actions/dot-github/workflows/actions/download-artifact-4.1.7
Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows
2024-11-03 13:34:52 -05:00
Birk Magnussen 3d171eb858 Remove EffectTiming 2024-11-03 15:00:32 +01:00
Birk Magnussen e2dbb46b9c Fold OmniEffect into ParticleEffect 2024-11-03 14:45:16 +01:00
Goober5000 ed7af6acd1 enhance sexp handling of generic subsystems
1. Since we already handle `<all engines>` and `<all turrets>`, it's simple to extend this to all generic subsystems of any type
2. Add an `<all subsystems>` case for handling every subsystem on a ship
3. Add some compiler directives to enforce preconditions for subsystem type `#define`s
2024-11-03 01:56:02 -04:00
Mike Nelson 99e263343a Optional icon scaling (#6329)
* optional briefing icon scaling

* cleanup

* fix merge conflict issue
2024-11-02 22:04:38 -04:00
Birk Magnussen 1aa67c9342 Properly use new effect host 2024-11-02 14:48:58 +01:00
Birk Magnussen 98ddb1500f Add sensible particle host class 2024-11-01 16:23:11 +01:00
Goober5000 e9be8d2424 Merge pull request #6393 from Goober5000/proper_fighter-bomber_fix
proper fix for fighter/bomber
2024-10-29 19:08:12 -04:00
Goober5000 42de74a62e Merge pull request #6349 from Goober5000/hud_gauge_api_functions
add several useful hud gauge functions
2024-10-29 19:07:45 -04:00
Goober5000 c582f77965 Merge pull request #6405 from Goober5000/getBreedName_for_parse_objects
adds getBreedName() in a few places
2024-10-29 19:07:38 -04:00
Goober5000 e58f8f9a5b Merge pull request #6365 from Baezon/disambiguate-shockwave-damage
Disambiguate `ShockwaveDamage` cases
2024-10-29 19:07:30 -04:00
Goober5000 e3d28b7fb1 adds getBreedName() in a few places
There are a few places in the Lua script API where a variable could be some type of "object" or something that is not an "object" but is still useful - one example is the return value from oswpt:get().  With this function, scripts will be able to tell what the variable is without risking an exception.
2024-10-29 00:20:05 -04:00
Birk Magnussen e28671ff92 Assign the correct flash particle variable 2024-10-28 18:29:03 +01:00
BMagnu 95fef2af39 Fix x86 SIMD Extension Handling (#6384)
* Fix AVX2 detection

* Also query for proper OS support

* Actually properly set ISA level on all platforms

* Expose level of x86-SIMD instructions to the code.

* Fix handling of forced instruction set

* Fix errors

* Fix MSVC

* Properly deal with linux CI builds

* fix clang
2024-10-28 17:58:31 +09:00
Shivansps 2eb2af6f76 Add RISC-V to cmake linux (#6375)
* Add support for RISC-V compile to cmake

* No need to pass -march for gcc in riscv

* -march=native is not supported in Risc-V clang

* fix comment and remove unnecessary newline

* Remove incorrect values while checking CMAKE_SYSTEM_PROCESSOR

* Support 32bit RISCV as well

I dont think this will be ever be needed, but i dont like that compilation will fail due to incorrect compiler flags if you try.
2024-10-28 17:27:39 +09:00
BMagnu 80625fd307 Change Build to C++17 (#3710)
* Set ver to C++17

* remove deprecated shuffle

* Fix std::iterator being deprecated

* Work around codecvt deprecation

* Fix std::result_of deprecation

* Another random_shuffle

* another text conversion replacement
2024-10-28 17:27:14 +09:00
Goober5000 d38f7256a7 Merge pull request #6396 from Shivansps/fix-legacy-config-default-true-windows
Set old_config_exists to false in Windows if the registry key are not present
2024-10-27 23:18:45 -04:00
Goober5000 89e546099a Merge pull request #6332 from Goober5000/movie_hooks
add pre-movie hook
2024-10-27 23:15:55 -04:00
Goober5000 79a9acbb90 Merge pull request #6394 from Goober5000/fix_camera_shudder
fix camera shudder
2024-10-27 23:15:46 -04:00
Goober5000 98522476e5 Merge pull request #6404 from Goober5000/version_24_3
bump version to 24.3
2024-10-27 23:03:29 -04:00
Goober5000 961e06df0b bump version to 24.3 2024-10-27 22:43:26 -04:00
Birk Magnussen bb3e50832d Fix particle end conditions and vector-based orientations for offset 2024-10-27 21:13:51 +01:00
Birk Magnussen c0f5b0ba86 Properly deal with always-particle sources 2024-10-27 20:55:52 +01:00
Goober5000 846608e949 add command-line arguments to Run FreeSpace command
Takes the command-line arguments used to launch FRED and reuses them to launch FSO.

As part of this, slightly refactor the `cmdline_print_cmdline_multi()` function so that it calls a new `cmdline_build_string()` function.
2024-10-25 15:52:52 -04:00
Goober5000 d288dcb3fd revise Run FreeSpace menu option
Fix some memory leaks and make the application name detection slightly more reliable.
2024-10-25 14:55:24 -04:00
Birk Magnussen c513ab5ad3 Fix legacy particle lifetime when built-in bitmap is used 2024-10-25 12:45:57 +02:00
BMagnu bd1792d777 Move Effect timing into the ParticleSource. 2024-10-24 16:54:02 +02:00
Salvador Cipolla 9c67434be2 Use a different variable for the optional 2024-10-23 19:22:30 -03:00
BMagnu c937bc6bbb Actually get rid of particle emitters 2024-10-23 17:04:35 +02:00
BMagnu a79c23be07 Add orientation-based velocity inherit for beampiercingeffects 2024-10-23 15:27:02 +02:00
Birk Magnussen c16dfba843 Fix directional scaling 2024-10-22 22:40:53 +02:00
Birk Magnussen 9b2d069bfd Actually apply rotation to the cone volume 2024-10-22 22:31:01 +02:00
Birk Magnussen 39c6dc788d Fix default ship particle parameters 2024-10-22 21:56:28 +02:00
Birk Magnussen 2bba61a4b8 Account for negative velocities in particle setup for weapons, again 2024-10-22 21:51:47 +02:00
Birk Magnussen 8e1474f018 Account for negative velocities in particle setup for weapons 2024-10-22 21:47:32 +02:00
Tyler Blount 91a2291c03 Merge pull request #6386 from MjnMixael/fix_skip_to_string
Return false if skip to string can't find the string
2024-10-20 10:36:57 -07:00
Salvador Cipolla 7176c73fd0 Unix dosent use a optional type here 2024-10-19 08:25:19 -03:00
Salvador Cipolla ccefc988c2 Use optional type 2024-10-19 07:46:19 -03:00
Salvador Cipolla a48d101c92 Look for specific registry key not found error 2024-10-18 20:08:23 -03:00
Salvador Cipolla 94907eac7f Set old_config_exists to false if the registry key are not present 2024-10-14 20:58:34 -03:00
Goober5000 1570f72df3 fix camera shudder
The enhanced controls and flags in #4552 were intended to allow the camera to shudder in all views, not just the cockpit view.  And indeed, the shudder does apply in all other views... except for cutscene cameras, due to the `VM_FREECAMERA` check in `game_render_frame()`.  So, add a separate check for cutscene cameras when shuddering everywhere.  The cutscene camera can be jittered just like the cockpit camera, but the rotation should not be modified or it will produce feedback.

Follow-up to #4552.  Also removes an unused variable that was made obsolete in #5656.
2024-10-14 00:36:13 -04:00
Goober5000 a9d2605c0e proper fix for fighter/bomber
This fixes the fighter/bomber type which had been broken ever since the objecttypes.tbl upgrade in 246cfcfa65: the fighter/bomber type is again treated as a union of fighters and bombers, not a unique type of its own.  This requires special handling for the `OPF_SHIP_TYPE` SEXP argument type, and all four SEXPs that use `OPF_SHIP_TYPE` have been modified to check for the special case.  The explicit fighter/bomber type has again been removed from the built-in objecttypes.tbl.

The requirements for "fighter/bomber" to be valid are 1) there is no explicit "fighter/bomber" type in the mod; 2) a "fighter" type exists; 3) a "bomber" type exists.  If any of these conditions is not met, the special case behavior is not enabled.

Follow-up to #6390.  Properly fixes #6388.
2024-10-13 21:43:18 -04:00
Goober5000 947b3d4f21 Revert "add the fighter/bomber type back to objecttypes.tbl"
This re-removes the fighter/bomber type by reverting commit 565d91b6dc.
2024-10-13 17:03:50 -04:00
Goober5000 83d12684e4 Merge pull request #6390 from Goober5000/re_add_fighter-bomber
add the fighter/bomber type back to objecttypes.tbl
2024-10-13 17:02:11 -04:00
Goober5000 565d91b6dc add the fighter/bomber type back to objecttypes.tbl
A few missions used the fighter/bomber ship type, so this adds the type back to make those missions work again.

Temporary fix for #6388.  A more proper fix will be applied after the official 24.2 release.
2024-10-12 22:12:22 -04:00
Salvador Cipolla da68c223ae Remove an unintentional new line 2024-10-10 19:39:19 -03:00
Salvador Cipolla 096aa4ed65 Move env pref path detection from os_get_config_path() to getPreferencesPath()
It is a better place for it, it enables the regular path checks and warnings
2024-10-09 20:19:28 -03:00
Goober5000 66bf2aefb0 remove redundant cutscene_mark_viewable()
This is already done in `movie::play()` and shouldn't be done again if a script overrides the function.  The extra calls were added in 251285cacc and cbccf655fa (the former copied from the latter), originally as an unsuccessful attempt to fix Mantis 61.
2024-10-09 14:39:34 -04:00
Goober5000 3d8fbc0e97 add pre-movie hook
Add an `$On Movie About To Play:` hook to match `$On Intro About To Play:`.  Also make the two hooks overridable, since that might be useful.

Additionally, change a few (nonexhaustive) `name` parameters to `filename` to make it clearer that the string is a filename.
2024-10-09 14:39:34 -04:00
Salvador Cipolla e43612c9c4 Read a custom optional path for the preferences path 2024-10-08 22:23:56 -03:00
mjn-mixael a1a5780104 return false if skip to string can't find the string 2024-10-07 16:17:49 -05:00
Goober5000 44ddc5f21c allow voice acting manager to handle non-wingman personas
Augments the voice acting manager to handle non-wingman as well as wingman personas, plus limit operations to a specific persona.  This also modifies the editor to only increment the number of modifications when something *is* modified, not merely when something *could be* modified but is currently the expected value.

Resolves #6379.
2024-10-06 18:22:26 -04:00
wookieejedi 49ee006dd5 Fix overlappig XSTRs (#6381)
The XSTR entry 1779 (strings.tbl) is used for two different texts:

"Disabled" in shadows.cpp;
"Toggle Auto Pilot" in controlsconfigcommon.cpp;

"Disabled" is already assigned to XSTR 413. ATM I have this set to shadow's usage (even though 413 is related to Disabled ships). Alternatively I would be happy to use `"Off", 1693`, which is what the other graphic settings use (though the actual value in the code would still remain `Disabled` of course).
2024-10-06 09:32:07 -04:00
Goober5000 b734d6017f Merge pull request #6382 from Goober5000/cargo_title_initialization
properly initialize cargo titles
2024-10-04 22:20:13 -04:00
Goober5000 349a9927cc properly initialize cargo titles
This adds several missing initializations of cargo titles for both ships and subsystems.  Note that `Subsys_status` initialization needs to happen in `allocate_subsys_status()`, because subsystems can be allocated in red-alert or in the `ship-copy-damage` SEXP, not just parsing.

Follow-up to #6000.  Fixes a rather insidious ERANGE error in Inferno.
2024-10-04 00:56:47 -04:00
Goober5000 6ed64e796d make malformed XSTR a release warning
1. Tweak the API of `error_display` so that an error level of 2 displays a `ReleaseWarning`.
2. Use this error level for the malformed XSTR warnings in the localization code.

Resolves #6374.
2024-10-01 00:36:43 -04:00
z64555 f459d687f3 Revert JOY_NUM_BUTTONS value back to 32 2024-09-29 20:58:10 -05:00
z64555 0f14b61dfb Add lazy constants for hat positions
* Reorder hat position labels to match SDL order (christian cross -> clockwise)
2024-09-29 20:40:18 -05:00
z64555 b3f2f8b257 Use sprintf instead of sprintf_s 2024-09-29 20:33:29 -05:00
z64555 97e1c6de04 Make button labels procedural. Hat position labels still use a LUT.
* Remove unneeded comment on U and V axis. (Comments there are for original axis XSTR indices)
* Fix UI issue where bound button message did not display which controller it belonged to
* Removed unused extern reference of Joy_button_text
2024-09-29 20:02:59 -05:00
Tyler Blount da9ae0dd69 Merge pull request #6368 from Baezon/tmap-25-verts-error
Have TMAP chunks report >25 verts polygon error as well
2024-09-29 13:27:43 -07:00
Tyler Blount 04f5c2ff84 Merge pull request #6363 from Goober5000/voice_manager_modifications
set the modified flag in the Voice Acting Manager
2024-09-29 13:27:26 -07:00
Tyler Blount d723300c86 Merge pull request #6370 from MageKing17/bugfix/ingame-shockwave-options-clarity
Make Shockwaves in-game option force multi-value selection.
2024-09-29 13:26:08 -07:00
wookieejedi c9e9b9849a Fixes Lab Rendering when Zooming (#6373)
Fixes #6372 by more specifically setting the `MR_ATTACHED_MODEL` value and by correctly setting the `MR_NO_INSIGNIA`.

Tested and fixes the issue.
2024-09-29 11:19:16 -04:00
z64555 bbf029b1b2 Oops! Labels!
Update XSTR_SIZE to 1859
2024-09-28 09:09:19 -05:00
z64555 9ffcf94195 Add two axis names and bump button limit to 128. 2024-09-28 08:00:31 -05:00
MageKing17 44b4c04058 Make Shockwaves in-game option force multi-value selection.
This makes it so that the "3D"/"2D" display is actually respected in the in-game options menu, rather than just having an ambiguous checkbox labelled "Shockwaves".
2024-09-26 22:23:52 -07:00
Goober5000 fbee2b8f49 Merge pull request #6367 from Goober5000/remove_bogus_ship_types
remove bogus ship types from objecttypes.tbl
2024-09-26 19:54:22 -04:00
Asteroth 6c1bb9a617 make 25 verts error for tmap too 2024-09-25 19:34:41 -04:00
Goober5000 09d89066ec remove bogus ship types from objecttypes.tbl
The "stealth" and "fighter/bomber" ship class flags are not actual ship types, so they should never have been added to objecttypes.tbl.  Remove them from the built-in table.

Additionally, if a mod *does* use "stealth" in its own objecttypes.tbl, remove it.  This prevents the invalid "stealth" type from overriding a valid existing type, which fixes #6366.
2024-09-25 01:27:39 -04:00
Birk Magnussen 92473780d5 Fix correct random range constructor overlaod 2024-09-24 17:54:16 +02:00
Birk Magnussen b9b7a13586 Fix source bugs 2024-09-24 17:42:19 +02:00
Birk Magnussen 0ec845b4ce Make builtin particle sources actually anonymous 2024-09-24 17:34:43 +02:00
Birk Magnussen 562c39d8b4 fix parse 2024-09-24 17:24:32 +02:00
Birk Magnussen 09d8ffe66d Do legacy parsin 2024-09-24 17:24:31 +02:00
Birk Magnussen db4ec11fd9 Remove redundant effects 2024-09-24 17:24:27 +02:00
Birk Magnussen 53047638bc Replace final legacy effect with omni effect 2024-09-24 17:23:01 +02:00
Birk Magnussen 63a18b28fa Update Ship and Supernova effects to Omni 2024-09-24 17:23:01 +02:00
BMagnu 8503c8a068 Start replacing legacy effects with omnieffect 2024-09-24 17:23:01 +02:00
Birk Magnussen e0c2ba7011 Prepare for the removal of composite effects 2024-09-24 17:23:01 +02:00
BMagnu 989e21622d Allow creating of OmniParticleEffects as needed for the non-part-tbm effects 2024-09-24 17:23:01 +02:00
Birk Magnussen efed4647aa Code volumes 2024-09-24 17:23:00 +02:00
Birk Magnussen e5afc04829 Add OmniEffect 2024-09-24 17:23:00 +02:00
Birk Magnussen 5dfc2108dc Fix bugs from particle_emitter refactor 2024-09-24 17:23:00 +02:00
BMagnu 2f2e8b2e14 Remove particle_effect and ParticleType 2024-09-24 17:23:00 +02:00
BMagnu 97dbd2fa83 Removal of effects, pt. 2 2024-09-24 17:23:00 +02:00
Birk Magnussen 7d10ed44fa Removal of effects, pt. 1 2024-09-24 17:22:59 +02:00
Asteroth 649d458e83 fix spelling 2024-09-23 15:16:35 -04:00
Asteroth 40e334fc94 Disambiguate shockwave cases 2024-09-23 03:16:45 -04:00
Goober5000 03b99a3fd0 Merge pull request #6361 from Goober5000/derp
derp
2024-09-22 22:05:23 -04:00
Goober5000 6f089d74cb set the modified flag in the Voice Acting Manager
When actions in the Voice Acting Manager modify the mission, set the modified flag so that FRED will prompt to save the mission.  And since this requires tracking the number of modifications, enhance the dialog boxes to display this information to the user.

Fixes #6362.
2024-09-22 22:01:21 -04:00
Goober5000 62180212f5 derp
Counting is A-1 SUPAR.
2024-09-21 18:06:35 -04:00
Goober5000 385bf49b39 replace waypoint pointers with waypoint indexes
Several locations in the code (notably `ai_info` and `waypoint_h`) previously stored pointers for waypoints and waypoint lists that need to be valid for more than one frame.  Since both waypoint lists and waypoint paths may change size, resulting in vector reallocation, the information should be stored as indexes instead.

Fixes #6353.
2024-09-21 01:00:24 -04:00
Tyler Blount c6cd2de577 Merge pull request #6357 from Goober5000/swarminfo_corkscrewinfo_functions
use functions for getting swarm info and corkscrew info
2024-09-20 09:32:38 -07:00
Tyler Blount 466995a909 Merge pull request #6355 from MjnMixael/adjust_options_message
Clarify options popup message text
2024-09-20 09:32:11 -07:00
Goober5000 56fc5b457f Merge pull request #6352 from Goober5000/allow_explicitly_empty_sounds
allow explicitly empty sounds
2024-09-17 22:27:56 -04:00
Goober5000 461c62823c Merge pull request #6356 from Goober5000/retail_style_warning_fix
retail-style warning fix
2024-09-17 22:27:48 -04:00
Goober5000 24555ac739 add functions for getting swarm info and corkscrew info
Apparently virtvars can only return one value.  This deprecates the virtvars and adds function equivalents for getting weapon class swarm info and corkscrew info.  Fixes a bug reported by Woolie Wool in Discord.
2024-09-17 14:07:26 -04:00
Goober5000 d67fe30982 retail-style warning fix
The warning for mismatched names-and-indexes implicitly assumed that retail-style sounds would only be added with numeric indexes.  Since adding named sounds in the retail style is, in fact, allowed, update the logic to not warn in that case.

Fixes #6354.
2024-09-16 23:39:58 -04:00
mjn-mixael e35b03dc61 Clarify options popup message text 2024-09-16 09:56:42 -05:00
Goober5000 b596fa305d allow explicitly empty sounds
Make sounds that are specified as "empty" or "none" in sounds.tbl ineligible for treatment as placeholder sounds.  Resolves #6350.
2024-09-13 16:42:13 -04:00
Goober5000 0fd2e9396b add several useful hud gauge functions
1. a `hud-reset-color` SEXP operator, to complement the existing `hud-set-color` and set a gauge back to its configured color
2. `ConfigType` and `ObjectType` Lua virtvars which are essentially the built-in gauges' equivalents of `Name` for custom gauges
3. `getColor` and `setColor` Lua functions
2024-09-11 14:42:07 -04:00
Goober5000 f08d82be23 Merge pull request #6348 from Goober5000/hud_gauge_bugfix
two HUD fixes
2024-09-11 14:03:21 -04:00
Goober5000 dfe34ec58d update documentation 2024-09-11 02:03:40 -04:00
Goober5000 2f3423d70e fix "hudgauge" custom parameter
Since the `OPF_ANY_HUD_GAUGE` type checks for any default or custom HUD gauge in regular SEXP operators, it should do so in scripted SEXP operators as well.
2024-09-11 01:45:44 -04:00
Goober5000 98de7323aa fix crash in hud_get_custom_gauge()
The `Player_ship` variable can sometimes be NULL, especially in FRED, so revise the conditional to check for this.
2024-09-11 01:31:22 -04:00
BMagnu b6879da96d Fix deferred lighting Option (#6346)
* Fix deferred lighting option

* Fix issue

* Fix premature cache

* Appease Clang

* cache specific option not options in general
2024-09-09 21:37:49 +00:00
Goober5000 45d99265b8 Merge pull request #6339 from Goober5000/empty_sounds_fix
further refinement of sound fixes
2024-09-08 21:09:56 -04:00
Goober5000 ee9770d418 properly fill sounds into placeholder slots 2024-09-05 02:36:49 -04:00
Goober5000 9d6c8509ab proactively set placeholder sounds to invalid 2024-09-05 02:36:28 -04:00
dependabot[bot] 728a841ce9 Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-09-03 22:12:52 +00:00
Goober5000 854b0139d2 fix sound initialization (#6333)
Fix a small oversight from #6112.  In the empty/placeholder indexed sound situation, although the sound should not be appended (since it indexed), it should still be treated as a new sound, in order for all the first-parse and first-initialize logic to run properly.  Set the right value and add some comments to illuminate the logic.
2024-08-30 08:42:33 -04:00
Goober5000 c59a967f46 Merge pull request #6331 from Goober5000/save_version_update
update detection of save version
2024-08-28 21:45:56 -04:00
Tyler Blount e6f46cf031 Merge pull request #6328 from MjnMixael/fix_fade_icons
Fix fade icons not matching parent
2024-08-28 18:44:48 -07:00
Tyler Blount 10f6f47819 Merge pull request #6327 from MjnMixael/fix_briefing_icons_4k
Fix Briefing Icons at 4K in SCPUI
2024-08-28 18:44:35 -07:00
Goober5000 328e7d37e0 update detection of save version
Looking at the log of missionsave.cpp, the presence of a ship or subsystem cargo title will necessitate a minimum version of 24.1.
2024-08-28 21:23:19 -04:00
mjn-mixael b4ace94637 remove the whole block 2024-08-28 17:05:50 -05:00
mjn-mixael 68943d2c06 cleanup 2024-08-28 16:58:31 -05:00
mjn-mixael a3e62433f2 you're killing me, clang 2024-08-28 13:09:59 -05:00
mjn-mixael 5475c63309 Fix fade icons not matching the scaling and orientation of their parent icons 2024-08-28 12:55:00 -05:00
mjn-mixael 3a7c532d1a remove unncessary return 2024-08-28 10:13:35 -05:00
Goober5000 39565d36e2 Merge pull request #6325 from Goober5000/probability-curves-followup
follow-up to probability curves
2024-08-28 01:02:29 -04:00
Goober5000 c8aa28b1cc follow-up to probability curves
Fix the inadvertent swapping of the two utility functions for parsing sounds.  While we're at it, streamline a few lines, remove a few C-style casts, and remove an unused function prototype.

Follow-up to #6314.  Fixes a crash encountered by Inferno on 24.2-RC1.
2024-08-27 23:30:25 -04:00
Goober5000 b98b8f2d07 Merge pull request #6324 from Goober5000/fotg_sound_fix
fix deletion of looping sounds
2024-08-27 15:27:52 -04:00
Goober5000 28659bb1f9 fix deletion of looping sounds
Per the comment earlier in this function, both -1 and -2 are expected values for sound indexes.  Update the sound validity check accordingly.  Fixes an assertion in `obj_snd_delete()` encountered by FotG when a sound index was -2.
2024-08-27 15:10:14 -04:00
Mike Nelson d68b18dfc8 Upgraded Asteroid Field SEXPs (#6295)
* upgrade asteroid sexps to match new asteroid field features

* clang is a needy boy

* unify the sexp operators into one since there are minimal changes

* cleanup for readability

* address feedback
2024-08-27 20:36:54 +02:00
Mike Nelson 40bbced2f9 Reset hotkey lines before populating (#6318)
* reset hotkey lines before building

* clang is the most high maintenance partner i've ever had
2024-08-27 20:36:46 +02:00
Goober5000 a84941e6d1 Merge pull request #6323 from Goober5000/6317_followup
follow-up to BWO crash fix
2024-08-27 14:29:27 -04:00
John FernandezandGoober5000 faaa235c84 Fix: Always check for nullptrs and make red-alert respect cur_waves from last mission (#6262)
* keep from crashing

* Also, bash the number of waves if necessary

* Add Debug warning to modders

* address feedback

* formatting

---------

Co-authored-by: Goober5000 <[email protected]>
2024-08-27 14:18:37 -04:00
Goober5000 33f136dd26 follow-up to BWO crash fix
The BWO fix in PR #6317 was not quite the correct fix.  The `sim_room_lines` array contains the maximum number of scrollable lines, not the maximum number of lines on the screen at one time.  This partially reverts commit 20338ff28b and implements a new fix that allows the full `MAX_LINES` but also properly checks the list button limit.  Additionally, this adds the list button limit check to other vulnerable code sections.

Fixes the tech room being limited to a single page of missions after #6317.  Testing confirms that the BWO crash is still fixed with this update.
2024-08-27 14:06:13 -04:00
Asteroth bec860e9d8 Small optimization (#6321)
* small optimization

* put this comment where it was before
2024-08-27 02:30:03 -04:00
Mike Nelson 6280ffe0e1 Accessibility IFF colors (#6300)
* accessibility iff colors

* appease clang the conqueror
2024-08-27 00:36:18 +02:00
Kestrellius 91a673ac58 Generic random distributions, including curve-based (#6314)
* Adds PDF to CDF function.

* Further implementation; not complete

* Implements curve integration.

* Implements binary search.

* Finalizes random-range reorganization

* Extends generic range support to various things.

* Removes infinities.

* Fixes bugs.

* Adds handling of invalid prob curves.

* Adjusts warning.

* Exception handling

* Addresses issues raised during review.

* Cleanup

* Appeases clang

* Further appeasement

* even further appeasement

* appeasement^3

* appeasement^4
2024-08-27 00:27:33 +02:00
Goober5000 a74bfab94b Merge pull request #6278 from Goober5000/timestamp_refinement
some timestamp refinements
2024-08-26 16:09:31 -04:00
Goober5000 12784be019 use new isFinite() in several existing expressions 2024-08-26 15:11:15 -04:00
Mike Nelson 23f7fa7f02 Fix brown asteroid being an immortal member of the asteroids kingdom (#6320) 2024-08-26 14:55:31 -04:00
Goober5000 8da346dee3 Merge pull request #6304 from Goober5000/immobile_flags
implement don't-change-position and don't-change-orientation
2024-08-26 13:47:47 -04:00
Goober5000 ac16a54bec Merge pull request #6312 from Goober5000/fred_lock_from_editing
add option in FRED to lock objects from being edited
2024-08-26 13:47:39 -04:00
Goober5000 ddfd0c6fca update comment 2024-08-26 01:54:23 -04:00
Goober5000 dccb7dc8cf Merge pull request #6317 from Goober5000/fix_bwo_crash
fix the mysterious crash in BWO
2024-08-25 22:36:38 -04:00
Goober5000 20338ff28b fix the mysterious crash in BWO
This is an error that existed all the way back in retail.  Each line in the simulator room (i.e. each mission name in the list) is also a "button" in the sense that clicking on it will highlight the line and set some values.  The maximum number of buttons is `LIST_BUTTONS_MAX`, but the maximum number of `sim_room_lines` was a different #define, `MAX_LINES`.  This was set to 200, a far higher value than the `LIST_BUTTONS_MAX` value of 42.  The code responsibly checked the limit, but the limit was incorrect.

(This had not been seen in previous mods because the number of lines was never high enough to reach 42.  BWO happened to use a font that was small enough to fit that many lines in the mission simulator screen.  This explains why removing fonts.tbl prevented the bug from occurring.)

Thus when the number of lines reached 42, the sim room started writing to out-of-bounds memory.  This didn't cause a crash immediately, but did corrupt the `Static_lights` vector, which in turn caused a crash as soon as a model was lit in-mission or in the ship loadout screen.  It's rather strange that this crash only occurred in optimized SSE2 builds though.

The fix is simply to use `LIST_BUTTONS_MAX` as the limit, rather than `MAX_LINES`.  This also removes the unused `MAX_DESC_LINES` and `Num_desc_lines` at the same time.

Fixes #6313.
2024-08-25 21:56:37 -04:00
Goober5000 c8010e5447 some timestamp refinements
1. Make sure the legacy `timestamp_until()` and `timestamp_since()` functions check for any type of invalid timestamp
2. Add a useful `isFinite()` function
3. A timestamp delta on an immediate timestamp is more properly the actual delta, rather than another immediate timestamp
2024-08-24 17:24:39 -04:00
Goober5000 92b628353f Merge pull request #6286 from Goober5000/sound_indexing_refinement
improve sounds.tbl index ordering
2024-08-24 16:22:23 -04:00
Goober5000 ff69743836 Merge pull request #6311 from Goober5000/fix_waypoint_marking
fix waypoint marking
2024-08-24 10:37:15 -04:00
Goober5000 38f8943ccf Merge pull request #6316 from Kestrellius/const-matrices
Adds const to a couple batching matrices.
2024-08-23 21:18:31 -04:00
Goober5000 df0f3da79c Merge pull request #6306 from Kestrellius/conditional-impacts-warning
Adds warning if cond-impact armor type not found.
2024-08-23 21:01:17 -04:00
Kestrellius f5ccf98b17 Adds const to a couple batching matrices. 2024-08-23 17:59:15 -07:00
Kestrellius e87d311d92 further cleanup 2024-08-22 18:35:11 -07:00
Goober5000 b5acdd607f add option in FRED to lock objects from being edited
Add options to the Edit menu to lock and unlock objects.  Locked objects cannot be selected or dragged.  They can still be edited in the various editors (e.g. Ships, Objects) but not in the main viewing area.

Also add the Selection Lock option to the Edit menu.  It was previously available in the toolbar but this provides another way to access it.
2024-08-22 15:25:30 -04:00
Goober5000 332ccbc2df fix waypoint marking
When the Show Waypoints option is toggled, the marking was not updated as it was for the other options (Show Ships, Show Starts, Show IFFs).  Fix this by calling `correct_marking()`.
2024-08-22 14:23:39 -04:00
EatThePath 32b69eda2a Merge pull request #6307 from naomimyselfandi/fix-weapon-class-swarm-info
Fix WeaponClass.SwarmInfo
2024-08-22 14:13:27 -04:00
Kestrellius a569bd9ab7 Cleanup 2024-08-22 07:01:23 -07:00
Kestrellius ca70a5a242 Adds support for explicit no-armor; cleanup 2024-08-20 12:31:13 -07:00
Mike Nelson 397a1c84ba Grant access to shipclass shield hitpoints value (#6308) 2024-08-20 01:18:07 +02:00
Naomi Coffman ce6a6b447e Fix WeaponClass.SwarmInfo 2024-08-19 14:01:53 -04:00
Kestrellius 5531dfc58d Adds warning if cond-impact armor type not found. 2024-08-19 10:10:00 -07:00
wookieejedi db13168729 Cleanup variable name in weapon_do_area_effect function (#6303)
* Cleanup variable name in `weapon_do_area_effect` function

Per discussion in #6302, this PR renames `other_obj` to `impacted_obj` to minimize confusion

* update other functions with impacted_obj naming

* nullptr

* appease clang's strange rules

* fighting clang continues

* use !empty check instead of > 0

* remove un-needed no lint comment
2024-08-18 20:59:18 +00:00
Goober5000 cc5bb307c0 Merge pull request #6268 from Baezon/remove-some-prints
Remove some overzealous prints
2024-08-17 19:16:14 -04:00
Goober5000 6b0fe5a763 fix template warnings when compiling 2d.cpp (#6305)
Fix several compilation warnings related to templates by properly casting these values.  See also the existing example that uses casts in cmdline.cpp.
2024-08-18 00:59:21 +02:00
Goober5000 704bf95a75 implement don't-change-position and don't-change-orientation
Per #4294, this adds two new flag that, together, are equivalent to the legacy "immobile" flag but individually provide more fine-grained control.  Since the physics for position and orientation have a bit of overlap, the new flag functionality simply reverts whatever position or orientation changes were done by the physics sim.

In the FRED and qtFRED ship flags dialogs, the "immobile" flag (aka "Does Not Move") is replaced by the two new flags, but in FSO the situation is more complicated.  The old and new flags coexist and have overlapping functionality, so the mission designer must be careful to set and unset the appropriate flag (that is, it is possible for both "immobile" and "don't-change-position" to be set at the same time, in which case the ship cannot change position without both flags being unset).  The `set-immobile` and `set-mobile` legacy SEXPs ensure that the new flags are removed so as not to conflict with the legacy flag, but the `alter-ship-flag` and `are-ship-flags-set` SEXPs and the `getFlag` and `setFlag` script functions use exactly what the FREDder/scripter specifies and nothing else.

(I attempted to completely replace "immobile" with the two newer flags, but it proved intractable to do this while maintaining reverse compatibility: retrofitting single-flag functions to apply dual flags for one particular situation made the functions harder to understand as well as introducing many edge cases and opportunities for bugs or "gotchas".)

Implements #4294.
2024-08-17 16:46:48 -04:00
Goober5000 9887a7b638 move secondary_point_reload_pct maintenance to a more sensible location 2024-08-17 16:46:48 -04:00
wookieejedi 908c1c7b32 Fixes CTD with new Friendly Fire Feature (#6302)
* Fixes CTD with new Friendly Fire Feature

On current master I was hitting a CTD when firing a weapon with a shockwave at close range (ie player is within the shockwave zone). The minidump showed `other_obj` was null, so this PR adds some safety checks.

Tested and this fixes the crashes.

* fix obj usage

* one more obj cleanup
2024-08-17 18:30:21 +00:00
BMagnu 619591f680 Fix shuffling of older but active directives (#6299) 2024-08-16 22:01:28 +02:00
EatThePath 16447b7c7b Remove routine exceptions for unset option values (#6296) 2024-08-15 23:38:18 +02:00
Asteroth 05a0220f4a Merge remote-tracking branch 'upstream/master' into remove-some-prints 2024-08-15 17:30:32 -04:00
Asteroth 20bd8b4bf4 switch to nprintf 2024-08-15 17:29:16 -04:00
EatThePath 57c160623a Stop checking the options value for deferred lighting all the time when it requires restart to change. (#6297) 2024-08-15 14:09:25 +02:00
Asteroth 590cfa5f81 Merge pull request #6293 from Baezon/remove-some-int3s-from-hud-code
Remove some int3s from offscreen indicator drawing
2024-08-14 18:10:29 -04:00
Goober5000 8390304a6e Merge pull request #6292 from Goober5000/lua_tostring_nullcheck
safety check for lua_tostring()
2024-08-13 22:39:16 -04:00
Goober5000 f7e934440c parameter deconfliction (#6282)
Prevent compiler warnings caused by the `value` parameter of the external serializers hiding the `value` member of `std::integral_constant`.

Follow-up to #6276.
2024-08-13 23:17:28 +02:00
Kestrellius 6da7830b7b Add offset for tabled particle effects (#6264)
* Adds particle effect offset.

* bugfixing

* Switches to a cleaner approach.

* Futureproofing for particle parenting.

* actually let's just bundle parenting into this one

* working on turrets

* grinding toward turret correctness

* still grinding toward correctness

* Gets turrets working correctly.

* Fixes merge artifact

* appeases clang-tidy

* Updates some comments.

* Updates some comments.

* Tiny bit of cleanup.

* Deduplicates comments.
2024-08-13 23:06:44 +02:00
Kestrellius 67a9f6f5b7 Friendly fire control flags and SEXP (#6265)
* Adds flags.

* Basic structures built; still needs work.

* Fills out SEXP.

* bugfixing

* appeases clang-tidy

* Adds flags.

* Basic structures built; still needs work.

* Fills out SEXP.

* bugfixing

* appeases clang-tidy

* further appeasement

* Makes implementation more consistent.

* Fixes and cleanup as requested.

* Adjusts is_nan handling.
2024-08-13 20:32:02 +02:00
John Fernandez e1be949d0e Merge pull request #6288 from JohnAFernandez/Fix-lead-indicator-behavior
Fix renderLeadCurrentTarget
2024-08-13 13:52:33 -04:00
Asteroth c64a3e5e6a shouldnt lose target either 2024-08-13 13:26:04 -04:00
Asteroth 65d281e3cb remove some int3s 2024-08-13 01:40:31 -04:00
Goober5000 4cbd84d59e safety check for lua_tostring()
The return value of `lua_tostring()` is NULL if (and only if) the string conversion failed.  Many places in the code did not check for this situation, which led to the crash in #6290.

Fixes #6290.
2024-08-12 16:00:24 -04:00
Kestrellius d4cd767679 Beam slash curves (#6269)
* Adds curves for slash completion and rotation.

* Finalization.

* Fixes pointer comparison.

* Updates table parameter to better match behavior.

* Makes requested changes.

* Changes rotation amount to use raw curve.

* Sets curve-1.0 to be equal to full turn rotation.
2024-08-12 19:58:37 +02:00
Goober5000 e9592bc4d7 add scripting support for wing wave min/max delay (#6280)
There was scripting support for wing arrival/departure delays, but not for wave delays.  Now there is.
2024-08-12 19:58:25 +02:00
Goober5000 5bc929d06e add is-species SEXP operator (#6283)
As noted on Discord, there was previously no `is-species` operator.  Now there is.

As a bonus, this also fixes a bug where the pre-existing `is-iff` operator did not work with wings that had not yet arrived.
2024-08-12 19:58:16 +02:00
Goober5000 8dc1ffea94 Merge pull request #6260 from Goober5000/coverity_fixes
some coverity fixes
2024-08-11 17:01:39 -04:00
JohnAFernandez a9fdbac199 Fix one comment's accuracy 2024-08-10 01:29:05 -04:00
JohnAFernandez 01d3e14dc1 Fix renderLeadCurrentTarget
This fixes an edge case in the Average and Multiple modes, where secondary lead indicator rendering was skipped by continue statements when the primary weapons were out of range.   I also added some comments that help people actually understand what this function does as it is very confusing.
2024-08-10 01:09:10 -04:00
Goober5000 61e94636ac Merge pull request #6284 from Goober5000/directive_timing
fix a minor bug with directive marking
2024-08-08 19:01:11 -04:00
Goober5000 d16eb20aea improve sounds.tbl index ordering
Although sound indexing is now done by name, mods which index by number (sc. a number that is treated as a name) expect the indexes to be in numeric order.  When multiple levels of -snd.tbm files add mixed retail-style and new-style sounds, this assumption can be violated due to named sounds being placed into indexes that later files expect to be available.

This PR refines the parsing so that sounds which use a numeric index can pre-empt existing named sounds that have been assigned to that index.  Since named sounds can go anywhere, they are just moved to the end of the list.  This allows the ranges 192-199 and 202-249 to be available for numeric indexes as expected under the old style.  MediaVPs named sounds which were previously parsed into those indexes are bumped to the next available index.

Additionally, this PR doubles the range of numbers that are treated as indexes, to more realistically accommodate additional numbered sounds.  (The number/index distinction is rather arbitrary and is primarily used to avoid creating large sections of unused sounds if a mod were to specify a very large number, e.g. 10001, for a sound name.)

Finally, this changes parse warnings to use `error_display()` so that the warning displays the parsed file and line number.
2024-08-08 19:00:20 -04:00
Goober5000 f2bffd3234 fix a minor bug with directive marking
Fix units are denominated in seconds, while timestamp units are denominated in milliseconds.  This fixes the directive timing check which, after the timestamp upgrade, would time out after 5 and 7 milliseconds instead of 5 and 7 seconds.

Follow-up to #4633.
2024-08-07 02:28:20 -04:00
Kestrellius 35db8e31c9 Adds weapon support, switches parse ordering (#6254) 2024-07-29 22:35:57 +02:00
Kestrellius cb75da4de6 Interpolate particle spawning positions for moving spawner objects (#6249)
* Sets up linear interpolation for object particles.

* Makes interpolation time-based.

* Updates comments to match changes.

* appeases clang-tidy

* Adds interpolation for particle particles.
2024-07-29 22:35:44 +02:00
Goober5000 d057c0b830 Merge pull request #6277 from Goober5000/improve_model_texture_parsing
improve model texture parsing
2024-07-29 16:11:32 -04:00
Goober5000 693a4a346d Merge pull request #6276 from BMagnu/ade_rpc_serialize_cleanup
Slightly clean up RPC API
2024-07-29 16:11:21 -04:00
Goober5000 734efbdb54 variable checks and message enhancements 2024-07-29 16:04:23 -04:00
Goober5000 c6844755d3 address false positives in smart pointers 2024-07-29 16:04:23 -04:00
Goober5000 1ca56897bb some coverity fixes
Check the return value of `eval_wing()`, and tweak the checks for `closeup_pos` in `draw_model_rotating()`.  This addresses a few Coverity defects.
2024-07-29 16:04:16 -04:00
Goober5000 1fae61b873 improve model texture parsing
Model textures that are too long will cause a very unfriendly and hard-to-track down "ERANGE: String" error.  The situation can be greatly improved by checking the string length ahead of time, printing a friendly Warning, and truncating the filename.  This will alert the modder to the source of the problem while also allowing gameplay to continue.
2024-07-29 15:47:22 -04:00
Birk Magnussen 500bf1c2ca Add clang NOLINTs
To explain: Clang's being stupid here, and seemingly does not recognize that the placement new in the deserializers requires a non-const ptr.
2024-07-29 19:59:02 +02:00
John Fernandez 19b415e524 Merge pull request #6275 from JohnAFernandez/Fix-Duplicate-Interface-Sound-Entries-Crash
Fix a sound crash
2024-07-29 08:52:38 -04:00
BMagnu 558f922209 add implicit-only includes 2024-07-29 10:26:59 +02:00
Birk Magnussen 7caef527d4 Slightly clean up RPC API 2024-07-28 11:15:02 +02:00
JohnAFernandez 72b5135df4 Fix an interface sound crash
This would crash because duplicate sounds were not being populated with the original entries.  When snd_set_pos was called, the handle to the Sounds array would not be set, making our code think it was not loaded.
2024-07-28 01:01:10 -04:00
Kestrellius f041b8dace Adds consts to parameters for a couple laser rendering functions. (#6270)
* Adds consts to parameters for a couple functions.

* makes it actually compile
2024-07-25 22:58:24 +02:00
Goober5000 372d2dd18e Merge pull request #6267 from vmedea/2024-07-sdl2
Fix SDL2 pkg-config name
2024-07-25 14:57:10 -04:00
BMagnu 81da8a8499 disable misc-no-recursion (#6266) 2024-07-24 23:33:15 +02:00
Asteroth 6a5cd9fcc5 remove some prints 2024-07-24 13:41:13 -04:00
mara 4ea0757950 Fix SDL2 pkg-config name
The pkg-config name for SDL 2 is lowercase 'sdl2', and it was passed in
upper-case so the proper library was never detected on Linux. Fix the name.
2024-07-24 14:47:02 +00:00
Goober5000 ea00032d7e by request, add an additional comment 2024-07-23 00:01:09 -04:00
Goober5000 44c949f8d5 optimize collision code a bit
This was motivated by the recent Coverity report.  Coverity noticed that a few of the copy assignments could be replaced by move assignments, but on further investigation one copy each in `ship_weapon_check_collision()` and `beam_collide_ship()` can be entirely removed, another either/or copy in each can be replaced with an either/or pointer assignment, and a few copies can be done only when needed.  Another vec3d copy (`hit_dir`) can be replaced with a vec3d pointer; it is no longer modified locally, so there is no longer a need to keep a local copy.
2024-07-22 23:57:20 -04:00
Mike Nelson 79d0c93ba5 Print in game options data to scripting output files (#6257) 2024-07-21 12:25:32 -04:00
Tyler Blount eeba1085c9 Merge pull request #6243 from MjnMixael/per_weapon_convergence
Per weapon auto convergence
2024-07-20 11:57:55 -07:00
Goober5000 ebb5a27922 refine timestamp_valid
Change `timestamp_valid()` to also catch the common case of -1 being used for invalid as well as the "official" 0.
2024-07-20 01:19:23 -04:00
Mike Nelson 70629876b9 allow accepting a pilot without changing gamestate (#6235) 2024-07-18 22:44:59 -04:00
Goober5000 e1458ae8ab Merge pull request #6259 from Goober5000/6258_followup
fix copy-paste error in timestamp_since
2024-07-17 18:35:41 -04:00
Goober5000 bac4eb84c0 fix copy-paste error in timestamp_since
The time since an invalid timestamp should be INT_MIN, not INT_MAX.  Follow up to #6258.
2024-07-17 14:24:40 -04:00
Goober5000 20602b19c2 Merge pull request #6255 from Goober5000/atan2_safe_to_atan2
change atan2_safe to atan2
2024-07-17 13:30:13 -04:00
Goober5000 3c3289a3cc Merge pull request #6258 from Goober5000/fix_6256
fix `NextFireTimestamp`
2024-07-17 13:30:04 -04:00
Goober5000 2166c756ab per review, make the delta check silent 2024-07-16 20:59:30 -04:00
Goober5000 5faed98e3a handle special timestamp values in timestamp_until and timestamp_since 2024-07-16 20:27:14 -04:00
Goober5000 fe3b72b01e fix NextFireTimestamp
Changes `NextFireTimestamp` to work as advertised.  Fixes #6256.
2024-07-16 17:27:41 -04:00
Asteroth 8914ac6e2d guards ignore protected attackers (#6253) 2024-07-16 15:46:12 -04:00
Goober5000 87ea04fa53 change atan2_safe to atan2
According to DahBlount:
> Most atan2 implementations for a long time had problems when the inputs were close to machine epsilon or when x was less than or equal to 0

And according to z64555:
> Modern versions of C++ should have an atan2() that works correctly when the inputs are at 0 or near epsilon of the floating point specification, meaning Volition's workaround shouldn't be needed anymore.

So this removes `atan2_safe` and changes all instances to `atan2`.  Consequently, the angle range in FRED now shows as [-180, 180] as expected.

Fixes #3730.
2024-07-15 20:55:57 -04:00
wookieejedi f5a268bcef Expose Minimum LoS Detection Radius (#6252)
The somewhat modern AI flag for `Require_exact_los` is extremely useful in multiple different situations, for example making large capital ship weapons not fire into friendly surrounding ships on accident. When the feature was added, the `check_los` function was provided with a default value of `10.0` meters for minimum radius detection. This PR exposes that value to modders so they can set it to a reasonable value depending on the ship sizes of their specific needs. And as a note, the los value just uses a simple numerical comparison check, so the los detection could be set to a negative value with no consequence (hence why error messages were not added, though if folks would like I can certainly add them).
2024-07-15 08:30:31 -04:00
Goober5000 1db093e1d6 Merge pull request #6251 from Goober5000/popup_keys_fix
fix incorrect processing of keys during ESC popup
2024-07-14 20:07:18 -04:00
Goober5000 3d556af391 Merge pull request #1451 from Goober5000/pilot_stats_fixes
better stats handling when switching or resetting campaigns
2024-07-14 20:06:51 -04:00
mjn-mixael e1fd863dd0 cleanup whitespace 2024-07-14 10:11:22 -05:00
mjn-mixael 1744718a03 We can remove this bool now that we have bools for each flag set 2024-07-14 10:08:50 -05:00
mjn-mixael d9cfd1f626 Fix boolean checks that determine the which aiming style to use 2024-07-14 09:53:19 -05:00
Mike Nelson d9f9996c2d expose shockwave damage (#6245) 2024-07-13 09:29:48 -04:00
Goober5000 6f05c26542 fix incorrect processing of keys during ESC popup
In retail, the processing of certain keys during a popup, in the `popup_process_keys()` function, was dependent upon the `PF_ALLOW_DEAD_KEYS` flag.  This flag was never used in retail, causing the if() block to be marked as dead code.  In a4e623db23, the dead code warning was addressed by removing the dependency on `PF_ALLOW_DEAD_KEYS`, which is incorrect.  The "dead keys" should only be processed during the "dead popup".  Since the "dead popup" was moved to its own de[a]dicated "popupdead" section, the "dead keys" processing can be entirely removed from the "normal popup".

Fixes a bug noticed by @PremiumColt where certain keys, especially the time compression keys, were processed while the ESC popup was active.
2024-07-12 20:08:57 -04:00
Goober5000 944549ae5f Merge pull request #6246 from notimaginative/update_prebuilt_libs
update to newest prebuilt libs
2024-07-12 17:33:41 -04:00
Goober5000 fbab427943 Merge pull request #6250 from Goober5000/coverity_on_scp
only run the Coverity workflow on the SCP repository
2024-07-12 17:32:54 -04:00
Goober5000 705238a184 only run the Coverity workflow on the SCP repository
This prevents Coverity from running on any forked repository, by default; both because the workflow will fail, and also because the workflow's results would be identical.  (Any forked repository can, of course, change this within its own scope.)
2024-07-12 16:28:25 -04:00
Goober5000 7557c54aa9 restore clearing of stats based on comments from #6238 2024-07-11 21:53:16 -04:00
Goober5000 f341987471 Merge pull request #6248 from Baezon/bugfix-invulnerability-time-again
Bug fix for aspect invulnerability timing... again
2024-07-11 21:19:33 -04:00
Goober5000 cdbf525877 Merge pull request #6233 from JohnAFernandez/Add-Insignia-Renderer
Fix Insignia Checkbox in the Lab
2024-07-11 21:19:01 -04:00
Goober5000 cc790a00bd Merge pull request #6223 from Goober5000/address_6010
address 6010
2024-07-11 21:17:40 -04:00
Asteroth b565376a02 account for original retail handling 2024-07-11 01:50:13 -04:00
wookieejedi 52f417500c Fix Settings Localization IDs (#6242)
In `strings.tbl` the graphics settings localization IDs are as follows:
1160, "Low"
1161, "Medium"
1162, "High"
1163, "Very High"

These values are used throughout the code, but in some cases with SCPUI upgrades, the IDs got off by 1. This PR fixes those incorrect IDs.
2024-07-09 18:07:18 -04:00
Taylor Richards 79d6e91403 additional fixes 2024-07-09 12:23:35 -04:00
naomimyselfandi 5235aac95b Respect tabled delay for arrival and backup messages (#6239)
* Respect the tabled delay for Arrive Enemy messages

* Respect the tabled delay for Backup messages
2024-07-09 07:59:22 -04:00
Taylor Richards bebed48bf8 address errors 2024-07-09 04:39:39 -04:00
Taylor Richards 38e27f8a25 update to newest prebuilt libs
Supports newer SDL2 from the prebuilt package on win32/win64
Adds support for Windows ARM64
Adds option to use prebuilt SDL2/OpenAL/Freetype libs on Linux
2024-07-09 03:17:29 -04:00
BMagnu 98d5de9d13 Make clang const correctness a little less aggressive (#6244) 2024-07-08 19:40:48 +00:00
mjn-mixael 6fdaf87717 du const 2024-07-08 14:32:09 -05:00
mjn-mixael acccc90ded per weapon auto convergence 2024-07-08 14:06:56 -05:00
John Fernandez de570875d0 Merge pull request #6231 from JohnAFernandez/Fix-unreliable-channel-soundid-chacing
Fix unreliable Sounds index retrieval
2024-07-07 20:51:22 -04:00
BMagnu e17f0260f6 Update clang tidy to 16 as used to compile (#6236) 2024-07-06 23:01:32 +00:00
BMagnu 6b6a622c4d Fix clang-tidy (#6234)
* Allow clang-tidy to run

* Amend CI check
2024-07-06 15:16:44 +02:00
Goober5000 e90416e199 Several coverity fixes (#6232)
* coverity - using `std::move` instead of copying, and change some parameters from value to reference

* coverity - fix or mark potential copy-paste mistakes

* coverity - various checking of parameter and return values

* coverity - miscellaneous fixes, and change some 'intentional' markers to 'false positive' markers
2024-07-06 12:51:31 +02:00
JohnAFernandez a319adad76 Use constexpr and value, because we broke defines 2024-07-05 17:26:36 -04:00
John Fernandez 97e36d8af6 Don't forget to remove the declaration 2024-07-05 15:24:11 -04:00
wookieejedi f20c1bddfd Fix short read error with red alert csg file reading (#6229)
In current master, the debug log commonly shows `CSG => Warning: (0x0011) Short read, information may have been lost!`.

Thanks to Taylor for pointing the following issue out:
The function `pilotfile::csg_read_redalert()` returns if `ship_list_size` is zero, but it still needs to check the `wing_list_size` a bit below that. This has likely not caused data loss issues ATM, because it's reasonable to assume that if `ship_list_size` is zero then so is `wing_list_size`. But it's still a bug and should be fixed before it does cause some real data loss.

This PR moves the relevant read sections to within each respective if-block. That way the function is capable of checking both `ship_list_size` and `wing_list_size` on every load (even if `ship_list_size` is zero).
2024-07-05 12:50:56 -04:00
JohnAFernandez c50b425fee More type fixes 2024-07-05 01:14:36 -04:00
JohnAFernandez 7a99e9a7c9 Even more type conversions 2024-07-05 01:11:48 -04:00
John Fernandez 84ccd1375e Fix Flag Negation 2024-07-05 00:57:06 -04:00
John Fernandez a7fc64389f Use the correct method to get index to Sounds
Our sound code is extremely confusing, so it's no wonder that the author of these functions could not find snd_get_sound_id.
2024-07-05 00:44:29 -04:00
John Fernandez ac44f1478e Merge pull request #6226 from JohnAFernandez/Try-Saving-Config-Name-As-Default
Save current preset name and use as default when saving new preset name
2024-07-04 21:42:03 -04:00
John Fernandez ffd78555a0 Enable turning off insignias in the LAB 2024-07-04 19:33:33 -04:00
John Fernandez 1f834aa406 change render flags to uint64_t
32 more flags, yay!
2024-07-04 18:08:27 -04:00
JohnAFernandez 4f2f8c9f25 Save Current Preset name and Use when Saving 2024-07-04 00:35:55 -04:00
Goober5000 200ef1093c Merge pull request #6225 from Baezon/fix-poof-alignment
fix poof alignment
2024-07-03 21:12:45 -04:00
Goober5000 691fe96151 Merge branch 'master' into pilot_stats_fixes 2024-07-03 20:56:56 -04:00
Asteroth 840759d59a fix poof alignment 2024-07-03 19:41:21 -04:00
Goober5000 83d07277f2 Merge pull request #6224 from Goober5000/fix_coverity_task
fix coverity task
2024-07-03 17:12:36 -04:00
Goober5000 cccf76863f fix coverity task
Per @notimaginative, change the `compiler` variable to uppercase to match its usage in the rest of the file.  This should allow the coverity task to start running again.
2024-07-03 16:41:18 -04:00
Goober5000 c03207f141 address 6010
I took a close look at the code involved in parsing particle tables.  There is no smoking gun, but there are several ways to polish the code which I have implemented here.  The most likely culprits for the slowdown, IMO, are the repeated conversions between SCP_string and C-string, especially in `ParticleManager::getEffectByName()`; followed by the omission of `std::move` in several places.
2024-07-03 15:06:33 -04:00
John Fernandez 5df0acf3ef Merge pull request #6185 from MjnMixael/assign_hud_in_ships
Assign hud in ships.tbl
2024-07-03 10:40:54 -04:00
Mike Nelson 75221b0ff5 deprecate some commandlines and make some options not require restart (#6214) 2024-07-02 22:44:44 -04:00
Mike Nelson 6a4774dcc4 Change warning print 2024-07-02 17:06:28 -05:00
Goober5000 eed055d41a Merge pull request #6219 from Goober5000/lock_perspective_and_slew
enhance lock-perspective to also lock slew mode
2024-07-01 16:29:22 -04:00
Goober5000 e374db538c Merge pull request #6220 from Goober5000/enhance_stuff_int_list
enhance stuff_int_list to allow turning off the warning
2024-07-01 16:29:14 -04:00
Goober5000 6468901c0d address feedback 2024-07-01 16:01:31 -04:00
Kestrellius d14b66456f Adds conditional impact functionality. (#6218)
* Adds conditional impact functionality.

* Changes as requested.

* Second batch of changes.

* Switches out insert_or_assign so the checks pass.
2024-07-01 21:45:48 +02:00
naomimyselfandi 723209ce29 Clarify some SEXP operator documentation (#6216)
* Clarify some SEXP operator documentation

* Reword SEXP operator descriptions per feedback
2024-07-01 21:45:41 +02:00
Goober5000 98da98c53b enhance stuff_int_list to allow turning off the warning
This will be useful for situations where a missing lookup entry is not valid but nevertheless does not merit a warning.
2024-06-30 22:37:20 -04:00
Goober5000 558a8333e4 add an option to not change the view mode 2024-06-30 21:42:51 -04:00
Goober5000 ffcbfeb70b enhance lock-perspective to also lock slew mode
Adds an optional argument to the `lock-perspective` sexp to allow locking of the 'free look' or 'padlock' view.  This prevents the player from looking around which might not be desired in certain forced perspective situations.
2024-06-30 21:41:17 -04:00
Goober5000 c5de5149a9 Merge pull request #6217 from Goober5000/debris_type_parsing
another follow-up to #6021
2024-06-30 17:08:53 -04:00
Mike Nelson e868d94927 cleanup message_kill_all (#6213) 2024-06-29 11:03:15 -04:00
naomimyselfandi 253d97a3df Allow defining custom message types (#6142)
* Vectorize Builtin_messages

* Allow defining custom message types

* Add OPF_MESSAGE_TYPE

* Add send-builtin-message SEXP operator
2024-06-29 12:32:17 +02:00
Goober5000 da93cc6047 another follow-up to #6021
When loading a legacy mission that contains a debris field, FSO will try to index into an empty vector, causing an out-of-bounds exception.  This can be seen by loading Derelict mission dl1-08, "The Horror in the Deep".

The `// Obsolete and only for backwards compatibility` code added in #6021 properly handles asteroid fields, but not debris fields; so the fix is simply to apply the logic to debris fields as well.
2024-06-28 21:35:12 -04:00
BMagnu b57278ab18 Adds Voluemtrics Toggle SEXP (#6215)
* Allow toggle of volumetrics

* enhance description

* Typo
2024-06-28 17:56:22 +02:00
Goober5000 630f479fd9 properly handle game sounds with numeric IDs (#6212)
Patches the gamesnd system in several ways to properly fix the bug identified in #6196.  Due to the way the new sound system was written, sounds with numeric IDs were not necessarily added in their indexed location, even though the code assumed (even prior to #6112) that this would be the case.  The code now uses the proper index for both old *and* new style sounds.  This is done by ensuring, in `gamesnd_parse_entry()`, that the vector contains an entry for the specified numeric ID before doing a search for that ID.

Due to the slightly modified population of the gamesnd vectors, the `Snds_iface_handle` vector is now populated after parsing the various sounds.tbl files rather than during parsing.

Separately, this makes consistent the handling of the `sound_entries` vector which could potentially be empty but also treated an empty state as an assertion failure.
2024-06-27 23:55:42 -04:00
John Fernandez e7a7c830f0 Merge pull request #6184 from MjnMixael/ship_wep_custom_strings
Custom Strings for ships and weapons
2024-06-27 10:21:01 -04:00
Mike Nelson d6e7d56081 expose method to kill all current voice messages (#6207) 2024-06-27 08:07:35 -04:00
Mike Nelson 5c5bcf72e9 don't kill paused messages either (#6206) 2024-06-27 08:07:19 -04:00
wookieejedi 06f909d7e3 Followup to #6187 (#6211)
#6187 fixed transparency for cockpits, but the positioning for deferred lighting alas fell through the cracks. This PR fixes that and allows deferred lighting in cockpits to once again work as intended.

Tested and fix works as expected.
2024-06-26 14:08:38 +00:00
Mike Nelson 46d4a1f219 fix screenshudder option being optimized out by the compiler (#6204) 2024-06-26 16:51:41 +09:00
BMagnu 7e71d4c194 Add ugly hack to prevent SCPUI flicker on Win11 (#6199) 2024-06-26 16:50:38 +09:00
Goober5000 2314294a8c Merge pull request #6209 from Goober5000/parse_names_clear
clear Parse_names on mission init
2024-06-25 19:50:54 -04:00
Goober5000 3bce3fd631 clear Parse_names on mission init
When a new mission is loaded, clear the parse names vector, in lieu of the old `Num_parse_names = 0;` line.  This fixes a bug where FRED will complain about nonexistent ships when loading a different mission.  Follow-up to #5937.
2024-06-25 17:33:39 -04:00
wookieejedi 31452e397b One more follow-up to #6021 (#6202)
* One more follow-up to #6021

Update assertion message and mission saving check since older builds are not going to be able to read fields created with newer builds

* update to use empty
2024-06-24 02:59:31 +00:00
wookieejedi 80e3030a0c Follow-up to asteroids update #6021 (#6201)
The Unlimited Asteroid/Debris Field Types & Subtypes PR (#6021) updated to using vectors to allow for unlimited asteroid and debris types. That update removed the count field, `num_used_field _debris_types`, which counted both asteroids and debris pieces (even though the name only has debris in it). The counter variable was removed in favor of `.size()` but now both asteroid and debris field sizes needed to be checked, so this PR updates the code to account for that. Allows asteroid fields to properly pass the count check and properly again spawn in mission.

Tested on asteroid fields passive and active along with debris fields (both created from sexps and the asteroid mission editor) and everything now works as expected. Also tested on missions with no fields and those also still work as expected.
2024-06-23 10:53:39 -04:00
John Fernandez 4a739c988f Merge pull request #6198 from MjnMixael/fix_ingame_options_init
Fix ingame options init bugs
2024-06-21 19:40:45 -04:00
mjn-mixael 7b4deb6c6b Fix ingame options init bugs 2024-06-21 14:16:43 -05:00
BMagnu 3d285f2f42 Fix transparent cockpit by ensuring ordering (#6187) 2024-06-21 17:38:47 +02:00
BMagnu 7403f4a1c9 Improve Volumetrics Performance (#6159)
* properly trace volumetrics and explicitly set texture setting

* UDF-ify volumetrics

* Fix warning

* only apply lower bound when actually correct
2024-06-21 17:10:14 +02:00
John Fernandez 9f99a9eae4 Merge pull request #4489 from JohnAFernandez/Ensure-break
Simplify logic here
2024-06-20 01:30:56 -04:00
John Fernandez d11003a869 Simply logic here
Break when you've found a match, instead of just mindlessly comparing the rest.

This is technically just an optimization and safety change, but potentially, before, if the loops had been switched, it would have caused unexpected behavior if two copies of the same flag were listed.
2024-06-20 01:11:19 -04:00
Taylor Richards 1b855044c7 fix data length bug in PXO hole punch packet (#6195)
The header length from the tracker is 1 byte larger than the size calculated
by the client due to psnet removing that byte internally. The header length
is adjusted to compensate for this, but only *after* the deserialization
process, so we have to use the received packet size instead.
2024-06-18 20:39:43 +00:00
John Fernandez a390b5a01a Generalize linear interpolation (#5003)
* Remove old interpolate angles quick

* Remove old interpolate functions

These are no longer used.

* Add linear interpolate vm function

More clearing functions

* Add physics snapshot struct to silo interpolation

Two of these two functions require an object pointer, so they cannot be in physics_state.cpp

With doxygen documentation

* Try to placate Linux

* Address Feedback

* And update declaration, of course

* Attempt to appease linter
2024-06-18 20:10:01 +02:00
John Fernandez 8c913c8cc5 Merge pull request #6192 from notimaginative/pxo_hole_punch
add support for PXO's UDP hole punch feature
2024-06-18 12:04:01 -04:00
Goober5000 ebeec69a6d add API for glow point banks (#6107)
* add API for glow point banks

Previously, a model API existed for glow points mounted on thrusters, but not glow points mounted on glow point banks.  This adds glow point bank support.  Also, this refactors and cleans up the implementation of the model API a bit.

* NULL -> nullptr
2024-06-17 21:28:40 +02:00
Taylor Richards 1821df58cf limit debug log spam from file shadows (#6027)
Always log the possible shadow if:
 1) it's a critical file
 2) it's in the same root

Otherwise log it behind a debug filter ("CFileSystem").
2024-06-16 11:04:01 -04:00
Taylor Richards 3f9ec121ae add support for PXO's UDP hole punch feature
Should allow for most games, even those behind CG-NAT, to work without having
to set up port forwarding. This set of changes is only needed for game servers
to work with the new feature. No special handling is required for clients, so
any build from the last few years should work for them.
2024-06-16 01:58:47 -04:00
Goober5000 408f116d95 Merge pull request #6190 from Goober5000/tactical_goals_allowed
make sure 'tactical' variants of disable and disarm are allowed
2024-06-14 21:51:20 -04:00
Goober5000 ce34f77780 add the attack-ship-class goal as valid for player orders 2024-06-14 00:08:47 -04:00
Goober5000 1bb34cc0ae make sure 'tactical' variants of disable and disarm are allowed
The new `ai-disable-ship-tactical` and `ai-disarm-ship-tactical` goals were inadvertently omitted from the ship type default table, causing these goals to not be available in the Event Editor drop-down menu or Ship Editor initial orders.  Testing did not catch this because testing was done using the HUD squad message system which assigned the new goal (if the flag is enabled) without explicitly checking the validity.

Follow-up to #5512.  Fixes #6189.
2024-06-13 23:52:43 -04:00
Goober5000 f733414403 make mission log dynamic (#6111)
* make mission log dynamic

Change the mission log from a static array to a dynamic vector.  This removes any chance of the mission log running into a limit (as regularly happened with the last mission of Shepherds before the limit bump) and also prevents strange mission bugs caused by culling obsolete entries.

This also unifies the API a bit by renaming the public `message_log_` function prefixes to `mission_log_`, removing the redundant `Num_log_lines` variable, and removing `Log_scrollback_vec` from the header.

Implements #5878.

* feedback

* refactor to reference rather than pointer
2024-06-13 00:17:47 +02:00
Goober5000 9a26d1fba5 Merge pull request #6112 from Goober5000/fix_primary_ammo_rearm
fix ballistic primary banks exploding
2024-06-12 02:29:23 -04:00
John Fernandez c7334de3bd Merge pull request #6188 from MjnMixael/fix_warning_every_frame
Prevent printing a warning every frame
2024-06-11 18:43:04 -04:00
mjn-mixael e1f0042e99 prevent printing a warning every frame 2024-06-11 09:51:28 -05:00
BMagnu 559a2616f3 Fix edge case in MSAA shader (#6186) 2024-06-11 13:41:19 +02:00
Mike Nelson 7f20b9cf64 Unlimited Asteroid/Debris Field Types & Subtypes (#6021)
* base working version of unlimited debris types

* Proper FRED support

* make qtFRED handle asteroids properly

* fix qtFRED assertion

* further clean out MAX_RETAIL_DEBRIS_TYPES

* These should be sizes not POFs

* Move this to it's own method

* convert asteroid subtypes to a vector

* unlimit asteroid subtypes

* fix some global shadowing

* signed/unsigned mismatch

* Address feedback
2024-06-10 22:06:10 +02:00
John Fernandez e1b44892e5 Merge pull request #6170 from TheForce172/feature/ShipPathsDialog
Arrival/Departure Paths Dialog
2024-06-10 15:47:02 -04:00
mjn-mixael 866f907e27 comment clarity 2024-06-10 13:00:30 -05:00
mjn-mixael a1aac15e5a Make $Name style gauge config its own thing 2024-06-10 12:54:39 -05:00
mjn-mixael 49e2d60551 Allow setting gauges in ships.tbl per ship 2024-06-10 12:08:55 -05:00
mjn-mixael 67ebeb438e custom strings for ships and weapons 2024-06-10 09:43:20 -05:00
Goober5000 0f4c3ce8c7 Merge pull request #6181 from Kestrellius/beam-multishot
Make the $Shots parameter work for beams.
2024-06-10 00:33:40 -04:00
wookieejedi 786a4eff42 Follow-up to Unified Scanning (#6183)
Fixes a bug with new unified scanning PR (#6000) and adds a bit of cleanup, including consistent brackets, whitespace cleanup, and removing vestigial function from the original PR.

Tested and works as expected.
2024-06-09 22:26:23 +02:00
BMagnu d87e997d79 Increase Lua safety (#6179)
* disable popen

* Check file type when opening with io lib

* Compile on Windows

* Windows include

* Properly conserve function environment

* Correctly copy fenv
2024-06-09 17:43:54 +02:00
Mike Nelson aee0123587 Allow player-specific options even when using In-Game Options (#6045)
* Move these functions into OptionsManager for more global use

* Make sure player options are preferred even when using OptionsManager

* persist the newly loaded options to disk

* Actually let's persist these only if the load is successful and also handle the multi option

* Comment this out for now I guess
2024-06-09 12:29:15 +02:00
Kestrellius be454f74b0 Merge branch 'master' into beam-multishot 2024-06-09 01:33:44 -07:00
Goober5000 c1985656d1 Merge pull request #6105 from Goober5000/object_h_index
replace pointers with indexes in object_h
2024-06-09 02:24:46 -04:00
Goober5000 d5e387479e replace pointers with indexes in object_h
This refactors the object_h struct to store objects as indexes rather than pointers.  This is a prerequisite for making the collection of objects dynamic in the future.  See also #6100.

Follow-up to #5800 and #5829.
2024-06-09 02:06:22 -04:00
Mike Nelson 574c39210f Ingame options respect mods (#5917)
* Save/Load player options to a mod-specific ini file if possible

* use rfind instead of find to ensure it's the last dash character used for trimming

* cleanup + comments + nullptr

* A more robust way of getting the mod root using lambdas

* prevent infinite loop for non Knossos/Knet mods

* Notify the player if options may need updating and pull settings from fs2_open.ini if we can

* proper localization

* update xstr
2024-06-09 00:26:51 +02:00
Mike Nelson 4432341694 Scanning is chaos, let's make it sane (#6000)
* Unify scanning behavior

* Allow modifying the cargo title

* update localization

* update documentation

* update localization

* address feedback

* fix conflict merge resolution error

* fix oversights, missed subsys title # feature, additional xstrs

* don't need sprintf here
2024-06-08 22:20:22 +02:00
Mike Nelson 8b43b5d325 split up debris and asteroid type handling within the asteroid field struct (#6011) 2024-06-08 21:16:06 +02:00
Asteroth 836840154c Merge pull request #6180 from Goober5000/utility_find
utility functions for counting and searching
2024-06-08 13:43:10 -04:00
Asteroth 41bdcfe720 Merge pull request #6182 from Baezon/beam-fixes
Assorted beam fixes
2024-06-08 13:42:42 -04:00
Goober5000 4cdc0b9c0b change Asserts 2024-06-06 00:39:14 -04:00
John Fernandez c4a7a9dd15 Merge pull request #6157 from Kestrellius/fix-beam-particle-vel
Fix beam particle velocity
2024-06-05 12:51:44 -04:00
Kestrellius f4921b6d01 Makes minor structural changes as requested. 2024-06-05 09:39:10 -07:00
The Force 900199d97f Add confirmation on cancel 2024-06-04 22:57:10 +01:00
Asteroth 230fdf4d03 assorted beam fixes 2024-06-04 17:32:30 -04:00
Kestrellius 0da93ec5fd Adds multishot for beams. 2024-06-04 13:10:54 -07:00
Goober5000 4ed38896d2 Merge pull request #6177 from Goober5000/fix_warnings
fix compilation warnings
2024-06-04 12:05:33 -04:00
Goober5000 3529e49466 utility functions for counting and searching
Inspired by #6178, this moves the existing `count_items_with_name()` functions into utility.h and adds additional functions for finding specific items with a given `.name` or, more generally, a given field.  The `Damage_types` search has been converted to illustrate how these functions can be used.
2024-06-03 23:09:32 -04:00
Goober5000 64c17f4830 fix compilation warnings
Fixes the few remaining compilation warnings in the current codebase.  Also adds comments to the various casting macros for clarity.
2024-06-03 22:19:29 -04:00
wookieejedi b831c773dd Expose Impact Damage Type to Scripting (#6178)
* Expose Impact Damage Type to Scripting

There's already a sexp that does this, but having the script version for ships is quite useful, too. For example, scripters can set impact damage types for just the player at various difficulties.

Tested and works as expected.

* always set damage type
2024-06-03 21:59:35 -04:00
Goober5000 350130ce9d Merge pull request #6100 from Goober5000/model_and_submodel_indexes
convert model_h and submodel_h to use indexes
2024-06-01 21:20:07 -04:00
wookieejedi 1fa0f43c6f Exposes the New Flight Cursor Mode to Scripting and Fixed Aiming Setting (#6173)
* Exposes the New Flight Cursor Mode to Scripting

Thanks to #6136, FSO supports switching between two methods of flying. This PR exposes those settings and values to scripters. Tested and works as expected.

* fix aiming setting

* add reset position function

* cleanup setting pitch and heading

* one more cleanup

* update to enum support

* remove older version

* one more fix for setting flight mode
2024-06-01 02:47:03 +00:00
Goober5000 b5351c7ca8 Merge pull request #6120 from Goober5000/fred_autorecover
Fred autorecover
2024-05-31 21:46:56 -04:00
Goober5000 e4b5d5fb7e Merge pull request #6149 from Kestrellius/fix-headon-discrepancies
Make headon transition behavior consistent between laser and glow bitmaps
2024-05-31 21:46:45 -04:00
Asteroth b1d4e0a5e2 better option ordering comparison (#6133) 2024-05-31 15:05:33 +02:00
BMagnu 6a83875d93 Fix effect framebuffer blit (#6175) 2024-05-31 14:53:50 +02:00
BMagnu 01bb406b3d Allow overriding low-level keypresses (#6174)
* Clean unneeded properties

* properly queue-ify keys

* Refactor key checking to use functions instead of globals

* Update hooks and cache checked-against key

* Documentation and Naming

* match tilde

* only remove control not debug
2024-05-31 14:53:39 +02:00
Goober5000 14aa38eea9 Merge pull request #6172 from Kestrellius/fix-type-5-beam-rand
Sets type 5 end point rand to use correct values.
2024-05-29 11:48:02 -04:00
Goober5000 e991872c22 Merge pull request #6171 from Baezon/uniform-rand-vector-script
Use uniform random vector for createRandomVector
2024-05-29 11:47:39 -04:00
Kestrellius e9a91f9c1f Sets type 5 end point rand to use correct values. 2024-05-28 17:46:32 -07:00
Kestrellius e710b651de Inlines headon glow render; converts some casts. 2024-05-28 10:58:59 -07:00
Asteroth f0f7eb513f fix 2024-05-27 13:28:13 -04:00
Asteroth 3164261152 update to better random vector 2024-05-27 13:27:46 -04:00
The Force 120b76b21e GCC 2024-05-27 09:30:25 +01:00
Kestrellius c6efd0a0a3 Makes random life factor of children configurable. (#6166)
* Makes random life factor of children configurable.

* Renames parameter and associated variables.
2024-05-26 20:42:53 +02:00
John Fernandez 914f895cac Merge pull request #6162 from TheForce172/MoveShipFileQT
Move Ship Editor Files And Coverity Clean-up
2024-05-26 13:46:00 -04:00
John Fernandez b3a51d776f Merge pull request #6136 from Baezon/aim-cursor
Add 'Flight Cursor' flying style option
2024-05-26 13:23:43 -04:00
Asteroth dbac7d1259 make the options beginner instead of advanced 2024-05-26 13:05:52 -04:00
The Force 42355b2384 Add Paths Editor 2024-05-26 10:48:20 +01:00
The Force 16a0268bd7 Missed a bit 2024-05-26 06:10:05 +01:00
Asteroth 73bbc94e5e (int) -> fl2i 2024-05-24 23:19:44 -04:00
Goober5000 a0d1ad163d Merge pull request #6165 from Baezon/fix-decloaking
Fix for 'decloaking' effect
2024-05-22 21:53:28 -04:00
Asteroth 3b0d4558ca fix for decloaking 2024-05-22 19:35:01 -04:00
The Force ad8d9484c8 Hopfully Last ones 2024-05-22 20:07:20 +01:00
The Force e93a60c68a Missed a reference 2024-05-22 20:02:39 +01:00
The Force d2af199f14 Address GCC Issues 2024-05-22 19:59:22 +01:00
John Fernandez b122c7a10c Merge pull request #6160 from scp-fs2open/dependabot/pip/ci/post/requests-2.32.0
Bump requests from 2.31.0 to 2.32.0 in /ci/post
2024-05-22 14:11:20 -04:00
BMagnu 8b3e36b3c9 Allow replacement of skybox textures (#6161)
* Add skybox texture replace sexp

* Expose Skybox and Skybox instance to scripting

* first batch of comments

* change sexp name

* remove code repetition

* rebake skybox if required
2024-05-22 16:26:18 +09:00
JohnAFernandez 23254c993e Allow the loadout dialog to open varaible dialog 2024-05-22 01:09:14 -04:00
BMagnu 87704fc817 Refactor replacement texture to a modelinstance parameter (#6154)
* Move replacement textures from ship to modelinstance

* Actually set pmi

* Fix texture replace in fred as well

* Fix bad indent

* incorporate feedback
2024-05-21 17:18:32 +02:00
dependabot[bot] 0f67b85ac0 ---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-05-21 05:43:09 +00:00
The Force 8e082e7293 Change to size_ts and C++ style casts 2024-05-20 16:46:40 +01:00
The Force aa3192aa94 Remove Code that snuck in from another branch 2024-05-20 16:45:51 +01:00
The Force 6419adfbe4 Move Ship Files To there own folder for legibility 2024-05-20 16:45:40 +01:00
JohnAFernandez 29fa8c4f9e Final Fixes
Implements container contents reading, as well
2024-05-18 23:26:21 -04:00
Goober5000 27caca5d2f handle modification of placeholder sounds 2024-05-18 17:34:09 -04:00
Goober5000 e3bdc106f3 fix ballistic primary banks exploding
When game sounds were changed to allow named entries, it became possible for named entries to unexpectedly replace numbered entries.  This was noticed most obviously in the ballistic rearm sound effect, which started using explosions rather than the standard rearm sound effects.  This occurred because MV_Tiny and MV_Small were added into indexes 200 and 201.

To restore the original behavior, the code now prevents sound effects added via TBM from being placed into reserved indexes.  The reserved indexes are instead assigned placeholders, which can subsequently be updated or left alone as the modder prefers.

This also makes the code a bit more robust including patching some sound validity checks in `gamesnd_game_sound_try_load` and `snd_load`.
2024-05-18 17:34:09 -04:00
JohnAFernandez ab7aa63569 Whoops 2024-05-18 16:31:09 -04:00
JohnAFernandez 77062e2571 Make sure check eternal boxes are properly enabled 2024-05-18 16:17:32 -04:00
Goober5000 c1af4317d4 Merge pull request #6156 from Baezon/rand-vec-adjustment
Better rand vec for createRandomorientation
2024-05-18 15:58:59 -04:00
JohnAFernandez 7229fdc423 Fix variable read and write 2024-05-18 15:58:19 -04:00
Kestrellius 3f5a154e7a Updates beam-source particle velocity each frame. 2024-05-17 19:58:57 -07:00
Asteroth 8bd8e785b1 adjustments to rand vecs for random orientation 2024-05-17 21:09:36 -04:00
John Fernandez d8c7a63af7 This should actually fix it. 2024-05-17 18:04:08 -04:00
JohnAFernandez 2cf24cb27b Trying to fix this mystifying error 2024-05-17 17:58:48 -04:00
JohnAFernandez 768f88b135 Linter Fixes 2024-05-17 17:44:38 -04:00
John Fernandez d1829a9f10 Fix Eternal flags being set with no persistence 2024-05-17 17:29:40 -04:00
John Fernandez 860e28fbdb Finish applying data from model to mission 2024-05-17 15:33:11 -04:00
Goober5000 24e9a3a0c1 Merge pull request #6151 from Goober5000/cloaked_flag
add "cloaked" to list of flags
2024-05-17 12:34:53 -04:00
Goober5000 122e29fcaa Merge pull request #6152 from Goober5000/createRandomOrientation
add createRandomOrientation
2024-05-17 12:34:44 -04:00
BMagnu 03311c1527 Remove illegal assignment (#6153) 2024-05-17 10:11:16 -04:00
Goober5000 379077242a it's uniformly random, per Asteroth 2024-05-17 00:45:10 -04:00
Goober5000 cb4258e31f add createRandomOrientation
Considering that we have `ba.createRandomVector()`, we should have `ba.createRandomOrientation()` too.  This is based on an algorithm devised by @Baezon.
2024-05-17 00:16:54 -04:00
Goober5000 8ce463daf5 add "cloaked" to list of flags
This allows "cloaked" to be set and unset using `alter-ship-flag`.  Also clarify documentation on the primitive sensors flag.
2024-05-16 22:58:20 -04:00
John Fernandez 07a389a5e8 Typo 2024-05-16 15:45:53 -04:00
John Fernandez 87367d6b84 Make sure Keys and Items are proper length 2024-05-16 15:40:56 -04:00
John Fernandez ad7e713692 Override the virtual reject function 2024-05-16 14:40:38 -04:00
John Fernandez e5e2729157 Add non-numeric keys to warning messages 2024-05-16 11:38:01 -04:00
John Fernandez 039866d526 Linter Fixes 2024-05-16 11:24:03 -04:00
John Fernandez d432f9b1e9 Make to loop over the right constraint 2024-05-16 11:21:14 -04:00
John Fernandez c51bc08d1d linter fix 2024-05-16 11:11:07 -04:00
JohnAFernandez 3be4d0b15a Fixes based on testing and linters 2024-05-16 00:47:46 -04:00
Goober5000 fd32abad25 Merge pull request #6144 from Goober5000/emp_voice_fix
properly distinguish between adjusting voice and effects volume
2024-05-15 23:22:43 -04:00
Kestrellius f1c521413c Makes headon transition rate consistent. 2024-05-15 12:34:10 -07:00
Kestrellius 3b31034688 Removes const keyword from a couple things 2024-05-15 11:33:41 -07:00
John Fernandez 7da79c174b Add sorting to other function calls 2024-05-15 13:01:13 -04:00
John Fernandez 62a43512fd Finish safe to alter variable functions
And sorting function.
2024-05-15 12:31:13 -04:00
Goober5000 30d1653cae Merge pull request #6148 from Goober5000/physics_whack_nocap
refine process for capping speed due to physics whack/shock/collide
2024-05-15 03:05:54 -04:00
Goober5000 724e2e7f68 properly distinguish between adjusting voice and effects volume
When messages are distorted due to EMP effects, the voice volume should be controlled by the voice setting, not the effects setting.  Fixes a bug noticed by @skdKitsune, a portion of which dates back to the original public source release.

Also, when volume is adjusted in `snd_set_volume`, make sure the correct voice volumes are used.  Fixes a copy-paste bug from #5694.
2024-05-14 16:42:23 -04:00
Goober5000 5ccc3d5a78 Merge pull request #6130 from Kestrellius/min-pixel-per-weapon
Created per-weapon field for laser min pixel size.
2024-05-14 16:30:25 -04:00
Goober5000 49777052ac Merge branch 'master' into min-pixel-per-weapon 2024-05-14 15:58:56 -04:00
Goober5000 b9466193f5 Merge pull request #6141 from Goober5000/emp_scramble_flag
add ship flag to disable message scrambling when EMP is active
2024-05-14 15:50:25 -04:00
Goober5000 6fdb9459b5 Merge pull request #6147 from Kestrellius/const-particle-functions
Changes particle effect functions to take consts.
2024-05-14 15:50:04 -04:00
Goober5000 0d1c86e0cd Merge pull request #6146 from Kestrellius/bolt-offset
Laser bolt offset
2024-05-14 15:49:52 -04:00
John Fernandez 492683db2a Add A check to safeToAlter functions
And Add more notes to the notes column in the UI
2024-05-14 13:18:11 -04:00
Kestrellius cb93748898 Removes const keyword from copied parameters. 2024-05-14 07:29:54 -07:00
John Fernandez c53e6b1487 Finish Safe to Alter Options in Model Update 2024-05-14 00:14:48 -04:00
John Fernandez e7f6fa3c91 Upgrade Container Copying 2024-05-13 22:31:30 -04:00
John Fernandez 455d2c9681 Add to Apply()
And start safeguarding changes that would not be safe to make without cleaning references.
2024-05-13 20:57:39 -04:00
Kestrellius 9192bb00b1 Alters other files to match previous changes. 2024-05-13 13:23:41 -07:00
Kestrellius ebd39bb5df Changes particle effect functions to take consts. 2024-05-13 13:03:42 -07:00
Goober5000 30b0026ca5 refine process for capping speed due to physics whack/shock/collide
The three functions `physics_apply_whack`, `physics_apply_shock`, and `physics_collide_whack` limited speed after the physics had been applied, but they limited absolute speed, not the speed due to the physics.  This modifies the process to limit the change in speed.  It also adds an AI profiles flag to disable the limit if desired.

This also tweaks the three functions (by editing comments and moving lines) to be more consistent, since all three are doing very similar calculations near the end.
2024-05-13 15:53:20 -04:00
Kestrellius c14a62e9d3 Adds comments clarifying positioning details. 2024-05-13 11:25:11 -07:00
Goober5000 046f302458 Merge pull request #6139 from Kestrellius/muzzle-effect
Adds muzzle effect functionality.
2024-05-13 14:02:56 -04:00
wookieejedi 4b6cbb9c01 Expose Collision Rotation Factor to Players (#6145)
* Expose Collision Rotation Factor to Players

Previously, there were hardcoded checks in place to make players have 0 rotational effects when colliding with another ship. This PR adds a new value, "+Player Multiplier for Rotation Factor:" that allows modders to have players experience rotational effects from collisions. Also performed some cleanup of the light and heavy collisional rotational calculations by removing older if-blocks following useful recommendation from Asteroth.

Tested and works as expected.

* make  rot_fac_multiplier_ply_collisions into global value

* update name to better match with ships table

* restore repeated comments to help with separation
2024-05-13 16:57:41 +00:00
John Fernandez b053131e71 Connect the x with prereject instead of reject.
Because the x is not connected to the cancel button, it has to be connected to preReject first.
2024-05-13 10:18:29 -04:00
John Fernandez e502cdfe76 Finish the validation function 2024-05-13 09:48:40 -04:00
Mike Nelson ed78fd84ea remove more ui stuff from API mode debrief (#6137) 2024-05-13 07:38:49 -04:00
Goober5000 393a9d4eba Merge pull request #6140 from Goober5000/small_fixes
several small fixes, mostly for FRED/qtFRED
2024-05-13 00:06:15 -04:00
Goober5000 9b94655250 Merge pull request #6125 from Goober5000/sync_initialization
make initialization consistent among FSO, FRED, and qtFRED
2024-05-13 00:06:08 -04:00
wookieejedi 5a501a8447 Update Align to target when guarding still (#6143)
Follow-up to #6047. This method better accounts for matching the guardee ship orientation when using the new AI flag.

Tested and works as expected. Thanks @BMagnu!
2024-05-12 23:09:58 -04:00
Kestrellius 3747a45dbe Adds three-dimensional bolt offset. 2024-05-12 16:07:24 -07:00
Kestrellius 5d30c07e31 Removes unnecessary commented-out code. 2024-05-12 11:06:21 -07:00
Kestrellius e2bf3bbd46 Adds one-dimensional bolt offset, with bugs. 2024-05-12 10:54:05 -07:00
Asteroth 5d6e68b8fd tweaks and fixes 2024-05-12 13:09:59 -04:00
JohnAFernandez e855fc81e9 Check for conversion availability with same algo 2024-05-12 01:50:45 -04:00
JohnAFernandez df77615473 Various Fixes Based on Testing 2024-05-12 01:42:36 -04:00
Goober5000 d51f53fb30 add ship flag to disable message scrambling when EMP is active
What it says on the tin.  This supersedes PR #2917, as it puts the flag check in the proper function and uses a ship flag rather than a mission flag.
2024-05-11 23:38:18 -04:00
John Fernandez 23dda4ba43 Merge pull request #6135 from MjnMixael/fix_debrief_ui_murderer
Do not unload debrief bitmaps in API mode
2024-05-11 22:50:57 -04:00
Goober5000 499a5f4a02 several small fixes, mostly for FRED/qtFRED
1. Add the "Override #Command in event messages" checkbox to qtFRED
2. Add the "Preload Subspace Tunnel" checkbox to the proper button group in qtFRED
3. Reorder lines in fred.rc so the declarations match the order they appear in the dialog
4. Use the correct name when reporting fireball index errors for ship classes
2024-05-11 22:42:38 -04:00
Kestrellius 67e689106c Makes muzzle effects work properly on turrets. 2024-05-11 17:23:27 -07:00
Kestrellius 67999a3fe8 Clean version of shipfx move. 2024-05-11 15:29:24 -07:00
Asteroth 5cb0633314 fixes 2024-05-11 13:38:15 -04:00
Asteroth 2bbc052e7f Merge pull request #6128 from Goober5000/vanilla_time_compression
allow restriction to vanilla time compression range
2024-05-11 12:36:29 -04:00
mjn-mixael a222b29586 Do not unload debrief bitmaps in API mode 2024-05-11 11:32:50 -05:00
Asteroth 49a1e8458f add in game options and adjustments 2024-05-11 12:19:14 -04:00
John Fernandez 20f992fe54 Fix Not being able to add map items by value 2024-05-11 00:43:36 -04:00
JohnAFernandez d557a6eff4 More Bug fixes 2024-05-11 00:19:18 -04:00
JohnAFernandez e66803af09 Further Bug fixes based on testing 2024-05-10 23:17:54 -04:00
JohnAFernandez cd3464d331 Make sure string items can be deleted 2024-05-10 22:52:56 -04:00
Kestrellius b5efed380f Adds muzzle effect functionality. 2024-05-10 19:47:51 -07:00
JohnAFernandez bc5f986d76 Bug fixes from testing 2024-05-10 22:18:54 -04:00
Goober5000 9d9714f0bb Merge pull request #6126 from Goober5000/hud_support_find_closest_fix
patch hud_support_find_closest
2024-05-10 14:38:03 -04:00
Goober5000 edeabbbd58 Merge pull request #6129 from Goober5000/cmdbrief_modify_check
call set_modified() when cmd_brief data has changed
2024-05-10 14:37:48 -04:00
Kestrellius 62f25d7400 Changed variable names to specify laser. 2024-05-10 10:57:24 -07:00
Kestrellius d43818f7dc Merge branch 'min-pixel-per-weapon' 2024-05-10 10:41:25 -07:00
Kestrellius 6c9bf8def4 Implementation changes as requested by BMagnu. 2024-05-10 10:38:02 -07:00
Kestrellius c73c0ef889 Merge branch 'master' into min-pixel-per-weapon 2024-05-10 10:07:13 -07:00
Goober5000 a9141e9733 call set_modified() when cmd_brief data has changed
Fixes #6032.
2024-05-09 22:42:33 -04:00
Goober5000 fc4024ab66 allow restriction to vanilla time compression range
This provides a command-line argument to restrict the time compression range to the classic 1x - 4x.  Implements #6075.

I'm not entirely satisfied with `-orig_speedx_range` but it's the best I came up with that fit into the 19-character limit.  I'd be open to other suggestions.
2024-05-09 19:05:14 -04:00
Goober5000 c2335640ad Merge pull request #6113 from Goober5000/when-argument-fix
don't short-circuit eval_sexp on any nodes in a when-argument tree
2024-05-09 17:39:34 -04:00
Goober5000 8b984781fd Merge pull request #6121 from Goober5000/fix_dradis_blips
Fix DRADIS blips
2024-05-09 17:39:25 -04:00
Asteroth c3b01da2d1 reduce volume threshold (#6127) 2024-05-09 08:01:43 -04:00
Kestrellius 68a936504f Make laser glow scaling configurable. (#6123) 2024-05-08 17:41:50 +02:00
Goober5000 6edaea6056 Merge pull request #6122 from Dark-Visor/color_and_colour
Accept "color" and "colour" in game_settings.tbl
2024-05-07 01:12:43 -04:00
Goober5000 bf7c923020 patch hud_support_find_closest
Rework `hud_support_find_closest()` slightly to do a quick out if the player is no longer a valid object.  Fixes an assertion noticed by Darius that occurs if the player dies when a rearm is imminent.
2024-05-07 01:06:15 -04:00
Goober5000 bfe40e12c6 make initialization consistent among FSO, FRED, and qtFRED
Make the initialization sequence consistent so that FSO, FRED, and qtFRED call their initialization functions in the same order.  Most of the changes involve bringing FRED and qtFRED into sync with FSO.  This fixes fireball prerequisites for the ship types table, applies the script initialization fixes from #5946 to FRED, and generally removes the possibility of any surprises due to FRED differing from FSO.

Also remove the empty `brief_init_colors()` function.
2024-05-07 00:14:18 -04:00
Kestrellius 8d9736d3e3 Created per-weapon field for laser min pixel size. 2024-05-06 16:26:44 -07:00
Goober5000 322f807ac0 Merge pull request #6114 from Goober5000/dynamic_fireballs
make fireball types dynamic
2024-05-06 01:40:14 -04:00
Goober5000 209f5636b0 Merge pull request #6115 from Goober5000/setClip_enhancement
setClip enhancement
2024-05-06 01:39:59 -04:00
Asteroth dea9437c04 add waypoints no formation flag (#6119) 2024-05-05 22:10:19 -04:00
JohnAFernandez 621030a720 Fix various issues 2024-05-05 13:30:24 -04:00
JohnAFernandez 9b29e754ce Fix overflow return values
Previously on windows it was returning 0 because std::stol has a poor windows implementation.
2024-05-05 11:13:03 -04:00
JohnAFernandez e4886db4d2 Fix shift up and down buttons 2024-05-05 00:58:24 -04:00
JohnAFernandez b9b36d2a76 Fix Shift up and down buttons 2024-05-05 00:19:01 -04:00
JohnAFernandez 87fd99f9f6 Finish implementation of type formatting option 2024-05-05 00:18:47 -04:00
JohnAFernandez 03083d1a91 Implement a few missing container item features 2024-05-04 23:25:09 -04:00
JohnAFernandez 3120d6dda1 Fix the Addition of variables by typing
And start adding container Items by typing.
2024-05-04 16:57:30 -04:00
JohnAFernandez 8dde6d47cb More spacing adjustments and text changes 2024-05-04 01:19:42 -04:00
JohnAFernandez 98e78ec086 Fix Containers Not Restoring Deleted Items
And Change Deletion Text for size savings
2024-05-04 01:03:34 -04:00
JohnAFernandez e1b9832faf Fixes Based on Testing 2024-05-04 00:51:39 -04:00
JohnAFernandez c9e11d4657 Fixes Based On Testing 2024-05-04 00:35:46 -04:00
JohnAFernandez d7c4c544e6 Bug fixes according to testing 2024-05-03 23:54:07 -04:00
JohnAFernandez 50762246cb Fixes based on linter
And size adjustments
2024-05-03 23:22:27 -04:00
Goober5000 b624019f32 Merge pull request #6094 from Goober5000/hide_key_reset
hide key-reset
2024-05-03 11:02:22 -04:00
Goober5000 d1d173b99f Merge pull request #6116 from Dark-Visor/subtitles
Update Settings for movie subtitles #6064
2024-05-03 11:01:40 -04:00
Dark-Visor b7f4ad9780 Accept "color" and "colour" in game_settings.tbl
Allow optional strings in game_settings.tbl to recognise both
spellings - color/colour.
2024-05-02 13:57:16 +01:00
Goober5000 69c8957500 several improvements to DRADIS blips
1. fix a bug where blips expired immediately every frame; they now track their expiration by object
3. store object numbers rather than object pointers
3. clamp both the high bound and the low bound of alpha values
2024-05-02 01:33:31 -04:00
Goober5000 76359c649f remove some obsolete commented code 2024-05-02 01:32:17 -04:00
Goober5000 855331bcd6 change sweep_percent field to sweep_angle to be more accurate 2024-05-02 01:31:27 -04:00
Goober5000 fa6d64ae7e fix sweep_duration and disambiguate overall frametime
Convert `sweep_duration` from seconds to milliseconds to work correctly with the timestamp system.  Also clarify use of `game_get_overall_frametime()`, especially with `ba.getFrametimeOverall()`; and add `ba.getSecondsOverall()` to do what `ba.getFrametimeOverall()` allegedly did.
2024-05-02 00:01:47 -04:00
Goober5000 bc4cc598c9 qtfred too 2024-05-01 22:42:06 -04:00
Goober5000 3d92d469ac move backup info and make them consistent 2024-05-01 22:22:24 -04:00
Goober5000 9edcf5f450 add routine to recover autosaved mission 2024-05-01 21:42:39 -04:00
Goober5000 2f5e7a4de2 tweak MessageBox call 2024-05-01 21:42:39 -04:00
Goober5000 8d6a8721f9 taylor's patch for file modification time 2024-05-01 21:42:39 -04:00
Goober5000 7ebfa52bf5 standardize file modification time formatting between FRED and qtFRED 2024-05-01 21:42:32 -04:00
Dark-Visor 89e8961984 Add allowances for no alpha and spelling colour
User should be able to input 3 values (r,g,b) and let alpha default to
opaque. Also add "$Movie subtitle colour:" for English spelling of
color.
2024-05-01 15:23:06 +01:00
John Fernandez d04ce617fe Add swap keys and values button 2024-05-01 00:53:45 -04:00
John Fernandez 8340427388 Make sure shift buttons apply the model 2024-04-30 22:15:31 -04:00
John Fernandez eda645dcfc Make sure delete button changes text
The button should now say restore when the item has already been deleted.  Also, this expands how well we warn about deletions and will dynamically decide if we need to warn about deletion.
2024-04-30 22:03:50 -04:00
John Fernandez 72b13631c8 Implement sift up and down buttons 2024-04-30 20:56:04 -04:00
John Fernandez 824b5bbb37 Write addNewVariable overload for typed items 2024-04-30 18:59:24 -04:00
John Fernandez 2a8ec9cc45 Write setContainerKeyType 2024-04-30 18:51:29 -04:00
John Fernandez 237bd53b6d Rename this variable for clarity
And add a comment
2024-04-30 17:47:55 -04:00
JohnAFernandez ba263d6889 Trying to fixup The map/list switch function 2024-04-30 00:50:55 -04:00
JohnAFernandez d333694a09 Adding Button for Key/Value Swap
And Add more width for table views
2024-04-30 00:50:26 -04:00
John Fernandez cf356ed3df Finish writing change from list to map 2024-04-29 17:26:57 -04:00
John Fernandez 4677fb8801 Start Applying List values to Keys, etc. 2024-04-29 14:02:13 -04:00
Dark-Visor 0f4dc47db9 Correction to subtitle_color check
Update check from checking the validity of state color to
Movie_Subtitle_rgba color values.
2024-04-29 18:10:04 +01:00
Dark-Visor eacba95b7b Update to #6064 fix to correct code
Update movie.cpp to correct subtitle declaration and checks.
2024-04-29 17:30:29 +01:00
Asteroth f40941304c Account for scripting when dealing with velocity (#6110)
* add scripted velocity

* fix

* rejigger to handle displacement as well, and add flag

* review tweaks

* one more fix
2024-04-29 01:40:26 -04:00
JohnAFernandez 5ee211203a Fix Containers not deleting 2024-04-29 01:06:04 -04:00
JohnAFernandez 898f8a9963 Increase size of dialog to store info better
And ... more Fixes Based On Testing
2024-04-29 00:54:02 -04:00
JohnAFernandez c5b033235a More Fixes Based On Testing 2024-04-29 00:03:02 -04:00
JohnAFernandez f1dd86477a More Fixes Based on testing 2024-04-28 23:30:23 -04:00
Dark-Visor eb9c58dc2d Update Settings for movie subtitles #6064
Update mod_table and movie files to include settings for the color and
transparency of the subtitles.
2024-04-28 22:36:07 +01:00
JohnAFernandez a8cc7d2896 Appease the linter 2024-04-28 14:44:38 -04:00
JohnAFernandez e902f6d075 More change based on testing 2024-04-28 13:38:40 -04:00
JohnAFernandez 0c2d1a7a10 Save Changes 2024-04-28 01:52:30 -04:00
JohnAFernandez c984faeda1 Add Accept and Reject Signal Reactions 2024-04-28 01:37:29 -04:00
Goober5000 742fd321d5 setClip enhancement
Allow the resize mode to be specified to `gr_set_clip()` without changing the active graphics-wide resize mode.  Along with `drawStringResized`, this provides a shorthand to allow text to be drawn at different sizes, with the appropriate clipping regions, without requiring access to the `CurrentResizeMode` virtvar.
2024-04-27 02:48:08 -04:00
JohnAFernandez dac5fbeb82 Fix more Container issues based on testing 2024-04-26 20:11:40 -04:00
JohnAFernandez 94dbd95530 Fix nullptr on copy 2024-04-26 19:10:24 -04:00
JohnAFernandez 6e6b4098f3 Fix add container and add item rows
They were not appearing.
2024-04-26 19:03:22 -04:00
JohnAFernandez fc11ddcd45 Fixes Based On Linter and Testing 2024-04-26 18:15:59 -04:00
John Fernandez ec4e50481b Hopefully fix Variable Persistence Not saving 2024-04-26 17:21:18 -04:00
John Fernandez d143add82d Fixes to container options updates
And other fixes and adjustments
2024-04-26 17:17:10 -04:00
John Fernandez ed3fcc8aca Switch Key Options and Data Options
The data type options are going to be used much more regularly and always enabled, and so should be higher on the layout.
2024-04-26 17:16:34 -04:00
John Fernandez c24457ff6d Add Clamping Function
And more cleanup for trimIntegerString
2024-04-26 16:41:13 -04:00
John Fernandez 4bb8456f69 Further Fix and Rename function for clarity
It turns out that an empty string is not the only possible desired value if the filtered string is "-".  "-0" should return "0", but would return "" before this.
2024-04-26 16:06:58 -04:00
John Fernandez 5503aec7b4 Fix filtering out zero by accident 2024-04-26 15:57:33 -04:00
JohnAFernandez 4324b41109 More Fixes and Tweaks based on testing 2024-04-26 01:02:22 -04:00
JohnAFernandez 6134a42ef0 Ton of fixes from testing 2024-04-26 00:01:27 -04:00
John Fernandez 2a4894d696 start implementing unified values in containers
And write map key changing function.

Revert "start implementing unified values in containers"

This reverts commit 25eeae42413373bc7f12831285f8f639c8a93904.
2024-04-26 00:01:27 -04:00
Goober5000 3851832db5 make fireball types dynamic
As requested by Event Horizon, this removes the limit on fireball types.  The fixed array has been replaced with a vector and the relevant code updated accordingly.  There is also a new version of `stuff_int_list()` to parse ints into a vector.

This also adds bounds checking for explosion animations that are parsed for ship classes, ship types, and asteroids, since previously there was no guarantee that the indexes would be in range.
2024-04-25 21:26:35 -04:00
Goober5000 539d89ca8c don't short-circuit eval_sexp on any nodes in a when-argument tree
This is a follow-up to #2942.  That PR solved most of the short-circuiting issues with nested conditionals under when-argument, but it was still possible for the code to incorrectly short-circuit on a nested conditional that had `<argument>` in an action operator but not a condition operator.  The cleanest way to fix this is to not short-circuit on *any* nodes that are part of a when-argument tree.
2024-04-25 00:10:27 -04:00
Goober5000 289d0b66d1 Merge pull request #6093 from Goober5000/sexp_error_check_fix
fix bad node identification for certain SEXP errors
2024-04-23 16:52:39 -04:00
John Fernandez 55380f7e8f Start on SetContainerListOrMap 2024-04-23 13:02:48 -04:00
John Fernandez 3a5a2ab43c Linter errors from recent changes 2024-04-23 12:01:17 -04:00
John Fernandez 4f0f57e711 Clean up the model in a few places 2024-04-22 16:46:04 -04:00
John Fernandez 8801672301 Fix more linter errors 2024-04-22 13:03:22 -04:00
John Fernandez a18ac34c03 Fix Linter errors 2024-04-22 12:43:26 -04:00
John Fernandez dd44d7d13a Fixing more issues 2024-04-22 01:40:46 -04:00
John Fernandez 84cad8c188 More Fixes and polish 2024-04-22 01:09:44 -04:00
John Fernandez 9dfc6d7c68 Fixes for UI bugs 2024-04-22 01:02:17 -04:00
JohnAFernandez 3c7639a9e3 And one more apparently 2024-04-22 00:33:16 -04:00
JohnAFernandez 7f1e72ecca Some final ui adjustments 2024-04-22 00:32:51 -04:00
JohnAFernandez d147330739 Fix null item crash 2024-04-21 23:38:14 -04:00
Goober5000 f3c6b0f8f3 Merge pull request #6108 from Goober5000/no_escort_callsigns
add flag to not show callsigns in escort list
2024-04-21 23:29:35 -04:00
JohnAFernandez beaadbbc16 Merge branch 'qtFRED-variables-editor' of https://github.com/JohnAFernandez/fs2open into qtFRED-variables-editor 2024-04-21 23:03:34 -04:00
John Fernandez f38dbae310 Save changes to transfer over 2024-04-21 22:50:51 -04:00
John Fernandez 7f0666cc33 More Fixes, but Requires Linter For more progress 2024-04-21 16:46:57 -04:00
John Fernandez 91723be9c5 And stub another function for now
There are at least two stubbed functions left on the model
2024-04-21 16:05:12 -04:00
John Fernandez 4e669f9ce4 don't forget to change name. 2024-04-21 16:02:00 -04:00
John Fernandez 209e905a05 Add copy Container Function 2024-04-21 16:00:43 -04:00
John Fernandez a82db02b41 Fix missing function 2024-04-21 15:56:47 -04:00
John Fernandez 22663cb297 Finish Dialog Code
Need to make more changes to the model
2024-04-21 15:54:11 -04:00
John Fernandez 3698cbe09f Hopefully Final Linter mistakes 2024-04-21 15:00:44 -04:00
John Fernandez 29754cafc2 More Linter Fixes 2024-04-21 14:39:45 -04:00
John Fernandez 474527ef83 More Linter Fixes 2024-04-21 14:15:35 -04:00
John Fernandez ce32ef3022 Linter Fixes 2024-04-21 13:41:23 -04:00
John Fernandez 792cf0a0ed More fixes 2024-04-21 01:11:57 -04:00
John Fernandez 314ba92782 Fix Compiler Errors 2024-04-21 00:41:38 -04:00
John Fernandez 6264656097 As far as I can tell populating items is done 2024-04-21 00:37:46 -04:00
John Fernandez 6bd3b43cd8 Don't forget extra line left by accident 2024-04-21 00:17:01 -04:00
John Fernandez 3bec6d8cfc No const here 2024-04-21 00:14:19 -04:00
John Fernandez 72271be1f9 Getting closer to completion of basics 2024-04-20 23:50:54 -04:00
John Fernandez bb838ea4dd Place getCurrentContainerRow in more places 2024-04-20 23:38:32 -04:00
Asteroth 1bd65192ba Allow for more field of fire cooldown shenanigans (#6086)
* allow for more fof cd shenanigans

* review fix

* switch to per frame management

* unused variable

* review tweaks
2024-04-20 23:33:24 -04:00
John Fernandez ad74c21b82 Edit onVariablesTableUpdated
And Apply GetCurrentContainerRow
2024-04-20 23:31:17 -04:00
John Fernandez e7b0f61870 Start applying currentVariableRow 2024-04-20 19:04:14 -04:00
John Fernandez 7c37628e1a Add get item rows to reduce duplicate code 2024-04-20 18:52:36 -04:00
John Fernandez 2a337133cb Fixes and add a couple more UI functions 2024-04-20 18:36:30 -04:00
Taylor Richards 2642fa22de add preliminary support for Windows ARM64 (#6079)
First step in the process of working Windows ARM64 support. This adds the most
basic support needed, but by itself will not succesfully build. However these
changes should not interfere with builds for other architectures or platforms,
and should still allow for x86/x64 builds on ARM64 Windows.
2024-04-19 04:30:20 -04:00
John Fernandez a06cb0c688 More progress on updateContainerDataOptions 2024-04-18 18:03:37 -04:00
John Fernandez e4254636dd Finish addMapItem and upgrade getcontainernames
This has an upgrade for displaying List and Map info in a configurable manner.
2024-04-18 16:52:45 -04:00
Goober5000 ac8d774bc7 Merge pull request #6095 from Baezon/debris-big-damage
Add flag for debris respecting big damage
2024-04-18 15:58:54 -04:00
Goober5000 a57ae15c72 Merge pull request #6109 from Goober5000/fighter_beam_fov_fix
fix fighter beam FOV calculation
2024-04-18 15:58:45 -04:00
John Fernandez f61649e911 Add type text to container Table 2024-04-18 15:14:25 -04:00
John Fernandez 83fde5acfc Actually, upgrade the lambda
This handles the leading negative no matter where it is.
2024-04-18 14:45:20 -04:00
Goober5000 26c4ea1057 fix fighter beam FOV calculation
Remarkable that we're still finding bugs in fighter beams after 20 years...

Since field-of-fire angles are specified in degrees, and `cosf` accepts radians, the angle needs to be converted (and then halved, per usage elsewhere).  Although this is a bugfix, this should technically not affect fighter beam behavior because fighter beams always fire down their normals.
2024-04-18 14:39:37 -04:00
John Fernandez 7d7b6eeeb8 Prevent crash from empty source string 2024-04-18 14:25:18 -04:00
John Fernandez 94057c5ef2 Clean up container data updates
And move the trimString method.
2024-04-18 14:24:01 -04:00
Goober5000 148efb4713 add flag to not show callsigns in escort list
As a follow-up to #5523, some mods use callsigns for their ships but prefer not to display the callsigns in the escort list.  In lieu of a more flexible way to configure escort lists, a simple flag is sufficient to implement the desired behavior.
2024-04-18 13:46:58 -04:00
Goober5000 88bf67a64f Merge pull request #6104 from Goober5000/locations_to_enums
convert arrival/departure locations to enum classes
2024-04-18 03:53:30 -04:00
Goober5000 a18b122b19 Merge pull request #6106 from Goober5000/checkVisibility_fix
fix checkVisibility
2024-04-17 23:18:55 -04:00
Goober5000 0a59c533c2 fix checkVisibility
The checkVisibility function did not check its arguments' validity, leaving open the possibility of a null pointer access.
2024-04-17 22:32:54 -04:00
John Fernandez 6fe5ab7dc7 Fix No Persistence not updating
And other fixes
2024-04-17 16:29:11 -04:00
Goober5000 3ad0d3713d convert arrival/departure locations to enum classes
To enforce type safety for arrival and departure locations, this converts them to enum classes.  Various casts are added when appropriate to convert between the indexed and enum values.
2024-04-17 15:05:48 -04:00
Goober5000 7acf56f4f5 Merge pull request #6103 from Goober5000/in_back_of_ship
add 'In back of ship' arrival location
2024-04-17 15:05:24 -04:00
Goober5000 55c41c96a7 add above/below and left/right 2024-04-17 14:37:47 -04:00
Mike Nelson e63383d324 Ingame prejoin API (#6099)
* ingame prejoin api

* fix type mismatch

* return boolean here

* address feedback
2024-04-17 17:48:57 +00:00
Mike Nelson 7ae8c79dea Team Loadout API for SCPUI (#6096)
* team loadout methods

* documentation

* address feedback

* better assertions
2024-04-17 13:24:27 -04:00
Mike Nelson 002783ce7c miscellaneous methods needed (#6090) 2024-04-17 12:48:27 -04:00
Asteroth 72b6ded0ac fix circ default curves (#6102) 2024-04-17 12:48:02 -04:00
JohnAFernandez a57949c747 getting closer to correct width 2024-04-17 00:27:22 -04:00
JohnAFernandez 24310690f6 more progress 2024-04-17 00:26:42 -04:00
JohnAFernandez bd75eff4e4 Make sure that tables have contents
And fixes and progress
2024-04-17 00:05:36 -04:00
JohnAFernandez 364e39cedf more fixes 2024-04-16 23:24:26 -04:00
Goober5000 4c7f16fb1b add 'In back of ship' arrival location
Allows ships and wings to arrive behind a ship, to complement 'In front of ship'.  In fact, the arrival code is nearly identical, with just a small tweak to distinguish ahead from behind.

Since the new arrival location represents a change in mission format, this also adds code to detect for its usage and set the mission format to 24.1.  Most missions can continue to be saved as version 23.1.
2024-04-16 19:27:47 -04:00
JohnAFernandez e1662d8501 Fix many typos from lack of linter 2024-04-16 00:22:40 -04:00
John Fernandez 7938169730 Don't forget lookup by name functions
This helps prevent name collisions
2024-04-15 22:50:05 -04:00
John Fernandez 3d5c43e45d Fix model functions by using index
Instead of name.
2024-04-15 22:43:45 -04:00
John Fernandez 1581d9dc1f Save progress 2024-04-14 12:34:20 -04:00
John Fernandez d4f8706208 Add contents to UpdateContainerOptions 2024-04-14 12:00:32 -04:00
John Fernandez 8d40952bf5 Finish adding Variable change options 2024-04-13 00:51:20 -04:00
John Fernandez 4cac920943 Add more dialog functions 2024-04-12 23:56:00 -04:00
John Fernandez 2ad0571b22 Make sure that setVariableType signals failure 2024-04-12 23:55:22 -04:00
John Fernandez 6e10ee64f8 Add TrimNumberString function
And other things
2024-04-12 21:56:27 -04:00
John Fernandez c9f4982d08 Add apply trigger on validated data
And clean up dialog model slightly
2024-04-12 21:48:50 -04:00
John Fernandez bc059bdb86 Add Variable Editor Trigger To Loadout Dialog 2024-04-12 21:47:42 -04:00
John Fernandez e60cf65036 Write part of onVariablesTableUpdated 2024-04-12 21:04:20 -04:00
John Fernandez 2934e99ddc Progress on applyModel 2024-04-12 17:26:14 -04:00
John Fernandez 11fac90617 Add missing functions 2024-04-12 15:27:24 -04:00
John Fernandez 9ef56797fe Create the Validate Function
And correct the Apply function some.
2024-04-12 15:26:58 -04:00
JohnAFernandez e1ed5fdd78 Fixes to allow building
Edits were previously done on a machine that could not build or use a linter.
2024-04-12 00:59:29 -04:00
JohnAFernandez a125b8b3ce Fixup the Variables Dialog
Add it to the editor menu (with shortcut), and fix it showing up when started
2024-04-12 00:58:37 -04:00
John Fernandez de54dea61a save progress 2024-04-11 22:29:21 -04:00
Mike Nelson ecb9fae3c4 check if inputbox is valid (#6092) 2024-04-11 17:49:25 -04:00
wookieejedi 55c20636d9 Improve Mainhall Button Responsiveness (#6098)
* Improve Mainhall Button Responsiveness

Previously, there was a 175 millisecond delay when hovering over a mainhall animation before it triggered. This PR makes that value settable via the mainhall table.

Tested and works as expected. Now custom mainhalls have much more of a spring int their step.

* cleanup num res location
2024-04-11 17:48:28 -04:00
Goober5000 e8d164c926 Merge pull request #6097 from Goober5000/model_range_fix
model range fix
2024-04-11 17:01:43 -04:00
Goober5000 89f4fe54c3 convert model_h and submodel_h to use indexes
Indexes are a more robust way than pointers to manage model and submodel handles, and in the event that models are made dynamic in the future, indexes will be necessary anyway.
2024-04-11 15:15:44 -04:00
John Fernandez d665c618c1 Starting progress on initializeData
And container functions
2024-04-11 15:12:16 -04:00
Goober5000 7fba753f9d model range fix
Use the correct upper bounds check for `model_get()`.
2024-04-11 14:53:24 -04:00
Asteroth bd05f13f07 add flag for debris respecting big damage 2024-04-11 14:21:44 -04:00
Goober5000 d5a3813e8b hide key-reset
Hides the `key-reset` operator in FRED and elaborates on the help descriptions for both it and `key-reset-multiple`.  Implements #6076.
2024-04-10 21:14:59 -04:00
Goober5000 735d4ab678 fix bad node identification for certain SEXP errors
Set the bad node to the ship node, so that the FREDder can see which ship is receiving the invalid order.  Without this change, the bad node would point to the last value parsed, which is typically the goal priority.

Fixes a misleading error dialog reported in Discord.
2024-04-10 17:54:57 -04:00
Goober5000 71543c9c10 Merge pull request #6058 from Goober5000/skybox_orientation_and_alpha
add skybox alpha, and add scripted functions for alpha and orientation
2024-04-10 17:06:24 -04:00
Goober5000 b2e1ae43a9 Merge pull request #6039 from Goober5000/percent_ships_scanned
add percent-ships-scanned
2024-04-10 17:04:46 -04:00
Goober5000 c7cffcb311 Merge pull request #6091 from notimaginative/fix_chatbox_crash
fix crash when chatbox message is all whitespace
2024-04-10 17:04:37 -04:00
Goober5000 c96f1af375 Merge pull request #1 from BMagnu/skybox_alpha
Fix Skybox Alpha Setting
2024-04-10 12:53:41 -04:00
BMagnu c2d1b69ea2 Set alpha as alpha mult and only if actually required 2024-04-10 12:49:58 +02:00
Taylor Richards 861e5f9813 fix crash when chatbox message is all whitespace
When attempting to add a chat message which is all whitespace the split_str()
function will produce no lines. The strcpy() that follows will then crash
due to an attempt to copy a nullptr.
2024-04-10 05:03:16 -04:00
John Fernandez fa27b8d133 MOAR FUNCTIONS! 2024-04-10 01:38:48 -04:00
Taylor Richards f288ef7101 fix issues with get_text() and set_text() for INPUTBOX (#6089) 2024-04-08 19:19:03 -04:00
Taylor Richards 067f862c4d add support for decompression of DDS textures (#6025)
Adds bcdec lib to convert compressed DDS textures to RGBA based on what the
system supports. BC7 if BPTC extension not supported, DXT? if S3TC extension
not supported.

Should support cubemaps and volume textures but those were not tested.

Addtional changes:
 - remove indexed DDS support since it had bugs but didn't work anyway
   (R8 should be used instead)
 - fix issues with volume textures (nothing to test with)
 - remove old compression support flags as they are now obsolete

Fixes #4920
2024-04-08 16:56:33 -04:00
John Fernandez aea39664ba Add logic for addcontainer
and a few other functions
2024-04-08 14:18:14 -04:00
John Fernandez 5575ab4c95 Finish setContainerValueType
And add stubs for other model functions we'll need
2024-04-07 23:37:25 -04:00
Taylor Richards 3478640b4d fix deprecated/removed code in cutscene ffmpeg (#6088) 2024-04-07 18:43:15 -04:00
Mike Nelson 66204287e6 properly validate mission custom data keys (#6082) 2024-04-07 16:46:05 -04:00
Mike Nelson 6b1d9304ed Multi general api (#6078) 2024-04-07 16:45:51 -04:00
John Fernandez 2827e93b2d Continue writing editor model functions
Also, add a few declarations for List and Map contents editing.
2024-04-07 16:36:29 -04:00
Mike Nelson 66ec2c8154 multi dogfight debrief api (#6084) 2024-04-07 16:48:23 +00:00
Mike Nelson e3918a14f2 API for the Multi Pause UI (#6083) 2024-04-07 12:28:24 -04:00
John Fernandez cad4f6980d Save progress 2024-04-07 09:51:00 -04:00
Mike Nelson 4b1476c101 on loading complete hook (#6085) 2024-04-07 08:09:51 -04:00
John Fernandez 286a96e2c3 save progress 2024-04-06 22:25:48 -04:00
Goober5000 86db536bf5 Merge pull request #6071 from Goober5000/support_ship_specific_checks
adjust ship registry checks to accommodate support ships
2024-04-06 20:51:58 -04:00
Goober5000 b3b811841b Merge pull request #6080 from Goober5000/electrical_arc_stuff
more electrical arc API features
2024-04-06 20:51:50 -04:00
Goober5000 cc62643001 Merge pull request #6081 from Goober5000/goal_cheat_fix
mission goal cheat fix
2024-04-06 20:51:41 -04:00
Goober5000 3b7157e2de mission goal cheat fix
If the goals are marked complete, a mission log entry should be added as well.  Fixes some goal weirdness first noticed by DAK on Discord.
2024-04-03 20:32:12 -04:00
Goober5000 a5630d63a5 more electrical arc API features
Follow-up to #6034.  This slightly changes the function signature of `AddElectricArc` but it should be fine since it hasn't appeared in a stable release yet.
2024-04-03 20:27:14 -04:00
Mike Nelson 052b4b29e9 Multi sync API (#6077)
* multi host settings ui initial setup

(cherry picked from commit bcb31c327653329e62e4430815fe1e981751f9dc)

* Finish the rest of the API

* include enums

* set these

* Close game needed

* Handle accepting the host setup

* Don't need to be master to set these and add ways to check master and self

* add client ui to this PR because

* Allow getting the player state string

* Multi sync api methods

* unused variables

* Fix state checking

(cherry picked from commit fcde973cdf)

* typo

* address feedback

(cherry picked from commit ecb33e7cc6)
2024-04-02 17:34:06 +00:00
Mike Nelson ea8e356b63 Multi Start Game UI API (#6068)
* methods for the Multi Start Game UI API

* missed a comma

* properly close the session

* name instead of password
2024-04-02 16:56:56 +00:00
Mike Nelson 9bba53c3e8 Multi Join API (#6059)
* methods required for the multi join ui api

* Move color setting because the API doesn't need it either
2024-04-02 12:19:20 -04:00
Asteroth 3df616e69d Merge remote-tracking branch 'upstream/master' into aim-cursor 2024-04-01 23:09:31 -04:00
Goober5000 0fb18a15c4 Merge pull request #6069 from Baezon/bad-rearm-time
Add bad-rearm-time sexp
2024-03-31 15:01:50 -04:00
Goober5000 e1503a8ac8 Merge pull request #6002 from Goober5000/game_settings_order
allow game_settings options to be read in any order
2024-03-31 15:01:41 -04:00
Goober5000 b11cf2c2db Merge pull request #5887 from Goober5000/wing_destruction_sanity_check
check for potential issues in FRED missions
2024-03-31 15:01:32 -04:00
Asteroth 9c8d02b69b Add 'alignment' for poofs (#6072)
* add poof alignment

* put this back

* review fixes
2024-03-31 10:49:34 -04:00
John Fernandez 055cc6e4c8 Merge pull request #4210 from JohnAFernandez/Team-Loadout-Editor-Possible-Rebase
QTFred Loadout Editor
2024-03-31 00:25:16 -04:00
Goober5000 e3447223eb allow game_settings options to be read in any order
The ai_profiles.tbl options can already be read in any order, so it is modder-friendly to extend this capability to game_settings.tbl as well.  This also updates the "unrecognized parameter" log statement to indicate the filename.

Note that this commit should be viewed while ignoring whitespace changes.
2024-03-30 19:37:29 -04:00
Goober5000 8b575e7a72 add checkbox to control behavior 2024-03-30 19:27:10 -04:00
Goober5000 30547ff026 check for potential issues in FRED missions
Add a routine to the sexp syntax checker that also checks for potential issues.  These are not definitive errors, but situations that might trip up mission designers.  Currently there is one issue checked: the destruction of a wing that has multiple waves and arrives from a docking bay.
2024-03-30 19:27:05 -04:00
JohnAFernandez d564329ffb Remove old TODOs and add confirmation
Copying to other team can erase a lot of progress, therefore make sure we ask for confirmation.
2024-03-30 18:16:42 -04:00
Goober5000 18c5662584 adjust ship registry checks to accommodate support ships
This does two things:

1. Fix a bug in `mission_bring_in_support_ship` that assigns an incorrect parse object index to the support ship's ship registry entry.  Since `Arriving_support_ship` is not an item of `Parse_objects`, it should not have an index.
2. Adjust the in-game join checks at the bottom of `parse_create_object_sub` to more scrupulously account for index mismatches and bounds errors, with a specific exception for the arriving support ship.
2024-03-30 16:00:04 -04:00
JohnAFernandez 534c69ee60 More dialog adjustments 2024-03-30 15:56:48 -04:00
JohnAFernandez b3bafb83b4 Remove Unused Code and Add Skip Validation 2024-03-30 14:23:52 -04:00
JohnAFernandez 9783e96207 No Shadowing and more Column Adjustments 2024-03-30 13:13:34 -04:00
JohnAFernandez 103275e488 Don't for get to save required status 2024-03-30 13:07:53 -04:00
JohnAFernandez 16ff22cce1 Add Functionality for Required Weapons 2024-03-30 12:49:48 -04:00
JohnAFernandez ef31905f3e Appease Clang by not having prefix by accident 2024-03-30 00:41:26 -04:00
JohnAFernandez 18f76652cf It's no longer crashing
And it is now updating correctly.

I don't like it but I don't want to touch it.
2024-03-30 00:38:56 -04:00
Goober5000 d3c43732fa Merge pull request #6074 from Goober5000/fast_fred_reload
speed up FRED reloading with this one weird trick
2024-03-30 00:03:41 -04:00
Goober5000 e6b2cbf900 Merge pull request #5870 from Goober5000/any_wingman_check
add a new check to the Voice Acting Manager
2024-03-30 00:03:35 -04:00
Goober5000 0267fb539c speed up FRED reloading with this one weird trick
Thanks to @notimaginative's detective work, nearly all of the FRED stalling when saving a mission can be avoided by simply not calling `model_free_all()`.  By checking a flag in `clear_mission()`, multiple situations can avoid this slowdown, including reload-after-save and import-FSM.
2024-03-29 23:34:54 -04:00
wookieejedi 218a98dde3 Merge pull request #5978 from BMagnu/shader_backwards_compat
Add runtime flag to split up the main render shader
2024-03-29 23:14:36 -04:00
JohnAFernandez f52ebc8ccb Save my progress ....
Even though it crashes and I have no idea why.
2024-03-29 20:25:59 -04:00
JohnAFernandez 88897b907c Fix Setting 2024-03-29 20:25:59 -04:00
JohnAFernandez 9ab82ae607 Adding Functionality to CombobBox 2024-03-29 20:25:59 -04:00
JohnAFernandez c01c7da121 Version 2, Adding Buttons
And fixing existing issues
2024-03-29 20:25:59 -04:00
JohnAFernandez 817fa2cd98 Save progress because this is a huge headache 2024-03-29 20:25:59 -04:00
JohnAFernandez 41be934485 Finish Polishing Regular List behavior
Also start adding many variable enabler functions
2024-03-29 20:25:59 -04:00
JohnAFernandez b870675cc9 Properly Clear list when switching modes 2024-03-29 20:25:59 -04:00
JohnAFernandez 5b3dddff4a New way of "Clearing" rows
Empty and move text instead of deleting items to avoid apparently inevitable memory bugs.
2024-03-29 20:25:59 -04:00
JohnAFernandez 8c904c36f9 Add extra allocated to newly enabled
So that items do not keep switching places.
2024-03-29 20:25:59 -04:00
JohnAFernandez c7f80725fe Fix copy paste mistake 2024-03-29 20:25:59 -04:00
JohnAFernandez 5af559d1cf Update Window size and Label names 2024-03-29 20:25:59 -04:00
JohnAFernandez d4246432d7 Make List selection update on multiselect 2024-03-29 20:25:59 -04:00
JohnAFernandez 95bc875ac2 Fix Updating the UI
The model was not updating its sending to front end list when getting new info from user input.  It would save it in the model, but not where it was sending information back to the dialog (UI).
2024-03-29 20:25:59 -04:00
JohnAFernandez 6b72772ac9 More Polishing 2024-03-29 20:25:59 -04:00
JohnAFernandez 6de2897347 Ok, making progress on fixing spinbox 2024-03-29 20:25:59 -04:00
JohnAFernandez 7a83c71b87 Starting to fix Functionality
And polish things that already work
2024-03-29 20:25:59 -04:00
JohnAFernandez 74805c83ba Make sure Usable ships make more sense 2024-03-29 20:25:59 -04:00
JohnAFernandez c9f3244268 Ok, prevent some crashes due to missing items 2024-03-29 20:25:59 -04:00
JohnAFernandez 308e2edb3e Ok, it is at least updating correctly. 2024-03-29 20:25:59 -04:00
JohnAFernandez 2baec05a55 More Linter fixes 2024-03-29 20:25:59 -04:00
JohnAFernandez bf2dbb4a02 Trying hard to fix things 2024-03-29 20:25:59 -04:00
JohnAFernandez 228a8994ee Appease linters
Remove unused variables
2024-03-29 20:25:58 -04:00
JohnAFernandez fe2561c893 Fixn 2024-03-29 20:25:58 -04:00
JohnAFernandez ee73fadad1 Get the code to compile at least 2024-03-29 20:25:58 -04:00
JohnAFernandez d75e4e46ab A good chunk of further fixes 2024-03-29 20:25:58 -04:00
JohnAFernandez 2d90756fed Gotta keep chipping away at the boulder 2024-03-29 20:25:58 -04:00
JohnAFernandez 807e416ebb Why yes, there's tons more errors 2024-03-29 20:25:58 -04:00
JohnAFernandez b8bb4d445b Fix some compilation errors 2024-03-29 20:25:58 -04:00
JohnAFernandez f0f57bf576 Remove duplicate function definitions 2024-03-29 20:25:58 -04:00
JohnAFernandez 8b081bf2ed Fix no class declaration 2024-03-29 20:25:58 -04:00
JohnAFernandez 1f034209d0 Fix incomplete line 2024-03-29 20:25:58 -04:00
JohnAFernandez cef7abb1db Disable Reset Lists 2024-03-29 20:25:58 -04:00
JohnAFernandez d9909e2a21 Cleaning out further functions to fit new paradigm. 2024-03-29 20:25:58 -04:00
JohnAFernandez 90097293cb Refactor UpdateUI() to reflect new UI structure 2024-03-29 20:25:58 -04:00
JohnAFernandez c2aa94bdde Properly update list widgets 2024-03-29 20:25:58 -04:00
JohnAFernandez 404a8c9bb7 Cleaning things up a little 2024-03-29 20:25:58 -04:00
JohnAFernandez 209583b449 Save changes.
Still plenty to do to finish converting.
2024-03-29 20:25:58 -04:00
JohnAFernandez 5c746f13a6 Pretty Much Completely Redone 2024-03-29 20:25:58 -04:00
JohnAFernandez dae99e5b80 Also, add add/remove to ui file 2024-03-29 20:25:58 -04:00
JohnAFernandez e5f0b674b5 Rearrange Editor to use add/remove
More edits to follow ...
2024-03-29 20:25:58 -04:00
JohnAFernandez eebc2bfd59 Fix 2024-03-29 20:25:58 -04:00
JohnAFernandez 7eb64e59bb Fixes 2024-03-29 20:25:58 -04:00
JohnAFernandez 7db278410c A little more cleanup 2024-03-29 20:25:58 -04:00
JohnAFernandez ed4d187365 Getting Close hopefully to properly functioning 2024-03-29 20:25:58 -04:00
JohnAFernandez 1bbcdc3dc5 Finish the Loadout Dialog
Finished the Model And Dialog files for the Loadout Editor
2024-03-29 20:25:57 -04:00
JohnAFernandez c36551fbd6 Edits to the Dialog for Clarity. Conciseness
In preparation for writing the model and dialog cpp and h files

And a quick rename

Don't need these

done
2024-03-29 20:25:57 -04:00
Goober5000 6f94d67cfa Merge pull request #6063 from Goober5000/sexp_boolean
allow boolean and numeric scripted SEXPs to return special values
2024-03-26 15:18:07 -04:00
Goober5000 0ffd9bc421 Merge pull request #6067 from Goober5000/fix_fix_missile_detonation
fix fixed-missile-detonation
2024-03-26 15:15:11 -04:00
Goober5000 4899e6454e Merge pull request #6066 from Goober5000/override_submodel_impact
add "override submodel impact" subsystem flag
2024-03-26 15:15:03 -04:00
John Fernandez 8f6f6ab970 Merge pull request #6070 from Baezon/fix-anim-directions
Fix an issue with animation directions
2024-03-25 22:48:58 -04:00
Asteroth 3388341343 fix an issue with animation directions 2024-03-25 20:58:22 -04:00
Asteroth e65803b747 add bad-rearm-time sexp 2024-03-25 20:13:16 -04:00
Goober5000 197356077d fix fixed-missile-detonation
The logic to handle the `$Fixed Missile Detonation:` flag missed an important case: subsystems with concave hull geometry but without destroyable submodels.  The original flag was tested on a bowl-shaped turret, which could be destroyed.  However the bowl-shaped engine on the SSG Rahu was susceptible to the same detonation problem.  By changing the check to always use the radius, whether obtained from a submodel or from the subsystem, the flag fixes the detonation in both cases.
2024-03-25 16:02:30 -04:00
Goober5000 168d3c9ddf add "override submodel impact" subsystem flag
With the `$Damage Impacted Subsystem First:` game_settings flag, weapons will damage submodels over subsystems, even if the subsystem is closer.  Yet occasionally this is not the correct behavior (e.g. for the Rahu's engines).  The new subsystem flag allows this behavior to be selectively overridden.
2024-03-25 15:49:52 -04:00
Goober5000 55ead5c2c6 Merge pull request #6065 from Goober5000/6014_followup
additional lighting fixes
2024-03-25 14:05:09 -04:00
Goober5000 db8a3651cd additional lighting fixes
Fix a minor oversight from #6014; in the ship lab, there are sometimes no suns at all, so remove the assertion.  The lighting check is only needed for supernovas anyway, so make that clear.

Additionally, add further clarification for the distinction between suns, lights, and variables used only for the supernova.  Finally fix one more sun/light discrepancy that escaped notice from #6014.

Fixes an assertion in the ship lab.  Follow-up to #6014.
2024-03-25 13:33:21 -04:00
Mike Nelson 620afa0c1e Cockpit fov option (#5924)
* add cockpit fov to in-game options and use a define for the default fov value for both fov options

* Add a controlling toggle option

* constexpr

* localization
2024-03-25 07:28:24 -04:00
Mike Nelson 7fdcd4abc7 Basic implementation of some audio options in-game (#5927)
* Basic implementation of some audio options in-game

* Unused param

* do localization
2024-03-24 21:46:02 -04:00
John Fernandez 18394f7074 Merge pull request #6061 from MjnMixael/fix_api_debrief
Don't init the debrief ui in API mode
2024-03-24 14:55:14 -04:00
Goober5000 897e388d1c allow boolean and numeric scripted SEXPs to return special values
This adds the special SEXP return values (SEXP_KNOWN_TRUE, SEXP_NAN, and so forth) as enums, and adds code to intercept these enums if they are returned where the code would normally expect a boolean or number.  If an enum is found, it is converted to its special return value equivalent.

With this change, a script can end a function with `return SEXP_KNOWN_TRUE` or similar.  No other API changes are needed; in particular, no special `$Return Type:`s are needed.

Implements #5959.
2024-03-23 23:35:36 -04:00
mjn-mixael 8bde63a9ae Don't init the debrief ui in API mode 2024-03-23 14:42:22 -05:00
Goober5000 f021e9df8a Merge pull request #6060 from Goober5000/fix_std_move_crash
fix crash caused by using a moved variable
2024-03-23 13:09:14 -04:00
Goober5000 4a1d794a64 fix crash caused by using a moved variable
In #5894, in the `add_dynamic_sexp` function in sexp_lookup.cpp, a call to `sexp->getHelpText()` was moved to the bottom of the function.  Normally this would be fine, except that this occasion caused the `sexp` variable to be accessed after a `std::move`.  The crash can be avoided by moving the last access of the `sexp` variable just a little bit earlier.
2024-03-23 02:04:48 -04:00
Goober5000 fecb9b16af Merge pull request #6014 from Goober5000/sun_light_index_fixes
fix a few lighting bugs
2024-03-22 15:58:42 -04:00
Goober5000 aa12ec7790 add skybox alpha, and add scripted functions for alpha and orientation
This allows the skybox orientation and alpha to be accessed and changed through Lua virtvars, and also adds a sexp to change the alpha.

Unfortunately, changing the alpha has no perceptible effect on the skybox.  This will need the attention of a graphics coder to figure out what might need updating.
2024-03-22 13:23:05 -04:00
John Fernandez 7e637d5d5a Merge pull request #5893 from JohnAFernandez/Fix-Coverity-Time-T-issues
Fix coverity time t issues
2024-03-22 12:16:29 -04:00
John Fernandez ff5bc2f6a0 Merge pull request #5894 from JohnAFernandez/Coverity-Reference-Issues
Coverity: Change many auto calls to const auto& to avoid unnecessary copies.
2024-03-22 12:09:34 -04:00
John Fernandez c08a669c2e Merge branch 'scp-fs2open:master' into Fix-Coverity-Time-T-issues 2024-03-22 11:51:27 -04:00
John Fernandez 03f6f09c93 Merge branch 'scp-fs2open:master' into Coverity-Reference-Issues 2024-03-22 11:50:46 -04:00
Mike Nelson 74c2a204c7 API to get the PXO urls (#6054)
* API to get the PXO urls

* whitespace
2024-03-22 08:30:33 -04:00
Goober5000 a9ad87ea08 Merge pull request #6023 from Goober5000/preload_weapon_create
add weapon preloader
2024-03-21 14:25:48 -04:00
Goober5000 0a86623e9e Merge pull request #6056 from Goober5000/fix_ai_path_update
update Fix_ai_path_order_bug for new waypoint options
2024-03-21 13:24:41 -04:00
Goober5000 2f957668e3 update Fix_ai_path_order_bug for new waypoint options
When waypoint start index and direction were added in #5698 / 42fc989 et seq., the `Fix_ai_path_order_bug` flag needed to be updated to account for those new options.  This fixes that.

Fixes #6052.
2024-03-21 00:13:05 -04:00
Goober5000 38d9a975ce Merge pull request #6055 from Goober5000/shipB_submodel
add ShipBSubmodel to ship collisions
2024-03-20 22:52:01 -04:00
Goober5000 f26643c43d add ShipBSubmodel to ship collisions
Since the On Ship Collision hook can potentially be called twice, with the ships reversed, it is necessary for both parameters to have submodels specified.  Otherwise +Override would not be able to handle both cases.

Followup to #6035.
2024-03-20 21:15:33 -04:00
Mike Nelson c2cb07ded3 Allow skipping using retail mainhall defaults (#6042) 2024-03-18 07:40:49 -04:00
Goober5000 7a04f76a46 Merge pull request #6049 from Goober5000/gr_string_size
add getStringHeight and getStringSize
2024-03-17 19:55:31 -04:00
Goober5000 006d2a49b1 Merge pull request #6050 from Goober5000/hud_high_contrast
add a HUD virtvar for contrast
2024-03-17 19:55:20 -04:00
Goober5000 a281f35f1a add a HUD virtvar for contrast
Adds a hu.HUDHighContrast virtvar.  Also renames `HUD_contrast` to `HUD_high_contrast` for clarity and makes it a boolean.
2024-03-17 16:18:02 -04:00
wookieejedi 88f7e41d8c Add AI Flag to align to target when guarding stationary ship (#6047)
* Add AI Flag to `align to target when guarding stationary ship`

When a ship is ordered to guard another ship that is stationary and not incredibly large, the AI will fly to a position then turn and face away from the targeted ship. This behavior is not ideal in various scenarios, including both blockade style formations and overall visuals.

The PR adds a flag that tells the AI to align to the target ship it is guarding once the AI has reached it's guarding position in this situation, which allows all the guarding ships to have the same orientation and look much better and work better for directional defenses.

Tested and works as expected. Also changed some `NULL` to `nullptr` in this function for cleanup.

* remove duplicate brackets
2024-03-17 08:16:55 -04:00
Goober5000 f2998a2c69 add getStringHeight and getStringSize
We already have `gr.getStringWidth()`, but these functions are useful too.
2024-03-16 21:15:40 -04:00
Mike Nelson 1b0a3ea6f9 Default framebuffer effects to off (#6046) 2024-03-16 21:14:22 -04:00
Mike Nelson 5e274a008c Add lua function to validate a string as a valid IP (#6043) 2024-03-16 21:14:00 -04:00
Mike Nelson 38be5c248c Convert multi team chat to use a struct/list setup (#5850)
* convert multi team chat to use a struct/list setup

* use the correct array size define

* cleanup local vars & Asserts

* address feedback

* remove uncessary if
2024-03-16 11:10:09 -04:00
Mike Nelson 0450ef0d1a Fix multi option virtvars so they can be read without being set (#6044) 2024-03-16 08:14:19 -04:00
Mike Nelson e6a2a2a7f9 Fix retail options not saving (#6020)
* Make sure retail options are saved properly when Using_in_game_options is true

* don't need this
2024-03-15 15:43:45 -04:00
Goober5000 bbb6a6f199 Merge pull request #6016 from Goober5000/sexp_help_tweak
fix help descriptions for string-greater-than and string-less-than
2024-03-15 13:22:21 -04:00
Goober5000 1c0b58e11b Merge pull request #6041 from Goober5000/support_ship_sexp_update
improve set-support-ship description
2024-03-15 13:19:40 -04:00
Goober5000 0bf0735cd9 Merge pull request #6034 from Baezon/scripted-model-arcs
Add scripted model 'lightning' arcs
2024-03-15 13:03:34 -04:00
Goober5000 cc3791b594 improve set-support-ship description
Per Durandal, a few attributes of this SEXP can be documented a little better.
2024-03-15 13:00:25 -04:00
John Fernandez 799906a921 Merge pull request #6040 from MjnMixael/default_postproc_on
Default post processing to on because so many things require it
2024-03-14 19:45:54 -04:00
mjn-mixael 043e3fab79 Default post processing to on because so many things require it 2024-03-14 17:23:58 -05:00
Mike Nelson 2e34c29215 Scpui multi pxo api (#5845)
* multi pxo api

(cherry picked from commit 9af26da728a19b9d6c890968a314e8e56ecc1ddf)

* multi pxo help api

(cherry picked from commit f4df704576ddb648e9c486907b07ae172c859feb)

* minor fixes

* not extern

* break out chat message data into a table

* address some feedback

* return empty strings if not in multi

* use GetChannelByUser() instead

* once more with feeling

* correct documentation
2024-03-13 15:23:44 -04:00
Goober5000 8ac68c5b8b make the percent operators correctly return KNOWN_FALSE when they are known false 2024-03-13 14:03:32 -04:00
Goober5000 b92f50e94f add percent-ships-scanned
Kind of surprised this SEXP operator hasn't been added before now.  It complements the existing percent-X operators in the Objectives category.

Also, this fixes and clarifies the help documentation for the various percent-X operators.
2024-03-13 12:05:35 -04:00
Goober5000 96228d6e98 Merge pull request #5937 from Goober5000/some_parse_upgrades
some parse upgrades
2024-03-13 12:04:56 -04:00
Asteroth dc4daafd61 fix for a merge mistake 2024-03-12 15:39:00 -04:00
Asteroth 4b37796628 Merge remote-tracking branch 'upstream/master' into scripted-model-arcs 2024-03-12 15:38:13 -04:00
Goober5000 45a434a60a some parse upgrades
Turn `Parse_names` into a vector and add SCP_string overloads of ship registry functions.  Refactor calling code to use registry as appropriate.  Remove an unused overload of `mission_parse_get_parse_object`.
2024-03-12 14:30:07 -04:00
Asteroth 488ec8d5a8 review tweaks 2024-03-12 13:50:38 -04:00
Goober5000 b1460eb3fa Merge pull request #6035 from Goober5000/submodel_collision
enhancements for submodel collisions
2024-03-12 13:42:41 -04:00
Goober5000 671fe21a75 additional collision info
* Add the submodel that was hit to the On Ship Collision scripting hook.  (This will only be non-nil if the ship was the "heavy object".)
* Add a `getModel()` function to the scripted submodel object.
* Fix some incorrect documentation in `OnShipCollision`.
2024-03-12 13:02:58 -04:00
Goober5000 d6606ad642 enhancements for submodel collisions
* Expose NoCollide and NoCollideThisOnly as virtual variables for submodels
* Allow submodels to be optionally specified in object:checkRayCollision
* Be sure to calculate ship-to-ship hit position before the override collision hook is called, in case the hook needs this value.  (The other collision hooks already calculate the hit position before the override hook.)
2024-03-12 13:02:57 -04:00
Taylor Richards d9b2b428a0 remove Docker setup for standalone servers (#6036) 2024-03-12 09:02:34 -04:00
Asteroth e87fcfaf28 add player orders afterburn hard flag (#6019) 2024-03-11 09:25:22 -04:00
Joshua Glatt 65d1b7f99a Handle container data correctly with eval_num() (#6031) 2024-03-10 21:33:58 -07:00
Joshua Glatt 712337a2da fix crash when right-clicking on container modifier (#6030) 2024-03-10 08:12:14 -07:00
Asteroth b9169cc425 add some real docs 2024-03-09 21:27:32 -05:00
Asteroth b7a0124a9b limit damge and emp arcs 2024-03-09 14:00:16 -05:00
Asteroth 27925607b8 add scripted model arcs 2024-03-09 12:46:34 -05:00
Mike Nelson 38d8f17990 Fix message api out of bounds check (#6013) 2024-03-09 11:35:09 -05:00
Mike Nelson 5143855863 Add opf custom string as a lua sexp return type (#5964)
* add opf custom string as a lua sexp return type

* maybe just return the table directly

* break statement
2024-03-08 14:03:43 -05:00
Mike Nelson 648a1d009d Lua method to get the number of object sounds that can be used in tandem with removeSoundByIndex() to effectively silence a ship (#5958) 2024-03-07 21:42:31 -05:00
Goober5000 df531fc595 Merge pull request #6006 from Goober5000/lua_invalid_returns_nil
allow invalid arguments to be nil
2024-03-07 21:32:13 -05:00
Taylor Richards 5802f718f6 clean up and update macOS bundle info (#6028)
- Set app name properly per Apple docs
 - Use correct "FreeSpace Open" name
 - Set version properly per Apple docs
 - Add bundle identifier
 - Update copyright date
 - Remove localized strings since they are all English already
2024-03-06 05:22:59 -05:00
Mike Nelson 7d62d741b9 expose parse skip_to_string (#5936) 2024-03-05 10:48:51 -05:00
Mike Nelson 45258aabb4 allow ba.xstr to lookup from strings.tbl (#5949) 2024-03-05 10:42:29 -05:00
Goober5000 db34b4d53c Merge pull request #5987 from Goober5000/misc_timestamps
make several miscellaneous timestamps type-safe
2024-03-05 00:05:04 -05:00
Mike Nelson 7c2077baf2 Code to check if a medal is rank or badge (#5934) 2024-03-04 07:46:19 -05:00
Mike Nelson eef7623e9f Push back instead of direct assignment (#6024)
* push back instead of direct assignment

* remove i
2024-03-04 18:08:00 +09:00
Goober5000 529ac05034 add a useful function 2024-03-03 11:47:28 -05:00
Goober5000 6ac8559630 Lafiel's template magic to treat all invalid objects as nil 2024-03-03 11:47:28 -05:00
Goober5000 2626e7862b allow invalid arguments to be nil
A design choice very early in FSO's scripting development established that invalid results return invalid objects.  By using a game_settings.tbl flag, this allows invalid results to return nil instead.
2024-03-03 11:47:28 -05:00
John Fernandez b3cd35258c Merge pull request #5849 from MjnMixael/listify_active_games
Make Active_games_head an SCP_list
2024-03-03 11:01:55 -05:00
Goober5000 0fb12b89eb Merge pull request #6012 from Goober5000/more_composition_h
scripting refactor to compose handle types
2024-03-03 10:58:39 -05:00
Mike Nelson c082babd9c Allow lua to lock/unlock cutscenes (#5928)
* allow lua to lock/unlock cutscenes

* fix issue from rebase
2024-03-03 10:48:06 -05:00
Goober5000 d5f3be091c add weapon preloader
`ship-create` has had a preloader for many years, but `weapon-create` and `beam-create` did not.  This remedies that.
2024-03-02 21:25:24 -05:00
wookieejedi 790227a2bf Fix CTD with HUD Preset Switching (#6022)
* Fix CTD with HUD Preset Switching

After #5302 it was discoved that pressing the `Next` button in the HUD presets would cause a CTD.

Thanks for Lafiel for figuring this out
`If HC_current_file is HC_preset_filenames.size() - 1, then it'll oob on a vector access.`

Testing this PR fixes that crash.

* use static cast
2024-03-02 18:20:02 +00:00
Goober5000 803f08f969 Merge pull request #5992 from MageKing17/cleanup/iff-modular-special-colors
Change special IFF color `#define`s into `extern int`s.
2024-03-02 11:36:17 -05:00
Goober5000 f2c40a2669 Merge pull request #5971 from JohnAFernandez/Fix-QT-FRED-Command-Briefing
Fix "missing" command brief data
2024-03-02 11:35:47 -05:00
Goober5000 63756c00af add extra ways to modify background elements in missions (#6005)
* add extra ways to modify background elements in missions

This adds Lua API methods for getting suns and bitaps by index, as well as modifying their scale and position.  This removes the need to completely add and remove a background element that only needs to be modified.

* big pruning of (int) casts
2024-03-02 11:24:58 -05:00
Goober5000 2147571dff make several miscellaneous timestamps type-safe
Trail timestamps and a few top-level timestamps.  Also a few `static` and `constexpr` keywords for good measure.
2024-03-02 00:10:31 -05:00
Goober5000 bb9c76103b Merge pull request #5997 from ferralverrall/user/joverral/subsystem_under_reticule
allow targeting subsystems on already targeted ship under reticule
2024-03-01 15:33:12 -05:00
Goober5000 857e61f638 Merge pull request #5956 from Goober5000/coverity_1
several coverity fixes
2024-03-01 15:33:05 -05:00
Goober5000 58053a02b2 several coverity fixes
Some false positive annotations, some range checks, and commenting dead code.
2024-03-01 13:47:00 -05:00
BMagnu e8ea8733d0 Animation Drivers for Cockpits (#5925)
* Add control_info driver sources

* Properly deal with cockpits and their 'objnum's

* Add driven animation sets to weapons and cockpits

* enumify objnums
2024-03-01 10:03:27 +01:00
Goober5000 184bbb52bb Merge pull request #5974 from Goober5000/coverity_casts
use C++ casts for floating.h and floating.cpp
2024-02-29 20:23:05 -05:00
Goober5000 b00410ab01 Merge pull request #5967 from Goober5000/bitstring_poofs
bitstring poofs
2024-02-29 01:22:50 -05:00
Goober5000 525d8e34d0 Merge pull request #5950 from Goober5000/has_time_elapsed_msecs
add a has-time-elapsed-msecs SEXP
2024-02-29 01:22:37 -05:00
Goober5000 4cdf10b399 Merge pull request #6018 from Goober5000/another_isValid_fix
another isValid fix
2024-02-28 14:10:27 -05:00
Goober5000 c652d5a84c another isValid fix
Another #6009 follow-up, this one from PR #5935.
2024-02-28 12:51:49 -05:00
Goober5000 1a356834b4 Merge pull request #5998 from Goober5000/allow_resetting_ship_type
allow a ship class's type to be set more than once
2024-02-28 12:40:46 -05:00
Goober5000 3f48f7c4ad Merge pull request #5944 from Goober5000/implement_5941
allow finer control of particle rotation randomization
2024-02-28 12:39:13 -05:00
Goober5000 3e8a9d9738 Merge pull request #5935 from Goober5000/ship_to_parsed_ship_api
connect ship and parsed ship in Lua API
2024-02-28 12:39:03 -05:00
Goober5000 592eefb60f scripting refactor to compose handle types
Several handle types in the scripting API used inheritance where composition would be more appropriate.  This refactors those types, as well as removing the various handle types that were just aliases for `model_h`.  These are just the C++-side types; all the Lua types remain as-is.

This also refactors `sound_h` to move the previous `isSoundValid` to `isValid` so that `ade_set_args` will work properly for sounds with the `Lua_API_returns_nil_instead_of_invalid_object` flag.  The subclassing from `sound_entry_h` was removed and the "full validity check" was moved to `isValidWithEntry`.  The Lua side remains unaffected, but additional documentation was added to clarify the usage.

Follow-up to #6009 and prerequisite to #6006 due to the `isValid` refactor for `sound_h`.
2024-02-28 02:51:08 -05:00
Goober5000 373218d7d9 fix help descriptions for string-greater-than and string-less-than 2024-02-28 02:50:41 -05:00
Goober5000 1bdd6c3c4c Merge pull request #6015 from Goober5000/reconcile_isValid
reconcile isValid between PRs
2024-02-28 02:45:59 -05:00
Goober5000 1313434e11 reconcile isValid between PRs
PRs #6009 and #5995 passed CI checking independently of each other, but compilation broke after merging.  This patches things.
2024-02-28 02:01:30 -05:00
Goober5000 bf996313dc Merge pull request #6009 from Goober5000/isValid_refactor
isValid refactor
2024-02-28 01:41:42 -05:00
Goober5000 2eb5a3ecde Merge pull request #5993 from MageKing17/bugfix/ssm-random-count-fix
Fix SSM strikes with a variable count.
2024-02-28 00:04:06 -05:00
Goober5000 1aee2401e5 fix a few lighting bugs
There was confusion in the lighting code between light indexes and sun indexes.  These are usually the same, but not always.  This makes several changes to fix light/sun handling.

1. Clarify the distinction between lights and suns and add a `sun_index` field
2. Add a flags field and assign the `dual_cone` boolean to it, as well as a new glare flag
3. Determine light glare by checking the light flag, not the sun (which never worked in the first place as the `stars_sun_has_glare` function checked bitmaps rather than suns)
2024-02-27 20:21:42 -05:00
Goober5000 f8203e9da3 Merge pull request #5995 from Goober5000/ship_arrival_functions
cover all stages of ship warping in the Lua API
2024-02-27 13:14:13 -05:00
Goober5000 b24bcbcc62 Merge pull request #5886 from Goober5000/is_in_mission_update
make is-in-mission work for wings
2024-02-27 13:13:52 -05:00
Goober5000 0b8c1b6853 Merge pull request #5933 from Goober5000/for_subsystem
add for-subsystems
2024-02-27 13:13:43 -05:00
Goober5000 6ae6c550a7 Merge pull request #6001 from Goober5000/parse_object_team
add Team virtvar to parse objects
2024-02-27 13:12:13 -05:00
Mike Nelson 9c521d04d8 Retail ingame options (#5895)
* Create the ingame options game state

* Base working version of in-game options

* Cleanup + Optimization

* Localization pass

* more cleanup + documentation

* tooltips on option hover

* documentation and better inbounds check

* match case

* format strings instead of direct strings

* unused parameter

* address feedback

* localization id conflict with master

* Add this line back in

* pass the new option flags as well

* resolve xstr id conflict
2024-02-27 13:09:34 -05:00
Goober5000 c6c9945e50 check objh specifically for validity 2024-02-27 12:19:04 -05:00
mjn-mixael 8dfeca4ac3 address feedback 2024-02-26 22:30:59 -06:00
mjn-mixael bb4898cb04 assertion error 2024-02-26 22:30:59 -06:00
mjn-mixael 6e38656658 Convert Active_games_head to an SCP_list to prepare for the SCPUI API 2024-02-26 22:30:59 -06:00
Goober5000 e72dd4c2ca Merge pull request #6007 from BMagnu/collision_4096_fix
Fix broken collision pair caching
2024-02-26 19:23:40 -05:00
Goober5000 be8725c6c6 change isSubsytemValid to isValid 2024-02-26 16:19:53 -05:00
Goober5000 15c921223b compose object_h within the structs/classes that use it 2024-02-26 16:19:53 -05:00
Goober5000 ec241fcab3 standardize on isValid() and make validity member functions const 2024-02-26 15:56:41 -05:00
Birk Magnussen 0e00ab670c Add comment on MAX_OBJECTS 2024-02-26 21:07:37 +01:00
Birk Magnussen 1f9a2ca4ce Increase collision pair cache bitshift 2024-02-26 20:53:46 +01:00
Goober5000 0d697672dc Merge pull request #5943 from Goober5000/fix_time_to_goal
fix time-to-goal edge cases
2024-02-26 12:56:05 -05:00
Goober5000 1fe62ea8d1 Merge pull request #5996 from Goober5000/fix_ship_name_in_use_bug
fix "this ship name is already in use" bug
2024-02-26 12:26:15 -05:00
Goober5000 687694c732 Merge pull request #5884 from Goober5000/str_wrap_followup
str_wrap_to_width followup
2024-02-26 12:19:45 -05:00
Goober5000 9093af9b95 Merge pull request #5881 from Goober5000/hud_gauge_filename
add method for determining whether the HUD is hi-res
2024-02-26 12:19:37 -05:00
Goober5000 3b0dca6cd9 Merge pull request #6003 from Goober5000/version_24_1
bump version to 24.1
2024-02-26 03:03:48 -05:00
Goober5000 817b7dc975 bump version to 24.1 2024-02-26 00:49:25 -05:00
Goober5000 d4d7c8dbd2 add Team virtvar to parse objects
Previously, Team was an attribute available on ships, but not parsed ships.
2024-02-22 23:08:59 -05:00
Goober5000 bb89553b0a allow a ship class's type to be set more than once
There was an extra check during ship class parsing that prevented a ship class's type from being set if it had been set already.  This dates back to commit 5f3a6ec7 and was added as a parsing safeguard rather than as part of any modular table checks.  Since the parsing has changed, this extra check is no longer applicable.  Removing the check allows a ship class with a different type to be created using an existing ship class as a template.
2024-02-21 22:05:34 -05:00
joverral e4acd15a1e fix the string too! 2024-02-21 16:48:53 -08:00
joverral d16f46fb1c name change per feedback 2024-02-21 16:42:30 -08:00
joverral 77ad3ba0aa Fixes per feedback 2024-02-21 10:25:52 -08:00
Goober5000 da31995331 fix "this ship name is already in use" bug
This rather insidious FRED bug was all down to an improper check for the current ship.  It is possible for multiple objects of different types to be selected at the same time.  If, for example, a waypoint and ship are selected, and the waypoint was selected first, the waypoint will be what `cur_object_index` refers to.  Since the ship is the one and only ship selected, it will be what `single_ship` refers to.  Therefore, to avoid flagging its own ship name as a duplicate, the loop should exclude the single ship, not the current object.

The bug can be reliably triggered by selecting a waypoint, then adding a ship to the selection, then switching the focus to another application and back to FRED.  This finally squashes the bug.
2024-02-21 02:00:06 -05:00
joverral 25d326567e allow targeting subsystems on already targeted ship under reticule 2024-02-20 18:07:13 -08:00
Goober5000 03696d07ca cover all stages of ship warping in the Lua API
This improves the ability of Lua to check for ship arrival status:

1. Deprecates the `isWarpingIn` function, which can be misleading, and replaces it with the equivalent `isWarpingStage1`
2. Adds an `isWarpingStage2` function to fill a gap in functionality
3. Adds an `isArrivingWarp` function (complementing the existing `isDepartingWarp` function) to cover both stage 1 and stage 2
2024-02-19 22:08:15 -05:00
MageKing17 0528538a6f Fix SSM strikes with a variable count.
In #2464, a somewhat hard-to-understand equation involving taking the modulo of a random number was replaced with a function that would do those calculations instead. The problem is that the function performed the *entire* formula, while the code it replaced was only operating on the *difference* between the two numbers. Fortunately, this is as easy to fix as changing a `+=` into just an `=`.
2024-02-19 01:02:11 -08:00
MageKing17 3a48613a2d Add some security to avoid invalid Random::next() calls. (#5988)
There were a few instances of `Random::next()` being called without ensuring its arguments couldn't trip an assertion. This should hopefully catch them all.
2024-02-14 15:03:51 -05:00
MageKing17 a7b795e965 Change special IFF color #defines into extern ints.
Before this commit, `IFF_COLOR_SELECTION`, `IFF_COLOR_MESSAGE`, and `IFF_COLOR_TAGGED` were hardcoded indices into the `Iff_colors` vector. This could cause problems if any of these three colors were set to the same RGB values (since `iff_init_color()` doesn't create a new entry if the color already exists in the vector), and if a modular table tried to change any of these colors nothing would happen (since it would just create a new entry in `Iff_colors` without doing anything to the hardcoded indices).

This commit instead changes the `#define`s into `extern int`s, and assigns the return value of `iff_init_color()` to those global variables upon parsing the special color values, meaning that any combination of the three can be set to the same color without causing issues, and modular tables can actually modify them.

Potential clutter from unused values in the `Iff_colors` vector is basically unchanged (technically slightly worse if a modular table overrides any of these special colors with a color that doesn't already exist in the vector), but should maybe be looked at in the future.
2024-02-13 13:51:09 -08:00
Goober5000 99875810c6 Merge pull request #5986 from Goober5000/24_0_RC2_edits
edit the release template
2024-02-11 01:53:27 -05:00
Goober5000 13420121dd edit the release template
A bit of wordsmithing and link updating for the release thread.
2024-02-10 00:34:28 -05:00
Goober5000 26c5152d4a Merge pull request #5985 from Goober5000/pof_file_valid_fname_checks
make model file checks consistent
2024-02-09 17:24:08 -05:00
BMagnu 5066e498a3 Virtual POF fixes (#5984)
* Fix wrong filename being used

* Fix replacement map not used for collision check

* Fix poly count and incorrect submodel numbers
2024-02-09 23:10:39 +01:00
Goober5000 4bf806c485 make model file checks consistent
The general expectation is that model filenames can be specified as 'none' or '<none>' for no model, but as discovered by no tea, this was not consistent across the code base.  For example, `$Model File: none` was handled as expected but `$External Model File: none` was not.  This PR makes the handling consistent for all ship, weapon, and shockwave POF files, and also adds some extra checks when models are loaded.
2024-02-09 17:00:45 -05:00
Goober5000 2403f13483 Merge pull request #5983 from Goober5000/fred_popup_enhancement
fix FRED's "new object type" popup
2024-02-09 00:29:52 -05:00
Goober5000 8e98cddd6e Merge pull request #5982 from Goober5000/issue_5980
address issue 5980
2024-02-08 12:56:54 -05:00
Goober5000 30cabc4174 fix FRED's "new object type" popup
1. Fix the item ID indexing on the popup submenus and make sure they correspond with the ship dropdown menu
2. Remove the "player start" popup menu option as it has very limited utility and was already removed in qtFRED
3. Reduce a bunch of casts by using more appropriate popup menu types
4. Actually place an object in the mission when one is chosen from the popup menu

Also:
1. Remove the `Default_player_model` variable as its use is redundant
2. Remove unused arguments of `create_player()`
2024-02-08 03:26:25 -05:00
Goober5000 8a3b36d921 uncorrect angles if we're saving without the corrected angles flag (which will happen if the save format isn't STANDARD) 2024-02-07 22:51:37 -05:00
Goober5000 b74824f793 use a different method for removing blank backgrounds 2024-02-07 18:27:52 -05:00
Goober5000 6a26ca5061 only display these warnings once, and only on explicit save 2024-02-07 18:27:52 -05:00
Goober5000 9b78fad1c5 address feedback 2024-02-07 15:29:13 -05:00
John Fernandez d34570ae90 Merge pull request #5979 from MjnMixael/fix_select_zoom
Unhardcode renderSelectModel zoom value
2024-02-06 23:40:41 -05:00
mjn-mixael a0f4c4d2b3 documentation error 2024-02-05 16:20:33 -06:00
mjn-mixael 63990c54a9 unhardcode zoom value 2024-02-05 16:14:07 -06:00
Goober5000 6593565165 Merge pull request #5976 from notimaginative/fix_cmdline_mod_on_unix
refactor unix modlist handling to fix serveral issues
2024-02-05 17:00:59 -05:00
Goober5000 af93922ba5 Merge pull request #5975 from notimaginative/fix_chdir_bug
fix error handling in cfile_push_chdir()
2024-02-05 17:00:47 -05:00
Birk Magnussen 6ca68151a1 Remove Compiler Warning 2024-02-05 19:23:55 +01:00
Birk Magnussen f61407d899 Introduce shadow map amd optimization 2024-02-05 19:22:33 +01:00
Birk Magnussen 86ef5c356e Optimize uniforms 2024-02-05 19:22:33 +01:00
Birk Magnussen a127a35eee Optimize inter-stage data 2024-02-05 19:22:33 +01:00
Birk Magnussen 2a6c14d3b5 Make it properly configurable 2024-02-05 19:22:33 +01:00
Birk Magnussen 4f28615c6c Set flags correctly 2024-02-05 19:22:33 +01:00
Birk Magnussen 46408cce3a Conditionally set shader flags at run or compiletime 2024-02-05 19:22:33 +01:00
Birk Magnussen 3f1e67330c Large shader capability 2024-02-05 19:22:32 +01:00
Birk Magnussen e16ae385fa Predefine system 2024-02-05 19:22:32 +01:00
Birk Magnussen 2e90c8eed6 Conditional shader includes 2024-02-05 19:22:32 +01:00
Birk Magnussen da352c3eea Refactor gr_capability 2024-02-05 19:22:32 +01:00
Fabian Woltermann daeb1a7940 Merge pull request #5977 from BMagnu/shadow_map_ifdef
Fix faulty / missing optimization for AMD shader compilation
2024-02-05 18:34:08 +01:00
Birk Magnussen f56cbc59f1 improve shader for shadow map generation 2024-02-05 14:43:54 +01:00
Taylor Richards 79418a073d use proper SCP types 2024-02-05 00:04:34 -05:00
Goober5000 ce2e165510 Merge pull request #5962 from Goober5000/warp_duration_fixes
fix warp time durations
2024-02-04 23:49:15 -05:00
Goober5000 e9ee311709 fix warp time durations
Properly set the warp durations when ships arrive and depart, so that the warp animation can open and close smoothly without any discontinuities.
2024-02-04 23:30:22 -05:00
Taylor Richards 7576d4f2fe refactor unix modlist handling to fix serveral issues
The result of this special parsing should produce a mod string identical
to the string passed on the command line with the following exceptions:
  directory name case, directory separators

Should address the following:
 - no fundamental difference in modlist compared to Windows
 - no errors or warnings that are not produced on Windows
 - do not remove mods from list if missing
 - verify mod directory is accessible and actually a directory
 - do minimum amount of work to see if mod directory is valid
 - fix bug with trainling slashes
2024-02-04 22:08:28 -05:00
Taylor Richards 866b06ca35 fix error handling in cfile_push_chdir()
Old Volition bug where the original directory is pushed onto a stack
before the chdir() call. If that call fails then the stack is left with
a used entry that won't be removed until restart and can cause the stack
to fill up. Now it's added only if the chdir() call succeeds.

Also take the opportunity to make Cfile_stack dynamic.
2024-02-04 22:03:56 -05:00
Goober5000 f4d7b45e4d bitstring poofs
Change `Neb2_poof_flags` to use a bit string of unlimited length to allow for an arbitrary number of nebula poofs.
2024-02-04 19:07:29 -05:00
Goober5000 d23e4b8e87 use C++ casts for floating.h and floating.cpp
Change the casts used in the convenience #defines in floating.h.  Since these #defines are used pretty widely, this should reduce the count of C-style casts in the codebase by quite a bit.

Also change the casts in floating.cpp while we're at it, and remove some obsolete or unused code.
2024-02-04 18:33:25 -05:00
Goober5000 f3d15f8ddc Merge pull request #5972 from Goober5000/send_message_clarification
update sexp help for send-message
2024-02-04 15:19:10 -05:00
Goober5000 c9fe191d31 Merge pull request #5973 from Goober5000/modular_medals_fix
ensure medal information is correctly assigned
2024-02-04 15:18:53 -05:00
John Fernandez bad255fffb Merge pull request #5970 from Goober5000/sexp_exited_refinement
be mindful of death rolls when checking for ship stats
2024-02-03 23:31:01 -05:00
Goober5000 be260ef74c ensure medal information is correctly assigned
Make sure all medal fields are properly assigned.  In particular, if a modular -mdl.tbm is parsed, don't overwrite information from the base medals.tbl.  Fixes a bug reported in Discord.
2024-02-03 21:25:05 -05:00
Goober5000 0ac3d52261 update sexp help for send-message
Clarify message priorities, especially the conditions that allow High messages to be sent by Command.  Motivated by #5968.
2024-02-03 19:14:40 -05:00
John Fernandez f7df03c654 Merge pull request #5932 from Dark-Visor/sexp_ship_helps_final
Clarify which SEXPS work on ships not arrived
2024-02-03 17:14:34 -05:00
John Fernandez a7e1a27e36 Merge pull request #5963 from MjnMixael/fix_custom_string_dlg
Fix assert when adding custom strings
2024-02-03 16:03:56 -05:00
John Fernandez d83de47ef2 Fix wave filename copy. 2024-02-03 15:33:53 -05:00
JohnAFernandez 59435abfb2 fix missing command brief data
This fixes command briefing data apparently disappearing.  The ui was not being properly initialized because model_changed was being called before the ui was initialized, leading to default values.

This also fixes a few other minor issues.
2024-02-03 00:55:19 -05:00
Goober5000 ab319a631c be mindful of death rolls when checking for ship stats
In #5649 / b6c0e8b, the ship registry was updated to take ship death rolls into account.  There was one small wrinkle that it did not account for, however: SEXP operators that return numeric values had previously (i.e. before the introduction of the ship registry) checked the mission log for ship destruction, but after #5649 the EXITED status was not set until after the ship had completely exploded, resulting in certain SEXPs having their conditions slightly modified.  The equivalent of checking the mission log for ship destruction is now checking the ship status for DEATH_ROLL, so it is necessary to make that change for the numeric SEXPs to behave as they did before.

The motivating result for all this is to fix SEXPs like `hits-left` firing after a ship has been destroyed but before it has finished exploding.  This can be seen by loading the first non-training mission of FSPort and comparing the messages that are sent if you use cheats to kill Alpha 2.
2024-02-02 16:51:38 -05:00
John Fernandez 7c2950480e Merge pull request #5969 from Goober5000/fix_blink_locked_anim
fix Blink Locked Animation: option
2024-02-01 07:48:00 -05:00
Goober5000 a80bc26bfc fix Blink Locked Animation: option
Due to a copy-paste error in #4581, this option was not set properly.
2024-02-01 02:08:56 -05:00
John Fernandez ead3c62d23 Merge pull request #5966 from MjnMixael/unfocused_pause_again
Prevent compiler optimization
2024-01-30 22:22:19 -05:00
mjn-mixael 5cd502fb79 prevent compiler optimization 2024-01-30 15:26:25 -06:00
Dark-Visor 905d777e18 Update to wording of sexp helps PR
Clarify wording on SEXP helps so that it is clear whether an Event will
be evaluated or have delayed evaluation.
2024-01-30 21:12:14 +00:00
Dark-Visor 66deb83980 Clarify which SEXPS work on ships not arrived
SEXP helps should let the FREDder know whether a given ship argument
needs to be already in-mission for the SEXPression to operate. Update
the helps to include (ship needs to be in-mission) or (ship does not
need to be in-mission) or other relevant helpful information.
2024-01-30 21:12:14 +00:00
mjn-mixael de3e382180 better defense 2024-01-30 08:11:58 -06:00
mjn-mixael 0190fda7ee fix assert when adding custom strings 2024-01-30 08:11:58 -06:00
Goober5000 9651dc1598 Merge pull request #5957 from Goober5000/fix_subsystem_message
fix ship subsystem parse warning
2024-01-29 22:53:18 -05:00
Goober5000 743cf779bf Merge pull request #5961 from Goober5000/another_gravity_fix
Third gravity fix
2024-01-29 22:38:49 -05:00
Goober5000 da1e2c1049 add a new check to the Voice Acting Manager
This adds a new button to check if messages sent by `"<any wingman>"` have at least one ship with that persona.
2024-01-29 22:08:09 -05:00
Goober5000 bf13ce54a8 add method for determining whether the HUD is hi-res
Check the filenames used to initialize HUD gauges and mark the gauge as hi-res if the filename starts with 2_.  Also add a script method to return this value.

Additionally, make accessor methods `const`.
2024-01-29 22:07:54 -05:00
Goober5000 fcd3264fad implement C-str version of str_wrap_to_width 2024-01-29 22:07:37 -05:00
Goober5000 e33419c48d refactor str_wrap_to_width to use string starting offsets and lengths 2024-01-29 22:07:37 -05:00
Goober5000 a73df5bcb4 int to size_t 2024-01-29 22:07:37 -05:00
Goober5000 4e707fc8e9 make is-in-mission work for wings
Since its creation, the `is-in-mission` sexp operator has only checked for ships.  But mission designers might assume this also works for wings, leading to a situation where the sexp always returns false because no ship can have the same name as a wing.  Fortunately wing functionality can be added to this sexp without affecting ship functionality.
2024-01-29 22:07:18 -05:00
Goober5000 2e7057ed8d add for-subsystems
This is a new argument provider that lists all the subsystems of a ship, optionally restricted to one or more subsystem types.
2024-01-29 22:06:31 -05:00
Goober5000 ba9285e09a connect ship and parsed ship in Lua API
Add `getShip()` to parsed ships and `getParsedShip()` to ships to allow the two APIs to connect to one another.
2024-01-29 22:06:15 -05:00
Goober5000 138eddfbd2 fix time-to-goal edge cases
This fixes a few items that were revealed in the course of Dark Visor's SEXP documentation PR.  The EXITED status should return NAN_FOREVER, not just NAN.  The CANT_EVAL value is never returned from the sexp on account of ship status, due to the preceding check, and is not an appropriate return value anyway; so that is removed.  Finally, for a ship that can't move, the NAN return value is better than CANT_EVAL, since it represents the numeric situation more accurately and can also be checked by `is-nan`.
2024-01-29 22:05:38 -05:00
Goober5000 66be185d0c allow finer control of particle rotation randomization
This adds a new field to particle effects so that particle rotation can be configured on a per-type basis, not just on a blanket basis.  Implements #5941.
2024-01-29 22:05:23 -05:00
Goober5000 0c355efaa2 add a has-time-elapsed-msecs SEXP
Also fix a small mistake in the SEXP help.  The `sexp_has_time_elapsed()` function has been moved to take advantage of the existing time functions.
2024-01-29 22:05:00 -05:00
Goober5000 89a6e2aa7d fix ship subsystem parse warning
As reported by Trivial Psychic, if the number of subsystems exceeds the max as the result of a modular table, the error message was very misleading.  This fixes the error message and also makes it report the correct number of parsed subsystems.
2024-01-29 22:04:25 -05:00
Goober5000 84033d901c Third gravity fix
`ai_get_weapon` is not guaranteed to return a valid `wip`, so check for that here.  This should now cover all uses of `ai_get_weapon` in the codebase.

Fixes an Event Horizon crash reported in Discord.  Follow-up to #5842, commit 8dbe0e7.
2024-01-29 22:04:02 -05:00
Asteroth 46226a6cbe tweaks 2024-01-29 19:34:36 -05:00
John Fernandez 4b49123070 Merge pull request #5965 from notimaginative/fix_linux_build_image
switch to new linux build image
2024-01-29 16:36:40 -05:00
Taylor Richards 213bcbc80b find&replace ALL the things 2024-01-29 15:04:47 -05:00
Taylor Richards 0da34f0bc8 switch to new linux build image
Upgrades to Ubuntu 20.04 to fix Node v20 problem.
Bumps compiler to gcc-9.

NOTE: This breaks support for Linux distros older than Ubuntu 20.04
2024-01-29 14:57:38 -05:00
John Fernandez 8fcf385e7e Merge pull request #5955 from MjnMixael/no_ui_pause
Pause the UI properly based on user settings
2024-01-28 00:53:37 -05:00
mjn-mixael 4f4722ccad also pause the UI properly based on user settings 2024-01-25 13:14:24 -06:00
John Fernandez 7d94561ea5 Merge pull request #5920 from MjnMixael/properly_check_windowed
Properly check if we're running in a windowed mode
2024-01-25 00:21:43 -05:00
John Fernandez 248cec7cf9 Merge pull request #5921 from MjnMixael/save_multi_settings
Save these to the ini file
2024-01-25 00:20:50 -05:00
John Fernandez e987d1cd7b Merge pull request #5929 from MjnMixael/clean_cutscene_info
Cleanup ui cutscene api
2024-01-25 00:20:18 -05:00
John Fernandez f1aa29551b Merge pull request #5954 from MjnMixael/fix_discord_option
Fix discord option needing restart
2024-01-24 17:21:34 -05:00
Goober5000 76734fb5ed Merge pull request #5946 from Goober5000/splash_fix
fix splash crash and add supplemental script hook
2024-01-24 14:42:29 -05:00
mjn-mixael fb0a62c400 fix discord option needing restart 2024-01-24 10:07:37 -06:00
Goober5000 1403301b65 add variable to prevent any hooks from running until OnGameInit has run 2024-01-23 14:51:06 -05:00
John Fernandez 1d1eb5ec4d Merge pull request #5952 from MjnMixael/fix_custom_string_save
Fix custom string saving
2024-01-23 14:29:45 -05:00
Goober5000 7283412880 Merge pull request #5953 from Goober5000/fix_fire_at_coords
fix crash in fire-beam-at-coordinates
2024-01-23 00:40:12 -05:00
Mike Nelson 1d2ca8eb5a print option settings to the log (#5914) 2024-01-23 00:40:04 -05:00
Goober5000 130ddb41f1 Merge pull request #5947 from JohnAFernandez/keep-observers-from-crashing
Fix: Keep Chase view from crashing in multi
2024-01-23 00:13:07 -05:00
Goober5000 9462241c0b Merge pull request #5948 from BMagnu/fix_msaa_compile
Fix MSAA for some graphics drivers
2024-01-23 00:12:58 -05:00
Goober5000 14bba9aea1 fix crash in fire-beam-at-coordinates
A small oversight in #5837 - beam jitter is not done when targeting coordinates.
2024-01-23 00:07:33 -05:00
mjn-mixael c7b43b0e0e fix custom string saving 2024-01-22 12:18:25 -06:00
Birk Magnussen 1355c484fe Remove language-defined declaration 2024-01-19 22:15:29 +01:00
JohnAFernandez 1866c6adb5 Whoops, forgot to push typo fix 2024-01-19 01:49:43 -05:00
JohnAFernandez a11517984e Keep Chase view from crashing
For Observers in multi
2024-01-19 01:29:08 -05:00
Goober5000 f207d2d12c add new On Splash End hook for scripts that have been doing post-splash stuff in On Game Init 2024-01-18 17:00:02 -05:00
Goober5000 4970252e9f tweak initialization sequence to head off potential future problems 2024-01-18 16:51:36 -05:00
Goober5000 d789e9b33a fix crash caused by incomplete script initialization 2024-01-18 00:43:14 -05:00
Fabian Woltermann 292f7d3b03 Merge pull request #5938 from MjnMixael/unload_pilot_scpui
Fix SCPUI overwriting campaign data
2024-01-15 19:09:47 +01:00
mjn-mixael 3bfc37172a Expose unloading a player and campaign file 2024-01-14 22:32:25 -06:00
Goober5000 2bb1c10557 Merge pull request #5916 from Goober5000/number_hack_upgrade
upgrade the OPF_POSITIVE number hack
2024-01-14 19:19:16 -05:00
Asteroth 84f97936aa Merge remote-tracking branch 'upstream/master' into aim-cursor 2024-01-13 00:53:37 -05:00
Goober5000 40fac5dd5f Merge pull request #5838 from Goober5000/turret_constify
constify some turret code
2024-01-12 20:46:03 -05:00
John Fernandez 2a33e374c2 Merge pull request #5926 from MjnMixael/is_movie_playing
LUA method to check if a movie is currently playing
2024-01-10 02:52:31 -05:00
mjn-mixael d48d00d946 static cast 2024-01-09 08:11:03 -06:00
mjn-mixael 562875130c Cleanup ui cutscene handling 2024-01-08 13:57:51 -06:00
mjn-mixael 4401101fea lua method to check if a movie is currently playing 2024-01-07 14:41:01 -06:00
John Fernandez 7c15adec1a Finish Loop for saving variables 2024-01-06 18:38:12 -05:00
John Fernandez 52cc1f182e Make sure flags are included 2024-01-06 18:13:19 -05:00
John Fernandez 64b54d1022 Start writing apply and reject methods 2024-04-01 17:58:07 -04:00
mjn-mixael 509f887f6c Save these to the ini file 2024-01-05 17:04:58 -06:00
mjn-mixael 266079997a remove unused code 2024-01-05 13:31:31 -06:00
mjn-mixael f4a3903478 properly check if we're running in a windowed mode 2024-01-05 13:13:24 -06:00
Taylor Richards f4202df450 codesign Mac builds to prevent broken app message (#5919)
Apple Silicon Macs require that all code is signed in order to run. Our builds
are partially signed due to the SDL framework already being signed, so it is
seen as broken. To fix that we need to codesign all the rest of the necessary
files with an ad-hoc signature in order to allow the builds to work properly.
2024-01-04 22:25:59 -05:00
Goober5000 e619c0c3d3 Merge pull request #5910 from Goober5000/campaign_load_refactor
campaign error message improvement
2024-01-04 21:51:24 -05:00
Goober5000 ff0b79b6be move this and make it static 2024-01-04 13:49:27 -05:00
Goober5000 701d20c112 upgrade the OPF_POSITIVE number hack
This is a new method of ensuring that OPF_POSITIVE numbers are positive.  It works for all numeric arguments, including variables and literals, and caches the status of the node to avoid lookups for every negative number on every frame.  Tested on both operator and non-operator cases.

Follow-up to #5915.
2024-01-04 13:43:19 -05:00
Goober5000 9a45c9fd05 Merge pull request #5915 from Goober5000/number_hack_update
restore number hack sign checking in all builds
2024-01-04 13:41:47 -05:00
JohnAFernandez 146102e82c Merge pull request #5909 from Goober5000/remove_mht
remove mainhalltemp
2024-01-04 11:33:41 -05:00
Goober5000 be2c18d608 add back exceptions 2024-01-03 18:46:10 -05:00
Goober5000 c9644cdcae Merge pull request #5913 from Goober5000/5911_followup
5911 followup
2024-01-03 18:03:05 -05:00
Goober5000 d088e895f8 restore number hack sign checking in all builds
Operators that specify OPF_POSITIVE should be guaranteed to get positive numbers.  This code was previously disabled for performance reasons, but following the contract of the SEXP system is more important.  A future PR will improve the performance of the functions used here.

Also, the `num-players` operator takes no arguments, so fix that.
2024-01-03 14:24:43 -05:00
Goober5000 f1a9b2639b 5911 followup
In consultation with @BMagnu, code that validates data in the POF file itself should happen in `read_model_file_no_subsys`, as virtual POFs rely on their source files having correct data.  I've added comments and slightly rearranged things to make this clearer, and also moved the new code from `read_and_process_model_file`.  Additionally, I fixed two bugs by changing `parent > pm->n_models` to `parent >= pm->n_models` and adding a newline to the `nprintf`.
2024-01-03 11:34:18 -05:00
Fabian Woltermann a1690dcb90 Merge pull request #5911 from The-E/fix/invalid_eye_point_data
Fixes an issue with faulty eyepoint data causing a crash.
2024-01-03 14:45:26 +01:00
Fabian Woltermann 2c4088efdd Fixes an issue with faulty eyepoint data causing a crash. 2024-01-03 13:50:23 +01:00
Goober5000 da3725a3ac Merge pull request #5902 from Goober5000/refine_number_checking
refine numeric error checking in FRED
2024-01-03 00:00:22 -05:00
JohnAFernandez 81b7460e57 Merge pull request #5908 from MjnMixael/lua_enum_validation
Add some better error and validation checking to lua enums scripting API
2024-01-02 23:41:58 -05:00
Goober5000 c9a1127764 fall back to default campaign when starting the game or choosing a new pilot 2024-01-02 02:27:37 -05:00
Goober5000 6eb9ae2aec remove mainhalltemp
These files are not referenced anywhere and haven't been used since before FreeSpace 2 was released.
2024-01-01 23:51:45 -05:00
Goober5000 d3d9ee3092 refine campaign failure error messages 2024-01-01 17:41:42 -05:00
Goober5000 f66fc92859 int to boolean 2024-01-01 17:41:42 -05:00
Goober5000 94cbc350a4 handle main hall if campaign could not be loaded 2024-01-01 17:41:42 -05:00
Goober5000 550e9ec5b2 distinguish between corrupt and missing campaign files 2024-01-01 17:41:30 -05:00
mjn-mixael de3463958d Add some better error and validation checking to lua enums 2024-01-01 13:27:11 -06:00
Asteroth 03d7845124 improve comments (#5903) 2023-12-31 15:56:41 -05:00
Goober5000 661dceb0d8 Merge pull request #5906 from Goober5000/fix_vr_aspect_lock
additional HUD fixes for VR
2023-12-31 12:53:59 -05:00
m!m 202686dab6 Merge pull request #5907 from asarium/fix/balanceLuaStack
Fix unbalanced stack when retrieving Lua main thread
2023-12-31 18:18:41 +01:00
asarium b8da1106eb Fix unbalanced stack when retrieving Lua main thread
After getting the main state from the Lua registry, this function had
two Lua thread values on its Lua stack but we only removed one which
lead to a value being left on the stack.

Why did this not blow up before? Because undefined behavior.

The only place where this was called was when creating a Lua reference
value where luaL_ref is called in the same expression (see
UniqueLuaReference::create). The evaluation order of the parameters for
the make_shared call is not defined by the standard and for some reason
all major compilers (except clang) choose to execute the luaL_ref call
before the getMainThread call.

For those compilers, everything is fine. We have some extra values on
the Lua stack but that gets cleaned up after the API function finishes.

However, clang first evaluates the getMainThread which leaves an extra
Lua thread on the Lua stack. The luaL_ref call then references this
thread value instead of the intended value. In the concrete case, this
meant that LuaFunction saw that the reference points to a thread and
rightfully threw an exception.

This fixes #5904.
2023-12-31 17:44:58 +01:00
Goober5000 43f7921121 additional HUD fixes for VR
Use a single canonical `frametime` value for all HUD rendering, in both `hud_render_preprocess` and `hud_render_all`.  Previously, certain functions called through `hud_render_preprocess` were using the full frametime, rather than the half frametime needed for VR when the HUD is rendered twice.

Fixes #5882.
2023-12-30 20:35:15 -05:00
Goober5000 f4669db41c constify some turret code
Apply `const` to a whole bunch of functions.  Also change a bunch of ints to bools.
2023-12-30 00:00:31 -05:00
Tyler Blount b3df3364e4 Merge pull request #5837 from Goober5000/turret_refactor
untangle turret code a bit
2023-12-29 21:31:51 -07:00
John Fernandez 5d0ee564ac fix support structs 2023-12-29 17:50:39 -05:00
Goober5000 b6a76b788d reuse beam points for collision test 2023-12-29 16:51:36 -05:00
Goober5000 e21b07662e refactor 'share fire direction'
Use a simpler, more robust, and more correct method of sharing the fire direction among beams: replicate the actual beam vector for all firing points.  This further cleans up and simplifies the beam firing code and also clarifies some vector math.
2023-12-29 16:35:34 -05:00
Goober5000 9b4b0b552b fix use of target position, and also don't get gvec if we don't need it 2023-12-29 16:34:22 -05:00
Goober5000 bdab7a0c55 untangle turret code a bit
1. make `check_ok_to_fire` return a boolean (like `check_los`)
2. make `check_ok_to_fire` and `check_los` both use a position argument since we don't need the whole turret
3. remove the redundant position prediction code from `ship_get_global_turret_gun_info` (since that needs to be a "pure" function) while making sure "share fire direction" still works
4. skip calculation of the vector in `ship_get_global_turret_gun_info` if we don't need it
5. move the position prediction code out of `aifft_rotate_turret` and into its own function
6. prune some gun position calculation calls since in most cases one will suffice
7. fix position "jitter" with weapon subsystem damage in missions that use gravity
8. `model_rotate_gun` now uses a nullptr position for a reset instead of an extra boolean argument
9. use a more efficient method to calculate gun barrel length
10. a couple variable name changes for clarity
2023-12-29 16:28:24 -05:00
Goober5000 e269cdab6e Merge pull request #5863 from Baezon/beams-respect-hull-check-self-damage
Make beams respect 'check hull' and 'can damage shooter' flags
2023-12-29 16:27:50 -05:00
wookieejedi edc76bcb40 Fix typo in lua error prints (#5901)
2 line typo fix `refere` -> `refer`
2023-12-29 13:42:35 -05:00
Goober5000 cbde5a8e85 refine numeric error checking in FRED
1. Allow a `+` to appear in front of numbers, just as with `-`
2. Check for `.` and `,` within numbers to give a less misleading error message than "not a number"
3. The old number hack inadvertently skipped numeric literals, so specifically check for those
2023-12-28 14:46:47 -05:00
Goober5000 7fcfc35820 Merge pull request #5898 from Goober5000/invalid_point_message_fix
make error messages more accurate
2023-12-24 14:31:06 -05:00
Goober5000 f852421d76 update messages per feedback 2023-12-24 13:27:51 -05:00
Goober5000 2321311725 make error messages more accurate
There are several SEXP argument types that themselves encompass multiple argument types: for example, ships and wings.  This could be misleading when there is an error message displayed.  So, this updates the error codes to explicitly cover all of the possibilities.
2023-12-24 13:27:51 -05:00
John Fernandez e7583ddab8 start creating Model and helper structs 2023-12-22 18:41:06 -05:00
JohnAFernandez 98a5ff4a23 Initial Dialog
Not building yet.  Some sort of linking error
2024-03-31 12:43:08 -04:00
John Fernandez 38cd1bff86 Restore accidental const removals 2023-12-21 16:33:31 -05:00
John Fernandez 71ee9501f9 Turns out coverity was optimistic 2023-12-20 21:05:36 -05:00
John Fernandez 221670589e Undo Overzealous changes 2023-12-20 20:30:40 -05:00
John Fernandez 9a47a664f7 Whoops, no std::move here 2023-12-20 19:54:13 -05:00
John Fernandez 7b7b19b71b Change many references to const auto&
A few uses of auto were also removed, where using a direct function call was superior.
2023-12-20 19:43:11 -05:00
John Fernandez 666b9a5751 Missed another conversion specifier 2023-12-20 16:21:35 -05:00
JohnAFernandez 733e1adcba Merge pull request #5892 from JohnAFernandez/Fix-Coverity-Workflow
Fix Coverity WorkFlow
2023-12-20 16:17:29 -05:00
John Fernandez 8421d8d8e6 Adjust conversion specifiers 2023-12-20 16:14:55 -05:00
John Fernandez 63ed4c8254 Remove this time tracking
It is no longer used and has low resolution compared to the current method used elsewhere.
2023-12-20 16:06:49 -05:00
John Fernandez 3124c55642 Change various varibales to time_t
These variables were previously int's or uint's
2023-12-20 16:06:49 -05:00
Goober5000 485eb16fe3 Merge pull request #5827 from Goober5000/delay_status_tweak
tweak event status evaluation when the game is not in-mission
2023-12-19 19:34:35 -05:00
John Fernandez a493f07333 Fix Coverity WorkFlow
By using app image and switching to Checkout V1.

Also removes Vulkan SDK install, since it seems to be taken care of by the app image or is disabled.  I can't figure it out from the app images.
2023-12-19 12:12:56 -05:00
JohnAFernandez 366c1a9d0b Merge pull request #5891 from MjnMixael/self_credits_update
Self Credits update
2023-12-18 13:31:18 -05:00
mjn-mixael 0594a487c8 credit with my real name instead of online handle 2023-12-15 14:38:26 -06:00
JohnAFernandez f8733eab72 Merge pull request #5890 from MjnMixael/fix_obt_table
Make internal table file match updated parsing preference
2023-12-15 14:23:55 -05:00
mjn-mixael 8dcc4a24e9 make internal table file match updated parsing preference 2023-12-15 13:04:25 -06:00
Goober5000 bf4d7a3114 Merge pull request #5888 from Goober5000/fix_qtfred_option
fix crash in QtFRED
2023-12-14 20:57:10 -05:00
Goober5000 5e8a4f754d fix crash in QtFRED
Not sure how this option became false, but it should be true in order for the checkable menu option to be set up properly.
2023-12-14 18:56:10 -05:00
JohnAFernandez d0a537ff82 Merge pull request #5868 from MjnMixael/more_scpui_options
More scpui options
2023-12-14 12:48:36 -05:00
JohnAFernandez e7c98d6d23 Merge pull request #5880 from MjnMixael/fix_render_overhead
Fix renderOverheadModel's reliance on wss_slots
2023-12-14 12:48:16 -05:00
JohnAFernandez 36e7598ceb Merge pull request #5879 from JohnAFernandez/Fix-Player-Menu-Smarter
QOL: Don't reset the position in the player list if we switch modes
2023-12-11 17:46:28 -05:00
Mike Nelson 0672bd94e9 This should be Game instead of Graphics 2023-12-11 11:26:02 -06:00
Mike Nelson c7792cd781 Merge branch 'master' into more_scpui_options 2023-12-11 11:22:33 -06:00
JohnAFernandez 252392b26a Merge pull request #5865 from MjnMixael/scpui_multi_options
Scpui multi options
2023-12-11 11:54:53 -05:00
JohnAFernandez 65677542cb Merge pull request #5869 from MjnMixael/disable_cmdline_overrides
Disable cmdline overrides
2023-12-11 11:50:22 -05:00
mjn-mixael 691bbca2b2 remove renderOverheadModel's reliance on wss_slots 2023-12-11 09:36:49 -06:00
John Fernandez cd95b143a0 Only init player screen if we need to 2023-12-11 00:46:21 -05:00
Goober5000 a360a1f5f1 Merge pull request #5877 from Goober5000/bump_missionlog
bump missionlog limit
2023-12-10 18:20:52 -05:00
Goober5000 d1119b2353 bump missionlog limit
This limit has not been bumped since the original public source release.  The final mission in Shepherds has been experiencing mysterious bugs which were finally tracked down to the mission log overflowing its limit and discarding log entries.  Ideally the mission log should be made dynamic and the pruning mechanisms removed, but for the 24.0 release, it suffices to bump the limit.
2023-12-10 00:33:22 -05:00
JohnAFernandez c37e1b1c96 Merge pull request #5871 from Goober5000/juggling_fix
juggling fix
2023-12-09 14:30:43 -05:00
Goober5000 fd6ca9dde9 juggling fix
Volition used a bit of juggling when deleting the briefing editor pointer.  Turns out this actually prevents a crash in certain situations, so let's put it back.

Follow-up to #5866.
2023-12-09 14:04:53 -05:00
Goober5000 fbb3a8f6a5 Merge pull request #5829 from Goober5000/oswpt_registry_ptrs
replace pointers with indexes in ship registry and oswpt
2023-12-09 00:23:33 -05:00
JohnAFernandez 0e63d64647 Merge pull request #5451 from BMagnu/animation_driver
Animation Drivers
2023-12-08 20:58:54 -05:00
Goober5000 de50f693ae Merge pull request #5811 from Goober5000/perform_on_mission_skip
implement on-mission-skip SEXP
2023-12-08 20:05:20 -05:00
Goober5000 6e9b31cb5a replace pointers with indexes in ship registry and oswpt
This refactors the ship registry and the OSWPT struct to store data as indexes rather than pointers.  This is a prerequisite for making these collections dynamic in the future.  See also #5800.
2023-12-08 19:45:58 -05:00
Fabian Woltermann e316c28258 Merge pull request #5607 from EatThePath/opt/luastring
LuaDrawstring optimization
2023-12-08 17:18:20 +01:00
JohnAFernandez 1ef528af5f Merge pull request #5867 from MjnMixael/discord_option_category
Change the discord option category to "game"
2023-12-08 10:48:31 -05:00
EatThePath e536413259 Deferred light mesh submission optimizations (#5828)
* Reorganized opengl deferred light mesh drawing to submit all data before,
beginning to submit draws, and also to reduce total bind calls needed.

* Leftover unused variable cleanup

* CI didn't like my loops, maybe it'll like these.

* unused variable cleanup.
2023-12-08 07:40:42 -05:00
Goober5000 ccbe7efcbe Merge pull request #5866 from Goober5000/fred_autosave
add more autosaving in FRED
2023-12-07 18:12:37 -05:00
mjn-mixael 1fcf51bd92 unused vars 2023-12-07 16:55:41 -06:00
mjn-mixael b9938b854f commandline to disable using ingame options 2023-12-07 16:45:43 -06:00
mjn-mixael ad06cb1c5b disable commandline options overriding in-game options 2023-12-07 15:00:33 -06:00
mjn-mixael b62a7fbe3d no unfocused pause & localization + cleanup 2023-12-07 11:54:45 -06:00
mjn-mixael 4011a0800d screenshake option 2023-12-07 11:33:01 -06:00
mjn-mixael 8f7c6a0ed8 and force dropdown selector for display selection 2023-12-07 10:45:17 -06:00
mjn-mixael 9e719440c9 Change the discord option category to "game" 2023-12-07 10:31:15 -06:00
Goober5000 6692540cbf add more autosaving in FRED
FRED has an autosave feature but it wasn't invoked in too many places.  This adds autosaving whenever a major dialog is closed, unless it was closed by hitting Cancel.  NB: Autosave is not yet implemented in qtFRED.

Also, `addvariabledlg` incorrectly referred to `OnOk` instead of `OnOK` and `CMessageEditorDlg` incorrectly referred to `OnOK` instead of `OnOk`, so this fixes those and distinguishes `OnOk` by renaming it `OnButtonOk` to be consistent with the event editor and other dialogs.
2023-12-06 17:55:26 -05:00
mjn-mixael 668fc18d5c Make these two dropdown options to account for the longer string values 2023-12-06 15:29:32 -06:00
mjn-mixael a101e3cf77 spelling is hard 2023-12-06 15:25:37 -06:00
mjn-mixael dcce4a6538 Set the globals at player select rather than player load 2023-12-06 15:08:23 -06:00
mjn-mixael 7ce3217f17 multi login info & ip address list API 2023-12-06 12:49:38 -06:00
mjn-mixael 33a1b1f8ca clean up and fix 2023-12-06 09:59:36 -06:00
mjn-mixael a29a97f39a xstrs 2023-12-06 08:22:26 -06:00
Goober5000 8d40d7467e Merge pull request #5861 from BMagnu/fix_windowres_warning
Avoid a casting warning in cmdline.cpp
2023-12-06 01:07:22 -05:00
Goober5000 eb57482c1a Merge pull request #5864 from Goober5000/fix_query_node_argument_type
fix query_node_argument_type()
2023-12-06 01:05:53 -05:00
Goober5000 50f083043b fix query_node_argument_type()
Calling `query_node_argument_type()` on a node with no parent is a valid use case, so return the proper argument type.  Fixes a crash discovered by Applemush.
2023-12-05 17:03:48 -05:00
Goober5000 d02bd6ca04 Merge pull request #5862 from Goober5000/no_arrival_music
allow nonexistence of arrival overlays
2023-12-05 16:53:15 -05:00
Asteroth e543c1aea2 make beams respect check hull and self damage 2023-12-05 16:46:32 -05:00
Goober5000 22962afcde allow nonexistence of arrival overlays
Ever since retail, the code has assumed that a soundtrack would always have arrival music.  This removes that requirement.  If arrival music is missing, it will just be skipped.
2023-12-05 16:19:46 -05:00
Birk Magnussen 1f9c9a3673 Catch nonexistant curves 2023-12-05 21:25:22 +01:00
Birk Magnussen f3922f35e8 Properly cast to avoid a warning 2023-12-05 19:16:16 +01:00
Birk Magnussen bb5bfad828 Fix parsing and asserts 2023-12-05 18:54:30 +01:00
JohnAFernandez 18ac8425ee Merge pull request #5859 from MjnMixael/fix_language_selection
Only use- in-game language if the mod table option is enabled
2023-12-05 12:10:03 -05:00
BMagnu f6167bb89a Make sure that the openxr_loader subproject is forced to the correct debug iterator level (#5860) 2023-12-05 17:00:01 +00:00
Birk Magnussen c8ceb289ba Actually run drivers 2023-12-05 17:47:44 +01:00
Birk Magnussen 9ea64627ab property drivers 2023-12-05 17:47:43 +01:00
Birk Magnussen 6e9ca36481 fix driver parsing 2023-12-05 17:47:43 +01:00
Birk Magnussen 90dbdc4236 Add remap driver 2023-12-05 17:47:43 +01:00
Birk Magnussen 3a35f7ebe7 make curve inferment constant 2023-12-05 17:47:42 +01:00
Birk Magnussen 05f190b36c Ensure driver source precedence 2023-12-05 17:47:42 +01:00
Birk Magnussen 0924a392aa Add basic driver sources 2023-12-05 17:47:41 +01:00
Birk Magnussen 21db833dee Add driver files 2023-12-05 17:47:41 +01:00
Birk Magnussen 86011f2669 Driverify time 2023-12-05 17:47:41 +01:00
Birk Magnussen 2bd143e093 Separate Animation State tracking from direction and time tracking 2023-12-05 17:47:40 +01:00
mjn-mixael 79d3077071 quick & dirty initial work for the toggle options 2023-12-05 09:30:04 -06:00
mjn-mixael aacd14e1df only use- in-game language if the mod table option is enabled 2023-12-04 15:58:41 -06:00
BMagnu 43afcd5ea6 VR Lua interface (#5858)
* Allow lua to check whether VR is enabled

* Add global hook condition

* Add missing descriptionm
2023-12-04 20:39:26 +00:00
BMagnu b98544d862 Merge pull request #5583 from BMagnu/openxr
Add VR support through OpenXR
2023-12-05 04:57:19 +09:00
Birk Magnussen 7867dc77bd external Openxr vars on mac 2023-12-04 20:38:50 +01:00
Birk Magnussen 426c227b68 Actually make sure that OpenXR is not a target on maxc 2023-12-04 20:24:42 +01:00
Birk Magnussen 612bdcf4df Do not link OpenXR on mac 2023-12-04 20:20:41 +01:00
ETP 0d712d6fc0 Minor code cleanup. 2023-12-04 14:12:31 -05:00
Taylor Richards 62fa0c081b Merge pull request #5856 from notimaginative/mac_name_change_fixes
update nebula script for Mac filename changes
2023-12-04 00:13:23 -05:00
Taylor Richards 8035a2b32a update nebula script for Mac filename changes 2023-12-03 17:19:08 -05:00
ETP f7f2c58746 New method to wrap strings to drawing widths, and use of that method in lua gr.drawstring, resolves #5495 2023-12-03 14:31:33 -05:00
Goober5000 7bf0fd137d Merge pull request #5855 from Goober5000/coverity_magic
change two global variables to be scoped
2023-12-03 01:18:06 -05:00
Goober5000 6d818f1e3b Merge pull request #5565 from Goober5000/plieblang_good_primary_time
Add plieblang's good primary time SEXP
2023-12-02 23:45:46 -05:00
Goober5000 e23b5533aa change two global variables to be scoped
These variables are only ever used in the scope of `os_get_legacy_user_dir()`, so they can be scoped rather than global.  This should fix a Coverity issue on the `DCF(low_mem` debug console function.
2023-12-02 23:39:24 -05:00
Goober5000 6b79571edc Merge pull request #5854 from Goober5000/fix_api_format
fix Lua API arguments
2023-12-02 18:26:12 -05:00
JohnAFernandez 27f022b2f2 Merge pull request #5799 from JohnAFernandez/Fix-many-old-divide-by-issues
Add safety to crusty old physics code (coverity issue)
2023-12-02 18:19:54 -05:00
JohnAFernandez 4578fbc900 Merge pull request #5851 from MjnMixael/sound_assertion
Add assertion when getting a loaded sound index
2023-12-02 18:11:07 -05:00
John Fernandez bfde2144a2 Typo 2023-12-02 18:01:51 -05:00
John Fernandez 1787f4457b Add safety to crusty old physics code 2023-12-02 18:01:51 -05:00
Goober5000 be14c34f7d reset the timestamp instead of checking the size 2023-12-02 14:56:31 -05:00
Goober5000 da66bd65da feedback 1 2023-12-02 14:56:30 -05:00
Goober5000 dc7aa86147 updates based on comments 2023-12-02 14:56:30 -05:00
Goober5000 4bf743765c plieblang's good-primary-time 2023-12-02 14:56:30 -05:00
Taylor Richards b4e3ebe085 Merge pull request #5853 from notimaginative/mac_arm64_builds
add mac arm64 builds to CI workflow
2023-12-02 14:46:20 -05:00
Goober5000 ada432a1f3 fix Lua API arguments
Make sure the return value is actually a float so that the float format can process it.

Follow up to #5831.  Fixes a crash for invalid movies.
2023-12-02 13:04:14 -05:00
Goober5000 25d796afe4 implement on-mission-skip SEXP
Adds a SEXP that specifically checks for whether a player has skipped a mission.  This can be used to set tech room entries, allowed ships/weapons, and other campaign data that would otherwise break if a player skipped a mission.

This only applies to the the failed-five-times popup.  For this to work with the `skipmemymissionyo` cheat, it would be necessary to load every intervening mission and check the events.  That being said, `skipmemymissionyo` already automatically allows all ships and weapons, so there is much less, if any, need for this SEXP in that case.
2023-12-02 01:25:14 -05:00
Goober5000 1a034031d1 Merge pull request #4634 from Goober5000/sexp_reset_event
add reset-event and reset-goal
2023-12-02 01:03:38 -05:00
Goober5000 23098666e2 Merge pull request #5506 from MageKing17/bugfix/debrief-failure-skip-count
Restore (mostly-)retail debrief failure counting behavior.
2023-12-01 23:41:48 -05:00
Taylor Richards 5490751167 skip tests on mac if target arch doesn't match host
An arm64 mac can run unittests on a x86_64 build, but not the other way
around. So if the target arch doesn't match the build host arch then
just skip the tests. Saves us from a far more complicated fix that would
only produce the same test results anyway.
2023-12-01 23:05:56 -05:00
Taylor Richards 4bc9cf0846 set IS_ARM64 correctly if building on different arch 2023-12-01 23:01:29 -05:00
BMagnu dd9248fc22 Fix merge errors 2023-12-02 11:50:01 +09:00
BMagnu c2ed03ca59 Merge branch 'master' into openxr 2023-12-02 11:42:55 +09:00
Taylor Richards 7491a82d74 always build embedfile and unittests for host arch 2023-12-01 21:15:13 -05:00
MageKing17 2f0c0f1d6f Restore (mostly-)retail debrief failure counting behavior.
Back in 2008 (in commit 2c45dbbb5f), some retail code incrementing `Player->failures_this_session` was removed, seemingly by accident. A month later, a bug related to this was fixed (in commit 28a408deee) in a different way. Since this fix is rendered redundant by the restoration of the original behavior, I've removed it and put back in the old behavior. This is only "mostly-retail" because the retail code didn't check `Game_mode & GM_CAMPAIGN_MODE`.
2023-12-01 18:14:55 -08:00
Taylor Richards 3b231b375f add mac arm64 builds to CI workflow 2023-12-01 20:55:29 -05:00
Taylor Richards 07fb5bec0e support new prebuilt libs on mac (#5852) 2023-12-01 20:54:41 -05:00
mjn-mixael e51815a933 Add assertion when getting a loaded sound index 2023-12-01 11:27:17 -06:00
Goober5000 ea6e503ea1 Merge pull request #5839 from Goober5000/radar_timestamps
make radar timestamps type-safe
2023-11-30 13:19:58 -05:00
JohnAFernandez a381ecc607 Merge pull request #5844 from MjnMixael/fred_on_mission_load
FRED on mission load hook
2023-11-30 11:42:48 -05:00
Asteroth 125e47d749 Add cockpit 'sway' (#5840)
* add cockpit sway

* remove 5000 scaling factor
2023-11-30 10:52:39 -05:00
JohnAFernandez d280800bce Merge pull request #5847 from MjnMixael/remove_cd_checks
Remove the cd checks that always returned true anyway
2023-11-30 10:38:19 -05:00
JohnAFernandez a1c9b108ed Merge pull request #5842 from Baezon/gravity-fixes
Two gravity fixes
2023-11-30 10:38:05 -05:00
JohnAFernandez d7a06c893f Merge pull request #5848 from MjnMixael/fix_medal_parsing
Fix medal parsing issue
2023-11-30 10:37:33 -05:00
m!m 3aa672c855 Merge pull request #5843 from asarium/build/ci_qtfred
Reenable QtFred building for Linux CI builds
2023-11-29 21:08:05 +01:00
mjn-mixael 8acbe82aa0 fix medal parsing 2023-11-29 13:08:05 -06:00
JohnAFernandez 5227e2e0c4 Merge pull request #5830 from MjnMixael/vectorize_multi_pxo
Vectorize multi pxo
2023-11-29 13:47:04 -05:00
mjn-mixael 95baa85750 remove the cd checks that always returned true anyway 2023-11-29 11:27:31 -06:00
mjn-mixael fb1ffd8413 fred on mission load hook 2023-11-29 09:14:07 -06:00
asarium f43732c5da Reenable QtFred building for Linux CI builds
Qt has been added to the build image which eliminates the need to
dynamically install it which removed a possible point of failure.

At the moment this is only enabled for pull request builds and should
not affect nightly or release builds.
2023-11-29 11:34:42 +01:00
Asteroth 8dbe0e7b8a gravity fixes 2023-11-29 02:34:26 -05:00
mjn-mixael 3ad66b988d unused var 2023-11-28 20:48:21 -06:00
mjn-mixael 969759426a list instead of vector 2023-11-28 20:31:54 -06:00
m!m 224503391f Merge pull request #5841 from asarium/fix/build-upload
Update container image to fix artifact uploads
2023-11-28 14:29:08 +01:00
asarium 0edc6267aa Update container image to fix artifact uploads
The previous version of the image accidentally removed the /tmp
directory which broke things in the GitHub actions.

Initially, an update for the upload/download actions was tried which had
no effect but keeping these updated is probably a good idea.
2023-11-28 10:58:28 +01:00
Goober5000 def75287eb convert radar timestamps to new system
Also convert true/false variables to boolean.
2023-11-28 00:09:25 -05:00
Goober5000 c427014fc2 just use the flag 2023-11-27 18:19:56 -05:00
Goober5000 99d140fb83 indicate 'done' events with a flag 2023-11-27 18:19:56 -05:00
Goober5000 808e5bedd9 address feedback 2023-11-27 18:19:56 -05:00
Goober5000 6dfd1ed0b8 add reset-event and reset-goal
These new SEXP operators clear all status information from an event or goal, making it as if the event or goal had never been evaluated.

Implements feature discussed in #4184.
2023-11-27 18:19:56 -05:00
Goober5000 0d1d6fdf44 tweak event status evaluation when the game is not in-mission
The requirement for delayed event status checks to be strictly greater than the event fired timestamp (see commit eed50619ca / PR #5267) means that `is-event-true-delay 0` will not work in debriefings if the event becomes true and the debriefing SEXPs are evaluated on the exact same timestamp.  Normally this is not a problem, but one important exception is the `end-mission` operator which instantly sends the player to debriefing.

This timestamp behavior is working as designed and should be consistent as long as the `end-mission` operator has been around (I've verified it as far back as 3.7.4).  But it does lead to inconvenient situations where the event that called `end-mission` cannot be evaluated by the debriefing.  This makes it slightly more complicated to plan debriefing stages based on these events.

Therefore, it makes sense to add an exception to the event status function to ignore the delay if the evaluation is not in-mission.  This is consistent with evaluating events that *never* fired and also satisfies the principle of least astonishment for mission designers.

This also adds relevant documentation to the event and goal status operators.
2023-11-27 18:08:59 -05:00
m!m 369b90a156 Merge pull request #5833 from asarium/update_compilers
Update PR build image and compilers
2023-11-27 08:23:13 +01:00
mjn-mixael 7bb6a8ae86 negate this 2023-11-26 23:49:02 -06:00
Goober5000 7afb00e976 Merge pull request #5800 from Goober5000/reduce_ship_info_ptrs
avoid storing ship_info pointers in data structures
2023-11-26 23:30:13 -05:00
JohnAFernandez c4fe9e664f Merge pull request #5836 from MjnMixael/fix_hud_translations
Do not translate these if setting is enabled
2023-11-26 22:19:56 -05:00
JohnAFernandez eda9f16294 Merge pull request #5835 from MjnMixael/language_out_of_bounds
Verify this is in bounds and add vector_inbound macro
2023-11-26 22:19:32 -05:00
mjn-mixael f7dddc35d1 inline and remove signed check for size_t 2023-11-26 20:55:37 -06:00
mjn-mixael b8806e958d do not translate these if setting is enabled 2023-11-26 19:52:34 -06:00
mjn-mixael 40cf32133f in bounds check for language ext 2023-11-26 19:28:06 -06:00
Mike Nelson 691ec74406 Mission custom strings (#5544) 2023-11-26 19:15:30 -05:00
Goober5000 359886fee1 Merge pull request #5831 from Goober5000/movie_duration
add Lua function for movie duration
2023-11-26 16:00:26 -05:00
Mike Nelson 9b86d2f16d Scpui language selector (#5826)
* SCPUI in-game language selector

* xstr support

* proper debug print format

* minor fixes

* Save the language as json data rather than an index into the languages array

* ext instead of id for clarity

* Do this more formally

* unused param
2023-11-26 11:52:15 -05:00
asarium 260f15624b Update PR build image and compilers
This advances the versions for Clang to 16 and GCC to 13 along with
fixing any warnings these new versions are detecting now.

The new image versions also include Vulkan so the additional workflow
step for installing that is not necessary anymore.
2023-11-26 12:23:57 +01:00
mjn-mixael 6de870766a address additional feedback 2023-11-25 10:25:58 -06:00
Goober5000 072e802863 add Lua function for movie duration
This retrieves the duration from the movie stream.  Thanks to @asarium for pointing me in the right direction.
2023-11-23 13:11:40 -05:00
mjn-mixael 2ca9d6672c address feedback 2023-11-23 10:47:55 -06:00
mjn-mixael 7281e8d127 unused 2023-11-22 13:18:27 -06:00
mjn-mixael a730f30435 cleanup for checks 2023-11-22 13:07:16 -06:00
mjn-mixael cd5f044217 vectorize the chat 2023-11-22 12:31:05 -06:00
mjn-mixael 8b90cda3f4 nullptr 2023-11-22 09:52:13 -06:00
JohnAFernandez 6b2ced4643 Merge pull request #5815 from MageKing17/feature/direction-blind-contrails
Implement direction-blind contrails option.
2023-11-21 23:32:18 -05:00
JohnAFernandez 5ee051c55f Merge pull request #5803 from Baezon/start-loop-end-snd-weapons
Add Start/Loop/End sounds for weapons
2023-11-21 23:29:23 -05:00
Goober5000 ecc452088c Merge pull request #5751 from Goober5000/freespace_timestamps
upgrade timestamps referenced in freespace.cpp
2023-11-21 18:30:14 -05:00
mjn-mixael 841ae430c0 Vectorize the players list 2023-11-21 16:06:27 -06:00
Mike Nelson 3f7ffdb6a0 Localize strings in ship_select_blit_info (#5824) 2023-11-21 13:05:24 -05:00
Tyler Blount 737717fe3f Merge pull request #5569 from MjnMixael/loadout_no_validation
Do not validate loadouts
2023-11-20 21:57:57 -07:00
JohnAFernandez a463ac19cf Merge pull request #5825 from Baezon/fix-head-on-lasers
Fix for lasers with head on bitmaps
2023-11-20 21:57:53 -05:00
mjn-mixael 9d0ee6ab0d vectorize the channel list 2023-11-20 16:48:43 -06:00
Asteroth 703269aa71 fix for lasers with head on bitmaps 2023-11-20 17:27:11 -05:00
JohnAFernandez b7a0170cd1 Merge pull request #5818 from EatThePath/opt/single_batching
Remove redundant batching_render_all calls
2023-11-20 10:33:30 -05:00
JohnAFernandez 6f263365af Merge pull request #5761 from JohnAFernandez/Coverity-COPY_INSTEAD_OF_MOVE-ISSUES
These std moves were suggested by Coverity as optimizations
2023-11-19 23:11:26 -05:00
Goober5000 6435843c24 Merge pull request #5817 from Goober5000/fix_player_entry_delay
fix loadout dialog updating in FRED
2023-11-19 19:22:09 -05:00
Goober5000 22ee5d5c15 Merge pull request #5819 from Goober5000/the_new_old_checkbox
FRED checkbox upgrade
2023-11-19 19:22:00 -05:00
Mike Nelson 5fadb12b0f Deprecate IsValid in favor of isValid (#5814) 2023-11-19 18:58:35 -05:00
Taylor Richards e94c515ab8 fix deprecation warnings on newer ffmpeg versions (#5822) 2023-11-19 16:41:53 -05:00
Taylor Richards d83ddeed0f add arm64 detection and naming support (#5821) 2023-11-19 16:41:18 -05:00
Taylor Richards 3556d41b44 disable png neon optimizations on arm (#5820) 2023-11-19 16:41:03 -05:00
Mike Nelson f2df96b4bb remove is docked check for transfer-cargo sexp (#5810) 2023-11-19 11:25:14 -05:00
wookieejedi 9eeb3307d0 Expose isValid parse object check to scripting (#5816) 2023-11-19 07:51:33 -05:00
Goober5000 a406b43876 Merge pull request #5808 from Goober5000/rename_vaporize_chance
rename Vaporize Percent Chance
2023-11-18 23:04:38 -05:00
Goober5000 c86802e9c1 use alternate overlap fix
Back out the manual resize fix and apply a simpler fix that is less hackish.  See this other StackOverflow article:
https://stackoverflow.com/questions/57951333/cchecklistbox-items-get-overlapped-on-selection-if-app-build-using-visual-studi
2023-11-18 19:26:52 -05:00
Goober5000 5b4065bd53 FRED checkbox upgrade
The overlapping checkboxes problem described in #5494 is the result of the checkbox list item height being slightly too small.  A fix for this, which requires a subclass of `CCheckListBox`, is described in the following StackOverflow article:
https://stackoverflow.com/questions/3147958/mfc-cchecklistbox-items-overlap

It turns out there is already a subclass of `CCheckListBox` in the codebase: `ShipCheckListBox`, a class that was apparently left on the cutting room floor when DaveB refactored the team loadout dialog on 2/23/99.  It allows an entire selected range of items to be toggled by pressing the spacebar.  I've augmented it with the StackOverflow fix, and I've added it to the team loadout dialog as well as some other places that could benefit from it.

Fixes the other half of #5494.
2023-11-18 18:44:39 -05:00
ETP 5fd439fb60 Clean now-unused batch rendering flag. 2023-11-18 16:26:10 -05:00
ETP 2043f836ed Clean extra batched buffer run in particles 2023-11-18 15:53:47 -05:00
ETP 4a3c7fc9a9 Batched buffers are rendered soon after this anyway and the overhead is considerable.
Also removed what appears to be accidentally duplicated lines
2023-11-18 15:52:55 -05:00
Goober5000 e0e3f7e7ac fix loadout dialog updating in FRED
We need to call `UpdateData()` in the `OnOK()` function and in several other places so that the member variables are populated with the most recent input from the UI.  This prevents certain input (such as Player Entry Delay changes) from being lost by being overwritten with stale stored values.

This fixes a bug reported by Kitsune where the Player Entry Delay box did not work properly.  It also fixes the random checkbox issue from #5494.
2023-11-18 15:44:48 -05:00
Goober5000 542d9741c4 Merge pull request #5813 from Goober5000/fix_grid
small briefing bugfix
2023-11-18 15:04:10 -05:00
MageKing17 68eef5949b Implement direction-blind contrails option.
One of the features requested in #5378 (specifically the one requested in #5274), this adds a new "$Contrails use absolute speed:" option to game_settings.tbl, which makes the `ct_below_limit()` function check `objp->phys_info.speed` instead of `objp->phys_info.fspeed`. This allows contrails to appear when moving in a direction other than forwards.
2023-11-18 10:51:40 -08:00
Goober5000 7958670868 small briefing bugfix
Prevent "Disable grid rendering" from being stuck on.  Fixes a bug reported by Kitsune.
2023-11-18 12:34:28 -05:00
Mike Nelson 226ed40cec Move no campaign warning to on Ready Room click (#5809)
* Move no campaign warning to on ready room click

* Add a log print
2023-11-18 11:10:39 -05:00
Mike Nelson d454a74716 Add child enum suffix option (#5798) 2023-11-17 21:45:36 -05:00
Mike Nelson 4ff96abd9e Merge branch 'master' into loadout_no_validation 2023-11-17 10:29:50 -06:00
Mike Nelson 5bc1200731 Fred cutscene dialog (#5618)
* fred cutscene editor and deprecate alias types

* properly handle right-click delete

* cleanup

* these must be ints also
2023-11-17 11:27:05 -05:00
Asteroth b23dff91e7 revert removal of allow relative (#5807) 2023-11-16 22:20:54 -05:00
Goober5000 3af831e0b7 rename Vaporize Percent Chance
This option was misleadingly named when originally introduced, so give it a more sensible name.  The old name is still accepted for backwards compatibility.
2023-11-16 15:57:53 -05:00
Mike Nelson bcae459b56 Add way to offset directive help text only (#5802)
* add way to offset directive help text only

* specify which offset
2023-11-15 07:50:21 -05:00
Goober5000 ff7d85a60f Merge pull request #5806 from Baezon/fix-changing-bank-num
Fix for changing the number of banks on a ship
2023-11-15 00:10:30 -05:00
Goober5000 267fcfc6f8 also check ship_info_size() 2023-11-14 23:32:20 -05:00
Asteroth 8587bf768b fix changing number of banks 2023-11-14 20:04:55 -05:00
JohnAFernandez 535ff9f99a Merge pull request #5608 from Goober5000/move_cmdline_option
move -no_unfocused_pause
2023-11-14 16:01:20 -05:00
Asteroth 422ccaa514 fix 2023-11-14 13:15:30 -05:00
wookieejedi a3e27f566f Allow Modders to Set Rotational Scaling Multiplier for Asteroids/Debris (#5801)
* Allow Modders to Set Rotational Scaling Multiplier for Asteroids/Debris

Previously, there was no way to limit the velocity at which asteroids/debris randomly rotated. There was a way to set maximum speed, thus this PR follows that convention and adds a way to cap the rotational velocity scaling. This PR allows modders to set caps per type, including setting the value to 0 for no rotation.

A single scaling value was used b/c it was the most straightforward value to se via table and it was the employed the least code changes. Asteroids pick a random normalized vector for their rotation when spawning, and then that value is scaled by a random multiplier.

* use full multiplier instead
2023-11-14 08:02:16 -05:00
Asteroth 9ecb451efe more tweaks 2023-11-13 18:53:15 -05:00
Asteroth e3d2c02f99 tweak 2023-11-13 17:55:48 -05:00
Asteroth 13170a235e add start/loop/end sounds for weapons 2023-11-13 17:52:50 -05:00
Goober5000 5406445ed4 replace pointers with indexes in WarpEffect 2023-11-13 14:05:39 -05:00
Goober5000 301b9453b6 replace pointers with indexes in cockpit_display 2023-11-13 12:48:08 -05:00
JohnAFernandez cd32c2ce42 Merge pull request #5778 from freijon/fix_opt_flags
Don't ignore user-set -O* flags
2023-11-13 11:08:34 -05:00
Goober5000 7b1b1113da upgrade timestamps referenced in freespace.cpp
Convert additional timestamps to use the new timestamp system.  This covers all timestamps referred to in freespace.cpp.  For purposes of organization, the fade-in/fade-out timestamps have been moved to light.h|cpp and the training timestamps have been moved to missiontraining.h|cpp.

There are also several related code enhancements:
1. `FadeType` has been converted from `enum` to `enum class`
2. Initialization of the various training variables has been added to `training_mission_init` (previously they had never been reset between missions)
3. Validity checks have been added to the relevant locations for these timestamps
2023-11-12 15:22:30 -05:00
JohnAFernandez 1f32834d9d Merge pull request #5792 from MjnMixael/lua_enum_remove_item
Add ability to remove an enum item from a list
2023-11-12 14:31:49 -05:00
Mike Nelson bee0742aa2 downgrade this to a log print (#5791) 2023-11-12 10:07:16 -05:00
Mike Nelson d336d395db Fix incorrect out of bounds check (#5795) 2023-11-12 10:07:04 -05:00
Goober5000 1953bd9c49 Merge pull request #5748 from Goober5000/event_currency_tweaks
Event currency tweaks
2023-11-12 01:40:07 -05:00
Joshua Glatt e27cbe9517 Disallow Replace Container Data for all special argument SEXPs (#5793) 2023-11-12 01:38:55 -05:00
Goober5000 4b5d4320f8 Merge pull request #5794 from Goober5000/missionsave_tweaks
FRED missionsave updates
2023-11-11 23:43:00 -05:00
Goober5000 ed7f3e6880 Merge pull request #5787 from Goober5000/refactor_argument_functions
refactor argument functions
2023-11-11 19:39:55 -05:00
Goober5000 980d2c2bcc Merge pull request #5797 from Goober5000/fix_5773
fix 5773
2023-11-11 18:29:15 -05:00
Goober5000 17dfa0ddb9 fix 5773
In #5773, this use of frand_range(0, N) needed to be converted to Random::next(N+1), just like several other similar instances in that PR.

Fixes #5796.
2023-11-11 17:58:37 -05:00
Goober5000 5f511e34e3 FRED missionsave updates
1. Use the `optional_string_fred`/`fout` pattern so the FRED comment parser can follow along with the mission file
2. Since the #Custom Data section is optional and requires a version bump, don't output the section header if the section is empty
2023-11-11 14:34:17 -05:00
Goober5000 31c8739ecd Merge pull request #5788 from Goober5000/rcs_thruster_refactor
rcs thruster refactor
2023-11-11 13:17:48 -05:00
Goober5000 8e23c32b8c Merge pull request #5765 from Goober5000/subsystems_blown_optimization
optimization for checking whether subsystems are blown
2023-11-11 13:07:01 -05:00
mjn-mixael b628b665cf Do this using brain 2023-11-11 11:51:45 -06:00
mjn-mixael 7a367b10ad Add ability to remove an enum item from a list 2023-11-11 11:30:07 -06:00
wookieejedi 09c885c4af Add built-in xstrs for SCP-added custom controls (#5790) 2023-11-11 12:06:24 -05:00
JohnAFernandez 9ac6060abd Merge pull request #5522 from MjnMixael/mainhall_lua_esc
Custom lua action for mainhall esc keypress
2023-11-11 00:02:15 -05:00
JohnAFernandez a34f37fa8d Merge pull request #5645 from MjnMixael/lua_dynamic_enums
Lua Child Enums for Sexp types
2023-11-11 00:01:44 -05:00
JohnAFernandez 7645704ac2 Merge pull request #5753 from Baezon/moar-curves
Moar curves
2023-11-11 00:01:29 -05:00
wookieejedi b25e76cb65 Fix documentation error in On State Start (#5789) 2023-11-10 19:46:55 -05:00
BMagnu a9cfd27455 Expose more submodel instance and submodel attributes and functions to Lua (#5766)
* Add global to local for matrices

* Add lua integration

* Get Submodel from Submodel instance

* Add submodel functions

* Add model instance from submodel instance

* Fix index

* Fix copy paste error
2023-11-11 07:23:47 +09:00
Goober5000 110f609dea Merge pull request #5701 from Goober5000/jumpnode_constify
add const where appropriate to the jump node API
2023-11-09 17:52:30 -05:00
Birk Magnussen ba3ac66958 X compile error 2 2023-11-09 23:43:09 +01:00
Birk Magnussen 274366c8ad X compile error 2023-11-09 23:39:26 +01:00
Birk Magnussen df285b7ae1 Fix rebase errors 2023-11-09 23:14:08 +01:00
Birk Magnussen 7eec846b3d readd hudtarget 2023-11-09 22:56:47 +01:00
Birk Magnussen 25a9f6abe2 Avoid OGL errors 2023-11-09 22:56:07 +01:00
Birk Magnussen f0737f1b87 Tidyup, Linux init code is now tested 2023-11-09 22:56:07 +01:00
Birk Magnussen dbefa6d333 Actually init GLX 2023-11-09 22:56:07 +01:00
Birk Magnussen 54c0680b2a Fix HUD speed 2023-11-09 22:56:06 +01:00
Birk Magnussen 058cec3d2c Make VR 2D-Screen Auto recenter 2023-11-09 22:56:06 +01:00
Birk Magnussen a73cc9bfce Add option for window-scaling 2023-11-09 22:55:27 +01:00
Birk Magnussen 245ac3f6b3 Safe type conversions 2023-11-09 22:53:59 +01:00
Birk Magnussen ee6159c685 Fix incorrect print order 2023-11-09 22:53:59 +01:00
Birk Magnussen 68f9d90629 Proper swapchain AR detection 2023-11-09 22:53:59 +01:00
Birk Magnussen 2523218fdc Fix interfacing with the very segfaulty oculus runtime 2023-11-09 22:53:59 +01:00
Birk Magnussen b323760659 HUD offset never makes any sense 2023-11-09 22:53:54 +01:00
Birk Magnussen 5a93f78933 Mac Compile 2023-11-09 22:52:56 +01:00
Birk Magnussen e99341d79f Fix compile issues 2023-11-09 22:52:56 +01:00
Birk Magnussen 54a188d46a Try fixing compile on mac 2023-11-09 22:52:55 +01:00
Birk Magnussen f686046a1d Properly force VR AR 2023-11-09 22:52:51 +01:00
Birk Magnussen 61f8e0370b Fix Warning again again 2023-11-09 22:52:19 +01:00
Birk Magnussen 397125fc6e Fix Warning again 2023-11-09 22:52:19 +01:00
Birk Magnussen 6f458d5398 Fix Warning 2023-11-09 22:52:19 +01:00
Birk Magnussen 1223808a14 Need to output linear for OpenXR 2023-11-09 22:52:18 +01:00
Birk Magnussen 19c4c6edba Make sure scripts have correct Proj_fov 2023-11-09 22:50:59 +01:00
Birk Magnussen bfeb86f017 Properly apply asymmetric FOV to g3_rotate_ functions 2023-11-09 22:50:29 +01:00
Birk Magnussen e7ded2b4cd Integrate per-eye fov overrides 2023-11-09 22:49:44 +01:00
Birk Magnussen b2d1da6701 Enable Asymmetric Projection FOV 2023-11-09 22:49:41 +01:00
Birk Magnussen d0086c31b8 Fix asymmetric top-down fov and add logging 2023-11-09 22:48:55 +01:00
Birk Magnussen d9786f8aae Clang 2023-11-09 22:48:54 +01:00
Birk Magnussen fe916eb7ce Fix Warnings 2023-11-09 22:48:54 +01:00
Birk Magnussen a476897963 Fix BUild Issues 2023-11-09 22:48:54 +01:00
Birk Magnussen e404f32c7b Add warning if extension is not present 2023-11-09 22:48:54 +01:00
Birk Magnussen 77a2f5345f Fix HUD Message Head 2023-11-09 22:48:17 +01:00
Birk Magnussen 41efb57879 Lead indicator slew 2023-11-09 22:47:05 +01:00
Birk Magnussen 729aa2f6f7 Fixup HUD for slewing 2023-11-09 22:45:07 +01:00
Birk Magnussen 346ce5c975 Fix lighting 2023-11-09 22:43:51 +01:00
Birk Magnussen d1d64a0afb Autoslew HUD 2023-11-09 22:43:51 +01:00
Birk Magnussen 94cd6cf8bb Fix retail stars and screenshake 2023-11-09 22:43:51 +01:00
Birk Magnussen 9b09818b49 Cleanup 2023-11-09 22:43:50 +01:00
Birk Magnussen 1ab0d74939 Static linkage on Linux 2023-11-09 22:43:50 +01:00
Birk Magnussen 474db9e184 Fix mouse cursor rendering 2023-11-09 22:43:50 +01:00
Birk Magnussen 36cb7a62d6 Fix OpenGL Errors 2023-11-09 22:43:50 +01:00
Birk Magnussen cb1f1e9c0b Build Warnings 2023-11-09 22:43:49 +01:00
Birk Magnussen 9dc291569f Make OpenXR session creation build on llinux 2023-11-09 22:43:49 +01:00
Birk Magnussen 5da1a075ad Restore Debug timers 2023-11-09 22:43:31 +01:00
Birk Magnussen ad05ce147e Tidy up code 2023-11-09 22:43:31 +01:00
Birk Magnussen 9a227de872 Add option to scale down HUD in OpenXR mode 2023-11-09 22:43:30 +01:00
Birk Magnussen d4ca441449 Add graphics stubs 2023-11-09 22:43:30 +01:00
Birk Magnussen 4ea99eb461 Properly init HMD FoV 2023-11-09 22:43:27 +01:00
Birk Magnussen e01dabeb59 Lock VR behind flag 2023-11-09 22:42:46 +01:00
Birk Magnussen 27e80a3fff Fix VR coordinate transforms 2023-11-09 22:42:46 +01:00
Birk Magnussen 3ab8cb097c 2D flats as plane in space 2023-11-09 22:42:46 +01:00
Birk Magnussen 3721f8165d Basic Stereoscopy 2023-11-09 22:42:43 +01:00
Birk Magnussen f94119d722 Properly init OpenXR and just blit the backbuffer to both eyes for now 2023-11-09 22:40:19 +01:00
Birk Magnussen 5e78054a66 Properly init an OpenXR session, at least on Win32 2023-11-09 22:40:19 +01:00
Birk Magnussen cfe64748a4 Add Graphics abstraction layer 2023-11-09 22:40:18 +01:00
Birk Magnussen 7a281781e3 Make OpenXR linkable 2023-11-09 22:40:18 +01:00
Birk Magnussen a859192587 Basic OpenXR initialization 2023-11-09 22:39:58 +01:00
Goober5000 fa49d05e0c feedback 2023-11-09 15:48:43 -05:00
Goober5000 d8ff77f57f Merge pull request #5782 from Goober5000/build_fixes
a few build fixes
2023-11-09 15:27:38 -05:00
Birk Magnussen fdc8c246f5 Add OpenXR 2023-11-09 20:15:25 +01:00
BMagnu 395aadba6b Merge pull request #5676 from BMagnu/window_resolution
Add command line option for window resolution
2023-11-10 04:13:44 +09:00
Birk Magnussen 1625d86ad7 new res argument 2023-11-09 18:47:57 +01:00
Goober5000 187d24c2f4 rcs thruster refactor
Here's some low-hanging fruit for reducing the memory footprint of `ship_info`.  This turns the maneuvering thrusters array into a vector, refactors the names a bit, fixes thruster activation when `-nosound` is active, reduces the number of calls to `ship_get_thruster_status`, adds some const-correctness, and converts the timestamps to the new system.
2023-11-09 12:44:40 -05:00
mjn-mixael 47ac8a56a0 Some cleanup 2023-11-09 10:26:32 -06:00
JohnAFernandez 72ccbff147 Merge pull request #5781 from MjnMixael/mainhall_input_control
Mainhall ignore input
2023-11-09 09:51:39 -05:00
JohnAFernandez 9960d4bc9f Merge pull request #5755 from Baezon/particle-parent-size-factor
Allow particles to inherit size and lifetime
2023-11-09 09:50:27 -05:00
JohnAFernandez 2334138b99 Merge pull request #5774 from Baezon/lua-burst-params
Add lua burst values
2023-11-09 09:49:56 -05:00
Goober5000 a0b7134b9b refactor argument functions
Move some special-arg helper functions to sexp.h, as requested by jg18.  While we're at it, also refactor the names and add documentation.
2023-11-08 22:46:25 -05:00
Goober5000andJohnAFernandez b20efdec80 Update code/utils/HeapAllocator.cpp
Co-authored-by: JohnAFernandez <[email protected]>
2023-11-08 20:08:37 -05:00
Goober5000 b546dcf949 Merge pull request #5773 from Goober5000/frand_to_Random
convert some instances of frand_range to Random::next
2023-11-08 19:58:31 -05:00
Goober5000 15329b9564 Merge pull request #5786 from BMagnu/fix_headani
Fix wingman headanis
2023-11-08 19:58:19 -05:00
Goober5000 94bd1af5cd Merge pull request #5785 from Goober5000/waypoint_list_fix
fix invalid pointer access to waypoint lists
2023-11-08 19:57:55 -05:00
Birk Magnussen 367f48cf2f fix warning 2023-11-08 20:07:55 +01:00
Birk Magnussen eff00035fa Fix wingman Headani's when they're scaled up 2023-11-08 19:56:58 +01:00
Goober5000 ba2c2f03fb add index check 2023-11-08 13:39:00 -05:00
Goober5000 309bf0b3ea fix invalid pointer access to waypoint lists
Previously (since 2012!) a waypoint would store its parent list as a pointer.  However, this pointer can become invalidated if the waypoint list vector is resized.  To prevent this, store the parent list as an index.

This also renames the waypoint's `objnum` field to `m_objnum` to match the naming of the other fields.
2023-11-08 13:34:56 -05:00
Taylor Richards b62c49ec81 add version check to fix older ffmpeg versions (#5784) 2023-11-08 13:29:50 -05:00
mjn-mixael e34c82d7d1 bool + static cast 2023-11-08 09:25:22 -06:00
mjn-mixael 67e00da79b mainhall ignore input 2023-11-08 08:57:31 -06:00
JohnAFernandez 8528bfe750 Merge pull request #5777 from MjnMixael/hide_yo_jumpnode
Only untarget jumpnode if we're in a mission
2023-11-07 19:14:58 -05:00
Goober5000 37c344a127 a few build fixes
1. use `SIZE_T_ARG` instead of `"%lu"`; should fix format warning in #5780
2. since `HeapAllocator::checkRangesMerged()` has no effect unless running in debug, `#ifdef` out the function; should fix CI warning in #5778
2023-11-07 17:51:55 -05:00
Goober5000 b5b922cbf0 Merge pull request #5779 from Baezon/fix-collision-bug
Fix collision bug
2023-11-07 17:19:15 -05:00
Asteroth 1cbeae2cd9 make sure these remain copies 2023-11-07 15:52:36 -05:00
Goober5000 4292303018 Merge pull request #5776 from Goober5000/fred_import_fixes
FRED import fixes
2023-11-07 15:30:27 -05:00
Jonas Frei 3ebdc51c48 Don't ignore user-set -O* flags 2023-11-07 21:21:28 +01:00
mjn-mixael 6e8ab64523 only untarget if we're in a mission 2023-11-07 08:33:44 -06:00
Asteroth 1b04d9f22c trigger state 2023-11-07 01:22:44 -05:00
Goober5000 4013cf6046 FRED import fixes
Some patches for mission imports:
1. Check that the path isn't empty (the user didn't select "This PC") before continuing
2. Count successful imports
3. Avoid treating an import as a newly saved single mission unless the import was successful
2023-11-07 01:09:10 -05:00
Goober5000 26df8e9a45 assert -> assertion 2023-11-06 13:24:06 -05:00
Goober5000 bb3e3eadfc additional optimizations 2023-11-06 13:24:06 -05:00
Goober5000 b5e215a85c optimization for checking whether subsystems are blown
In many calls to `ship_get_subsystem_strength`, the caller doesn't care about the actual number, just whether the subsystem type is destroyed.  So this adds an optimization to check specifically for that.  In the case of `SUBSYSTEM_ENGINE`, this avoids an iteration over every subsystem on the ship which, for a ship with many turrets, can be significant.
2023-11-06 13:24:04 -05:00
Goober5000 da4eeb3582 Merge pull request #5771 from Goober5000/const_modelcollide
protect model_collide input values
2023-11-06 13:07:45 -05:00
Goober5000 dc578c2479 Merge pull request #5772 from Goober5000/const_eeo
protect eval_enemy_obj_struct input values
2023-11-06 13:07:34 -05:00
BMagnu 3522f3be91 Removed unused variables (#5775) 2023-11-06 18:05:11 +00:00
Goober5000 bd52d75ab9 tweaks 2023-11-06 11:37:01 -05:00
JohnAFernandez a54dc0ded7 Merge pull request #5767 from BMagnu/scripting_in_mission_state
Add a scripting-in-mission state
2023-11-06 11:07:59 -05:00
Goober5000 c076cd11f1 feedback 2023-11-06 10:23:50 -05:00
JohnAFernandez b42c7af847 Merge pull request #5742 from JohnAFernandez/Get-rid-of-int3s
Get rid of remaining int3s in AI code
2023-11-06 10:07:05 -05:00
John Fernandez 5893ef836c Feedback 2023-11-06 09:47:46 -05:00
Asteroth 9eeb7e7983 add burst values 2023-11-06 03:22:21 -05:00
Goober5000 71fa18927c Merge pull request #5770 from Goober5000/fix_fred_warning
fix a FRED compilation warning
2023-11-06 01:55:39 -05:00
Goober5000 ae89ed2b9d convert some instances of frand_range to Random::next
Some of the `frand_range` calls were used for integer calculations, so we can use `Random::next` now.

This also reduces the number of C-style casts in the codebase.
2023-11-06 01:48:29 -05:00
Goober5000 24a4c0df6a protect eval_enemy_obj_struct input values
Add `const` to the `eval_enemy_obj_struct` struct so its values aren't inadvertently overwritten.  Handle a bit of const-correctness propagation.  Also add default member initialization to the struct.
2023-11-06 00:05:54 -05:00
Goober5000 a5f90ddcc1 fix a FRED compilation warning
One of the Voice Acting Manager dialog's strings is now too long for the .rc file and is truncated at 256 characters.  Fortunately this can be worked around by setting it at runtime.
2023-11-05 21:43:36 -05:00
Goober5000 3fe94fc3f4 protect model_collide input values
Add `const` to the `mc_info` struct so its values aren't inadvertently overwritten.  Tweak some of the collision code to prevent overwrites.

Also remove the `flak_muzzle_flash` declaration since that function no longer exists.
2023-11-05 21:17:46 -05:00
Goober5000 f89d437506 Merge pull request #5762 from Goober5000/command_tweaks
Command fixes and tweaks
2023-11-05 20:37:35 -05:00
Birk Magnussen 86a8c1c6f5 Make this a pushing state, not a setting state 2023-11-05 23:42:35 +01:00
Birk Magnussen f72fb68615 Also add the state name 2023-11-05 23:13:35 +01:00
Birk Magnussen 3447b76736 Also change header 2023-11-05 22:23:06 +01:00
Birk Magnussen 7dd52a4214 Add scripting state that does not end mission 2023-11-05 22:04:23 +01:00
Birk Magnussen 8671b9e2f7 Make res parsing a warning 2023-11-05 17:40:15 +01:00
Goober5000 b861989fb6 Merge pull request #5764 from Goober5000/tweak_soundtrack_warning
two small tweaks
2023-11-05 11:12:12 -05:00
Goober5000 1c8a272eca two small tweaks
1. Update soundtrack message to make it easier for modders to track down missing files
2. Update sexp help for ai-stay-near-ship to show the right argument count
2023-11-04 21:05:54 -04:00
Goober5000 221b0dc7ee Command fixes and tweaks
In a few places where the game checks for the command sender, it should check for #Command as well, as long as the mission flag to override #Command is present.

Additionally, while the mission's command sender was originally intended to be a ship, it has been used to specify an alternative to #Command as well.  But this caused problems when the "override #Command" mission flag was active, as it transformed a hashed source into a non-hashed source.  So this commit adds a check to treat the source as hashed, if necessary, if a replacement has occurred.

Fixes #5749.
2023-11-03 17:27:20 -04:00
John Fernandez 0a5cf6ad9d Try the std moves suggested by Coverity
For many coverity issues
2023-11-03 14:40:04 -04:00
JohnAFernandez 2cb12b8ff7 Merge pull request #5593 from MjnMixael/rank_display_names
Rank display name and title
2023-11-03 14:34:55 -04:00
JohnAFernandez 9f173e8cd9 Merge pull request #5750 from MjnMixael/log_timer_padding
Provide a way to account for timer padding in the mission log
2023-11-03 14:34:17 -04:00
JohnAFernandez 6588daaca5 Merge pull request #5758 from JohnAFernandez/Coverity-Improper-Use-Of-Negative
Coverity improper use of negative
2023-11-03 14:32:36 -04:00
JohnAFernandez 9cd648a206 Merge pull request #5760 from TheForce172/fix/5759
Fix #5759 Sticky Support Ship
2023-11-03 14:32:13 -04:00
The Force 44c797f65b Disable support hud when Force rearm done 2023-11-03 14:10:00 +00:00
The Force 46b9c27dfe Fix #5759
Code should only be run in Dock stage 4.
also add extra check if ship is repairing itself
2023-11-03 12:48:57 +00:00
John Fernandez 33e3b13d43 More limited check 2023-11-02 23:27:46 -04:00
John Fernandez 8351d4f623 Ensure we don't use bad indexes in argument_of ops
For coverity 1523820
2023-11-02 23:22:28 -04:00
John Fernandez e0443739bd Always double check that active_goal is positive
Both branches of this ternary assume that it's positive.  Coverity 1523821
2023-11-02 22:42:02 -04:00
JohnAFernandez 80a206151c Merge pull request #5752 from MjnMixael/global_disable_loadout_restoration
Mod setting to disable FSO's internal loadout restoration
2023-11-02 19:25:46 -04:00
JohnAFernandez 64a592d0d5 Merge pull request #5756 from MjnMixael/custom_data_bounds_check
Missed a couple out of bounds checks
2023-11-02 19:25:27 -04:00
JohnAFernandez c30559a63a Merge pull request #5698 from Goober5000/waypoints_upgrade
Waypoints upgrade
2023-11-02 19:24:55 -04:00
JohnAFernandez 245cec5a34 Merge pull request #5694 from MjnMixael/lua_audio_upgrades
Upgrade Lua Sound Handling methods
2023-11-02 14:36:38 -04:00
JohnAFernandez ddedc1bd8e Merge pull request #5739 from MjnMixael/fix_general_order_paths
how about an if/then/else that actually works?
2023-11-02 14:34:23 -04:00
JohnAFernandez 6b71812e7b Merge pull request #5744 from JohnAFernandez/Handle-Oct30-Covscan-issues
Handle oct30 covscan issues
2023-11-02 12:19:16 -04:00
JohnAFernandez 844e9affea Merge pull request #5729 from JohnAFernandez/Fix-pointer-to-local-scope
Change the scope of this pointer
2023-11-02 12:18:53 -04:00
mjn-mixael b69cdc08ee Merge branch 'master' into loadout_no_validation
# Conflicts:
#	fred2/fred.rc
2023-11-02 09:30:42 -05:00
mjn-mixael 69d56172b0 missed a couple out of bounds checks 2023-11-02 08:27:45 -05:00
Asteroth 9d2a89f778 fix subsys position getting (#5740) 2023-11-02 08:15:39 -04:00
Asteroth adcc19085d more docs 2023-11-02 02:30:38 -04:00
Asteroth faddde8307 Merge remote-tracking branch 'upstream/master' into particle-parent-size-factor 2023-11-02 02:27:59 -04:00
Asteroth 0355d2b8d1 update docs 2023-11-02 02:27:40 -04:00
JohnAFernandez 21f42ce47b Merge pull request #5536 from MjnMixael/mission_custom_data
Mission custom data
2023-11-01 20:24:37 -04:00
Asteroth 574b1e6197 accidental shadow 2023-11-01 19:46:00 -04:00
mjn-mixael 34e57d301a Mod setting to disable FSO's internal loadout restoration 2023-11-01 17:49:04 -05:00
Asteroth dc83e4f14a few fixes 2023-11-01 18:16:38 -04:00
Asteroth 3c837b7e9a add all the curves 2023-11-01 18:08:45 -04:00
John Fernandez c7b77a5b24 Add a weekly coverity workflow
Since we removed travis ci, coverity has been unused for six years.  This allows us to submit a linux build to coverity scanning once a week.
2023-11-01 17:06:41 -04:00
mjn-mixael 5a58ff46f2 Add check to mission version 2023-11-01 15:53:04 -05:00
mjn-mixael 4145717363 Merge branch 'master' into mission_custom_data 2023-11-01 15:50:41 -05:00
mjn-mixael eca583074a update check for 23_3 data 2023-11-01 12:59:25 -05:00
mjn-mixael 723bdcb9f1 Merge branch 'master' into loadout_no_validation 2023-11-01 12:56:05 -05:00
Goober5000 cb4fe955ea change GetColor() signature 2023-11-01 11:03:04 -04:00
mjn-mixael ed83ed79ec provide a way to account for timer padding in the mission log 2023-11-01 09:35:30 -05:00
Goober5000 02669338e8 C++ casts 2023-11-01 10:03:51 -04:00
Goober5000 6e86a3a035 Merge pull request #5747 from Goober5000/directive_special_fix
make sure events are current before they become special
2023-11-01 09:36:44 -04:00
Goober5000 4f8344c91e Merge pull request #5741 from Goober5000/misc_updates
some polishing of recent changes
2023-11-01 09:36:33 -04:00
Goober5000 643d18c6f8 Merge pull request #5746 from TheForce172/fix-shader
Fix #5743
2023-11-01 09:36:24 -04:00
JohnAFernandez 8dc481d034 Merge pull request #5736 from BMagnu/alpha_mult_glow
Account for Glow and Spec maps for alpha-multiplied ships
2023-11-01 04:01:47 -04:00
JohnAFernandez 3ba2193d3f Merge pull request #5624 from MjnMixael/xstr_debug_filter
xstr debug filter
2023-11-01 03:31:06 -04:00
JohnAFernandez 8693fa37eb Merge pull request #5732 from Baezon/fix-damaged-engine-max-vel
Fix for ets changes when engines are <15%
2023-11-01 03:30:22 -04:00
JohnAFernandez 3764146957 Merge pull request #5611 from MjnMixael/force_rearm_sexp
Force rearm sexp
2023-11-01 03:29:09 -04:00
John Fernandez 50c923d397 Have fallback for !pmi 2023-11-01 03:26:30 -04:00
Goober5000 617c903cbd tweaks 2023-11-01 00:31:39 -04:00
Goober5000 b6903fbdf4 make sure events are current before they become special
There is an implicit assumption in the code that the `MEF_DIRECTIVE_SPECIAL` flag could not be set on an event until after the `MEF_CURRENT` flag was also set.  This change makes that assumption explicit, and also adds a check in `mission_process_event` to be sure the flag setting doesn't happen out of order.  This situation is very rare, but can happen if the following conditions are true:

1. there is an event directive checking for the destruction of a wing
2. the wing has multiple waves
3. the directive uses the older `is-event-true-delay` technique to control when it is displayed
4. the directive becomes temporarily true before it can be displayed and while there are still waves remaining

This previously caused the "directive special" logic to occur before the "event current" logic occurred, skipping the proper setting of `born_on_date`.

Fixes Github #5725 and Mantis 930.
2023-11-01 00:00:45 -04:00
mjn-mixael dc751a9c5d address feedback 2023-10-31 16:33:27 -05:00
Goober5000 dff0b2acb4 convert event status to enum 2023-10-31 15:56:35 -04:00
Goober5000 ea10ac157f split off the event currency functionality from Sexp_useful_number and move the setting of it 2023-10-31 14:57:48 -04:00
mjn-mixael 173a3d23e8 add comments 2023-10-31 13:36:58 -05:00
The Force 98e20c0979 Fix #5743 2023-10-31 18:07:33 +00:00
JohnAFernandez db02a829aa Fix uninitialized scalars 2 (#5737)
* Make sure we handle unknown location types

Avoids edge-case gargabe pointer 1522974

* Make sure local vectors are at least set to zero

For coverity 1522985

* Make sure from_table is initialized

When creating a replacement texture object, for coverity 1522989

* Change to Unreachable to help Linters

This was a false positive uninitialized scalar, Coverity 1523726.  Hopefully, changing to UNREACHABLE() will help linters avoid this false positive in the future.

* Initialize xyw on this struct instantiation

For coverity 1523730

* Add early return for ade_set_args if error

For coverity 1523732
2023-10-31 13:49:44 -04:00
JohnAFernandez cfe92a4d32 Fix auto copies (#5738)
* fix inefficient (auto x : container) loops

* Don't make two copies of every element...

* Fix more loops

* Last inefficient auto loops
2023-10-31 13:47:48 -04:00
John Fernandez 7f9a10a9a0 ensure that these functions can rely on pmi
For coverity 1523731
2023-10-31 13:37:23 -04:00
John Fernandez 925e2e53f4 A few more int3's 2023-10-31 13:09:03 -04:00
John Fernandez 0e7f24bcac Make sure we don't load nonsense nebulas
For coverity 1523734
2023-10-31 12:51:16 -04:00
John Fernandez b2d85b8e2f Add early return for low level bug
For coverity 1523734
2023-10-31 12:46:17 -04:00
John Fernandez e23409f5f8 Remove the final INT3's in AI code 2023-10-31 10:32:48 -04:00
John Fernandez 381e45f483 Replace remaining Int3's in aibig and aicode
Replacing with Unreachables and Assertions
2023-10-31 09:49:02 -04:00
Goober5000 2d2db58905 some polishing of recent changes
1. The player can target other object types besides ships, so when creating an `object_ship_wing_point_team`, make sure it is a ship
2. A few recent mission features require a version bump, but not all missions use these features; so do a "soft bump" where the mission version is updated only if necessary
3. Remove an unneeded #include by adding a `struct team_data` declaration (see #5599)
2023-10-30 22:59:37 -04:00
mjn-mixael 2b3da41a6d how about an if/then/else that actually works? 2023-10-30 15:46:25 -05:00
mjn-mixael 9da948be56 fix type mismatch 2023-10-30 15:16:16 -04:00
Birk Magnussen 79454fb6c4 Also Alpha-Fade Glow and Spec 2023-10-30 20:08:33 +01:00
John Fernandez 10ed12182c Change the scope of world_goal_pos
Coverity 1523195, change the scope of this variable so that the pointer is not invalidated outside of the if block.
2023-10-30 11:05:43 -04:00
John Fernandez 6038076bf0 Add current_cmeasure > -1 check
This is an actual edge case bug.  If no countermeasure was set, and then one was set, there might be a garbage timestamp set that would give an incorrect countermeasure delay on next use.
2023-10-30 10:56:45 -04:00
John Fernandez 40c8cbbb25 Add check for negative index
For coverity 1523515
2023-10-30 10:56:45 -04:00
John Fernandez bd7429c353 Get rid of Extraneous check
Coverity 1523341 is pointing out this check, but shipp->ship_info_index is checked earlier just before we set the shipp pointer on line 1243
2023-10-30 10:56:45 -04:00
John Fernandez faf130adb3 Add Assertion for Coverity 1093701 2023-10-30 10:56:45 -04:00
John Fernandez f7fef072df Feedback 2023-10-30 10:56:18 -04:00
John Fernandez 0da6a4a64c Coverity 1523287
Fall back to standard behavior if no allowed paths.

Missing bracket
2023-10-30 10:56:18 -04:00
John Fernandez f542fea96e coverity 1523419
Avoid dividing by zero when there is just one autoscale ai class
2023-10-30 10:56:18 -04:00
John Fernandez 742326e42e Coverity 1523548 Divide by zero
Make sure we only use autoscale delay if there is more than one autoscale ai class.
2023-10-30 10:56:18 -04:00
John Fernandez e25a6517fc Add a check for 0
To avoid division by zero (in dubious circumstances) explicitly check for zero.  For coverity 1523313
2023-10-30 10:56:18 -04:00
John Fernandez be0c78dc72 Add checks for options_multi_vox_plist_get
For coverity 1093612, this function *should* never return zero, but it is no catastrophic if it does.  Allowing it to return a negative value in some unknown edge case would allow it to clobber some other global data.

So now add a check for negative values and take no action if those negative values are reached.  Assert on debug.
2023-10-30 10:55:41 -04:00
John Fernandez ef681affbf Make sure we don't clobber other memory
If this index is negative one return early before we accidentally clobber other data.

Coverity 1523181
2023-10-30 10:55:41 -04:00
Asteroth 729e448fe5 review fixes 2023-10-30 02:10:18 -04:00
Asteroth 96ae3d0608 Revert "fix subsys pos finding for improved subsys attack pathing"
This reverts commit 55ed0a08f6.
2023-10-30 00:44:37 -04:00
Asteroth 55ed0a08f6 fix subsys pos finding for improved subsys attack pathing 2023-10-30 00:44:22 -04:00
Goober5000 3a2ac5ab5f Merge pull request #5726 from Goober5000/persona_index_check
check for out-of-range persona
2023-10-30 00:01:03 -04:00
Goober5000 435676a67d Merge pull request #5730 from Goober5000/class_type_check
make sure class_type exists when used
2023-10-30 00:00:47 -04:00
Asteroth c017ef9b8a fix for ets changes when engines are <15% 2023-10-29 23:54:36 -04:00
Goober5000 4fbe3b7131 make sure class_type exists when used
A mission in Mantle caused an invalid vector access when checking whether to vaporize a ship whose ship type was -1.  Turns out having "no type" is actually allowed, so I audited all `class_type` accesses throughout the code for potential -1 accesses.  Most were properly checked but a few were not.  A few others needed to be tweaked.

(I suspect this is something that would be on the Coverity list if it isn't already.)
2023-10-29 15:17:22 -04:00
Birk Magnussen e071603ac0 Multiply emissive with alpha 2023-10-29 10:29:01 +01:00
Goober5000 87a4ae1e41 check for out-of-range persona
For missions which use the Persona Index method, make sure the mod doesn't load a persona index that is out of range for the personas it knows about.
2023-10-28 21:23:25 -04:00
mjn-mixael c738941ccf Provide Lua a way to toggle the mainhall help overlay 2023-10-28 19:16:09 -04:00
John Fernandez 5c25bb9bcb Just use the already existing SCP_string
The destination strings in player_order are already SCP_strings, so no need to use manual allocation
2023-10-28 19:15:25 -04:00
John Fernandez e0bc6d0ed7 Fix memory leak in tga file writing
Yes.  I know, I know, we're not going to use this code anymore.  But just in case, I don't want this memory leak to have the possibility to exist in the future.
2023-10-28 19:15:25 -04:00
mjn-mixael e6792ab441 Merge branch 'master' into lua_dynamic_enums
# Conflicts:
#	code/parse/sexp.cpp
#	code/parse/sexp.h
#	fred2/sexp_tree.cpp
#	fred2/sexp_tree.h
#	qtfred/src/ui/widgets/sexp_tree.cpp
#	qtfred/src/ui/widgets/sexp_tree.h
2023-10-28 17:50:26 -05:00
Mike Nelson ec706a6a87 Allow SCPUI saving current player data to file (#5718)
* Allow saving current player data to file

* return nil, dummy

* unused
2023-10-27 07:32:37 -04:00
John Fernandez 5d0127a764 Fix workflow by adding reference branch 2023-10-26 23:41:28 -04:00
Mike Nelson 91c15e6f48 Player general orders (#5638) 2023-10-26 19:22:44 -04:00
Asteroth a9fc7bab8a fix for particle culling (#5719) 2023-10-26 16:08:09 -04:00
Taylor Richards 042c85d213 revert workaround for the windows runner breakage (#5722) 2023-10-26 13:53:27 -04:00
Goober5000 bb3d59ecbe Merge pull request #5715 from Baezon/fix-hud-target-triangle
Bugfix HUD target direction triangle
2023-10-25 23:19:26 -04:00
Goober5000 d1c57391cf Merge pull request #5699 from Goober5000/handle_shuffled_parse_objects
handle parse objects that are out of order
2023-10-25 23:18:19 -04:00
mjn-mixael 5d6c34c2ab Upgrade lua sound handle with pause/resume methods and channel selection 2023-10-25 08:31:06 -05:00
Mike Nelson 5986b7143f Adds custom data for intel entries (#5660)
* adds custom data for intel entries

* update tests

* This one, too
2023-10-25 07:32:03 -04:00
wookieejedi 5d447951b4 Add Game Option to refresh selected weapon in loadout (#5713)
* Add Game Option to refresh selected weapon in loadout

This PR adds an option to always ensure the viewed weapon is one that can actually be on the selected ship when first clicking on the weapon loadout.

If you go to the loadout in the briefing and view the weapons on your ship, then go and change your ship class and go back to the weapon loadout screen, you will see that the weapon shown in the window on the right side is from your very first viewing before you changed your ship class. Displaying a weapon not allowed on a ship by default can be confusing to players, especially on mods like FotG where most ships have unique weapons.

The player can still of course click on a non-allowed weapon to view it, but with this PR the player will be initially shown a selected weapon that is allowed on the ship when opening the loadout editor.

Tested and works as expected.

* update order to be near weapon bools
2023-10-25 07:31:23 -04:00
Sébastien Noel f149c36b44 Fix a few typos (#5598) 2023-10-24 20:33:45 -04:00
Asteroth 34b6cf74ab whoops forgot the rval 2023-10-24 15:16:12 -04:00
Asteroth bc33f90e32 early return if z is 0 2023-10-24 14:32:56 -04:00
MageKing17 bb47531c55 Make lock_fov settable for aspect/javelin missiles. (#5493)
The code has always checked a per-weapon-class value called `lock_fov` when comparing the dot product of a ship to its target to see if it can lock on to it, however the weapon table hasn't ever included a way to set this value; it's always the default value of 0.85. This just adds "+Lock FOV:" entries to aspect/javelin homing missile parsing after "+Seeker Strength:", which will set `lock_fov` as long as the supplied input is between 0 and 360 degrees.
2023-10-24 07:26:54 -04:00
Asteroth aed90493ec make g3_project_vertex unconditionally project 2023-10-23 17:53:30 -04:00
John Fernandez d54c3e51e3 Apply Workaround to windows Build 2023-10-23 15:47:27 -04:00
Goober5000 a215bea0d0 unswap the net signatures 2023-10-23 15:29:06 -04:00
Goober5000 ec23f6bd0e Merge pull request #5709 from Goober5000/fix_loadout_crash
fix a crash in the apply-loadout-to-wing routine
2023-10-23 12:21:30 -04:00
John Fernandez d93d56e1c9 remove redundant setting of object_host 2023-10-23 10:24:13 -04:00
John Fernandez d2265325e9 check for nullptr to avoid nullptr dereference
For coverity 1093467
2023-10-23 10:24:13 -04:00
John Fernandez 2bb22a2153 Return to avoid nullptr dereference
For coverity 1093461.  If this is null, the function is done at this point.
2023-10-23 10:24:13 -04:00
John Fernandez 018c22eee1 Make sure Net_player is not null here
For coverity 1093460. Net_player should never be null here, but it is C++ after all.
2023-10-23 10:24:13 -04:00
John Fernandez 6ef60c67ca Make sure Multi_pxo_channels is not null
For coverity 1093458
2023-10-23 10:24:13 -04:00
John Fernandez 982e8d7f85 Add net_player nullptr check
Address coverity 1093457 by adding a nullptr check and Assertion.  This *should* never happen, but that's what asserts are for, right?
2023-10-23 10:24:13 -04:00
John Fernandez 8affd53cf6 Remove Unused Functions
These functions have not been called from what I can tell since the source code was released.  But they did happen to trigger a clang warning, so it's time to get rid of them.
2023-10-23 07:50:29 -04:00
Mike Nelson eeaf894b15 Message notes feature (#5541)
* Add stage notes feature for mission messages

* don't keep notes outside the mission editor

* use F_MULTITEXT and do lcl_replacements

* this should be multitext too
2023-10-23 07:38:33 -04:00
Goober5000 b546d897ae fix a crash in the apply-loadout-to-wing routine
If a wing has fewer than four ships, clicking the apply-to-all button will cause a vector subscript out of range error.  This fixes it.
2023-10-23 00:44:33 -04:00
John Fernandez d8aea4ad30 Add CMakePresets.json to gitignore 2023-10-22 22:54:24 -04:00
Goober5000 829692b7bd Merge pull request #5468 from Goober5000/5462_followup
additional cleanup from PR 5462
2023-10-22 17:10:42 -04:00
Goober5000 855935d4eb Merge pull request #5706 from Goober5000/fix_5705
fix change-soundtrack after <No Music>
2023-10-22 16:12:30 -04:00
Goober5000 f83efb54c0 fix change-soundtrack after <No Music>
The fix in #5578 assumed that a previously playing soundtrack would properly set the timestamp, but if no soundtrack was previously played at all, this wouldn't happen.  So if we deliberately don't play a soundtrack, be sure to set the timestamp as if `event_music_do_frame()` had been called.

Fixes #5705.
2023-10-22 15:31:02 -04:00
Mike Nelson 3ca26587eb add default player weapon flag (#5600) 2023-10-22 13:23:30 -04:00
John Fernandez 3e2bb36d4b Fix Redefined Macro Warning
Clarify
2023-10-22 00:37:18 -04:00
Goober5000 02bd62ff3c Merge pull request #5700 from Goober5000/special_to_supercap
change "special warp physics" to "supercap warp physics"
2023-10-21 17:34:20 -04:00
Goober5000 e1e0239914 also the dialog text 2023-10-21 16:40:31 -04:00
Goober5000 17ad0e09dd add const where appropriate to the jump node API
See title.
2023-10-21 15:59:24 -04:00
Goober5000 e621dbe997 Merge pull request #5464 from Goober5000/render_constify
add const where appropriate to the modelrender API
2023-10-21 15:57:24 -04:00
Goober5000 ea5c328c13 change "special warp physics" to "supercap warp physics"
Per discussion with @Baezon, this is a more precise term.
2023-10-21 15:51:16 -04:00
Goober5000 8c0bc25303 Merge pull request #5671 from Goober5000/subsystem_calculation_fix
add "Calculate subsystem hitpoints after parsing" option
2023-10-21 14:08:37 -04:00
Goober5000 6b0a3b7606 handle parse objects that are out of order
Occasionally, FRED can save a mission with a wing's ships out of order; this can happen if ships are deleted and FRED finds a free index in the middle of the ship list.  This can cause benign but confusing mismatches in the ship registry, the hotkey list, and other places -- and it's also possible some mismatches may not be so benign, e.g. in multiplayer.  Anyway, it's better for the ships to appear in the order the wing expects them, so this adds a routine to swap them around if necessary.
2023-10-21 13:40:09 -04:00
Mike Nelson 9afe76b5d2 force msaa in-game toggle to require restart (#5688) 2023-10-21 11:44:15 -04:00
Mike Nelson ad27664ebc Pause and Resume voices (#5636)
* pause and resume voices

* Use newer styling rather than the sound.cpp styling
2023-10-21 10:23:53 -04:00
Goober5000 2fe182a4b1 Merge pull request #5604 from Goober5000/drawString_tweak
small speedup to drawString
2023-10-21 01:28:23 -04:00
Goober5000 60c2718b91 add spacing 2023-10-20 23:26:46 -04:00
Tyler Blount 15d9b9b3db Merge pull request #5689 from MjnMixael/fix_lightshafts_optimization
Fix lightshafts and bloom in-game options
2023-10-20 15:09:03 -07:00
mjn-mixael a0c787aa83 Merge branch 'master' into lua_dynamic_enums 2023-10-20 16:13:15 -05:00
mjn-mixael d00003e199 Merge branch 'master' into fix_lightshafts_optimization 2023-10-20 16:11:34 -05:00
Tyler Blount 991d0ee2d6 Merge pull request #5696 from MjnMixael/deferred_lighting_ingame
Add deferred lighting as an in-game option
2023-10-20 14:09:33 -07:00
Goober5000 ee27abf693 make CI happy 2023-10-20 16:23:50 -04:00
Goober5000 6bcd2f730c update qtfred 2023-10-20 15:51:29 -04:00
Goober5000 c8d78816b0 remaining const updates 2023-10-20 15:32:46 -04:00
mjn-mixael 3eee74a31c remove unneeded header 2023-10-20 14:16:22 -05:00
mjn-mixael 941d5f7ec3 Move the option definition to a file that doesn't require glad.h for building and resolve xstr issue 2023-10-20 14:01:50 -05:00
Goober5000 b53f3fc803 handle ship_return_seconds_to_goal for WPF_BACKTRACK 2023-10-20 14:58:18 -04:00
Goober5000 d1f0b9343f change iterators 2023-10-20 14:58:18 -04:00
Goober5000 0b2d4768f3 new sexp for waypoint index and backtrack 2023-10-20 14:58:17 -04:00
Goober5000 42fc9891e3 waypoint upgrades 2023-10-20 14:58:17 -04:00
Asteroth 0cde26dd6e make invalid model_subsystem model nums a hard error (#5591) 2023-10-20 14:40:48 -04:00
Mike Nelson 7804f7fff5 add feature to always display the damage gauge (#5518) 2023-10-20 14:40:27 -04:00
Asteroth 832cec27ad bugfix missile time determination (#5595) 2023-10-20 14:40:02 -04:00
Mike Nelson 31acb115c2 Add nebula-fade-poof SEXP (#5612)
* nebula-fade-poofs

* Move this up because order of operations is important.

* Add some documentation

* Respect time compression

* Fix sexp description

* Make sure faded poofs do not flicker

* optimize
2023-10-20 14:39:38 -04:00
Goober5000 f9591b3a92 Merge pull request #5664 from Goober5000/fix_cheat_status
fix incorrect setting of disabled/disarmed flags when cheating
2023-10-20 14:27:37 -04:00
mjn-mixael 21f92194f1 Add deferred lighting as an in-game option 2023-10-20 12:38:53 -05:00
wookieejedi c605451460 Fix glare shining through cockpits in freelook (#5690)
Fixes #3098. The `shipfx_eye_in_shadow` function did a collision check for cockpits, bit did not previously take into account of the viewpoint had a non-forward orientation (ie the player was using free look). This PR sets the collide check to take that into account with a 1 line fix. Tested with multiple FotG cockpits and fixes the issue.
2023-10-20 07:39:25 -04:00
Taylor Richards 2acdc65875 add workaround for broken windows workflow (#5693)
Temporary fix for broken windows workflow. Hopefully a more permanent
solution will be found soon and we can then remove this.

Reference: https://github.com/actions/runner-images/issues/8598
2023-10-19 17:39:04 -04:00
Goober5000 b7de2fd644 Merge pull request #5554 from Goober5000/set_armor_type_generic
enhance set-armor-type to work with generic subsystems
2023-10-19 14:09:50 -04:00
Tyler Blount a226a81d80 Merge pull request #5692 from JohnAFernandez/master
Revert one "Fix" and add comments
2023-10-19 09:25:36 -07:00
John Fernandez eb39532f7c Revert one "Fix" and add comments
Only one of these was an actual memory leak.

Add comments to clarify
2023-10-19 11:42:24 -04:00
JohnAFernandez 1478ace3e0 Avoid edge case divide by zero (#5683)
* Add a divide by zero check

For coverity 1107324.  Keeps framecount from dividing by zero in very rare circumstances.

* Add a clarifying comment

This marks isNaturalNumberFactor() so that we know it is the best way to get whether a number is a natural number.

Modulo division is slower and gives the same results.

* Spoiled by Rust
2023-10-19 07:57:12 -04:00
JohnAFernandez 7edc5bf842 Change underlying type to avoid endianness problem (#5680)
Before this change if the wrong endianness was used, the c style cast that was used here would lead to the argument being passed to getsockopt to lack the actual information.

Fixes coverity 1093482

(Directly cast to socklen_t)
2023-10-19 07:56:21 -04:00
JohnAFernandez b8dc7d643d Fix two small memory leaks (#5679)
Fixes 1093679 and 1093680 from coverity by freeing if an early return is reached.
2023-10-19 07:55:23 -04:00
Goober5000 883ed32796 ai-disable-ship-tactical and ai-disarm-ship-tactical (#5512)
Add "tactical" versions of disable and disarm goals which only perform the specific task without implying anything else.  The target ship is not protected and attack goals are not cleared from other ships.

There is also a new AI profiles flag to make this the default hud squad message command instead of the classic disable/disarm.
2023-10-19 07:50:49 -04:00
Mike Nelson f3dfc85c0f weapon ignores countermeasures flag (#5628) 2023-10-19 07:49:06 -04:00
mjn-mixael bfd261a1d3 Merge branch 'master' into lua_dynamic_enums
# Conflicts:
#	code/parse/sexp/LuaSEXP.cpp
2023-10-18 23:11:39 -05:00
mjn-mixael e32ea7b694 Merge branch 'master' into fix_lightshafts_optimization
# Conflicts:
#	code/graphics/post_processing.cpp
2023-10-18 23:09:43 -05:00
Tyler Blount 7ef70f6d4d Merge pull request #5627 from MjnMixael/new_controls_xstrs
Add built-in xstrs for SCP-added controls
2023-10-18 20:21:49 -07:00
Tyler Blount 1b1afbf8d7 Merge branch 'master' into new_controls_xstrs 2023-10-18 19:51:26 -07:00
Tyler Blount bfdf05469b Merge pull request #5622 from MjnMixael/scpui_options_localization
SCPUI Options Localization
2023-10-18 19:50:43 -07:00
mjn-mixael aee48373ab Make sure these post processing variables are not optimized out of non Debug builds 2023-10-18 15:07:21 -05:00
mjn-mixael a2f1638a99 adjust XSTR IDs 2023-10-18 13:55:46 -05:00
mjn-mixael 762cf4cb88 We'll get this right eventually 2023-10-18 13:45:55 -05:00
mjn-mixael 705287c8d4 "nothing" to see here 2023-10-18 13:26:05 -05:00
mjn-mixael e2aac31912 Merge branch 'master' into scpui_options_localization
# Conflicts:
#	code/camera/camera.cpp
2023-10-18 12:49:48 -05:00
Tyler Blount a9f5a11813 Merge pull request #5686 from MjnMixael/lua_add_scrollback
Lua add scrollback
2023-10-18 10:21:01 -07:00
mjn-mixael b8728ed828 get team rather than team index 2023-10-18 08:59:24 -05:00
mjn-mixael de1110650f Adjust XSTR IDs per feedback 2023-10-18 08:42:25 -05:00
BMagnu b3295e5a2d Fix near z planes for the cockpit rendering (#5654)
* Properly unify cockpit near planes

* Properly pass near plane to deferred shader
2023-10-18 08:08:22 -04:00
Tyler Blount a6c1b1b04a Merge pull request #5605 from naomimyselfandi/more-message-filters
More message filters
2023-10-18 00:36:24 -07:00
Goober5000 b5fdf52e8c Merge pull request #5428 from Goober5000/remove_key_save
remove hud_squadmsg_save_keys()
2023-10-18 03:25:09 -04:00
Goober5000 c43f5bdd58 Merge pull request #5516 from Goober5000/pof_version_fix
POF version fix
2023-10-18 03:24:55 -04:00
Tyler Blount dc7fc774b8 Merge pull request #5662 from MjnMixael/on_intro_hook
Intro about to play hook
2023-10-18 00:24:44 -07:00
Goober5000 dad16f76c4 Merge pull request #5574 from Goober5000/generateWeaponGroupId
add mn.generateWeaponGroupId()
2023-10-17 20:06:27 -04:00
Goober5000 d10c59f6cc Merge pull request #5629 from Goober5000/arrival_warp_distance
add support for predicting arrival warp distance
2023-10-17 20:06:17 -04:00
Goober5000 3bd2fc9a56 Merge pull request #5677 from Goober5000/fix_5529
rewrite primary weapon cycling
2023-10-17 20:06:10 -04:00
Goober5000 fabff58d09 Merge pull request #5684 from Goober5000/prevent_repeated_death
don't kill/self-destruct ship if it's already dying
2023-10-17 20:05:29 -04:00
Mike Nelson 2fd3bf091d add waytpoint as allowed lua sexp parameter type (#5631) 2023-10-17 19:28:40 -04:00
Mike Nelson b4442d3423 double the allowed cargo (#5626) 2023-10-17 19:27:43 -04:00
Mike Nelson cf4cae7264 add dkjson as a default lua file (#5534) 2023-10-17 19:26:39 -04:00
Mike Nelson ebea1b1240 remove new lines from default generated mission (#5519) 2023-10-17 19:25:06 -04:00
mjn-mixael 54341acb9b allow use of enums 2023-10-16 15:54:53 -05:00
mjn-mixael 07fd188064 lua method to add a message directly to the message log.
(cherry picked from commit 1caceeaa2b9ebe654a102e293146dc23b9f3c2ee)
2023-10-16 15:21:37 -05:00
BMagnu 0cbe06884b Allow to Capture Mouse in FSO window (#5678)
* Allow to capture mouse, and also make window present

* Fix Typo
2023-10-17 03:57:21 +09:00
Goober5000 c1d3e5a2ad Merge pull request #5597 from Goober5000/maneuver_despite_engines
add a maneuver-despite-engines flag
2023-10-16 14:40:05 -04:00
Naomi Coffman 2bcedc34cc Respond to PR feedback 2023-10-16 12:36:48 -04:00
Goober5000 16892c3e46 Merge pull request #5670 from Goober5000/fly_to_ship_upgrade
fix and upgrade ai-fly-to-ship
2023-10-16 04:26:23 -04:00
Goober5000 5c88b75b94 Merge pull request #5524 from Goober5000/splash_aspect_ratio
aspect-ratio-specific splash screens
2023-10-16 03:26:10 -04:00
Goober5000 987c705bc9 address feedback 2023-10-16 03:24:53 -04:00
Goober5000 b89cbbd530 fix and upgrade ai-fly-to-ship
The ai-fly-to-ship goal was added early in FSO's development but never worked right.  Until recently it could crash; and even aside from the crash the AI would try to reach the target's exact position, causing repeated collisions.  This folds ai-fly-to-ship into ai-stay-near-ship, since the behaviors are conceptually the same except for fly-to being satisfied as soon as the target is in range.

This also adds a new "escort" mode usable by both behaviors.  The default Volition behavior is to swoop toward the target in a long, graceful arc; the new mode generates a goal point and flies directly to that point.  These can be toggled via an optional sexp parameter.

There is also some minor cleanup and a new vec3d operator for convenience.

Needed for Scroll; depends on #5667.
2023-10-16 03:24:52 -04:00
Goober5000 d3383d9d87 Merge pull request #5667 from Goober5000/refactor_mission_goal_achievable
refactor ai_mission_goal_achievable
2023-10-16 03:23:43 -04:00
Goober5000 4f6d9c36a8 don't kill/self-destruct ship if it's already dying
If a ship is in the process of dying, it shouldn't be killed or self-destructed again.  This fixes a bug noticed by RedMageJoe during the Derelict playthrough.

(This situation is distinct from a ship being hit while in the middle of its death roll.  That shortens the death roll but does not try to kill the ship again.)
2023-10-16 00:36:10 -04:00
JohnAFernandez a36157f582 Merge pull request #5540 from MjnMixael/lua_mod_root
LUA get mod root
2023-10-15 23:16:40 -04:00
JohnAFernandez 3837455004 Merge pull request #5617 from MjnMixael/allow_no_subcategory
Allow Lua SEXPs to not specify a subcategory
2023-10-15 23:15:59 -04:00
JohnAFernandez 808f7a88c6 Merge pull request #5557 from MjnMixael/lua_launch_url
Lua method to launch arbitrary url
2023-10-15 23:15:08 -04:00
Goober5000 79702273d5 some tweaks and clarifications 2023-10-15 16:55:50 -04:00
BMagnu d06018bcad Bump version to 23.3 (#5681) 2023-10-15 19:23:34 +00:00
Goober5000 ac87cde80d supercap check should come from params 2023-10-15 14:16:51 -04:00
Goober5000 06d9e02c34 sync up tokens 2023-10-15 13:48:23 -04:00
Asteroth 40233ae05f use a constant for excess speed 2023-10-15 13:43:49 -04:00
Goober5000 57192065d6 change assert to assertion 2023-10-15 13:43:49 -04:00
Goober5000 d2031a476a some fixes 2023-10-15 13:43:49 -04:00
Asteroth c60ea2d4a7 move supercap warp time constant 2023-10-15 13:43:49 -04:00
Asteroth 6843d48358 add math for predicting warp in distance 2023-10-15 13:43:47 -04:00
Goober5000 066b251052 implement UI work for arrival warp distance 2023-10-15 13:42:27 -04:00
BMagnu 4596600627 Fix hiDPI (#5673) 2023-10-16 01:44:33 +09:00
BMagnu ea262f90c0 Make version parsing available (#5655)
* Make version parsing available

* Consolidate version parsing

* Recode version parsing and write test

* remove copy paste error
2023-10-16 01:44:25 +09:00
BMagnu 02e84f212a Fix HUD slewing (#5656)
* Fixup HUD for slewing

* Fix Training Message box

* Lead indicator slew

* Fix HUD Message Head

* Correctly render messages

* Fix HUD offset handling

* HUD offset never makes any sense

* Cleanup offset code

* Remove unused parameter

* Fix Talking Head in RTT mode
2023-10-16 01:44:17 +09:00
Goober5000 a1d92afebf Merge pull request #5659 from Goober5000/objecttypes_warp_range_factor
allow modification of warp audible range via objecttypes.tbl
2023-10-15 12:43:23 -04:00
Goober5000 a20f3ca030 Merge pull request #5561 from Goober5000/special_warp_physics
add "special warp physics" to custom warpin parameters
2023-10-15 12:42:22 -04:00
Goober5000 e132fcf74c Merge pull request #5585 from Goober5000/beam_api_stuff
additional beam-related features for Lua
2023-10-15 12:41:05 -04:00
Goober5000 7a4df25fc5 Merge pull request #5566 from Goober5000/allowed_in_campaign
add AllowedInCampaign virtvar
2023-10-14 17:01:50 -04:00
Mike Nelson 08dfcc8b74 lua access to Support Ship availability (#5570) 2023-10-15 05:40:12 +09:00
Mike Nelson 0def45b381 add death message as a dialog hv (#5542) 2023-10-15 05:40:05 +09:00
Goober5000 be6a2b9196 add gr.killAllParticles (#5481)
Some scripts under development will benefit from access to the `particle::kill_all()` function.
2023-10-15 05:39:53 +09:00
Mike Nelson f7413be1d8 preload subspace tunnel flag (#5532) 2023-10-15 05:39:42 +09:00
Mike Nelson 02233fc439 Set timer padding sexp (#5535)
* set timer padding sexp

* allow negative padding
2023-10-15 05:39:33 +09:00
BMagnu febd8cd2ad Allow an asymmetric FOV / Frustrum (#5657)
* Enable Asymmetric Projection FOV

* Properly apply asymmetric FOV to g3_rotate_ functions

* De-CPP14-ify

* cleanup

* Make GCC happy

* Fix Vertical Asymmetric FOV

* Fix printf
2023-10-15 05:39:24 +09:00
Goober5000 bf7125724d small updates 2023-10-12 18:07:11 -04:00
Goober5000 efce98db47 rewrite primary weapon cycling
Remove a whole bunch of ad-hoc code piled on top of the retail weapon cycling behavior, then replace it with a robust algorithm that takes all relevant attributes into account.

Fixes #5529.
2023-10-12 17:50:04 -04:00
Birk Magnussen 0c8564f085 Add option for window-scaling 2023-10-12 20:41:59 +02:00
Goober5000 45abdefc07 add "Calculate subsystem hitpoints after parsing" option
Subsystem hitpoints are calculated as a percentage of the ship's hull strength as they are parsed.  If a modular table modifies the ship's hull strength, the subsystems are not modified at the same time.  This can lead to unreasonably large or small subsystem hitpoint values, as recently seen in the 1.3.0 version of Cardinal Spear.

This PR adds an option to defer hitpoint calculation until after parsing so that the subsystem is a percentage of the correct hull strength.  Since this may affect the balance of existing mods, it is off by default unless the build targets 24.0 or later.

This also removes the long-unused `hull_percentage_of_hits` check and adds several log statements for significant options in game_settings.tbl.
2023-10-06 20:52:22 -04:00
Goober5000 73c612034b log the filename 2023-10-06 13:07:46 -04:00
Goober5000 1ae9aaab21 Merge pull request #5669 from Goober5000/additional_shipstatus_fixes
additional ShipStatus fixes
2023-10-06 01:13:45 -04:00
Goober5000 3a46ed66ba additional ShipStatus fixes
Update the Lua enums to be consistent with the new ShipStatus enums.

Separately, add an extra ship registry check in the event a ship doesn't exist in the ship registry.
2023-10-06 00:38:23 -04:00
Goober5000 f98806b034 refactor ai_mission_goal_achievable
Change `ai_mission_goal_achievable` to use the ship registry instead of looking up the target repeatedly.
2023-10-05 23:15:28 -04:00
Goober5000 1812efa209 Merge pull request #5666 from Goober5000/fix_briefing_popup
fix replacement textures in briefing popup
2023-10-05 23:07:28 -04:00
Goober5000 2966757e62 Merge pull request #5668 from Goober5000/better_message
tweak error message
2023-10-05 23:07:20 -04:00
Goober5000 bc3aad374e tweak error message
For better debugging.
2023-10-05 22:23:02 -04:00
Goober5000 dcfea6f141 modify and address feedback 2023-10-05 17:32:53 -04:00
Goober5000 c5d192524e Merge pull request #5665 from notimaginative/add_mac_to_forum_posts
add macOS builds back to forum release build posts
2023-10-05 02:24:10 -04:00
Goober5000 7a47cc0521 fix replacement textures in briefing popup
Use the same method for texture replacement in briefing popups that is already used in the tech room.

Also don't render shadows when the jump node is displayed, since it's not being lit anyway.
2023-10-05 00:59:57 -04:00
Taylor Richards a33cc0f6c4 add macOS builds back to forum release build posts 2023-10-05 00:22:55 -04:00
Goober5000 af4ec4facc Merge pull request #5663 from Goober5000/fix_5661
remove incorrect setting of ship status
2023-10-04 23:10:52 -04:00
Goober5000 d897643217 tweak messages per feedback 2023-10-04 22:25:29 -04:00
Goober5000 5688ba8637 fix incorrect setting of disabled/disarmed flags when cheating
Normally the disabled/disarmed flags are only set if the destroyed subsystem is actually an engine or turret.  This should be done for cheats as well, otherwise, for example, destroying any subsystem on a non-engined ship will cause it to become disabled.
2023-10-04 22:18:44 -04:00
Goober5000 6631975e45 some additional fixes 2023-10-04 21:15:30 -04:00
Goober5000 fa2b135bb1 remove incorrect setting of ship status
There is a bit of code in missionparse that sets the parse object because in-game joining needs it.  This is unrelated to ship status, so the status shouldn't be changed.  This fixes the bug and adds a comment to clarify the situation, as well as some warnings to help track down incorrect joining states.

Fixes #5661.  Follow-up to #5658 (where the regression was introduced) and #4836 (which fixed in-game joining).
2023-10-04 20:46:22 -04:00
mjn-mixael 1ce9d46822 Intro about to play hook 2023-10-04 11:16:48 -05:00
Tyler Blount 7f4d78f44a Merge pull request #5639 from Goober5000/red_alert_wing_status
add wing status to red-alert system
2023-10-03 18:11:30 -07:00
Tyler Blount 10f484a504 Merge pull request #5649 from Goober5000/fix_ship_status
fix ShipStatus states to correctly account for exploding ships
2023-10-03 18:11:25 -07:00
Tyler Blount f0c8c9ad74 Merge pull request #5658 from Goober5000/fix_barrel_roll
fix barrel roll crash in Star Fox: Event Horizon
2023-10-03 18:11:18 -07:00
Goober5000 79579eda94 fix barrel roll crash in Star Fox: Event Horizon
The Star Fox barrel roll effect is achieved using a script which spawns a new ship.  The script sets no-collide on this spawned ship, but it also tries to set the ship flag for all future ships -- and future ships require a parse object, which doesn't exist for a created ship.  This patches the FALLTHROUGH in the sexp code to account for that possibility.

Separately, there are other ways a parse object pointer could become null through unusual code states, so this adds an INVALID status and several additional checks to defend against this crash in other circumstances.
2023-10-03 14:00:22 -04:00
Goober5000 f7b9896294 allow modification of warp audible range via objecttypes.tbl
The retail warp range multiplier can yield ridiculous results, like an Elysium warp being audible over 9000 meters away.  So allow the multiplier to be set via ship type.
2023-10-03 12:50:05 -04:00
Goober5000 be8ec82649 Merge pull request #5642 from BMagnu/fix_null_shiphit
Fix null dereference when a subsystem is hit for damage by a null object
2023-10-02 20:20:56 -04:00
Goober5000 b72b7688f9 Merge pull request #5634 from Baezon/fix-ai-subsys-attack-subobj
Fix for improved subsys attack pathing
2023-10-02 20:20:32 -04:00
Birk Magnussen c2e01864d5 Incorporate feedback 2023-10-02 17:48:03 +02:00
Goober5000 7a4d4466fd Merge pull request #5651 from Goober5000/fly_to_ship_mode_fix
fix crash when a ship has the fly-to-ship goal
2023-10-02 11:14:05 -04:00
Goober5000 ec75cac4d9 fix crash when a ship has the fly-to-ship goal
Add the missing AI mode in the switch block.  Also remove some redundant `break`s.
2023-10-02 00:04:02 -04:00
Goober5000 b6c0e8b562 fix ShipStatus states to correctly account for exploding ships
Adds a `DEATH_ROLL` status to specifically cover the state after ships have been destroyed but before they exit.  I've also audited all code that interacts with the ship registry to use the correct state with this new state taken into consideration.

This fixes access to exploding ships that was broken when the ship registry framework was introduced.  In particular, the `when destroyed X beam-lock-all X` QoL feature now works again.
2023-10-01 18:10:55 -04:00
JohnAFernandez 8d0570846b Merge pull request #5647 from notimaginative/fix_mac_id10t_error
fix bad extraction command in mac distribution zip
2023-10-01 12:55:19 -04:00
Taylor Richards 93d0624b3e fix bad extraction command in mac distribution zip 2023-10-01 03:22:15 -04:00
Goober5000 563445466e Merge pull request #5646 from Goober5000/warning_message_tweaks
tweak some model warning messages
2023-09-30 22:32:40 -04:00
Goober5000 b7e9d4c9cb tweak some model warning messages
Per a thread in the TBP forum, elaborate on these model warnings a bit.

Two other small code tweaks as well.
2023-09-30 20:06:41 -04:00
Birk Magnussen 348fb5ffb4 Change to variables 2023-10-01 01:25:38 +02:00
mjn-mixael 6d08a90106 Prevent out-of-range assert 2023-09-30 13:13:20 -05:00
mjn-mixael 92ed875e69 allow for lua enums to reference lua enums 2023-09-30 10:36:55 -05:00
Taylor Richards d754c2cb50 tweak directory copying for frameworks on macOS (#5641)
CMake's copy_directory functions follow symlinks recursively as opposed to
preserving them. For mac frameworks, which make use of symlinks for versioning,
this causes the files to be duplicated multiple times in the copied framework.
Using rsync instead, just for frameworks, will properly duplicate the framework
while still avoiding the "file exists" error from cp.
2023-09-30 08:51:35 -04:00
Taylor Richards b760c5dec8 tweak mac build packaging (#5640)
Use GNU tar instead of the default bsdtar. This works around some weird
corruption bug triggered by the combination of the GitHub runner-VM, the llvm
linker, and bsdtar.

Adjust intermediate filenames such that they don't get uploaded to
indiegames by mistake.

Unpack builds as a single step instead of two.
2023-09-30 08:51:01 -04:00
JohnAFernandez 9c9b06a1b1 Merge pull request #5635 from MjnMixael/fix_gameplay_help
Do not clear Help Text
2023-09-30 05:02:20 -04:00
Birk Magnussen 30da49be81 Fix null dereference when hit for damage by a null object 2023-09-30 09:55:47 +02:00
Goober5000 c2d0eafc36 add wing status to red-alert system
If consecutive red-alert missions have different numbers of ships in a wing, then calculating the number of waves will not be correct.  This necessitates the addition of wing status to the stored data for red-alert sequences.

Not only must wing data be stored in `Red_alert_wing_status`, but also in the CSG file.  This necessitates a version bump.  Fortunately, the current design of CSG files allows extra data to be added to a section without breaking old builds, since the CSG loader will just skip over the unrecognized data.

This also renames `red_alert_wingman_status` to `red_alert_ship_status` since it's not limited to wingmen, as well as fixing the omission of exited ships if they are in the player's wing but don't have the red-alert-carry flag.

Fixes #5637.  Follow-up to #4457 and #5609.
2023-09-28 21:14:11 -04:00
mjn-mixael e3c7f81412 do not clear this 2023-09-27 23:17:32 -05:00
Asteroth 2b155c7a30 separate variable 2023-09-27 16:40:29 -04:00
Goober5000 df69993a84 Merge pull request #5633 from Goober5000/tweak_weapon_detonation
fix weapon detonation
2023-09-27 15:30:44 -04:00
Asteroth 3fb5bf1f5f fix world pos getting of target subsys 2023-09-27 14:35:53 -04:00
Goober5000 6823e24350 fix weapon detonation
Add some extra logic implied by the `Begun_detonation` flag.  Missiles that are homing can have their targets, headings, speeds, and lifetimes changed for various reasons.  If a missile has begun detonation, particularly if it is in "detonation limbo" because it is flying across a bowl-shaped turret, we don't want to change any of that.  The "detonation limbo" weapon lifetime is only accurate if all of those values remain constant.

Follow up to #4006.
2023-09-27 13:30:37 -04:00
MageKing17 305a7f6630 Show both name and callsign in escort list.
In #5477, I made the escort list respect hidden names by copying the behavior from `message_queue_process()`, which already checked those flags; however, this resulted in some dramatic behavioral changes for mods using callsigns for escort ships, and while making the behavior optional was a possibility, feedback suggested everyone would rather it just behaved like the target box and displayed both. So I replaced the code with similar logic from hudtargetbox.cpp, except with the "replace hidden name with ship class" code taking priority.
2023-09-26 16:33:45 -07:00
mjn-mixael 14a98e1470 add built-in xstrs for these controls 2023-09-26 10:07:29 -05:00
Goober5000 4ba6191e0c Merge pull request #5623 from notimaginative/fix_macos_packaging
fix macOS build packaging issues
2023-09-25 17:14:44 -04:00
mjn-mixael cb5bf05424 update comments here 2023-09-25 15:58:11 -05:00
Tyler Blount b4f633767e Merge pull request #5616 from Goober5000/HomingSubsys_fix
some fixes for setting HomingSubsystem in script
2023-09-25 13:56:24 -07:00
Naomi Coffman 15db3b17bc Respond to PR feedback 2023-09-24 11:09:31 -04:00
mjn-mixael 1dc701270f optimize this entirely out of release builds 2023-09-23 18:35:36 -05:00
mjn-mixael 41b10e4d40 xstr debug filter 2023-09-22 23:44:15 -05:00
mjn-mixael ba2c37a1fe xstr the boolean default on/off as well 2023-09-22 23:24:52 -05:00
mjn-mixael aa997dd9ed Fix some overlapping xstrs 2023-09-22 23:11:08 -05:00
Taylor Richards 6dbfba2c9f fix macOS build packaging issues
- handle double archiving of macOS builds so they'll work properly with Knossos
 - fix issue where only a single configuration was included in the package
   (Release or FastDebug, not both)
2023-09-22 22:14:15 -04:00
Taylor Richards 9748de5ec1 Merge pull request #5621 from notimaginative/use_static_libstdc++
use static libstdc++
2023-09-22 22:13:05 -04:00
mjn-mixael a0a523223c clean up options builders and use delayed xstr for localization 2023-09-22 19:15:42 -05:00
Taylor Richards 0765c7be95 try and fix clang build error 2023-09-22 16:17:23 -04:00
Taylor Richards 73f8e57961 statically link to libstdc++
Statically link to libstdc++ for CI/CD builds in an attempt
to avoid compatibility issues without relying on a crippled
docker build image.

Should properly fix #5571
2023-09-22 15:13:43 -04:00
Taylor Richards 743d8dd666 Revert "Revert "Update build image with curl and jq preinstalled""
This reverts commit f67814aaae.
2023-09-22 15:12:20 -04:00
mjn-mixael 8fbf22a055 allow lua sexps to not specify a subcategory 2023-09-21 10:12:17 -05:00
Goober5000 7b410b2116 some fixes for setting HomingSubsystem in script
1. Allow setting the homing subsystem if the homing object has already been set
2. Use the `weapon_set_tracking_info` function if setting both object and subsystem, as it handles several important homing things
2023-09-20 23:29:04 -04:00
Tyler Blount 8fed4437ee Merge pull request #5614 from MjnMixael/fix_setting_mission_stats
Fix setting mission stats
2023-09-20 10:57:05 -07:00
Tyler Blount ad25418f92 Merge pull request #5613 from MjnMixael/fix_get_shipclass_kills
Fix Lua API Error with Player Stats
2023-09-20 10:52:15 -07:00
Asteroth 8460218707 first draft 2023-09-20 12:20:38 -04:00
mjn-mixael 5972457ad5 fix setting mission stats 2023-09-19 10:57:30 -05:00
mjn-mixael 35876bc17e fix api error 2023-09-18 23:15:56 -05:00
mjn-mixael f2d0bfdb31 add abort rearm 2023-09-18 09:06:09 -05:00
mjn-mixael 6350a67e73 Cleanup force-rearm 2023-09-18 09:05:53 -05:00
Goober5000 46fa212db6 Merge pull request #5610 from Goober5000/collide_and_no_collide_sync
sync setting and getting of collides and no_collide
2023-09-17 18:28:22 -04:00
Goober5000 d0d65cd30c Merge pull request #5609 from Goober5000/red_alert_followup
improve checks for red-alert status
2023-09-17 18:28:15 -04:00
Goober5000 cb0e9ce601 sync setting and getting of collides and no_collide
The `collides` and `no_collide` flags are equivalent, but opposite.  So when sexps or scripts get or set those flags, allow each to be used as an anti-synonym (not exactly an antonym) for the other.
2023-09-17 01:23:31 -04:00
Goober5000 13bc0362c8 improve checks for red-alert status
Two fixes for red alert missions:
1. Since any ship in the wing can be stored, not just the wing leader, the "prospective name" check should check for all possible names in each wave
2. If a wing wasn't actually stored, the red alert code should not reset the wing's wave number to 0

Follow-up to #4457.
2023-09-17 00:17:39 -04:00
Goober5000 bfad425738 move -no_unfocused_pause
As requested on Discord.  I don't use this option myself, so I welcome any arguments why this should or shouldn't change categories.
2023-09-16 22:27:21 -04:00
Goober5000 5749b856df Merge pull request #5606 from Goober5000/revert_5547
Revert 5547 and 5580
2023-09-16 15:39:35 -04:00
Goober5000 f67814aaae Revert "Update build image with curl and jq preinstalled"
This reverts commit 0219e65b00.
2023-09-16 14:58:39 -04:00
Goober5000 24daea79f3 Revert "Change ubuntu-latest to ubuntu-20.04"
This reverts commit 45306da4fe.
2023-09-16 14:58:27 -04:00
Goober5000 0f013f920b Revert "modify per feedback"
This reverts commit 679c3606c5.
2023-09-16 14:58:17 -04:00
Naomi Coffman 0811c7037b Allow (easily) requiring an exact mood match 2023-09-16 13:47:00 -04:00
Naomi Coffman f13a5b3736 Allow specifying tiebreakers between builtin messages 2023-09-16 13:47:00 -04:00
Naomi Coffman 04a5778235 Allow filtering builtin messages by nearby ships 2023-09-16 13:47:00 -04:00
Goober5000 5a941c1d59 small speedup to drawString
Since `gr_string` can accept a length parameter, there's no need to copy each line before it is drawn.

Related to #5495 but not one of the two options mentioned.
2023-09-16 13:43:11 -04:00
Goober5000 d0c3c7db21 Merge pull request #5602 from Goober5000/sexp_fixes
fix crash in unusually formatted handwritten SEXP
2023-09-16 13:34:26 -04:00
Goober5000 be678c2f54 Merge pull request #5603 from Goober5000/fix_message_candidates
fix random selection of message candidates
2023-09-16 13:34:14 -04:00
Naomi Coffman 9586f21780 Add team filters to messages 2023-09-16 10:24:40 -04:00
Goober5000 ed5a5861f7 aspect-ratio-specific splash screens
Adds the ability to specify an aspect ratio, or a range of aspect ratios, to be used by splash screens.
2023-09-16 02:18:10 -04:00
Goober5000 16180306ad fix random selection of message candidates
The `Random::next(low, high)` function returns a value in [low, high].  This location should use the single-argument version, `Random::next(int modulus)`, which returns a value in [0, modulus-1].
2023-09-16 02:12:22 -04:00
Goober5000 865045a231 fix crash in unusually formatted handwritten SEXP
As reported by Colt, there was a crash in the in-mission jump sequence in Shepherds where the mission previously worked.  The proximate cause was a handwritten SEXP called via script that omitted whitespace before an opening parenthesis.  This was incorrectly recognized by the upgraded SEXP parser as an invalid SEXP.  Unfortunately, a separate bug in `get_line_num()` caused a crash when the parser tried to display a warning, because the function tried to calculate the line number of a SEXP that did not come from a parsed file.

This commit fixes the parser to recognize opening parentheses even when no whitespace precedes them, moves the output to the 'unexpected end of sexp' warnings will they will now be seen, and fixes `get_line_num()` to work when there is no parsed text.

Follow-up to #5520.
2023-09-15 15:12:44 -04:00
mjn-mixael e387038cc3 base implementation of force-rearm 2023-09-15 13:55:37 -05:00
Tyler Blount 0b54c741a6 Merge pull request #5599 from MjnMixael/fix_scpui_reset_loadout
Actually reset the weapon pool with SCPUI
2023-09-14 15:26:32 -07:00
mjn-mixael baa34f1ffe Actually reset the weapon pool, dummy 2023-09-14 10:46:52 -05:00
Goober5000 89b33ebbc5 add a maneuver-despite-engines flag
This flag ignores engine status when determining whether and how a ship can maneuver.  Implements #5503.
2023-09-13 22:36:58 -04:00
Goober5000 53e6edf8bb documentation 2023-09-10 17:40:02 -04:00
Tyler Blount 0220ad0563 Merge pull request #5594 from MjnMixael/fix_campaign_saving_scpui
Save player after changing campaign in scpui
2023-09-10 13:55:59 -07:00
Tyler Blount 910521bdfe Merge pull request #4457 from JohnAFernandez/restore-red-alert-flags
Fix wing persistence and ensure checks for depleted wings are valid
2023-09-10 13:55:34 -07:00
Goober5000 7003e5caa2 get the wave count correct 2023-09-10 13:49:31 -04:00
mjn-mixael 8efe146300 save player after changing campaign in scpui 2023-09-09 23:01:59 -05:00
mjn-mixael 52b7a3d198 rank display name and title 2023-09-09 10:54:04 -05:00
Asteroth a14fb35713 initialize trail info better (#5588) 2023-09-09 02:41:55 -04:00
Goober5000 2d0dc7798d unused variable 2023-09-09 00:41:44 -04:00
Goober5000 8242e3b94b small edits 2023-09-08 19:40:53 -04:00
Goober5000 16cb6b3f2f rewrite red-alert bashing routine 2023-09-08 19:13:58 -04:00
Goober5000 8c9be400a6 Merge branch 'master' into restore-red-alert-flags 2023-09-08 00:57:54 -04:00
Goober5000 7974a682ef Merge pull request #5581 from TRBlount/briefing_icon_scale_followup
Follow-up for briefing icon scaling
2023-09-07 23:12:11 -04:00
Goober5000 41af098d19 Merge pull request #5582 from TRBlount/starfield_timestamp_fix
Update starfield animation handling
2023-09-07 23:12:04 -04:00
Goober5000 4c95370f74 add parse object flag for starting wing, and move starting wing checks to post-processing 2023-09-07 20:56:54 -04:00
Goober5000 a6730a997c feedback 2023-09-07 19:15:56 -04:00
Goober5000 c5b84d9406 Merge pull request #5589 from Goober5000/beam_armor_fix
supply parameter for is_beam in all armor checks
2023-09-07 16:40:52 -04:00
Tyler Blount d2f5a12d5f Add parentheses to make order of operations more clear 2023-09-06 19:26:20 -07:00
Tyler Blount 6f6e839bbf Update starfield animation handling 2023-09-06 19:23:48 -07:00
Goober5000 065524fd4b Merge pull request #5586 from Goober5000/firepoint_followup
fix the logic for lighting up firing points
2023-09-06 18:22:27 -04:00
Goober5000 c84cb7ab64 supply parameter for is_beam in all armor checks
For certain calculations involving armor, the `GetDamage` function needs to know if the damage is being applied by a beam so it can apply the calculations with the proper frametime.  The parameter was not provided in all cases, so this fixes that.

Follow-up to #1609.
2023-09-06 18:17:37 -04:00
Goober5000 587ed4e41f convert magic number to constant 2023-09-06 12:13:36 -04:00
Goober5000 8b8daece46 additional beam-related features for Lua
1. Add a `vanish()` function for beam objects, to be consistent with other object types
2. Add a `BeamFree` virtvar, analogous to `TurretLocked`
3. Add timestamp variants of TurretLocked and BeamFree to be consistent with sexps
4. Add `BeamLife`, `BeamWarmup`, and `BeamWarmdown` virtvars so scripts can access table properties
5. Add "On Beam Death", "On Beam Warmup", and "On Beam Warmdown" hooks
6. Clarify some existing documentation and patch a couple things
2023-09-06 00:28:07 -04:00
John Fernandez d73d46feb2 Stupidest typo in history 2023-09-04 14:50:01 -04:00
Goober5000 a881b339cc fix the logic for lighting up firing points
The firing point gauge did not work as advertised; this fixes it.  Unselected weapons are dimmed, selected weapons are normal, and firing weapons are bright.
2023-09-04 14:25:06 -04:00
Tyler Blount 1f90be0a86 Merge pull request #5584 from Goober5000/firepoint_fix
fix crash in firepoint gauge
2023-09-04 11:06:42 -07:00
Goober5000 4ce02ce291 fix crash in firepoint gauge
The gauge assumes that all firepoints will always have weapons, but it's possible for a ship to have less than the maximum number of weapons.
2023-09-03 18:07:40 -04:00
John Fernandez 7d83ece711 And make sure we can call the constructor 2023-09-01 19:34:25 -04:00
John Fernandez 9ee1a6eb23 Add a constructor for red_alert_wing_status 2023-09-01 19:25:36 -04:00
John Fernandez f258554304 add bash wingman status
And function calls.
2023-09-01 19:02:19 -04:00
John Fernandez 994048eb24 Create Struct And functions for restoring wings
This needs to be separate from ships
2023-09-01 16:54:46 -04:00
Tyler Blount 0af3197a90 Follow-up for briefing icon scaling 2023-09-01 12:15:41 -07:00
Goober5000 e5824b41bb Merge pull request #5580 from Goober5000/ubuntu_version_tweak
Change ubuntu-latest to ubuntu-20.04
2023-09-01 12:41:25 -04:00
Goober5000 679c3606c5 modify per feedback 2023-08-31 17:30:08 -04:00
Mike Nelson acbab034cc wtf (#5579) 2023-08-30 23:03:48 -04:00
Goober5000 45306da4fe Change ubuntu-latest to ubuntu-20.04 2023-08-30 22:57:29 -04:00
Goober5000 f09c7b3ba5 Merge pull request #5577 from Goober5000/additional_music_checks
additional music checks
2023-08-30 13:11:28 -04:00
John Fernandez 964f495238 A theoretical fix for invalid checks
Replace `wingp->num_waves == 0` with valid `wingp->current_wave >= wingp->num_waves` and correct six year old copy paste error.
2023-08-29 01:25:33 -04:00
Goober5000 865f7e725c Merge pull request #5578 from Goober5000/soundtrack_start_fix
fix soundtrack timestamp when change-soundtrack is called immediately
2023-08-27 16:33:28 -04:00
Goober5000 6a550a6701 additional music checks
This adds several fixes to make the event and menu music more robust:
1. The game will now run with zero soundtracks.  All accesses into a potentially empty vector should now have checks.
2. Soundtracks and menu music are now checked for validity before being played (not just when importing a FSM mission).
3. The parsing validity checks and the in-game event music now check for skippable patterns using the same function.
4. Zero measures and zero samples-per-measure now cause the game to skip a pattern.  Negative values now trigger a warning.
5. Omitting some or all of the `$Name:` lines for a soundtrack will not cause an assert.

Fixes #5576.  Follow-up to #5572.
2023-08-25 19:22:03 -04:00
Goober5000 ad2531efcc fix soundtrack timestamp when change-soundtrack is called immediately
There is a built-in delay for the event music to start playing, but this delay gets stepped on if `change-soundtrack` is called when the mission first starts.  So don't set the delay unless it has already elapsed at least once before.
2023-08-25 19:20:21 -04:00
Goober5000 8af06b9e78 Merge pull request #5575 from Goober5000/obj_sound_fix
fix persistent sounds not clearing their tally
2023-08-25 19:08:06 -04:00
Goober5000 b6eef2e8f2 fix persistent sounds not clearing their tally
When a non-looping persistent sound expires, `obj_snd_stop()` actually does need to be called.  Even though the sound is no longer playing, the `Num_obj_sounds_playing` tally needs to be decremented, otherwise it will eventually exceed its limit and prevent any additional persistent sounds from playing.  And it turns out `obj_snd_stop()` returns gracefully for sounds that aren't playing.

Follow-up to #3510.  Fixes a bug that appears to have been around since retail.
2023-08-25 13:27:09 -04:00
Goober5000 344e231058 add mn.generateWeaponGroupId()
The `mn.createWeapon()` function takes an optional group ID for weapons that share lighting, but the internal `weapon_create_group_id()` function was never exposed to the API.  This adds that.
2023-08-25 02:39:40 -04:00
BMagnu 2feeb34629 Move light calculation out of vertex shader (#5573) 2023-08-25 05:46:02 +09:00
Goober5000 9d28ba568c Merge pull request #5572 from Goober5000/5567_followup
fix validity check for soundtracks
2023-08-23 22:28:53 -04:00
Goober5000 1b6ed75d73 filename is already truncated 2023-08-23 21:10:05 -04:00
Goober5000 4cf7ab3474 fix validity check for soundtracks
Since event music soundtracks use the exact file extension specified (see #5567), the validity check should also use the exact file extension specified.

Also, move the validity check to after parsing has completed because extensions may be overridden.
2023-08-23 20:39:26 -04:00
mjn-mixael b7045f1756 do not validate loadouts feature 2023-08-22 23:29:18 -05:00
Goober5000 bd4b9cb0d7 Merge pull request #5568 from Goober5000/fix_campaign_crash
fix crash in campaign editor
2023-08-22 20:32:13 -04:00
Goober5000 926e10584c Merge pull request #5567 from Goober5000/event_music_extension_agnostic
handle extension mismatch in event music
2023-08-22 20:32:05 -04:00
Goober5000 defab61664 handle extension mismatch in event music
Currently, menu music will trim the extension and look for both OGG and WAV files, but event music will use the exact extension specified.  This is intended but could lead to unexpected results in mods, so display a warning for the modder.
2023-08-22 15:48:21 -04:00
Goober5000 7dc971a6f2 fix crash in campaign editor
The crash in #5514 appears to be caused by some of the graphics code not being in the expected state for the synchronization.  Looking at the code in `render_frame()`, a `gr_flip()` happens after one frame ends and before the next frame begins.  That implies that this `gr_flip()` should not be here, as it is in the middle of a frame.  For additional evidence, `gr_flip()` modifies the "uniform buffer manager" state, and that is part of the stack trace preceding the crash.  Removing this `gr_flip()` fixes the crash.

The strange thing is that this code *doesn't run at all* while the campaign editor is active.  I verified this by adding a MessageBox in place of `gr_flip()`; the MessageBox doesn't display until the campaign editor is exited.  And yet, FRED crashes with `gr_flip()` present and doesn't crash with it removed.  This calls for a new category of bug; I propose "spookybug", from spooky action-at-a-distance.

Fixes #5514.
2023-08-22 12:47:14 -04:00
Goober5000 e0a6ca9abd Merge pull request #5563 from Goober5000/movie_subtitle_font_tweak
fix $Movie subtitle font: for custom fonts
2023-08-21 16:42:11 -04:00
Goober5000 210a9a8309 add AllowedInCampaign virtvar
These can be used to set whether a ship or weapon is allowed in loadouts, without necessarily waiting for the mission to be accepted.
2023-08-21 16:32:56 -04:00
Goober5000 613fad21c9 fix $Movie subtitle font: for custom fonts
The default movie subtitle font is font01.vf, but mods with custom font tables might not use this font.  So this changes the handling slightly so that the movie player will use whatever the first available font is.

Follow-up to #1523.  Fixes a sometimes spurious warning in mod initialization.
2023-08-19 13:25:13 -04:00
Goober5000 91497d5056 Merge pull request #5560 from Goober5000/fred_help
improve launching of FRED help
2023-08-17 21:25:16 -04:00
Goober5000 6b3e50dade add "special warp physics" to custom warpin parameters
Supercaps use a physics flag on warpin that makes them slow down faster than they would under the normal physics code.  This adds that flag as an option for custom warp parameters.

Since flags are not yet parsed when warp parameters are parsed, the code needs to skip ahead and peek at the flags in the same way as the weapon override.
2023-08-16 19:07:30 -04:00
Goober5000 e796a4fe00 improve launching of FRED help
1. Fall back to the FREDzone help docs if the local files cannot be found
2. Tweak url_launch error message and add a return value

This consequently removes the ReleaseWarning which wasn't the friendliest or clearest way to tell the user about a missing help file.
2023-08-16 12:28:53 -04:00
Goober5000 03f01604d9 Merge pull request #5559 from Goober5000/fix_5515
assign weapon particle effects properly
2023-08-16 11:27:30 -04:00
Goober5000 1547526057 Merge pull request #5558 from Goober5000/streaminganim_extension
some streaming animation fixes
2023-08-16 11:27:21 -04:00
Goober5000 7602b88756 assign weapon particle effects properly
Since `std::unordered_map.insert` does nothing if a key already exists, use bracket notation.  Fixes #5515.
2023-08-15 23:16:07 -04:00
Goober5000 4812ff529d Merge pull request #5550 from Goober5000/modular_weapon_flags
fix flags in modular weapon entries being cleared
2023-08-15 17:41:26 -04:00
Goober5000 fe42c7bdff make alpha value work for streaming EFFs 2023-08-14 18:07:21 -04:00
Goober5000 f706d6c0a0 use the correct resize mode 2023-08-14 17:40:47 -04:00
Goober5000 16b9225533 remove extensions from streaming animations
Since other functions in the scripting API remove extensions before loading the files, and since the internal functions expect them to be removed, the streaming anim API should handle that too.
2023-08-14 16:41:20 -04:00
mjn-mixael 9a7500de36 lua method to launch arbitrary url 2023-08-13 09:27:30 -05:00
Goober5000 64d9b6fb74 Merge pull request #5548 from Goober5000/stay_near_ship_fixes
ai-stay-near-ship fixes
2023-08-13 09:27:52 -04:00
Goober5000 b40f5a15b2 Merge pull request #5553 from Goober5000/nightly_porphyrion_to_perses
nightly build updates
2023-08-10 00:07:24 -04:00
Goober5000 52a5c356cf Merge pull request #5551 from Goober5000/dock_goal_achievability
remove Int3()'s in ai_mission_goal_achievable
2023-08-09 23:51:56 -04:00
Goober5000 e71dba4207 enhance set-armor-type to work with generic subsystems 2023-08-09 18:21:19 -04:00
Goober5000 3b42ee42ca put the hull and shields at the top to be consistent with other sexps 2023-08-09 17:23:13 -04:00
Goober5000 b270c44ede use https for indiegames 2023-08-09 15:17:45 -04:00
Goober5000 6cf6f8a6fe update server 2023-08-09 15:14:43 -04:00
Goober5000 c273496c1e remove obsolete build files 2023-08-09 15:08:36 -04:00
Goober5000 8933aaff38 address feedback and add more chex 2023-08-09 15:01:41 -04:00
Goober5000 a3de0db735 remove Int3()'s in ai_mission_goal_achievable
As reported by Woutersmits, the GTT Nova did not dock with the GTD Hall in the first mission of Black Horizon.  Attempting to run a debug build caused a CTD.  Investigation showed that there was an invalid dockpoint triggering an Int3().  The dockpoint has been fixed, but to aid troubleshooting in the future, the Int3()'s in this function have been changed to more appropriate functions.
2023-08-09 04:11:47 -04:00
Goober5000 0dcb60f805 fix flags in modular weapon entries being cleared
When weapon flags are parsed in a modular table and override the previous set of flags, certain flags must be kept to preserve the behavior of the weapon.  The previous `preset_wi_flags` technique only worked if all such flags (homing, has-display-name, even whether the weapon turns) were set in the same modular table.  If a modular table overrode the flags but didn't specify those lines over again, mysterious and subtle bugs would occur.

This modifies the flag parsing to explicitly preserve all appropriate flags from the existing weapon entry, which fixes the bug.  It also allows all of the flags to be specified in one place, rather than scattering `preset_wi_flags` assignments throughout `parse_weapon`.  And this also adds quite a few flags to the flag list that were not handled at all under the previous design.

Finally this fixes a few incorrect assignments of default values to fields that should only happen the first time a weapon entry is parsed.
2023-08-09 01:49:35 -04:00
MageKing17 1bc7732b6e Merge pull request #5549 from MjnMixael/fix_sexp_descriptions
Correct a few sexp descriptions
2023-08-08 22:44:41 -07:00
mjn-mixael 2a64abfe92 correct a few sexp descriptions 2023-08-08 17:00:12 -05:00
Goober5000 d1e81be2aa ai-stay-near-ship fixes
Three fixes:
1. In commit fa0878b6b3 for PR #5338, the optional distance parameter was inadvertently changed to a bool.  This fixes the parameter.
2. The distance parameter was previously parsed using `atoi` which works for number literals, so change to `eval_num` to allow sexp return values.
3. Make `eval_num` consistent with `eval_sexp` in the sense that evaluating an empty list is valid and returns false or 0.

Also takes advantage of the fact that `is_sexp_true` works for empty lists to streamline optional arguments in `ai_add_goal_sub_sexp`.
2023-08-08 13:07:21 -04:00
Goober5000 e285641ac6 Merge pull request #5528 from Goober5000/detonate_on_expiration
'detonate on expiration' weapon flag
2023-08-07 22:18:58 -04:00
Goober5000 d3b1ad4328 remove vestigial debug variables 2023-08-07 16:59:02 -04:00
Tyler Blount 914f0e13e3 Merge pull request #5526 from Goober5000/hud_set_coords
add screen resolution scaling for hud-set-coords
2023-08-06 15:22:08 -07:00
m!m df68da3dd6 Merge pull request #5547 from asarium/image_curl_jq
Update build image with curl and jq preinstalled
2023-08-06 18:15:05 +02:00
asarium 0219e65b00 Update build image with curl and jq preinstalled
The install step in the CI pipeline is no longer needed after this
change and has been removed.
2023-08-06 17:09:42 +02:00
m!m cc171a6344 Merge pull request #5546 from asarium/fix_file_exists
Fix "File exists" error
2023-08-06 16:44:23 +02:00
asarium 7d066a1c45 Fix "File exists" error
Copying a file with cp on top of another one is not allowed by default
so switching the command to use the CMake provided one will fix the
issue and will also unify the commands for all platforms.

The directory support is necessary for Mac where the SDL library is
actually a directory.
2023-08-06 14:46:46 +02:00
mjn-mixael accb842ffa fix duplicate detection 2023-08-04 18:41:07 -05:00
Tyler Blount 6677fcabae Merge pull request #5513 from Goober5000/fred_campaign_path
fix a couple bugs in the campaign editor
2023-08-04 13:46:44 -07:00
Tyler Blount 171d36bf7f Merge pull request #5527 from Goober5000/fix_5507
add model filename back into debug log
2023-08-04 13:46:35 -07:00
Tyler Blount 9018ddf0d5 Merge pull request #5539 from MjnMixael/fix_bitmap_fps
Fix animated background bitmaps rendering with incorrect framerate
2023-08-04 13:46:28 -07:00
Tyler Blount d847236dd2 Merge pull request #5537 from MjnMixael/fix_loadout_ctd
Fix: Prevent loadout related CTD
2023-08-04 13:46:20 -07:00
mjn-mixael bb6b010487 lua get mod root 2023-08-02 12:04:33 -05:00
mjn-mixael 0ee3d099ab and not or dummy 2023-08-02 09:28:07 -05:00
mjn-mixael 9aa48579b0 also check upper range 2023-08-02 09:19:26 -05:00
mjn-mixael bb28d0b859 account for very low framerates 2023-08-02 09:17:01 -05:00
mjn-mixael 2ef3a935e4 Fix animated background bitmaps rendering with incorrect framerate 2023-08-02 08:23:52 -05:00
mjn-mixael 233fa38890 Prevent loadout related CTD 2023-08-01 16:16:30 -05:00
mjn-mixael 97adef1d87 frakking ints bro 2023-07-31 22:02:20 -05:00
Goober5000 e91d6ed17b 'detonate on expiration' weapon flag
For mods which want primary weapons to 'detonate', setting the detonation range is not reliable because, due to rounding imprecision, either the range (which detonates) or the lifetime (which does not) may happen first.  So this adds a flag to always detonate a weapon when its lifetime expires.  Secondary weapons have this flag by default, but primary weapons can add this flag in the $Flags list.  Additionally, if the detonation range and the predicted range due to lifetime are equal, the flag is added automatically.

Resolves #5521.
2023-07-29 18:23:38 -04:00
Goober5000 f6c86464aa add model filename back into debug log
In #4702 this log line was changed to the 'Model' category, which made it hidden by default.  This was missed in review but should be restored as it is a fairly important line.

Fixes #5507.
2023-07-29 15:29:29 -04:00
Goober5000 dd0af0e07c add screen resolution scaling for hud-set-coords
The hud-set-coords SEXP has always used exact pixels, without regard for the current screen resolution.  This adds a similar scaling mechanism as is used for show-subtitle.

Fixes #5525.
2023-07-29 15:21:43 -04:00
Goober5000 24031db712 Merge pull request #5520 from Goober5000/variable_token_fixes
SEXP parsing cleanup and fixes
2023-07-29 14:18:44 -04:00
Goober5000 d82b02a54a Merge pull request #5517 from Goober5000/fix_fred_bugs
fix mission corruption in FRED
2023-07-29 14:15:10 -04:00
Goober5000 a21876127d comment 2023-07-28 19:54:42 -04:00
Goober5000 f64de84e7c address feedback 2023-07-28 17:08:22 -04:00
Goober5000 feadc0bd69 feedback 2023-07-28 16:45:44 -04:00
mjn-mixael bb6917ab3b custom lua action for mainhall esc keypress 2023-07-28 09:30:30 -05:00
Goober5000 1252d794db Merge pull request #5509 from Baezon/fix-laser-single-segment-trails
Some more fixes for laser single segment trails
2023-07-27 23:12:49 -04:00
Goober5000 58fcbde152 Merge pull request #5511 from z64555/fillValues_more_error
Add more error checking in joy-sdl.cpp.
2023-07-27 23:12:24 -04:00
Goober5000 b3970798e1 variables will only be referenced in nodes, not generators like for-counter 2023-07-27 16:14:06 -04:00
Goober5000 da34e25bc3 handle things properly on parse error 2023-07-27 16:07:15 -04:00
Goober5000 7fc75c0d6c more robust handling of Mp, especially after error 2023-07-27 15:04:38 -04:00
Goober5000 859978fd84 upgrade container parsing as well; and check for malformed variable tokens 2023-07-27 03:38:17 -04:00
Goober5000 7781d9fcda fix sexp variables in argument lists 2023-07-27 02:19:54 -04:00
Asteroth 03e876f65b no shadow 2023-07-27 00:58:10 -04:00
Goober5000 9480869e0a make variable parsing more robust; don't assume that an @ is always followed by a valid variable name; fix length checks; soften non-fatal Errors to error_display(0) 2023-07-27 00:04:15 -04:00
Goober5000 481e82303c use tokens in sexp help 2023-07-26 14:55:31 -04:00
Goober5000 689ac56bc8 fix mission corruption in FRED
When using the mission importer, missions were being corrupted for very subtle reasons: due to some code reordering in prior commits, `raw_ptr` would be initialized to `Parse_text_raw` before `Parse_text_raw` itself was initialized.  This assignment was done in the `CFred_mission_save` constructor and the ordering dependency is not obvious.  Since this is a highly fragile situation and has the potential to affect any use of `parse_comments()` in FRED, it's better to explicitly assign `raw_ptr` when it is needed, and just initialize it to nullptr in the constructor.

This also sets the version number to the legacy version (0.10) when the mission is saved in the retail format.
2023-07-26 03:39:17 -04:00
Goober5000 c80f787d34 POF version fix
Modelread.cpp supports POF versions as low as 1900, but early model versions were not loaded properly because they relied on preprocessor directives rather than version checks.  This changes the POF loading to correctly check version numbers and chunk IDs.

Fixes crashes when attempting to load a FS1 model.
2023-07-26 00:00:17 -04:00
mjn-mixael 861a9c9c4a Add default custom data with descriptions that will show in FRED 2023-07-25 16:01:23 -05:00
mjn-mixael d2d1d8f996 qtFRED saving of custom data 2023-07-25 10:05:34 -05:00
mjn-mixael 46530b78b7 Working FRED implementation 2023-07-25 10:00:58 -05:00
Goober5000 c5469982c8 fix a couple bugs in the campaign editor
1. When saving a campaign, the save directory should be the one that the campaign was just loaded from.  If prompting the user, this should be the default save directory.  This fixes a bug where campaigns were saved to %APPDATA% instead of where the FREDder might expect.  This has been a bug ever since the migration of the game files from FreeSpace2 to %APPDATA%.
2. When saving a campaign, save only the external mission flags, not the working flags that are maintained during gameplay but have no meaning in the saved file.
2023-07-25 01:49:10 -04:00
z64555 db64a212d6 Adds more error checking in joy-sdl.cpp.
* In fillValues(), Check the size values returned by SDL to assert they are non-negative.  If they are negative, abort vector resize and mprintf the SDL Error.
2023-07-24 19:01:08 -05:00
Asteroth 0a07b7e0ad some fixes for laser single segment trails 2023-07-24 18:37:03 -04:00
mjn-mixael cf3b5e8085 base implementation of mission custom data 2023-07-24 16:51:06 -05:00
Tyler Blount 833d181700 Merge pull request #5504 from Baezon/fix-cmeasure-single-segment-trail
Fix for countermeasures with a single segment trail
2023-07-23 10:08:35 -07:00
Tyler Blount dfc716d91a Merge pull request #5501 from naomimyselfandi/zero-out-persona-bitfields
Explicitly zero out persona bitfields
2023-07-23 09:58:49 -07:00
Goober5000 8dd6a27418 Merge pull request #5475 from Goober5000/ai_autoscaling_check
prevent AI autoscaling for only a single autoscaled class
2023-07-22 21:46:25 -04:00
Asteroth 691ae8752e fix for countermeasures with a single segment trail 2023-07-20 23:42:35 -04:00
Asteroth 14b4fd3465 Fix weapon flags +override handling wrt spawn flag (#5488)
* fix wep flags +override wrt spawn

* Revert "fix wep flags +override wrt spawn"

This reverts commit 08a2bee1ca.

* parse +override ahead of time

* use string list instead

* hopefully fix whitespace???
2023-07-19 17:09:11 -04:00
Naomi Coffman fc6a1402c3 Explicitly zero out persona bitfields
Personae have a flag and a species bitfield. They're built up during parsing, but never explicitly zeroed out. This leads to ships occasionally getting an incorrect persona (especially common with support ships, which never have an explicit persona).

Additionally, this commit addresses an issue with the UES Aranyaka (and potentially other support ships belonging to species without a support persona). I'm honestly not sure why they were ever able to speak; however, with this change, they'll never be able to. As such, this commit introduces a "default support persona" to retain the desired behavior.
2023-07-19 15:04:18 -04:00
MageKing17 275f96d80c Remove Int3()s from message_translate_tokens().
In f350e06851, two Int3()s were added to `message_translate_tokens()`, to check for possible out-of-bounds errors. However, in c70fdc3a52, just a couple months later, the code being protected by those bounds checks were put into `else` branches, meaning the `Int3()`s became redundant. This wouldn't actually cause any problems unless somebody passed a string with two `$`s at least 40 characters apart to `message_translate_tokens()`. Cue #4876, which started calling `message_translate_tokens()` on debriefing stages and recommendations, which can contain color tags. This still wouldn't cause problems as long as the color tags are in pairs within close proximity (`translate_key()` would say "that's not the name of a scan code" and leave the text between the two tags alone), but as soon as two color tags are far enough apart to trip the bounds check conditional, the `Int3()` would be hit. This is still fine on Release builds, which ignore `Int3()`s, but triggers a breakpoint on debug builds, which depending on the user's system, can result in a CTD. Since, as far as I can tell, the `Int3()`s haven't actually been meaningful since 2006, I've just removed them (and inverted the conditionals), and testing by the affected user confirms that it no longer CTDs.
2023-07-18 13:34:26 -07:00
Goober5000 850d706df2 prevent AI autoscaling for only a single autoscaled class
When only one AI class performs autoscaling, the math formulas which use autoscaling will become meaningless (e.g. in `ai_maybe_launch_cmeasure()`) or will cause divide-by-zero errors (e.g. in `ai_manage_shield()`).  And autoscaling is not very useful outside of the specific ways that Volition used it.  So this adds some warnings and disables single-occurrence autoscaling.

Fixes #5474.
2023-07-18 01:05:18 -04:00
Goober5000 b06c8e72e1 Merge pull request #5499 from Goober5000/fireball_fix
fix Lua API access to Fireballs array
2023-07-18 00:34:53 -04:00
Asteroth b1fd9ffffb Improve performance of collision retiming (#5496)
* fast version of setting position and orientation

* preliminary stale collide time

* add global collision cache stale flag instead

* clean up

* more clean up

* no periods >.>

* bring back single object version

* rename and bring back stale object list

* use a set
2023-07-18 00:28:49 -04:00
Goober5000 e2c264cec4 fix Lua API access to Fireballs array
When fireballs were made dynamic in 609ed4ed94, the `MAX_FIREBALLS` #define lost any relationship to the fireball collection.  This removes it and also correctly specifies the size of the fireball collection.

This fixes a CTD when accessing items in `mn.Fireballs` via script.
2023-07-17 23:33:22 -04:00
Fabian Woltermann 3f889137d7 Merge pull request #5497 from The-E/fix/warn_for_invalid_trail_textures
Add a warning for cases when we couldn't load a trail bitmap
2023-07-17 23:53:48 +02:00
Fabian Woltermann 19f1e6b4ee remove bothersome warning 2023-07-17 23:07:37 +02:00
Goober5000 7e692ebca6 Merge pull request #5498 from Goober5000/5492_followup
add missing #includes to fix compilation
2023-07-17 16:17:03 -04:00
Goober5000 0067a57f8f add missing #includes to fix compilation
These #include lines are needed for the changes introduced in #5492.  Not sure why they weren't picked up by CI, or why they work in some compilers but not others.
2023-07-17 14:58:24 -04:00
Fabian Woltermann e028162dc2 update batching assertions 2023-07-17 18:54:12 +02:00
Fabian Woltermann 9b26439dd3 Add a warning for cases when we couldn't load a trail bitmap 2023-07-17 17:12:33 +02:00
Tyler Blount 1431270287 Merge pull request #5483 from Baezon/hud-gauge-load-safety
Improved hud gauge loading safety
2023-07-16 15:49:17 -07:00
Tyler Blount 06e74fa976 Merge pull request #5491 from MageKing17/bugfix/demo-missing-campaign
When playing the demo, don't try to reset if no campaign is active.
2023-07-16 15:47:59 -07:00
Tyler Blount 318fde51d7 Merge pull request #5492 from MageKing17/bugfix/voice-recognition-while-paused
Ignore voice recognition events while game is paused.
2023-07-16 15:47:51 -07:00
Goober5000 15daaf2633 additional cleanup from PR 5462
Some streamlining and constifying of the readyroom popup list and associated functions.

Followup to #5462.
2023-07-13 01:54:25 -04:00
MageKing17 d253302fc9 Also check popup_active() and popupdead_is_active(). 2023-07-12 16:07:17 -07:00
MageKing17 560eb31e4f Ignore voice recognition events while game is paused.
If you pause the game, say something into the microphone, then unpause, it can abruptly perform an action based on voice recognition; this is probably counter to player expectations. This adds a `gameseq_get_state() != GS_STATE_GAME_PAUSED` check to the existing conditional.
2023-07-12 15:09:36 -07:00
MageKing17 493df37287 When playing the demo, don't try to reset if no campaign is active.
If the "Campaign Room only available in full version" popup is shown, it tries to reset `Active_campaign_index`, except that if a pilot is loaded with a missing campaign file, `Active_campaign_index` is -1. This causes an out-of-bounds array access, so let's present an alternate popup in this case (either one to select whatever the first campaign file found is, or the generic `popup_game_feature_not_in_demo()` if no campaign files are found).
2023-07-12 14:53:40 -07:00
BMagnu 32298b89fd Properly deinit io lib LuaFunctions (#5485) 2023-07-11 07:03:52 +09:00
Asteroth d6ee515873 remove testing prints 2023-07-07 01:22:40 -04:00
Asteroth bc09f0672b better hud gauge load safety 2023-07-07 01:20:11 -04:00
Goober5000 859534a75c Merge pull request #5482 from Goober5000/ship_killer_name_fix
fix some bugs revealed by ships with long display names
2023-07-07 00:41:59 -04:00
Goober5000 5f8234d1cd fix some bugs revealed by ships with long display names
Several related fixes:
1. Copy the actual ship name, not the display name, to `killer_parent_name` for two reasons:
  1a. Since `killer_parent_name` is used to look up the ship, it must be the actual ship name, not the display name.
  1b. Copying the display name can cause a buffer overflow because display names can be longer than 31 characters.
2. The display name functionality is moved to the more appropriate location in `player_generate_death_message()`.
3. Remove `player_get_killer_weapon_name()` which only served as a proxy check for whether the weapon index was used or not.
4. Use `ship_registry_get()` rather than `ship_name_lookup()`.
5. Add comments to clarify the use of `killer_parent_name`.
2023-07-03 20:08:26 -04:00
Goober5000 03e0904398 Merge pull request #5477 from MageKing17/cleanup/ship-name-handling
Avoid displaying hidden ship names in the escort list.
2023-07-03 17:18:43 -04:00
Goober5000 99170a3a70 Merge pull request #5480 from Goober5000/dockpoint_checks
add some additional safety checks for dockpoint paths
2023-07-03 17:18:31 -04:00
Goober5000 9b72fb6592 add some additional safety checks for dockpoint paths
1. Check that a path index is in range
2. Check that a path's parent submodel is the same as the dockpoint's parent submodel
2023-07-03 12:35:34 -04:00
Goober5000 ed6adeb281 Merge pull request #5479 from Goober5000/fix_instructor_check
fix instructor check
2023-07-02 22:59:55 -04:00
Goober5000 7c13df5881 fix instructor check
Fix the instructor check for whether a ship should circle or not.  Follow-up to #5353.  Fixes #5478.
2023-07-02 22:13:54 -04:00
BMagnu c6a98ad228 Clear Thread-stuff more aggressively (#5476) 2023-07-03 04:38:15 +09:00
MageKing17 927567ffed Avoid displaying hidden ship names in the escort list.
Secondarily, display callsigns in the escort list, if one is given.
2023-07-02 11:26:52 -07:00
Tyler Blount 5ebf530a30 Merge pull request #5473 from MageKing17/bugfix/avoid-split-line-once-assertion
Remove `max_pixel_w > 0` assertion from `split_str_once()`.
2023-06-30 08:44:48 -07:00
MageKing17 b32b54a737 Remove max_pixel_w > 0 assertion from split_str_once().
In at least two instances, `split_str_once()` can be called with width values derived from mod-supplied values that can be 0 or less (specifically, two hud gauges: if `+Messages:` has a `Max Width:` that's too small, or `+Directives:` has a `Max Line Width:` of 0 or less). Since user-supplied code shouldn't be tripping assertions, I looked into adding security around the calling sites when I realized that the assertion wasn't actually protecting against anything; the function would run just fine with a negative pixel width, it would just break with every whitespace. Since both calling sites that could trip the assertion already treat getting `src` back as output as an "I can't split this" error condition, it's perfectly fine (and skips iterating through the string) to just `return src` if the maximum pixel width is 0 or less, so let's just do that instead. Technically this is a behavior change in Release code, but the result of the old code would've been to spam the message log with every individual word in every message (if `Max Width:` was too small), and for directives to seemingly-randomly split only after the first word (if `Max Line Width:` was 0 or less). Not splitting at all is at least as correct, saves some pointless processing, and *should* still be obviously wrong if there was supposed to be a reasonable width value.
2023-06-28 11:56:38 -07:00
Goober5000 447ed95878 Merge pull request #5469 from Goober5000/fix_5387
tweak filename length check for PNGs
2023-06-25 01:33:02 -04:00
Goober5000 1ddf247fd5 Merge pull request #5471 from Goober5000/fix_5470
fix Assertion in turret_swarm_set_up_info
2023-06-25 00:32:16 -04:00
Goober5000 7f05f775af fix Assertion in turret_swarm_set_up_info
It appears that `(turret->turret_enemy_objnum < 0)` is an expected and allowed condition, so just assert that the objnum does not exceed MAX_OBJECTS.

Fixes #5470.
2023-06-23 22:55:41 -04:00
Goober5000 6cfc54499d tweak filename length check for PNGs
This is a bit tricky because both animated and non-animated PNGs use the same extension.  So for PNGs we need to defer the filename length check until we know for sure that it is an animated image.

Fixes #5387.
2023-06-21 03:45:14 -04:00
Joshua Glatt 4fa5c0d3e7 Fix save on mission close' container (#5463) 2023-06-20 21:12:37 -07:00
Goober5000 8c237626a5 Merge pull request #5462 from Goober5000/fix_5459
allow getting of mission info even for files with long names
2023-06-20 18:10:09 -04:00
BMagnu 41312265d5 Decouple MSAA from deferred end (#5467) 2023-06-21 06:17:56 +09:00
Goober5000 ee42e767a5 add warning to save; and make loading/saving more robust 2023-06-19 16:17:01 -04:00
wookieejedi f6b445ed2e Fix crash that can occur due to invalid glow point bank (#5465)
PR adds extra validity check within `model_render_glowpoints` function. Other places in code that use `bank->submodel_parent` check for validity before looking up `pmi->submodel`, but this check was missing from this section (which caused a CTD in a mission restart due to `bank->submodel_parent` being -1).
2023-06-18 22:14:16 -04:00
Goober5000 17d36156cb add const where appropriate to the modelrender API
See title.  There were some cascade effects, but the changes are mostly contained to the model code.  The calls to `gr_render_model` and `g3_render_primitives` use `const_cast` because constifying that API would require a whole other PR.
2023-06-18 14:05:46 -04:00
Goober5000 126c2e27f7 allow getting of mission info even for files with long names
Issue #5459 notes that mission files that are too long will crash the FRED campaign editor, but this is an artificial restriction.  The only need for a string buffer here is to enforce the correct mission extension, so use a SCP_string for this, and add checks for whether string manipulation is in fact necessary.  (In most cases it isn't.)

Fixes #5459.
2023-06-17 01:05:59 -04:00
Tyler Blount f4aa5c079f Merge pull request #5461 from TRBlount/23_2_RC
Begin 23.2 Release Cycle
2023-06-16 19:10:13 -07:00
Tyler Blount 4f9e1360a5 Update changelog and release.mako for 23.2 2023-06-16 17:13:38 -07:00
Tyler Blount d839f9f3c9 Merge pull request #5444 from Goober5000/5401_followup
refinements of jump node features
2023-06-16 14:38:12 -07:00
Tyler Blount 9d10066da7 Merge pull request #5318 from Goober5000/per_species_warp
add per-species warp effects
2023-06-16 14:35:45 -07:00
Goober5000 d42f3f79ac Merge pull request #5457 from Goober5000/zero_sun_bank
fix angle conversions in FRED
2023-06-15 22:32:33 -04:00
Goober5000 32982351dc Merge pull request #5456 from Goober5000/kitsune_fix
handle special characters in additional places in FRED
2023-06-15 22:32:24 -04:00
Goober5000 bcb9e48586 fix angle conversions in FRED
In certain cases, angles would be rounded to 360, where the expected range is 0-359.  The range was guarded properly for skyboxes but not for bitmaps and suns.  This fixes that.  Additionally, since suns do not bank, the angle conversion now sets the bank to 0.

Fixes #5390.
2023-06-14 14:31:12 -04:00
wookieejedi df323423dd Update Some Newish CM Options to Floats (#5452) 2023-06-12 19:24:07 -04:00
Goober5000 26abf577cc handle special characters in additional places in FRED
Kitsune discovered that special characters, notably semicolons, were not properly handled in the Mission Specs editor.  This adds appropriate handling of special characters for fields in that editor, similar fields in the campaign editor, and the corresponding places in qtFRED.  This also makes error messages more descriptive for campaign load failures.
2023-06-11 16:34:50 -04:00
BMagnu 7c0827aaa2 Move bad check (#5455) 2023-06-10 23:13:26 +02:00
Asteroth 4845f6837d fix ai reposition oversight (#5454) 2023-06-08 20:13:46 -04:00
Shivansps 15e7fb16d1 Validate chunk size to avoid align crash and add align skip flag (#5450)
* validate chunk size to avoid align crash and add align skip flag

* change type from uint to int

* change mprintf output to a warning

* revert uint to int change and requested changes
2023-06-08 16:05:56 -04:00
Asteroth 60f3aa59d6 Make lasers less kinky (#5446)
* properly handle trapezoidal bitmaps

* clean up

* fixup single segment trails too

* fix
2023-06-07 19:59:07 -04:00
BMagnu 8562dde955 OpenGL Capability Handling (#5445)
* Init Particle shaders only if they're actually used

* set layout correctly

* Don't compile shadow shader if not needed

* Properly deal with capabilities

* Fix typo

* remove obsolete capability
2023-06-07 19:58:55 -04:00
Mike Nelson 85f915f352 Fix typo and copy/paste error (#5449) 2023-06-06 16:39:35 -04:00
Goober5000 23f6b39597 Merge pull request #5407 from z64555/fix/5405
Fix 5405
2023-06-05 21:45:01 -04:00
Goober5000 c7bc0a7263 Merge pull request #5443 from Goober5000/lighting_profiles_followup
some updates to the lighting profile code
2023-06-05 21:44:35 -04:00
Goober5000 3ae178e125 refinements of jump node features
1. Deprecate the old set-jumpnode-name sexp now that there is a set-jumpnode-display-name
2. Make the display name design consistent with ships and weapons; in particular add a `HasDisplayName()` function and automatically generate the display name for hash-truncated names
3. Keep the display name in sync when the name is changed in the FRED dialog
4. Fix the overriding of hash-truncated names with display names on the HUD
5. Fix the incorrect setting of the alphacolor flag when using FRED
6. Fix array out-of-bounds access when no object is selected

Follow-up to #5401.
2023-06-05 00:41:38 -04:00
Goober5000 e7cb174684 Merge pull request #5442 from Goober5000/retime_pairs_fix_and_update
some refinements for retiming of object collision pairs
2023-06-04 22:11:04 -04:00
Goober5000 aef5a022a8 Merge pull request #5440 from Goober5000/drop_shadows_option
add game_settings.tbl option to enable HUD drop shadows by default
2023-06-04 16:38:49 -04:00
Goober5000 fe77cbee3c Merge pull request #5441 from MjnMixael/default_cm_class
Lua access to default countermeasure class
2023-06-04 16:38:42 -04:00
Goober5000 ab5e016dbb some updates to the lighting profile code
1. Add const qualifier where appropriate to API methods
2. Change `TonemapperAlgorithm` from enum to enum class, for type safety and token scope
3. Update saving of lighting profile in FRED
4. Add saving of lighting profile in qtFRED
5. Add lighting profile (and asteroid) initialization to qtFRED
2023-06-04 16:09:51 -04:00
Goober5000 91e7bea55e Merge pull request #5439 from Goober5000/followup_stuff
Fixes for lab backgrounds and curve initialization
2023-06-04 16:09:23 -04:00
Goober5000 c72b8b0cf4 some refinements for retiming of object collision pairs
1. Add a function to retime *only* the collision pairs involving a specific object.  This is useful when only one object has moved, since only collisions involving that object are affected.
2. Use this function when objects are moved for autopilot, via sexp, and via script.

Previously collision pairs were not retimed when objects were moved via script, leading to bugs.  This fixes that.
2023-06-04 16:04:53 -04:00
mjn-mixael c07389ce6b invalid weapon 2023-06-04 09:22:01 -05:00
z64555 f07e3322e9 Use a std::runtime_error instead of std::exception, because messages in std::exceptions are not a cstdlib spec.
* Update doxy to reflect changes
2023-06-04 09:04:17 -05:00
Goober5000 8e242b4c40 Merge pull request #5433 from Goober5000/sexp_tree_search
Sexp tree searching and filtering
2023-06-03 23:33:19 -04:00
Asteroth 9bd3b00b49 add single segment trails (#5432) 2023-06-02 21:28:45 -04:00
Asteroth 46b886df2c add single segment trails (#5432) 2023-06-02 20:23:07 -04:00
Asteroth 87ad9d99c4 add single segment trails (#5432) 2023-06-02 20:22:40 -04:00
mjn-mixael 1a946beed1 lua access to default countermeasure class 2023-06-02 17:40:44 -05:00
Goober5000 720d938a3a address feedback 2023-06-02 16:26:25 -04:00
Goober5000 ab63301d22 Merge pull request #5401 from MjnMixael/translatable_jump_node
Enhance jump node handling
2023-06-01 22:43:08 -04:00
Goober5000 f1bed594f8 Merge pull request #5435 from MjnMixael/lua_is_player_allowed
Flags to see if a ship or weapon class is player allowed
2023-06-01 22:42:58 -04:00
Goober5000 8a44ff160f Merge pull request #5438 from MjnMixael/fix_default_lighting_profile
Default profile name needs to be added after reset()
2023-06-01 22:42:48 -04:00
Goober5000 ee74f86c5e use correct #Background bitmaps string, use correct string skipping, and do a little tidying 2023-06-01 15:58:39 -04:00
Goober5000 68d216d973 add curves_init and alphabetize #include list 2023-06-01 15:38:22 -04:00
Goober5000 d7d9f10208 add game_settings.tbl option to enable HUD drop shadows by default
As requested by a comment on #4543.
2023-06-01 15:23:41 -04:00
mjn-mixael cc567edaf7 default profile name needs to be added after reset() 2023-05-31 15:50:20 -05:00
mjn-mixael fd6b670a04 flags to see if a ship or weapon is player allowed 2023-05-31 11:37:59 -05:00
Goober5000 b24594acb8 Merge pull request #5418 from scp-fs2open/dependabot/pip/ci/post/requests-2.31.0
Bump requests from 2.26.0 to 2.31.0 in /ci/post
2023-05-30 22:56:52 -04:00
Goober5000 af84b91619 Merge pull request #5421 from BMagnu/modular_subsystem_set_data
Virtual POFs: Modify Subsystems
2023-05-30 22:56:34 -04:00
Goober5000 e28e681d08 Merge pull request #5426 from Baezon/all-poofs-default
All poofs on by default
2023-05-30 22:56:24 -04:00
Goober5000 b223665c3d Merge pull request #5434 from TheForce172/fix/qtFredload
Quick fix to qtfred loading on linux
2023-05-30 22:55:53 -04:00
The Force 303e482047 Quick fix to allow qtfred to compile on ubuntu 2023-05-30 23:53:26 +01:00
Goober5000 8fc28b01ea work with operator indexes to reduce back-and-forth between const and index 2023-05-30 15:41:24 -04:00
Goober5000 278355cac0 select text by default, and implement escape 2023-05-30 15:41:22 -04:00
Goober5000 9bd10e55c6 sort operators by cost when filtering, and use the same best-match strategy in sexp_match_closest_operator 2023-05-30 15:41:17 -04:00
Joshua Glatt a10c733122 allow using container data with ai-waypoints* SEXPs (#5429) 2023-05-29 15:24:18 -07:00
Goober5000 a06573b15e implement type-to-filter and enter-to-confirm 2023-05-29 00:31:27 -04:00
Goober5000 4ff90d3716 move some utilities to a better location, plus a slight refactor 2023-05-28 22:47:38 -04:00
Goober5000 01b96de318 fix handle mismatch 2023-05-28 22:42:23 -04:00
Goober5000 eb959cd0bf make the tooltip explain why an operator can't be selected 2023-05-28 22:42:23 -04:00
Goober5000 46dee9ff0c use selected operators, and prevent disabled operators from being confirmed 2023-05-28 22:42:23 -04:00
Goober5000 579ce220ab fix some sexp help text 2023-05-28 22:42:23 -04:00
Goober5000 09ae954d8e disable operators with incompatible return types 2023-05-28 22:42:23 -04:00
Goober5000 4c43f22a7a multiline tooltips work 2023-05-28 22:42:22 -04:00
Goober5000 9967ed5150 add a new MFC control for the operators 2023-05-28 22:42:22 -04:00
Goober5000 ff2ec6a2ab preliminary sexp operator popup 2023-05-28 22:42:22 -04:00
z64555 9b0846c897 Try const std::exception &e, as per Goober5000's suggestion. 2023-05-27 20:25:41 -05:00
Mike Nelson 2ed78ab1a8 Fix asteroid wrapping (#5419)
* refactor how asteroid wrapping is done and setup for allowing or disallowing range check

* allow fred to toggle enhanced spawn checking

* field naming adjustment

* some minor tweaks

* Add sexp compatibility

* We don't need to save the boolean, just the string.

* full qtFRED support
2023-05-27 15:03:49 -04:00
Goober5000 99450fa643 remove hud_squadmsg_save_keys()
Remove this function and associated items, since they are commented out and unused.
2023-05-27 13:39:47 -04:00
Goober5000 5373ceb650 Merge pull request #5425 from Goober5000/comm_menu_hook
add hooks for comm menu opening and closing
2023-05-27 12:07:52 -04:00
Goober5000 8e7a93698b Merge pull request #5424 from Goober5000/hud_gauge_qtfred_update
patch qtFRED's handling of hud gauges
2023-05-27 12:07:44 -04:00
Taylor Richards b3532e71cc add support for loose lz4 compressed files (#5411) 2023-05-26 22:43:13 -04:00
EatThePath bee289cfa9 Merge pull request #5423 from EatThePath/ltp/fix-reset-new-profiles
call reset() on new profiles to ensure properly set default values.
2023-05-26 21:46:10 -04:00
Asteroth 5bf35ef048 all poofs on by default 2023-05-26 17:44:58 -04:00
Asteroth 16e0e3d6c4 Use volume particles for poofs (#5412)
* allow volume particles for poofs

* fix
2023-05-26 16:23:06 -04:00
Goober5000 59a5d2642c add hooks for comm menu opening and closing
Implements #5420.
2023-05-26 12:51:34 -04:00
Goober5000 346bbb61a2 patch qtFRED's handling of hud gauges
There was a missing function call in qtFRED's initialization, which prevented custom HUD gauges from being loaded.  This adds that.  Additionally, this updates the deduplication code in `get_listing_opf_custom_hud_gauge` to match its counterpart in FRED.

Fixes #5422.
2023-05-26 11:34:11 -04:00
ETP 2ba173d208 call reset() on new profiles to ensure properly set default values. 2023-05-25 20:13:04 -04:00
Birk Magnussen f4b6a4af61 Property Append Mode proper 2023-05-25 20:55:22 +02:00
Birk Magnussen f8220ccd60 Property Append Mode 2023-05-25 20:54:04 +02:00
Birk Magnussen be29fc9eaa fix warning 2023-05-25 12:15:18 +02:00
Birk Magnussen 4d25b34c1b Add Subsystem data change 2023-05-25 12:12:55 +02:00
Asteroth 71ac62e395 add parent size and parent lifetime 2023-05-24 23:54:38 -04:00
EatThePath b32e7b35f7 fix #5416 by loading correct table filenames and ensuring tonemapper is parsed into proper profile. (#5417)
Also fixes semi-spurious warnings about missing default profile by ensuring proper creation of the default profile even if no files are found.
2023-05-22 22:46:58 -04:00
dependabot[bot] b837c4fa7a Bump requests from 2.26.0 to 2.31.0 in /ci/post
Bumps [requests](https://github.com/psf/requests) from 2.26.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.26.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-23 02:42:44 +00:00
Goober5000 7443fed890 Merge pull request #5415 from Goober5000/iequals
add lcase_equal and lcase_lessthan
2023-05-21 21:19:12 -04:00
Asteroth d4beb69328 Add player damage inflicted factor (#5406)
* add player damage inflicted factor

* update default file
2023-05-21 08:17:31 -04:00
Goober5000 d6f3fc76f9 Merge pull request #5414 from Goober5000/fix_event_delay_status
fix evaluation of event status for some events
2023-05-20 18:53:58 -04:00
Goober5000 3e0c7f0721 add lcase_equal and lcase_lessthan
The `SCP_string_lcase_equal_to()()` and `SCP_string_lcase_less_than()()` functors are rather unwieldy to use in non-functor situations, so this adds conventional function equivalents.
2023-05-20 18:21:37 -04:00
Goober5000 d0409ee7be Merge pull request #5409 from Goober5000/fred_and_parse_cleanup
some cleanup and refactoring
2023-05-20 12:41:10 -04:00
Fabian Woltermann 04ad198bb1 Merge pull request #5380 from EatThePath/ltp/multiple-profiles
Ltp/multiple profiles
2023-05-20 10:27:21 +02:00
Fabian Woltermann ca66b41a9e Merge branch 'master' into ltp/multiple-profiles 2023-05-20 10:02:05 +02:00
Goober5000 38c04d0ab3 fix evaluation of event status for some events
Related to #5267, and again concerned with the original check for event delay:
```
if ( (fix) Mission_events[i].timestamp + delay >= Missiontime )
    return SEXP_FALSE;
```
For events that were never evaluated at all, their timestamp remained 0.  Thus the function did not return and the status of the event (which by definition was incomplete) was always checked.

After the timestamp refactoring, this comparison always returned SEXP_FALSE for these events.  The correct behavior is to bypass invalid timestamps so that the status of the event is always checked.

This fixes the behavior of `is-event-false-delay` in debriefings.
2023-05-19 23:11:35 -04:00
Goober5000 d784f18a52 Merge pull request #5410 from Goober5000/fix_qtfred_init
fix qtFRED initialization
2023-05-19 20:57:29 -04:00
Mike Nelson d87cd04aad Traitor overrides feature (#5404)
* Traitor overrides feature

* must code the way goober codes or else

* clarity is key when you're ocd

* even more clarity
2023-05-19 13:07:50 -04:00
ETP aec4977e6e cleaned up some dead commented code 2023-05-19 13:05:28 -04:00
Goober5000 c7ad3592a6 fix qtFRED initialization
The `stars_post_level_init()` change in #5403 exposed a bug where qtFRED would sometimes try to render the mission before all setup had been completed, causing a crash because `Show_iffs` was zero-length.  This was due to the mission being created in the middle of initialization, instead of after initialization was complete.  This fix moves `createNewMission()` to main.cpp, after initialization has finished, and in parallel with the command-line option to load a mission.
2023-05-19 00:37:13 -04:00
Goober5000 1fe528b86d Merge pull request #5403 from Goober5000/skybox_timestamp_fix
patch FRED handling of starfield setup
2023-05-18 18:33:24 -04:00
Goober5000 34663c68bd some cleanup and refactoring
Refactor and clean up some of the code, and add some fixes and utility functions.  This covers the non-X-Wing part of #5277.
2023-05-18 18:28:09 -04:00
Asteroth 29e77013ab init curves in fred (#5408) 2023-05-18 04:51:51 -04:00
z64555 3ec4480c13 We actually want to throw when the pointer is a nullptr, thank you. 2023-05-17 09:38:54 -05:00
z64555 562dd95da3 Replace Assertion within io::joystick::Joystick's constructor with a throw.
* Add try-catch block within enumerateJoysticks() to catch the exception thrown by the Joystick constructor and log the deviceid and the SDL error.
2023-05-17 08:49:47 -05:00
Goober5000 2b1cd53db9 Merge pull request #5397 from Goober5000/lua_is_player
add ship:isPlayer()
2023-05-14 22:05:21 -04:00
Goober5000 be8c3ebb2f patch FRED handling of starfield setup
1. Skybox initialization (and perhaps other aspects of mission initialization) requires the existence of a timestamp snapshot, so make sure a snapshot has been taken before FRED creates a mission.  Follow-up to #5343.
2. Move `stars_post_level_init()` to `Editor::createNewMission()` in qtFRED to be consistent with FRED's `create_new_mission()`.

Fixes a crash when the user tries to add a skybox when FRED first launches.
2023-05-14 15:35:18 -04:00
BMagnuandFabian Woltermann b0b05b35fd MSAA (#5400)
* Add MS buffers

* Implement basic MSAA with commandline

* Move MSAA init to deferred pipeline

* Fix shadows when MSAA is enabled

* Implement resolve shader

* Cleanup basic resolve shader

* Implement front-first depth-aware MSAA resolve

* Fix background resolve

* Allow setting MSAA level

* Ensure good MSAA level

* Code Median shader for different sample counts

* Cleanup

* Add MSAA options toggle

* Add MSAA sample count pre-parsing

* Add GL scope

Co-authored-by: Fabian Woltermann <[email protected]>

* Typo
2023-05-14 08:14:51 +00:00
ETP 7beb28b4f6 added lab interface for selecting lighting profiles. 2023-05-13 21:12:59 -04:00
ETP a094eb00c8 Trim out some future feature code. 2023-05-13 21:12:59 -04:00
ETP 6ccde7b01d maybe appease CI 2023-05-13 21:12:58 -04:00
ETP 62b70e74ca Rebasing lighting profile switchery 2023-05-13 21:12:58 -04:00
EatThePath 89ffbb5a34 Merge pull request #5347 from EatThePath/ltp/profile-code-reorg
lighting profile code reorg
2023-05-13 21:11:58 -04:00
mjn-mixael 4c7e9f6585 On second thought, this should still be Name and not DisplayName 2023-05-12 16:38:07 -05:00
mjn-mixael 78b957982b enhance jump node handling 2023-05-12 15:30:41 -05:00
Goober5000 8aa5a22f5d Merge pull request #5399 from BMagnu/modularpof_parent_subsystem
Fix modular pof handling of dock / path parent names
2023-05-12 14:19:16 -04:00
BMagnu 26cfc8d017 Make check case insensitive 2023-05-13 01:52:40 +09:00
Goober5000 5ed0a9161c Merge pull request #5398 from Goober5000/update_dock_flags
update type_flags when dock name changes
2023-05-12 11:39:36 -04:00
Birk Magnussen 6f8c8e802a fix modular pof handling of dock / path parent names 2023-05-12 10:26:13 +02:00
Goober5000 712a70444b update type_flags when dock name changes
The `type_flags` on a model's dockpoints are determined by the dockpoint name.  If the name changes, the flags should be updated accordingly.

This fixes a bug in Scroll where a dockpoint that was imported and renamed to start with the word "cargo" was not compatible with cargo docking as expected.
2023-05-12 04:08:38 -04:00
Goober5000 eaf57bddf3 add ship:isPlayer()
Add Lua functions to check whether a ship or parse object is a player ship.
2023-05-12 00:35:29 -04:00
wookieejedi 29f82cb5d7 Fix two undocking bugs for small ships (#5396) 2023-05-11 17:06:42 -04:00
Goober5000 7846e593a0 Merge pull request #5394 from BMagnu/fix_anim_crash_dead_ship
Add additional checks for Animation List handling of nonexistent polymodel instances
2023-05-08 23:19:40 -04:00
Birk Magnussen ff3be1a4e3 Add additional checks for animation list handling of nonexistent polymodel instances 2023-05-06 13:42:21 +02:00
Goober5000 25348edff2 Merge pull request #5391 from Goober5000/tweak_int_parsing
make number parsing a little more forgiving
2023-05-05 14:38:04 -04:00
Goober5000 0bdcd3c2f4 Merge pull request #5393 from MjnMixael/lua_enum_index_fix
Lua Enum Hotfix
2023-05-05 14:37:54 -04:00
mjn-mixael 13a990a98f this needs to be converted from base 1 2023-05-05 10:14:48 -05:00
Asteroth 18ba984f3e fix for weapons with lots of inherited velocity (#5392) 2023-05-05 07:58:37 -04:00
Fabian Woltermann 488db515ce Merge pull request #5388 from BMagnu/fix_shader_hdr
Fix HDR conversions in main shader
2023-05-05 13:54:20 +02:00
Mike Nelson 3f8e3360f9 Some additional splash screen features (#5379)
* some additional splash screen features

* Do this based on actual milliseconds

* splash screen is skipped in standalone

* os_poll()
2023-05-04 14:24:10 -04:00
Goober5000 61579f746c make number parsing a little more forgiving
In retail, number parsing picked up immediately at the character after the number parsed, so parsing `0.50` as an int would yield 0, and then the next available characters would be `.50`.  Even though parsing has been tightened up and made stricter, we can still "fail gracefully" by simulating the old behavior.  And when failing gracefully, the message can be a warning.
2023-05-03 22:44:55 -04:00
Asteroth 02a40ae905 Remove model octants (#5373)
* remove model octants

* actually remove the struct

* comments

* remove scratch comment

* initialize
2023-05-01 23:54:43 -04:00
Goober5000 04a9de69ea Merge pull request #5375 from Goober5000/4562_redux
Modernise CFLAGS on Mac/Linux
2023-05-01 23:25:20 -04:00
Goober5000 1457bb0c7f Merge pull request #5386 from MjnMixael/no_unicode_font_error
Warn instead of error for bitmap fonts in unicode
2023-05-01 23:25:01 -04:00
Goober5000 275c7ffe66 Merge pull request #5389 from Goober5000/5381_followup
clear caches for both nodes in rand_sexp
2023-05-01 23:23:41 -04:00
Goober5000 e120bb90b6 clear caches for both nodes in rand_sexp
Since `rand_sexp` also writes text into the sexp node for the seed value, its cache should be cleared too.  And since this is a pretty common operation, wrap it in a `clear_cache` function.

Follow-up to #5381.
2023-05-01 16:36:58 -04:00
Goober5000 10ce1ac625 sync toolchain-apple-clang.cmake flags with the ones in toolchain-clang.cmake 2023-05-01 14:54:08 -04:00
Birk Magnussen baada08eca Fix shader 2023-05-01 20:00:59 +02:00
Goober5000 996a2002e6 Merge pull request #5377 from Goober5000/remove_old_fred_components
remove some obsolete FRED components
2023-04-30 20:48:50 -04:00
wookieejedi 5a1ac87802 Update recent particle optimizations to fix edge case slowdowns (#5385)
#5328 added a very useful culling for particles created by specific particle effects (ie weapons, now beams), though in an effort to simplify the culling process, that PR removed the necessary culling of default smoke on ships. This PR restores the culling of default smoke while also keeping the new culling of particle specific effects. Tested and works as expected, including fixing the slowdowns caused by the aforementioned removal of smoke effect culls.
2023-04-30 15:15:37 -04:00
mjn-mixael 9e5894512c warn instead of error 2023-04-30 10:57:15 -05:00
MageKing17 e5301b7595 Fix the rand SEXP's use of cached values. (#5381)
The `rand` SEXP stores the result of its first call in the "low" node. Prior to PR #2402, this worked fine, but after that, the value is cached when first evaluated, meaning that subsequent calls to the `rand` SEXP will always return the lowest value in the range, not whatever number was rolled the first time.

This commit makes it so that writing the rolled value to the node's `text` attribute is immediately followed by deleting the no-longer cached value, so that the SEXP continues to work as intended.
2023-04-30 11:31:32 -04:00
MageKing17 ae91e4af1b Actually handle a missing Fade_anim properly. (#5382)
When I made FSO not crash with demo data in PR #1156, I avoided calling `brief_maybe_blit_scene_cut()` if `Fade_anim` didn't load, when I should've made it do what the icculus port does in demo mode: pretend the animation finished immediately.

With this commit, the first mission of the demo correctly advances past the first briefing stage.
2023-04-29 17:13:37 -07:00
Fabian Woltermann b77902309a Merge pull request #5384 from The-E/fix/division_by_zero_when_rendering_glowpoints
fix crash in glowpoint rendering
2023-04-29 19:32:32 +02:00
Fabian Woltermann 09a1485a7b this makes sure we do not run into a division by zero under certain circumstances. Also skips glowpoint rendering if the glowpoint is currently invisible 2023-04-29 18:04:39 +02:00
Asteroth 63df812d79 Add beam particles (#5330)
* add beam particles

* tweaks

* more tweaks

* fix warning

* dumb c++

* fix switch

* spelling
2023-04-29 08:45:31 -04:00
Goober5000 4dc6fd417f Merge pull request #5374 from Goober5000/required_for_mission_fred
Add FRED support for the "required weapon" feature
2023-04-27 14:41:11 -04:00
Goober5000 f15c5188c3 remove some obsolete FRED components
- remove FolderDlg which hasn't been needed since we dropped support for Visual Studio 6
    (see version history of MFC, https://mariusbancila.ro/blog/2015/08/12/version-history-of-vc-mfc-and-atl/)
- remove dialog1 which isn't used
2023-04-27 14:37:01 -04:00
Asteroth b8dacdd898 afterburning hard ignores wings (#5376) 2023-04-27 02:51:41 -04:00
Goober5000 b97430e5a0 move from setjmp to try/catch 2023-04-26 19:36:16 -04:00
Goober5000 64c27d8186 fix unused variable warnings 2023-04-26 19:36:16 -04:00
Asteroth d43cf1018d ensure pmi for this lookup (#5372) 2023-04-25 22:27:41 -04:00
Goober5000 e7048f6940 make CI happy 2023-04-25 13:25:08 -04:00
Goober5000 ef1933ec1b Modernise CFLAGS on Mac/Linux
Per GCC optimisation guide, which applies equally well to clang:
* -funroll-loops should not be used unless directed by profiling. The compiler will already unroll loops when it's a good idea.
* clang and gcc now have -Og optimisation levels designed to enable debugging with good performance.

(second attempt at PR #4562)
2023-04-25 13:22:18 -04:00
Goober5000 2a74c93313 link with team loudout dialog 2023-04-25 12:51:23 -04:00
Goober5000 143c52d252 add checkboxlistdlg 2023-04-25 12:18:00 -04:00
Goober5000 53ba2e792a modify loadout dialog 2023-04-25 12:18:00 -04:00
Goober5000 06df0a8a4d Merge pull request #5332 from Goober5000/xmt_ssm
improve XMT handling of ssm.tbl
2023-04-25 00:14:04 -04:00
Taylor Richards 28747bb1b7 warn when a critical file might be be shadowed (#5350) 2023-04-24 02:19:30 -04:00
wookieejedi f2987aa749 Fix max Z speed when using ETS and engine damage tracking (#5368)
* Fix max Z speed when using ETS and engine damage tracking

Follow up for #5137 and #5292. This engine strength check thus needs to be added to all instances where `max_vel.xyz.z` is updated, so a function was created and added in respective locations. Fixes #5367.

* cleanup and adding validity assertations

* cleanup outdated comments

* might as well make the cleanup look nice

* update to account for more edge cases

* cleanup
2023-04-23 22:01:05 -04:00
Fabian Woltermann 938eacdee9 Merge pull request #5370 from The-E/fix/crash_when_logging_ai_submode
Fix crash when logging ai submode
2023-04-23 20:08:47 +02:00
Fabian Woltermann 898c0c1945 fix a crash when attempting to log the ai being in certain submodes 2023-04-23 19:19:44 +02:00
Fabian Woltermann 6234c97f4f fix invalid access when choosing builtin messages (#5369) 2023-04-23 17:19:23 +00:00
Fabian Woltermann 8dd4a05cd1 fix invalid access when choosing builtin messages 2023-04-23 18:52:15 +02:00
BMagnu 6e561761d1 Cleanup Variable Names for Volumetrics (#5362)
* Rename opacityDistance

* Add oversight
2023-04-23 08:16:12 -04:00
Goober5000 b3f237b8c1 Merge pull request #5366 from Goober5000/fred_rc_fixes
some FRED cleanup
2023-04-22 12:14:37 -04:00
Goober5000 587d5af8ca some FRED cleanup
1. Disambiguate dialog IDs for the music player and the volumetric nebula dialogs
2. Fix compilation of qtFRED
3. Small refactor of Personas access to use STL functions where appropriate
2023-04-21 23:16:51 -04:00
Goober5000 0cc28cf8fc Merge pull request #5348 from MjnMixael/sync_color_handling
Deprecate old versions in favor of versions that use color objects
2023-04-21 21:49:08 -04:00
Goober5000 5c9b309293 Merge pull request #5361 from Goober5000/fred_orient_qol
FRED object editor QOL improvements
2023-04-21 21:48:38 -04:00
Mike Nelson c19f05a9d9 organize and map additional keys (#5354) 2023-04-21 21:05:54 -04:00
BMagnu ab4d1fb779 Skip anim if type is unknown (#5363) 2023-04-22 02:28:27 +09:00
BMagnu 13e1f28c4a FRED Dialog for Volumetrics (#5351)
* Add volumetrics dialog skeleton

* Implement first fields in dialog

* Add dialog to main window

* Fix Spinners

* Add all non-noise inputs

* Add Noise Fields

* Fix errors

* Add Tooltips

* Fix fred menu

* Init dialog
2023-04-22 01:06:58 +09:00
Goober5000 bce1e7c2d9 Merge pull request #5360 from Goober5000/improve_spawn_collision
improve spawn collision checking
2023-04-21 09:40:47 -04:00
Goober5000 2f654c496c FRED object editor QOL improvements
1. When the "object" radio button is selected, the "point to" check box will also be selected
2. When an object is selected from the object list, the "object" radio button and "point to" check box will also be selected

Fixes #5356.
2023-04-20 23:58:18 -04:00
Goober5000 1feef8ff2a improve spawn collision checking
Take into account the collision flag and collision groups when spawning a ship.  Should fix #5357.

Also clean up the code a bit, including setting a few `int`s to `bool`s and adding a missing axis case.
2023-04-20 22:31:34 -04:00
Asteroth fa0878b6b3 Add an Ai goal flag to afterburn hard (#5338)
* add afterburn hard flag

* return some ab locked checks

* this one too

* more tweaks
2023-04-20 19:42:35 -04:00
wookieejedi 21d1ffd3bd Fixes CTD with New Particle Lifetime Curve (#5358)
Turns out Velocity Lifetime Curve was never initialized.
2023-04-20 14:39:46 -04:00
Goober5000 237fea6cbf Merge pull request #5355 from Goober5000/enhanced_sexp_warnings
enhance some SEXP warnings
2023-04-20 11:29:42 -04:00
mjn-mixael 95649dafa1 cleanup 2023-04-20 09:37:33 -05:00
EatThePath 427873a345 remove int3 from the rest of the batching things (#5349) 2023-04-20 07:43:29 -04:00
Asteroth 4a53ff742d Add debris density (#5340)
* add debris density

* doc new param
2023-04-20 02:48:19 -04:00
Goober5000 581c834353 Merge pull request #5337 from Goober5000/various_tweaks
Various tweaks and polishing
2023-04-19 22:20:53 -04:00
Goober5000 58f3e8fb06 Merge pull request #5345 from MjnMixael/finalize_scpui_api
Finalize scpui api
2023-04-19 22:20:06 -04:00
Goober5000 d7a2bba630 enhance some SEXP warnings
These messages add the context of the actual SEXPs causing the warnings to be displayed.  Motivated by Admiral Nelson's mod debugging work.
2023-04-19 22:15:21 -04:00
Goober5000 0d6791ff1d Merge pull request #5353 from Goober5000/joe_fixes
Joe fixes
2023-04-19 22:14:33 -04:00
Asteroth 9be559622e dont overwrite a disallowed depart order (#5352) 2023-04-19 17:30:09 -04:00
Asteroth 31b23d8c50 Whackable debris and asteroids (#5291)
* whackable debris and asteroids

* fixes

* review tweaks

* some more review tweaks
2023-04-19 10:56:46 -04:00
Asteroth 56f010a231 Add arbitrary curves support (#5323)
* Add arbitrary curves support

* review tweaks

* pretty sure i dont need this anymore
2023-04-19 08:13:06 -04:00
Goober5000 f0322a12f2 remove unused variable 2023-04-18 20:50:17 -04:00
Goober5000 f62e437dbd properly handle wingmen that are destroyed before mission 2023-04-18 19:50:32 -04:00
Goober5000 41e338e8ab Joe fix: if the Instructor is known to a mission, it should govern training messages 2023-04-18 19:49:29 -04:00
Goober5000 6ce1f5276a Joe fix: if a ship can't find a dock path, the game shouldn't crash 2023-04-18 19:46:36 -04:00
mjn-mixael 623f887495 documentation 2023-04-18 09:18:36 -05:00
mjn-mixael 3f6eae0836 Update methods to optionally accept and return color objects 2023-04-18 08:37:30 -05:00
Asteroth 0bffa82422 fix wep glowpoints (#5344) 2023-04-18 08:04:16 -04:00
Goober5000 d203d2915f Merge pull request #5343 from Goober5000/synchronized_timestamps_take_2
synchronize simulation timestamps across the entire frame
2023-04-17 19:15:32 -04:00
EatThePath 64af9e520c Merge pull request #5154 from EatThePath/opt/less-batching-find
Optimizing the trail renderer by avoiding repeated batch_find calls
2023-04-17 16:15:59 -05:00
ETP 77c7aee8f4 Moved the configurable profile adjustments into their own file 2023-04-17 14:58:14 -05:00
mjn-mixael eafab41823 unify language and capitolization 2023-04-17 14:50:38 -05:00
BMagnu bbb7599512 Add proper time wrapping for animations (#5339) 2023-04-18 04:40:04 +09:00
BMagnu 522e1aa360 Restrict player order accept ship (#5341) 2023-04-18 04:39:56 +09:00
ETP 57f9455f6c moving lighting profiles into a namespace and arranging it as cleanup for future changes 2023-04-17 14:36:41 -05:00
ETP a8035fec36 Applied formatting to lighting profiles files 2023-04-17 14:06:21 -05:00
Goober5000 9b337b714b take a new snapshot when time compression is updated 2023-04-17 12:10:56 -04:00
mjn-mixael f5a08bb694 change api description to finalize 2023-04-17 08:53:52 -05:00
mjn-mixael da7d9f28b9 global to param 2023-04-17 08:53:26 -05:00
Asteroth 4bbc9f3eb3 Improve particle culling and performance (#5328)
* better particle culling

* remove range on emitters

* explicit cast

* bit more efficient
2023-04-17 08:03:41 -04:00
Asteroth 7c4b9272d5 Randomize particle rotation (#5335)
* randomize particle rotation

* spelling

* initialize it, dummy
2023-04-17 07:37:38 -04:00
Goober5000 051d85d05c fix time compression with snapshotted timestamps
Because time compression adjusts the raw timestamp to be 0, it must use the exact value, not the snapshotted value, or the mission time will be slightly off.  So this commit fixes that problem, as well as making sure that changes in time compression always occur at the start of a frame.
2023-04-16 22:19:57 -04:00
Goober5000 b487969e5f use constant 2023-04-16 14:27:59 -04:00
ngld 86a81bfb9c Merge pull request #5342 from ngld/pr/fix-nightly-upload 2023-04-16 19:39:15 +02:00
ngld d7c22b126c Mark the nightly upload step as succesful as long as at least one mirror got the file 2023-04-16 19:00:32 +02:00
Mike Nelson 108def6224 Scpui Hud Config API (#5302)
* initial API for hud config elements

* get rendering, highlighting, and selecting working

* Add a way to create color objects

* some cleanup and fixes

* go away we dont need you

* allow arbitrarily scaling the hud config draw

* last few config options and innitial preset handling

* vectorize hud presets and setup handling

* some last minute fixes

* iiiiiiiiiiiiiiiiiiiiiiint

* really

* documentation and address feedback

* completely revert this as well

* more documentation

* document all the things

* comment out unused parameter

* peach emoji retentive

* whatever

* return types

* color
2023-04-16 08:13:06 -04:00
BMagnu ff296f8f98 Add a Translation Moveable (#5313)
* Add Translation Moveable

* Update SEXP docs

* Update some strings
2023-04-16 20:56:44 +09:00
Goober5000 4106414858 timestamps need to be synced in FRED too 2023-04-15 22:36:22 -04:00
Goober5000 9c5b4dfb49 synchronize simulation timestamps across the entire frame
Prior to the timer upgrade, all simulation timestamps shared identical timer and timestamp values for the duration of the frame, since they were only updated within the `game_set_frametime` function.  Since the timer upgrade depends on the system clock, timestamps evaluated near the end of the frame will be very slightly later than timestamps evaluated near the beginning of the frame.  It is desirable to keep them all in sync.

This PR tweaks the timestamp system to take a snapshot at the beginning of the frame, then use that snapshot for the entire duration of the frame.  This only affects simulation timestamps; real-time timestamps still use the live timer.
2023-04-15 22:17:23 -04:00
Goober5000 1083f34ffc Merge pull request #5336 from Goober5000/rank_adjustment
tweak rank handling in Lua
2023-04-15 22:04:38 -04:00
Mike Nelson 3c30257816 Modular messages table (#5285)
* modular messages table

* clarify warning
2023-04-16 08:40:25 +09:00
BMagnu 023a7d3e68 "On Frame but actually Wait before you continue"-Executor (#5314)
* add 'syncronized async run'

* cleanup

* cleanup 2

* Properly free the screen

* Incorporate feedback
2023-04-16 08:39:49 +09:00
BMagnu f32b575f0c Allow 0-Asteroid setups (#5329)
* Allow 0-Asteroid setups

* Make mission brief error non fatal
2023-04-16 08:39:04 +09:00
Asteroth 1525f829b7 Flush empty cbrief voice filenames to "None" (#5333)
* make clearing cbrief voice easier

* qtfred too

* ani_filename too
2023-04-15 15:06:37 -04:00
Goober5000 a932dc94c0 Merge pull request #5307 from MjnMixael/explicit_no_wrap
Explicitely do not split lines when making the message log
2023-04-15 14:59:09 -04:00
Goober5000 55a92a32de a bit of encapsulation 2023-04-15 14:23:05 -04:00
Goober5000 0c8a6c6f97 small streamlining 2023-04-15 14:23:05 -04:00
Goober5000 5e3f8e4792 Merge pull request #5334 from Goober5000/check_whitespace_comma
check for whitespace between token and comma
2023-04-15 14:19:37 -04:00
Goober5000 7018a560b9 streamline type conversion 2023-04-15 00:06:33 -04:00
Goober5000 bcc964d0fa color tweaks 2023-04-15 00:06:33 -04:00
Goober5000 8fbe2c244a address feedback 2023-04-14 20:34:19 -04:00
Goober5000 c6a2dcdfa9 tweak rank handling in Lua
Follow-up to #5280:

1. Make the Rank virtvar actually return a rank object, to be consistent with other Lua API methods
2. Add a RankIndex virtvar to replicate the previous functionality
3. Make RankIndex return the expected 1-based index for Lua

This is a breaking change to the API, but since the original API is less than a month old, the impact should be small.
2023-04-14 19:17:46 -04:00
Goober5000 d28db605a9 avoid repeated commas 2023-04-14 11:51:03 -04:00
Goober5000 67428f506c grayspace makes more sense here 2023-04-14 10:56:11 -04:00
Goober5000 0ff15cfe16 check for whitespace between token and comma
When parsing a list of numbers, such as in the $uvec or $fvec of models, a bug was reported where whitespace before the comma caused the number parsing to fail.  This change checks for a comma after whitespace instead of checking for a comma as the very next character.
2023-04-14 02:51:01 -04:00
Goober5000 4ee4f51ee2 improve XMT handling of ssm.tbl
Extensible modular table handling for -ssm.tbm files was not very robust due to quite a few assumptions left over from straight .tbl parsing.  Ostensibly optional fields were required, non-overridden fields were reset to defaults, etc.  This improves XMT parsing and adds sensible defaults for SSM fields.
2023-04-14 01:12:09 -04:00
Goober5000 4da52ca23b Merge pull request #5325 from Goober5000/hotkey_followup
convert hotkey types to enum
2023-04-14 01:07:44 -04:00
Fabian Woltermann 1d52bc5876 make sure deferred_global_data follows the alignment rules (#5331) 2023-04-13 20:45:56 +00:00
Asteroth 689dca1f3f bugfix accidental swap (#5324) 2023-04-12 14:55:04 -04:00
Goober5000 bb53f7ee68 type safety revealed something 2023-04-12 10:55:38 -04:00
Goober5000 78d9562661 feedback and fix 2023-04-12 10:55:38 -04:00
Goober5000 b7d1270439 convert hotkey types to enum
Here's a suggested followup to #5249.  This converts the hotkey type to an enum for improved type safety.  It also adds the corresponding Lua enums and adjusts the Type virtvar to return them.
2023-04-12 10:55:36 -04:00
Goober5000 257ba70d70 Merge pull request #5326 from Goober5000/validity_checks
add validity checks
2023-04-12 10:52:39 -04:00
Goober5000 10e5875289 add validity checks
Many of the recent scripting API enhancements are missing validity functions and validity checks, so this adds them.  There are also some documentation fixes and a >= vs. > bugfix.
2023-04-12 00:14:20 -04:00
BMagnu 64de96f6ce Fix Subsystem serialization (#5319) 2023-04-12 00:31:54 +09:00
Asteroth ac9636733f ets fixes (#5317) 2023-04-11 06:31:04 +09:00
Asteroth a2df152323 Add fov values to .pof models (#5244)
* add model fov values

* initialize proper defaults

* set defaults directly
2023-04-11 06:30:17 +09:00
Goober5000 fbca88d36d add per-species warp effects
This allows warp parameters to be specified in species_defs.tbl, rather than requiring them to be specified for each ship in ships.tbl.  Since this introduces a cyclic dependency between species_defs.tbl and sounds.tbl, the parsing of sounds.tbl is broken into two stages.

Implements request from #5283.
2023-04-10 17:24:38 -04:00
Mike Nelson e01a5359ac Scpui API for Control Config (#5305)
* read access to controls

* Early draft of checking keypresses in scpui

* detangle some code and prepare it for API usage

* API access to the core methods required

* move these checks into the UI methods

* comment

* fix bugs

* be smarter

* Need this stuff, too

* some more presets work

* unify func naming scheme

* cleanup and clarifications

* get detect keypress working

* allow searching and creating new presets based on current controls

* address feedback

* return nil if no preset is matched

* use the builtin methods which do the same thing, but slightly cleaner

* typo
2023-04-07 12:02:13 -04:00
BMagnu e2b205ffaa Modular POF Features 2 (#5209)
* Add weapon bank copy

* Add Path / Dock point copying

* cleanup

* Fix dock points

* Fix copy paste error

* Incorporate feedback

* Incorporate feedback 2

* delete copy assignment
2023-04-07 08:12:20 +09:00
Goober5000 1388866ddd Merge pull request #5315 from Goober5000/fix_qtfred_compilation
fix qtfred compilation
2023-04-06 11:04:31 -04:00
Goober5000 7e9e8bcb62 additional fixes 2023-04-05 21:14:45 -04:00
Goober5000 deded57112 fix qtfred compilation
Fix various compilation warnings and errors.
2023-04-05 20:56:53 -04:00
BMagnu 599a1893c3 Add +Use Ship as Template (#5311)
* Implement +Use Ship as Template

* Update Warning Message
2023-04-06 07:10:30 +09:00
Goober5000 dbff592f94 Merge pull request #5312 from Goober5000/chase_view_toggle
make 'player starts in chase view' a toggle
2023-04-05 13:00:23 -04:00
Goober5000 9c00070154 revert view on escape 2023-04-05 00:04:58 -04:00
Asteroth 203b738f79 Add $CockpitLaunchSnd (#5300)
* add cockpit launch snd

* whoops

* another whoopsie
2023-04-04 23:40:15 -04:00
Goober5000 b016163bf3 make 'player starts in chase view' a toggle
Per request of #5226.  This PR also makes the variable names more consistent.
2023-04-04 23:34:03 -04:00
Fabian Woltermann 884d47611f Merge pull request #5310 from The-E/fix/5309_div_by_zero_in_glowpoint_rendering
fix rare division-by-zero caused by unchecked data
2023-04-03 18:56:30 +02:00
Fabian Woltermann a786e2d541 fix rare division-by-zero caused by unchecked data 2023-04-03 18:16:44 +02:00
Goober5000 dc2370393e Merge pull request #5251 from Goober5000/move_self_destruct_log
move self-destruct mission logging to ship_hit_kill
2023-04-03 10:28:50 -04:00
Mike Nelson 0dd4daf2eb modular traitor + cleanup (#5188) 2023-04-03 14:12:57 +02:00
naomimyselfandi 949141c611 Message filter follow up (#5304)
* Fix intra-persona message borrowing logic

Closes #5299.

* Always assign personae for Support

Disabling the Auto_assign_personas flag had the side-effect of prohibiting support ships from ever speaking. Since a mod that wants this behavior (for whatever reason) can just not have a support persona, this commit makes an exception for them.

* Make Protect Target and Cover Me adaptive like Engage Enemy is

* Respect the allow subsitution flag
2023-04-03 08:11:46 -04:00
Fabian Woltermann 14689265ce Merge pull request #5308 from TRBlount/fix/vulkan_build
Prevent build error when Vulkan SDK isn't installed
2023-04-03 09:23:53 +02:00
Tyler Blount 837ac8d08e Also force if the option is set, but Vulkan could not be found 2023-04-02 19:56:50 -07:00
Tyler Blount 6cac2af8e4 Default to OFF for FSO_BUILD_WITH_VULKAN 2023-04-02 18:47:41 -07:00
mjn-mixael 80004f2996 explicitely do not split lines 2023-04-02 19:43:53 -05:00
Asteroth e3cd5c819f removal of current_max_speed (#5292) 2023-04-01 16:13:08 -04:00
Asteroth 39273db918 $beaminfo implies beam flag (#5297) 2023-04-01 16:12:32 -04:00
Asteroth cd36ce336f small fix for type5 fighter beams (#5298) 2023-04-01 16:11:54 -04:00
Goober5000 dcdade36a3 Merge pull request #5293 from Goober5000/5290_followup
additional constraint on Command arrival messages
2023-03-30 22:05:52 -04:00
naomimyselfandi cbbd197cd3 Add "no-first-wave-message" wing flag (#5288)
* Add "no-first-wave-message" wing flag

For when you want custom dialogue for the first wave, and automatic announcements for the rest.

* Fix FRED macro name
2023-03-30 21:17:03 -04:00
Goober5000 5d4cd31a79 fix IFF logic for teams that attack themselves (#5294)
If a team explicitly attacks itself, then the same-team checks should not apply.  Fixes a bug reported by SilverAngelX on Discord.
2023-03-30 21:16:45 -04:00
Asteroth 835285248e No overlapping turret sounds (#5295)
* prevent overlapping turret sounds

* whitespace

* fixes
2023-03-30 21:16:32 -04:00
Goober5000 682cffa610 additional constraint on Command arrival messages
Command should not be considered if the mission explicitly prevents Command from sending builtin messages.

Follow-up to #5290.
2023-03-29 00:31:03 -04:00
EatThePath 4753d0f761 Merge pull request #5290 from naomimyselfandi/configurable-command-arrival-message-chance
Dehardcode Command arrival message chance
2023-03-28 22:41:49 -05:00
Mike Nelson 85bcfd56e8 force expand wings instead of toggle for scpui (#5286) 2023-03-28 07:40:03 -04:00
Mike Nelson af88697348 Parse and save asteroids by name (#5134)
* parse and save asteroids by name

* typo

* update version
2023-03-28 07:38:14 -04:00
ETP 633f138afe Remove Int3() from new versions of batching_add_ for modernization 2023-03-27 23:46:54 -05:00
David Gibson d7ebb8f062 Optimizing the trail renderer building code path moderately by avoiding repeated batch_find calls 2023-03-27 23:01:05 -05:00
BMagnu 272d6261c4 Generic Lua Multiplayer RPC (#4835)
* Add automatic lua obj serialization function dispatch

* Implement fundamental and object de/serialization

* Proper default case for package deserialization

* Add No Multi func

* Add Serialization part

* Fix max encoding size for userdata

* Implement exception handling

* Start Implementing lua RPC

* Prepare waitAsync for RPC

* Add packet order enforcing and forwarding

* Add RPC registry

* Make RPCs callable

* Add waitRPC

* Add serializers

* Fix GCC error

* Explicitly specify lua_net_exception

* Fix Warnings

* Replace Seriliaze fundamental with cross-platform data types

* Appease Clang

* Prevent serialization CTD on invalid objects

* Actually use the temporaries assigned

* Fix OSWPT shadow

* Fix table deserialize order

* Incorporate Feedback

* Fix Warnigs

* ix WArnings 2

* Add sanity checks for OSWPT wing serialization

* Multi Bump

* Forgot we have american-style dates there
2023-03-28 03:07:03 +09:00
wookieejedi 2a492e00c2 Revert "synchronize simulation timestamps across the entire frame" (#5287)
* Revert "synchronize simulation timestamps across the entire frame"

* try a proper fix instead of revert

* make sure nothing is reverted

* and back to full revert
2023-03-27 09:59:23 -04:00
Fabian Woltermann c816a65c63 Merge pull request #5289 from EatThePath/restore-envmap-hotkey-export
restored the keyboard hotkey for envmap export.
2023-03-26 21:48:44 +02:00
Mike Nelson 8d762d3fbe fredTunes, Fredify, Fred Music, or whatever. It's a music player. (#5101)
* initial semi-working version

* better implementation of play and add stop and music.tbl viewer

* let the music window lose focus

* some cleanup

* add autoplay, next, previous

* use graphics

* Better dialog layout and allow ignoring files from the player list

* Make betterer

* a touch more cleanup

* revert this change

* missing bracket from merge conflict resolution

* address feedback
2023-03-25 13:52:11 -04:00
Naomi Coffman fec9603a09 Fix brainfart 2023-03-25 13:51:17 -04:00
Naomi Coffman 78cb768546 Dehardcode Command arrival message chance
Historically, there's been a hardcoded 25% chance for Command to announce an enemy wing arrival. This is problematic for mods without Command, like BTA.
2023-03-25 13:27:16 -04:00
David Gibson de057e421e restored the keyboard hotkey for envmap export. 2023-03-25 11:57:41 -05:00
Fabian Woltermann 9308318199 Merge pull request #5253 from naomimyselfandi/more-flexible-dynamic-messages
More flexible dynamic messages
2023-03-24 10:50:39 +01:00
Fabian Woltermann 17b34508e9 Merge pull request #5280 from MjnMixael/medals_access
Scpui API for medals access
2023-03-24 10:49:45 +01:00
Fabian Woltermann bcf0ab1957 Merge pull request #5256 from MjnMixael/texture_filtering_option
Expose texture filtering as a built-in option
2023-03-24 10:48:44 +01:00
Fabian Woltermann 18a679052b Merge pull request #5282 from qazwsxal/fix/gamma_stopgap
FIX: Incorrect gamma calculations in shaders.
2023-03-23 22:05:19 +01:00
Adam Leach d516ab3c23 Stopgap patch to make envmaps work again. 2023-03-23 19:33:41 +00:00
mjn-mixael dceea0d7a5 don't need this 2023-03-23 13:17:51 -05:00
mjn-mixael 1fdf8b1756 access to array sizes 2023-03-23 12:52:11 -05:00
mjn-mixael d76c733d66 nothing to see here 2023-03-23 12:23:03 -05:00
mjn-mixael c92d383b69 scpui api for medals access 2023-03-23 11:19:46 -05:00
Fabian Woltermann 7c6e27e83d Merge pull request #5279 from Baezon/clip-planes
Add clip planes to game_settings.tbl
2023-03-23 14:12:40 +01:00
Fabian Woltermann f2eca9ca3f Merge pull request #5249 from MjnMixael/scpui_hotkeys
Scpui hotkeys
2023-03-23 14:11:13 +01:00
Asteroth 31e891df0d rename and betterchecking 2023-03-23 05:04:02 -04:00
Fabian Woltermann 98f1777040 Merge pull request #5252 from MjnMixael/capitalize_icon_names
these should be capitalized
2023-03-23 10:01:15 +01:00
Asteroth af41dbae37 add clip planes to game_settings 2023-03-22 19:48:05 -04:00
mjn-mixael 242c7184b8 Merge branch 'master' into scpui_hotkeys
# Conflicts:
#	code/scripting/api/libs/ui.cpp
2023-03-22 09:14:21 -05:00
Fabian Woltermann 2f28dc2f1e Merge pull request #5239 from MjnMixael/scpui_game_help
SCPUI methods for the Game Help UI
2023-03-22 15:11:11 +01:00
mjn-mixael 88166d58bc Merge branch 'master' into scpui_hotkeys
# Conflicts:
#	code/scripting/api/libs/ui.cpp
#	code/source_groups.cmake
2023-03-22 08:33:11 -05:00
mjn-mixael 51c55550f0 Merge branch 'master' into scpui_game_help
# Conflicts:
#	code/scripting/api/libs/ui.cpp
2023-03-22 08:25:33 -05:00
BMagnu 9caa9c4c7c Expose some Nebula settings to Lua (#5268)
* Add more nebula options

* rename vars due to windows api defines
2023-03-22 12:42:18 +01:00
Mike Nelson fbf0db09a7 Scpui Mission Log (#5242)
* SCPUI access to scrollback items (mission event log and message log)

* copy paste error

* check the objective flags instead of the action flags now

* rename actions -> segments
2023-03-21 20:03:35 -04:00
Asteroth 6afb160ebd add some parameters for corkscrew start angle (#5275) 2023-03-21 20:03:20 -04:00
Naomi Coffman 6752a7f196 Fix bad merge 2023-03-20 11:30:05 -04:00
Naomi Coffman 2cb9b94f61 Merge branch 'master' into more-flexible-dynamic-messages 2023-03-20 11:07:36 -04:00
Goober5000 6f7c949e16 Merge pull request #5267 from Goober5000/event_timestamp_check_fix
fix an edge case in is-event-true-delay and related sexps
2023-03-20 11:04:32 -04:00
Goober5000 5b411f4041 Merge pull request #5266 from Goober5000/timestamp_snapshot
synchronize simulation timestamps across the entire frame
2023-03-20 11:04:14 -04:00
Naomi Coffman 91acdfbc23 Ensure variable is initialized 2023-03-20 10:58:46 -04:00
Mike Nelson 29ea809790 toggle auto-assigning personas (#5125) 2023-03-19 21:50:26 -04:00
Goober5000 7540c79993 add comment 2023-03-19 00:01:20 -04:00
Goober5000 eed50619ca fix an edge case in is-event-true-delay and related sexps
Originally the check for event delay was this:
```
if ( (fix) Mission_events[i].timestamp + delay >= Missiontime )
    return SEXP_FALSE;
```
This returns false even when the mission time is equal to the timestamp.  Therefore the timestamp check needs to use >, not >=.

Thanks to Durandal and ShivanSpS for helping to track this down.
2023-03-17 15:00:06 -04:00
Goober5000 685f641696 synchronize simulation timestamps across the entire frame
Prior to the timer upgrade, all simulation timestamps shared identical timer and timestamp values for the duration of the frame, since they were only updated within the `game_set_frametime` function.  Since the timer upgrade depends on the system clock, timestamps evaluated near the end of the frame will be very slightly later than timestamps evaluated near the beginning of the frame.  It is desirable to keep them all in sync.

This PR tweaks the timestamp system to take a snapshot at the beginning of the frame, then use that snapshot for the entire duration of the frame.  This only affects simulation timestamps; real-time timestamps still use the live timer.
2023-03-17 14:14:55 -04:00
Asteroth 32cfb59a9e fix a bug in mission log with subsys names (#5261) 2023-03-16 22:43:15 -04:00
Goober5000 75a14625cf Merge pull request #3392 from the-maddin/qt-campaign-editor
QtFRED campaign editor
2023-03-15 15:15:48 -04:00
Goober5000 56869f10a5 Merge pull request #5259 from MjnMixael/qtfred_warning_fix
Use qtfred style warning instead of fred style
2023-03-15 15:15:22 -04:00
Goober5000 482d4a19a8 Merge branch 'master' into qtfred_warning_fix 2023-03-15 14:18:11 -04:00
Goober5000 2baf97b07a Merge pull request #5257 from DMJC/master
Fixes for Missionsave.cpp and BriefingEditorDialog.ui
2023-03-15 14:13:33 -04:00
mjn-mixael 27d9e412cb use qtfred style warning instead of fred 2023-03-15 08:02:32 -05:00
James Carthew 6e51c7cc05 Fixed missionsave.cpp - removed deprecated MB_OK MessageBox command. 2023-03-15 22:16:05 +10:30
James Carthew 638745cb16 Fixed compilation error in BriefingEditorDialog.ui 2023-03-15 22:15:01 +10:30
mjn-mixael 900abcf680 expose texture filtering as a built-in option 2023-03-14 11:00:55 -05:00
Mike Nelson b74937d74f always test goober-suggested code for errors (#5254) 2023-03-13 16:38:55 -04:00
Naomi Coffman 2c42f425dc Remove some hardcoded send chances
I missed these earlier. Oh well. They're gone now.
2023-03-11 20:51:32 -05:00
Naomi Coffman fd82ff70f1 Merge all friendly arrival messages into one type 2023-03-11 19:14:14 -05:00
Naomi Coffman 1b5b902bdd Remove unused parameters
These were always 0, and now they're gone.
2023-03-11 18:11:56 -05:00
Naomi Coffman 730eddc73a Localize message type parsing 2023-03-11 17:57:03 -05:00
Naomi Coffman 39b24a5789 Add subject filters to most messages 2023-03-11 17:39:49 -05:00
Naomi Coffman 43bd4d95fa Support sender filters 2023-03-11 17:39:49 -05:00
Naomi Coffman 7a5c145436 Parse message filters
They're not used yet, but they do get parsed.
2023-03-11 11:39:06 -05:00
Naomi Coffman 95f5839b5f Disenlongate method names 2023-03-11 11:39:06 -05:00
Naomi Coffman 8d1171ae88 Add message types for every standard player order
This commit also changes a couple confusing message type names.
2023-03-11 11:39:06 -05:00
Naomi Coffman 11987590af Overhaul builtin message matching logic
The logic used to select builtin messages was complex and hard to follow. This commit replaces it with logic that, while not identical, is both similar and more flexible. Additionally, the old logic had a major limitation when it came to downgrading messages: If a message type was defined for *any* persona, then it couldn't be downgraded for *any* persona. The new logic removes this limitation, and makes downgrade paths easier to define as well.
2023-03-11 09:34:01 -05:00
Naomi Coffman 629857adfb Always use the tabled occurrence chance
Some message types had hard-coded occurrence chances. These have been removed, and the default occurrence chance for the corresponding type modified to compensate.
2023-03-11 09:33:55 -05:00
Naomi Coffman 29c644c10c Store message priority and timing with the type 2023-03-11 08:27:46 -05:00
mjn-mixael 2bb705eca0 these should be capitalized 2023-03-10 10:39:46 -06:00
Mike Nelson b1033732f1 fixup error checking in regards to sexps using dynamic parameters (#5245)
* fixup error checking in regards to sexps using dynamic parameters

* anal retentive

* add more nonsense to make other nonsense work

* check these better

* dammit github

This reverts commit 542707c1c2.

* do this again but not in GitHub

* more nonsense to handle nonsense

* Revert "more nonsense to handle nonsense"

This reverts commit 6bc8b6e775.

* this is the song that never ends
2023-03-10 03:05:53 -05:00
Goober5000 39d5fc36f7 Merge pull request #5250 from Goober5000/tweak_techroom_modelnum
fix Techroom_modelnum references
2023-03-10 00:06:53 -05:00
Goober5000 ede86efa99 move self-destruct mission logging to ship_hit_kill
This moves `LOG_SELF_DESTRUCTED` to the same place that `LOG_SHIP_DESTROYED` is recorded.  This allows self-destruction to be correctly recorded when a ship is self-destructed via script, as well as when it is auto-repaired with a negative hull multiplier, or when ships are killed off in in-game joining.
2023-03-09 23:47:19 -05:00
Goober5000 8b63f9528d fix Techroom_modelnum references
These should be >=, not >
2023-03-09 22:19:35 -05:00
mjn-mixael 08471e8749 cleanup includes 2023-03-09 16:41:18 -06:00
mjn-mixael 465190b154 fix some issues based on testing 2023-03-09 16:38:31 -06:00
mjn-mixael 3c498e65ec get hotkeys by line 2023-03-09 15:56:30 -06:00
mjn-mixael aa91e93aa6 copy/paste 2023-03-09 14:36:27 -06:00
mjn-mixael 3e24e21e4d add a dumb 2023-03-09 10:25:36 -06:00
mjn-mixael 6d142428c3 remove a dumb 2023-03-09 10:14:04 -06:00
mjn-mixael 92f140c080 add functions 2023-03-09 10:03:37 -06:00
mjn-mixael 03555ebce4 some cleanup and prep 2023-03-09 09:56:39 -06:00
Goober5000 0d3922d483 Merge pull request #5247 from Goober5000/fix_submodel_iteration
fix submodel sanity check
2023-03-08 19:51:37 -05:00
Goober5000 0f88965aed fix submodel sanity check
If a submodel doesn't have a parent, set `parent_sm` to nullptr instead of a random value.
2023-03-08 19:09:29 -05:00
Goober5000 a65813b292 Merge pull request #5234 from Goober5000/new_hud_gauges
add missing HUD gauges
2023-03-08 15:30:50 -05:00
Goober5000 8236a87d25 Merge pull request #5243 from Goober5000/add_ship_flags
add some ship flags to the alter-ship-flag lists
2023-03-08 15:29:55 -05:00
mjn-mixael e105b57a26 read access to mission hotkeys for scpui 2023-03-08 14:23:33 -06:00
Asteroth 482034a383 Adjust movement sanity checks to account for more situations (#5240)
* adjust movement sanity checks

* traverse through children

* use `model_iterate_submodel_tree`
2023-03-08 15:18:57 -05:00
Goober5000 5e255dd8d1 add some ship flags to the alter-ship-flag lists
A few ship flags were missing from these lists.
2023-03-07 22:40:21 -05:00
mjn-mixael 55a89dc13d clarify documentation 2023-03-07 13:27:00 -06:00
Fabian Woltermann 7205808e76 Merge pull request #5149 from MjnMixael/refactor_scrollback_msg
Refactor Msg_scrollback_lines
2023-03-07 18:11:06 +01:00
Goober5000 0b2c356fe8 Merge pull request #5241 from MjnMixael/fix_subsy_node_check
Check the op const, not the op dummy
2023-03-07 10:37:08 -05:00
JohnAFernandez 199fca289c Merge pull request #5223 from Baezon/shudder-multipliers
Add shudder multipliers
2023-03-07 10:29:12 -05:00
mjn-mixael c1260fc533 Check the op const, not the op dummy 2023-03-07 08:10:50 -06:00
niffiwan f9c9474b0c Merge pull request #5235 from niffiwan/fix/chucked-asteroids-speed
use large asteroids speed when chucking asteroids
2023-03-07 20:41:04 +10:00
niffiwan 625a77bdb1 Merge pull request #5238 from Baezon/remove-vestigal-attach-thrusters
Remove `Attach_thrusters` submodel flag
2023-03-07 20:40:29 +10:00
mjn-mixael 1d9fa9719c some cleanup 2023-03-06 18:26:19 -06:00
mjn-mixael bc2218a87b use a table 2023-03-06 18:22:33 -06:00
mjn-mixael b2e56dc408 Initial setup of lua access to help sections 2023-03-06 17:33:09 -06:00
mjn-mixael 8cd8e9b0ff address feedback 2023-03-06 09:45:55 -06:00
Fabian Woltermann 2392a6cc7d Merge pull request #5231 from BMagnu/volumetric_nebulae
Localized Volumetric Nebulae
2023-03-06 16:38:14 +01:00
Fabian Woltermann c8fd2af450 Merge pull request #5090 from MjnMixael/scpui_closeup_icons
SCPUI methods required for handling closeup briefing icon stuff
2023-03-06 16:36:44 +01:00
Mike Nelson 46d1386690 Enhance Dynamic SEXPs with parent parameters (#5033)
* Add ability for a Lua sexp parameter to require a 'parent' parameter

* Add dockpoint as a return type

* variable conflicts

* var name

* qtfred

* address feedback
2023-03-06 22:27:06 +09:00
BMagnu 7b288deb62 Add missing return statements 2023-03-06 14:26:29 +01:00
BMagnu 5be591a345 Separate parsing from initialization and remove RAII 2023-03-06 14:16:03 +01:00
niffiwan 5cc0404efc use input asteroids speed
In case anyone wants to change the type of asteroids chucked at ships in
future
2023-03-06 21:48:03 +10:00
Asteroth ece792d35b remove vestigal flag 2023-03-06 02:17:52 -05:00
BMagnu 7893f0e3c5 Remove superfluous comment 2023-03-06 00:15:59 +09:00
BMagnuandFabian Woltermann c2a61c7d86 Update volumetric fog uniform buffer
Co-authored-by: Fabian Woltermann <[email protected]>
2023-03-06 00:14:58 +09:00
Fabian Woltermann a918212fe6 Merge pull request #5237 from BMagnu/opengl_debug_access
Add new OpenGL Debug Mode to cmake
2023-03-05 15:42:15 +01:00
Birk Magnussen e561b9e915 Add new OpenGL Debug Mode to cmake 2023-03-05 14:56:53 +01:00
Fabian Woltermann 9d41b1bb1e Merge pull request #5236 from qazwsxal/gr_debug_groups
Enable debug scope on release builds
2023-03-05 14:21:17 +01:00
Birk Magnussen b3502ba413 Add GR debug scopes 2023-03-05 13:13:51 +01:00
Birk Magnussen 3917890981 Don't render volumetrics when fog is disabled 2023-03-05 13:03:01 +01:00
Adam Leach a150dc8255 Enable debug scope on release builds 2023-03-05 11:33:45 +00:00
niffiwan aa4c3840f4 use large asteroids speed when chucking asteroids
Chucked asteroids are always large. Therefore use their speed, not the
speed of the 1st parsed/small asteroid. Should not affect retail because
it uses the same speed for all three asteroids
2023-03-05 21:14:02 +10:00
niffiwan 65f96cbf42 Merge pull request #5233 from Baezon/fix-thruster-flicker
Small fix for thruster flicker
2023-03-05 21:06:30 +10:00
Mike Nelson e664849346 Use subsystem names instead of model names (#5217)
* use subsystem names instead of model names

* address feedback
2023-03-05 19:02:35 +09:00
Mike Nelson c7a5f87b1b Document options files (#5177)
* Some documentation

* top level descriptions
2023-03-05 19:01:45 +09:00
Goober5000 b265124459 add missing HUD gauges
Looks like the last time this list was updated was in commit 2cded90031, and other gauges have been added since then.  So let's update the list.
2023-03-05 01:36:09 -05:00
Asteroth 89f10a5495 small fix for thruster flicker 2023-03-05 00:55:14 -05:00
Birk Magnussen 2f4bea8b21 Fix claaaaang 2023-03-05 00:41:44 +01:00
Birk Magnussen 473f907a40 Fix more warnings 2023-03-05 00:28:34 +01:00
Birk Magnussen 8af5d4cf93 Tidy up more after lib 2023-03-05 00:06:06 +01:00
Birk Magnussen 58fd88a113 Tidy up after lib's warnings 2023-03-05 00:00:05 +01:00
Birk Magnussen b50456c244 Fix GCC Warns 2 2023-03-04 23:57:00 +01:00
Birk Magnussen 97fde4d149 Fix GCC Warns 2023-03-04 23:48:06 +01:00
Birk Magnussen 5b06f84771 Correct depth for FoV abberation 2023-03-04 23:24:34 +01:00
Birk Magnussen e194e84c27 Add FRED round trip support 2023-03-04 22:30:29 +01:00
Goober5000 e103eaeb45 add some XSTR entries (#5229)
Add XSTR entries for "or", "None", and "Nothing".

Note that there is already an XSTR entry for "none", but it does not have the right capitalization.

Note that "None" is localized in `textify_scancode` but not `textify_scancode_universal`.

This makes "Nothing" cargo use appropriate localization.

Fixes #5227.
2023-03-04 08:57:29 -06:00
Goober5000 8153e32351 Merge pull request #5224 from Baezon/ai-movement-flags
Update some movement flags to work for AI too
2023-03-03 23:29:20 -05:00
Goober5000 fd66eb7550 Merge pull request #5230 from Baezon/fix-damage-scaling-bug
Fix damage scaling oversight
2023-03-03 23:29:01 -05:00
Asteroth 02805be745 fix damage scaling oversight 2023-03-03 21:32:07 -05:00
Goober5000 f8f61e8b62 Merge pull request #5104 from Goober5000/persona_species
Persona species enhancements
2023-03-03 18:25:53 -05:00
BMagnu cfba7ec067 optimize Shader performance 2023-03-03 09:10:14 +01:00
Birk Magnussen 5e285e42bc Set proper texture address mide 2023-03-02 21:17:56 +01:00
Birk Magnussen 975b31dc91 Fix nebula alpha 2023-03-02 21:04:41 +01:00
MjnMixael 7a24e0e4c6 Refactor gameplay help (#5119)
* refactor gameplay help

* OCD

* some read better than others

* typo
2023-03-02 22:10:08 +09:00
MjnMixael 259828316d Use weapon tech model if no anim (#5075)
* initial working version

* cleanup and generalize variable names
2023-03-02 22:09:13 +09:00
BMagnu 3a3d2c4438 Tidy up shader code 2023-03-02 13:54:11 +01:00
BMagnu 4af5bf405f Make volumetrics obey nebula quality settings 2023-03-02 13:38:53 +01:00
BMagnu 7827cb4835 Add Noise intnsity lab integration 2023-03-02 13:01:10 +01:00
BMagnu db8292be03 Add noise color intensity 2023-03-02 12:54:00 +01:00
BMagnu 1b1a8983ee Properly check for uploaded textures 2023-03-02 12:39:14 +01:00
BMagnu 5e9dd9aef5 Calculate alpha for things rendered after the nebula 2023-03-02 12:35:35 +01:00
BMagnu c342a22507 handle 3d array access using define 2023-03-02 11:42:07 +01:00
Asteroth 15b1ed8822 fix name (#5225) 2023-03-02 10:23:49 +00:00
Asteroth a0e94eca92 update some movement flags to work for AI too 2023-03-01 21:11:23 -05:00
Asteroth 6720115b95 fix retail star look by applying gamma correction (#5222) 2023-03-01 20:19:00 -05:00
Asteroth c3d6d72941 add for engine wash too 2023-02-28 20:13:08 -05:00
Asteroth 0428fa221f add shudder multipliers 2023-02-28 20:08:26 -05:00
Birk Magnussen 7f83dd8ddb Fix volume map generation 2023-02-28 21:51:34 +01:00
Birk Magnussen dd1641fd15 Fix coordinates 2023-02-28 21:11:07 +01:00
Birk Magnussen 53b1dc690a Enter values from empirical testing 2023-02-28 20:27:11 +01:00
Birk Magnussen 5392a0d9fe Fix lab volumetrics 2023-02-28 20:24:46 +01:00
BMagnu 2f0e2f591f Adjust alpha of neb-affected effects 2023-02-28 14:17:49 +01:00
BMagnu cc1e26dd25 Fix skip_to_start_of_string_one_of 2023-02-27 16:56:08 +01:00
BMagnu 14b37add71 ImGui integration for neb settings 2023-02-27 16:49:39 +01:00
BMagnu e1f071036f Lab parse volumetric nebula 2023-02-27 15:55:03 +01:00
BMagnu 6b0f49cf3b Begin Lab integration 2023-02-27 09:37:11 +01:00
wookieejedi 9d57ca14de Add line of sight as optional AI override (#5220)
Many values in `ai.tbl` can be inserted as overrides for their equivalent `Ai_profiles.tbl` values. (They are all optional and if not set for an AI class, the values in AI Profiles will be used.)

This is particularly useful for making very specific AI classes that still follow the main AI profiles table with easy to change values.

This PR adds `$firing requires exact los:` as an optional override to set in `ai.tbl`. This particular override is very useful, since it can be set to off by default in the `ai_profiles.tbl` for performance, but then set to on for some select AI classes within `ai.tbl`, and those AI classes can be easily changed on the fly in a mission.
2023-02-26 21:43:40 -05:00
Birk Magnussen 2298c3fb31 Properly unload volume textures 2023-02-25 00:13:59 +01:00
Birk Magnussen 8f697dd03a Fix Noise, Fix Scale, Fix Pos 2023-02-24 23:50:50 +01:00
Goober5000 6eeeb788dc Merge pull request #5218 from Goober5000/5210_5157_followup
5210 and 5157 followup
2023-02-24 17:22:42 -05:00
BMagnu a60512cfa4 Add parsing for nebula settings 2023-02-24 14:51:18 +01:00
BMagnu 2fd24ecf29 Begin integration into mission 2023-02-24 14:16:38 +01:00
BMagnu 9cdbf4b5ed Load configurable noise 2023-02-24 11:59:21 +01:00
m!m d2e57becd3 Merge pull request #5219 from asarium/codeowners_update
Remove myself from code owners
2023-02-24 11:40:00 +01:00
asarium 305fa3c6eb Remove myself from code owners
I have not been able to keep up with code reviews for quite some time so
I should not be a default one.

Also fixed a copy issue which was missing an option to properly handle
already existing files.
2023-02-24 11:17:53 +01:00
Goober5000 7a2caea6ea here too 2023-02-23 23:02:30 -05:00
Goober5000 0fc8fcfad3 localization tweaks
1) follow-up to 5210: Avoid a memory leak caused by duplicating text, assigning it to a SCP_string, and then leaving the buffer in limbo
2) also keep the text as const char * since it's probably best to be consistent and keep the three types the same
3) be more scrupulous about checking for the existence of map entries, since the [] operator is create-if-not-found
2023-02-23 22:32:28 -05:00
Goober5000 dbe731782a prevent memory leaks in the mission log by using unique_ptr (since message_log_remove_segs no longer exists to free the strings) 2023-02-23 21:06:49 -05:00
Goober5000 6bc6b0f1e2 use SCP_string optimizations here 2023-02-23 20:35:48 -05:00
Birk Magnussen 6eee49a868 Optimize smoothing mode of volumetrics shader 2023-02-23 20:55:26 +01:00
Birk Magnussen b6f0e8e4e8 Build noise lib in release 2023-02-23 20:55:08 +01:00
BMagnu 1a5c39154d Very basic volumetric noise setup 2023-02-23 15:33:06 +01:00
Fabian Woltermann b373ad2df4 Merge pull request #5036 from MjnMixael/lua_access_to_enums
allow scripts to read LuaEnums and add LuaEnums
2023-02-23 14:46:48 +01:00
Fabian Woltermann 39c5336847 Merge pull request #5210 from MjnMixael/mapify_builtin_strings
Mapify builtin strings
2023-02-23 14:38:32 +01:00
Fabian Woltermann 9cfc6f4b07 Merge pull request #5157 from MjnMixael/refactor_scrollback_log
Refactor mission log scrollback
2023-02-23 14:35:15 +01:00
Fabian Woltermann 9190d90536 Merge pull request #5158 from MjnMixael/lua_goals_virtvars
Add virtvars for goal satisfaction and score
2023-02-23 14:33:54 +01:00
Fabian Woltermann 50fee8eb8a Merge pull request #5211 from Baezon/increase-snd-update
Increase sound update rate
2023-02-23 14:33:03 +01:00
Fabian Woltermann 7f44bd1969 Merge pull request #5213 from MjnMixael/check_dup_enum_items
Check duplicate enum items
2023-02-23 14:32:48 +01:00
BMagnu 03e3bdb40a cleanup noise 2023-02-23 12:33:33 +01:00
BMagnu c127b2b982 Make Edge smoothing toggleable 2023-02-23 11:06:50 +01:00
BMagnu 15d078aad2 Add edge smoothing and fix size ordering 2023-02-23 10:47:27 +01:00
Birk Magnussen 92fc993597 Remove UB due to Non uniform control flow 2023-02-23 00:48:53 +01:00
Birk Magnussen 88dd1f843b Disable noise 2023-02-23 00:14:26 +01:00
Birk Magnussen 084085a53f Make noise loadable 2023-02-22 23:19:45 +01:00
BMagnu eb81b50c55 Actually load noise volume texture 2023-02-22 16:50:19 +01:00
BMagnu 6e91356f47 Properly pass volumetric pso/size 2023-02-22 16:48:39 +01:00
BMagnu 9dbf5df152 Add Noise sampling to volumetric shader 2023-02-22 16:11:33 +01:00
BMagnu c2c02470d1 Add noise generation 2023-02-22 14:52:55 +01:00
BMagnu e78fbfb9be Add worley noise 2023-02-22 14:09:21 +01:00
BMagnu 756f0a9732 Incorporate new COLLIDE_ALL for nebula rendering 2023-02-22 12:26:54 +01:00
BMagnu 68ad0c826b Merge branch 'master' into volumetric_nebulae 2023-02-22 09:31:41 +01:00
Goober5000 f02ff33311 Merge pull request #5204 from Goober5000/enhance_sexp_comments
Enhance sexp comments
2023-02-21 21:40:25 -05:00
Goober5000 98268b139c Merge pull request #5214 from Goober5000/mc_info_init_update
add initializers to mc_info
2023-02-21 21:40:12 -05:00
Goober5000 5b175673ed add initializers to mc_info
This initializes `mc_info` to the correct values when it is constructed, removing the need for `mc_info_init`.

This PR also fixes a group of incorrectly inverted assignments in beam.cpp.
2023-02-21 19:09:10 -05:00
Asteroth 1dc4a210b7 Add collision flag for colliding with all polies (#5212)
* add collision flag for colliding with all polies

* copy paste error
2023-02-22 04:45:18 +09:00
mjn-mixael eaed502d62 break the loops 2023-02-21 12:25:49 -06:00
mjn-mixael 267921b443 skip the outer loop, not the inner loop 2023-02-21 11:51:07 -06:00
mjn-mixael 439f59e1f2 check for duplicates here, too 2023-02-21 09:12:54 -06:00
mjn-mixael ce8724a653 disallow enum duplicates 2023-02-21 09:10:48 -06:00
mjn-mixael ed78597635 check for duplicate enum items 2023-02-21 08:39:47 -06:00
mjn-mixael af41185acb Merge branch 'master' into lua_access_to_enums 2023-02-21 08:00:02 -06:00
MjnMixael 61247bf3e2 sexps to check turret weapons (#5072) 2023-02-21 18:11:21 +09:00
MjnMixael c83b4b5838 is-ship-emp-active sexp (#5071)
* is-ship-emp-active sexp

* remove these

* remove counting

* unused variable declarations
2023-02-21 18:11:00 +09:00
MjnMixael f6ffe4e399 add pre-parse enums support (#5011)
* add pre-parse enums support

* Skip to the next defined enum if one already exists by this name.

* do this as string instead of char array
2023-02-21 18:10:52 +09:00
Asteroth 18b48214a2 Fix some issues with damage application (#5084)
* fix some issues with damage application

* typo

* turn off flag for new versions

* update versions to apply to post 23.0 nightlies
2023-02-21 18:10:44 +09:00
Asteroth ddc5c7ac8b increase sound update rate 2023-02-21 01:17:09 -05:00
Goober5000 9d0629f657 Merge pull request #5196 from MjnMixael/flag_sexp_descriptions
Flag sexp descriptions
2023-02-20 23:26:29 -05:00
mjn-mixael 7d0743d5ed SCP_string 2023-02-20 18:01:08 -06:00
mjn-mixael 9e24469928 emplace 2023-02-20 17:28:21 -06:00
mjn-mixael 4483d5051b remote the last of the old array and actually copy the data into the map 2023-02-20 17:06:01 -06:00
the-maddin 4e9309a154 Comment branch types 2023-02-20 21:15:08 +01:00
the-maddin 439c22b528 Merge branch 'master' into qt-campaign-editor 2023-02-20 21:07:01 +01:00
Fabian Woltermann e3be23ac7f disable the fog pass when rendering cockpits (#5208) 2023-02-20 23:17:47 +09:00
MjnMixael 39c71d3a7b Flag to apply hud shudder to chase view (#5145)
* flag to apply hud shudder to chase view

* not not
2023-02-20 23:13:24 +09:00
MjnMixael b2fe7a94ae Remove nebula bitmap limit (#5128)
* Remove nebula bitmap limit

* FRED bounds check and qtFRED

* remove length checks
2023-02-20 23:13:10 +09:00
Asteroth b7353b2027 Add turret-fired-since SEXP (#5061)
* add turret-fired-since

* update to new timestamp system

* unused variables
2023-02-20 22:10:49 +09:00
BMagnu bef3f33f6a Always to sample buffer assign 2023-02-20 11:04:55 +01:00
BMagnu d0f051847c reduce 3d texture build from O(n^3) to O(n^2) 2023-02-20 11:00:41 +01:00
Fabian Woltermann 153d3effaa Merge pull request #5160 from The-E/feature/vulkan
make the vulkan support buildable again
2023-02-20 10:54:11 +01:00
Fabian Woltermann 96f0c66722 shut down the imgui SDL backend regardless of graphics API selected 2023-02-20 10:27:31 +01:00
Goober5000 bdea153270 Merge pull request #5163 from MjnMixael/lua_update_discord
Lua update discord
2023-02-19 18:40:18 -05:00
mjn-mixael 13e28a3102 const the header, dummy 2023-02-19 14:58:17 -06:00
Goober5000 b089dabadc Merge pull request #5207 from MageKing17/bugfix/negative-check-inversion
Fix negative child check inversion.
2023-02-19 15:54:48 -05:00
Goober5000 a20dd3bea9 Merge pull request #5174 from MjnMixael/get_audiostream_duration
get audiostream duration in float seconds
2023-02-19 15:46:30 -05:00
mjn-mixael 5dc8b04dab boom chikka const const 2023-02-19 14:32:48 -06:00
mjn-mixael 00995f5516 typos 2023-02-19 14:29:00 -06:00
MageKing17 8846e043fb Fix negative child check inversion.
In PR #5202, a bunch of `Assert(child >= 0);` statements were replaced with `if (child < 0) return nullptr;`, except the first one kept the assertion's condition (inverting the logic). This fixes this accidental inversion.
2023-02-19 12:26:37 -08:00
Goober5000 89c6d330f8 Merge pull request #5159 from MjnMixael/credits_no_splitting
Prevent line splitting if building credits for SCPUI
2023-02-19 15:10:14 -05:00
Goober5000 42db9f2e7b Merge pull request #5169 from MjnMixael/countermeasure_cargo_size
Feature for countermeasures to respect cargo size
2023-02-19 15:06:17 -05:00
Goober5000 35f4dab373 Update code/sound/audiostr.h
Update documentation
2023-02-19 14:44:41 -05:00
mjn-mixael 2ed504eb82 clarified descriptions 2023-02-19 10:48:48 -06:00
MjnMixael 5074a939ed Merge branch 'master' into lua_update_discord 2023-02-19 10:39:11 -06:00
Fabian Woltermann ec4222b412 Merge pull request #5190 from MjnMixael/lua_os_focus
Lua method to check if the game has focus
2023-02-19 17:22:27 +01:00
Fabian Woltermann 901dfe310b Merge pull request #5186 from MjnMixael/on_warp_complete_hook
On warp complete hook
2023-02-19 17:21:58 +01:00
Fabian Woltermann 5f6f4c11b2 Merge pull request #5191 from MjnMixael/unlimited_power
Unlimited Power
2023-02-19 17:21:07 +01:00
Fabian Woltermann 2de1441bf1 Merge pull request #5192 from MjnMixael/cutscene_custom_data
Cutscene custom data
2023-02-19 17:20:48 +01:00
Fabian Woltermann e1de3b6ac4 Merge pull request #5202 from Goober5000/deblongify_fred
deblongify fred
2023-02-19 17:20:02 +01:00
Fabian Woltermann 6960fe58c8 Merge pull request #5203 from Baezon/no-bsp-tree-optimization
Remove previous bsp tree skipping optimization
2023-02-19 17:19:46 +01:00
Fabian Woltermann 4b6a791b02 pin vulkan version to 1.3.204.0 2023-02-19 15:43:17 +01:00
Fabian Woltermann 801b693e63 make sure the WITH_VULKAN compile time flag is still set 2023-02-19 15:43:17 +01:00
Fabian Woltermann 0ab3a85289 cleanup 2023-02-19 15:43:17 +01:00
Fabian Woltermann faf8fb2ecc don't build vulkan on macos for now either 2023-02-19 15:43:17 +01:00
Fabian Woltermann 0fbc422ca0 remove vulkan references from the lab 2023-02-19 15:43:17 +01:00
Fabian Woltermann c835481e6d x86 builds don't get vulkan 2023-02-19 15:43:17 +01:00
Fabian Woltermann 4deaecece9 more compile fixes 2023-02-19 15:43:17 +01:00
Fabian Woltermann 1387c46b67 fix the rest of the pipelines 2023-02-19 15:43:17 +01:00
Fabian Woltermann acd4486fc1 remove unfinished imgui init 2023-02-19 15:43:17 +01:00
Fabian Woltermann b7343690de move vulkan sdk install to similar place in macos pipeline 2023-02-19 15:43:17 +01:00
Fabian Woltermann 7d39df9871 fix missing fall-through in case statement 2023-02-19 15:43:17 +01:00
Fabian Woltermann 4ab8d35b8b add curl to the gha container 2023-02-19 15:43:16 +01:00
Fabian Woltermann 3e7e3bfb4d more cleanup 2023-02-19 15:43:16 +01:00
Fabian Woltermann 42a16b4c7d fix minor issues breaking compilation in CI 2023-02-19 15:43:16 +01:00
Fabian Woltermann 7ea7953cd7 wip 2023-02-19 15:43:16 +01:00
Fabian Woltermann 0bb898ae2e download the vulkan sdk in the pipeline 2023-02-19 15:43:16 +01:00
Fabian Woltermann c6831d8b30 instead of shipping our own copy of vulkan-hpp, use the one in the official SDK 2023-02-19 15:43:16 +01:00
Asteroth 68aec1edef Merge remote-tracking branch 'upstream/master' into no-bsp-tree-optimization 2023-02-19 04:07:07 -05:00
Fabian Woltermann 072fee459b Merge pull request #5199 from Baezon/refactor-submodel-rand-points
Add `GetVertex()` and `NumVertices()` script functions and clean up random submodel point retrieval a bit
2023-02-19 08:58:03 +01:00
Goober5000 d85d854646 make multiline work in text editor 2023-02-18 16:17:32 -05:00
Goober5000 23c5355bc7 make multiline comments display properly without length restriction 2023-02-18 15:45:28 -05:00
Asteroth eba379330e update naming and remove unused function 2023-02-18 15:31:06 -05:00
Asteroth f75f08f7ba remove previous optimization 2023-02-18 15:15:41 -05:00
Goober5000 0357df1e7d add comment 2023-02-18 15:01:44 -05:00
Asteroth 7a5c6df202 update docs and prints 2023-02-18 14:58:00 -05:00
Goober5000 628ac80f2c prevent fred from crashing on a node that shouldn't be there 2023-02-18 14:55:18 -05:00
Goober5000 ea58a760ff prevent the BLONG by capturing keypresses 2023-02-18 14:09:44 -05:00
Fabian Woltermann 5e79d94bad Merge pull request #5201 from The-E/fix/deprecated_github_actions
Fix github CI deprecation warnings
2023-02-18 19:48:23 +01:00
Goober5000 2f4059b7fd Merge pull request #5198 from Goober5000/fix_mission_version
mission version numbers should be major.minor
2023-02-18 13:46:18 -05:00
Fabian Woltermann b030148c21 Merge pull request #5019 from Goober5000/query_referenced_update
more #define updates
2023-02-18 18:45:22 +01:00
MjnMixael 754c351498 per bank autoaim (#5074)
adds per-bank autoaim feature
2023-02-18 18:43:03 +01:00
Fabian Woltermann f45a6fb58c removes soon to be deprecated github CI commands. For details see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ 2023-02-18 18:30:08 +01:00
Asteroth 6e25fbb50f unused variable 2023-02-17 23:55:22 -05:00
Asteroth db5a37c178 add num vertices script func 2023-02-17 23:23:24 -05:00
Asteroth b68e424213 refactor getting random vertices and script func 2023-02-17 23:03:57 -05:00
Goober5000 af428ca6b9 other feedback 2023-02-17 21:59:57 -05:00
Goober5000 731b5d53c5 change case 2023-02-17 21:50:42 -05:00
Birk Magnussen 3042846e62 Fix model-based volume generation 2023-02-18 00:17:44 +01:00
Goober5000 8d27682126 mission version numbers should be major.minor
Since older builds of FRED parse the mission version as a float, the version can contain a maximum of one decimal point.  These changes allow FRED and FSO to disregard the build number when loading, saving, or comparing versions.

There is also a small fix to qtfred's saving of the author field.
2023-02-17 12:32:54 -05:00
mjn-mixael 9f20cb1921 descriptions 2023-02-17 10:03:54 -06:00
BMagnu 8b75bbbb0d Add model read for 3d texture sample 2023-02-17 15:09:21 +01:00
BMagnu 9220b48592 Fix Typo and test oversampling 2023-02-17 13:26:18 +01:00
BMagnu f7f2b5f025 Encapsulate 3d texture render in volumetrics class 2023-02-17 11:59:13 +01:00
BMagnu 2531a31b1e tidyup parameters 2023-02-17 10:42:23 +01:00
Goober5000 8d406c2167 Merge pull request #5069 from MjnMixael/popup_shortcut_var
Pass shortcut key character to Lua as a hook variable
2023-02-16 22:32:44 -05:00
Goober5000 0813a7f416 Merge pull request #5195 from MjnMixael/fix_qtfred_building
missed items required to build qtfred
2023-02-16 22:31:45 -05:00
Goober5000 9a1badf444 Merge pull request #5193 from MjnMixael/object_death_documentation
Match documentation description to actual hook names.
2023-02-16 22:30:28 -05:00
MjnMixael 5df51711fe add ability to disable grid rendering for each stage (#5053)
* add ability to disable grid rendingering for each stage

* revert these
2023-02-16 22:22:32 -05:00
MjnMixael 7ec27f147f Allow for arbitrary briefing icon scaling (#5047)
* allow for arbitrary briefing icon scaling

* only apply valid scale values
2023-02-16 22:22:16 -05:00
mjn-mixael e972cdc2cf explicit size_t 2023-02-16 21:10:07 -06:00
mjn-mixael f220075bbe missed items required to build qtfred 2023-02-16 20:45:01 -06:00
mjn-mixael 730c84308e qtFRED support 2023-02-16 20:36:04 -06:00
mjn-mixael badde3ad96 Let FRED display flag descriptions 2023-02-16 17:12:47 -06:00
BMagnu 1371dc3a08 Add attribution before I forget 2023-02-16 16:11:09 +01:00
mjn-mixael 0c5342b875 Match documentation to actual hook names. 2023-02-16 09:05:30 -06:00
BMagnu 4c3024e5fc Add Beer-Powder absorption for diffuse lighting 2023-02-16 16:03:47 +01:00
mjn-mixael bbb7539fb6 cutscene custom data 2023-02-16 08:50:03 -06:00
BMagnu a9a110e8fa Add Heyney Greenstein Scattering 2023-02-16 14:58:19 +01:00
BMagnu a71dbbab6a Tidy up shader and prepare for diffuse lighting 2023-02-16 13:29:43 +01:00
BMagnu 3e8be9c8a3 Fix emissive blur 2023-02-16 12:30:56 +01:00
mjn-mixael b2270e4714 OPF_BOLT_TYPE is the senate 2023-02-15 18:24:37 -06:00
mjn-mixael 5410b3ef46 sssssssnake case 2023-02-15 16:54:17 -06:00
mjn-mixael 5344b45c47 scripting documentation 2023-02-15 16:48:11 -06:00
mjn-mixael 2bdf6c21f2 i pity the bool 2023-02-15 16:44:41 -06:00
mjn-mixael 5b2bd80609 cleanup os_foreground() 2023-02-15 16:42:03 -06:00
mjn-mixael 8063fc3863 Unlimited Power 2023-02-15 16:34:15 -06:00
Birk Magnussen 9ac262579d Document Emissive Attempts 2023-02-15 20:39:16 +01:00
mjn-mixael 4924f56613 lua method to check if the game has focus 2023-02-15 10:01:59 -06:00
BMagnu dbc2cb1c27 prepare volumetric shader for multi-influence color 2023-02-15 15:51:14 +01:00
Fabian Woltermann 076ad7770b remove main shader compile-time flags (#5055) 2023-02-15 15:20:11 +01:00
BMagnu 3c942fc409 Proper step calculation based on nebula parameters 2023-02-15 15:09:37 +01:00
BMagnu 5f48e55990 Proper alpha-considering ray marching 2023-02-15 14:26:48 +01:00
MjnMixael aaee1e5a32 enhance handling of motion debris (#5022)
* enhance handling of motion debris

* dunno what i was thinking here

* address feedback

* require all four bitmaps to be defined in new parsing method

* address feedback
2023-02-15 17:13:48 +09:00
MjnMixael ce274209c1 adds hudgage and event to the valid types of a Lua Sexp parameter (#5018) 2023-02-15 17:13:38 +09:00
MjnMixael 7be49e67d1 modular autopilot table (#4978)
* modular autopilot table

* clarical comment
2023-02-15 17:13:29 +09:00
BMagnu 8731ad1448 Add option to deprecate hooks (#5184)
* Add hook deprecation to calls

* Deprecate hooks properly

* Change OnSplashScreen hook callig

* Check for deprecated hooks at script time

* include hooks directly

* Check deprecation for lua added hooks

* Write deprecation notice to docs

* rescope Target_version

* fix typo
2023-02-15 17:12:25 +09:00
Birk Magnussen a5f634885b Get volumetric ray marching working 2023-02-15 01:14:34 +01:00
Goober5000 fe4d93393b Merge pull request #5122 from Goober5000/parse_object_colgroup
make collision_group_id accessible to parse objects
2023-02-14 18:45:06 -05:00
Birk Magnussen 9de6beb4c2 First working raycast 2023-02-14 21:03:18 +01:00
BMagnu 4485efe484 Add FRED SpaceMouse support (#4984)
* Add hidapi lib

* Add Spacemouse Interface

* Integrate HID API

* Implement basic 3dconnexion hid protocol

* FRED Spacemouse integration

* QtFRED support

* Fix assertion

* More devices

* Increase polling

* Wireless resetting

* QtFRED polling frequency

* Add nonlinear scalings

* Linux Build Options for HIDAPI

* Linux Build Options for HIDAPI 2

* Fix GCC

* Resolve Type Aliasing

* Fix out-of-focus control

* rename searchSpaceMouse
2023-02-15 03:00:08 +09:00
mjn-mixael 12a0a8642e override then normal hook 2023-02-14 09:56:22 -06:00
mjn-mixael e246616fac on warp complete hook 2023-02-14 09:43:35 -06:00
BMagnu d3701166af Properly clear new composite buffer 2023-02-14 16:41:57 +01:00
BMagnu e1db2ca59a Hooks into deferred draw code 2023-02-14 15:39:05 +01:00
BMagnu 063a567fe4 Being volumetrics calculations 2023-02-14 15:22:23 +01:00
BMagnu c32c655350 Keep Emissive texture intact during deferred render step 2023-02-14 15:21:00 +01:00
BMagnu 91d274cd6d Add 3D-Texture support 2023-02-14 14:36:28 +01:00
MjnMixael 08742f36e8 enable commandline language setting (#5013) 2023-02-14 17:28:09 +09:00
MjnMixael 24571d099e modular ai classes table (#4945)
* modular ai classes table

* bool instead of int

* merge these
2023-02-14 17:27:16 +09:00
MjnMixael f29c48965e fictionviewer localization (#5012)
* fictionviewer localization

* Move this to it's own method

* C_str
2023-02-14 17:26:36 +09:00
MjnMixael fbb209ef6b Modular rank table (#4854)
* vectorize ranks

* Add modular table parsing

* int

* comments

* prevent field overwriting if tbm is used

* address feedback

* off by one
2023-02-14 17:25:52 +09:00
Goober5000 7cc9f72cac Merge pull request #5077 from MjnMixael/gameplay_profiles_alias
Allow gameplay_profiles.tbl to be an alias of ai_profiles.tbl
2023-02-13 21:45:21 -05:00
Goober5000 6f7f9c2f48 Merge pull request #5120 from MjnMixael/scpui_pause_screen
funcs and virtvars for SCPUI pause screen
2023-02-13 21:45:12 -05:00
Goober5000 d398ce25fb Merge pull request #5117 from MjnMixael/pause_weapon_sounds
Expose pausing weapon sounds
2023-02-13 21:39:39 -05:00
Goober5000 3c59687d75 Merge pull request #5185 from MjnMixael/splash_screens_range
Keep splash screen rand choice in range
2023-02-13 21:13:19 -05:00
mjn-mixael ef3af0e254 Keep this in range 2023-02-13 14:56:27 -06:00
MjnMixael 40807000ad Merge branch 'master' into countermeasure_cargo_size 2023-02-12 23:18:02 -06:00
Goober5000 de5a422fc0 Merge pull request #5146 from MjnMixael/on_asteroid_created
On asteroid created hook
2023-02-12 21:25:32 -05:00
Goober5000 4b86f32b21 Merge pull request #5183 from Goober5000/thruster_flag_rename
rename thruster flags
2023-02-12 20:52:48 -05:00
Goober5000 09b6552908 rename thruster flags
`Roll_` and `Bank_` are synonyms, and the `Roll_` thruster flags should be `Yaw_` anyway, so rename them and rename their table strings.  This still checks the old table strings for compatibility.
2023-02-12 19:42:26 -05:00
Goober5000 de3e158b73 Merge pull request #5182 from Baezon/fix-thruster-sounds
Fix thruster sounds and add flag for player thruster sounds
2023-02-12 19:36:38 -05:00
Goober5000 a0c0766146 Merge pull request #5181 from Goober5000/build_fix
build compatibility fix
2023-02-12 19:24:12 -05:00
Asteroth 05790db5e7 clean up 2023-02-12 18:47:02 -05:00
Asteroth d28833e92a fix thruster sounds and add flag 2023-02-12 15:55:23 -05:00
Goober5000 60e5ba9541 Merge pull request #5139 from MjnMixael/has_armor_sexp
has-armor-type sexp
2023-02-12 15:40:53 -05:00
Goober5000 705d4a519f Merge pull request #5175 from MjnMixael/unlimit_cheats
Remove message requirement for custom cheats
2023-02-12 15:39:38 -05:00
Goober5000 950fbf1a13 Merge pull request #5178 from MjnMixael/lua_free_models
Lua method to free all loaded models
2023-02-12 15:39:27 -05:00
Goober5000 dd0b099d9b Merge pull request #5176 from MjnMixael/disable_old_debug_cmnds
Remove some old debug key checks in mainhall
2023-02-12 15:39:19 -05:00
Goober5000 ca6f25f5af Merge pull request #5085 from Goober5000/play_dead_ets
prevent ship from managing ETS if it is playing dead
2023-02-12 13:34:21 -05:00
MjnMixael 09215672a1 override to set glowpoint bank to default off (#5091) 2023-02-12 09:54:23 -05:00
MjnMixael 1076493ceb choose random splash image (#5054)
* choose random splash image

* address feedback
2023-02-12 09:52:57 -05:00
Goober5000 28a1e2a3d4 build compatibility fix
Follow-up to #5138.  Tweak the function header to be more compatible with different build environments; some don't like the `= ""` for some reason.
2023-02-11 22:18:38 -05:00
MjnMixaelandGoober5000 280d8c8c8a increase mission author name length limit (#5162)
* increase mission author name length limit

* use string_copy

---------

Co-authored-by: Goober5000 <[email protected]>
2023-02-12 08:29:18 +09:00
MjnMixael 58e7d50b1c Add to description 2023-02-11 16:19:24 -06:00
Goober5000 1c4db98bc5 Merge pull request #5180 from Goober5000/update_version_23.1.x
bump version to 23.1.x
2023-02-11 16:53:33 -05:00
Goober5000 214c6e3d5c bump version to 23.1.x 2023-02-11 16:28:59 -05:00
Goober5000 eaa063ba65 Merge pull request #5152 from Goober5000/mission_versioning
add versioning support to missions
2023-02-11 16:19:33 -05:00
mjn-mixael 002ab4885e gate float divisions behind mod flag 2023-02-11 14:48:55 -06:00
Goober5000 58175aa386 Merge pull request #5179 from Goober5000/model_sanity_checks
add some sanity checks for submodel indexes
2023-02-11 15:41:24 -05:00
Goober5000 0e70c4918a Merge pull request #5079 from MjnMixael/visible_node_comments
Make sexp node comments more visible at a glance
2023-02-11 15:37:27 -05:00
Goober5000 0d75790a6a Merge pull request #5138 from MjnMixael/force_emp_sexp
hud-force-emp-effect sexp
2023-02-11 15:36:48 -05:00
Goober5000 85e11ecd6d Merge pull request #5096 from MjnMixael/opf_turret_type
Implement opf_turret_type
2023-02-11 15:36:35 -05:00
Goober5000 3651239a6b Merge pull request #5010 from Goober5000/more_category_updates
more category updates
2023-02-11 15:33:28 -05:00
mjn-mixael 041a390660 no team, dummy 2023-02-11 14:26:39 -06:00
Goober5000 6bc1bff0ab add some sanity checks for submodel indexes
Add some checks during model load for submodel indexes that could be out of range due to a corrupt model.
2023-02-11 00:32:24 -05:00
mjn-mixael de1215f64e unused 2023-02-10 21:40:10 -06:00
mjn-mixael d101227721 lua method to free all loaded models 2023-02-10 20:57:23 -06:00
mjn-mixael 13b7f626a9 appease etp 2023-02-10 09:30:38 -06:00
mjn-mixael 0e375e2e0d remove some old debug key checks in mainhall 2023-02-10 09:00:38 -06:00
mjn-mixael a360245857 remove message requirement for custom cheats 2023-02-09 15:08:30 -06:00
mjn-mixael d0e26adc20 appease goober 2023-02-07 16:08:32 -06:00
wookieejedi 9403f17fbb Adds safety checks to scripting orders with waypoints (#5173)
* Adds safety checks to scripting orders with waypoints

Turns out setting a waypoint order then trying to get to target of that order in the same frame triggers a crash in the scripting API for ship orders (`order.cpp` line 295). This was due to invalid lookups which lacked safety checks.

This PR adds those safety checks. Now, if this situation is encountered, it leaves `objnum` at -1 and thus returns an object for which `isValid` is false.

Fix is tested and works as expected. Also fixes #5172

* appease clang

* cleanup thanks to Goober

* clang again

* forgot to re-add the nullptr

* remove redundant checks
2023-02-07 15:57:39 -05:00
mjn-mixael 289266d959 get audiostream duration in milliseconds 2023-02-07 13:18:53 -06:00
Goober5000 9a7b3fe0d6 Merge pull request #5171 from MjnMixael/clear_credits_scpui
Clear credits before rebuilding
2023-02-04 20:50:40 -05:00
mjn-mixael c5ea47fd05 clear credits before rebuilding 2023-02-04 01:26:04 -06:00
Goober5000 11dcb01a98 Merge pull request #5167 from Baezon/fix-ai-secondary-selection
Fix inadvertent AI usage of invalid weapons
2023-02-03 19:29:32 -05:00
mjn-mixael 4f36c6a781 feature for countermeasures to respect cargo size 2023-02-03 10:15:32 -06:00
BMagnu 605e89a01a Fix WeaponUsedConditions (#5165) 2023-02-03 06:23:48 +09:00
Asteroth 2100a0d2f3 change ai_choose_secondary_weapon to return validity 2023-02-02 15:37:27 -05:00
Goober5000 37f7c569b8 Merge pull request #5156 from Baezon/no-invalid-priority2-assignment
Dont assign a possibly -1 priority2_index
2023-02-01 19:48:37 -05:00
mjn-mixael 4a8991703f missed comma 2023-02-01 12:17:58 -06:00
mjn-mixael 34232bd5d8 const char instead of SCP_string 2023-02-01 12:03:44 -06:00
mjn-mixael 7eca7febcb expose setting discord presence 2023-02-01 11:52:41 -06:00
mjn-mixael 0ad91aaf3d prevent line splitting if building credits for SCPUI 2023-01-31 16:19:40 -06:00
mjn-mixael e83609b121 properly force fit the actions 2023-01-30 14:22:57 -06:00
mjn-mixael 1d93e9bff6 variable collision 2023-01-30 14:01:24 -06:00
mjn-mixael a568f514a3 add virtvars for goal satisfaction and score 2023-01-30 13:59:31 -06:00
mjn-mixael ed8a511fe9 refactor mission log scrollback 2023-01-30 13:37:02 -06:00
MjnMixael 1a6517cf51 if no valid choices, bail (#5153) 2023-01-30 13:42:47 -05:00
Asteroth e9c3b7e4b2 little clearer 2023-01-30 13:24:44 -05:00
Asteroth 2ae50c4a70 dont assign a possibly -1 priority2_index 2023-01-30 13:22:14 -05:00
Asteroth a5546a5dc7 better safety for ai_select_secondary_weapon (#5151) 2023-01-30 01:45:13 -05:00
Goober5000 f083018628 Merge pull request #5107 from MjnMixael/better_verify_orders
some validity checks to order sending
2023-01-28 20:43:37 -05:00
Goober5000 3c723c9ea9 add versioning support to missions
This finally enables the `$Version:` field in FreeSpace missions, which has been present ever since the beginning of FS1's development but has never been used for its intended purpose.  This field now stores the version of FSO that is required to run the mission.  If the version of the engine is not sufficient to run the version of the mission, then a) the mission is hidden from the mission listing, or b) a friendly notification is displayed if the mission is loaded anyway (for example, through a campaign).  Furthermore, FRED will notify the user if the mission's version is migrated from any version other than the legacy 0.10.

It will be the responsibility of coders who modify the mission format to also update the `MISSION_VERSION` constant with the appropriate major/minor/build/revision of the format change.
2023-01-28 18:01:51 -05:00
mjn-mixael e9be428cd1 refactor Msg_scrollback_lines 2023-01-27 16:36:03 -06:00
Goober5000 07768b2d2d Merge pull request #5142 from EatThePath/remove_trail_exclusion
Removed unhelpful optimization from trail rendering
2023-01-26 20:34:13 -05:00
Goober5000 543c7f220c Merge pull request #5144 from MjnMixael/fix_weapon_origin
If we're not drawing weapon models then skip all this
2023-01-26 20:34:02 -05:00
mjn-mixael 8360bae5af on asteroid created hook 2023-01-26 11:24:33 -06:00
mjn-mixael 6162c475a0 float 2023-01-26 08:34:34 -06:00
mjn-mixael 9419f24184 warning 2023-01-26 08:30:26 -06:00
Goober5000 ed14e03f73 Merge pull request #5141 from MjnMixael/scpui_load_hires
Allow way to prevent scpui loading hires animations
2023-01-25 22:47:33 -05:00
Goober5000 6cd74c979a Merge pull request #5137 from MjnMixael/num_linkable_weapons
Check if we have at least two linkable weapons
2023-01-25 22:46:34 -05:00
Goober5000 67d5acd836 Merge pull request #5143 from Goober5000/fix_tips
patch player tips
2023-01-25 20:25:01 -05:00
Goober5000 7978cbae0b Merge pull request #5140 from MjnMixael/check_beam_damage_factor
Warn if beams have damage factors while damage factors are disabled
2023-01-25 20:24:50 -05:00
mjn-mixael fe787ade08 if we're not drawing weapon models then skip all this 2023-01-25 17:06:07 -06:00
mjn-mixael 236b648b11 address feedback 2023-01-25 08:43:11 -06:00
mjn-mixael 414c630d04 address feedback 2023-01-25 08:31:36 -06:00
Goober5000 c70806a705 patch player tips
1. Be consistent about the check for `Player` being null, as the `Player` variable may be used later in the function without a null check
2. Return early if there are no tips to show, so as to prevent a crash
3. Use `Random::next` rather than `frand_range`
4. Use `SCP_string` to avoid string overflow

Fixes a crash discovered in Star Fox: Event Horizon
2023-01-25 00:01:36 -05:00
David Gibson 6ecfe2f186 Removed unhelpful optimization from trail rendering 2023-01-24 16:58:36 -06:00
mjn-mixael e0baaa6087 Allow way to prevent scpui loading hires animations 2023-01-24 16:20:00 -06:00
mjn-mixael 663ce18fab warn if beams have damage factors while damage factors are disabled 2023-01-24 12:28:33 -06:00
mjn-mixael d7bbecfa16 has-armor-type sexp 2023-01-24 11:20:25 -06:00
mjn-mixael d2e1e2b5de hud-force-emp-effect sexp 2023-01-23 21:50:36 -06:00
mjn-mixael 9e1181b70f check if we have at least two linkable weapons 2023-01-23 09:04:15 -06:00
Tyler Blount ae5c49e970 Merge pull request #5136 from scp-fs2open/fix/post-release-secrets
Inherit secrets when publishing Release builds
2023-01-22 20:49:40 -07:00
Tyler Blount 14d51b4584 Inherit secrets when publishing Release builds 2023-01-22 19:03:52 -07:00
Goober5000 b92954877d Merge pull request #5135 from Goober5000/fix_5089
fix sunglares when lightshafts are disabled
2023-01-22 15:02:08 -05:00
Asteroth 3047a226a3 Better account for runtime gravity changes (#5130)
* better account for changing gravity

* use `obj_used_list`

* check should_be_dead
2023-01-22 14:40:13 -05:00
MjnMixael 9974457df0 let passive fields wrap if gravity is involved (#5132) 2023-01-22 13:56:34 -05:00
Goober5000 11f2635abd add parse object collision group to sexps 2023-01-21 18:53:40 -05:00
Goober5000 df8268368a make collision_group_id accessible to parse objects
Add collision groups to parse objects so they can be set before arrival via script.
2023-01-21 18:10:51 -05:00
Goober5000 c72e214c47 fix sunglares when lightshafts are disabled
This is another case of a bug introduced by a bugfix, in this case #3885.  The original bug inadvertently made sun glare work in most cases where it was supposed to.

This commit removes the check for lightshafts when drawing the sun glare.  Since sun glare can be drawn regardless of whether lightshafts are enabled, the only thing that matters is to check that the view is not shadowed.
2023-01-21 17:52:55 -05:00
EatThePath 7177361c82 Merge pull request #5126 from EatThePath/fix-my-cmdline-mess
adding proper launcher documentation for some of my recent flags
2023-01-21 09:12:51 -06:00
Asteroth 654b0a0e42 Improve handling of failure to find spawn weapons (#5111)
* improve handling of failure to find spawn weps

* docs

* shadowing
2023-01-21 01:33:25 -05:00
Goober5000 add6a60439 Merge pull request #5129 from MjnMixael/more_asteroid_sexp_fixes
Move these checks into asteroid.cpp
2023-01-20 21:26:50 -05:00
MjnMixael 5694e5c810 Allow negative number in event editor (#5106)
* allow negative number in event editor

* handle qtFRED ui also
2023-01-20 18:06:08 +01:00
Goober5000 5c8806d040 Merge pull request #5127 from Goober5000/dont_blast_nocollide
don't blast no-collide objects
2023-01-19 21:38:57 -05:00
mjn-mixael 798e47409a Move these checkes into asteroid.cpp 2023-01-18 16:24:48 -06:00
Goober5000 f8acd4f898 don't blast no-collide objects
In the same way that navbuoys aren't blasted by explosions, no-collide objects shouldn't be blasted either.

Fixes #5068.
2023-01-18 01:59:20 -05:00
David Gibson 689467e21f ADding proper launcher documentation for some of my recent flags 2023-01-17 13:14:10 -06:00
Goober5000 b6ff2caa0a update the .mako file for release posts (#5118)
* update the .mako file for release posts

1. Change the "previous release" thread to 22.2
2. Change http to https where possible
3. Link to the github Bug Triage page rather than the Mantis filter
2023-01-17 01:52:15 +00:00
mjn-mixael 6b097be0a6 use me daddy 2023-01-16 14:15:56 -06:00
mjn-mixael 9980c3f5c5 funcs and virtvars for SCPUI pause screen 2023-01-16 14:02:01 -06:00
mjn-mixael bd1a288cd9 expose pausing weapon sounds 2023-01-15 21:02:50 -06:00
Tyler Blount 5020cf8b64 Merge pull request #5114 from z64555/fix_5113
Fix and expand upon debug safety catcher for ccfg.tbl flag reading.
2023-01-15 15:12:56 -07:00
Tyler Blount 4f1d486ea3 Merge pull request #5110 from MjnMixael/fix_asteroid_sexps
make sure we have an argument
2023-01-15 13:30:07 -07:00
Fabian Woltermann e8c9a0a3aa do not update the gl buffer for a batch if the batch is empty (#5115) 2023-01-15 19:15:47 +01:00
z64555 2bc1247002 Fix and expand upon debug safety catcher for ccfg.tbl flag reading.
* Expand upon some comments for clarity on assumptions and optimizations
* Define the CCF_NONE flag for posterity
2023-01-15 10:59:48 -06:00
mjn-mixael d8a052128e remove returns 2023-01-14 17:29:32 -06:00
mjn-mixael fa3631c9b9 make sure we have an argument 2023-01-14 17:24:43 -06:00
Fabian Woltermann 0fcf7e0fbe Remove the screen signature (#5108) 2023-01-14 16:45:10 +01:00
mjn-mixael ddde9079c9 some validity checks to order sending 2023-01-13 15:48:28 -06:00
Goober5000 d562104c0f Merge pull request #5105 from MjnMixael/fix_skipping_first_debris
don't skip first debris item
2023-01-12 22:42:25 -05:00
mjn-mixael a1dbf2e917 don't skip first debris item 2023-01-12 12:16:39 -06:00
Goober5000 eca7db0315 allow personas to be used by more than one species 2023-01-12 12:47:12 -05:00
Goober5000 be4d7acb6a change substitute_missing_messages to an actual flag, and add a no automatic assignment flag 2023-01-12 00:49:21 -05:00
Goober5000 02e5cc4353 remove PERSONA_FLAG_VASUDAN, since it is no longer assigned, and fix the -Vas suffix on the personas, which has apparently been broken since the species upgrade 2023-01-11 23:55:28 -05:00
JohnAFernandez d55a604ca5 Merge pull request #5098 from MjnMixael/fix_team_color_parse
fix team color parsing
2023-01-11 16:31:15 -05:00
mjn-mixael 481c0a490b address feedback 2023-01-11 08:14:29 -06:00
Fabian WoltermannandFabian Woltermann 264a44085d when checking sexp text strings, make sure to account for usages of <argument> (#5100)
Co-authored-by: Fabian Woltermann <[email protected]>
2023-01-10 21:33:39 +01:00
Goober5000 da3ed275d4 Merge pull request #5095 from MageKing17/bugfix/asteroid-targets-fred-crash
Avoid calling `asteroid_add_target()` in FRED.
2023-01-09 23:58:43 -05:00
Goober5000 44bebf17b8 Merge pull request #5097 from MjnMixael/add_missing_help
Add missing help for ship-untag sexp
2023-01-09 23:58:26 -05:00
mjn-mixael 0b234af925 fix team color parsing 2023-01-09 12:40:52 -06:00
mjn-mixael 5ca15685ef Add missing help for ship-untag sexp 2023-01-09 11:37:41 -06:00
mjn-mixael 2a5b930941 implement opf_turret_type for turret-protect-ship and turret-unprotect-ship 2023-01-09 11:13:37 -06:00
MageKing17 98713dadc1 Avoid calling asteroid_add_target() in FRED.
PR #5058 made `count_incident_asteroids()` use `Asteroid_obj_list` instead of `obj_used_list`; a perfectly sensible change in and of itself. However, PR #4827 had previously made `asteroid_obj_list_init()` only be called if FRED wasn't running (presumably because of the iteration through `Asteroid_objs` to clear flags, which is wasted effort in FRED). The problem is that without `list_init()` being called on `Asteroid_obj_list`, its `prev` and `next` were `nullptr` instead of linking back to itself, which means the beginning of the list and the end of the list were no longer considered the same (the iterator's `begin()` calls `GET_FIRST(head)`, which is effectively `head->next`, while `end()` calls `END_OF_LIST(head)`, which is effectively just `head`). This meant that iterating over `list_range(Asteroid_obj_list)` was returning `nullptr` as the first element of the list, and trying to dereference that would cause a crash. This was still not a problem in and of itself, as long as nothing tried to iterate over `Asteroid_obj_list` while FRED was running, which theoretically shouldn't be necessary...

PR #3704 changed mission parsing so that when parsing a ship with a name that matches one of the `Asteroid_field.target_names`, it would call `asteroid_add_target()` to initialize the relevant data for the asteroid field to fling asteroids at that ship. `asteroid_add_target()` calls `count_incident_asteroids()`, which (since PR #5058) iterates over `Asteroid_obj_list`, causing a crash due to dereferencing a null pointer on any mission that defines `$Asteroid Targets:` (and then actually has such a target be parsed).

While this could be solved by unconditionally initializing `Asteroid_obj_list`, there's really no need to do anything with `Asteroid_obj_list` in FRED, so instead the `asteroid_add_target()` call has been gated behind a `!Fred_running` check, and `Assertion()`s have been added to make sure `Asteroid_obj_list` has been initialized at the beginning of any function that does anything with it (besides initialize it), to catch similar problems in the future.

Fixes #5092.
2023-01-09 06:43:58 -08:00
Goober5000 b0f5a4cffb Merge pull request #5082 from MjnMixael/port_to_qtfred
This case was never ported to qtFRED
2023-01-08 13:32:09 -05:00
mjn-mixael 2881482182 fix rendering of jump nodes 2023-01-07 11:11:02 -06:00
mjn-mixael 661732a45b only load the model in the retail ui 2023-01-07 02:23:36 -06:00
mjn-mixael dd9faf9438 more missed stuff 2023-01-07 02:03:44 -06:00
mjn-mixael 856997326b some cleanup 2023-01-07 01:49:58 -06:00
mjn-mixael d52c2da8b5 take a break youve earned it 2023-01-07 01:48:39 -06:00
mjn-mixael c6a1639a82 scpui methods required for handling closeup briefing icon stuff 2023-01-07 01:48:39 -06:00
Goober5000 fc2cac617f Merge pull request #5087 from MjnMixael/fix_brief_api_highlight
fix api brief map not rendering icon highlight arrows
2023-01-06 21:09:27 -05:00
mjn-mixael 96bd06fbc1 fix api brief map not rendering icon highlight arrows 2023-01-06 09:49:16 -06:00
mjn-mixael d62e38d996 unify get_listing_opf_subsystem 2023-01-06 08:56:01 -06:00
Goober5000 a0181e715d prevent ship from managing ETS if it is playing dead
This was the bug found recently that was thought to be related to #2157.  It turns out that ships will manage ETS even if they are playing dead, which caused a ship to accelerate during a ship-maneuver as it directed more power to engines.  So this PR adds a "$ships playing dead don't manage ETS:" flag to control this behavior.  Tested and works.

This also capitalizes two flags that did not have an initial capital letter.
2023-01-06 03:04:11 -05:00
Goober5000 d8fe4a11be Merge pull request #5042 from MjnMixael/asteroid_sexp_missed_items
A few missed items and fixes to the asteroid debris sexp
2023-01-05 21:11:00 -05:00
MjnMixael 1a4abd9977 Typo 2023-01-05 12:29:42 -06:00
mjn-mixael aa6b1030f1 This case was never ported to qtFRED 2023-01-05 11:04:34 -06:00
mjn-mixael 3752a54a63 move 2023-01-05 10:48:47 -06:00
JohnAFernandez a49acc92f3 Merge pull request #5076 from MjnMixael/warn_dogfight_weapons
Warn dogfight weapons
2023-01-05 11:00:56 -05:00
MjnMixael 5ba4e50685 remove ignored missions from the lab list (#5081) 2023-01-05 10:06:28 +01:00
Goober5000 24e3243289 Merge pull request #5078 from MjnMixael/fix_fred_coords_input
Disallow overly large input in FRED Orientation Editor
2023-01-04 18:29:13 -05:00
mjn-mixael dbbd6b7705 Make sexp node comments more visible at a glance 2023-01-04 16:08:10 -06:00
mjn-mixael ae135b4922 mission profiles instead of gameplay profiles 2023-01-04 13:48:16 -06:00
mjn-mixael c1987aba62 < instead of <= 2023-01-04 13:44:57 -06:00
mjn-mixael 6f7bcbd0ff check INT_MIN also 2023-01-04 13:42:55 -06:00
mjn-mixael 9a8d5cde53 disallow overly large input 2023-01-04 09:08:58 -06:00
mjn-mixael efc5a370d5 better error message 2023-01-04 08:22:05 -06:00
mjn-mixael 4760bc7e2b Move this into the main loop 2023-01-04 08:14:24 -06:00
mjn-mixael 9c167b279d throw in -gmp.tbm as optional match to -aip.tbm 2023-01-03 21:25:59 -06:00
mjn-mixael 1884e4c4d1 allow gameplay_profiles.tbl to be an alias of ai_profiles.tbl 2023-01-03 21:21:37 -06:00
Goober5000 a7b46dba58 Merge pull request #5060 from MjnMixael/fix_mainhall_anims
SCPUI needs to be able run game_close_level
2023-01-03 21:23:38 -05:00
mjn-mixael cc079aedfa clearer warning message 2023-01-03 20:01:45 -06:00
mjn-mixael f3937a8f68 only run the check if the mission is a dogfight mission 2023-01-03 19:59:52 -06:00
mjn-mixael 1f7cdca5a9 optional 2023-01-03 19:56:56 -06:00
mjn-mixael d36a95962f warn if dogfight mission doesn't have dogfight weapons 2023-01-03 19:55:34 -06:00
Goober5000 d2eff1f141 Merge pull request #5073 from Goober5000/fixed_chain_repeat
restore retail behavior of chaining to repeating events
2023-01-03 19:03:33 -05:00
Goober5000 9ce7748c20 Merge pull request #5039 from Goober5000/object_iteration_fixes
more robust object iteration
2023-01-03 19:03:22 -05:00
mjn-mixael c74d523e18 third attempt at getting past that one guy 2023-01-03 14:52:55 -06:00
mjn-mixael 0bc26cab24 Revert "make sure game time is running in the mainhall"
This reverts commit 155e043bb0.
2023-01-03 08:37:06 -06:00
Goober5000 0d56bb9999 restore retail behavior of chaining to repeating events
To avoid changing behavior of existing mods, simulate the retail behavior unless the bugfix is explicitly activated.  The buggy retail behavior is to evaluate a chained event, not skip it, if the event is repeating, regardless of whether the repeat timestamp has elapsed.
2023-01-03 01:37:18 -05:00
Goober5000 f2fa235522 Merge pull request #5058 from Goober5000/missile_obj_list_iteration
add should-be-dead checks for missile and asteroid iterations
2023-01-02 14:19:03 -05:00
Goober5000 7829989478 Merge pull request #5070 from MjnMixael/fix_ingame_joystick
Make sure all 4 in-game joystick options get evaluated
2023-01-02 01:12:43 -05:00
mjn-mixael a8e411d310 Make sure all 4 ingame joystick options get evaluated 2023-01-01 23:30:50 -06:00
mjn-mixael 8cf7796809 Pass shortcut key character to Lua as a hook variable 2023-01-01 18:04:05 -06:00
Goober5000 07924f078a use Missile_obj_list or Asteroid_obj_list instead of obj_used_list where appropriate 2023-01-01 18:13:29 -05:00
Goober5000 782980844b add checks to Missile_obj_list and Asteroid_obj_list 2023-01-01 18:13:29 -05:00
Goober5000 c95865442e Merge pull request #5065 from notimaginative/fix_joystick_loops
swap loop order to fix joystick detection issue
2023-01-01 18:00:35 -05:00
Goober5000 f484ddef06 Merge pull request #5066 from notimaginative/fix_joyid_problem
use correct joystick id type (instance -> device)
2023-01-01 18:00:26 -05:00
JohnAFernandez 0c687f37c1 Merge pull request #5062 from Baezon/team-color-split-ships
Ensure 'split ships' are team colored
2022-12-31 23:24:56 -05:00
Goober5000 6de5c96127 add should-be-dead checks for object iterations (#5050)
Follow-up to #5040.  This extends the checks to most iterations over `obj_used_list` in FSO.  There are a few exceptions such as `waypoint_add` and `waypoint_remove`, plus a few others.  And none of the object iterations in FRED have the guard because FRED does not use the same object life cycle as FSO.
2022-12-31 23:23:39 -05:00
Taylor Richards 083984efec add support for .vpc extension on VP archives (#5067)
.vpc is identical to existing .vp except that it is allowed to
contain compressed files. This allows builds and tooling to know
that although the archive itself is retail compatible, it's content
may require special handling.

Simply rename your existing .vp to .vpc to indicate that it may
use compressed files. Existing tools can be updated to be able to
handle the compressed content within.

Although not recommended, the same archive can exist as both .vp
and .vpc for maximum compatibility. Both archives will be indexed
but the content of the .vpc will have priority.
2022-12-31 18:58:28 -05:00
Taylor Richards 9346f67d5c use correct joystick id type (instance -> device)
fixes #4793
2022-12-30 21:57:10 -05:00
Taylor Richards d2322cb2c2 swap loop order to fix joystick detection issue
fixes #4792
2022-12-30 21:48:34 -05:00
Asteroth 96f2a3b045 ensure split ships are team colored 2022-12-30 00:45:03 -05:00
Goober5000 e2e14bb6df Merge pull request #5059 from Baezon/team-color-change-pobjp
Check for parse object before team color change
2022-12-29 14:37:04 -05:00
mjn-mixael 155e043bb0 make sure game time is running in the mainhall 2022-12-29 11:01:43 -06:00
Asteroth ef721b3192 check for parse object 2022-12-29 03:27:38 -05:00
Goober5000 06ded501c8 Merge pull request #5056 from Goober5000/comment_tweak
comment tweak
2022-12-29 01:08:51 -05:00
Goober5000 9540caff5a Merge pull request #5057 from MageKing17/bugfix/use-universal-textifying
Use `textify_scancode_universal()` in more places.
2022-12-29 00:07:48 -05:00
MageKing17 3eacbc0e0b Use textify_scancode_universal() in more places.
Controls6 (PR #4133) changed `textify_scancode()` to be more l10n-aware, and added `textify_scancode_universal()` to continue serving the function of providing the values expected by scripts. Except there was one `textify_scancode()` call in the scripting system that wasn't changed, and it also wasn't used in FRED (for providing values for the `OPF_KEYPRESS` argument type, as used with `key-pressed`). This commit fixes both of these oversights, which *should* mean that all instances where a script or mission file needs to reference a keypress now use the same strings as before controls6.
2022-12-28 18:03:07 -08:00
Goober5000 a2d4576c4f comment tweak
Add a useful summary to the comment about event timestamps.
2022-12-28 17:34:15 -05:00
Fabian WoltermannandFabian Woltermann c727e40b8a apply the HDR colorspace stuff _after_ mixing in the team color glows (#5052)
Co-authored-by: Fabian Woltermann <[email protected]>
2022-12-28 18:48:20 +01:00
Goober5000 78b385e41b Merge pull request #5051 from Goober5000/wing_fix_and_error_checks
fix wing cues and add some more error checks
2022-12-27 15:30:34 -05:00
Goober5000 5485efe904 fix wing cues and add some more error checks
Fixes #5045 by correctly initializing wing arrival and departure cues.  Follow-up to #4856.  Also adds a bit more SEXP error checking.
2022-12-27 01:33:53 -05:00
Goober5000 85bb14898f Merge pull request #5040 from Goober5000/ship_obj_list_iteration
add should-be-dead checks for all ship iterations
2022-12-26 22:28:00 -05:00
MjnMixael a3bbf13da6 prevent access to goals outside the vector (#5044)
prevent access to goals outside the vector
2022-12-24 21:12:56 -05:00
JohnAFernandez 10d3bdda06 Merge pull request #5041 from MjnMixael/consolidate_tech_rendering
consolidation of tech rendering methods
2022-12-24 11:59:12 -05:00
Goober5000 dd93284777 Merge pull request #5043 from Baezon/no-pobjp-crash-fix
Fix a crash in `change_ship_type`
2022-12-23 13:14:06 -05:00
Goober5000 d6bb97d8f2 address feedback 2022-12-23 02:11:54 -05:00
Goober5000 46293ad0fe add should-be-dead checks for all ship iterations
When iterating through `Ship_obj_list`, check the `Should_be_dead` flag before using the object.  This fixes #4990 and adds defense-in-depth checks to guard against similar errors elsewhere.

I considered moving the `Ship_obj_list` removal from `obj_delete` to `ship_cleanup`, but decided it would be prudent to avoid fundamental changes to lifecycle management.
2022-12-23 00:51:31 -05:00
mjn-mixael 8aa4a86e1c set shadow override 2022-12-22 07:02:10 -06:00
Asteroth ca7618c993 check for if a ship has a parse object first 2022-12-22 04:02:43 -05:00
mjn-mixael fc21e12dfd A few missed items and fixes to the asteroid debris sexp 2022-12-21 21:11:14 -06:00
mjn-mixael a662f8168c consolidation of tech rendering methods 2022-12-21 20:45:40 -06:00
Goober5000 c2b93549a2 more robust object iteration
When iterating through various object collections, check for the should-be-dead flag to avoid returning objects that are on the verge of being deleted.

Separately, this adds the `isExpiring` function to check for should-be-dead objects.

This PR also makes object iteration consistent across all object types, both to reduce code duplication and to ensure that the length and iteration are done using the same algorithm.  Furthermore, if the number of should-be-dead objects is nonzero, the Lua array count for that frame will be different from the internal array count for that frame.

Fixes #5034.
2022-12-21 19:51:02 -05:00
Goober5000 32852c967e Merge pull request #5037 from Goober5000/hud_lock_iteration_fix
patch hud-lock iteration for objects that aren't ships
2022-12-21 12:44:46 -05:00
Goober5000 342373e2a1 Merge pull request #5038 from Goober5000/patch_hud_target_live_turret
patch some crash vulnerabilities in hud_target_live_turret
2022-12-21 12:43:59 -05:00
Goober5000 1070d1dbea patch hud-lock iteration for objects that aren't ships
Add a few more safety checks; don't assume every item is a ship.
2022-12-21 00:40:09 -05:00
Goober5000 6cf6b3266f patch some crash vulnerabilities in hud_target_live_turret
These checks risked causing a crash or memory access violation if they were ever encountered with an invalid target when `auto_advance` is true.
2022-12-20 20:40:43 -05:00
mjn-mixael 3b3a45d2d8 fix documentation 2022-12-20 16:07:52 -06:00
mjn-mixael 9f1c00c581 allow scripts to read LuaEnums and add LuaEnums 2022-12-20 15:53:40 -06:00
Asteroth f464b30089 update regen rates and autoaim fov on ship class change (#5029) 2022-12-21 00:17:23 +09:00
Asteroth 0fb6b2ae0d Update 22.4 version references to 23.0 (#5025)
* update references to 22.4 to 23.0

* fix a few more version references
2022-12-21 00:16:51 +09:00
Fabian Woltermann 18c182acc8 script hooks must be declared within global_hooks so that both FRED and FSO can see them (#5031) 2022-12-20 11:55:36 +01:00
Taylor Richards c9291e3f1c address issues related to cf.openFile() error handling (#5030)
- fix crash bug when path only contains dir separators
 - fix error handling when no path is specified in write mode
 - clarify function documentation

Fixes #5028
2022-12-20 01:27:51 -05:00
Goober5000 00f0cc4847 Merge pull request #5027 from Goober5000/comm_menu_open
add hu.isCommMenuOpen
2022-12-19 20:33:04 -05:00
Tyler Blount 2f8e10b8d8 Merge pull request #5024 from scp-fs2open/fix/CI-POST-result-status
Change check of POST response result
2022-12-18 20:35:01 -07:00
Tyler Blount 0acb22456c Respecify the env for Post Builds auto-trigger 2022-12-18 14:15:04 -07:00
Tyler Blount 22c8ae024e Change check of POST response result
This modified the check as `text` has been changed in the Requests API. In order to make the code compatible with the JSON result, we check `resp.status_code` instead.
2022-12-18 13:53:32 -07:00
Tyler Blount 5857b569a1 Merge pull request #5023 from scp-fs2open/fix/build-post-23.0-RC1
Fix failure to post Mac builds to forums
2022-12-18 11:31:26 -07:00
Tyler Blount 9136c04a34 Fix failure to post Mac builds to forums
Also includes replacement of string literals with constants to reduce maintenance overhead in the event the name of a group changes.
2022-12-18 10:22:31 -07:00
Fabian WoltermannandFabian Woltermann 87926995df Feature/dear imgui (#4987)
* Add imgui

* migrate render options

* remove wmcgui

* Add subsystem selection and highlighting

* Add a syntactic sugar extension for imgui

* don't rebuild the mission list every frame

* Add imgui_sugar extension

* Move helper functions out of lab_ui, add function to display consolidated table text for object

* add button to export cubemap

* fix entering and exiting the lab

* refactor some of this for greater cleanness

* use techroom lighting when no mission background is set

* minor things

* add imguizmo

* add imguizmo

* Add imgui

* migrate render options

* remove wmcgui

* Add subsystem selection and highlighting

* Add a syntactic sugar extension for imgui

* don't rebuild the mission list every frame

* Move helper functions out of lab_ui, add function to display consolidated table text for object

* add button to export cubemap

* fix entering and exiting the lab

* refactor some of this for greater cleanness

* minor things

* add imguizmo

* add imguizmo

* Add button to reset changes made in the render dialog

* refactoring

* unfuck rebase

* fix issue with loose mission files

* use with_CollapsingHeader for greater uniformity

* add weapon selection functionality

* make primaries and secondaries fire again

* implement animation triggers

* avoid crash when switching back and forth between ships with and without team colors

* add control to set team color setting to renderer texture dialog

* make sure the table text updates when the ship class changes

* let rotating subsystems rotate

* do not add imgui.h to pstypes

* code cleanup

* add subsys highlighter from fred

* Highlight non-modelled subsystems as well

* add cmdline flag to show the imgui demo dialogue

* fix compiler warnings reported by CI

* fix error when building the subsystem list

* refactor variable/method naming

* code cleanup

* remove vestigial code

* update to imgui 1.89.1

* add credits entry for imgui

* use the imgui namespace

* Separate the background dialog out into its own window

* make sure the subsystem highlights are placed correctly

Co-authored-by: Fabian Woltermann <[email protected]>
2022-12-18 16:29:20 +01:00
Goober5000 87a051a933 Merge branch 'master' into more_category_updates 2022-12-18 01:31:47 -05:00
BMagnu 66becc983e Fix OnBeamCollision oversight (#5021) 2022-12-18 01:04:59 +00:00
Goober5000 47564d1505 Merge pull request #5008 from MjnMixael/asteroid_sexp_error_checks
Add missing asteroid debris argument type error checking
2022-12-16 23:04:13 -05:00
Goober5000 7022ba191a ci stuff 2022-12-16 23:03:27 -05:00
Goober5000 4572aa1bc1 Merge pull request #5004 from JohnAFernandez/fix-use-of-incorrect-variables
Use the correct variables in this function
2022-12-16 22:58:59 -05:00
Goober5000 d36db98974 Merge pull request #5014 from MjnMixael/fix_render_tech_model
Do not include -destroyed subobjects in renderTechModel
2022-12-16 22:58:48 -05:00
Goober5000 a822d2ad60 Merge pull request #5016 from Goober5000/navpoint_fixes
initialize NavPoint properly
2022-12-16 22:58:41 -05:00
Goober5000 e3fc5f8bc1 add hu.isCommMenuOpen
A script function to tell if the comms menu is open
2022-12-16 22:20:52 -05:00
Goober5000 8d672bddb3 change SEXP_SRC_* to enum class 2022-12-16 22:10:22 -05:00
Goober5000 dc281a56f8 change SEXP_MODE_* to enum class 2022-12-16 19:45:05 -05:00
Goober5000 7b0a8eff9e change REF_TYPE_* to enum class 2022-12-16 19:41:45 -05:00
Fabian Woltermann 386e068890 Merge pull request #5015 from The-E/fix/old_ai_weapon_link_copypasta
fix vintage copypasta bug
2022-12-16 21:09:50 +01:00
Goober5000 5a674a7db1 initialize NavPoint properly
Initialize NavPoint values any time a NavPoint object is created, not just when the `clear()` function is run.
2022-12-16 12:59:53 -05:00
Fabian Woltermann 5984be99b6 fix vintage copypasta bug 2022-12-16 18:35:52 +01:00
mjn-mixael 84962ff33c Remove model instances after rendering 2022-12-16 09:39:11 -06:00
mjn-mixael 3136e0debf Use a model instance to prevent rendering destroyed subobjects 2022-12-16 09:31:19 -06:00
Goober5000 7318221e6a Merge pull request #5002 from Goober5000/beam_team
beam teams
2022-12-15 17:46:26 -05:00
Goober5000 c3477e88a7 beam teams
Add a Team virtvar to beam objects in Lua.
2022-12-15 15:44:54 -05:00
MjnMixael f1f27b21b7 Use define 2022-12-15 10:52:58 -06:00
Goober5000 52455bbc62 Merge pull request #5009 from MjnMixael/dynamic_sexp_enum
Dynamic sexp enum
2022-12-15 11:31:49 -05:00
mjn-mixael 25a4f66451 missed items 2022-12-15 01:01:10 -06:00
mjn-mixael e0eb7ef3d6 this should have a more unique name 2022-12-14 22:49:41 -06:00
mjn-mixael 2909e8fa2b address feedback 2022-12-14 22:32:51 -06:00
mjn-mixael a47658b336 address feedback 2022-12-14 15:41:36 -06:00
mjn-mixael 42a88a9e3f Comment 2022-12-14 13:54:17 -06:00
mjn-mixael 174976d2bb Better global name 2022-12-14 13:52:50 -06:00
mjn-mixael 911639d1b0 Add missing asteroid debris argument type error checking 2022-12-14 13:46:40 -06:00
mjn-mixael 5366f235ca Allow custom Lua Enums 2022-12-14 13:45:14 -06:00
Fabian Woltermann 76b301b4f1 Merge pull request #5007 from The-E/fix/5006_ssm_struct_not_initialized
Fix an issue with ssms sending uninitialized messages
2022-12-14 17:04:46 +01:00
mjn-mixael 49b486a326 use enum for list types 2022-12-14 09:12:11 -06:00
Fabian Woltermann c39861a600 When parsing an ssm, make sure to only use a custom message when one is actually defined 2022-12-14 15:18:05 +01:00
John Fernandez bb42302ba3 Use the correct variables in this function 2022-12-13 21:47:10 -05:00
Goober5000 d722f50f8b more category updates
1. Allow categories, not just subcategories, to be added by scripted SEXPs.
2. Allow subcategories in different categories to have the same name.
2022-12-13 21:16:26 -05:00
Goober5000 29217cc2aa Merge pull request #5000 from Baezon/playdead-player-turrets
Allow player turrets to fire despite play dead
2022-12-13 19:15:53 -05:00
BMagnu 385478824e Fix refactor bug (#5001) 2022-12-13 20:56:48 +00:00
Asteroth b0c6d81d89 ship_move_subsystems too 2022-12-13 15:38:21 -05:00
Asteroth 5d66f3108f allow player turrets to fire despite play dead 2022-12-13 15:02:08 -05:00
Goober5000 922be2ff36 Merge pull request #4999 from BMagnu/problematic_counter_lib
Remove problematic counter library
2022-12-13 13:52:52 -05:00
BMagnu af1f0eaeca Rework Script Conditions (#4960)
* add skeleton for hook condition API

* Begin Scripting Hook refactor

* Program Hook Conditions for current new-style hooks

* Replace more hooks

* Fully transition global hooks

* Convert legacy hooks pt. 1

* Convert legacy hooks pt. 2

* Convert legacy hooks pt. 3

* Post-conversion cleanup

* restore parsing

* Add Documentation and fix parsing

* Fixup engine ingame hook adding

* Fixup engine ingame hook adding again

* Fix warnings

* Fix GCC unqualified template base lookup

* unqualified lookup v2

* Virtual Destrcutors

* Fix Clang

* Fix ship objp hook condition shadow

* Remove global hook include in ship.h

* Incorporate Feedback

* Incorporate Feedback 2

* Add revision to inline version specififer
2022-12-14 03:51:27 +09:00
Birk Magnussen 6b3f99eafd comment for OP_NOT_AN_OP 2022-12-13 18:43:01 +01:00
Birk Magnussen cb008706a4 Tidy up comment 2022-12-13 18:37:08 +01:00
Birk Magnussen 9366963e42 Fix formatting 2022-12-13 18:32:27 +01:00
Birk Magnussen 7ed7b37f9a Replace enum in switch for readability purposes 2022-12-13 18:25:26 +01:00
Birk Magnussen a62a9cd5e0 Remove enum type name for safery 2022-12-13 18:21:32 +01:00
BMagnu 80b75352bf Respect First OP 2022-12-13 16:10:45 +01:00
BMagnu c58216f9c3 Remove Counter library 2022-12-13 16:04:55 +01:00
Goober5000 f40a018785 Merge pull request #4996 from MageKing17/bugfix/let-vc-2017-compile-again
Add missing locale argument to `std::isdigit()` calls.
2022-12-12 15:21:00 -05:00
JohnAFernandez cf9bfb8939 Merge pull request #4997 from Goober5000/subcategory_fixes
subcategory fixes and followup
2022-12-12 12:32:55 -05:00
Goober5000 74db049f85 subcategory fixes and followup
Several items here:
1. Patches several category and subcategory validation checks (comparisons to -1 rather than _NONE) that were missed in #4965.
2. Adds sanity checks to both built-in operators and scripted sexps to ensure categories and subcategories are consistent.
3. Deconflicts several built-in sexps that had inconsistent categories.

The inconsistent operators were:
* script-eval-string
* set-wing-formation
* get-ets-value
* turret-get-primary-ammo
* turret-get-secondary-ammo
* get-fov

Follow-up to #4965 and #4995.
2022-12-12 00:08:21 -05:00
MageKing17 7fde659b42 Add missing locale argument to std::isdigit() calls.
Much like a previous instance (fixed in #3281, although the function in question was later removed), `std::isdigit()` without a locale argument prevents MSVC 2017 from compiling FSO.
2022-12-11 20:11:42 -08:00
EatThePath 780ab89b61 Merge pull request #4995 from Goober5000/fix_4994
fix subcategory comparison
2022-12-11 22:04:52 -06:00
Goober5000 afbdd39bde fix subcategory comparison
Empty subcategories are now OP_SUBCATEGORY_NONE, not -1.  Fixes #4994.

Also fixes a cast warning in missionparse.cpp.
2022-12-11 22:27:47 -05:00
JohnAFernandez 6e159345d8 Merge pull request #4993 from MjnMixael/fix_passive_arc_iterator
fix passive arc iteration
2022-12-11 19:41:34 -05:00
MjnMixael a421d38455 Asteroid/Debris cleanup + Modular asteroids table (#4870)
* set-asteroid-field sexp

* errors

* scope

* set-debris-field sexp

* Clarify sexp documentation

* num_debris_sizes

* allow any order and activate display name feature

* unify naming scheme

* modular -ast.tbm

* styling

* decouple sexp parsing and asteroid field creation methods

* remove this

* fix merge oversights

* Remove this check

* reorder

* use scp_string instead

* spacing

* Only setup display name if it's empty

* Use define instead of magic numbers

* Ensure asteroid types get the correct spawn weight

* Warn if spawn weight is set for asteroid type

* typo

* Correctly handle asteroid split types

* iiiiiiiiiiiiiiiiiint

* address feedback
2022-12-11 19:29:23 -05:00
mjn-mixael c69bc1e395 fix passive arc iteration 2022-12-11 18:04:42 -06:00
Goober5000 e89a661210 Merge pull request #4992 from Goober5000/fix_4991
fix crash in ship_close_cockpit_displays
2022-12-10 22:20:32 -05:00
Goober5000 1e834010e0 fix crash in ship_close_cockpit_displays
This function can be called when `shipp` is null, so check for that.

Fixes #4991.
2022-12-10 21:37:28 -05:00
Goober5000 4b172c0ca9 Merge pull request #4965 from Goober5000/sexp_category_bump
SEXP operators, categories, and subcategories refactoring
2022-12-10 15:18:53 -05:00
Asteroth eb3b7544b5 ensure animations load first if available (#4986) 2022-12-10 08:45:21 -05:00
Goober5000 207540303f multi version bump for new SEXP operator IDs 2022-12-09 14:44:30 -05:00
Goober5000 89ed5be8c7 Merge pull request #4875 from Goober5000/dynamic_events
dynamic events and goals
2022-12-09 13:53:54 -05:00
Goober5000 57395a772a address feedback 2022-12-09 13:47:23 -05:00
Goober5000 e179caa339 add defaults to switch blocks 2022-12-09 13:47:23 -05:00
Goober5000 621593c39f convert categories, subcategories, and operator IDs 2022-12-09 13:47:23 -05:00
Goober5000 da66b8c08c use enum for sexp error check 2022-12-09 13:47:23 -05:00
Goober5000 ffed86e8a0 typesafe oswpt_type 2022-12-09 13:47:23 -05:00
Goober5000 719148beaa typesafe sexp_oper_type 2022-12-09 13:47:23 -05:00
Goober5000 1a487473d7 MAX_OPERATORS is no longer used 2022-12-09 13:47:23 -05:00
Goober5000 eddca6bdf0 Merge pull request #4961 from Goober5000/support_ship_cleanup
clean up support ship mode in all cases
2022-12-09 13:14:45 -05:00
Goober5000 226e956fcc dynamic events and goals
Make events and goals dynamic in missions and campaigns.  When parsing, initialize all fields to their defaults.
2022-12-09 13:10:39 -05:00
Goober5000 a88ccb69e7 Merge pull request #4963 from Goober5000/messageq_enhancement
make message queue dynamic
2022-12-09 11:03:54 -05:00
Goober5000 10bdf5c03b Address feedback 2022-12-08 21:53:10 -05:00
Goober5000 12cbf9ab61 make message queue dynamic
Use a vector for storing the message queue so it can be whatever size the mission needs.

As part of this, add `free` and `vm_free` deleters to be usable with `unique_ptr` and enhance `insertion_sort` to be usable with vectors.

Fixes #4959.
2022-12-08 21:53:10 -05:00
Goober5000 6496b97d21 Merge pull request #4985 from Goober5000/disable_qt_again
try disabling Qt builds
2022-12-08 21:50:33 -05:00
Goober5000 721680cb60 try disabling Qt builds
Per the example in #3160, disable Qt builds for the time being.
2022-12-08 19:54:46 -05:00
Goober5000 c4cf9edd41 Merge pull request #4983 from Goober5000/wing_formation_script_2
exposes wing formation via scripting
2022-12-08 13:32:15 -05:00
Goober5000 7f22137bc3 exposes wing formation via scripting
A rework of #4980, adding a wing formation type and a way to access them via `tb.WingFormations`.
2022-12-08 12:02:33 -05:00
Goober5000 fd77eba855 Merge pull request #4975 from Goober5000/sendMessage_enhancement
enhance sendMessage to allow messages sent from ships
2022-12-07 20:46:06 -05:00
MjnMixael e72e90b9cc Only set the colors for passive lightning (#4982) 2022-12-07 22:39:46 +00:00
MjnMixael 6d070c88b7 clean traitor.tbl parsing (#4949) 2022-12-07 17:29:05 -05:00
BMagnu 57f529e902 Fix edge case bugs with moveables in combination with special polymodels being animated (#4981) 2022-12-07 20:43:36 +00:00
MjnMixael a51b2750aa pre parse icons to get an accurate count (#4925)
* pre parse icons to get an accurate count

* static

* Some code clarity
2022-12-07 11:00:03 -05:00
MjnMixael fce04d5907 do correct math at parse (#4979) 2022-12-07 15:40:19 +00:00
wookieejedi 07a21a607a Mod Table Settings for Arc Widths (#4967)
* Mod Table Settings for Arc Widths

There is currently a way to set the color of EMP and Damage Arcs in game_settings.tbl, but no way to change the width.

This PR adds options useful to modders to set the width and how it is calculated. Looking over the code and asking around, I developed these exposed options.

The options also allow modders to control the arc widths in multiple ways. For example, if you want to set a constant width for all ships you would set the `+Do Not Use Width Multiplier Over Radius:` to something huge, and if you wanted no arcs ever you would set the `+Width Default:` to 0.

They are tested and work as expected.

* clang

* fix copy paste error from #2053

* tab cleanup

* whitespace cleanup 2

* same for type ship and damage
2022-12-07 07:24:05 -05:00
wookieejedi 3f21ba4d17 Expose decal options useful for modders (#4957)
* Fixes CTD with decals on dying ships

If a ship was getting shot with weapons that used decals, the decal code would hit an assertation, because the invalid decals were not being all removed.

This PR updates the decal cleanup loop, to ensure that no decals are missed and all invalid ones are removed. Tests confirm this fixes the issue.

Also cleaned up some comments and moved another assertation before setting of variables.

* Exposes modder useful options to decals

Now that decals are very stable, this PR exposes two options that are very useful for using decals, a random range for the radius along with the option to have a random rotation when the decal is created.

Tested and everything works as expected.

* add script ability to toggle decals

* properly use set arg not func

* fix two minor things in decal shader

* one more cleanup line

* fixes
2022-12-07 07:23:57 -05:00
Goober5000 0c49b09fd7 Merge pull request #4977 from Goober5000/set_formation
add changeable formation flying
2022-12-07 00:38:10 -05:00
Goober5000 e824caeea3 add changeable formation flying
Add a SEXP to change the formation and formation scale on-the-fly.
2022-12-06 23:16:54 -05:00
Goober5000 0211f44df9 Merge pull request #4973 from MjnMixael/fix_custom_data
Fix custom data when using tbms
2022-12-06 22:53:15 -05:00
Goober5000 823566244f Merge pull request #4953 from Baezon/fullneb-background-bgs
Add mission flag to show bg bitmaps despite fullneb
2022-12-06 22:52:51 -05:00
Goober5000 0e80428d48 Merge pull request #4946 from MjnMixael/per_weapon_autoaim
per weapon auto aim feature
2022-12-06 22:52:14 -05:00
Goober5000 ab3eb196b9 Merge pull request #4976 from Goober5000/fix_player_cheat_check
move player-is-cheating to the correct category
2022-12-06 22:06:08 -05:00
MjnMixael bc3da4fed7 custom colors for passive lightning (#4969)
* custom colors for passive lightning

* initialize member variables and apparently this can't be nullptr

* Small bugfix
2022-12-06 19:57:16 -05:00
Goober5000 ed06a424e2 move player-is-cheating to the correct category 2022-12-06 19:25:19 -05:00
Goober5000 bb3b3b7b13 Merge pull request #4974 from MjnMixael/remove_at_symbol
move @ removal up
2022-12-06 18:54:29 -05:00
Goober5000 affb402ee7 Merge pull request #4972 from Goober5000/mission_do_departure_cleanup
clean up mission_do_departure
2022-12-06 18:52:58 -05:00
Goober5000 7ac37d45c3 enhance sendMessage to allow messages sent from ships
Allow `mn.sendMessage` to send from a ship source, not only a string source, by allowing the ship object to be specified as the first argument.  Also add `ship:sendMessage` which is a more streamlined version of the same thing.
2022-12-06 16:40:00 -05:00
mjn-mixael b3b349a2f0 three lines for this short comment is silly 2022-12-06 12:50:35 -06:00
mjn-mixael 2988aa8fc8 move @ removal up 2022-12-06 12:43:33 -06:00
mjn-mixael 4d84e4c2a0 Make sure custom_data is properly cleared or carried over when shipclass info is reset or cloned/moved 2022-12-06 09:48:33 -06:00
Goober5000 d9dfceb279 clean up mission_do_departure
Since `mission_do_departure` can be called for multiple frames in a row, make sure that certain things run only once.
2022-12-05 22:00:51 -05:00
Goober5000 9dfb36962c Merge pull request #4971 from Goober5000/fix_cockpit_ctd
fix a crash when the Knossos explodes in A Flaming Sword
2022-12-05 21:45:26 -05:00
Goober5000 c634e64f27 fix a crash when the Knossos explodes in A Flaming Sword
The ship being accessed here is the viewer object, not the loop iterator.

Follow-up to #4936.
2022-12-05 19:56:48 -05:00
mjn-mixael 662d5f743a address feedback 2022-12-05 09:59:06 -06:00
BMagnu fb223c1dbe Properly init cockpit_model_instance to -1 (#4966) 2022-12-05 15:32:09 +00:00
BMagnu 5bb869953e Animate More Things (#4936)
* Add Cockpit AnimSet

* Add Skybox Animset

* Add cockpit model instanc

* Render ship cockpit with instance

* Finish scripting API

* Add moveables

* Fix Typo

* Fix moveable table value get

* Fix copy paste error

* Add Cockpit AnimSet

* Add Skybox Animset

* Add cockpit model instanc

* Render ship cockpit with instance

* Finish scripting API

* Add moveables

* Fix Typo

* Fix moveable table value get

* Fix copy paste error

* Add Animation Scripting Handle

* Add proper saving of skybox anim triggers

* Properly step non-obj animations

* Incorporate feedback

* Incorporate feedback

* Fix comparison
2022-12-05 10:00:29 +09:00
Goober5000 97614517a2 Merge pull request #4962 from Goober5000/set_weapon_protecc
add some additional weapon checks
2022-12-04 15:17:49 -05:00
Goober5000 0a29a74bc8 Merge pull request #4964 from Goober5000/squadron_wing_name_fix
fix wing name matching
2022-12-04 15:07:11 -05:00
MjnMixael 7c695eebd0 Allow setting glowpoint light intensity (#4955) 2022-12-05 04:56:06 +09:00
Goober5000 8f6e6e97f5 fix wing name matching
The logic designed to match Epsilon and Epsilon#clone would be tripped up by Pi and Pisces.  Tweak the string matching to handle this.

Fixes a bug reported on the forums: https://www.hard-light.net/forums/index.php?topic=98576.0
2022-12-04 14:06:56 -05:00
Goober5000 9c9ca3bcd6 remove unneeded function prototypes 2022-12-04 00:25:14 -05:00
MjnMixael bdea3d53c0 set-asteroid-field and set-debris-field sexps (#4860)
* set-asteroid-field sexp

* errors

* scope

* set-debris-field sexp

* Clarify sexp documentation

* num_debris_sizes

* styling

* decouple sexp parsing and asteroid field creation methods
2022-12-03 22:10:50 -05:00
Goober5000 360dcd4e1e add some additional weapon checks
Enhance set-primary-weapon and set-secondary-weapon to check the validity of the weapon bank and weapon type.
2022-12-03 20:34:15 -05:00
Goober5000 5a9136a5c2 clean up support ship mode in all cases
Whether a ship is a support ship or its target, and whether it is destroyed or vanished, its repair/rearm mode should be cleaned up in a consistent way.  This fixes a bug in Series Resurrecta where calling `ship-vanish` on a support ship put things into a broken state.
2022-12-03 20:06:32 -05:00
Goober5000 9fbcd71442 Merge pull request #4948 from Goober5000/isMouseButtonDownCount
add mouseButtonDownCount and flushMouse
2022-12-02 11:03:57 -05:00
Goober5000 7e337944f0 Merge pull request #4943 from EatThePath/better-dynsexp-error
Improved error message for missing sexp action
2022-12-01 21:25:24 -05:00
wookieejedi 31e55f4d12 Fixes CTD with decals on dying ships (#4956)
If a ship was getting shot with weapons that used decals, the decal code would hit an assertation, because the invalid decals were not being all removed.

This PR updates the decal cleanup loop, to ensure that no decals are missed and all invalid ones are removed. Tests confirm this fixes the issue.

Also cleaned up some comments and moved another assertation before setting of variables.
2022-12-01 14:18:46 -05:00
Goober5000 398cf2f8c3 add flushMouse 2022-11-30 23:36:14 -05:00
Goober5000 028ee9ec23 deprecate isMouseButtonDown and add mouseButtonDownCount
Implements #4429.
2022-11-30 22:04:48 -05:00
Goober5000 5b1f668e6f Merge pull request #4954 from Goober5000/patch_event_timestamps
fix event status evaluation for repeating events
2022-11-30 19:41:19 -05:00
Goober5000 08626aeecf fred2 support 2022-11-30 00:46:40 -05:00
Goober5000 42fba1c7f2 fix event status evaluation for repeating events
Two situations in the event timestamp life cycle, chain delays and event status delays, require accommodation for the timestamp-plus-interval case described in `mission_process_event()`.  Commit 06fc8c73 applied the fix for chain delays; this applies the same fix to event status delays.

Follow-up to #4633.  Fixes #4951.
2022-11-29 23:42:55 -05:00
Asteroth 3ed90e2b89 Add Fullneb_background_bitmaps mission flag 2022-11-29 23:00:39 -05:00
mjn-mixael 9e2aa0377f per weapon auto aim feature 2022-11-28 14:19:00 -06:00
Kiloku 4106176aab Cheat framework allowing for custom cheats, sexp for cheat used and On Cheat lua hook (#4387)
* Add SpawnShipCheat and convert Bravos spawning to it

* Clean-up and add canUseCheat() check

* Move some stuff to parent CustomCheat class

* Add cheat-used SEXP and On Cheat scripting hook

* Add cheat tbls and tbms, fix custom cheat detection, move cheat hooks to global hooks

* Add a default virtual destructor to CustomCheats for its derived classes to use

* Initialize buffers with memset so clang will calm down, also move cheat check a bit to keep old cheats

* Attempt to appease MSVC

* Clean-up and formatting

* Ensure custom cheats fit in the cheat code buffer

* Fix a merge mistake

* Move pre-set cheat to embedded cheats table

* Use appropriate types for stuff_string

* Remove unnecessary copying of the cheat buffer

* Explicit nullchecking

* Avoid copying values for initializing CustomCheat

* move cheat checking function to cheats_table.h, fix a typo

* Clarify OP_USED_CHEAT sexp description

* Remove unnecessary casting

* Use list initalization for Ship Cheats

* Move a few method definitions from the .h to .cpp

* Change buffer to const char*
2022-11-29 01:30:54 +09:00
Goober5000 ea93f29654 Merge pull request #4916 from Goober5000/fix_3849
guard against unknown variables
2022-11-27 22:50:34 -05:00
Goober5000 dbd1c027e8 Merge pull request #4944 from Goober5000/fix_fotg_ctd
fix crash on mission load
2022-11-27 17:10:49 -05:00
Goober5000 77fc5150c7 fix crash on mission load
Some subsystems will not have submodel instances, so make sure their velocities are not reset.  Fixes a crash in FotG.
2022-11-27 15:23:04 -05:00
Goober5000 027f109f9f Merge pull request #4929 from Goober5000/supplemental_autoscaling_fix
fix the rest of the autoscaled attributes
2022-11-27 14:37:22 -05:00
Goober5000 1b744a6ae1 Merge pull request #4932 from Goober5000/fix_event_dragging
make sexp_tree dragging more user-friendly
2022-11-27 14:37:07 -05:00
David Gibson 125e1e26bf Improved error message for missing sexp action 2022-11-27 13:28:50 -06:00
Taylor Richards 20dcdb2904 use case-insensitive comparison of cfile pathtypes (#4942)
fixes #4941
2022-11-27 13:37:32 -05:00
Taylor Richards 0be895d8bd add proper support of subfolders to lua listFiles (#4940)
Also updates function description to be more accurate and
document filter format for subfolder searches.

fixes #4939
2022-11-27 11:53:10 -05:00
BMagnu f76048b269 Enhance OnDialogX Hooks to encompass Death Popups (#4938)
* Add Scripting hooks to death popups

* Fix type

* cleanup
2022-11-27 19:01:50 +09:00
Goober5000 18150673c3 Merge pull request #4934 from Goober5000/ai_play_dead_fix
don't process turrets or subsystems when playing dead
2022-11-26 12:41:53 -05:00
BMagnu 5034855d4d Check if Texture is valid first (#4937) 2022-11-27 02:28:46 +09:00
Goober5000 1d5c802a9c handle speeds when removing play-dead 2022-11-25 12:20:45 -05:00
Goober5000 35380e8e24 don't process turrets or subsystems when playing dead
In the submodel reorganization in commit 575c050da4, subobject movement was moved out of the AI pipeline, which inadvertently removed the play-dead check that prevents subsystem movement.  This broke a few missions such as Scroll's 'Thor's Hammer'.  This PR restores the check.

Fixes #4933.
2022-11-25 11:35:13 -05:00
MjnMixael 649b513481 Modular bolts (#4880)
* better types and initialize objects with reasonable values

* modular -ltng.tbm

* fixes

* remove warning on no glow being defined

* do not error in FRED since the above code won't load the texture in FRED
2022-11-25 03:35:57 -05:00
Goober5000 cb7c760255 make sexp_tree dragging more user-friendly
FREDders expect events (and goals and campaign links) to land where you drag them.  So when dragging items earlier in the list, insert them before the item they are dropped on.
2022-11-24 20:55:18 -05:00
Goober5000 412cd8a993 Merge pull request #4931 from Goober5000/fix_warnings
fix two warnings
2022-11-24 16:43:33 -05:00
wookieejedi 1c45a18d9b Add Option to allow weapons that hit player to place per-weapon sound (#4921)
* Add Option to allow weapons that hit player to place per-weapon sound

Weapons that lasers or missiles that hit the player also play a hard coded sound, which is not ideal when trying to give valuable audio feedback to player.

This PR allows modders to stop the behavior and have the weapon class impact sound specified in the weapons table play instead of the hard coded sounds.

Tested and works as expected.

* add per class shockwave and weapon sounds

* naming update
2022-11-24 17:03:05 +00:00
MjnMixael 0af43628ad add set-order-allowed-for-target sexp (#4884) 2022-11-23 22:28:52 -05:00
Goober5000 8d8cdd9206 fix two warnings
`warning C4305: 'argument': truncation from 'double' to 'float'`
2022-11-23 22:25:51 -05:00
Goober5000 23a48ed9a8 Merge pull request #4927 from Goober5000/no_fred_weapons
add no_fred flag for weapons, and patch no_fred for ships
2022-11-23 21:43:28 -05:00
Goober5000 261e37d047 Merge pull request #4928 from Goober5000/options_tweaks
style tweaks for recently added options
2022-11-23 21:43:06 -05:00
BMagnu 67d0fb3dce Add 'Dont stop running sounds' (#4924) 2022-11-23 16:43:52 +09:00
Goober5000 c40764b65c add no_fred flag for weapons, and patch no_fred for ships
The new `no_fred` flag prevents weapons from being listed in the dropdown lists in the weapon dialog.  Also this fixes `no_fred` ships to not appear either: previously they were hidden in the main window dropdown but still appeared in the ship editor.

In order to vastly simplify the dropdown list code, the weapon dialog was refactored to use arrays of variables rather than one hardcoded variable per bank.

Implements #3643.
2022-11-22 21:30:25 -05:00
Goober5000 77be140a45 fix the rest of the autoscaled attributes
PR #4516 did not cover all of the autoscaled AI class attributes, since a few of them were labeled differently.  This adds checks to grab the correct autoscale index for the remaining cases:

```
$Afterburner Use Factor:
$Shockwave Evade Chances Per Second:
$Get Away Chance:
$Secondary Range Multiplier:
```

Fortunately, Sushi's investigation was pretty thorough.  Between these remaining cases and @EatThePath's autoscaling review, this PR should cover the complete set of autoscaling situations.

Fixes #4922.
2022-11-22 21:18:34 -05:00
Goober5000 89fb43b83d style tweaks for recently added options
1. Since Discord is both a common noun and a proper noun, capitalize it here to clarify what it refers to.
2. Capitalize the first letter of the Hotkey internal variable to follow the global variable convention.  And might as well clarify, while we're at it, that it hides hidden ships, not all ships.
2022-11-22 19:53:13 -05:00
Asteroth 13a08371cf fix an oversight from gravity changes (#4926) 2022-11-22 16:05:39 -05:00
Asteroth 732f1bdcbe Fix strange warp glow sizing (#4244)
* fix warp glow sizing

* whoops
2022-11-22 11:07:24 -05:00
EatThePath 8e560a0ba4 More old dead shader override code that isn't hooked to anything anymore. (#4861) 2022-11-22 11:06:51 -05:00
EatThePath 406c28d871 Add yaml file defining build options for vscode cmake tools users. (#4858) 2022-11-22 11:06:34 -05:00
Taylor Richards c9374ec6fb add text-to-speech support for macOS (#4914)
* add text-to-speech support for macOS

* only add Obj-C langs on mac

* move obj-c file to apple-specific block
2022-11-22 11:05:13 -05:00
Taylor Richards 072e1123d9 avoid playing voice messages with aux effects (EFX) (#4923) 2022-11-22 11:04:13 -05:00
Goober5000 e402af803b fix full ship list selection in FRED (#4919) 2022-11-21 20:15:44 -05:00
Asteroth 219bcca23a Implement gravity (#4803)
Adds gravity! Applies on a per-mission basis, and weapons, ships, debris, and asteroids now have a configurable "gravity const" which multiplies the effect of gravity on them, by default everything except debris is 0 (meaning no effect even when the mission has gravity). AI and the lead indicator will also lead for ballistic trajectories as well, given a gravity-affected weapon. No FRED support or gravity direction control yet, to come in later PRs.
2022-11-21 20:13:35 -05:00
Strygon 91eb48c5b8 Setting up Vampirism again... again (#4911)
* Setting up Vampirism again
2022-11-20 17:07:27 -05:00
MjnMixael d0fea8e14c option to always hide hidden hotkey ships (#4877) 2022-11-20 17:04:22 -05:00
John Fernandez d29ead20f6 optional feedback 2022-11-20 17:03:20 -05:00
John Fernandez 760a91376c Fix a warning
We shouldn't be checking that the `cci_h` is valid by seeing if it is greater than -1 because by that point it never will be.  Instead, we should be checking that the incoming id is valid and setting to the invalid state if it is not.
2022-11-20 17:03:20 -05:00
Goober5000 cf7919aef6 fix crash when changing ship classes in FRED (#4917)
PR #4908 had a small bug that caused a crash in FRED.  The code in question is only needed and only relevant when changing ship classes in-mission.
2022-11-20 21:56:43 +00:00
JohnAFernandez 2b6058d6f4 Adjust ssssssssssi in one more place (#4913)
* Fix crashes with sssi

We need to init in both places to avoid purging goals before ssi is set.

* Make sure we adjust for the wingp->special_ship--

Make sure we adjust sssi on ship death
2022-11-20 09:11:40 -05:00
Goober5000 7693138f56 also qtfred 2022-11-19 20:48:48 -05:00
Goober5000 d06e5ee627 guard against unknown variables
If a variable can't be found, fail gracefully instead of Asserting.  These changes will allow the mission to be saved and/or loaded, and will also allow the user to open the Event Editor and replace the nonexistent variable.  This fixes the crash/assertion failure in #3849, as well as the case where the variable is edited in the mission file.
2022-11-19 20:43:02 -05:00
Goober5000 5eddd06f44 Merge pull request #4915 from Goober5000/4878_followup
fix a copy+paste error
2022-11-19 20:23:59 -05:00
Goober5000 e62c148c53 fix a copy+paste error
This was accidentally introduced in #4878.
2022-11-19 18:54:39 -05:00
Goober5000 bfa498b378 Merge pull request #4898 from MjnMixael/force_sensor_static_sexp
hud-force-sensor-static sexp
2022-11-18 21:52:25 -05:00
Goober5000 ecb78479ce Merge pull request #4910 from MjnMixael/generate_script_name
allow getting message names in script generation
2022-11-18 21:51:55 -05:00
Goober5000 70b8a8e81e Merge pull request #4885 from Goober5000/fred_campaign_path
fix campaign loading in FRED
2022-11-18 21:49:57 -05:00
mjn-mixael 4e6ff9c355 allow getting message names in script generation 2022-11-18 11:06:34 -06:00
MjnMixael 2811e56d39 setup callsign and altname fields to use the full 31 characters allowed (#4905)
* setup callsign and altname fields to use the full 31 characters allowed

* no magic numbers
2022-11-18 10:06:09 -05:00
John Fernandez cd67d8ac6a Move the assertion.
This is just a much simpler and cleaner version of the same check.
2022-11-17 19:45:29 -05:00
MjnMixael 735b41631d ship flag to exempt it from targeting restrictions (#4878)
* ship flag to exempt it from nebula targeting restrictions

* Make this flag more generic

* address feedback
2022-11-17 07:38:37 -05:00
JohnAFernandezandGoober5000 203c5a04f6 Add special ship info index (#4908)
* Add special_ship_ship_info_index

* Change the wing's sssii if it's the wing leader

* Ignominious Lack of P

* Update code/ai/aigoals.cpp

Co-authored-by: Goober5000 <[email protected]>

* Update code/ai/aigoals.cpp

fix indentation

Co-authored-by: Goober5000 <[email protected]>
2022-11-17 05:46:13 +00:00
Goober5000 6918993994 Merge pull request #4907 from Goober5000/reanimate_textures
by default, start texture animation at the beginning of a mission
2022-11-16 23:46:53 -05:00
Goober5000 22782333c9 by default, start texture animation at the beginning of a mission
For all POFs that use animated textures, if no starting timestamp is specified, assume animation started at the beginning of the mission.  This fixes a bug reported in Starfox: Event Horizon where weapon POF animated textures stopped animating after the texture timestamp upgrade.
2022-11-16 22:50:04 -05:00
MjnMixael 727b3dc5c2 check nebula and poof bitmaps at parse time (#4895) 2022-11-16 10:47:00 -05:00
MjnMixael 76392de698 Fix overhead style (#4893)
* move initialization of overhead style

* Still need to init these colors for scpui
2022-11-16 07:37:58 -05:00
EatThePath d848adc1cf hook up cone light profile values (#4900) 2022-11-16 07:37:15 -05:00
wookieejedi 493158174a Fix Flashlights (#4902)
Area_normalisation term in deferred shader was not getting set properly for cone lights, which caused things like ship headlights to not work properly.

Tested and fixes issue as expected. Thanks to Qaz and EatThePath for pointing out how to fix it!
2022-11-16 07:36:48 -05:00
mjn-mixael 786b4b74f1 missed one 2022-11-15 21:29:04 -06:00
mjn-mixael 1f311adf13 hud init and better variable name 2022-11-15 20:20:20 -06:00
Goober5000 bd062d155e Merge pull request #4892 from MjnMixael/resize_fred_briefing
Increase default Briefing window size and allow custom setting
2022-11-15 20:53:15 -05:00
Goober5000 98a3c64cc8 fix campaign loading in FRED
Load campaigns using the full path provided by the user, not just from the configured mod paths.

Also tweaks initialization based on the campaign having already been cleared in `mission_campaign_clear()`.
2022-11-15 20:40:33 -05:00
JohnAFernandez 6255b9b154 Make sure that we check the correct instance (#4897) 2022-11-15 12:02:55 -05:00
mjn-mixael 2e42f9f215 hud-force-sensor-static sexp 2022-11-15 10:44:30 -06:00
Taylor Richards 3e57da1681 add support for subfolders to cfile (#4771)
* add subfolder support to cfile

* sort files in VP archives before indexing them

* fix indexing of sub-subfolders

* remove unused 8B22K & 16B11K sound path types

* add more items to skip subfolder scanning

* fix windows build issues

* fix unit tests by allowing 0-byte files to be indexed

* fix file indexing on windows

* add test for cfile subfolders

* remove specific 'markup' and 'css' interface subfolders

They aren't directly referenced anywhere by pathtype and the new
subfolder code will continue to index and load files from them

* add player binds to list of always-root locations

* remove file-based localization support

An alternative is left in place for old fonts, as that was the only place
it appeared to be used.

This method of file localization conflicts with subfolder support however
so if it's needed in the future then changes to the subfolder code will
be necessary.

* add subfolder support to cf_find_file_location_ext()

* add subfolder tests for cf_find_file_location*()

* add shlwapi to needed win32 libs

* small bit of cleanup

* add subfolder support to cf_get_file_list()

* add tests for cfile subfolder lists

* report files that might be shadowed

* fix issue with lists when a filter is used

Also fixes discrepancy in older cf_get_file_list() when a sub path
is specified (should be used in all cases, not just glob).

* address review suggestions
2022-11-15 08:00:13 -05:00
BMagnu f2f53b718d Actually assign enum value for constants (#4896) 2022-11-15 15:28:47 +09:00
Goober5000 dbf94acf02 Merge pull request #4881 from Goober5000/fred_swap_fix
fix swapping of things in FRED
2022-11-14 14:37:35 -05:00
JohnAFernandez 8712e69130 Merge pull request #4836 from JohnAFernandez/Fix-in-Game-Joining-Backup
Fix in game joining
2022-11-14 11:14:40 -05:00
JohnAFernandez 0d27a0f086 Enable client turrets to track targets (#4791)
* Enable clients to move turrets

This allows clients to user server data to move turrets according to the timing and target data on the server.  Uses a small packet to do so.
2022-11-14 15:58:41 +00:00
Goober5000 b9896ea611 Merge pull request #4890 from Goober5000/fix_wing_leader_check
fix wing leader check
2022-11-14 10:43:00 -05:00
John FernandezandTaylor Richards 11d571ed43 Fix a few other crash fixes that still existed
Co-Authored-By: Taylor Richards <[email protected]>
2022-11-14 10:30:28 -05:00
John FernandezandTaylor Richards 206ca742ab Further Fixes from Taylor
These fix up the in-game confirm packet and help sync client and server through a few timing fixes.

Co-Authored-By: Taylor Richards <[email protected]>
2022-11-14 10:30:28 -05:00
JohnAFernandezandBMagnu c89bc89cdc Use Lafiel's Fix
Fixes a check that object flags did not exceed ubyte size * 8.

Co-authored-by: BMagnu <[email protected]>
2022-11-14 10:30:28 -05:00
John Fernandez 4b26d38534 Fix mistake And Add lock clearing for multilock 2022-11-14 10:30:28 -05:00
John Fernandez bd79cc9a7a Buttress error reporting
fix
2022-11-14 10:30:28 -05:00
John FernandezandTaylor Richards 79c3571d2f Deny in-game Join for SW games
Because these are competitive games, we cannot allow in-game joining.

Co-Authored-By: Taylor Richards <[email protected]>
2022-11-14 10:30:28 -05:00
John Fernandez 2365174b55 Use tabs here 2022-11-14 10:30:28 -05:00
John Fernandezandwookieejedi 32b1e563bb Fix from Wookie for Joining more than once
Make sure that in game joiners adjust their time more than once.

Co-Authored-By: wookieejedi <[email protected]>
2022-11-14 10:30:28 -05:00
John Fernandez f8de460b75 Fix ships not moving
Revert "Fix ships not moving"

This reverts commit e989ad440009a20c1d0b1957ff0f10cc856d8fea.

Update multi_ingame.cpp
2022-11-14 10:30:28 -05:00
John Fernandez ba665bfc9d Attempt to adjust timing for in-game joiners
This allows in game joiners to avoid interpolation and physics bugs by using the first incoming timing from the server as its local missiontime.
2022-11-14 10:30:28 -05:00
JohnAFernandez 4e8203a066 Patch in-game joining crashes
Patches multiple things about in-game joining to allow it to be enabled by default.
2022-11-14 10:30:27 -05:00
BMagnu bd2c50aa1d Refactor Lua Enums (#4867)
* Refactor bitfield enums

* Add default case for lua switch

* Add default case for more lua switches

* Fix Warnings

* constexpr
2022-11-14 17:31:50 +09:00
JohnAFernandezandTaylor Richards d50a599934 Taylor's in-game fixes
Co-Authored-By: Taylor Richards <[email protected]>
2022-11-13 20:32:42 -05:00
Goober5000 9d898cb585 Merge pull request #4891 from Goober5000/cannot_perform_scan_flag
add cannot-perform-scan flag
2022-11-13 18:41:59 -05:00
Goober5000 b6d3065876 Merge pull request #4888 from Goober5000/fix_animated_textures
use correct math for animated textures
2022-11-13 16:14:01 -05:00
Goober5000 b2f5ea9065 Merge pull request #4764 from MjnMixael/3d_select_settings
3d select settings
2022-11-13 16:13:17 -05:00
mjn-mixael 495872e8fa ordering 2022-11-13 15:08:39 -06:00
MjnMixael 760cc543b7 replace keybinds in debriefing (#4876) 2022-11-13 16:05:14 -05:00
mjn-mixael abec56ee05 use a single variable array 2022-11-13 14:46:53 -06:00
mjn-mixael bab0752af2 increase default window size and allow custom setting 2022-11-13 10:31:16 -06:00
Goober5000 320ebd4762 add cannot-perform-scan flag
Prevents the player from performing a cargo or subsystem scan.  Can be toggled using alter-ship-flag.
2022-11-13 00:37:56 -05:00
Goober5000 48cd9b2989 fix wing leader check
The `special ship` field stores the index in the wing's `ship_index` array.  It does not store the shipnum itself.
2022-11-12 18:43:41 -05:00
Goober5000 e22112e0a9 use correct math for animated textures
Fixes #4887.  Follow-up to #4704.
2022-11-12 14:11:11 -05:00
Asteroth e85fabf671 bugfix arg order (#4882) 2022-11-11 23:06:42 -05:00
Goober5000 51f50132d2 Merge pull request #4886 from MageKing17/bugfix/make-sound-environment-sexp-errors-recoverable
Make sound environment SEXP errors recoverable.
2022-11-11 23:00:21 -05:00
MageKing17 6ef8028794 Make sound environment SEXP errors recoverable.
Adds `SEXP_CHECK_INVALID_SOUND_ENVIRONMENT` and `SEXP_CHECK_INVALID_SOUND_ENVIRONMENT_OPTION` to `sexp_recoverable_error()`. Neither causes a fatal problem, and the former can be spuriously triggered if EFX is disabled.
2022-11-11 16:40:01 -08:00
MjnMixael b5328a81c2 increase object limits (#4849) 2022-11-11 12:54:54 -05:00
EatThePath 63a0c9bdb9 Merge pull request #4883 from Goober5000/ai_profiles_bump
bump MAX_AI_PROFILES
2022-11-11 11:03:29 -06:00
Goober5000 2b3c533d09 bump MAX_AI_PROFILES
Previous limit lasted from 2005-11-21 until now (from commit b33caf6f45).  We'll see how long this one lasts.
2022-11-11 00:41:14 -05:00
Goober5000 351aed432f Merge pull request #4866 from Goober5000/formation_enhancements
add wing formation align button
2022-11-10 22:13:28 -05:00
MjnMixael 3367b5739f Fix poof name parsing and fix lab not knowing about the new parsing (#4879)
* Fix poof name parsing and fix lab not knowing about the new parsing

* address feedback
2022-11-10 21:40:26 -05:00
Goober5000 bd50aadf5c fix swapping of things in FRED
This properly updates event and goal signatures when events are moved around.  Fixes Mantis bugs 1005, 1961, and 2998.
2022-11-10 15:47:20 -05:00
mjn-mixael 3e87c3f54e not needed 2022-11-09 10:12:31 -06:00
mjn-mixael 35e6bc9df0 setup overhead style as a type enum 2022-11-09 09:16:57 -06:00
Goober5000 8ddbad645b Merge pull request #4874 from Goober5000/fix_path_masks
use correct path masks for parse objects
2022-11-08 23:48:00 -05:00
Goober5000 1736c9b230 use correct path masks for parse objects
Parse objects have their path masks temporarily set to -1 during parsing, since at that point the mask represents an index, not a bitfield.  In all other cases, the path mask defaults to 0.

Fixes #4873.
2022-11-08 23:14:10 -05:00
Goober5000 0b2dc58d5a add formation scale 2022-11-08 22:52:38 -05:00
Goober5000 94358c20e9 add wing formation align button
This button allows wings to be arranged in their formation so that they don't scramble around when they arrive.
2022-11-08 22:48:31 -05:00
Goober5000 2fba619a67 Merge pull request #4865 from Goober5000/clean_up_old_fields
clean up some obsolete fields
2022-11-08 22:37:53 -05:00
Goober5000 2984f21999 Merge pull request #4872 from Goober5000/init_ship_for_lab
fix lab CTD
2022-11-08 17:26:45 -05:00
Goober5000 f823a8dc62 fix lab CTD 2022-11-08 15:19:09 -05:00
MjnMixael 415924bbbd Fix num comparison for FS2 medals (#4869)
* Fix num comparison for FS2 medals

* works better if you get the proper position
2022-11-08 14:42:22 -05:00
Goober5000 e8fdfa5513 clean up some obsolete fields
Remove `behavior`, `type`, and `wing`, which are either unused or redundant.
2022-11-07 22:43:50 -05:00
Goober5000 0721792b93 Merge pull request #4856 from Goober5000/clear_mission_refactor
refactor mission initialization
2022-11-07 21:46:56 -05:00
Goober5000 5ab63a8ec9 use the clear-wing function when creating a wing in fred 2022-11-07 20:41:54 -05:00
Goober5000 21751a8a58 Merge pull request #4863 from Goober5000/lua_is_docked
add numDocked and isDocked
2022-11-07 20:29:26 -05:00
Goober5000 d43be3eba4 Merge pull request #4868 from Goober5000/decal_parse_fix
fix decal debug warnings in FRED
2022-11-07 14:23:03 -05:00
Goober5000 e64d6a062e fix decal debug warnings in FRED
Prevent warnings from being displayed due to decals not being loaded.
2022-11-07 11:19:00 -05:00
EatThePath f3601d8178 Merge pull request #4826 from MjnMixael/optional_discord_presence
Optional discord presence
2022-11-07 08:59:30 -06:00
MjnMixael 1ba0b8dcbe Modular medals (#4851)
* Modular medals table

* Remove Num_medals completely

* Handle badges out of order and allow setting of masks to handle mask indecies out of order

* const const const

* qtFRED

* address feedback
2022-11-07 22:53:28 +09:00
MjnMixael 26269e10bf toggle-asteroid-field sexp (#4857) 2022-11-07 22:52:52 +09:00
MjnMixael 6e1b194c38 Modular iff table (#4845)
* split up init, parsing, and data resolution

* modular iff table

* address feedback
2022-11-07 22:52:44 +09:00
Goober5000 7c26c19671 add numDocked and isDocked
Two useful script functions.
2022-11-06 16:19:45 -05:00
Goober5000 4ace4f6d5a nebula fix 2022-11-06 11:27:18 -05:00
Goober5000 1ec38ff71a parse object stuff 2022-11-06 11:27:18 -05:00
Goober5000 b48d2faa80 wing stuff 2022-11-06 11:27:18 -05:00
Goober5000 00acefea86 some fixes 2022-11-06 11:27:18 -05:00
Goober5000 cce4be4bfb refactor mission initialization
Gather all the mission initialization code into a common function for clarity and ease of expansion.  Previously, the various parsing routines contained initialization as well as parsing.  As a bonus, quite a few redundant initializations are streamlined.
2022-11-06 11:27:18 -05:00
Goober5000 f873a6fc99 Merge pull request #4862 from Goober5000/check_sexp_syntax_fix
improve SEXP syntax checking
2022-11-06 11:25:39 -05:00
Asteroth 2777e45a95 Add isMultipart and getModelFlag functions on subsystems (#4846)
* add `getModelFlag` function

* add ismultipartturret function

* fix

* fix link
2022-11-06 23:59:54 +09:00
Asteroth 924013b521 add burst shots and delay to scripts (#4847) 2022-11-06 23:59:34 +09:00
Goober5000 b44f9f6125 improve SEXP syntax checking
When the top-level operator of a SEXP is not found, flag the error instead of crashing.  This is helpful for missions that contain unsupported scripted SEXPs.

Also be sure to set the bad node in the event of a NONOP_ARGS syntax error.
2022-11-06 05:09:40 -05:00
EatThePath aef869aa2a Merge pull request #4859 from EatThePath/fix-loadout-flicker
always set the default gloss uniform since it is now always used
2022-11-05 14:07:05 -05:00
Asteroth 18d3c01576 Allow overriding gvec in fireWeapon on subsystems (#4852)
* allow for overriding of gvec

* update docs

* fix docs
2022-11-05 14:13:01 -04:00
David Gibson 830fed0bdc always set the default gloss uniform since it is now always used. Fixes flickering issue 2022-11-05 11:16:51 -05:00
MjnMixael bff3d433e2 properly get badge name (#4853) 2022-11-05 10:01:44 -04:00
Asteroth f5fe1c5d65 small fix for turret fire pos in beam-fire (#4848) 2022-11-04 19:16:40 -04:00
EatThePath e371032e5e Merge pull request #4850 from qazwsxal/shader_geom_fix
Minor lighting shader fixes
2022-11-03 22:58:01 -05:00
JohnAFernandez 595d63c001 Merge pull request #4841 from JohnAFernandez/Add-check-to-Escort-list-in-multi
Make sure that the escort list only lists valid targets on multi
2022-11-03 12:24:43 -04:00
EatThePath 06fc2c81f9 Shader/Material cleanup pass (#4838)
* Ripping out the gloss override code because it's vestigial

* Remove redundant teammask declaration.

* The NORMAL_ALPHA shader feature appears both useless and unusable.
Consequently, I'm removing it.
2022-11-02 17:19:54 -04:00
Adam Leach 8ec89751bb Use the correct k value for geometry term. Actually use area_norm 2022-11-02 16:32:54 +00:00
BMagnu d85c1431a4 libRocket Texture Passthrough (#4822)
* Properly handle lua texture refcounting

* Add linkTexture ui method

* Incorporate feedback
2022-11-02 18:25:22 +09:00
MjnMixael bd151095b3 implement modular nebula.tbl (#4834)
* implement modular nebula.tbl

* Address feedback and skip > 32 poofs

* read/write nebula poofs by name

* qtfred changes

* variable name

* log -> warning

* nullptr and make sure to only set bitmap_name when it's actually defined
2022-11-02 18:25:13 +09:00
Goober5000 7e8e28e6e8 Merge pull request #4844 from Goober5000/timestamp_compare_fix
fix timestamp_in_between functions
2022-11-01 14:33:58 -04:00
MjnMixael e6ef239ae6 Modular tips (#4843)
* vectorize tips

* make tips.tbl extendable with -tip.tbm
2022-11-01 21:46:22 +09:00
Goober5000 5f54188e5b add a few scripting dock functions (#4839)
* add a few scripting dock functions

Add setDocked, setUndocked, and jettison.

* address feedback
2022-11-01 21:45:49 +09:00
Asteroth a29378d245 Clearable Ship/Subsystem Targets via script (#4842)
* make sure Targets can be cleared with `nil`

* move `set_targeted_subsys` calls
2022-11-01 21:43:26 +09:00
MjnMixael 346817f3d0 Further limit what built-in UI elements can be setup when using SCPUI (#4824)
* Further limit what built-in UI elements can be setup when using SCPUI

* remove superfluous declaration
2022-11-01 21:43:14 +09:00
MjnMixael f0ecf8c2aa allow borrowing flyby sounds from a previously parsed species (#4828) 2022-11-01 21:43:01 +09:00
Goober5000 a86074e3cd fix timestamp_in_between functions
Fix the comparison and add documentation to the compare functions.
2022-11-01 01:10:59 -04:00
MjnMixael 0b9f0f25c9 Dont add whitespace for no_fred ships in the main list (#4833)
* Dont add whitespace for no_fred ships in the main list

* whitespace and better variable name

* fix comparisons
2022-10-31 18:45:21 +09:00
Asteroth 7d800e48ae Add $On Camera Set Up hook (#4832)
* add on camera set up hook

* typo
2022-10-31 03:28:48 -04:00
John Fernandez a00a7a7f26 Make sure that the escort list
Only lists valid targets on multi
2022-10-30 20:52:30 -04:00
Goober5000 874e22b8e1 Merge pull request #4831 from Goober5000/new_autoscale
take non-autoscaling AI classes into account when autoscaling
2022-10-30 00:05:34 -04:00
JohnAFernandez 18c1abb14f Merge pull request #4825 from MjnMixael/full_int3_fix
remove misplaced int3() and allow the game to continue with -1
2022-10-29 16:30:27 -04:00
JohnAFernandez 6cd217589b Merge pull request #4490 from JohnAFernandez/fix-traitors-multilocking-each-other
Allow multilock between traitors
2022-10-29 16:16:08 -04:00
Goober5000 0e477367ef Merge pull request #4827 from Goober5000/asteroid_target_init
asteroid field fix/refactor
2022-10-27 19:54:20 -04:00
BMagnu 8a3a99ccbd UI Popup Scripting Hook (#4806)
* Add Popup Init Hook

* Finish popup hooks

* Fix warnings

* Fix fallthrough

* feedback
2022-10-27 16:23:23 +09:00
MjnMixael 291f4f68ea Allow adding custom head anis to the list in FRED (#4818) 2022-10-27 16:22:49 +09:00
EatThePath 7a9a33d16c These old vars did something once, but not anymore (#4823) 2022-10-27 16:22:36 +09:00
Goober5000 1b0dd83c27 type safety 2022-10-26 21:07:44 -04:00
Goober5000 b42831b981 take non-autoscaling AI classes into account when autoscaling
This adds an AI profiles flag that filters autoscaling so that only the index and number of autoscaled classes are considered, not the index and number of all AI classes.

Fixes #4516.
2022-10-26 21:02:59 -04:00
Goober5000 e8bbb97f96 add clarifying comment 2022-10-26 20:42:03 -04:00
Goober5000 0a9032fc03 asteroid field fix/refactor
Some refactoring with asteroid fields:
1. Moves asteroid throwing targets into the Asteroid_field struct, in anticipation of potentially multiple fields in the future
2. Moves some initialization code into `asteroid_level_init`
3. Calls `asteroid_level_init` when a mission is cleared
4. Loads asteroid targets as part of the asteroid field update/init logic.  This fixes a FRED bug reported in Discord where asteroid targets stay in the dialog when a new mission is loaded
5. Remove `Default_asteroid_throwing_behavior` flag as it is equivalent to checking that the target list is empty
2022-10-26 19:16:08 -04:00
mjn-mixael 8bc5723d43 create mod.tbl and built-in option to enable or disable discord presence 2022-10-26 14:13:53 -05:00
mjn-mixael 37022fa5c2 Setup discord presence to be able to be toggled 2022-10-26 14:12:58 -05:00
mjn-mixael f4f223908c remove misplaced int3() and allow the game to continue with a value of -1 2022-10-26 10:13:48 -05:00
Goober5000 f07c4481ff Merge pull request #4820 from Goober5000/lua_type_check_cleanup
clean up stack when checking type
2022-10-25 09:43:34 -04:00
Goober5000 e6b9ff7361 Merge pull request #4704 from Goober5000/texture_timestamp
upgrade texture animation code to use new timestamps
2022-10-24 23:49:42 -04:00
MjnMixael b3c900803e translate key tokens in tips (#4808) 2022-10-24 16:51:08 -04:00
Goober5000 fdbdcec2b1 clean up stack when checking type
The `ade_odata_is_userdata_type` function didn't clean up its stack properly, as it left type information there for error reporting.  But there are other reasons to check userdata types besides error reporting, so this adds a flag to clean up in most situations.

Fix courtesy of @BMagnu.
2022-10-24 11:09:52 -04:00
MjnMixael 9d122616dd Update credits (#4799)
* add self and naomi to SCP credits

* Add EatThePath, Kiloku, and Lafiel as well
2022-10-24 10:36:32 -04:00
EatThePath f8e99e6012 Actually dynamically populate the empty debug filter files (#4817)
* Actually dynamically populate the default debug filters properly for empty files, rather than just enable everything.

* whitespace shuffle
2022-10-24 18:37:11 +09:00
BMagnu 2116d1fe66 Modular POF Features (#4713)
* Add turret copying

* Ad addturret parsing

* Fix gun_nr error

* Fix strncpy_s

* Fix strings better

* Cleanup submodel / turret copying

* Add 'Add Engine'

* Add Glowpoints, add Special Subsys

* Remember to keep the glowpoint texture

* Fix unused param
2022-10-24 18:35:51 +09:00
Goober5000 1cc027666e Merge pull request #4814 from Goober5000/fix_debris_crash
handle debris model instances correctly when shadows are enabled
2022-10-23 15:04:17 -04:00
Goober5000 fde3589d1d handle debris model instances correctly when shadows are enabled
Fixes #4813.
2022-10-23 14:13:08 -04:00
BMagnu 2080824a20 Can has high rez plz k thx bye (#4805) 2022-10-22 18:47:58 +09:00
Goober5000 11b37bbeae Merge pull request #4787 from Goober5000/createdebris
create debris using script functions
2022-10-21 23:24:47 -04:00
Goober5000 41074956a8 more fixes 2022-10-21 12:01:25 -04:00
MjnMixael c63ce5de8c Allow writing to player mission specific stats (#4801)
* Allow writing to player mission specific stats

* Documentation

* return false
2022-10-21 20:25:35 +09:00
MjnMixael 17e42e92cf cockpitinactive gauges should render in chase view (#4804)
* cockpitinactive gauges should render in chase view

* Simplify
2022-10-21 20:25:24 +09:00
Goober5000 debedf26ef partial fix 2022-10-20 23:32:30 -04:00
MjnMixael 90c4316a5e Update scpui documentation (#4802)
* Update documentation

* Typo
2022-10-20 19:13:03 +09:00
Goober5000 9782f191b9 Merge pull request #4789 from Goober5000/timestamps_3
music and training message timestamp conversion
2022-10-19 20:02:47 -04:00
Goober5000 49fb2f07c0 refactor per feedback, tweak to fix circular #include, use accessor, reorder, fix namespaces, fix API documentation 2022-10-19 14:44:57 -04:00
Goober5000 f24277c39e make clang happy 2022-10-19 14:22:10 -04:00
Goober5000 452c8370dc model instances are not needed for debris in many cases 2022-10-19 14:22:10 -04:00
Goober5000 77179dc183 add mn.createDebris
This is a new Lua API function that allows creation of arbitrary debris pieces, whether chunks of a ship's hull or shards of shrapnel.  All of the parameters are optional, and a wide variety of situations are possible ranging from vaporized bits to static chunks to chunks propelled by an explosion.
2022-10-19 14:22:10 -04:00
Goober5000 d37a446894 music and training message timestamp conversion 2022-10-19 14:11:23 -04:00
MjnMixael 7a5b840338 Allow setting an override wireframe color globally and add option to set target monitor style and wireframe color per gauge (#4786) 2022-10-19 21:51:35 +09:00
MjnMixael 50cd91bd86 Damage, swarm, corkscrew info virtvars (#4798)
* Add access to damage type, swarm, and corkscrew data

* Also return if the weapons have the appropriate flags

* Return nil for invalid handle and clarify documentation
2022-10-19 21:51:22 +09:00
MjnMixael 00c8b946a4 Modular species table (#4775)
* Add modular ability to add intel entries

* Allow for +nocreate in modular tables

* Allow intel.tbl as an alias of species.tbl

* Additional error checking and remove tests that are no longer required

* const
2022-10-19 21:51:15 +09:00
Asteroth 4c6f043274 Add a bunch of movement stats to ship class script api (#4797)
* add a bunch of script physics values

* fix

* small doc fix (its just called "damp" barely worth mentioning)
2022-10-18 20:54:30 -04:00
MjnMixael 307c770c58 Enable hud rearm timer in hud_gauges.tbl (#4777)
* Enable hud rearm timer in hud_gauges.tbl

* Comment
2022-10-18 22:21:51 +09:00
JohnAFernandez bd0e6bb990 Add an update interval for client update packets (#4796) 2022-10-18 21:54:16 +09:00
MjnMixael 0a6729b03d enable target info in hud_gauges.tbl (#4778)
* enable target info in hud_gauges.tbl

* Comment
2022-10-18 17:08:44 +09:00
Fabian Woltermann 9e56ba43a5 Merge pull request #4783 from MjnMixael/render_no_lighting
Allow option to choose to render with no lighting
2022-10-17 19:30:40 +02:00
Fabian Woltermann f76e110c87 Merge pull request #4795 from The-E/fix/4794_bump_max_instance_depth
Bump the MAX_INSTANCE_DEPTH constant to 32
2022-10-17 19:30:08 +02:00
Fabian Woltermann a8328a8ee7 bumps the MAX_INSTANCE_DEPTH constant to 32.
This bump should be sufficient to cover complex animation states. This fixes #4794
2022-10-17 18:59:51 +02:00
mjn-mixael 6464900fa1 Fully deprecate -ship_choice_3d and -weapon_choice_3d 2022-10-17 09:58:48 -05:00
mjn-mixael 64bd233c49 API to access the new 3d select settings in game_settings.tbl 2022-10-17 09:58:15 -05:00
mjn-mixael 2d4d886a6a Add Game Settings options for 3d ship and weapon select 2022-10-17 09:58:15 -05:00
mjn-mixael 32b059ae07 fix documentation 2022-10-17 08:09:26 -05:00
mjn-mixael 1af0a1082b int to bool 2022-10-17 08:04:02 -05:00
Goober5000 f34294cf95 Merge pull request #4788 from Goober5000/force_arrival_for_reinforcements
fix makeShipArrive and makeWingArrive for reinforcements
2022-10-17 01:16:56 -04:00
wookieejedi 5d60e56614 Update $POF file Techroom: Usage (#4785)
* Update `$POF file Techroom:` Usage

Currently `$POF file Techroom:` is only used in the weapons loadout screen (despite having techroom in the name). This PR expands the use of the `$POF file Techroom:` to shiploadout select and the actual techroom.

If it is desired I can put it behind a game settings flag, but IMO it would make the most sense for modders to have this just work as the actual name implies.

* clean up code with feedback

* typo fix in comment
2022-10-15 21:12:19 -04:00
wookieejedi 4d581e92e8 1 Line fix for player view render check (#4790)
Fix for recent updates to cockpit rendering check, which was false if the player was the only ship in a mission. `instance >0` was used but it is supposed to be `instance >= 0` (The object index is valid if larger or equal to 0, while the signature is only valid equal or larger to 1.) Tested and fix works as expected.
2022-10-15 21:59:14 +00:00
Goober5000 3d515ddfb7 upgrade texture animation code to use new timestamps
Timestamp changes for texture animation, both on ships and on the skybox.
2022-10-15 12:24:05 -04:00
Goober5000 9161601cac Merge pull request #4780 from Goober5000/alter_ship_flag_listing
prevent duplicate flag names in the alter-ship-flag list
2022-10-15 11:53:29 -04:00
MjnMixael 09a307b17d Virtvar to access the energy a weapon consumes (#4784)
* Virtvar to access the energy a weapon consumes

* quick fix
2022-10-15 09:54:44 -04:00
Goober5000 848d133fe3 Merge pull request #4767 from Goober5000/enhanced_print
enhance ba.print and add ba.println
2022-10-14 21:40:11 -04:00
Goober5000 8f8a6ca527 warning tweak 2022-10-14 21:08:47 -04:00
Goober5000 a2af63726e fix makeShipArrive and makeWingArrive for reinforcements
The script functions should make the ships/wings arrive even if they are reinforcement, so this PR fixes that.  Also, this PR adds some additional verification of the `num_uses` of reinforcements, especially when the player calls for a wing that is already present but has more uses remaining.
2022-10-14 20:44:39 -04:00
JohnAFernandez 8ea13a2b49 Merge pull request #4773 from MjnMixael/fix_target_team_colors
apply team colors to all target view styles
2022-10-14 15:25:23 -04:00
Goober5000 b67ae48590 Merge pull request #4782 from Goober5000/submodel_indexer_fix
model.Submodels fix
2022-10-14 14:04:12 -04:00
MjnMixael 3dcfa99c4a add warp flash to ingame options (#4776) 2022-10-14 10:04:59 -04:00
mjn-mixael 7a5a54d009 Allow option to choose to render with no lighting 2022-10-14 09:00:35 -05:00
Goober5000 da7228cedb model.Submodels fix
Guard against the indexer being invalid, e.g. if the model isn't loaded yet.
2022-10-14 02:07:35 -04:00
Goober5000 aa7a57ef4e Merge pull request #4781 from Goober5000/collision_fix
collision fix
2022-10-14 01:01:09 -04:00
Goober5000 c300278328 collision fix
Fix a typo in `collide_ship_ship`.  Also tweak some lines for clarity.
2022-10-14 00:28:44 -04:00
Goober5000 8b3dccce1c prevent duplicate flag names in the alter-ship-flag list 2022-10-13 15:35:50 -04:00
MjnMixael d323421817 Use a local int for model storage in renderTechModel (#4779)
* Use a local int for model storage here

* null -> nullptr
2022-10-13 17:06:03 +00:00
MjnMixael 7ab80a0162 Toggle cockpit (#4772)
* proof of concept

* Account for shadows

* Option to tie individual HUD gauges to the cockpit option

* Do this in a more user-friendly way

* Address feedback
2022-10-13 19:42:00 +09:00
Goober5000 d1b16d5269 Merge pull request #4762 from Goober5000/flag_list_cleanup
remove obsolete field
2022-10-13 02:02:08 -04:00
Goober5000 446b50cbaf Merge pull request #4774 from Goober5000/fix_ui_timestamp_check
fix updating of ui_timestamps
2022-10-11 20:02:22 -04:00
Goober5000 187cd35e74 add additional comments 2022-10-11 19:28:02 -04:00
Goober5000 e95d214143 Merge pull request #4756 from Goober5000/ship_entry_and_related
Add Lua API for ship registry
2022-10-11 19:24:54 -04:00
MjnMixael 6ae8674615 Correctly set credits default even for scpui access (#4768)
* Correctly set credits default even for scpui access

* These also need to move up for the same reason

* Match retail functionality
2022-10-11 16:47:10 +09:00
Goober5000 7c01485d2d fix updating of ui_timestamps
Since the debug pause check needs to use UI timestamps, and since UI timestamps must keep track of time regardless of time compression, pausing, or mission status, move the updating and checking to `game_do_state_common`.

Also fix a type conversion warning.
2022-10-11 01:06:33 -04:00
Goober5000 3850acdd23 documentation updates 2022-10-10 22:45:14 -04:00
mjn-mixael e3424b4350 apply team colors to all target view styles 2022-10-10 12:56:04 -05:00
Goober5000 f10e35e8dd Merge pull request #4769 from Goober5000/credits_get_music
get the credits music without starting it
2022-10-10 09:43:24 -04:00
MjnMixael bc6282b34b These were reversed (#4770) 2022-10-10 17:48:47 +09:00
Goober5000 d8ad8ebc77 get the credits music without starting it
Starting the music should happen in `credits_init`, not whenever someone needs to know the file name.
2022-10-09 15:41:54 -04:00
Goober5000 ab83a94eb4 remove obsolete field
The `flag_list` field is left over from before the type-safe refactor.  It was used to specify either the `flags` or `flags2` bitfield.
2022-10-07 13:24:52 -04:00
Goober5000 663474516f Merge pull request #4752 from Goober5000/arrival_departure_info
add arrival and departure info for wings, ships, and parse objects
2022-10-07 12:26:59 -04:00
wookieejedi 0dfed6de4b Add maximum self repair percentages for health and subsystems (#4761)
* Add maximum self repair percentages for health and subsystems

Adds two new options to help with the automatic self repairs for hull and subsystems: `$Hull Self Repair Maximum:` and `$Subsystem Self Repair Maximum:`. These values allow mods to specify how much a ship's hull or subsystem can self repair to, which is very useful to have some auto repair but not enough to make the hull or subsystem 100%.

Also cleans up the `ship_auto_repair_frame` function with removing un-used define values, improving comments, and making formatting consistent. Also updates the parse sections of repair rate for hull and subsystems to print to the log if values are being clamped.

Probably easiest to review with hiding whitespace changes.

* update local names to be easier matches to surrounding code

* incorporate feedback

Add back in define, fix == 0 checks, and fix edge case logic bugs
2022-10-07 12:05:23 -04:00
Goober5000 d73ac59383 enhance ba.print and add ba.println
There was code that could interpret any Lua type as an argument for printing, so I adapted it to be used in ba.print(), ba.warning(), and ba.error().  Also ba.println() seemed like a useful thing to add.
2022-10-06 22:52:58 -04:00
Goober5000 a47b2440d3 add ship registry 2022-10-06 20:43:09 -04:00
Goober5000 7d6f261221 add getWing() to parse_object 2022-10-06 20:43:09 -04:00
Goober5000 473521f5ed Merge pull request #4759 from Goober5000/wing_flags
add wing flags
2022-10-06 18:58:00 -04:00
Goober5000 f1f234b89d Merge pull request #4702 from EatThePath/debug-log-cleanup
Moved more things to debug filters, and associated cleanup
2022-10-06 16:57:27 -04:00
MjnMixael 00d067be47 Fix one missed resize mode (#4765) 2022-10-06 15:53:30 -04:00
David Gibson 2ba9a03d9a Restored submodel detail level message 2022-10-05 20:37:33 -05:00
Goober5000 14929db6fe address feedback and add sexps 2022-10-05 18:00:16 -04:00
Goober5000 6ce8963e13 Merge pull request #4757 from Goober5000/animated_effects_to_timestamp
make animated ship effects use the new timestamps
2022-10-05 16:39:08 -04:00
Goober5000 364741ef8f additional flag error checking 2022-10-05 11:40:54 -04:00
BMagnu 209cb7cba8 Enable PNG blobs in LibRocket (#4754)
* Allow reading PNGs from b64, including in librocket

* fix memleak

* tidyup

* fix bad delete

* Force flush on png write

* Pass more image size
2022-10-05 16:57:09 +09:00
Goober5000 02aed5fde4 Merge pull request #4760 from Goober5000/removeSoundByIndex_fix
removeSoundByIndex should be 1-based
2022-10-05 00:12:31 -04:00
Goober5000 8694c042f7 add wing flags
Add setFlag and getFlag for wings, just like for ships and parse objects
2022-10-04 23:59:30 -04:00
Goober5000 3f86fbc7ad removeSoundByIndex should be 1-based
Looks like no mods use this script method, so this change should be safe.
2022-10-04 23:40:10 -04:00
Goober5000 fded868f8c Merge pull request #4758 from Goober5000/4751_followup
fix a last-minute error check
2022-10-04 23:25:26 -04:00
Taylor Richards f1a7a98639 fix and clean up cf_create_default_path_string(): (#4747)
- consolidate old and new functions
 - add missing location flags override from earlier fix
 - add proper error handling where needed
2022-10-04 23:18:28 -04:00
Goober5000 ec8354957d fix a last-minute error check 2022-10-04 22:49:44 -04:00
Goober5000 afeca7cc8f add the same for ships and parse objects 2022-10-04 21:45:56 -04:00
Goober5000 f0542553d6 make animated ship effects use the new timestamps
In addition to type-safety, this now adjusts ship effects properly for time compression and pausing.
2022-10-04 21:42:47 -04:00
Goober5000 cfefaef385 add arrival and departure info for wings
Virtual variables corresponding to the same fields as in `set-arrival-info` and `set-departure-info`.  Plus more variables.  Some refactoring as well.
2022-10-04 20:59:52 -04:00
Goober5000 90638ce534 Merge pull request #4751 from Goober5000/ship_arrival_script_functions
Ship/Wing arrival script functions
2022-10-04 20:56:30 -04:00
MjnMixael 36b0fa046b Move rendering of the 3d overhead to it's own method and create an api (#4749)
* Move rendering of the overhead model to it's own method and create an API to call it.

* fix typos
2022-10-05 02:52:38 +09:00
Goober5000 c1d687f560 prevent redundant arrivals and return whether ships were created 2022-10-03 19:41:26 -04:00
Goober5000 94f99c35f9 remove obsolete fields 2022-10-03 19:36:27 -04:00
Goober5000 61ceeff893 and also for wings 2022-10-03 19:36:27 -04:00
Goober5000 ae3bbd2959 make a parse object arrive 2022-10-03 19:36:27 -04:00
Goober5000 0702a38e1c Merge pull request #4750 from Goober5000/lua_mission_music_scores
add getMusicScore and setMusicScore
2022-10-03 19:09:56 -04:00
Goober5000 064d3a7549 add getMusicScore and setMusicScore
Two new Lua API methods, plus some minor refactoring.
2022-10-03 17:14:33 -04:00
EatThePath e32e01eb50 Added an API function to allow clearing the log during play. (#4741)
* Added an API function to allow clearing the log during play.

* document test fix maybe

* return something
2022-10-04 04:17:53 +09:00
Goober5000 c661ae4590 Merge pull request #4703 from Goober5000/control_used_upgrade
upgrade controls code to use type-safe timestamps
2022-10-02 21:02:32 -04:00
Goober5000 7a654b7e7b per feedback 2022-10-02 20:13:19 -04:00
MjnMixael d902c7612b Api to render the 3d selection effect (#4737)
* Api to render the 3d selection effect

* Missing include

* documentation

* error message for effect type

* documentation
2022-10-03 08:25:15 +09:00
BMagnu 979d305afe Add screenToBlob scripting function (#4738)
* extract base64 routines

* Add screenToBlob scripting method

* Fix variable shadow

* Fix variable shadow again

* Fix usused variable
2022-10-03 07:33:46 +09:00
Goober5000 f14acf9fc1 Merge pull request #4744 from Goober5000/lua_cap_waypoint_speed
add WaypointSpeedCap
2022-10-02 16:54:52 -04:00
JohnAFernandez c2895ba8a4 Fix subsystem health and comparison frames (#4666)
* Fix subsystem change handling code

Make sure that subsystem help actually gets updated.

* change from pointer to literal

I had decided to use `new` in the past when I was less experienced.  So this changes it back to regular angle variables.

(And White space fix requested by Wookie)
2022-10-02 16:52:36 +00:00
MjnMixael 419c56d012 check if weapon is required by current mission (#4731) 2022-10-02 20:23:36 +09:00
MjnMixael e30931b6d2 API to save the current loadout to the player file (#4739)
* API to save the current loadout to the player file

* cleanup
2022-10-02 20:23:31 +09:00
Goober5000 20653ece8e add WaypointSpeedCap
As requested by FotG
2022-10-02 00:13:50 -04:00
Fabian Woltermann 77476edd73 Merge pull request #4735 from The-E/fix/lua_rendering_outside_of_objectrender
When rendering stuff outside of ON OBJECT RENDER hooks, use immediate mode
2022-10-01 22:06:37 +02:00
Fabian WoltermannandGoober5000 e69f2b3fec Update code/scripting/api/libs/graphics.cpp
Co-authored-by: Goober5000 <[email protected]>
2022-10-01 21:39:08 +02:00
wookieejedi 1e61964055 Add AI flag to support ai bay arrivals > 10 seconds (#4733)
* Add AI flag to support ai bay arrivals > 10 seconds

Currently, if an AI ship is emerging from a bay path, the AI will stop following that path after only 10 seconds (and some distance away from the starting point). This results in AI breaking off a path early if a bay arrival path is long and/or uses a slow bay arrive multipliers. For bays that require the ship to follow the exact path this results in AI that then run into the parent ship and each other.

This PR adds a flag which disables that 10 second timeout. Also, in my tests having a flag to disable works best, as opposed to setting a max time (which is hard to calculate with varying ship speeds and varying bay path lengths).

PR is tested and works as expected.

* fix spelling
2022-10-01 12:39:17 -04:00
MjnMixael f5c83fbb40 primary -> secondary (#4740) 2022-10-01 08:44:55 -04:00
MjnMixael 7819d8262d Only check for greater than, not equal to (#4734) 2022-10-01 08:43:20 -04:00
MjnMixael 1edf63c617 take userdata and return int (#4736) 2022-10-01 08:43:13 -04:00
Fabian Woltermann b2ab98a979 When rendering stuff outside of ON OBJECT RENDER hooks, use immediate mode 2022-10-01 10:49:39 +02:00
Goober5000 1b9ab28d29 Merge pull request #4732 from BMagnu/add_local_anims
Add local coordinate relations to allow restoring old absolute behaviour
2022-09-30 19:03:36 -04:00
Goober5000 c5cbd2297c Merge pull request #4726 from Goober5000/decals_right_side_up
flip decals right-side up
2022-09-30 19:03:09 -04:00
wookieejedi 678922472a Fix Remove-Order not working for Play Dead Orders (#4720)
* Fix Remove-Order not working for Play Dead Orders

Play-dead orders set a special case of the ai mode (AIM_PLAY_DEAD), which had special handling to return early in the AI frame function. Remove-order does not change the ai mode though, and thus even when a play-dead order was removed the `AIM_PLAY_DEAD' remained, which would continually trigger an early out in AI frame, which in turn would make turrets not fire on ships, even when the play-dead order was removed. No other orders had this early return, which is why remove order works for them.

This PR accounts for that special handling case. There also seemed to be an extra cleanup line for rearm and repair, so this was added right after that step.

Tested and works as expected.

* make fix flag enabled

* appease clang
2022-09-30 08:34:02 -04:00
Asteroth c9972f678a add on mouse wheel hook (#4724) 2022-09-30 16:46:52 +09:00
MjnMixael ef850ad302 Handle errors from create_wings() in an API friendly way (#4730) 2022-09-30 16:46:45 +09:00
MjnMixael 4d620bb3c7 API for checking and setting if a slot is filled or empty (#4729) 2022-09-30 16:45:06 +09:00
MjnMixael e963cfda93 return the actual number of starting wings (#4728) 2022-09-30 16:44:58 +09:00
BMagnu 4fa9a43e0e refactor names 2022-09-30 09:31:50 +02:00
BMagnu a9ec68ced6 Encapsulate relation parsing 2022-09-30 09:27:20 +02:00
Birk Magnussen 92a1a2c441 Add Local Coordinate relations to restore old absolute 2022-09-29 22:55:42 +02:00
MjnMixael 384e228347 Reset loadout to default and handle commit mission error returns (#4719)
* Reset loadout to default and handle commit mission error returns

* Return enum instead of int codes

* comment
2022-09-29 22:35:09 +09:00
MjnMixael 35ee34b86a isDisabled returns if the ship is used in the mission + some documentation fixes (#4725) 2022-09-29 16:19:05 +09:00
MjnMixael 2149a0e1ee API access to the remaining ship class strings (#4721)
* API access to the remaining ship class strings

* copy paste errors

* Actually return the string
2022-09-29 16:18:50 +09:00
MjnMixael 5979d29463 Scpui loadout pools (#4698)
* API Access to the ship and weapon pools

* func to indexer

* Make ship and weapon pools writable
2022-09-29 16:18:26 +09:00
MjnMixael e369cf98d3 API access to weapons allowed on a ship class and/or in a specific bank (#4697)
* API access to weapons allowed on a ship class and/or in a specific bank

* Allow just checking the ship and not banks

* # This is a combination of 2 commits.

syntax fix

Add method to get number of primary and secondary banks

* We don't need these

* get default weapons for each bank

* # This is a combination of 2 commits.

documentation

return secondary not primary

* fix merge error

* Address feedback
2022-09-29 16:18:14 +09:00
Goober5000 08b7fc68b7 flip decals right-side up
For some reason, decals appear upside-down unless the uvec is flipped.
2022-09-28 22:07:28 -04:00
MjnMixael 44d042edb8 Make Wss_slots writable (#4717)
* Make Wss_slots writable

* cleanup
2022-09-28 22:53:45 +09:00
EatThePath 8edb25c235 Merge pull request #4479 from Kiloku/long_turrets
Allow turrets to use their firepoints for target-leading calculations
2022-09-27 20:21:22 -05:00
EatThePath f641f0283e Merge branch 'master' into debug-log-cleanup 2022-09-27 10:34:12 -05:00
David Gibson b76294e528 Returned some more serious lines to the general categories. 2022-09-27 10:32:18 -05:00
David Gibson e86bbb0138 cleanup to the cleanup of filters
Moved more things to debug filters, and associated cleanup
2022-09-27 10:25:50 -05:00
Asteroth af4b23b7c4 handle 0 duration better (#4716) 2022-09-27 20:11:14 +09:00
BMagnu f0068b13a0 Prevent dangling threads from crashing FSO on close (#4701)
* Prevent dangling threads from crashing FSO on close

* Fix warning

* Properly allow multiple parent threads for unittests

* Fix Test

* Redo it using the lua GC method

* tidyup

* Fix Warnings

* Fix double default

* get rid of explicitly defined copy constructor to allow implicit copy assign to exist
2022-09-27 15:32:13 +09:00
JohnAFernandezandwookieejedi 2e3ff7410c Add corrections in multi ship record (#4650)
The ship record for player ships is not always accurate.  So as to correct entries as valid packets are received.

Also, remove a case where null vectors were being passed to the physics engine.

Co-Authored-By: wookieejedi <[email protected]>

Co-authored-by: wookieejedi <[email protected]>
2022-09-26 22:14:08 -04:00
Goober5000 ac57537f94 Merge pull request #4718 from Goober5000/script_vecmat_copy
a couple of scripting enhancements
2022-09-26 21:21:34 -04:00
Goober5000 1794ba87b3 address feedback 2022-09-26 19:54:18 -04:00
EatThePath 03a9c24330 Merge pull request #4711 from EatThePath/finaldata
created new "_override" universal mod directory
2022-09-26 18:43:09 -05:00
Goober5000 e2dbfca1c3 allow customizing of debug particle color 2022-09-26 18:45:19 -04:00
Goober5000 00746f1f92 add copy methods for matrixes and vectors 2022-09-26 18:43:50 -04:00
Fabian Woltermann 11ec3b64c6 Merge pull request #4712 from MjnMixael/ShipSelect3b
Lua API read-only access to the actual loadout
2022-09-26 15:38:31 +02:00
mjn-mixael eb3c8a25fb MAX_SHIP_WEAPONS 2022-09-26 08:03:40 -05:00
Asteroth 6cad66c7e7 Make sure immobile objects always have 0 velocity (#4708)
* make sure immobile objects are always 0 vel

* doesnt need to be conditional
2022-09-26 18:52:12 +09:00
David Gibson b69ac0cdd3 Implementing formatting and naming feedback 2022-09-25 19:53:54 -05:00
Goober5000 7d854c96c4 Merge pull request #4707 from Goober5000/fix_scripting_line_num
fix off-by-one error in Lua line numbering
2022-09-25 18:35:31 -04:00
David Gibson b572ef45eb added command line flag for override and addressed feedback 2022-09-25 16:16:09 -05:00
Fabian Woltermann ac27124243 Merge pull request #4715 from EatThePath/ltp-mult-lab-fix
Moved lab access to light multipliers to cleaner path
2022-09-25 19:06:21 +02:00
EatThePath 0152b7829a Merge pull request #4714 from Baezon/no-continuous-turn
Flag to turn off continuous turn when attacking
2022-09-25 11:37:57 -05:00
David Gibson 7d0393d565 Moved lab access to light multipliers to cleaner path 2022-09-25 11:35:29 -05:00
Asteroth 76c54a1016 flag to turn off continuous turn when attacking 2022-09-24 19:59:00 -04:00
mjn-mixael 1e7ee8b345 Lua API read-only access to the actual loadout 2022-09-24 16:30:44 -05:00
EatThePath 367e19b751 Merge pull request #4694 from MjnMixael/ScpuiShipSelect
Scpui ship select
2022-09-24 15:15:13 -05:00
David Gibson d0241d060c created new "load_last" universal mod directory 2022-09-24 15:00:16 -05:00
kiloku ad9bf0af71 Reset setting on mod_table_reset() 2022-09-24 10:35:25 -03:00
kiloku 4f8cf06e57 Game settings option to consider all turrets long 2022-09-24 10:32:54 -03:00
kiloku 8ef408c746 ship_get_global_turret_gun_info needs a gvec to not crash 2022-09-24 10:31:33 -03:00
kiloku 075bbe7e3b Add flag to list for parsers 2022-09-24 10:31:33 -03:00
kiloku 0a6558eea9 Adds new flag Turret_distant_firepoint that allows long turrets to aim correctly 2022-09-24 10:31:32 -03:00
BMagnu 19a7814e50 Merge Show Ship and Cockpit Renderpasses (#4705)
* Setup merge of ship model and cockpit

* Merge extmodel and cockpit rendering

* Fix hasCockpitModel check

* Fix non-coord-share mode and deferred

* Make extmodel shadowcast toggleable

* Fix extmodel shadows

* Make cockpit pass somewhat configurable

* tidyup
2022-09-24 22:10:55 +09:00
Goober5000 44802949da fix off-by-one error in Lua line numbering
This fixes the newline count used to make the parsed Lua code align with the source file.
2022-09-23 23:43:30 -04:00
BMagnu d186aefa92 Adds a cache for modular POFs (#4690)
* cleanup submodel index replacement

* Add modelreplace cache

* Move RenameSubobjects to new API

* Fix and tidyup

* Fix GCC error

* fix macro

* Appease Clang

* Properly skip reading non-final leaves from the cache

* fix warning

* Safe-stringify, incorporate comments
2022-09-23 18:38:50 +09:00
EatThePath 7c3e07ab7b Unify default filters and consolidate the new lua category 2022-09-22 21:58:24 -05:00
Goober5000 b49f70fbc3 upgrade controls code to use type-safe timestamps
This requires splitting the `used` field into digital and analog components.  The digital field stores the last-used timestamp, whereas the analog field stores the last value.
2022-09-22 22:26:34 -04:00
Adam Leach fed039fd54 logic error fix - update envMatrix even if there's no specmap (#4699) 2022-09-22 22:00:19 -04:00
Goober5000 2b1e08431c Merge pull request #4633 from Goober5000/event_and_goal_timestamps
convert event-related timestamps to new system
2022-09-22 18:51:06 -04:00
Goober5000 b0e8f260bb Merge pull request #4695 from Goober5000/more_sexps_to_scripts
a few more script enhancements
2022-09-22 18:50:11 -04:00
MjnMixael f7d84dfe76 Update ui.cpp
return
2022-09-22 09:13:27 -05:00
mjn-mixael 601a41bb60 return invalid handle 2022-09-22 08:17:19 -05:00
MjnMixael 5f183832e1 Scpui api briefing map (#4656)
* API version of the briefing map

* Cleanup

* Further cleanup

* # This is a combination of 2 commits.

Fix resizing and cleanup remaining static anim calls

Revert changes completely

* Fix documentation

* implement initBriefing and rearrange map drawing methods to match.

* Documentation

* nullptr
2022-09-22 16:04:14 +09:00
Goober5000 c7b1092a96 a few more script enhancements
1) Add the "no-thrusters" ship flag to the list of flag that can be used by alter-ship-flag or the ship's setFlag function
2) Add a `FireRateMultiplier` virtvar to control the firing rate of turrets (fulfills #4300)
3) Add a `setGlowPointBankActive` function to do the same thing as `activate-glow-point-bank`/`deactivate-glow-point-bank`
2022-09-22 02:12:17 -04:00
mjn-mixael 764c996361 Swap order 2022-09-21 18:39:58 -05:00
mjn-mixael 2f5ccc5b1a unused parameter 2022-09-21 18:02:52 -05:00
mjn-mixael 3a171493b0 Cleanup 2022-09-21 17:29:20 -05:00
mjn-mixael 655fe8d7f1 Loadout wing API (+4 squashed commit)
Squashed commit:

[83e8522d1] Comments

[50686ce6a] Wing Slot data

[450a0f6e1] Common Init

[0c603313e] Rough in WIP
2022-09-21 17:27:38 -05:00
wookieejedi 0c2a6a4f28 Fix multi lib (#4692)
Just adding 1 missing include
2022-09-21 22:08:38 +00:00
MjnMixael 3d700589c5 Give Lua access to the select anims and images (#4687) 2022-09-22 05:31:24 +09:00
EatThePath 33f24f1b4d -luadev flag and lua log filter (#4681)
* Adds new default 'lua' filter category for all lua errors and output
Adds -luadev flag that currently only makes lua errors non-fatal.

* Correcting unreachable code.

* Missed a halting code path for luadevmode

* comment fix
2022-09-22 05:31:06 +09:00
Goober5000 5e3f72229c Merge pull request #4684 from Goober5000/set_and_get_ship_flags
add setFlag and getFlag for ships and parse objects
2022-09-21 12:39:00 -04:00
Goober5000 544234743e update ship flags 2022-09-21 08:43:29 -04:00
Goober5000 fdb5506d41 make autodoc happy 2022-09-20 20:16:54 -04:00
Goober5000 7ff6da8b8b Merge pull request #4664 from Goober5000/script_model_queue_render
use queued rendering instead of immediate rendering for scripts
2022-09-20 20:09:34 -04:00
Goober5000 ce4563867d Merge pull request #4682 from MjnMixael/MissionTime
Mission time
2022-09-20 20:09:25 -04:00
Goober5000 9c71a3a1a0 allow an arbitrary number of flag arguments 2022-09-20 20:06:11 -04:00
MjnMixael eddda373d3 Allow API to optionally not start the next mission. (#4679)
* Allow API to optionally not start the next mission.

* false -> true
2022-09-21 08:16:04 +09:00
Joshua Glatt 86f458f01a Allow modifying map container data when the map is an argument (#4683)
* allow modifying map container data when the map is an argument

* skip past an invalid map key, avoid infinite loop
2022-09-21 08:11:17 +09:00
wookieejedi 7926366ee6 Update max priority for scripting AIgoals (#4685) 2022-09-20 19:09:16 -04:00
MjnMixael 710d7a614c These go here (#4689) 2022-09-21 08:08:47 +09:00
Goober5000 a379411d7a add ParsedShips indexer and update terminology 2022-09-20 16:08:43 -04:00
Goober5000 35abc3e3f5 Merge pull request #4688 from Goober5000/hud_gauge_fix
fix cargo scan type parsing
2022-09-20 15:18:04 -04:00
Goober5000 a89ba892a2 add setFlag and getFlag for ships and parse objects
This mirrors alter-ship-flag and are-ship-flags-set.
2022-09-20 14:43:24 -04:00
Goober5000 d1ba57bc23 fix cargo scan type parsing
Because of idiosyncrasies of `required_string_one_of`, use a different technique.
2022-09-20 14:16:04 -04:00
mjn-mixael 931cfdebb0 explicit bool 2022-09-19 20:34:10 -05:00
mjn-mixael f7b19553c8 nullptr while I'm here 2022-09-19 19:36:11 -05:00
mjn-mixael 6579719a04 documentation 2022-09-19 19:17:34 -05:00
mjn-mixael 68f03b5328 Add isInMission and always return getMissionTime 2022-09-19 19:05:54 -05:00
Goober5000 7fea61f618 Merge pull request #4669 from TRBlount/feature/movie_alpha
Allow movies to be alpha blended through the LUA Movie Player API
2022-09-19 18:50:20 -04:00
Goober5000 91d8031c32 Merge pull request #4677 from BMagnu/absolute_translation
Add Absolute Translation
2022-09-19 18:50:12 -04:00
wookieejedi 7b3705ad61 Fix VS Warning (#4676)
* Fix VS Warning

If this is trivial and not needed feel free to dismiss, but this one-line PR simply fixes a warning that keeps showing up when building with VS.

* individually cast

* cleaner fix
2022-09-19 17:40:35 -04:00
Goober5000 9a2a85198a Merge pull request #4680 from MjnMixael/ReverseHasDebriefing
This needs to be reversed to return the expected value
2022-09-19 17:25:06 -04:00
mjn-mixael cbd3d7da24 This needs to be reversed to return the expected value 2022-09-19 15:26:09 -05:00
JohnAFernandez 54f030ae6c Merge pull request #4671 from Goober5000/custom_hud_scan
add -dualscanlines as a HUD config option
2022-09-19 13:26:19 -04:00
Goober5000 be31334212 Merge pull request #4675 from MjnMixael/FixScramble
Fix returning int when bool expected in API
2022-09-19 11:50:40 -04:00
mjn-mixael 41dd60d111 Fix returning int when bool expected 2022-09-19 08:48:17 -05:00
BMagnu e88b898839 Add absolute translation 2022-09-19 11:57:40 +02:00
Goober5000 94fe34f619 a couple of animation fixes (#4673)
Done at Lafiel's direction.
2022-09-18 23:08:19 +00:00
Goober5000 56803e7c9f Merge pull request #4615 from MjnMixael/ScpuiDebriefingLibrary
Scpui API debriefing library
2022-09-18 18:36:33 -04:00
Goober5000 7a8b8d5fdc Merge pull request #4667 from BMagnu/seamless_anim_flag
Flag for seamless animations with startup period
2022-09-18 18:36:11 -04:00
Goober5000 782600ba7a Merge pull request #4663 from Goober5000/lighting_followup
lighting followup
2022-09-18 04:41:34 -04:00
Goober5000 36972b35f5 Merge pull request #4668 from Goober5000/stop_looping_animation
add stopLoopingSubmodelAnimation
2022-09-18 04:41:24 -04:00
Birk Magnussen cc027a91fc Incorporate Feedback 2022-09-18 10:23:15 +02:00
Goober5000 222a75f3e6 semi-deprecate dualscanlines, and put the default option in the 'else' block 2022-09-18 02:13:11 -04:00
Asteroth 5823c5f4b5 add disco scan lines 2022-09-18 01:41:14 -04:00
Goober5000 4c16c95b9b add -dualscanlines as a HUD config option
Allow different types of cargo scans, including the -dualscanline behavior, to be specified in the HUD gauges table.  Right now the options are "default" and "dualscanlines".
2022-09-18 00:50:28 -04:00
mjn-mixael ac82d8349c Virtvar -> Func 2022-09-17 22:24:48 -05:00
Tyler Blount 2f0a15da28 Remove alpha conditional check in VideoPresenter 2022-09-17 17:02:35 -07:00
Tyler Blount 0d78538a91 Update video shader and add alpha controls to VideoPresenter API 2022-09-17 15:53:04 -07:00
Goober5000 1e0845ca5e Merge pull request #4661 from scp-fs2open/dependabot/pip/ci/post/mako-1.2.2
Bump mako from 1.1.5 to 1.2.2 in /ci/post
2022-09-17 18:47:39 -04:00
Goober5000 6d204a7bc5 lighting followup
Two small fixes to follow up the lighting PRs

1) Change the mprintf to a Warning, both to be consistent with other deprecation warnings and to notify modders that they might need to accommodate the new lighting system
2) Parse any leftover data so that legacy tables don't cause FSO to choke on parsing
2022-09-17 18:43:36 -04:00
Goober5000 622c99fa2f add stopLoopingSubmodelAnimation
A script command to mirror the SEXP operator.
2022-09-17 17:45:28 -04:00
Goober5000 aafa386f22 Merge pull request #4237 from TheForce172/fix/shipEditorCleanup
QTFRED: Ship Editor Cleanup 2
2022-09-17 16:51:41 -04:00
Goober5000 29f1280df7 Merge pull request #4336 from virusman/pr/mac-release-builds
Add release CI config for Mac
2022-09-17 16:43:50 -04:00
BMagnu 5593bd168d Add optional deferred lighting pass for cockpits (#3445)
* Add deferred cockpit lighting

* Put deferred Cockpits behind a flag

* (hopefully) fix bad in-case initializer

* clear non base color buffer in subsequent deferred passes

* Proper deferred Cockpit rendering

* undo whitespace changes
2022-09-17 15:29:35 -04:00
Goober5000 b14db41126 Merge pull request #4647 from Goober5000/frame_debug_tweak
better adjustment of timestamp delta
2022-09-16 22:20:55 -04:00
Goober5000 85c1ae1f4b use queued rendering instead of immediate rendering for scripts
Scripts that render models in the On Object Render hook were effectively doing immediate renders in the middle of queued renders.  This caused some data, such as model orientation, to 'leak' between renders.  It might also have something to do with why the bug in #4637 had the particular graphical side effects that it did.

Anyway, changing the immediate renders to queued renders fixes the leaky orientations, and is probably a good upgrade for other reasons as well.
2022-09-16 17:27:50 -04:00
wookieejedi ad817795e2 Fix smart spawn flag (#4662)
Courtesy of Lafiel, this code fixes special flags such as those related to `spawn`. (Bug arose in #4620).

Tested and fixes the problem and works as expected.
2022-09-16 20:46:16 +00:00
Birk Magnussen 2a8ee1f80b Properly set flag 2022-09-16 21:43:34 +02:00
dependabot[bot] 1b82c101f6 Bump mako from 1.1.5 to 1.2.2 in /ci/post
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.1.5 to 1.2.2.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-16 19:03:37 +00:00
BMagnu 7d42bf08a6 Fix Animation 3D Sound (#4658)
* Add options to enable animation sound to actually be 3D

* Fix typo

* Fix objnum valid check
2022-09-16 14:35:10 -04:00
mjn-mixael 8d8cf0a41c Prevent multiple instances of evaluated debrief sexps 2022-09-16 12:44:10 -05:00
Fabian Woltermann ef496f08e0 Merge pull request #4657 from Goober5000/4602_followup
additional polishing of the briefing API
2022-09-16 15:47:49 +02:00
BMagnu 47b5bc6b64 Add flag safeguard 2022-09-16 13:38:15 +02:00
BMagnu 3f3ff4f685 Add Seamless with startup animation mode 2022-09-16 13:15:07 +02:00
BMagnu dc320d0768 Add special flag to animations 2022-09-16 11:36:00 +02:00
Goober5000 c9ca58f504 update 2022-09-15 20:09:55 -04:00
BMagnu cf8f90e93d Properly encapsulate special flag parsing (#4620)
* properly encapsulate special flag parsing

* Cleanup Cpp11 mess

* Fix missing include in vmallocator.h

* Fix bad merge

* address feedback
2022-09-16 07:39:45 +09:00
Goober5000 06fc8c73a5 this flag deserves its own commit 2022-09-15 18:38:57 -04:00
Goober5000 d92496ee02 convert event-related timestamps to new system
This change covers just the timestamps associated with goals and events, for better review and isolation purposes.

Follow-up to #4569.
2022-09-15 18:38:53 -04:00
Goober5000 c13e262bb8 Merge pull request #4640 from Goober5000/hud_scripting_enhancements
several minor HUD enhancements
2022-09-15 18:34:36 -04:00
Fabian Woltermann 8d93276423 Merge pull request #4654 from qazwsxal/light-power-fix
Light power fix
2022-09-15 20:08:58 +02:00
Fabian Woltermann 69915a1364 Merge pull request #4653 from qazwsxal/thicc_lights
Improved beam, blob and warp lighting
2022-09-15 20:07:53 +02:00
Fabian Woltermann 179f0c0f47 Merge pull request #4659 from qazwsxal/fix/sim_room_fix
Fix retail UI crash when campaign missions are selected in simulator
2022-09-15 19:09:58 +02:00
Adam Leach 5254a5867d keep MSVC happy 2022-09-15 17:51:02 +01:00
Adam Leach 2a4b5b0dee Remove duplicate. 2022-09-15 17:49:22 +01:00
David Gibson fea116ea82 fix ambient lighting to match 2022-09-15 17:47:25 +01:00
David Gibson b6bc5175da Add default brightness profile adjust and retune the techroom rendering appropriately. 2022-09-15 17:47:25 +01:00
David Gibson 02ebdd50d0 Switched to default size zero light emitters 2022-09-15 17:47:00 +01:00
David Gibson c5800b722d Adding configurable source radius to the lighting data and uniforms 2022-09-15 17:46:42 +01:00
Adam Leach 0eb5197ecd Fixes retail UI crash when campaign missions are selected in simulator 2022-09-15 17:35:13 +01:00
David Gibson cf0a785029 adjusted the width of beam light cores 2022-09-15 17:04:25 +01:00
Adam Leach a9a9c89c98 Actually fix lighting error (and document) 2022-09-15 17:04:25 +01:00
Adam Leach f9424a1b88 Factor out spherelight calcs, fix lighting error when inside spherelight 2022-09-15 17:04:25 +01:00
Adam Leach b0467d0697 Clamp beam length to prevent light from going past start/end points. 2022-09-15 17:04:25 +01:00
David Gibson d93e6cf752 Adjusted fireball sizing 2022-09-15 17:04:25 +01:00
David Gibson e00635d430 Switched to default size zero light emitters 2022-09-15 17:04:25 +01:00
David Gibson 413e817733 Attached reasonabled defaults to the new source radius settings 2022-09-15 17:04:25 +01:00
David Gibson e37427a24b Adding configurable source radius to the lighting data and uniforms 2022-09-15 17:04:25 +01:00
Adam Leach 30d534fe32 Documentation and a small optimisation. 2022-09-15 17:04:25 +01:00
Adam Leach b77b820aa2 Initial work for lights with adjustable emitter size and tube rendering. 2022-09-15 17:04:25 +01:00
mjn-mixael ce9dd1eaf3 cleanup includes 2022-09-15 10:41:57 -05:00
Fabian Woltermann 6c83a72403 Merge pull request #4652 from qazwsxal/qaz-shaders
Improved shaders and image based lighting
2022-09-15 17:39:07 +02:00
mjn-mixael 54b6efcf25 Address feedback 2022-09-15 10:27:45 -05:00
mjn-mixael 925aa44ebb Compare pointer to nullptr instead of 0 2022-09-15 10:27:42 -05:00
mjn-mixael f0f23b5fd0 Address feedback 2022-09-15 10:27:38 -05:00
mjn-mixael 7d77b8ebc0 Return this exactly to previous state 2022-09-15 10:27:35 -05:00
mjn-mixael 6f0f3a10eb Address feedback 2022-09-15 10:27:31 -05:00
mjn-mixael f011e59d61 Remove unreachable code 2022-09-15 10:27:22 -05:00
mjn-mixael d718c76906 Some cleanup 2022-09-15 10:27:21 -05:00
Mike N 895d4dce1a debriefing api access 2022-09-15 10:27:19 -05:00
Goober5000 e146a24f9e additional polishing of the briefing API
Follow-up to #4602.  Overall the PR was good, but there are a few extra small changes that should go in. In order of priority:

1) The `exitLoop`, `skipMission`, and `skipTraining` functions should check for campaign mode.
2) The `isVisible` virtvar should be changed to a function, because calling it may have side effects.  In standard usage, the briefing formula is evaluated exactly once per stage on briefing initialization, so scripts should follow this convention.
3) The `hasGoalsSlide` function should be called `hasGoalsStage`, because "stage" is the common terminology in FSO.
4) Paging out mission messages is already done in `game_level_close` and should be removed from not only the scripting method but the method it was based on.
5) For consistency, unused parameters should use the `SCP_UNUSED` macro.
6) The `isTraining` flag check can be slightly streamlined using the double-not trick.
2022-09-15 11:20:00 -04:00
EatThePath c66f90b46d Implemented a command line flag that forces a fixed RNG seed, (#4599)
* Implemented a command line flag that forces a fixed RNG seed, which reseeds the RNG on every mission load.

* Naming changes and bounds checking
2022-09-15 22:30:26 +09:00
Adam Leach d4ad137251 Converted warning to log message as the data is just ignored 2022-09-15 13:21:11 +01:00
Adam Leach 1e695cf807 Merge branch 'master' into qaz-shaders 2022-09-15 10:18:03 +01:00
Goober5000 850f2904dc Merge pull request #4603 from Goober5000/timestamp_migration_2
more timestamp migration
2022-09-15 02:01:19 -04:00
Goober5000 086e386b75 Merge pull request #4655 from Goober5000/improve_huge_fire_info_lookup
improve huge_fire_info lookup
2022-09-14 22:32:09 -04:00
EatThePath 452f554193 Crossing the specular rubicon (#4302)
* Applying directional brightness profile value, disconnected spec flags and made specular light always equal to diffuse light

* Switched over to new command line arguments

* Wire lab up to new lighting controls, and provide backwards-compatible defaults for emissive.

* cleanup unused new function

* make static some functions that can be static

* revise command-line and emissive handling

* handled specular sun depreciation and general removal of specular value handling

* Removed specular light color as a separate value in the uniform buffers.

* cleanup of leftover/post-rebase specular references

* further post-rebase repair of light flags command line and leftover specular

* move techroom/selection/breifing 'room' lights to a common function and
augment lighting setup for current rendering

* fixed some mishandling of lighting modifiers.

* Addressed code clarity and comments from review
2022-09-15 05:47:58 +09:00
Goober5000 15dc0aba77 improve huge_fire_info lookup
According to EatThePath's frame profiling, this one ship name lookup takes 2% of the frame time.  It can be easily optimized by making use of the ship registry.
2022-09-14 14:39:32 -04:00
Adam Leach 9cccab3f18 unused var check 2022-09-14 17:54:05 +01:00
Adam Leach 36a714b93f Merge branch 'master' into qaz-shaders 2022-09-14 16:56:57 +01:00
MjnMixael 70609bb3b9 Cleanup Fiction, Red Alert, and Loop Brief based on feedback on other PRs (#4649) 2022-09-14 16:01:57 +09:00
BMagnu 10a47781a0 Change cmd_briefing API to reference from copy (#4646) 2022-09-14 16:01:42 +09:00
MjnMixael ff55a39dd4 Scripting functions required for SCPUI conversion of all four Tech Room UIs (#4591)
* Documentation (+6 squashed commit)

Squashed commit:

[ea8550b54] Resolve errors

[9ab0a576d] Add way to count number of elements in the arrays

[eb74146cc] Correct this boolean check

[60fbc6008] Missed one

[78e65a4b7] Avoid naming collision

[4ea5ddead] Clean unneeded log print and compare like variables

* Adding simulator room here seems like a pretty safe option

* Scpui API to access to build the tech room cutscene list and a few methods to help playing the cutscene and return to the menu accurately

* Scpui API access for credits related data

* # This is a combination of 7 commits.

Clean unneeded log print and compare like variables

Avoid naming collision

Missed one

Correct this boolean check

Add way to count number of elements in the arrays

Resolve errors

Documentation

* Address feedback

* Address feedback

* Add virtvar isCampaignMission
2022-09-14 16:01:34 +09:00
Goober5000 ae57ea7158 Merge pull request #4643 from Goober5000/small_hook_refactor
small hook refactor
2022-09-13 18:24:45 -04:00
MjnMixael ef85e94e40 SCPUI API elements required for the Briefing (#4602)
* API elements required for the Briefing

* Resolve errors

* Check if the mission is a Scramble mission

* Add one missed flag check

* Slight API naming adjustment

* Address feedback

* Address Feedback again

* Differentiate var names
2022-09-14 04:39:20 +09:00
Goober5000 258e735af2 better adjustment of timestamp delta
When debugging, don't adjust the timestamp by the exact difference, since that would make the frametime 0 and cause div-0 errors.  Instead pretend that the previous frame was a reasonable duration.  Also, perform the timestamp check separately from the frametime check, since they are not always consistent.
2022-09-12 21:22:56 -04:00
Goober5000 19f193f533 Merge pull request #4644 from Goober5000/remove_asserts
remove two unnecessary asserts
2022-09-12 15:56:51 -04:00
wookieejedi d5eca2fab1 Auto Truncate default ship names (#4642)
* Auto Truncate default ship names

Previously, placing a ship that had a long class name might create a default name that was too long and thus trigger a buffer overflow assert.

Such behavior was confusing if someone was just placing things in FRED and not sure at all what happened or how to fix it.

This PR replaces the assert with code to auto truncate the ship class part of the name to ensure that the default name will fit into the designated size.

* change var name
2022-09-12 13:26:53 -04:00
Goober5000 f932c2da6a Merge pull request #4645 from Goober5000/fix_4637
fix script conditions for ships
2022-09-12 03:09:25 -04:00
BMagnu 14f94eb34f Add Angle SEXPs (#4641)
* Add angle SEXPs

* Convert to Degrees
2022-09-12 15:11:57 +09:00
Goober5000 4be8851c16 fix script conditions for ships
Like #4559 before it for weapons, this fixes the script conditions for ships.  The problem was the same: the script condition would evaluate to true if none of the objects under consideration were ships.  The fix is the same as well.  I checked all the other script condition categories, so no similar bugs should pop up in the future.

Fixes #4637.
2022-09-12 00:05:24 -04:00
Goober5000 5e4abb30a3 remove two unnecessary asserts
It's not necessary here to assert on the correct variable type, as having the wrong type here won't cause the code to break.  More importantly, the error will have been flagged before this point anyway, and this code is used for formatting the SEXP to be displayed in an error message.  It's not helpful to pre-empt an error message with an assert.
2022-09-11 23:21:16 -04:00
wookieejedi f2dd37fab3 Allow Autotarget to target new target when current target is deathrolling (#4638)
Discussion starts here: https://discord.com/channels/223511295431933953/722747742996267068/1018264927699476571
2022-09-11 22:29:56 -04:00
Goober5000 974981520d change names 2022-09-11 22:25:57 -04:00
Goober5000 46bd9ecae8 fred and qtfred 2022-09-11 22:24:25 -04:00
Goober5000 9fcf17b9e6 better distinguish between builtin and custom hud gauges, and allow both when the functions can handle it 2022-09-11 22:09:24 -04:00
Goober5000 9056a9c89b partial revert of 2e839eda0; these sexps need to get any gauge, not just the custom ones 2022-09-11 21:16:50 -04:00
Goober5000 0480fa69d9 several minor HUD enhancements
add `getDirectiveLines` and `setPosition` script functions
properly error if trying to set a HUD gauge name
remove the unneeded `Directive_frames_loaded` variable
improve accuracy of SEXP help for HUD gauge operators
2022-09-11 21:16:50 -04:00
virusman 288e3b86d1 Add release CI config for Mac 2022-09-11 16:03:55 -07:00
Goober5000 8bc4064670 small hook refactor
Basically just changing some parameter names.
2022-09-11 15:07:17 -04:00
Goober5000 9e6e95108d Merge pull request #4636 from Goober5000/fix_4635
properly account for string sizes in debrief_choose_voice
2022-09-11 13:00:29 -04:00
wookieejedi 375ccd7413 Fix conditional for Always_warn_player_about_unbound_keys (#4639)
Properly check if mission is singleplayer for the `Always_warn_player_about_unbound_keys` game option.
2022-09-11 11:17:00 -04:00
Kiloku d0c76a7eaa New options for lead indicators (#4411)
* Adds Lead Indicator Behavior option to game_settings.tbl

* Adds dont merge lead indicators flag to weapons, allowing homing secondaries to have their own lead indicators no matter what.

* Removed unused variable that was added just for testing

* add explicit int to float conversion to appease build checks

* Move some things around to avoid potentially undefined values

* Clean-up + address feedback

* Remove redundancy
2022-09-11 23:57:40 +09:00
Goober5000 7462dd68f8 fix subtitle clipping (#4625)
For subtitles drawn using the `$Show-subtitle base resolution:` feature, text near the side of the screen would get clipped off mysteriously.  The clipping corresponded precisely to the edge of a 4:3 boundary, which led me to discover that the clip boundary was still at the side of a 4:3 box, rather than a 16:10 box as was expected.  Explicitly setting the clip boundary when setting the screen scale fixed the issue.

For any graphics coders in the know, is this actually the proper fix?
2022-09-11 20:00:54 +09:00
Fabian Woltermann 9ba91d870c Merge pull request #4632 from The-E/fix/4614_demotion_went_too_far
Fix issue with new pilots getting demoted too fast
2022-09-10 21:15:05 +02:00
Asteroth ef57ffc2f4 Add maneuvering thruster easing (#4623)
some thruster and comment clean up, and thruster easing
2022-09-09 18:36:04 -05:00
Goober5000 1509448a34 properly account for string sizes in debrief_choose_voice
The null terminator was written past the end of the string buffer, which intruded on the next field in the struct.  Fixing this fixes #4635.  Also adjust the string concatenation a couple lines up because it could also write past the end of the buffer.
2022-09-09 12:07:07 -04:00
EatThePath bb232382cf Merge pull request #4528 from MageKing17/feature/default-shockwave-damage-types
Add default shockwave damage types functionality.
2022-09-09 09:53:30 -05:00
Fabian Woltermann e21dfcb457 when resetting stats before replaying a mission, check the rank table to see which rank the player should be 2022-09-08 19:17:47 +02:00
Goober5000 ae3fb54c02 add more timestamp documentation 2022-09-08 02:42:38 -04:00
Goober5000 16a8a46f42 Merge pull request #4579 from MjnMixael/RenderWeaponTechModel
Implement renderTechModel() and renderTechModel2() for weapons
2022-09-07 20:09:06 -04:00
Goober5000 9cb2892ca9 Merge pull request #4629 from Goober5000/script_interpolate_matrices
rotational interpolation
2022-09-07 16:48:26 -04:00
Fabian Woltermann c9c4632a87 Merge pull request #4631 from The-E/fix/lab_crash_when_destroying_dead_ship
Fix lab crash when destroying a destroyed ship
2022-09-07 19:29:43 +02:00
Fabian Woltermann f2abe516f3 check if the current lab object is actually a ship before trying to destroy it 2022-09-07 18:54:05 +02:00
Asteroth cb7d117bdf Automatic thruster activation (#4617)
* automatic thruster activation and glide thruster activation

* finalizing tweaks

* fixes

* whoops
2022-09-07 18:36:37 +09:00
Asteroth de503bb2d5 small fix for banking (#4624) 2022-09-07 18:35:30 +09:00
Goober5000 39b57cbf41 rotational interpolation
Add script support for rotational interpolation of matrixes (orientations) and vectors.
2022-09-06 21:48:03 -04:00
Goober5000 66473f03ab Merge pull request #4621 from Goober5000/fix_supercap_warpout
fix supercap immediate warpout
2022-09-06 18:20:15 -04:00
MageKing17 dbd3721b00 Default-enable inheriting damage type in mods targeting 22.4+. 2022-09-06 13:04:44 -07:00
BMagnu 565047e93b Implement a proper std::optional alternative (#4619)
* Add optional lib

* Replace modelreplace optionals

* Replace Animation Optional

* rework modelanimationdata constructors
2022-09-06 17:05:05 +09:00
BMagnu ee4d74a1af Prevent closed thread from re-closing (#4622) 2022-09-06 03:17:13 +00:00
JohnAFernandez f2038a8a1a Merge pull request #4613 from JohnAFernandez/Add-Interpolate-Matrices-For-Multi
Add interpolate matrices for multi
2022-09-05 19:40:36 -04:00
John Fernandez a93eeebff0 Fixes for Matrix interp 2022-09-05 19:05:12 -04:00
Goober5000 5d57da1755 fix supercap immediate warpout
Supercaps have a special physics flag applied when they warp in so that they slow down quickly.  However, if a supercap immediately warps out again - as in Deus Ex Machina and DEM: Interlude - this physics flag will interfere with the process so that the ship doesn't accelerate immediately even though the warpout portal is opening.  This will cause the ship to miss the portal and clip off a section.  The solution is to clear the flag once the warpout process starts.
2022-09-05 16:35:03 -04:00
Goober5000 fe44dda809 Merge pull request #4521 from Goober5000/end_of_mission_cutscene
mission-specific cutscene enhancements
2022-09-05 04:51:15 -04:00
Goober5000 3da5910c23 Merge pull request #4618 from Goober5000/object_radius
add Radius virtvar for objects
2022-09-05 04:25:22 -04:00
Goober5000 268a483bdb add Radius virtvar for objects
Surprised it hasn't been added before now.
2022-09-05 01:31:18 -04:00
Asteroth 6440c64b77 Fix cfread string's handling of null terminated strings (#4583)
* fix cfread string's handling of null terminated strings

* clarity and doc edits
2022-09-05 04:15:50 +09:00
BMagnu 2a2ed22e5b Enable LuaAI to use more arguments (#4577)
* Enhance LuaAI args

* Pass the Lua Parameters

* Cleanup debugging comment

* Fix warnings
2022-09-03 22:31:52 +09:00
PhantomHoover 402ee8636e Remove unused and costly checksum during model read (#4592)
Profiling shows this taking about 10% of the total time in loading BP's Icarus mission, and the result isn't even read any more!
2022-09-03 22:16:50 +09:00
BMagnu 74ba7899fd Virtual / Modular POFs (#4590)
* Integrate Barebones Framework

* further integration

* Add brak in read

* Defer subsystem generation

* Unentangle pof parsing and subsystem info writing

* finalize modelreplace skeleton

* Begin submodel copying

* First prototype of modular pofs demonstratable

* Allow Submodel Renaming

* Add copy children and set offset

* properly handle depth

* Add header modification

* Fix issues with parsing

* Fix Warnings

* incorporate feedback

* de std-ify

* Incorporate Feedback 2

* Fix macro

* Remove ref

* Enhance error messages
2022-09-03 22:15:56 +09:00
Goober5000 bc5ee36bd8 Merge pull request #4552 from Goober5000/additional_shudder_support
enhanced control for the global ship shudder
2022-09-03 00:12:42 -04:00
naomimyselfandi a8c8549015 Respect hashes in ship and wing names in the loadout screen (#4609)
* Respect hashes in ship and wing names in the loadout screen

* Use get_display_name()
2022-09-02 08:36:07 -04:00
naomimyselfandi 89dc0c66dc Allow assigning support ship per species (#4608)
* Allow assigning support ship per species

* Respond to PR feedback
2022-09-02 08:15:26 -04:00
Kiloku 05495cd1bc Add optional Drop Shadows to HUD (#4543)
* Add drop shadows to HUD text

* Add drop shadow to reticle

* Add control to toggle Drop Shadows

* Double render reticle shadows

* Use gauge_color instead of creating a temp var

* Add shadows to ETS gauges

* Set shadow default to false and adjust formatting

* Restore numbering for controlsconfig
2022-09-01 22:06:00 -04:00
wookieejedi d905410591 Allow mods to change Emp flash color, intensity, and string (#4607)
* Allow mods to change Emp flash color, intensity, and string

EMP is the only text warning that does not use an entry in the strings table (and thus it's the only text warning gauge that mods cannot change and/or translate). This PR adds a string entry for it to allow mods to translate and change the string like all other HUD gauge text warnings.

Also, EMP flash has a hard coded color and strength factor for the flash, whereas generic pain and shield pain have a configurable flash strength factor (shield pain flash is based on shield color, while generic pain is based on damage dealt). This PR also allows modders to change the strength intensity and color following previously established methods.

This PR also fixes a case of "Launch" that fell through the cracks. The function is supplied the translated string, but within the function it does not check for the translation.

Everything is tested and works as expected.

* incorporate feedback

* convert to float during parse

* incorporate more feedback

* improve safety checks
2022-09-01 21:31:16 -04:00
Fabian Woltermann 9a5e34b546 Merge pull request #4612 from The-E/fix/4604-defer_adding_hooks_until_safe
defer adding new scripting hooks until after hook processing is done
2022-09-01 19:03:24 +02:00
Fabian Woltermann a1b48d0a9e defer adding new scripting hooks until after hook processing is done 2022-09-01 18:30:48 +02:00
Taylor Richards bb06c75cb4 handle irc motd error to prevent connection hang (#4610)
A MOTD missing (422) message is non-fatal and should be handled the
same as a MOTD end (376) message to prevent the chat connection
process from hanging.
2022-09-01 05:57:01 -04:00
Taylor Richards ea2d9d9167 prepend PXO game identity to chat lobby window (#4606)
For help with troubleshooting, list what game/mod PXO identifies
this instance is running in the chat lobby stream.
2022-09-01 05:56:24 -04:00
John Fernandez 5d267307b2 Change last orient to sensible value
Previously this could be set to bad data, since the last orient calculated could be based on stale data.
2022-08-31 15:54:56 -04:00
John Fernandez dc625bca33 Change to interpolating matrices
Should create a steadier interpolation
2022-08-31 13:33:25 -04:00
John FernandezandAsteroth 2b0f35b58b Add an explicit Interpolate Matrices function
Written by Asteroth, derived from our ai code.  I added a couple safety checks and changed the type to void to match our library.

Co-Authored-By: Asteroth <[email protected]>
2022-08-31 13:33:25 -04:00
Asteroth a9b485da3d associate a single version to submodel translation (#4605) 2022-08-31 01:13:11 -04:00
MjnMixael ebc8ebd638 Add $Mod Title and $Mod Version options to game_settings.tbl (#4565)
* Add $Mod Title and $Mod Version options to game_settings.tbl for mainhall and Lua use

* Fix comparison

* documentation

* address feedback

* typo
2022-08-30 10:57:06 -04:00
Goober5000 ba82e4ef57 Merge pull request #4582 from Goober5000/model_translation
Model translation
2022-08-29 12:46:28 -04:00
Goober5000 6c7c093729 some more timestamps 2022-08-29 10:42:03 -04:00
Goober5000 3d74bac90b more timestamp migration
More conversion of timestamps to the new system.  Follow-up to #4569.
2022-08-29 09:27:30 -04:00
Goober5000 74ab0f7878 Merge pull request #4601 from Goober5000/good_rearm_time_fix
fix good-rearm-time bug
2022-08-29 00:59:56 -04:00
Goober5000 ef4c3984b5 fix good-rearm-time bug
The original implementation of `ai_good_time_to_rearm` did not revert to being a "bad" time to rearm when the time was up.  This fixes that and adds an AI profiles flag to toggle it.

Also converts `ai_rearm_timestamp` to use the new TIMESTAMP type.
2022-08-29 00:00:15 -04:00
JohnAFernandez 51ca0d20ee Merge pull request #4600 from MjnMixael/ColorTagFix
This should be func not virtvar
2022-08-28 18:17:22 -04:00
Goober5000 41d2cdc82c Merge pull request #4569 from Goober5000/asteroid_debris_timestamps
convert some timestamps to the new system
2022-08-28 17:44:41 -04:00
mjn-mixael 63d4a7ce8c This should be func not virtvar 2022-08-28 14:52:31 -05:00
MjnMixael 6425a999a6 Some User Interface API cleanup and generalization (#4595)
* Move colors up one level and generalize

* Initialize this first

* These are common to both all Briefings, so put them in the general Briefing category
2022-08-28 14:27:17 -04:00
MjnMixael be00e257b8 Scripting functions required for SCPUI conversion of Red Alert (#4587)
* Scripting functions required for SCPUI conversion of Red Alert

* Correct documenation

* Address feedback

* Missed return

* Briefings
2022-08-28 13:18:12 -04:00
wookieejedi 650ae9a074 Some extra safety checks for fiction viewer scripts (#4598)
Protects `Fiction_viewer_active_stage` if it reads a stage of -1 (it would have thrown a vector access error because the index is out of range). Also, given a lot of other scripting functions have additional built in error checks, I just added those to the fiction viewer functions.
2022-08-28 09:11:57 -04:00
MjnMixael 60509b2c3c Scripting functions required for SCPUI conversion of Loop Brief. (#4586)
* Scripting functions required for SCPUI conversion of Loop Brief.

* nullptr

* Fix documentation and make setting choice optional, defaulting to false.

* Documetation fix
2022-08-28 08:52:41 -04:00
Goober5000 67729990e3 we don't need to bump the multi version yet 2022-08-27 13:10:05 -04:00
Goober5000 9116f5de2d improve API 2022-08-27 13:10:05 -04:00
Goober5000 018363dac6 edit lab flag 2022-08-27 13:10:05 -04:00
Goober5000 662d71a57a add model animation support, based on Lafiel's guidance 2022-08-27 13:10:05 -04:00
Goober5000 d3807cbd08 add subsystem sexps 2022-08-27 13:10:05 -04:00
Goober5000 5cf412aad8 implement stepped and regular translation as controlled by subsystems 2022-08-27 13:10:05 -04:00
Goober5000 a1215c6d6f infrastructure for handling submodel translations - maintaining, colliding, rendering 2022-08-27 13:10:05 -04:00
Goober5000 d25a477ffc Merge pull request #4560 from Goober5000/floating_point_followup
floating-point followup
2022-08-27 13:00:43 -04:00
MjnMixaelandAsteroth 150608a980 Base method to determine Debug vs Release (#4597)
* Base method to determine Debug vs Release

* small spelling fix

Co-authored-by: Asteroth <[email protected]>
2022-08-27 11:42:06 -04:00
wookieejedi 1df396bbf4 Allow test_line_of_sight to return intersecting object signature (#4596)
* Allow `test_line_of_sight` to return intersecting object signature

The `test_line_of_sight` can currently provide the closest intersecting distance, but it would be very useful, especially for AI scripting, if this function could also return the signature of the intersecting object. This PR adds that functionality.

Tested and works as expected. Happy to discuss strategies for changing implementation, too. The extra, third return value for object signature was added to `getLineOfSightFirstIntersect` function because that function already returns 2 values. Thus, it will remain compatible with older scripts which only save the first 2 returned values.

* fix documentation

* fix typo

* return object instead of sig

* fix pointer

* use pointer pointer for full fix

* name clarification
2022-08-26 23:05:07 -04:00
MjnMixael a884633723 Fix documentation (#4594) 2022-08-26 23:03:54 -04:00
mjn-mixael 762d855e99 Implement renderTechModel() and renderTechModel2() for weapons 2022-08-26 12:21:40 -05:00
Goober5000 19e407df62 convert some timestamps to the new system
Mostly debris and asteroid timestamps, but also arc timestamps for ships.
2022-08-25 21:40:18 -04:00
Goober5000 8c47a03df9 Merge pull request #4469 from Goober5000/more_voice_acting_buttons
Voice acting manager enhancements
2022-08-25 21:37:55 -04:00
Goober5000 4dfb29f9d8 adjust MOI values per feedback 2022-08-25 21:36:40 -04:00
Goober5000 e67ea63121 use std::max 2022-08-25 21:36:40 -04:00
Goober5000 60540d2a57 floating-point followup
Floating-point comparisons are tricky beasts.  See this article for a good summary of the issues involved:
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

This PR improves support somewhat, although there are obviously situations in the code (such as comparisons to 0) that should still be addressed.  This PR makes the following improvements:
1) Tightens the threshold on `IS_VEC_NULL` and `IS_VEC_NULL_SQ_SAFE` from 1e-16 and 1e-36 to FLT_EPSILON
2) Tightens the threshold for parsing `turn_time` in POFs
3) Restores the previous implementation of `fl_equal`
4) Adds a dedicated `IS_MOI_VEC_NULL` for moment of inertia values
5) Improves documentation

Follow-up to #4535 and #4443.
2022-08-25 21:36:40 -04:00
Goober5000 a1f58671e5 enhanced control for the global ship shudder
Allow the variables controlling ship shudder to be independently set using scripting.  Also add new flags to apply the shudder without decay and apply the shudder regardless of camera.

Also change the shudder timestamp to the new style.
2022-08-25 21:36:17 -04:00
Goober5000 c239490899 Merge pull request #4593 from virusman/pr/fix-mac-builds
Fix Mac builds by overriding py7zr version
2022-08-25 21:06:41 -04:00
virusman c30500b66e Fix Mac builds by overriding py7zr version 2022-08-25 17:11:46 -07:00
MjnMixael 6d26547928 Scripting functions necessary for SCPUI Fiction Viewer (#4584)
Scripting functions necessary for SCPUI Fiction Viewer
2022-08-25 18:16:42 -04:00
wookieejedi 261dc508f8 Script function for turnTowardsOrientation (#4578)
A simple copy of the same function on `ai_helper`, now usable on plain ships too.
2022-08-23 22:23:30 -04:00
Goober5000 a0890c291a Merge pull request #4585 from Goober5000/fix_sound_parsing
fix overriding of originally-empty sounds
2022-08-23 22:13:16 -04:00
MjnMixael 89ff900e68 Make cutscenes.tbl extendable with -csn.tbm (#4571)
* Make cutscenes.tbl extendable with -ccn.tbm

* Only let first cutscene of any parsed file be visible by default

* Implement +nocreate support and change modular ext from ccn to csn

* Remove commented out code

* Initialize char* as NULL

* Address feedback

* cleanup
2022-08-23 07:38:46 -04:00
Goober5000 f469da2606 fix overriding of originally-empty sounds
Follow-up to #3743.  A sound that was originally parsed as empty, but then re-parsed as non-empty, would still have the `GAME_SND_NOT_VALID` flag from the original attempt.  This fixes that by clearing the flag each time the filename is read.
2022-08-23 01:28:12 -04:00
Goober5000 38d099ebd6 Merge pull request #4581 from Goober5000/fs1_reticle_supplement
add missing hud_gauges.tbl options
2022-08-22 21:54:11 -04:00
Goober5000 063bf44a19 Merge pull request #4397 from Goober5000/separate_ondeath_hooks
add new hooks for each object type
2022-08-22 19:38:07 -04:00
Goober5000 9c61b389d6 add missing hud_gauges.tbl options
These options for controlling the locking animation are toggled by `$Reticle Style:` but were otherwise not available to HUD gauges.
2022-08-21 22:10:45 -04:00
Goober5000 2b582676a6 make OnShipDeath overridable, per request 2022-08-21 20:53:04 -04:00
Goober5000 ba36ad69f5 add new hooks for each object type
Splits the existing On Death hook into independent hooks for each relevant type.  Adds On Ship Death, On Missile Death, etc.  Also adds On Missile Death Started to complement On Ship Death Started.
2022-08-21 20:53:04 -04:00
BMagnu 76be16f6b2 Fix Typo (#4580) 2022-08-21 23:31:04 +00:00
BMagnu 2557478d55 Allow changing Animation Instance speed (#4572)
* Allow changing animation speed

* Return nil from function

* address feedback
2022-08-22 03:14:34 +09:00
Asteroth c68e737c51 cap zoom distance and lower sensitivity (#4557) 2022-08-22 02:18:01 +09:00
PhantomHoover a95ecf9c9c Fix dangling pointer in sexp.cpp (#4561)
If you define a variable inside a block, its lifetime is confined to that block. So oswpt needs to be lifted into the parent block.
2022-08-22 02:17:49 +09:00
PhantomHoover c153fa8d26 Fix dangling pointer in hudparse.cpp (#4558) 2022-08-22 02:16:42 +09:00
wookieejedi 0f6ea85224 Fix setting of $Shadow Quality Default: (#4576)
`$Shadow Quality Default:` allows mods to specify what the default shadow quality should be, given that `-enable_shadows` flag is used. If a mod used this game settings option but the player did not use the `-enable_shadows` flag, then a parsing error would show up.

This PR fixes that bug by reordering two lines. Tested and fix works as expected.
2022-08-21 12:04:35 -04:00
JohnAFernandez d1d63a912a Prioritize players in object update (#4575)
* Make sure that players are updated the more often

Mitigates the increased latency from multiple clients getting each other's positions.

And Adjust update times:

Because LAN settings are now widely used even on non-LAN connections, shift High to a little bit less frequently in some situations, and adjust LAN settings so that it doesn't take quite as much bandwidth for updating ships that are `rear_medium` or `rear_far`.

Also update comments.

* Remove unused define

This was used in the previous version of the object update code and doesn't need to be here anymore.
2022-08-21 11:15:47 -04:00
BMagnu 55eab4c7e7 Add turnTowardsOrientation (#4563) 2022-08-21 08:24:39 -04:00
Goober5000 38fbe6311e Merge pull request #4555 from MjnMixael/LuaPersonaAccess
Implement ability to get and set a ship's persona index
2022-08-21 00:54:50 -04:00
EatThePath 0b97fc2c8e Merge pull request #4554 from MjnMixael/OnLoadoutStarted
Add hook just before loadout parsing
2022-08-20 23:21:27 -05:00
MjnMixael 5f5b08b594 Mouse option strings (#4570)
* Updated display strings for mouse settings

* Reverse these to match input functionality

* Fix whitespace

* Update mouse.cpp

Fix whitespace again
2022-08-20 22:10:03 -04:00
The Force 88bae48ded Actually Alt-name & callsigns and don't update window if closed 2022-08-20 19:23:20 +01:00
Goober5000 12227fd0ab Merge pull request #4567 from Goober5000/fix_stepped_rotation
fix stepped rotation
2022-08-20 12:15:13 -04:00
Goober5000 74112e13f7 fix stepped rotation
As part of the cleanup in preparation for model translation, there was a bit of code review that was actually incorrect.  The calculation of the current step needs to be rounded down, because the step isn't actually complete until it fully reaches the next number.  Rounding the step causes the submodel to jump around in all sorts of weird ways.

Follow-up to #4443.
2022-08-20 10:53:50 -04:00
wookieejedi f82bf2276b Allows default shadow quality to be per mod (#4553) 2022-08-20 07:16:29 -04:00
BMagnu 61197d4c12 Add SEXP to stop an animation after loop (#4566)
* Add Animation Instance Flags

* Add SEXP barebones

* Unify and simplify animation parsing

* Clean up animation calling and use new animationlist api

* Add missing break
2022-08-20 18:44:17 +09:00
BMagnu 5a53de0eb8 Fix WeaponClass Script Condition (#4559)
* Fix Weaponclass hook

* remove bad include
2022-08-20 03:23:51 +09:00
MjnMixael 9b36fd1f6f Lua scan time (#4551)
* Add Lua access to a ship's Scan Time

* Disallow writing to the shipclass value

* Remove ship access in favor of shipclass access. Resolve read only issue.

* Cleanup and error if script attempts to set Scan Time

* Whoops. Still need to get the shipclass.
2022-08-19 07:57:56 -04:00
PhantomHoover 5ea90dcb46 Fix: Missing includes breaking Linux builds. Including the same thing twice in a row. A completely unnecessary recursive include loop. (#4556) 2022-08-19 07:50:51 -04:00
mjn-mixael 1d5c457c83 Fix issue 2022-08-19 00:28:59 -05:00
Mike N c0c7854c86 Address feedback 2022-08-18 16:01:32 -05:00
Mike N 3e884bd384 Change hook name 2022-08-18 12:57:38 -05:00
Mike N 103522b72a Implement ability to get and set a ship's persona index 2022-08-18 12:55:16 -05:00
Mike N 9a08bbf597 Add hook just before loadout parsing 2022-08-18 11:21:07 -05:00
Goober5000 34018db925 Merge pull request #4421 from Goober5000/add_missing_sexp_goals
add missing SEXP goals
2022-08-18 10:11:39 -04:00
Kiloku 843eda19dd Prevent subsystem fireWeapon scripting function from triggering an assert (#4537)
* Prevent an assert from being triggered down the line by giving a LuaError for invalid weapons

* Reword error message to match function documentation
2022-08-18 21:26:10 +09:00
Asteroth bfb77b2a00 add isPositionInFOV script function (#4540) 2022-08-18 21:25:40 +09:00
BMagnu 269bb1b221 Add scripting API and conditions for executing on server only (#4548)
* Add scripting API and conditions for executing on server only

* feedback
2022-08-18 21:13:05 +09:00
Goober5000 f68849f0d3 add missing SEXP goals
The rearm-ship and fly-to-ship goals were never set up to work with the `add-goal` SEXP.  This adds the necessary code to make them both work.
2022-08-17 23:07:38 -04:00
BMagnu 967619ab09 Add options to selectively disable shadows (#4536)
* Add options to selectively disable shadows

* Encapsulate logic

* Add comment for new functions
2022-08-18 05:42:43 +09:00
Asteroth 6e7fcdaac7 copy script function from ai helpers to plain ships (#4539) 2022-08-17 14:33:06 -04:00
Asteroth 96d6b8bc3f error if they try to change this (#4549) 2022-08-17 14:31:51 -04:00
Goober5000 3d741cea93 Merge pull request #4427 from Goober5000/ai_goal_refinement
Ai goal refinement
2022-08-17 12:24:43 -04:00
JohnAFernandez 9d6cdd9d84 Multi collision fix (ship-ship) collisions (#4542)
Change Interpolation function to bool

And calculate last position instead of just setting it

This should help FSO prevent some very odd collision issues when two ships collide
2022-08-17 09:14:07 -04:00
Goober5000 7eee0f9164 reorder code 2022-08-17 00:37:28 -04:00
Asteroth 8dc9081244 add script function for turret num fire points (#4538) 2022-08-16 12:09:30 -04:00
wookieejedi 31dc7c2269 Fix misspelled ID name for in-game options (#4541)
Thanks to MjnMixael for catching this.
2022-08-15 17:03:52 +00:00
Goober5000 0ca8add409 Merge pull request #4535 from wookieejedi/fix-null-vec-calculations
Fix False Null MOI warnings
2022-08-15 00:33:36 -04:00
wookieejedi 48cd864a59 comment update 2022-08-13 22:16:06 -04:00
Kiloku 89b369cd07 Merge pull request #4352 from Kiloku/aspect_immune_ship_flag
Add new ship flag Aspect_immune
2022-08-14 01:00:19 +01:00
kiloku f78f94c1f0 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into aspect_immune_ship_flag 2022-08-13 19:33:18 -03:00
MageKing17 f2f4ade45e Automatically calculate length of flag name lists. (#4532)
`Ai_flag_names[]`, `Object_flag_names[]`, and `Ship_flag_names[]` all had an associated `#define` containing their length that had to manually be incremented whenever new flag names were added to the list. This commit instead makes the number of flags in the list be computed by simple `sizeof` division, so now adding a new entry just requires adding the entry, rather than remembering to bump a `#define`. Tested in FRED to make sure populating `OPF_SHIP_FLAG` entries still works.
2022-08-13 13:30:06 -04:00
wookieejedi 294b8bd9ec appease clang 2022-08-13 10:58:32 -04:00
wookieejedi 4074cf4c9c Fix False Null MOI warnings
In #4443, `fl_near_zero` was set to use default epsilon values in the `IS_VEC_NULL` check. In this comparison, epsilon is the wrong threshold because it used to have a much smaller threshold. The fix restores the previous definitions of `IS_VEC_NULL` and `IS_VEC_NULL_SQ_SAFE` by exposing the epsilon value as an optional parameter (similar to how `IS_NEAR_ZERO` used to work. This PR also restores `IS_VEC_NULL_SQ_SAFE` where it was replaced by `IS_VEC_NULL.`
2022-08-13 09:59:10 -04:00
wookieejedi 8420e00ee1 Allow Mods to specific default multi update speeds (#4531)
Previosuly, the default object update speed setting for new players was `High`. Many mods, such as Fate of the Galaxy, do multiplayer tests where we have to ensure players are using the highest object update speed, which is LAN. This extra step is cumbersome and prone to players' forgetfulness.

This PR allows mods to set the default multiplayer object update speed for new pilots to mitigate this issue. Tested and works as expected.
2022-08-13 08:57:18 -04:00
Kiloku f767190ce8 Merge branch 'scp-fs2open:master' into aspect_immune_ship_flag 2022-08-13 12:30:04 +01:00
Goober5000 165db5d28b Merge pull request #4400 from Goober5000/lua_frame_cleanup
clean up Lua frame handling a bit
2022-08-12 21:29:20 -04:00
Goober5000 5f1ab9bfa8 Merge pull request #4442 from Goober5000/turret_barrel_fov
add ships.tbl override for turret fov
2022-08-12 21:28:49 -04:00
kiloku da51f480ed Yet another formatting fix 2022-08-12 14:27:17 -03:00
kiloku fa494aa8ce Fix comment formatting 2022-08-12 12:52:04 -03:00
kiloku 4e29b31ed8 Merge branch 'Kiloku-aspect_immune_ship_flag' into aspect_immune_ship_flag 2022-08-12 11:45:33 -03:00
kiloku a90e95bb33 Merge branch 'aspect_immune_ship_flag' of https://github.com/Kiloku/fs2open.github.com into Kiloku-aspect_immune_ship_flag 2022-08-12 11:42:17 -03:00
Goober5000 dfeb15f8e5 more cleanup in preparation for model translation (#4443)
* more cleanup in preparation for model translation

1) Clean up stepped rotation, fixing some logic, adding safeguards for invalid values, and allowing rotations to go in the opposite direction
2) Add more specific SEXP error checking for AWACS and rotating subsystems
3) Assorted refactoring and polishing

* address feedback, plus a bit of extra cleanup
2022-08-11 08:17:17 -04:00
JohnAFernandez 7733f2b0bb Only check that ships have left the mission (#4511) 2022-08-11 08:16:08 -04:00
Goober5000 5a6b389916 Merge pull request #4518 from Goober5000/hud_gauges_ux
don't prune HUD gauges by resolution in FRED
2022-08-09 19:55:50 -04:00
Goober5000 59f0b7eddf Merge pull request #4464 from Goober5000/must_go_faster
add x500 and x1000 movement speeds
2022-08-09 19:55:36 -04:00
Goober5000 ed1bce988f only attenuate a persistent sound by engine strength if it's an engine sound (#4506)
Previously the persistent object sound management code would attenuate all script-assigned sounds by engine strength, and would not play them at all if the engine was off.  This fixes the code to only apply that logic if the sound is in fact and engine sound.
2022-08-09 10:32:58 -04:00
Asteroth 53cb148180 bugfix for salvo mode and forced target (#4508) 2022-08-09 10:32:28 -04:00
JohnAFernandez f2f00cdb6e Bump to 22.3 (#4529) 2022-08-09 07:36:19 -04:00
MageKing17 7bd18faafa Add optional suffixes to add to inherited damage types.
This allows you to automatically append, for example, "-shock" to the damage type to make the shockwave damage type, so a weapon with "Heavy" damage type would automatically have its shockwave assigned the damage type "Heavy-shock".
2022-08-06 23:04:01 -07:00
MageKing17 9869f2f8d5 Allow shockwaves to have a default damage type.
This includes both separate defaults for dinky and non-dinky shockwaves, as well as automatic inheritance of the parent weapon's damage type (and if both are enabled simultaneously, the default is only used if there's nothing to inherit because the parent weapon doesn't set a damage type).
2022-08-06 23:04:01 -07:00
MageKing17 372f96cfc0 Const-correctness for damage_type_add() and damage_type_get_idx().
Neither of these modify their input, so the argument not being `const` was just stopping `const` strings from being used as input.
2022-08-06 23:04:01 -07:00
Tyler Blount 8038422eda Capture empty strings too 2022-08-06 16:21:18 -07:00
Tyler Blount dca5d84ae6 Merge pull request #4502 from Kiloku/markdown-testing
Preliminary Changelog for 22.2.0
2022-08-06 15:22:35 -07:00
Kiloku c5bd3ba96e Update Changelog.md 2022-08-05 09:31:30 -03:00
Kiloku f75837922e Formatting fix 2022-08-05 09:30:56 -03:00
Kiloku 71fc9cc37b Update Changelog.md 2022-08-05 09:25:19 -03:00
JohnAFernandez 6359cb973c Merge pull request #4526 from JohnAFernandez/Allow-OBJ-GHOST-in-Assert
Add OBJ_GHOST to this assert and add comments
2022-08-04 19:59:06 -04:00
John Fernandez bafa6d9896 Add OBJ_GHOST to this assert and add comments
This assert catches any weapon's parent object type, which can include OBJ_GHOST, which is a dead player.  OBJ_GHOST is being encountered in this function using BPC when the player dies via beam weapon and (likely) when the players weapon are hitting an enemy ship at the same time.  Because the player ship can damage an enemy after it is dead, allow for that in this function.
2022-08-03 10:34:39 -04:00
Kiloku 7f1310bef5 Update Changelog.md 2022-08-03 09:19:55 -03:00
Goober5000 d48cab0fce mission-specific cutscene enhancements
Add `$Post-debriefing Cutscene:`, and make `$Post-briefing Cutscene:` a synonym for `$Pre-game Cutscene:`.
2022-08-01 20:58:19 -04:00
Goober5000 8c7f9e5e9e don't prune HUD gauges by resolution in FRED
FRED needs to work with any HUD gauge in the table, so don't prune any based on resolution.  Fixes #4517.

This also improves checking for duplicate names in the FRED gauge list.
2022-07-30 17:31:48 -04:00
Kiloku 6095e2ae1c Hopefully final changelog version for 22.2.0! 2022-07-28 07:42:59 -03:00
Kiloku f24a8e6876 Add changes up to RC8 2022-07-25 08:51:54 -03:00
Kiloku a1973e323e Move item to the correct category. 2022-07-25 08:51:27 -03:00
Kiloku 72d9d86008 Address feedback 2022-07-25 08:42:14 -03:00
Kiloku fec0c7a3b6 Merge branch 'scp-fs2open:master' into markdown-testing 2022-07-25 12:37:45 +01:00
Kiloku 4619ab6b59 Minor grammar, spelling and formatting fixes 2022-07-20 11:32:15 -03:00
Kiloku 4070013d8a Add changes up to RC7 2022-07-20 11:08:23 -03:00
Kiloku c8fac05fbe Update Changelog.md 2022-07-20 10:23:52 -03:00
Kiloku 0bc03a1dab Improve changelog from feedback 2022-07-20 10:21:40 -03:00
Kiloku b1c0793bff Preliminary Changelog for 22.2.0 2022-07-19 19:15:09 -03:00
Adam Leach 92d4820995 Fix envmap shading transparent pixels. 2022-07-16 17:46:41 +01:00
Adam Leach 6b6b58fa9d specColor is already premultiplied by aoFactors.y 2022-07-13 23:38:14 +01:00
Adam Leach b8f0b8ec05 optimisation. with envmap, halfVec == normal by definition. 2022-07-13 23:22:23 +01:00
Adam Leach a8f1f668c1 Fixed bug where anti-glint could be too strong 2022-07-13 23:12:35 +01:00
Adam Leach d2d7f17385 moved anti-glint so IBL glint prevented too. 2022-07-13 23:12:11 +01:00
John Fernandez 4b23a1bd44 Feedback 2022-07-12 21:33:16 -04:00
John Fernandez 9f40a341cc Allow multilock between traitors
Use the proper attacking function here, as traitors need to be able to attack each other in dogfight mode.
2022-07-12 21:24:30 -04:00
Goober5000 826dfd01fc clean up Lua frame handling a bit
There's no need to keep all this infrastructure to run every frame for a barely used situation.  This cleans it up a bit and does the position reset in the actual drawString function.
2022-07-08 18:59:10 -04:00
Goober5000 67d8d56dd0 add a message if the copy detects inconsistent personas 2022-07-08 18:55:08 -04:00
Goober5000 b95e04743e restrict to wingman personas rather than fighter/bombers 2022-07-08 00:30:10 -04:00
Goober5000 495010275b add helpful dialog box 2022-07-06 12:08:38 -04:00
Goober5000 4b686359ec tweak dialog and add note 2022-07-05 22:53:26 -04:00
Goober5000 09e72fe917 bugfixes 2022-07-05 22:43:58 -04:00
Goober5000 7c019c4157 implement functions 2022-07-05 22:43:58 -04:00
Goober5000 bc44909501 constify 2022-07-05 21:14:30 -04:00
Goober5000 f942837785 stub out functions 2022-07-05 20:56:03 -04:00
Goober5000 72355be198 FRED UI for new voice acting buttons 2022-07-05 20:49:27 -04:00
Adam Leach af1da1c93f Potential fix for warp portal envmap lighting? 2022-07-04 10:42:31 +01:00
Goober5000 d0d22f04a7 add x500 and x1000 movement speeds
As requested by Asteroth.
2022-07-02 13:26:27 -04:00
Goober5000 abb81c6eaa add ships.tbl override for turret fov
Add `$Turret Barrel FOV:` option for turrets in ships.tbl, as requested by CP5670.
2022-06-25 18:42:50 -04:00
the-maddin ddeb40aa61 checks fix 2022-06-25 00:19:11 +02:00
Goober5000 5b87f62d6a add optional distance to ai-stay-near-ship 2022-06-19 19:04:45 -04:00
Goober5000 b0057e959d move ai goal stuff to aigoals.h 2022-06-19 19:04:44 -04:00
Adam Leach 5e4d6cc5de Implement IBL based off envmaps
Fixed environment map rendering


shift fresnel term to match ordering of ComputeGGX, document shader code.


Envmaps: Use tangentMatrix to build local coordinate system 


Fixed geometry self-shading calcs to improve shading of rough surfaces.


Cite paper correctly


optimsed env sampling 


Put envmap face generation a loop to make it easier to read


Precalculate points on circle for even faster envmap sampling..


Guard against NaNs


Revert to simpler envmap calcs, significantly faster on slower GPUs.


typo


We don't need the sample points any more.


Diffuse IBL shading


Fix gamma issues in envmap rendering


AO term on envmaps.


fix lab crash with retail data


Always render envmaps - PBR shouldn't care if a shine/specmap exists.
2022-06-18 19:57:54 +01:00
Adam Leach 5f4566620f UE4 based shaders
Better approximation in geometry/visibility term
Fixed Fresnel/Schlick model to be dependent on view in line with learn openGL PBR theory
introduce energy conservation term for diffuse rendering

Just use specColor instead of trying to figure out metalness.


Pull out g1 function for reuse


UE4 based shaders

Better approximation in geometry/visibility term
Fixed Fresnel/Schlick model to be dependent on view in line with learn openGL PBR theory
introduce energy conservation term for diffuse rendering

Just use specColor instead of trying to figure out metalness.


Pull out g1 function for reuse
2022-06-18 19:57:12 +01:00
the-maddin db68e30862 fix qvector error 2022-06-13 23:02:48 +02:00
David Gibson e78157908d fixed some mishandling of lighting modifiers. 2022-06-12 18:51:08 -05:00
the-maddin a1fc0907cf unified warning message handling 2022-06-13 01:00:04 +02:00
The Force 16d32f3730 Fix text entry
Try and fix editable dropdowns
Change  pass-by value rather than refrence
2022-06-12 02:24:19 +01:00
the-maddin 2c5f52a28d Integrated error checking
numbered to reflect campaigntreewnd.cpp
2022-06-12 02:04:12 +02:00
The Force 1e7cdbda47 Move All Ship Editor file so subfolder
Move All Ship Editor file so subfolder so it easier to navigate
2022-06-11 00:02:42 +01:00
The Force 7b04b3b27a Missed bit 2022-06-10 23:27:14 +01:00
The Force 13f3322ae8 Address Feedback 2022-06-10 23:24:34 +01:00
David Gibson 70b9c34f1a move techroom/selection/breifing 'room' lights to a common function and
augment lighting setup for current rendering
2022-06-04 20:40:12 -05:00
the-maddin 3d5ae71fc6 Merge remote-tracking branch 'refs/remotes/upstream/master' into qt-campaign-editor 2022-06-04 23:46:34 +02:00
the-maddin 5d0fadba19 doxy 2022-06-04 23:46:16 +02:00
kiloku 69d3f47e34 Re-added missing linebreak in ship flag list 2022-06-04 14:02:54 -03:00
kiloku ecbebfab00 Fix some undesired whitespace changes 2022-06-04 13:26:28 -03:00
kiloku aecc626634 Add new ship flag Aspect_immune which stops ships from being locked onto by aspect seeking weapons 2022-06-04 12:54:16 -03:00
David Gibson 13180db544 Merge remote-tracking branch 'origin/master' into light-flags-rubicon-2 2022-06-03 15:50:26 -05:00
David Gibson a7b59b4620 further post-rebase repair of light flags command line and leftover specular 2022-06-03 15:39:08 -05:00
David Gibson ee72bcec69 cleanup of leftover/post-rebase specular references 2022-06-03 14:07:57 -05:00
David Gibson cfa7d1736b Removed specular light color as a separate value in the uniform buffers. 2022-06-03 13:27:06 -05:00
David Gibson 252d0cb56a handled specular sun depreciation and general removal of specular value handling 2022-06-03 13:27:05 -05:00
David Gibson 4e835bafdb revise command-line and emissive handling 2022-06-03 13:26:29 -05:00
David Gibson 33f8109dfb make static some functions that can be static 2022-06-03 13:26:05 -05:00
David Gibson 89e17ec2f1 cleanup unused new function 2022-06-03 13:26:05 -05:00
David Gibson d73f8bf968 Wire lab up to new lighting controls, and provide backwards-compatible defaults for emissive. 2022-06-03 13:26:05 -05:00
David Gibson 6ee2699f51 Switched over to new command line arguments 2022-06-03 13:26:05 -05:00
David Gibson 23a46dcb65 Applying directional brightness profile value, disconnected spec flags and made specular light always equal to diffuse light 2022-06-03 13:22:54 -05:00
The Force 9a04166d9f Add comment to address feedback
Add comment
2022-05-25 16:13:49 +01:00
The Force f86a869509 Change class to dialog rather than widget 2022-05-25 16:13:49 +01:00
The Force e4cadff3f5 const initial status editor
Finish Consting
2022-05-25 16:13:49 +01:00
The Force 465c8cb2d4 More Doxy and clarify function names
Finish doxy ship editor
2022-05-25 16:13:49 +01:00
The Force 9acc16dde3 Properly encapsulate data 2022-05-25 16:13:49 +01:00
The Force 6fc5f2e979 Fix crash bug with cargo 2022-05-25 16:13:49 +01:00
The Force a6665320e9 Add clang fixies that accidently got removed 2022-05-25 16:13:49 +01:00
The Force 9100cc9bc5 Const Parameters
Properly privatise and const model data
2022-05-25 16:13:49 +01:00
the-maddin 2eb6410de8 Merge branch 'master' into qt-campaign-editor 2022-05-22 22:36:23 +02:00
the-maddin 401a26623a changes z64555 v1.4 2022-05-22 15:17:31 +02:00
the-maddin 9336d7264f changes z64555 v1.3 2022-05-22 14:17:15 +02:00
The Force 6024b0026f Convert to unique_ptr 2022-05-18 18:59:53 +01:00
The Force 4320760e8e Merge branch 'master' into fix/shipEditorCleanup 2022-05-18 18:16:26 +01:00
The Force a20afd147e Doxygen Ship Editor 2022-05-17 19:27:49 +01:00
The Force cea490ab62 Constify Ship Editor
Add missed lines
2022-05-17 17:42:56 +01:00
The Force 20faa3083d Merge branch 'master' into fix/shipEditorCleanup 2022-05-17 15:18:57 +01:00
The Force 65ef9e3ac4 Fix references to changed name 2022-05-15 13:34:53 +01:00
The Force 42e2870410 Merge branch 'feature/shipTBLViewer' into fix/shipEditorCleanup 2022-05-15 13:32:56 +01:00
The Force ca3bc07959 More descriptive Name 2022-05-15 13:31:15 +01:00
the-maddin ec3ad17fa2 changes z64555 v1.2 2022-05-09 01:35:15 +02:00
the-maddin d9a9cb5f9d changes z64555 v1.1 2022-05-09 01:34:47 +02:00
The Force f21ac8fd04 Clean-up Special stats dialog 2022-05-04 03:43:17 +01:00
The Force cb36670ce0 Clang-tidy 2022-05-04 03:39:01 +01:00
The Force bc2be1cbdf Clean-up Player orders dialog 2022-05-04 03:36:06 +01:00
The Force fa4c49e951 Clean-up Texture Replacement 2022-05-04 03:23:34 +01:00
The Force b6e259e374 Clean-up Flags Dialog 2022-05-04 03:05:52 +01:00
The Force ab307fe4a6 Clean-up Initial Status Dialog 2022-05-04 02:58:41 +01:00
The Force 9e8982edb4 GCC Appeasement 2022-05-01 20:22:08 +01:00
The Force 9afe340f46 Cleqanup Goals Dialog 2022-05-01 20:05:24 +01:00
The Force c07a679d87 Add TBL VIewer 2022-05-01 19:20:11 +01:00
The Force ba2ef3cb9d Fix newtype loading 2022-05-01 18:45:27 +01:00
The Force 30537a2ce9 Clang fix 2022-04-30 23:56:04 +01:00
The Force 328d3cce8c Try to avoid trigraph error 2022-04-30 23:43:18 +01:00
The Force b18f9ecee0 More GCC 2022-04-30 23:41:04 +01:00
The Force a5dbc27018 Cater to gcc 2022-04-30 23:33:58 +01:00
The Force c18ae68d65 Missed this 2022-04-30 23:29:29 +01:00
The Force 6c22137075 Change to new dialog loading style 2022-04-30 23:27:26 +01:00
The Force 41a3d9561d Add Tooltips 2022-04-30 23:16:04 +01:00
The Force e3228c0241 Fix Crash Bug 2022-04-30 18:02:49 +01:00
The Force b63da42715 Memory Cleanup 2022-04-30 16:44:19 +01:00
The Force 9d6f729f81 Add TBL Viewer 2022-04-30 14:48:00 +01:00
the-maddin 0a7ff1bc1a changes jg18 v3 2022-04-29 01:28:37 +02:00
the-maddin e5f80a160a incorporate feedback 2022-04-21 00:32:36 +02:00
the-maddin e3a153ef5b Clarify abbreviations 2022-04-11 23:36:39 +02:00
the-maddin ccf86293ce incorporate feedback 2022-03-29 00:59:59 +02:00
the-maddin f142780b95 clang 2022-03-25 00:55:49 +01:00
the-maddin 48f99e36b0 Merge branch 'master' into qt-campaign-editor 2022-03-25 00:22:45 +01:00
the-maddin 8bf51ff858 fix CheckedDataListModel pointer issue
(cherry picked from commit 3d4c03ede65657c38d5271cd70caa2e0eedef6bf)
2022-03-25 00:15:18 +01:00
the-maddin 84cb7fddba Export campaign model to Campaign struct
(cherry picked from commit 00ca3070063ba9859d316ac5e5da27aa67084561)
2022-03-25 00:15:15 +01:00
the-maddin 566d15dfec Add first mission selection, always keep valid
(cherry picked from commit 961a58a9b6bc261b6d11bf37a90bd457f602edc0)
2022-03-25 00:15:12 +01:00
the-maddin 0d82ca5be2 clang stuff
(cherry picked from commit 3ca042cc115372043527b94156faeb69b542aac7)
2022-03-25 00:15:06 +01:00
the-maddin 4857f320ad Saving part 2: Campaign Specs to Campaign
Move model Campaign Steps to engine campaign
struct

(cherry picked from commit 796eae1a8e003ba9b704692d460f909c20f49970)
2022-03-25 00:15:02 +01:00
the-maddin 636f6933be Ensure correct flags and loop state
(cherry picked from commit 68583f28cffa37a284b236173c29f11bf8ede1c5)
2022-03-25 00:14:58 +01:00
the-maddin a8483c5a8a Saving part 1: Output Campaign to file
Output a Campaign with ordered cmissions to a file,
like it is read.
This version does not depend on any FRED model/
implementation.

(cherry picked from commit c8aa141295de9f45813bc2bb762f3f2290ebad6d)
2022-03-25 00:14:53 +01:00
the-maddin 5eb4c35572 clang msvc
(cherry picked from commit 6faa6d41d87fdca6c9acc24b080451cd3fbfce59)
2021-09-28 22:46:30 +02:00
the-maddin 15752d1729 Integrate branch buttons into context menu
(cherry picked from commit fb986ea29efd7e9612d76e0722733d33a2f95aa3)
2021-09-28 20:23:13 +02:00
the-maddin 413842c84a Branch moving & branch UI misc
(cherry picked from commit 9ecb5b734de149ad85e2ad3c4409a20714b4f96a)
2021-09-28 20:23:13 +02:00
the-maddin e41bde6dad Fix branch sexptree popup menu part 3
(cherry picked from commit 4cd06c05b56518ac92ca0d63203437a7fa38de6c)
2021-09-28 20:23:13 +02:00
the-maddin e37ca8fd8e Model data access fix
(cherry picked from commit
effea261ecb607c09422ec9973522b02821bee6e)
2021-09-28 20:23:13 +02:00
the-maddin e2099271c6 Fix branch sexptree popup menu part 2
(cherry picked from commit 53d5d25c3a21876b3246af3eeff91ded7c37b678)
2021-09-28 20:23:13 +02:00
the-maddin 19817f4cda reorder model impl and lazy init some constants
(cherry picked from commit f2b2385a27b52a2088421c203560309e38444fcd)
2021-09-28 20:23:13 +02:00
the-maddin c41e5c9d7f Always replace corrupted model after load attempt
(cherry picked from commit ed8be26f81e80b72e147ea54b54b7440606e302c)
2021-09-28 20:23:13 +02:00
the-maddin b08109c2fe Fix branch sexptree popup menu part 1
(cherry picked from commit 17319ea5deb48e4ac27af804033dabc5907e781f)
2021-09-28 20:23:13 +02:00
the-maddin 30b484b276 Use AssociatedPlainTextDocument
(cherry picked from commit 5abb00e4382840e04474905f1477121173bd986a)
2021-09-28 20:23:13 +02:00
the-maddin 2989034394 Dialog cleanup
(cherry picked from commit 024be9d0e6d3c447c6b2bc972be4dddc9b31bfc2)
2021-09-28 20:23:13 +02:00
the-maddin eec2ce1713 Model structure and TextEdit cleanup
(cherry picked from commit 306de2da527128583841f0cb73363fb5ca222b16)
2021-09-28 20:23:13 +02:00
the-maddin 439f633364 Add branches & conditions in model
(cherry picked from commit 730bf0d9d5ff55b1b0e99c73c79ce12e5af67d48)
2021-09-28 20:23:13 +02:00
the-maddin 458d2f5e12 custom mission selection & linking context menu
(cherry picked from commit 31d2b9d0e02c803fa06b369772d754da70187c3c)
2021-09-28 20:23:13 +02:00
the-maddin 2f361340fc Parse eligible & campaign missions for event names
(cherry picked from commit 62a6ae9f6fc8cb7955b7804aeb951564c5bd3bd0)
2021-09-28 20:23:13 +02:00
the-maddin 41d65630f8 validate and use current branch index
(cherry picked from commit 072796d1f76325ec5e9be38c899951420d3ea781)
2021-09-28 20:23:13 +02:00
the-maddin 5e57094f8e Merge branch 'master' into qt-campaign-editor 2021-09-19 14:27:07 +02:00
the-maddin ae9b604f44 Merge branch 'master' into qt-campaign-editor 2021-06-29 23:31:08 +02:00
the-maddin 8db39a6c61 WIP note
(cherry picked from commit fdd2b54af8c4a9ca7f1370dfba09f277a78edc3c)
2021-06-29 23:27:58 +02:00
the-maddin ec84c7183e comboBox tweak
(cherry picked from commit cf0232f33f20b27ffa03ff2ee4ed6590822f149c)
2021-06-29 23:27:54 +02:00
the-maddin 16a5b1ccc7 Improve mission list robustness 2021-06-29 01:14:11 +02:00
the-maddin 856726d000 pick pulled model changes 2021-06-29 01:14:07 +02:00
the-maddin dd2c5a22a4 Comboboxes for loop brief & anim
also cmbBox cleanup
2021-06-29 01:12:35 +02:00
the-maddin b97129da86 Cleanup mission list loading, drop mission object 2021-06-29 01:10:56 +02:00
the-maddin a7badba0d8 cleanup 2021-06-29 01:10:52 +02:00
the-maddin 93a1f3e6b4 Use finer UI update control instead of modelChanged 2021-06-29 01:10:29 +02:00
the-maddin b19399021d load and display loop data 2021-06-29 01:08:38 +02:00
the-maddin c95fe1c9d1 clang
(cherry picked from commit 488dcdb1cc762d51826409df6d239fbad978a1e6)
2021-06-20 12:54:51 +02:00
the-maddin f405496791 Clang-tidy fixes 2021-06-20 01:21:32 +02:00
the-maddin 33b63e5b6c Implement FRED-Mission button 2021-06-20 00:56:10 +02:00
the-maddin b64bd789b6 Some more clang fixes 2021-06-20 00:56:10 +02:00
the-maddin 9011319e2f Use new CheckedDataListModel 2021-06-20 00:56:10 +02:00
the-maddin 3fd825b1de SaveAs shortcut 2021-06-20 00:56:10 +02:00
the-maddin b21d380240 Handle branch tree selection 2021-06-20 00:56:10 +02:00
the-maddin c2e8ba9fa6 Use campaign branch sexp_tree and load formulas 2021-06-20 00:56:10 +02:00
the-maddin 61fb9c5dd1 CMission Data: use combo boxes where possible 2021-06-20 00:56:10 +02:00
the-maddin f7ecb85df6 CampaignMissionData: load cmission, display
editable cmission data

Also make CheckedDataList construction translator
callbacks explicitly const.
2021-06-20 00:56:10 +02:00
the-maddin 144ae46ccc model initialisation cleanup 2021-06-20 00:56:10 +02:00
the-maddin 1a81682472 Show player number of multi campaigns
according to first mission.
2021-06-20 00:56:10 +02:00
the-maddin 3349c99a0a Clean up data entry widget signalling 2021-06-20 00:56:10 +02:00
the-maddin 6e2723a313 Update widgets on mission selection change 2021-06-20 00:56:10 +02:00
the-maddin 9241c49f32 Warn before dropping unloadable missionDropped
because it won't be shown for re-selection after
next load of campaign
2021-06-20 00:56:10 +02:00
the-maddin 80fc7a5cbf gcc11: add missing include
(cherry picked from commit 9959cdad5535abf56a156f1924d260a64e688d57)
2021-06-20 00:56:10 +02:00
the-maddin ca982fa1ae Immutable campaignType, file load & menu changes
Since the campaign type determines the compatible
missions, changing it would require invalidating
the mission list. So I'm restricting it to being
set on campaign creation.
2021-06-20 00:56:10 +02:00
the-maddin 20fc9d629c Create available mission list
Unlike FRED, I'm using a checked list of all
missions, not a simple list of the unused ones.
I'm showing uneditable / packaged missions
in yellow, missing / unloadable missions in red.
Also keeping missions loaded.
2021-06-20 00:56:10 +02:00
the-maddin 881f47670c Use CheckedDataListModel improvements
Make necessary changes and improvements
in model usage.
2021-06-20 00:56:10 +02:00
the-maddin 54a64cb91e Deal with windows filenames in CFile
(cherry picked from commit 0ed5a18fd9883166bbef8360ae9f2cfed3ae7f69)
2021-06-20 00:56:10 +02:00
the-maddin 232eb2a099 Allow full-length paths for campaign files
so qtfred can load them fro outside the cfile tree.
2021-06-20 00:56:10 +02:00
the-maddin fc65df048f Register initial... lists changes 2021-05-06 00:48:37 +02:00
the-maddin f2cfac14b3 Fix compile issue, correct reload behaviour 2021-05-06 00:37:10 +02:00
the-maddin 5cbe64c793 Implement initial ships/weapons lists, intialize
model by loading campaign file
2021-05-06 00:03:15 +02:00
the-maddin e2b9a5a1a2 Initial campaign loading & trivial uiUpdate
functionality
2021-05-06 00:03:08 +02:00
the-maddin da83c3aa41 Tie campaignmodel to campaign file, use QStrings in
model

String conversion should happen on load/save, not
every UI update/cahnge
2021-05-06 00:02:58 +02:00
the-maddin 30237c8988 initial updateUI, explicit model modification
flagging
2021-05-06 00:02:56 +02:00
the-maddin ca23d30c99 File ops UI logic, cleanup 2021-05-06 00:02:43 +02:00
the-maddin 53e30ba771 Connect some more signals/slots 2021-05-06 00:00:46 +02:00
the-maddin c4f84ea9f5 alternative layout 2021-05-05 23:58:50 +02:00
the-maddin 7acd4c6491 sync changes to model (initial) 2021-05-05 23:58:50 +02:00
the-maddin 04c136f59e add model with initial functionality 2021-05-05 23:58:50 +02:00
the-maddin 3768473270 Add more slots 2021-05-05 23:58:50 +02:00
the-maddin 52427a7ec3 Add initial CampaignEditorDialog
ui with most basic functionality
2021-05-05 23:58:50 +02:00
Goober5000 676fb4b17d better stats handling when switching or resetting campaigns 2017-08-26 16:40:16 -04:00
3208 changed files with 566237 additions and 277309 deletions

No files matched your search

+14 -1
View File
@@ -4,20 +4,28 @@ modernize-*,\
-modernize-avoid-c-arrays,\
-modernize-make-unique,\
-modernize-raw-string-literal,\
-modernize-use-default-member-init,\
-modernize-use-nodiscard,\
-modernize-use-trailing-return-type,\
-modernize-use-using,\
performance-*,\
-performance-no-int-to-ptr,\
-performance-type-promotion-in-math-fn,\
misc-*,\
-misc-include-cleaner,\
-misc-macro-parentheses,\
-misc-misplaced-widening-cast,\
-misc-no-recursion,\
-misc-non-private-member-variables-in-classes,\
-misc-static-assert,\
-misc-unused-parameters,\
-misc-use-anonymous-namespace,\
readability-*,\
-readability-avoid-const-params-in-decls,\
-readability-else-after-return,\
-readability-function-cognitive-complexity,\
-readability-function-size,\
-readability-identifier-length,\
-readability-identifier-naming,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
@@ -29,13 +37,18 @@ readability-*,\
"
WarningsAsErrors: ''
HeaderFilterRegex: 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$'
AnalyzeTemporaryDtors: false
CheckOptions:
- key: 'misc-assert-side-effect.AssertMacros'
value: 'assert,Assert,Assertion'
- key: 'misc-const-correctness.AnalyzeValues'
value: 'false'
- key: 'misc-const-correctness.TransformValues'
value: 'false'
- key: 'modernize-use-emplace.ContainersWithPushBack'
value: 'std::vector;std::deque;std::list;SCP_vector;SCP_deque;SCP_list'
- key: 'readability-braces-around-statements.ShortStatementLines'
value: '4' # Avoid flagging simple if (...) return false; statements
- key: 'performance-move-const-arg.CheckTriviallyCopyableMove' # This isn't actually performance relevant, but using move on trivially copyable types can well indicate that the variable should not be used anymore, such as when passing a builder type to the finialization function
value: 'false'
...
-8
View File
@@ -1,14 +1,6 @@
cmake/ @asarium
ci/ @asarium @z64555
code/executor/ @asarium
code/scpui/ @asarium
code/scripting/ @asarium
code/controlconfig/ @z64555
code/model/modelanimation*.* @bmagnu
+196 -115
View File
@@ -5,48 +5,38 @@ on:
tags:
- 'nightly_*'
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [FastDebug, Release]
os: [ubuntu-latest, ubuntu-24.04-arm]
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-24.04-arm
arch: arm64
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
runs-on: ${{ matrix.os }}
container: ghcr.io/scp-fs2open/linux_build:sha-ab87451
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
COMPILER: gcc-9
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
run: |
LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
run: ninja -k 20 all
- name: Run Tests
working-directory: ./build
env:
@@ -59,33 +49,45 @@ jobs:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: linux-${{ matrix.configuration }}
name: linux-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/install/*.AppImage
linux_zip:
name: Build Linux distribution zip
needs: build_linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v8
with:
name: linux-Release
name: linux-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: linux-FastDebug
name: linux-FastDebug-${{ matrix.arch }}
path: builds
- name: Fix permissions
working-directory: ./builds
shell: bash
run: chmod 755 *.AppImage
- name: Create Distribution package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Linux
- name: Upload result package
working-directory: ./builds
@@ -100,106 +102,169 @@ jobs:
strategy:
matrix:
configuration: [FastDebug, Release]
arch: [Win32, x64]
simd: [SSE2]
os: [windows-2025, windows-11-arm]
arch: [Win32, x64, ARM64]
simd: [SSE2, ""]
exclude:
- arch: Win32
os: windows-11-arm
- arch: x64
os: windows-11-arm
- arch: ARM64
os: windows-2025
- os: windows-2025
simd: ""
- os: windows-11-arm
simd: SSE2
name: Windows
runs-on: windows-2019
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
- name: Cache Qt
id: cache-qt-win
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Configure CMake
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install v143 ATL/MFC
shell: pwsh
run: ci/windows/install_v143_atlmfc.ps1
# Tree A: static CRT (/MT) for FSO + FRED2 (no Qt dependency needed)
- name: Configure CMake (static CRT /MT - FSO + FRED2)
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
- name: Compile
working-directory: ./build
mkdir build-mt
cd build-mt
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \
-DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_TESTS=ON -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \
-DFSO_BUILD_QTFRED=OFF -G "Visual Studio 18 2026" -T "v143" \
-DCMAKE_BUILD_TYPE=$CONFIGURATION ..
- name: Compile (static CRT)
working-directory: ./build-mt
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
cmake --build . --config "$CONFIGURATION" --target INSTALL -- /verbosity:minimal
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
cmake --install . --config "$CONFIGURATION"
ls -alR "$(pwd)/install"
# Tree B: dynamic CRT (/MD) for QtFRED only (matches Qt's prebuilt /MD runtime)
# Skipped on Win32: Qt6 has no 32-bit Windows support, so CMake force-disables
# FSO_BUILD_QTFRED there and the qtfred target would not exist
- name: Configure CMake (dynamic CRT /MD - QtFRED)
if: matrix.arch != 'Win32'
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
shell: bash
run: |
mkdir build-md
cd build-md
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \
-DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_TESTS=OFF -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_FRED2=OFF -DQT_USE_PRECOMPILED=ON \
-G "Visual Studio 18 2026" -T "v143" -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
- name: Compile (dynamic CRT)
if: matrix.arch != 'Win32'
working-directory: ./build-md
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
cmake --build . --config "$CONFIGURATION" --target qtfred -- /verbosity:minimal
cmake --install . --config "$CONFIGURATION" --component qtFRED
ls -alR "$(pwd)/install"
# Merge both trees into the single install dir the zip job consumes
- name: Merge installs
shell: bash
run: |
mkdir -p build/install
# build-md does not exist on Win32 (no QtFRED there)
if [ -d build-md/install ]; then
cp -r build-md/install/. build/install/
fi
cp -r build-mt/install/. build/install/
ls -alR build/install
- name: Run Tests
working-directory: ./build
working-directory: ./build-mt
env:
CONFIGURATION: ${{ matrix.configuration }}
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Set artifact id
shell: bash
run: |
id=
if [ -n "${{ matrix.simd }}" ]; then
id="${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}"
else
id="${{ matrix.configuration }}-${{ matrix.arch }}"
fi
echo "artifact_id=${id}" >> $GITHUB_ENV
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: windows-${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-${{ env.artifact_id }}
path: ${{ github.workspace }}/build/install/*
windows_zip:
name: Build Windows distribution zip
needs: build_windows
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [Win32, x64]
simd: [SSE2]
arch: [Win32, x64, ARM64]
simd: [SSE2, ""]
exclude:
- arch: Win32
simd: ""
- arch: x64
simd: ""
- arch: ARM64
simd: SSE2
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set artifact id
shell: bash
run: |
id=
if [ -n "${{ matrix.simd }}" ]; then
id="${{ matrix.arch }}-${{ matrix.simd }}"
else
id="${{ matrix.arch }}"
fi
echo "artifact_id=${id}" >> $GITHUB_ENV
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v8
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-Release-${{ env.artifact_id }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-FastDebug-${{ env.artifact_id }}
path: builds
- name: Create Distribution package
working-directory: ./builds
shell: bash
env:
ARCH: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
ID: ${{ env.artifact_id }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows
- name: Upload result package
working-directory: ./builds
@@ -216,30 +281,18 @@ jobs:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64]
arch: [x86_64, arm64]
name: Mac
runs-on: macos-latest
steps:
- name: Cache Qt
id: cache-qt-mac
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set up test version
shell: bash
run: |
@@ -255,45 +308,73 @@ jobs:
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
run: ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Sign builds
working-directory: ./build/bin
run: |
# make sure OpenAL framework is signed
find . -name OpenAL -type f | while read xx; do codesign --force -s - $xx; done
find . -name OpenAL.framework -type d | while read xx; do codesign --force -s - $xx; done
# make sure dylibs are signed
find . -name \*.dylib -type f | while read xx; do codesign --force -s - $xx; done
# sign binaries
find . -perm +111 -type f | grep MacOS | while read xx; do codesign --force -s - $xx; done
# sign apps
find . -name \*.app -maxdepth 1 | while read xx; do codesign --force -s - $xx; done
- name: Package build result
working-directory: ./build
run: cd bin && tar -cvzf macos-build.tar *.app
working-directory: ./build/bin
# Use GNU tar here (part of runner image) to avoid weird corruption bug with bsdtar
# Ref: https://github.com/actions/runner-images/issues/2619
run: gtar -cvzf macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz *.app
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: mac-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/bin/macos-build.tar
name: mac-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/bin/macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download Release builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: mac-Release
name: mac-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: mac-FastDebug
name: mac-FastDebug-${{ matrix.arch }}
path: builds
- name: Unpack builds
working-directory: ./builds
run: |
tar -xvzf macos-build-Release-${{ matrix.arch }}.tgz
tar -xvzf macos-build-FastDebug-${{ matrix.arch }}.tgz
- name: Create Distribution package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Mac
- name: Upload result package
working-directory: ./builds
+274 -121
View File
@@ -5,9 +5,6 @@ on:
tags:
- 'release_*'
env:
QT_VERSION: 5.12.9
jobs:
create_release:
name: Create GitHub release
@@ -41,69 +38,36 @@ jobs:
# Run this job for each configuration
# The current config running is accesible with `matrix.configuration`
configuration: [FastDebug, Release]
os: [ubuntu-latest, ubuntu-24.04-arm]
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-24.04-arm
arch: arm64
name: Linux
needs: create_release # Don't run this job until create_release is done and successful
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
runs-on: ${{ matrix.os }}
container: ghcr.io/scp-fs2open/linux_build:sha-ab87451
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
# cache the Qt directory so we don't have to reinstall it every time
# cache.inputs:
# path - A list of files, directories, and wildcard patterns to cache and restore. See @actions/glob for supported patterns.
# key - An explicit key for restoring and saving the cache
# restore-keys - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
# cache.outputs:
# cache-hit true when an exact match was found for the key, false otherwise.
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
# installs Qt in the action workflow
# install-qt-action.inputs:
# version desired qt version to install
# host Host platform of Qt, default to platform used by runs-on
# target target platform of Qt, default to desktop
# arch target architecture of Qt, only used for windows or android builds
# dir root dir Qt will be installed to
# install-deps if true, auto-install dependencies on linux. Default true
# modules whitespace delimited list string of additional addon modules to install
# archives whitespace delimited list string of Qt archives to install
# cached if true, Don't download Qt but set ENVARs; use with cache.outputs.cache-hit
# setup-python Set to false to skip using setup-python to find/download a valid python version
# set-env if true, set ENVARs; default = false
# aqtversion version of aqtinstall to use; default = 2.0.0
# py7zrversion version of py7zr to use; default = 0.16.1
# extra additional arguments to pass to aqinstall
# ENVARS set:
# Qt5_DIR / Qt6_DIR
# Qt bin dir appended to PATH
# QT_PLUGIN_PATH, QML2_IMPORT_PATH, PKG_CONFIG_PATH, LD_LIBRARY_PATH
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
# checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
name: Checkout
with:
submodules: true # `true` to checkout submodules, `recursive` to recursively checkout submodules
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
COMPILER: gcc-9
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
run: |
LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
run: ninja -k 20 all
- name: Run Tests
working-directory: ./build
env:
@@ -116,7 +80,7 @@ jobs:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
# Upload the url file for use with other runners
# upload-artifact.inputs:
# if-no-files-found=warn What to do if path fails to find any files.
@@ -127,39 +91,52 @@ jobs:
# 0 Use default retention policy of the repo
# 1~90 Min 1, Max 90 days to keep the artifact unless changed by repo settings page
with:
name: linux-${{ matrix.configuration }}
name: linux-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/install/*.AppImage
linux_zip:
name: Build Linux distribution zip
needs: build_linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0' # value 0 to fetch all history and tags for all branches
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download Release builds
# Grab the release builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: linux-Release
name: linux-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
# Grab the debug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: linux-FastDebug
name: linux-FastDebug-${{ matrix.arch }}
path: builds
- name: Fix permissions
working-directory: ./builds
shell: bash
run: chmod 755 *.AppImage
- name: Create Distribution package
# Zip both builds together
id: generate_package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Linux
- name: Upload result package
# Stash the result to artifact filespace
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
@@ -175,109 +152,175 @@ jobs:
strategy:
matrix:
configuration: [FastDebug, Release]
arch: [Win32, x64]
simd: [SSE2, AVX]
os: [windows-2025, windows-11-arm]
arch: [Win32, x64, ARM64]
simd: [SSE2, AVX, ""]
exclude:
- arch: Win32
os: windows-11-arm
- arch: x64
os: windows-11-arm
- arch: ARM64
os: windows-2025
- os: windows-2025
simd: ""
- os: windows-11-arm
simd: SSE2
- os: windows-11-arm
simd: AVX
needs: create_release
name: Windows
runs-on: windows-2019
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v7
# Checkout repo
name: Checkout
with:
submodules: true
- name: Cache Qt
# Cache Qt
id: cache-qt-win
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
# Install Qt 32bit if matrix.arch == Win32
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
# Install Qt 64bit if matrix.arch == x64
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Configure CMake
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install v143 ATL/MFC
shell: pwsh
run: ci/windows/install_v143_atlmfc.ps1
# Tree A: static CRT (/MT) for FSO + FRED2 (no Qt dependency needed)
- name: Configure CMake (static CRT /MT - FSO + FRED2)
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
- name: Compile
working-directory: ./build
mkdir build-mt
cd build-mt
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \
-DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_TESTS=ON -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \
-DFSO_BUILD_QTFRED=OFF -G "Visual Studio 18 2026" -T "v143" \
-DCMAKE_BUILD_TYPE=$CONFIGURATION ..
- name: Compile (static CRT)
working-directory: ./build-mt
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
cmake --build . --config "$CONFIGURATION" --target INSTALL -- /verbosity:minimal
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
cmake --install . --config "$CONFIGURATION"
ls -alR "$(pwd)/install"
# Tree B: dynamic CRT (/MD) for QtFRED only (matches Qt's prebuilt /MD runtime)
# Skipped on Win32: Qt6 has no 32-bit Windows support, so CMake force-disables
# FSO_BUILD_QTFRED there and the qtfred target would not exist
- name: Configure CMake (dynamic CRT /MD - QtFRED)
if: matrix.arch != 'Win32'
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
shell: bash
run: |
mkdir build-md
cd build-md
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \
-DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_TESTS=OFF -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_FRED2=OFF -DQT_USE_PRECOMPILED=ON \
-G "Visual Studio 18 2026" -T "v143" -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
- name: Compile (dynamic CRT)
if: matrix.arch != 'Win32'
working-directory: ./build-md
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
cmake --build . --config "$CONFIGURATION" --target qtfred -- /verbosity:minimal
cmake --install . --config "$CONFIGURATION" --component qtFRED
ls -alR "$(pwd)/install"
# Merge both trees into the single install dir the zip job consumes
- name: Merge installs
shell: bash
run: |
mkdir -p build/install
# build-md does not exist on Win32 (no QtFRED there)
if [ -d build-md/install ]; then
cp -r build-md/install/. build/install/
fi
cp -r build-mt/install/. build/install/
ls -alR build/install
- name: Run Tests
working-directory: ./build
working-directory: ./build-mt
env:
CONFIGURATION: ${{ matrix.configuration }}
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Set artifact id
shell: bash
run: |
id=
if [ -n "${{ matrix.simd }}" ]; then
id="${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}"
else
id="${{ matrix.configuration }}-${{ matrix.arch }}"
fi
echo "artifact_id=${id}" >> $GITHUB_ENV
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: windows-${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-${{ env.artifact_id }}
path: ${{ github.workspace }}/build/install/*
windows_zip:
name: Build Windows distribution zip
needs: build_windows
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
fail-fast: false # Run the other jobs in the matrix instead of failing them
matrix:
arch: [Win32, x64]
simd: [SSE2, AVX]
arch: [Win32, x64, ARM64]
simd: [SSE2, AVX, ""]
exclude:
- arch: Win32
simd: ""
- arch: x64
simd: ""
- arch: ARM64
simd: SSE2
- arch: ARM64
simd: AVX
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set artifact id
shell: bash
run: |
id=
if [ -n "${{ matrix.simd }}" ]; then
id="${{ matrix.arch }}-${{ matrix.simd }}"
else
id="${{ matrix.arch }}"
fi
echo "artifact_id=${id}" >> $GITHUB_ENV
- name: Download Release builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-Release-${{ env.artifact_id }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-FastDebug-${{ env.artifact_id }}
path: builds
- name: Create Distribution package
@@ -285,18 +328,17 @@ jobs:
working-directory: ./builds
shell: bash
env:
ARCH: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
ID: ${{ env.artifact_id }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows
- name: Upload result package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
- name: Upload debug package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: ${{ steps.generate_package.outputs.debug_name }}
path: ${{ steps.generate_package.outputs.debug_path }}
@@ -310,11 +352,122 @@ jobs:
${{ steps.generate_package.outputs.package_path }}
${{ steps.generate_package.outputs.debug_path }}
build_mac:
strategy:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64, arm64]
name: Mac
needs: create_release
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: 0
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Sign builds
working-directory: ./build/bin
run: |
# make sure OpenAL framework is signed
find . -name OpenAL -type f | while read xx; do codesign --force -s - $xx; done
find . -name OpenAL.framework -type d | while read xx; do codesign --force -s - $xx; done
# make sure dylibs are signed
find . -name \*.dylib -type f | while read xx; do codesign --force -s - $xx; done
# sign binaries
find . -perm +111 -type f | grep MacOS | while read xx; do codesign --force -s - $xx; done
# sign apps
find . -name \*.app -maxdepth 1 | while read xx; do codesign --force -s - $xx; done
- name: Package build result
working-directory: ./build/bin
# Use GNU tar here (part of runner image) to avoid weird corruption bug with bsdtar
# Ref: https://github.com/actions/runner-images/issues/2619
run: gtar -cvzf macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz *.app
- name: Upload build result
uses: actions/upload-artifact@v7
with:
name: mac-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/bin/macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download Release builds
uses: actions/download-artifact@v8
with:
name: mac-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v8
with:
name: mac-FastDebug-${{ matrix.arch }}
path: builds
- name: Unpack builds
working-directory: ./builds
run: |
tar -xvzf macos-build-Release-${{ matrix.arch }}.tgz
tar -xvzf macos-build-FastDebug-${{ matrix.arch }}.tgz
- name: Create Distribution package
id: generate_package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Mac
- name: Upload result package
uses: actions/upload-artifact@v7
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
- name: Publish result package
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ steps.generate_package.outputs.package_path }}
post_build:
name: Post builds to Nebula and Forum
needs: [linux_zip, windows_zip]
needs: [linux_zip, windows_zip, mac_zip]
uses: ./.github/workflows/post-build-release.yaml
with:
linux_result: ${{ needs.linux_zip.result }}
windows_result: ${{ needs.windows_zip.result }}
mac_result: ${{ needs.mac_zip.result }}
releaseTag: ${{ github.ref_name }}
secrets: inherit
-53
View File
@@ -1,53 +0,0 @@
name: Publish Standalone docker image
on:
push:
tags:
- 'nightly_*'
- 'release_*'
jobs:
build_images:
if: github.repository == 'scp-fs2open/fs2open.github.com'
strategy:
matrix:
configuration: [FastDebug, Release]
include:
- configuration: FastDebug
tag_suffix: -debug
- configuration: Release
tag_suffix: ""
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/scp-fs2open/standalone_server
tag-latest: false
- name: Login to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/standalone/Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}${{ matrix.tag_suffix }}
labels: ${{ steps.docker_meta.outputs.labels }}
build-args: |
build_type=${{ matrix.configuration }}
+147 -108
View File
@@ -5,37 +5,28 @@ on:
branches:
- 'test/*'
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [FastDebug, Release]
os: [ubuntu-latest, ubuntu-24.04-arm]
include:
- os: ubuntu-latest
arch: x86_64
- os: ubuntu-24.04-arm
arch: arm64
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
runs-on: ${{ matrix.os }}
container: ghcr.io/scp-fs2open/linux_build:sha-ab87451
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set up test version
shell: bash
run: |
@@ -45,14 +36,13 @@ jobs:
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
COMPILER: gcc-9
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
run: |
LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
run: ninja -k 20 all
- name: Run Tests
working-directory: ./build
env:
@@ -65,34 +55,46 @@ jobs:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: linux-${{ matrix.configuration }}
name: linux-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/install/*.AppImage
linux_zip:
name: Build Linux distribution zip
needs: build_linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v8
with:
name: linux-Release
name: linux-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: linux-FastDebug
name: linux-FastDebug-${{ matrix.arch }}
path: builds
- name: Fix permissions
working-directory: ./builds
shell: bash
run: chmod 755 *.AppImage
- name: Create Distribution package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Linux
- name: Upload result package
working-directory: ./builds
@@ -107,46 +109,39 @@ jobs:
strategy:
matrix:
configuration: [FastDebug, Release]
arch: [Win32, x64]
simd: [SSE2]
os: [windows-2025, windows-11-arm]
arch: [Win32, x64, ARM64]
simd: [SSE2, ""]
exclude:
- arch: Win32
os: windows-11-arm
- arch: x64
os: windows-11-arm
- arch: ARM64
os: windows-2025
- os: windows-2025
simd: ""
- os: windows-11-arm
simd: SSE2
name: Windows
runs-on: windows-2019
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set up test version
shell: bash
run: |
[[ "${{ github.ref }}" =~ ^refs\/heads\/test\/(.*)$ ]]
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR ${BASH_REMATCH[1]})" > "version_override.cmake"
- name: Cache Qt
id: cache-qt-win
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install v143 ATL/MFC
shell: pwsh
run: ci/windows/install_v143_atlmfc.ps1
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
@@ -156,12 +151,11 @@ jobs:
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH=ON \
-DFSO_USE_VOICEREC=ON -DFORCED_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_TESTS=ON -DFSO_INSTALL_DEBUG_FILES=ON -A "$ARCHITECTURE" \
-DQT_USE_PRECOMPILED=ON -G "Visual Studio 18 2026" -T "v143" \
-DCMAKE_BUILD_TYPE=$CONFIGURATION ..
- name: Compile
working-directory: ./build
env:
@@ -177,43 +171,72 @@ jobs:
CONFIGURATION: ${{ matrix.configuration }}
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Set artifact id
shell: bash
run: |
id=
if [ -n "${{ matrix.simd }}" ]; then
id="${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}"
else
id="${{ matrix.configuration }}-${{ matrix.arch }}"
fi
echo "artifact_id=${id}" >> $GITHUB_ENV
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: windows-${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-${{ env.artifact_id }}
path: ${{ github.workspace }}/build/install/*
windows_zip:
name: Build Windows distribution zip
needs: build_windows
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [Win32, x64]
simd: [SSE2]
arch: [Win32, x64, ARM64]
simd: [SSE2, ""]
exclude:
- arch: Win32
simd: ""
- arch: x64
simd: ""
- arch: ARM64
simd: SSE2
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set artifact id
shell: bash
run: |
id=
if [ -n "${{ matrix.simd }}" ]; then
id="${{ matrix.arch }}-${{ matrix.simd }}"
else
id="${{ matrix.arch }}"
fi
echo "artifact_id=${id}" >> $GITHUB_ENV
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v8
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-Release-${{ env.artifact_id }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
name: windows-FastDebug-${{ env.artifact_id }}
path: builds
- name: Create Distribution package
working-directory: ./builds
shell: bash
env:
ARCH: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
ID: ${{ env.artifact_id }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows
- name: Upload result package
working-directory: ./builds
@@ -230,30 +253,18 @@ jobs:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64]
arch: [x86_64, arm64]
name: Mac
runs-on: macos-latest
steps:
- name: Cache Qt
id: cache-qt-mac
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Set up test version
shell: bash
run: |
@@ -268,45 +279,73 @@ jobs:
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
run: ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Sign builds
working-directory: ./build/bin
run: |
# make sure OpenAL framework is signed
find . -name OpenAL -type f | while read xx; do codesign --force -s - $xx; done
find . -name OpenAL.framework -type d | while read xx; do codesign --force -s - $xx; done
# make sure dylibs are signed
find . -name \*.dylib -type f | while read xx; do codesign --force -s - $xx; done
# sign binaries
find . -perm +111 -type f | grep MacOS | while read xx; do codesign --force -s - $xx; done
# sign apps
find . -name \*.app -maxdepth 1 | while read xx; do codesign --force -s - $xx; done
- name: Package build result
working-directory: ./build
run: cd bin && tar -cvzf macos-build.tar *.app
working-directory: ./build/bin
# Use GNU tar here (part of runner image) to avoid weird corruption bug with bsdtar
# Ref: https://github.com/actions/runner-images/issues/2619
run: gtar -cvzf macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz *.app
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v7
with:
name: mac-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/bin/macos-build.tar
name: mac-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/bin/macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
container: ghcr.io/scp-fs2open/sftp_upload:sha-ab87451
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download Release builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: mac-Release
name: mac-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v8
with:
name: mac-FastDebug
name: mac-FastDebug-${{ matrix.arch }}
path: builds
- name: Unpack builds
working-directory: ./builds
run: |
tar -xvzf macos-build-Release-${{ matrix.arch }}.tgz
tar -xvzf macos-build-FastDebug-${{ matrix.arch }}.tgz
- name: Create Distribution package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Mac
- name: Upload result package
working-directory: ./builds
+62 -26
View File
@@ -5,58 +5,94 @@ on:
branches:
- master
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [gcc-5, gcc-10]
compiler: [gcc-9, gcc-13, clang-16]
arch: [x86_64]
cmake_options: [""]
include:
# Also include configurations that check if the code compiles without the graphics backends
- configuration: Debug
compiler: gcc-10
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
- configuration: Release
compiler: gcc-10
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
container: ghcr.io/scp-fs2open/linux_build:sha-ab87451
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: ccache
uses: hendrikmuhs/ccache-action@v1
uses: hendrikmuhs/ccache-action@v1.2.23
with:
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}-${{ matrix.arch }}
max-size: 750MB
- name: Configure ccache
run: |
ccache --set-config=sloppiness=pch_defines,time_macros
ccache -p
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
CCACHE_PATH: /usr/local/bin/ccache
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
run: ninja -k 20 all
- name: Show CCache statistics
run: ccache --show-stats
build_mac:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [clang]
arch: [x86_64, arm64]
cmake_options: [""]
name: Mac
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.arch }}
max-size: 750MB
- name: Configure ccache
run: |
ccache --set-config=sloppiness=pch_defines,time_macros
ccache -p
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
CCACHE_PATH: /usr/local/bin/ccache
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: ninja -k 20 all
- name: Show CCache statistics
run: ccache --show-stats
+20 -3
View File
@@ -10,6 +10,9 @@ on:
windows_result: # job.result
required: true
type: string
mac_result: # job.result
required: true
type: string
releaseTag:
required: true
type: string
@@ -30,6 +33,7 @@ env:
NEBULA_PASSWORD: ${{ secrets.NEBULA_PASSWORD }}
HLP_API: ${{ secrets.HLP_API }}
HLP_KEY: ${{ secrets.HLP_KEY }}
FORUM_SECRET: ${{ secrets.FORUM_SECRET }}
RELEASE_TAG: ${{ inputs.releaseTag }}
jobs:
@@ -42,11 +46,13 @@ jobs:
run: echo "github.event_name= ${{ github.event_name }}"
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v7
with:
fetch-depth: '0'
ref: ${{ env.RELEASE_TAG }}
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install Python dependencies
run: pip install -r ci/post/requirements.txt
@@ -55,6 +61,16 @@ jobs:
env:
LINUX_RESULT: ${{ inputs.linux_result }}
WINDOWS_RESULT: ${{ inputs.windows_result }}
MAC_RESULT: ${{ inputs.mac_result }}
GITHUB_REPO: ${{ github.repository }} # repo this workflow was called from
INDIEGAMES_USER: ${{ secrets.INDIEGAMES_USER }}
INDIEGAMES_SSHPASS: ${{ secrets.INDIEGAMES_PASSWORD }}
NEBULA_USER: ${{ secrets.NEBULA_USER }}
NEBULA_PASSWORD: ${{ secrets.NEBULA_PASSWORD }}
HLP_API: ${{ secrets.HLP_API }}
HLP_KEY: ${{ secrets.HLP_KEY }}
RELEASE_TAG: ${{ inputs.releaseTag }}
FORUM_SECRET: ${{ secrets.FORUM_SECRET }}
run: python ci/post/main.py release
- name: Post Builds (Manual trigger)
@@ -63,7 +79,8 @@ jobs:
env:
LINUX_RESULT: success
WINDOWS_RESULT: success
MAC_RESULT: success
run: |
echo "releaseTag= ${{ env.RELEASE_TAG }}"
echo "repository= ${{ github.repository }}"
python ci/post/main.py release
python ci/post/main.py release
+66 -83
View File
@@ -2,68 +2,65 @@ name: Check a pull request
on: [pull_request]
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [gcc-5, gcc-10, clang-9]
compiler: [gcc-9, gcc-13, clang-16]
cmake_options: [""]
include:
# Also include configurations that check if the code compiles without the graphics backends
- configuration: Debug
compiler: gcc-10
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
- configuration: Release
compiler: gcc-10
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
# - configuration: Debug
# compiler: gcc-13
# cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=ON
# - configuration: Release
# compiler: gcc-13
# cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=ON
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
container: ghcr.io/scp-fs2open/linux_build:sha-ab87451
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: ccache
uses: hendrikmuhs/ccache-action@v1
uses: hendrikmuhs/ccache-action@v1.2.23
with:
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}
save: false # Caches are created by a separate job and only restored for PRs
verbose: 1
- name: Configure ccache
run: ccache --set-config=sloppiness=pch_defines,time_macros
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
CCACHE_PATH: /usr/local/bin/ccache
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
run: ninja -k 20 all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Show CCache statistics
run: ccache --show-stats
- name: Run Clang Tidy
# Clang-tidy reuses the precompiled headers so this only makes sense for the clang compilers
if: startsWith(matrix.compiler, 'clang-')
@@ -77,43 +74,25 @@ jobs:
build_windows:
strategy:
matrix:
configuration: [Debug, Release]
configuration: [Debug, FastDebug, Release]
compiler: [MSVC]
arch: [Win32, x64]
name: Windows
runs-on: windows-2019
runs-on: windows-2025
steps:
- name: Prepare Environment
run: choco install ninja
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
- name: Cache Qt
id: cache-qt-win
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.compiler == 'MSVC' && matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.compiler == 'MSVC' && matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install v143 ATL/MFC
if: matrix.compiler == 'MSVC'
shell: pwsh
run: ci/windows/install_v143_atlmfc.ps1
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
@@ -125,12 +104,12 @@ jobs:
cd build
if [ "$COMPILER" = "MinGW" ]; then
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DFSO_BUILD_FRED2="OFF" -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" ..
cmake -DFSO_USE_SPEECH=OFF -DFSO_FATAL_WARNINGS=ON -DFSO_USE_VOICEREC=OFF -DFSO_BUILD_TESTS=ON \
-DFSO_BUILD_FRED2=OFF -DQT_USE_PRECOMPILED=ON -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" ..
else
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -G "Visual Studio 16 2019" \
-DFSO_BUILD_QTFRED=ON -T "v142" -A "$ARCHITECTURE" ..
cmake -DFSO_USE_SPEECH=ON -DFSO_FATAL_WARNINGS=ON -DFSO_USE_VOICEREC=OFF -DFSO_BUILD_TESTS=ON \
-DFORCED_SIMD_INSTRUCTIONS=SSE2 -G "Visual Studio 18 2026" -T "v143" -A "$ARCHITECTURE" \
-DQT_USE_PRECOMPILED=ON -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
fi
- name: Compile
working-directory: ./build
@@ -162,58 +141,62 @@ jobs:
matrix:
configuration: [Debug, Release]
compiler: [clang]
arch: [x86_64]
arch: [x86_64, arm64]
cmake_options: [""]
name: Mac
runs-on: macos-latest
steps:
- name: Cache Qt
id: cache-qt-mac
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
- uses: actions/checkout@v7
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: ccache
uses: hendrikmuhs/ccache-action@v1
uses: hendrikmuhs/ccache-action@v1.2.23
with:
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}-${{ matrix.arch }}
save: false # Caches are created by a separate job and only restored for PRs
- name: Configure ccache
run: ccache --set-config=sloppiness=pch_defines,time_macros
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
CCACHE_PATH: /usr/local/bin/ccache
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
run: ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Show CCache statistics
run: ccache --show-stats
- name: Install clang-tidy
# macOS runners don't ship clang-tidy; pin to the same version as the Linux
# container's clang-tidy-16 for consistent diagnostics. pyyaml is required
# too: clang-tidy-diff.py only accepts -export-fixes when it can import yaml.
# --break-system-packages is required since the runner's Homebrew Python
# is externally managed (PEP 668); the runner is ephemeral so this is safe.
if: startsWith(matrix.compiler, 'clang')
run: pip3 install --break-system-packages clang-tidy==16.0.4 pyyaml
- name: Run Clang Tidy
# Clang-tidy reuses the precompiled headers so this only makes sense for the clang compilers
if: startsWith(matrix.compiler, 'clang-')
if: startsWith(matrix.compiler, 'clang')
env:
CLANG_TIDY_BINARY: clang-tidy
run: $GITHUB_WORKSPACE/ci/linux/clang_tidy.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Process clang-tidy warnings
if: startsWith(matrix.compiler, 'clang-')
if: startsWith(matrix.compiler, 'clang')
uses: asarium/clang-tidy-action@v1
with:
fixesFile: clang-fixes.yaml
fixesFile: clang-fixes.yaml
@@ -0,0 +1,74 @@
name: Weekly Coverity Scan for Freespace Open
# adapted from code by "albert-github" on the doxygen repository
# many thanks for figuring this out first so it could be less painful for us!
#This mode is for testing
#on: [push, pull_request]
# In production, push on a specific schedule
on:
schedule:
- cron: "5 0 * * 5" # Run once per a week on Friday morning (midnight UTC, 4 AM EST), to avoid Coverity's submission limits
env:
coverity_email: [email protected]
coverity_token: ${{ secrets.COVERITY_TOKEN }}
jobs:
build:
name: Build FSO With Coverity Wrapper
if: github.repository == 'scp-fs2open/fs2open.github.com'
runs-on: ${{ matrix.config.os }}
container: ghcr.io/scp-fs2open/linux_build:sha-ab87451
strategy:
fail-fast: false
matrix:
config:
- { name: "GCC on ubuntu", os: ubuntu-latest, build_type: "Release" }
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive # `true` to checkout submodules, `recursive` to recursively checkout submodules
- name: Set workspace as safe
# This appears to be broken in current actions, so do it manually
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# pipe results of wget to a log file because it's very verbose and rarely fails
- name: Install Coverity
run: |
wget -o wgetlog.txt -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=${{ env.coverity_token }}&project=scp-fs2open/fs2open.github.com" -O coverity_tool.tgz
mkdir cov-scan
tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
- name: Setup Environment
run: |
echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
echo "NPROC=$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV
- name: Configure CMake for FSO
env:
CONFIGURATION: Release
COMPILER: gcc-9
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Build FSO with Coverity Wrapper
working-directory: ./build
env:
CONFIGURATION: Release
run: cov-build --dir cov-int ninja -k 20 all
- name: Compress Results
working-directory: ./build
run: tar zcf cov-scan.tgz cov-int
#Comment this out when testing to keep from running into upload limits
- name: Upload to Coverity
run: |
cd build
curl -X POST -d token=${{ env.coverity_token }} -d email=${{ env.coverity_email }} -d file_name="'cov-scan.tgz'" -d version=${{ github.ref }} -d description="Automatic GHA scan" 'https://scan.coverity.com/projects/870/builds/init' | tee response
upload_url=$(jq -r '.url' response)
build_id=$(jq -r '.build_id' response)
curl -X PUT --header 'Content-Type: application/json' --upload-file cov-scan.tgz $upload_url
curl -X PUT -d token=${{ env.coverity_token }} https://scan.coverity.com/projects/870/builds/$build_id/enqueue
+9
View File
@@ -42,6 +42,7 @@ _ReSharper*/
#Project files
[Bb]uild/
[Oo]ut/
#Subversion files
.svn
@@ -250,6 +251,7 @@ documentation/doxygen/*
projects/*
/.vs
CMakeSettings.json
CMakePresets.json
# Weird files created by Linux
.fuse_hidden*
@@ -258,3 +260,10 @@ CMakeSettings.json
!/code/scripting/lua/LuaConvert.h
!/code/debugconsole/
!/docker/build
CMakeFiles/cmake.check_cache
CMakeCache.txt
# Written by the unittests binary at runtime
test/test_data/**/*_settings.ini
test/test_data/data/players/presets/asdf.json
test/test_data/pilotfile/data/asdf.hdp
+1 -4
View File
@@ -1,6 +1,3 @@
[submodule "cmake/external/rpavlik-cmake-modules"]
path = cmake/external/rpavlik-cmake-modules
url = https://github.com/asarium/cmake-modules.git
[submodule "lib/libRocket"]
path = lib/libRocket
url = https://github.com/asarium/libRocket.git
url = https://github.com/scp-fs2open/libRocket.git
-175
View File
@@ -1,175 +0,0 @@
language: bash
sudo: required
dist: xenial
cache:
directories:
- $HOME/cmake-3.8
- $HOME/.ccache
- $HOME/curl_cache
addons:
apt:
packages: &global_deps
- ninja-build
- libopenal-dev
- libreadline6-dev
- libpng12-dev
- libjpeg62-dev
- liblua5.1-0-dev
- libjansson-dev
- libsdl2-dev
- libfreetype6-dev
- qt57base
coverity_scan:
project:
name: "scp-fs2open/fs2open.github.com"
notification_email: [email protected]
build_command: "ci/travis/script.sh"
# must match TRAVIS_BRANCH check below
branch_pattern: coverity_scan
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
# also note that fork's don't get access to secure keys
# you have to test using a branch in the main repo
- secure: "C3wF967ZeliwwP1vC12EMIBOaC568n26Z/cPnwzn317ve59DWH3YSfPZVgvt08GzmaXITGGsJvPB+qxfGoKvQzYE4O1B73q81RpUe5pB3IhF+ThQ91VfQZIRJR5xEGJaLINUlHTTZGX5jxlkVO9wAcauVj/s3b8sQ3dvUZauPvk="
# These declarations set INDIEGAMES_USER and INDIEGAMES_PASSWORD for uploading nightly builds to the indiegames server
- secure: "lUuRu8XIi8MKNf1ebOfyC4iVEpPyASojJIDWXRo2bNqEF4ILAljXdkVeXeN6H5yKCHD52cxCNTtyePIG/o3p3QEuGSVud9bDS3D7LaQicLETGGrsw3l07U49gF2OKHXGopg0MzBbZUU9QmhoFTAe8t6PV9NDuEayYCheqvTqjZg="
- secure: "E/DHLYcPK/hBUqxBYYlUqp5sjgvIqY5A0qRHyQ4bmjsB+WB/Xx71bGCSiF7hk6lTxar1ZI1i5RAXXh9AIvNVaYAIdEOlCP+q3gvwCYuc5naZEKmkxlUCf0oEL4O9Fye93A/3VkFHuBdC1TGPYYf69m4W5r4367wWO9dPRIdWpJA="
# These declarations set DATACORDER_USER and DATACORDER_PASSWORD
- secure: "dpBH/dDN3bmU/NFlh+2v9isNx9wX0ocoRy+W+kBXRH32sosUGp26REhMqgVRpBNP5oxPBU8ic5bEogxAYWCB+0xUygBbkxAwyMPgoA34s0OXdTCY/ofw14ni8qqV2Ffy7fQJbP/jkMURyiMHx3kBTxNv3YjxKJqLnOuOMlQLpT8="
- secure: "tLMRBD1Ufp5iKNwlqPDVbbuczgusaXNoBJyAnPATpJq2YwlkW4j3PqP9rW5vd85+52xam2EOP20w9PoBR5J6FLdiXRu4Lf7yCEhSHFAgowVqQj8QcJpPlyXr90bM4emFGrGqpdxVwxyQ5AFhKwLuEZKsI14GYLN+UMEwpNCMing="
deploy:
- provider: releases
api_key:
secure: "q619+eQTe7lv8UVphK4OIzU8Jw84KBbVkuprN2sWIubRcV3IbZr2+WahJoUMt+nyhiy3YjDYtstO2ZgkxupwnZgwGUBVIiD1c4SPuyy+HTjNMOtiVsEUHT2hf+xPAemWpTlK5HcwhMmHAOh6rt6dEj57QOg0gcmGiwD/tCbEriA="
skip_cleanup: true
file_glob: true
file: "/tmp/builds/*"
on:
condition: '"$RELEASE_BUILD" == true'
tags: true
- provider: script
script: bash ci/travis/ftp_deploy.sh
on:
condition: '"$NIGHTLY_BUILD" == true'
tags: true
- provider: script
skip_cleanup: true
script: bash ci/travis/ftp_deploy.sh
on:
condition: $TEST_BUILD = true
all_branches: true
matrix:
include:
# note that gcc Debug MUST be 1st for Coverity
- os: linux
env: CONFIGURATION="Debug" CC=gcc-5 CXX=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Debug" CC=gcc-9 CXX=g++-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- g++-9
- *global_deps
- os: linux
env: CONFIGURATION="Debug" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-9
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
- os: osx
env: CONFIGURATION="Debug"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET=v141 CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
- os: linux
env: CONFIGURATION="Release" CC=gcc-5 CXX=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Release" CC=gcc-9 CXX=g++-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- g++-9
- *global_deps
- os: linux
env: CONFIGURATION="Release" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-9
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
- os: osx
env: CONFIGURATION="Release"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141 CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
# There is a GCC compiler bug with MinGW that causes compilation failures on Windows at the moment
allow_failures:
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
fast_finish: true
before_install:
# ugly hack; if running a coverity scan abort all except the 1st build
# see note re gcc compiler above needing to be 1st
# also note that branch_pattern & the TRAVIS_BRANCH check must match
# unfortunately COVERITY_SCAN_BRANCH isn't defined until later in the
# build process
- if ([[ "${TRAVIS_JOB_NUMBER##*.}" != "1" ]] && [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]); then false ; fi
- source "./ci/travis/check_release.sh"
- "./ci/travis/before_install.sh"
install:
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export PATH="/c/Program Files/CMake/bin":$PATH; fi
- "./ci/travis/install.sh"
- export PATH=$HOME/cmake-3.6/bin:$PATH
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then QT_ENV_SCRIPT=$(find /opt -name 'qt*-env.sh'); source $QT_ENV_SCRIPT; fi
- "./ci/travis/before_script.sh"
script:
- if [ "$BUILD_DEPLOYMENT" = true ] ; then ./ci/travis/release.sh ; else ./ci/travis/script.sh ; fi
+107 -48
View File
@@ -1,5 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
CMAKE_MINIMUM_REQUIRED(VERSION 3.21)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Make sure the source and binary directory are not the sample
@@ -8,12 +8,12 @@ if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
endif()
include(cmake/util.cmake)
include(cmake/embed_file.cmake)
# Set a few policies
set_policy(CMP0051 NEW)
set_policy(CMP0053 NEW)
set_policy(CMP0054 NEW)
set_policy(CMP0091 NEW) # Enable use of CMAKE_MSVC_RUNTIME_LIBRARY
SET(FSO_PROJECT_DESCRIPTION "Open source project based on the original FreeSpace 2 source code.")
@@ -29,53 +29,68 @@ ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(TARGET_COPY_FILES "" CACHE INTERNAL "" FORCE)
SET(TARGET_COPY_DIRS "" CACHE INTERNAL "" FORCE)
### Define options and editable variables in the section below:
# This is only needed for single configuration generators so don't annoy others
if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build configuration used." FORCE)
message(WARNING "CMAKE_BUILD_TYPE was not specified, defaulting to Release configuration.")
endif(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
# Override standard CMake configurations
set(CMAKE_CONFIGURATION_TYPES Debug Release FastDebug CACHE STRING "Available configurations" FORCE)
set(FSO_BUILD_TYPES Debug Release FastDebug)
PROJECT(FS2_Open)
find_program(CCACHE_PROGRAM ccache)
# Currently only GCC support ccache properly without generating additional warnings
# Enable ccache on Mac even for clang
if(CCACHE_PROGRAM AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR APPLE))
if(NOT CMAKE_C_COMPILER_LAUNCHER)
message(STATUS "Using ccache for C compilation: ${CCACHE_PROGRAM}")
SET(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
endif()
if(NOT CMAKE_CXX_COMPILER_LAUNCHER)
message(STATUS "Using ccache for C++ compilation: ${CCACHE_PROGRAM}")
SET(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
endif()
if(is_multi_config)
set(CMAKE_CONFIGURATION_TYPES "${FSO_BUILD_TYPES}" CACHE STRING "Configuration types" FORCE)
elseif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build configuration used." FORCE)
message(WARNING "CMAKE_BUILD_TYPE was not specified, defaulting to Release configuration.")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${FSO_BUILD_TYPES}")
endif()
IF(CMAKE_CROSSCOMPILING)
SET(IMPORT_EXE_DIR "IMPORT_EXE_DIR-NOTFOUND" CACHE FILEPATH "Required for a cross compiling build, point to binary directory of a cmake build for the real OS")
INCLUDE(${IMPORT_EXE_DIR}/ImportExecutables.cmake)
ENDIF(CMAKE_CROSSCOMPILING)
set(FSO_LANGUAGES C CXX)
if(APPLE)
set(FSO_LANGUAGES ${FSO_LANGUAGES} OBJC OBJCXX)
# 10.15 for c++17 std::filesystem
# NOTE: this must be set *before* the project() call to work properly!!
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "macOS deployment target")
# fix all targets in scheme (so it's not just qtfred)
set(CMAKE_XCODE_GENERATE_SCHEME TRUE)
endif()
PROJECT(FS2_Open LANGUAGES ${FSO_LANGUAGES})
if (ANDROID)
message(STATUS "Building for Android (NDK)")
set(FSO_BUILD_INCLUDED_LIBS ON CACHE BOOL "" FORCE)
set(USING_PREBUILT_LIBS ON CACHE BOOL "" FORCE)
set(SDL3_USE_PRECOMPILED ON CACHE BOOL "" FORCE)
set(OPENAL_USE_PRECOMPILED ON CACHE BOOL "" FORCE)
set(USING_PREBUILT_VULKAN ON CACHE BOOL "" FORCE)
endif()
# Check if the external modules exists
IF(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules/launcher-templates")
IF(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libRocket/Build")
message(FATAL_ERROR "External submodules could not be found. Please make sure you have updated your submodules.")
endif()
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/finder")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/cotire")
# this must be set before include(toolchain)
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(FSO_BUILD_QTFRED OFF CACHE INTERNAL "" FORCE)
else()
OPTION(FSO_BUILD_QTFRED "Build qtFRED2 binary" ON)
endif()
INCLUDE(globals)
INCLUDE(toolchain)
include(embed_file)
IF(RESET_INSTALL_PREFIX)
IF(NOT $ENV{FS2PATH} STREQUAL "")
IF(NOT IS_DIRECTORY $ENV{FS2PATH})
MESSAGE(WARNING "The path '$ENV{FS2PATH}' of the environment variable FS2PATH does not point to a directory! Install prefix wasn't set.")
ELSE(NOT IS_DIRECTORY $ENV{FS2PATH})
SET(CMAKE_INSTALL_PREFIX "$ENV{FS2PATH}" CACHE FILEPATH "Install path" FORCE)
SET(CMAKE_INSTALL_PREFIX "$ENV{FS2PATH}" CACHE PATH "Install path" FORCE)
FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} CMAKE_INSTALL_PREFIX)
ENDIF(NOT IS_DIRECTORY $ENV{FS2PATH})
ELSE(NOT $ENV{FS2PATH} STREQUAL "")
@@ -83,9 +98,13 @@ IF(RESET_INSTALL_PREFIX)
ENDIF(NOT $ENV{FS2PATH} STREQUAL "")
ENDIF(RESET_INSTALL_PREFIX)
IF (WIN32)
OPTION(FSO_USE_SPEECH "Use Windows specific text-to-speach libraries" ON)
IF(WIN32 OR APPLE OR ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
OPTION(FSO_USE_SPEECH "Use text-to-speach libraries" ON)
ELSE()
OPTION(FSO_USE_SPEECH "Use text-to-speach libraries" OFF)
ENDIF()
IF (WIN32)
OPTION(FSO_USE_VOICEREC "Enable voice recognition support" ON)
OPTION(FSO_BUILD_FRED2 "Build FRED2 binary" ON)
@@ -99,10 +118,8 @@ OPTION(FSO_BUILD_TESTS "Build unit tests" OFF)
OPTION(FSO_DEVELOPMENT_MODE "Generate binaries in development mode, only use if you know what you're doing!" OFF)
OPTION(FSO_BUILD_QTFRED "Build qtFRED2 binary" OFF)
IF(WIN32 OR APPLE)
# On windows and mac the default should be to always build the included libraries
IF(WIN32 OR APPLE OR ANDROID)
# On windows, mac and android the default should be to always build the included libraries
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT ON)
ELSE()
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT OFF)
@@ -116,22 +133,53 @@ OPTION(FSO_USE_OPENALSOFT "Download and build OpenAL Soft instead of using the s
OPTION(FSO_FATAL_WARNINGS "Determines if warnings in the build are considered fatal errors, primarily used for CI" OFF)
SET(FSO_FREESPACE_PATH "${CMAKE_INSTALL_PREFIX}" CACHE FILEPATH "The path of the FreeSpace directory you want to use. Please note that you will have to change CMAKE_INSTALL_PREFIX if you change this at some point.")
SET(FSO_FREESPACE_PATH "${CMAKE_INSTALL_PREFIX}" CACHE PATH "The path of the FreeSpace directory you want to use. Please note that you will have to change CMAKE_INSTALL_PREFIX if you change this at some point.")
SET(FSO_RUN_ARGUMENTS "" CACHE STRING "Additional arguments passed to a generated executable when run with the generated build files.")
option(FSO_INSTALL_DEBUG_FILES "Install some debug files (currently only PDB files on windows)" OFF)
option(ENABLE_COTIRE "Enable cotire for faster compilation. Enabled by default." ON)
option(FSO_RELEASE_LOGGING "Enable logging output for release builds" OFF)
OPTION(FSO_BUILD_WITH_FFMPEG "Enable the usage of FFmpeg for sound and custscenes" ON)
OPTION(FSO_BUILD_WITH_DISCORD "Build with Discord support" ON)
OPTION(FSO_BUILD_WITH_OPENGL "Enable compilation of the OpenGL renderer" ON)
OPTION(FSO_BUILD_WITH_OPENGL_DEBUG "Enables debug option for OpenGL" OFF)
OPTION(FSO_BUILD_WITH_OPENGL_ES "When building OpenGL, use OpenGL ES compatibility layer" OFF)
OPTION(FSO_BUILD_WITH_VULKAN "Enable compilation of the Vulkan renderer" ON)
if(NOT FSO_BUILD_WITH_OPENGL AND FSO_BUILD_WITH_OPENGL_ES)
# Disable GLES if not building with OpenGL
set(FSO_BUILD_WITH_OPENGL_ES OFF CACHE BOOL "" FORCE)
endif()
if(FSO_BUILD_WITH_OPENGL_ES)
add_definitions(-DUSE_OPENGL_ES)
IF(FSO_BUILD_WITH_OPENXR)
MESSAGE(WARNING "FSO_BUILD_WITH_OPENXR is ON. But not supported on OpenGL ES for now - setting to OFF.")
SET(FSO_BUILD_WITH_OPENXR OFF CACHE BOOL "" FORCE)
endif()
endif()
IF(NOT APPLE AND NOT FSO_BUILD_WITH_OPENGL_ES)
SET(OPENXR_BUILD_DEFAULT ON)
ELSE()
SET(OPENXR_BUILD_DEFAULT OFF)
ENDIF()
OPTION(FSO_BUILD_WITH_OPENXR "Build with OpenXR support" ${OPENXR_BUILD_DEFAULT})
IF(FSO_BUILD_WITH_OPENXR AND APPLE)
MESSAGE(WARNING "FSO_BUILD_WITH_OPENXR is ON. Not supported on macOS - setting to OFF.")
SET(FSO_BUILD_WITH_OPENXR OFF CACHE BOOL "" FORCE)
ENDIF()
OPTION(FSO_BUILD_WITH_OPENXR_DEBUG "Enables debug option for OpenXR" OFF)
OPTION(FSO_USE_LTO "Build using LTO (only for release builds)" ON)
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
MARK_AS_ADVANCED(FORCE FSO_USE_OPENALSOFT)
@@ -139,17 +187,16 @@ MARK_AS_ADVANCED(FORCE FSO_USE_LUAJIT)
MARK_AS_ADVANCED(FORCE FSO_DEVELOPMENT_MODE)
MARK_AS_ADVANCED(FORCE FSO_FATAL_WARNINGS)
mark_as_advanced(FORCE FSO_INSTALL_DEBUG_FILES)
mark_as_advanced(FORCE ENABLE_COTIRE)
mark_as_advanced(FORCE FSO_RELEASE_LOGGING)
mark_as_advanced(FORCE FSO_BUILD_WITH_FFMPEG)
mark_as_advanced(FORCE FSO_BUILD_WITH_DISCORD)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENGL)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENGL_DEBUG)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENGL_ES)
mark_as_advanced(FORCE FSO_BUILD_WITH_VULKAN)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENXR)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENXR_DEBUG)
# Include cotire file from https://github.com/sakra/cotire/
include(cotire)
INCLUDE(globals)
INCLUDE(toolchain)
INCLUDE(platforms)
include(version)
@@ -160,11 +207,20 @@ SET(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_source)
include(generateHeaders)
if(FSO_BUILD_APPIMAGE)
include(appimage)
SET(BINARY_DESTINATION "bin")
SET(LIBRAY_DESTINATION "lib")
endif()
include(clang-tidy)
include(CheckIPOSupported)
check_ipo_supported(RESULT LTO_AVAILABLE)
if (FSO_USE_LTO AND LTO_AVAILABLE)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
message("Enabled LTO for Release builds")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
endif (FSO_USE_LTO AND LTO_AVAILABLE)
# This includes source code for some tools, either used in the build or also for something else
ADD_SUBDIRECTORY(tools)
@@ -208,8 +264,8 @@ include(package)
include(doxygen)
# Print used options to log
message(STATUS "Using text to speech: ${FSO_USE_SPEECH}")
IF (WIN32)
message(STATUS "Using text to speech: ${FSO_USE_SPEECH}")
message(STATUS "Using voice recogition: ${FSO_USE_VOICEREC}")
message(STATUS "Building FRED2: ${FSO_BUILD_FRED2}")
elseif(UNIX)
@@ -220,5 +276,8 @@ message(STATUS "Building qtFRED: ${FSO_BUILD_QTFRED}")
message(STATUS "Fatal warnings: ${FSO_FATAL_WARNINGS}")
message(STATUS "Release logging: ${FSO_RELEASE_LOGGING}")
message(STATUS "With FFmpeg: ${FSO_BUILD_WITH_FFMPEG}")
message(STATUS "With Discord: ${FSO_BUILD_WITH_DISCORD}")
message(STATUS "With OpenGL: ${FSO_BUILD_WITH_OPENGL}")
message(STATUS "With OpenGL ES: ${FSO_BUILD_WITH_OPENGL_ES}")
message(STATUS "With Vulkan: ${FSO_BUILD_WITH_VULKAN}")
message(STATUS "With OpenXR: ${FSO_BUILD_WITH_OPENXR}")
+566
View File
@@ -3,7 +3,573 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [23.2.0] - 2023-06-16
### Changes
<details><summary> <b>Big Feature: MSAA</b> </summary>
> The return of a long forgotten feature, with optimizations and improvements
> Noticeable reduction to artifacts caused by subpixel geometry and glinting.
</details>
<details><summary> <b>Big Feature: SCPUI</b> </summary>
> A modernized approach to defining menus in FS
> Tired of having your Menus in FSO be at a resolution of potato? Use SCPUI to have them rendered from Fake-HTML to the actual screensize as opposed to a prebuilt graphics!
> Tired of being limited to whatever people in the SCP hardcoded in for buttons? Use SCPUI to define buttons and all other manner of shenanigans as Lua-code just as you like.
> Tired of needing to replace a bajillion interface graphics to reskin FSO? Use SCPUI, and especially Mjn's existing collection of Lua, CSS, Fake-HTML and images, and you only need to replace about 250 graphics.
</details>
<details><summary> <b>Big Feature: Localized Volumetric Nebulae</b> </summary>
> Allows specifying a POF as the "hull" of a nebula, which will be rendered using ray marching
> Further details can be found on the [GitHub Pull Request](https://github.com/scp-fs2open/fs2open.github.com/pull/5231)
> Note: As this is a new feature, many improvements and optimizations remain to be made
> Adapted from Andrew Schneider's 2015 SIGGRAPH talk "The real-time volumetric cloudscapes of Horizon: Zero Dawn"
</details>
<details><summary>Game: </summary>
- Per bank autoaim
</details>
<details><summary>Animation: </summary>
- Fix CTD on bad legacy animation data
- Add proper time wrapping for Animations
- Actually handle a mssing `Fade_anim` properly
</details>
<details><summary>Controls: </summary>
- Organize and map additional keys to librocket
- Catch when SDL fails to open a joystick that is enumerated by the OS
</details>
<details><summary>FRED: </summary>
- Add SpaceMouse support
- Add pre-parse enums support
- Add music player to FRED
- Enhanced SEXP comments
- FRED Dialog for Volumetrics
- QoL improvements to Object Editor
- Add FRED support for the "required weapon" feature
- SEXP Tree search and filter
</details>
<details><summary>QtFRED: </summary>
- Campaign Editor
- Add SpaceMouse support
- Make 'player starts in chase view' a toggle
</details>
<details><summary>Graphics: </summary>
- "The other great shader flag removal effort"
- Enhance handling of motion debris
- Expose texture filtering as a built-in option
- Improved particle culling and performance
- Optimized trail renderer
- Beam Particles
- Multiple lighting profiles
- Use volume particles for poofs
- Optimize for simple trails
- Kink shamed the laser bitmaps
</details>
<details><summary>HUD: </summary>
- Flag to apply HUD shudder to chase view
- Add missing HUD gauges
- Explicitly do not split lines when making the message log
</details>
<details><summary>Localization: </summary>
- Add some XSTR entries
</details>
<details><summary>Modding: </summary>
- Mapify built-in strings
- Allow `gameplay_profiles.tbl` to be an alias of `ai_profiles.tbl`
- Modular rank table
- Toggle auto-assigning personas
- Add some parameters for corkscrew starting angle
- Add clip planes to `game_settings.tbl`
- Add `+Use ship` as a Template
- Modular messages table
- Add arbitrary curves support
- Traitor overrides
- Add support for loose lz4 compressed files
- Add per-species warp effects
</details>
<details><summary>Models: </summary>
- Fix submodel sanity check
- Fix techroom modelnum references
- Adjust movement sanity checks to account for more situations
- Modular POF Features 2
- Add fov values to .pof models
- Add a Translation Moveable
- Remove model octants
- Fix glowpoints on animated submodels
- Update type_flags when dock name changes
- Add additional checks for Animation List handling of nonexistent polymodel instances
- Virtual POFs: Modify Subsystems
- Validate chunk size to avoid alignment crash and add align skip flag
</details>
<details><summary>Multiplayer: </summary>
- Generic Lua Multiplayer RPC
</details>
<details><summary>Performance: </summary>
- Increase sound update rate
- Add `line of sight` as an optional AI override
</details>
<details><summary>SEXPs: </summary>
- `turret-fired-since`, returns `true` if the specified turret has fired in the last `N` milliseconds
- `is-ship-emp-active`, returns `true` if the specified ship or list of ships is currently under an EMP effect
- `turret-has-primary` and `turret-has-secondary`, returns `true` if the specified turret contains the specified weapon
- `has-armor-type`, returns `true` if the specified ship or subsystem has the specified armor type
- `OPF_ANY_HUD_GAUGE` and `OPF_EVENT_NAME`, new Lua SEXP parameters
- Enhance Dynamic SEXPs with parent parameters
- Add "afterburn hard" AI goal flag
</details>
<details><summary>Scripting: </summary>
- Add option to deprecate hooks
- Get audiostream duration in float seconds
- Lua method to check if the game has focus
- `On warp complete` hook
- Allow Lua to set the Discord presence to custom strings
- Add virtvars for goal satisfaction and score
- Allow scripts to read and add LuaEnums
- Funcs and virtvars for SCPUI pause screen
- Expose pausing weapon sounds
- Make collision_group_id accessible to parse objects
- Pass shortcut key character to Lua as a hook variable
- Lua method to free all loaded models
- `On Asteroid Created` hook
- SCPUI methods required for handling closeup briefing icons
- Expose some Nebula settings to Lua
- SCPUI mission log
- SCPUI APIsfor the Game Help UI, medals access, and control config
- Force expand wings instead of toggle for SCPUI
- Add misc. validity checks
- Convert hotkey types to enum
- Finalize SCPUI API
- Blocking `On Frame` executor
- SCPUI Hud Config API
- Configurable restriction for ships that accept Lua player orders
- Add `ship::isPlayer()`
- Lua access to default countermeasures class
- Flag to check if a ship or weapon class is player allowed
- Add hooks for comm menu opening/closing
</details>
<details><summary>Technical: </summary>
- Improve CFLAGS handling
</details>
## [22.2.0] - 2022-08-06
```
Changelog note:
As of this version, in an attempt to make the changelog easier to navigate and read,
each section will have collapsible subsections, ordered alphabetically by topic.
Headlining features will always be on top.
```
### Added
<details><summary> <b>Big Feature: SEXP Containers</b> </summary>
> As opposed to a SEXP variable, which stores only one value, a SEXP container stores a collection of values.
> Consequently, containers allow for handling data in much more sophisticated ways than variables.
> Containers come in two types:
> * List container - an ordered sequence of values, sort of a cross between Python lists and deques
> * Map container - pairs of keys associated with data, like Lua tables or Python dictionaries
> Further details in the [SEXP Containers announcement thread](https://www.hard-light.net/forums/index.php?topic=98209.0)
</details>
<details><summary> <b>Big Feature: LuaAI</b> </summary>
> LuaAI allows scripters to add a new AI Goal (like ai-chase) that will run script instead of internal logic.
> Adding a Lua AI section in a -sexp.tbm and a few functions to a corresponding -sct.tbm to define the AI logic in certain conditions. More documentation on these functions is available in the LuaAISEXP-Object of the Scripting Docs.
</details>
<details><summary>AI:</summary>
- `$AI ignores aspect lock for leading:` Flag, which lets AI continue to lead their target while performing an Aspect Lock
</details>
<details><summary>Animation: </summary>
- `pause on reverse` Flag
</details>
<details><summary>Controls: </summary>
- Handle international keyboard layouts
- Re-Add `-joy-info` command line flag, for slightly quicker Joystick GUID retrieval
- Add `-controlconfig_tbl` command line flag to print out a template controlconfigdefaults.tbl
</details>
<details><summary>FRED: </summary>
- Support the full number of nebula poofs using a multi-select list
- Add the ability to edit nebula fog colors, since that previously was not part of the FRED UI
- Flags `same-arrival-warp-when-docked` and `same-departure-warp-when-docked` to allow docked ships to still use custom warp parameters
- Allow highlighting custom-colored events by drawing a border on them
- Can now rotate objects relative to other objects in the Object Editor
- Dialog to calculate relative distance and orientation between ships
- Flag "Point using uvec" to point ships while incorporating the ship's uvec
- `ai-attackable-if-no-collide` flag, which prevents turrets from ignoring a target with `no_collide`
</details>
<details><summary>QtFRED: </summary>
- Reinforcements Dialog
- Implemented Replace Data for Number and String
- Texture Replacement Dialog
- TBL Viewer in the Ship Editor
</details>
<details><summary>Graphics: </summary>
- Allow particles to use a random chance for spawning through the `+Chance` parameter
- Command-line parameter `-fov_cockpit` which allows setting an FoV for the cockpit model separately from the viewport FoV. This allows using custom FoVs without distorting the cockpit
- Allow user to export environment map to a PNG from the F3 Lab by pressing M
- Weapon lights: Configurable lighting data for weapons, both on a per-weapon basis and globally via lighting profiles
- Implemented debug sphere queuing and rendering
</details>
<details><summary>Localization: </summary>
- Make strings for Match Speed Indicator, Glide Indicator, and Afterburner Indicator translateable
</details>
<details><summary>Modding: </summary>
- `game_settings.tbl` setting `$Supernova hits at zero:`, which causes Supernovae to hit when the timer gets to 0, instead of the default of hitting 5 seconds before the time is up
- `game_settings.tbl` settings `$Show-subtitle uses pixels:` and `$Show-subtitle base resolution:`, which can be used in conjunction to scale subtitles
- `game_settings.tbl` setting `$Always warn player about unbound keys used in Directives Gauge:`, to show such warning to players when needed (without it these warnings only apply to Training Missions)
- Ship flags `fail-sound-locked-primary` and `fail-sound-locked-secondary` to allow the firing fail sound to play if the player tries to fire weapons that are locked
- Subsystem Flag "hide turret from loadout stats"
- Allow weapon to override turret name with `$Turret Name:`
</details>
<details><summary>Multiplayer: </summary>
- Save PXO stats to local pilot file
</details>
<details><summary>Performance: </summary>
- Preload subspace tunnel if the `mission-set-subspace` SEXP is used in the mission
</details>
<details><summary>SEXPs: </summary>
- `cancel-future-waves`, for stopping wings that still had waves queued from spawning
- Added optional flag to `show-subtitle-text` and `show-subtitle-image` to not change the subtitle aspect ratio
- `set-nav-color` and `set-nav-visited-color`, which allows setting custom colors to Navpoints in a mission
</details>
<details><summary>Scripting: </summary>
- Support for decals (see `decaldefinition` in the Scripting documentation)
- Missile list iterator: `mn.getMissileList()`
- Campaign Start hook: `On Campaign Begin`
- Player Loaded hook: `On Player Loaded`
- Added a few functions to get information on HUD gauges (check `HudGauge` in the Scripting documentation)
- Function `ship.checkVisibility` which checks if a ship can appear on the viewer's radar
- Function `hu.flashTargetBox` which causes the target box to flash
- Function `hu.getTargetDistance` to return the distance to target as reported by the HUD
- Function `mn.hasLineOfSight` which checks if one point has line of sight to the other
- Function `mn.getLineOfSightFirstIntersect` which checks for line of sight and returns the distance of the first interruption if not
- Variable `gr.CurrentResizeMode`, which can get or set the scaling mode to be used by the `gr.*` drawing methods
- Function `gr.draw3dLine`, which draws a line in space between two points
- Allow SCPUI to run `$On Briefing Stage:` hooks
- New bindings to allow proper hooking into control actions based on the control's enumeration name
- Allow scripted controls to override hardcoded functionality
- Fennel script support
- Lua BitOp 1.0.2 extension library, allowing the usage of bit operations
</details>
<details><summary>Technical: </summary>
- Class encapsulation for Volition's linked list
- Improve a debug console message to be more informative
- Type-safe `TIMESTAMP` class
- Add `timestamp_since()` function
- Add methods to compare timestamps, calculate deltas from an existing timestamp and a number of milliseconds, and to calculate deltas between timestamps
- Create a command line option for logging data packets
- Add more information to Multi-related debug logging
- Enable Doxygen for QTFred
- Set up Mac builds on CI, allowing builds to be published automatically for Mac
- Add some logging to `waitAsync`
</details>
### Changed
<details><summary>Game: </summary>
- Only display one popup when the player gets to the main hall
- Allow an unlimited number of ship flags to be parsed at once
</details>
<details><summary>AI: </summary>
- Improve Player Orders to allow for a nearly unlimited number of player orders, as opposed to the 32 before
- Update `ai_turn_towards_vector` to use a target velocity for banking
</details>
<details><summary>Audio: </summary>
- Allow unlimited soundtracks and spooled music (Previously limited to 30 and 50 respectively)
- Allow unlimited sound effects
- Dynamically set the maximum number of audio channels based on how many the user's system can support
</details>
<details><summary>FRED: </summary>
- CTRL+V is now add-paste (used to be CTRL+P)
- CTRL+SHIFT+V is now overwrite-paste (used to be CTRL+V)
- Replace `Always_show_goals` with `Toggle_showing_goals` which toggles whether the goals are shown, and works in any mission (instead of only Training Missions)
- No longer disable icon dropdowns for models that have their own icons
- No longer change the ship class when the icon type is a special popup
- Make the number of player orders FRED can handle dynamic
- Restore original Error Checking behavior where the function would exit after one check (for consistency)
- Exclude player ships from Error Checking for ships in a wing sharing the same orders
- Split "No subsystems found" and "Not all subsystems have a record in ships.tbl" warnings into two different warning flags
</details>
<details><summary>Graphics: </summary>
- Improved light attenuation to look more real
- Increase POF vertex limit, allowing up to `2^32 - 1` vertices to be used by a single subobject
</details>
<details><summary>Performance: </summary>
- Delay `ai_new_maybe_reposition_attack_subsys` to only run once a second. Before this change, it could take around 13% of runtime in crowded missions
- Cached subsystem indexing, speeding up subsystem lookups, which run for multiple ships, multiple times per frame
</details>
<details><summary>Scripting: </summary>
- Enhance help text for Lua SEXPs
- Converted the following Lua Hooks to the new format to add documentation: `On Death`, `On Game Init`, `On Ship Collision`
</details>
<details><summary>Technical: </summary>
- Turn `insertion_sort` into a templated function that uses assignment
- CMake: Update `PREBUILT_VERSION_NAME` to latest (mac libs)
- Optimized space used in the new POF version
- Cleanup model code
- Cleanup beam light functions by consolidating some duplicated code and removing unreachable logic
- Cleanup wing wave code
- Move special parsing functions into new `parsehi.cpp` and `parsehi.h` files
- Actually clear delayed SSM parsing data when it's no longer needed
- Allow C++ to interact more with LuaTables, allowing it to extract userdata like objects or ships from them
- Use `SCP_string` for constructing multi/event log lines
- Replace `+Orders Accepted:` Bitfield with flag list
- Handle deprecated command line flags programmatically, avoiding lots of code duplication
- Set up debug_filter.cfg to have default filters that can be turned off
</details>
### Removed
<details><summary>FRED: </summary>
- Remove the `Allow Daisy-Chained Docking` mission flag
- Remove "Delete Item" from the right-click menu in the Event Editor
</details>
<details><summary>Technical: </summary>
- Remove light filtering data which didn't work and increased code complexity
- Remove a pointless assert that checked if `SEXP_NODE_INCREMENT` (a define, set at 250) was greater than zero
</details>
### Fixed
<details><summary>Game: </summary>
- Missing whitespace in credits
- Stopped destroyed submodels from showing in Techroom
- Prevent a crash when an object dies in the same frame as their goal
- Always record primary bank ammo capacity during ship creation, preventing situations where a ballistic weapon would accidentally be set to zero ammo
- Properly remove ships from the Techroom when they're not in the Tech Database
- Load the correct Techroom data after a Tech Database Reset
- Don't tick Supernova timer while the game is paused
- Make `set-camera-facing` use default identity orientation when the `$Use host orientation` flag is active and no host is present
- When a hotkey text replacement string refers to an unbound control, use the name of the binding instead of "none"
- Fix usage of default tech database flags
- Prevent a crash in the loadout screen with a weapons-locked ship
- Fix two crashes in the F3 lab
- End the campaign properly when a mission is skipped, preventing crashing in some situations
- Prevent a crash when a message is sent from an invalid source
- Prevent a broken campaign state if the player quits the game from the options menu during the debriefing
- Add some checks before converting a message to Command
- Prevent accidentally skipping cutscenes caused by hitting the spacebar during a loading screen
- Fixed an issue where ships would start with the wrong hull values in Red Alert missions
</details>
<details><summary>AI: </summary>
- Fix turret swarm weapons by removing a few checks that are no longer valid
- Fix a few issues with maneuvers
</details>
<details><summary>Animations: </summary>
- Fix broken turret animations in the Techroom
</details>
<details><summary>Audio: </summary>
- Fix cockpit engine sound volume changing unexpectedly
- Fix a timing bug that would sometimes prevent music from being initialized when re-playing a mission
- Check all possible extensions for audio files
</details>
<details><summary>Controls: </summary>
- Flush the mouse state after toggling between `Use_mouse_to_fly` states, preventing situations where a stale mouse state would be used
- Fix a conflict between Free Look View controls and directional thrust controls
</details>
<details><summary>FRED: </summary>
- Prevent Ship Select Dialog from crashing if there are too many IFFs
- Support saving nebula fog colors
- Properly save `nav-carry-status` flag
- Don't treat a bare `<argument>` as an error
- Prevent adding duplicated variables and display an error to the user when they try
- Clean up some parse problems
- Fix assignment of alt-name when using the hash
- Guard against off-by-one errors in `replace_one` and `replace_all`
- Improve error checking of campaign loop branches
- Improve error reporting for bad SEXP nodes
- Prevent a crash with paste/add-paste when the clipboard was empty
- Prevent rounding/conversion issues that caused FRED to think an angle or position was modified when it wasn't
- Skip absent ships or wings when running `clear-goals`, instead of stopping the whole operation
</details>
<details><summary>Graphics: </summary>
- Disable Lightshafts while the Supernova glare effect is active. This partial fix ensures the glare shows up with the correct brightness
- Update and correctly load environment maps in F3 Lab
- Correctly set textures and Team Colors with `change-ship-class`
- Fixes Team Colors not working with `show-ship`
- Correct positioning and angles for background bitmaps and suns
- Clean up ship arrival and departure effects
- Fix clearing a skybox model when it isn't the mission default
- Fix an assertion with Fireball LODs which would wrongly trigger if the number of LODs was the same as the maximum
</details>
<details><summary>HUD: </summary>
- Make HUD Target distance consistent
- Fix a crash with scripted HUDs
- Correctly update RTT Cockpit Gauges with `change-ship-class`
- Ignore HUD brackets with a size of zero or less (instead of just crashing)
- Squad menu wasn't scrolling properly with PageDown in some cases
- Fix issues with loading of hud config presets
- Fix parsing issues with HUD color presets
- Continue parsing remaining gauges if one isn't found
- Use translated strings both when saving and loading
- Fix an issue where a target's orders would be displayed wrongly in the target box
- Fix asteroid brackets disappearing or displaying wrong values
</details>
<details><summary>Modding: </summary>
- Delay processing `$Player Weapon Precedence:` until after parsing, avoiding ships starting with the wrong weapons in some situations
- Make the `$Player Weapon Precedence:` list actually give precedence
- Empty `+Orders Accepted List:` entries were causing the ship to accept the default orders, instead of no orders as would be correct
- Show a Warning if a turret submodel is not an immediate child of the base object and handle it as a single-part object to prevent a crash
</details>
<details><summary>Multiplayer: </summary>
- Limit client collisions to prevent bugs, such as flinging players with high pings who collided multiple times between packet updates
- Fix multiple timestamp issues
- Multi messaging and multi pause screen
- Make sure maintenance stuff (pings, voice, file xfer, etc.) isn't affected by pausing or time compression
- Sync issues caused by options menu and screenshots
- Prevent an error with long messages in PXO Chat by using proper buffer size
- Fix some issues with Multiplayer SEXPs
- Try to handle incompatible sexp packets better
- Fix operator name issue with debug messages
- Enable the new show-subtitle-text options
- Improve interpolation, fixing the jerkiness that used to occur when the interpolation code basically guessed the timing on when packets were coming in
- Fix rollback primary collisions, vastly improving accuracy on moving targets even at high pings
- Fix the standalone ship being added to ship list
- Stop non-printable keys adding text to multi message buffer
- Prevent the standalone from crashing if a player tried to switch secondaries in a ship that doesn't have secondaries
- Fix a standalone crash from disabled uniform buffer manager
- Prevent a crash related to Observer-type players
- Fix network issues on MacOS
</details>
<details><summary>Scripting: </summary>
- Make hook conditions consistent and handle combinations that didn't work properly before
- Fix `maybePlayCutscene` arguments
- Add `isActive` checks for new-style script hooks
- Sync the two `VIRTVAR`s for Orientation in subsystems and submodel instances, which behaved in different ways
- Fixed a few timing and framerate related issues for playing movies via script
- Ensure the Lua interpreter has enough space in its stack, and allow reserving more space if necessary
- Fixed an memory leak in the Lua interpreter caused by string-eval sexps, which never cleaned up the generated code
</details>
<details><summary>SEXPs: </summary>
- Avoid setting .rest for `Locked_sexp_true/false` with malformed SEXPs
- Fix some memory management problems in the `for-*` operators, avoiding a memory leak
- Fix crash when removing form-on-wing order with `remove-goal`
- Fix `show-subtitle` SEXP which was missing the `width` argument
- Reset volumes changed via `adjust-audio-volume` when the mission closes
- Prevent too many dynamic SEXPs from breaking the SEXP system
</details>
<details><summary>Technical: </summary>
- Check if index is valid before accessing `Weapon_info`, preventing CTDs under certain conditions
- When `weapon_create` was called while `MAX_WEAPONS` was reached, the previous algorithm didn't achieve desired results, and simply locked up the game. Instead, we now simply won't allow a new weapon to be created in such condition
- Refactored Supernova code and fixed some state transition issues in it
- Prevent crashes in the event of a subsystem mismatch during `change_ship_type`
- Change include order to fix compilation of unit tests on Mac
- Patch freeing of SEXP nodes, preventing a crash in certain conditions
- Fix a memory leak in model code
- Fix a crash in the Ship Creation code if a ship's name was exactly the maximum allowed length
- Removed vestigial bit-depth asserts for aabitmaps, preventing crashes with certain image types
- Prevent a crash when Escort Priority was parsed for a ship not present in the Escort List
- Fix a bunch of graphics functions to respect GR_STUB, preventing problems in standalone server
- Clean up line endings in several files (replaced CRLF with LF basically everywhere)
- Fixed a timestamp issue which helps lay the groundwork to add In-Game Joining to multiplayer
- Prevent pilot and campaign files from having invalid values, by clamping them within the expected ranges when saving and loading
- Also warn the player if such an invalid value was detected, telling them which setting had the wrong value and what it was reset to
- Try to avoid assertions by preventing invalid types from being handled by `obj_team()`
- Shut down the SEXP system before the Scripting system, otherwise a crash could happen if the SEXP system held references to Lua
</details>
----
## [22.0.0] - 2022-04-01 ([Thread](https://www.hard-light.net/forums/index.php?topic=98125.0))
### Changed
- Controls5 PR (aka multi-joy)
-2
View File
@@ -1,7 +1,5 @@
FreeSpace2 *S*ource *C*ode *P*roject
==
[![Travis-CI Build Status](https://travis-ci.org/scp-fs2open/fs2open.github.com.svg?branch=master)](https://travis-ci.org/scp-fs2open/fs2open.github.com)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/scp-fs2open/fs2open.github.com?branch=master&svg=true)](https://ci.appveyor.com/project/SirKnightly/fs2open-github-com/branch/master)
[![Coverity](https://img.shields.io/coverity/scan/870.svg)](https://scan.coverity.com/projects/870)
Building
-62
View File
@@ -1,62 +0,0 @@
version: 1.0.0.{build}
image: Visual Studio 2015
configuration:
- Debug
- Release
clone_depth: 10
environment:
matrix:
- BuildID: 0
CMAKE_GENERATOR: Visual Studio 14 2015
PlatformToolset: v140
QT_DIR: C:\Qt\5.9\msvc2015
- BuildID: 1
CMAKE_GENERATOR: Visual Studio 14 2015 Win64
PlatformToolset: v140
QT_DIR: C:\Qt\5.9\msvc2015_64
before_build:
- git submodule update --init --recursive
build_script:
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/build.ps1
test_script:
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/test.ps1
deploy:
- provider: GitHub
auth_token:
secure: h55Scpy+3vmo1Yb7WlSIGA4d9DRnsbzUYc2LYsQdByQHZHbqrqjBpicH0D2FFLEO
on:
ReleaseBuild: true # deploy on release push only
- provider: FTP
protocol: sftp
host: scp.indiegames.us
username:
secure: SFivQZfatqWHXK1ijYK3GQ==
password:
secure: q6Zk/412o1ri+NEya1dl1Q==
folder: public_html/builds/nightly/$(VersionName)
on:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: sftp
host: porphyrion.feralhosting.com
username:
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
password:
secure: CrzmDVca8AGG08iWPA1gOD4Ge06+wJ3rcBagBGclwYQ=
folder: www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly/$(VersionName)
on:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: sftp
host: porphyrion.feralhosting.com
username:
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
password:
secure: CrzmDVca8AGG08iWPA1gOD4Ge06+wJ3rcBagBGclwYQ=
folder: www/datacorder.porphyrion.feralhosting.com/public_html/builds/test/$(VersionName)
on:
TestBuild: true # deploy on test build push only
-164
View File
@@ -1,164 +0,0 @@
class BuildConfig {
[string]$Generator
[string]$PackageType
[string]$Toolset
[string]$SimdType
[string]$QtDir
[Bool]$SourcePackage
}
$NightlyConfigurations = @(
# [BuildConfig]@{
# Generator="Visual Studio 14 2015 Win64";
# PackageType="Win64";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015_64";
# SourcePackage=$false;
# },
# [BuildConfig]@{
# Generator="Visual Studio 14 2015";
# PackageType="Win32";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015";
# SourcePackage=$false;
# }
)
$ReleaseConfigurations = @(
# [BuildConfig]@{
# Generator="Visual Studio 14 2015";
# PackageType="Win32";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015";
# SourcePackage=$true;
# }
# [BuildConfig]@{
# Generator="Visual Studio 14 2015";
# PackageType="Win32-AVX";
# Toolset="v140";
# SimdType="AVX";
# QtDir="C:\Qt\5.9\msvc2015";
# SourcePackage=$false;
# }
# [BuildConfig]@{
# Generator="Visual Studio 14 2015 Win64";
# PackageType="Win64";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015_64";
# SourcePackage=$false;
# }
# [BuildConfig]@{
# Generator="Visual Studio 14 2015 Win64";
# PackageType="Win64-AVX";
# Toolset="v140";
# SimdType="AVX";
# QtDir="C:\Qt\5.9\msvc2015_64";
# SourcePackage=$false;
# }
)
$BuildConfigurations = $null
# Default values
$ReleaseBuild = $false
$NightlyBuild = $false
$TestBuild = $false
# Set to true to test either the release or the nightly part of this script
$ReleaseTest = $false
$NightlyTest = $false
$TestBuildTest = $false
if ($ReleaseTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)"))) {
# Tag matches
$ReleaseBuild = $true
$PackageName = "fs2_open_$($matches[1])"
$BuildConfigurations = $ReleaseConfigurations
}
if ($NightlyTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)"))) {
# Tag matches
$NightlyBuild = $true
$PackageName = "nightly_$($matches[1])"
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
$BuildConfigurations = $NightlyConfigurations
}
if ($TestBuildTest -Or ([System.Convert]::ToInt32($env:APPVEYOR_PULL_REQUEST_NUMBER) -le 0 -And ("$env:APPVEYOR_REPO_BRANCH" -match "^test\/(.*)"))) {
# Tag matches
$TestBuild = $true
$PackageName = "test_$($matches[1])"
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
$BuildConfigurations = $NightlyConfigurations
# Override the revision string so that the builds are named correctly
[System.IO.File]::WriteAllLines("$env:APPVEYOR_BUILD_FOLDER/version_override.cmake", "set(FSO_VERSION_REVISION_STR $env:VersionName)")
}
# Multiply by 2 so that we can add 0 or 1 for debug or release Configs
$buildID = [convert]::ToInt32($env:BuildID) * 2
if ($Env:Configuration -eq "Release") {
$buildID = $buildID + 1
}
$DeployBuild = $false
if ($ReleaseBuild -Or $NightlyBuild -Or $TestBuild) {
$DeployBuild = $true
}
Set-AppveyorBuildVariable 'ReleaseBuild' "$ReleaseBuild"
Set-AppveyorBuildVariable 'NightlyBuild' "$NightlyBuild"
Set-AppveyorBuildVariable 'TestBuild' "$TestBuild"
New-Item build -type directory
Set-Location -Path build
if ($DeployBuild) {
# Release build
if ($buildID -ge $BuildConfigurations.Length) {
# Not needed
exit 0
}
$buildConfig = $BuildConfigurations[$buildID]
if ($buildConfig.SourcePackage -eq $True) {
7z a -xr'!.git' "$($PackageName)-source-Win.zip" "$env:APPVEYOR_BUILD_FOLDER"
Push-AppveyorArtifact "$($PackageName)-source-Win.zip"
}
cmake -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" -DFSO_USE_SPEECH="ON" `
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$($buildConfig.SimdType)" `
-DQT5_INSTALL_ROOT="$($buildConfig.QtDir)" -DFSO_BUILD_QTFRED=ON `
-DFSO_INSTALL_DEBUG_FILES="ON" `
-G "$($buildConfig.Generator)" -T "$($buildConfig.Toolset)" ..
$Configs = @("Release", "FastDebug")
foreach ($config in $Configs) {
cmake --build . --config "$config" --target INSTALL -- /verbosity:minimal
if (! ($?)) {
Add-AppveyorMessage "A release build failed!"
exit 1
}
}
7z a -xr'!*.pdb' "$($PackageName)-builds-$($buildConfig.PackageType).zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
Push-AppveyorArtifact "$($PackageName)-builds-$($buildConfig.PackageType).zip"
7z a "$($PackageName)-debug-$($buildConfig.PackageType).7z" "$env:APPVEYOR_BUILD_FOLDER/../install/*.pdb"
Push-AppveyorArtifact "$($PackageName)-debug-$($buildConfig.PackageType).7z"
} else {
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="ON" -DFSO_BUILD_TESTS="ON" -DMSVC_SIMD_INSTRUCTIONS=SSE2 `
-DFSO_BUILD_QTFRED=ON -DQT5_INSTALL_ROOT="$env:QT_DIR" -DFSO_BUILD_FRED2="ON" `
-G "$Env:CMAKE_GENERATOR" -T "$Env:PlatformToolset" ..
cmake --build . --config "$Env:CONFIGURATION" -- /verbosity:minimal
if (! ($?)) {
exit 1
}
}
-13
View File
@@ -1,13 +0,0 @@
if ([System.Convert]::ToBoolean($env:ReleaseBuild) -Or [System.Convert]::ToBoolean($env:NightlyBuild) -Or [System.Convert]::ToBoolean($env:TestBuild)) {
# Skip tests for deployment
exit 0
} else {
write "Running unit tests..."
# Run unit tests
&"$pwd\bin\$Env:CONFIGURATION\unittests.exe" --gtest_shuffle 2>&1
if (! ($?)) {
exit 1
}
}
+12 -2
View File
@@ -5,6 +5,8 @@ set -e
SCRIPT=$(readlink -f "$0")
HERE=$(dirname "$SCRIPT")
git config --global --add safe.directory "$GITHUB_WORKSPACE"
COMMIT_RANGE=$1..$2
if ! git rev-list $COMMIT_RANGE 2>&1 >/dev/null; then
@@ -16,8 +18,16 @@ fi
# branch
BASE_COMMIT=$(git merge-base $1 $2)
# Allow the caller to override the clang-tidy binary and job count, since neither
# /usr/bin/clang-tidy-16 nor nproc are available outside the Linux CI container
# (e.g. macOS runners install clang-tidy via pip and use sysctl for core count).
CLANG_TIDY_BINARY="${CLANG_TIDY_BINARY:-/usr/bin/clang-tidy-16}"
NUM_JOBS="${NUM_JOBS:-$( (command -v nproc >/dev/null 2>&1 && nproc) || sysctl -n hw.ncpu )}"
# Note: Manually passing in the Vulkan flags that are normally provided by cmake (but are not so, here), to ensure
# that the source files are checked with the actual configuration used.
echo "Running clang-tidy on changed files"
git diff -U0 --no-color "$BASE_COMMIT..$2" | \
$HERE/clang-tidy-diff.py -path "$(pwd)/build" -p1 \
-regex '(code(?!((\/graphics\/shaders\/compiled)|(\/globalincs\/windebug)))|freespace2|qtfred|test|build|tools)\/.*\.(cpp|h)' \
-clang-tidy-binary /usr/bin/clang-tidy-9 -j$(nproc) -export-fixes "$(pwd)/clang-fixes.yaml"
-regex '(code(?!((\/graphics\/shaders\/compiled)|(\/globalincs\/windebug)|(\/def_files\/data)))|freespace2|qtfred|test\/src|build|tools)\/.*\.(cpp|h)' \
-clang-tidy-binary "$CLANG_TIDY_BINARY" -j"$NUM_JOBS" -export-fixes "$(pwd)/clang-fixes.yaml"
+43 -20
View File
@@ -1,34 +1,53 @@
#!/usr/bin/env bash
if [ "$COMPILER" = "gcc-5" ]; then
export CC=gcc-5
export CXX=g++-5
if [ "$COMPILER" = "gcc-9" ]; then
export CC=gcc-9
export CXX=g++-9
fi
if [ "$COMPILER" = "gcc-10" ]; then
export CC=gcc-10
export CXX=g++-10
if [ "$COMPILER" = "gcc-13" ]; then
export CC=gcc-13
export CXX=g++-13
fi
if [ "$COMPILER" = "clang-9" ]; then
# Work around bug in clang that uses the wrong installation directory: https://bugs.llvm.org/show_bug.cgi?id=47460
export CC=$(readlink -f $(which clang-9))
export CXX=$(readlink -f $(which clang++-9))
if [ "$COMPILER" = "clang-16" ]; then
export CC=clang-16
export CXX=clang++-16
fi
LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH
if [ "$RUNNER_OS" = "macOS" ]; then
CXXFLAGS="-mtune=generic -pipe -Wno-unknown-pragmas"
CFLAGS="-mtune=generic -pipe -Wno-unknown-pragmas"
PLATFORM_CMAKE_OPTIONS=""
export CMAKE_OSX_ARCHITECTURES="$ARCHITECTURE"
else
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
PLATFORM_CMAKE_OPTIONS="-DFSO_BUILD_APPIMAGE=ON"
PLATFORM_CMAKE_OPTIONS="-DFSO_BUILD_APPIMAGE=ON -DFORCED_SIMD_INSTRUCTIONS=SSE2"
# Optionally use static libstdc++/libc++ on Linux, but default to off
# (Issue #5571 enabled it as a fix for 20.04 compatibility, but we've moved to 22.04)
PLATFORM_CMAKE_OPTIONS="$PLATFORM_CMAKE_OPTIONS -DUSE_STATIC_LIBCXX=${USE_STATIC_LIBCXX:-OFF}"
fi
CMAKE_OPTIONS="$JOB_CMAKE_OPTIONS"
if [[ "$COMPILER" =~ ^clang.*$ ]]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCLANG_USE_LIBCXX=ON"
# Default to allowing system standard c++ library be used. On Linux, which
# typically uses libstdc++ by default, using libc++ causes a conflict with
# Qt6 libs. So an error/warning is in place to catch that case when QtFRED
# is enabled.
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCLANG_USE_LIBCXX=${CLANG_USE_LIBCXX:-OFF}"
fi
if [ ! "$CCACHE_PATH" = "" ] && [ ! -x "$CCACHE_PATH" ]; then
# The configured path doesn't exist on this runner (e.g. macOS runners on Apple
# Silicon hosts install Homebrew under /opt/homebrew instead of /usr/local),
# so fall back to whatever ccache is actually on PATH.
CCACHE_PATH="$(command -v ccache || true)"
fi
if [ ! "$CCACHE_PATH" = "" ]; then
echo "Using ccache at $CCACHE_PATH"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_PATH -DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_PATH"
fi
if [ -n "${ENABLE_QTFRED:-}" ]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DFSO_BUILD_QTFRED=${ENABLE_QTFRED}"
fi
mkdir build
@@ -38,10 +57,14 @@ export CXXFLAGS
export CFLAGS
export LD_LIBRARY_PATH
if [ "$RUNNER_OS" = "macOS" ]; then
if [ "$RUNNER_OS" = "macOS" ] && [ ! -x "$(which ninja)" ]; then
brew install ninja
fi
# CMAKE_JOB_POOLS and CMAKE_JOB_POOL_LINK ensure that when using ninja, link operations are done sequentially
# we have some build rules that do not play nice with parallel invocation and that fixes these issues
cmake -G Ninja -DFSO_FATAL_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $CMAKE_OPTIONS $PLATFORM_CMAKE_OPTIONS \
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DCMAKE_BUILD_TYPE=$CONFIGURATION \
-DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFSO_BUILD_QTFRED=ON \
-DSHADERS_ENABLE_COMPILATION=ON ..
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DCMAKE_BUILD_TYPE=$CONFIGURATION -DQT_USE_PRECOMPILED=ON \
-DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON \
-DCMAKE_JOB_POOLS=link=1 -DCMAKE_JOB_POOL_LINK=link ..
+16 -16
View File
@@ -8,29 +8,29 @@ OS="$1"
source $HERE/dist_functions.sh
if [ "$OS" = "Linux" ]; then
tar -cvzf "$(get_package_name)-builds-Linux.tar.gz" *
tar -cvzf "$(get_package_name)-builds-Linux-$ARCH.tar.gz" *
echo "::set-output name=package_path::$(pwd)/$(get_package_name)-builds-Linux.tar.gz"
echo "::set-output name=package_name::$(get_package_name)-builds-Linux.tar.gz"
echo "::set-output name=package_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Linux.tar.gz")"
echo "package_path=$(pwd)/$(get_package_name)-builds-Linux-$ARCH.tar.gz" >> $GITHUB_OUTPUT
echo "package_name=$(get_package_name)-builds-Linux-$ARCH.tar.gz" >> $GITHUB_OUTPUT
echo "package_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Linux-$ARCH.tar.gz")" >> $GITHUB_OUTPUT
elif [ "$OS" = "Windows" ]; then
7z a -xr'!*.pdb' "$(get_package_name)-builds-$ARCH-$SIMD.zip" "*"
7z a -xr'!*.pdb' "$(get_package_name)-builds-$ID.zip" "*"
echo "::set-output name=package_path::$(pwd)/$(get_package_name)-builds-$ARCH-$SIMD.zip"
echo "::set-output name=package_name::$(get_package_name)-builds-$ARCH-$SIMD.zip"
echo "::set-output name=package_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-$ARCH-$SIMD.zip")"
echo "package_path=$(pwd)/$(get_package_name)-builds-$ID.zip" >> $GITHUB_OUTPUT
echo "package_name=$(get_package_name)-builds-$ID.zip" >> $GITHUB_OUTPUT
echo "package_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-$ID.zip")" >> $GITHUB_OUTPUT
7z a "$(get_package_name)-debug-$ARCH-$SIMD.7z" "*.pdb"
7z a "$(get_package_name)-debug-$ID.7z" "*.pdb"
echo "::set-output name=debug_path::$(pwd)/$(get_package_name)-debug-$ARCH-$SIMD.7z"
echo "::set-output name=debug_name::$(get_package_name)-debug-$ARCH-$SIMD.7z"
echo "::set-output name=debug_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-debug-$ARCH-$SIMD.7z")"
echo "debug_path=$(pwd)/$(get_package_name)-debug-$ID.7z" >> $GITHUB_OUTPUT
echo "debug_name=$(get_package_name)-debug-$ID.7z" >> $GITHUB_OUTPUT
echo "debug_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-debug-$ID.7z")" >> $GITHUB_OUTPUT
elif [ "$OS" = "Mac" ]; then
tar -cvzf "$(get_package_name)-builds-Mac.tar.gz" *
tar -cvzf "$(get_package_name)-builds-Mac-$ARCH.tar.gz" *.app
echo "::set-output name=package_path::$(pwd)/$(get_package_name)-builds-Mac.tar.gz"
echo "::set-output name=package_name::$(get_package_name)-builds-Mac.tar.gz"
echo "::set-output name=package_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Mac.tar.gz")"
echo "package_path=$(pwd)/$(get_package_name)-builds-Mac-$ARCH.tar.gz" >> $GITHUB_OUTPUT
echo "package_name=$(get_package_name)-builds-Mac-$ARCH.tar.gz" >> $GITHUB_OUTPUT
echo "package_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Mac-$ARCH.tar.gz")" >> $GITHUB_OUTPUT
else
echo "Invalid OS: $OS"
fi
+39 -4
View File
@@ -2,13 +2,48 @@
INSTALL_FOLDER=$1
# safety check
if [ ! -d bin -o ! -f cmake_install.cmake ]; then
echo "ERROR! This script must be run from within the build root!"
exit 1
fi
if [ ! -x "$(which wget)" ]; then
echo "ERROR! Required utility is not available: wget"
exit 1
fi
# install newest appimagetool if it's not already available
if [ ! -x ./bin/appimagetool ]; then
APPIMAGE_TOOL_URL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage"
wget -O ./bin/appimagetool "$APPIMAGE_TOOL_URL" || { echo "ERROR! Failed to get appimagetool!" && exit 1; }
chmod +x ./bin/appimagetool
fi
# This shouldn't be needed with newer runtimes, but they still generate an
# error if fusermount is missing even though it works. So to skip error msg
# and have max compatibility with runtimes and containers we'll use it.
export APPIMAGE_EXTRACT_AND_RUN=1
# Install Freespace2 targets
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER -DCOMPONENT=Freespace2 -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/Freespace2 -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/Freespace2 -DCOMPONENT=Freespace2 -P cmake_install.cmake
# We need to be a bit creative for determining the AppImage name since we don't want to hard-code the name
FILENAME="$(find $INSTALL_FOLDER/bin -name 'fs2_open_*' -type f -printf "%f\n").AppImage"
appimagetool -n $INSTALL_FOLDER "$INSTALL_FOLDER/$FILENAME"
FILENAME="$(find $INSTALL_FOLDER/Freespace2/bin -maxdepth 1 -name 'fs2_open_*' -type f -executable -printf "%f\n").AppImage"
./bin/appimagetool -n "$INSTALL_FOLDER/Freespace2" "$INSTALL_FOLDER/$FILENAME"
chmod +x "$INSTALL_FOLDER/$FILENAME"
# Maybe install qtFRED targets
if [ -f qtfred/cmake_install.cmake ]; then
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/qtFRED -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER/qtFRED -DCOMPONENT=qtFRED -P cmake_install.cmake
# We need to be a bit creative for determining the AppImage name since we don't want to hard-code the name
FILENAME="$(find $INSTALL_FOLDER/qtFRED/bin -maxdepth 1 -iname 'qtfred_*' -type f -executable -printf "%f\n").AppImage"
./bin/appimagetool -n "$INSTALL_FOLDER/qtFRED" "$INSTALL_FOLDER/$FILENAME"
chmod +x "$INSTALL_FOLDER/$FILENAME"
fi
ls -al $INSTALL_FOLDER
+16 -1
View File
@@ -5,7 +5,22 @@ HERE=$(dirname "$SCRIPT")
export LD_LIBRARY_PATH=$(pwd)/bin/lib:$LD_LIBRARY_PATH
if [ "$CONFIGURATION" = "Debug"] && [[ "$RUNNER_OS" != "macOS" ]] ; then
# The unit tests never open a window, but a few of them reach code that brings SDL's video
# subsystem up (os_init() and resolution_default(), the latter via gr_init()). Left to itself SDL
# probes its real backends and dlopens libX11, which leaks a handful of blocks per init/quit cycle
# that SDL_QuitSubSystem() does not reclaim -- those are the "definitely lost" contexts memcheck
# fails the Debug legs on. Pinning the dummy driver skips the probing entirely, so the leaks never
# happen, and it makes the tests behave the same way whether or not the runner has a display.
export SDL_VIDEODRIVER=dummy
# if on mac and building for architecture that doesn't match host
# then unittests will fail so we just need to skip it (for now)
if [ "$RUNNER_OS" = "macOS" ] && [ "$ARCH" != "$(uname -m)" ]; then
echo "Skipping tests due to architecture mismatch!"
exit 0
fi
if [ "$CONFIGURATION" = "Debug" ] && [[ "$RUNNER_OS" != "macOS" ]] ; then
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
--suppressions="$HERE/valgrind.supp" ./bin/unittests --gtest_shuffle
else
+13 -3
View File
@@ -10,11 +10,21 @@ HERE=$(dirname "$SCRIPT")
source $HERE/dist_functions.sh
if [ "$UPLOAD_TYPE" = "nightly" ]; then
SSHPASS=$INDIEGAMES_SSHPASS upload_files_to_sftp "$INDIEGAMES_USER@scp.indiegames.us" "public_html/builds/nightly"
any_success=false
if SSHPASS=$INDIEGAMES_SSHPASS upload_files_to_sftp "$INDIEGAMES_USER@scp.indiegames.us" "public_html/builds/nightly"; then
any_success=true
fi
SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@porphyrion.feralhosting.com" "www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly"
if SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@perses.feralhosting.com" "www/datacorder.perses.feralhosting.com/public_html/builds/nightly"; then
any_success=true
fi
if [ "$any_success" = "false" ]; then
echo "All uploads failed"
exit 1
fi
elif [ "$UPLOAD_TYPE" = "test" ]; then
SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@porphyrion.feralhosting.com" "www/datacorder.porphyrion.feralhosting.com/public_html/builds/test"
SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@perses.feralhosting.com" "www/datacorder.perses.feralhosting.com/public_html/builds/test"
else
echo "Unknown upload type $UPLOAD_TYPE"
exit 1
+18 -42
View File
@@ -8,24 +8,6 @@
obj:*
obj:*
}
{
Travis memleak
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_signal_error
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
obj:/usr/lib/x86_64-linux-gnu/libmirclient.so.7
fun:call_init.part.0
fun:call_init
fun:_dl_init
fun:dl_open_worker
fun:_dl_catch_error
}
{
CLang Lua unitialized value error
Memcheck:Cond
@@ -127,37 +109,31 @@
fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
}
{
<insert_a_suppression_name_here>
SDL_Init one-time internal allocation via os_init
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_signal_error
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
obj:*
obj:*
fun:call_init.part.0
fun:call_init
fun:_dl_init
fun:dl_open_worker
obj:*
obj:*
fun:_Z7os_initPKcS0_S0_
fun:_ZN4test13FSTestFixture5SetUpEv
}
# Kept only as a backstop for running memcheck by hand. run_tests.sh pins SDL_VIDEODRIVER=dummy, so
# the X11 backend is never created there; this block also cannot match the prebuilt libSDL3 anymore,
# since that library is now stripped and X11_CreateDevice is a static symbol.
{
SDL3 X11 video backend internal allocations, not freed by SDL_VideoQuit
Memcheck:Leak
match-leak-kinds: definite,possible
...
fun:X11_CreateDevice
}
{
dlopen leak
glibc loader bookkeeping and library constructor allocations retained across dlopen
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_exception_create
fun:_dl_signal_error
fun:_dl_map_object
fun:dl_open_worker
fun:_dl_catch_exception
match-leak-kinds: definite,possible
...
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_exception
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
}
+95 -5
View File
@@ -12,6 +12,61 @@ from subprocess import check_output
MAX_PAGES = 100 # maximum number of PR pages to go through
warnings = 0
label_scores = {
"fred" : 6,
"qtfred" : 6,
"vr" : 6,
"multi" : 6,
"Lab" : 6,
"pilot file" : 6,
"scripting" : 6,
"sexps" : 6,
"ai" : 6,
"controls" : 6,
"HUD" : 6,
"models" : 6,
"sound" : 6,
"graphics" : 6,
"physics" : 6,
"ui" : 6,
"localization / translation" : 6,
"optimization" : 6,
"gameplay" : 5,
"general modding" : 4,
"fix" : 3,
"enhancement" : 2,
"backport" : 1,
"cleanup" : 0
}
label_to_category = {
"fred" : "FRED",
"qtfred" : "QtFRED",
"vr" : "VR",
"multi" : "Multiplayer",
"Lab" : "Lab",
"pilot file" : "Pilot File",
"scripting" : "Scripting",
"sexps" : "SEXPs",
"ai" : "AI",
"controls" : "Controls",
"HUD" : "HUD",
"models" : "Models",
"sound" : "Sound",
"graphics" : "Graphics",
"physics" : "Physics",
"ui" : "UI",
"localization / translation" : "Localization",
"optimization" : "Optimization",
"gameplay" : "Gameplay",
"general modding" : "General Modding",
"fix" : "Fix",
"enhancement" : "Enhancement",
"backport" : "Backport",
"cleanup" : "Cleanup",
"misc" : "Misc."
}
def get_last_page(response: requests.Response) -> int:
"""
@brief Extract the last page number from the response header
@@ -40,7 +95,33 @@ def get_last_page(response: requests.Response) -> int:
return MAX_PAGES
else:
return last_page
def label_score(label):
try:
return label_scores[label['name']]
except KeyError:
return -1
def get_label(labels) -> str:
"""
@brief Get the primary label from a list of labels
@param[in] labels The list of labels from a pull request
@returns The primary label to be used for sorting in the changelog
"""
if len(labels) < 1:
return "misc"
# Sort the labels based on their score and grab the highest valued label
name = sorted(labels, key=label_score, reverse=True)[0]['name']
# If a label couldn't be found, toss it into a miscellaneous bin
if name not in label_scores:
name = "misc"
return name
def main():
parser = argparse.ArgumentParser(description="Retrieves a log of commit messages and attempts to pretty them into a human-readable format")
@@ -138,11 +219,16 @@ def main():
print("Found old pull #{} ({}), stopping loop...".format(pull['number'], pull['updated_at']))
page = last_page + 1
break
# If a label isn't in the changelog, create a bin for it
label = get_label(pull['labels'])
if label not in changelog:
changelog[label] = {}
# Add the pull to the changelog, indexed by its pull.number
if pull['number'] not in changelog:
if pull['number'] not in changelog[label]:
# only add if the key isn't there already
changelog[pull['number']] = {
changelog[label][pull['number']] = {
"date": merge_date,
"title": pull['title'],
"labels": pull['labels'],
@@ -158,9 +244,13 @@ def main():
# 2021-09-28 | (#3661) Fix homing child weapons in niche circumstances
print("Writing to change.log...")
str = ''
for key, value in changelog.items():
str += "{} | (#{}) {} \n".format(value['date'].strftime("%Y-%m-%d"), key, value['title'])
for label, pulls in dict(sorted(changelog.items())).items():
str += "[size=18pt]{}[/size]\n".format(label_to_category[label])
str += "[list]\n"
for key, value in pulls.items():
str += "[li](#{}) {} [/li]\n".format(key, value['title'])
str += "[/list]\n\n"
with open("change.log", "w") as file:
file.write(str)
+5 -1
View File
@@ -149,6 +149,8 @@ def get_release_files(tag_name, config) -> Tuple[List[ReleaseFile], Dict[str, So
# x64 is the Visual Studio name but for consistency we need Win64
if platform == "x64":
platform = "Win64"
elif platform == "ARM64":
platform = "WinARM64"
binary_files.append(ReleaseFile(name, url, platform, group_match.group(3)))
else:
@@ -213,6 +215,8 @@ def get_ftp_files(build_type, tag_name, config) -> List[ReleaseFile] :
# x64 is the name Visual Studio uses but Win64 works better for us since that gets displayed in the nightly post
if "x64" in group_match:
group_match = group_match.replace("x64", "Win64")
elif "ARM64" in group_match:
group_match = group_match.replace("ARM64", "WinARM64")
# construct the download URL list for all mirrors. The first listed ftp location is taken as the Primary
for mirror in config["ftp"]["mirrors"]:
@@ -225,4 +229,4 @@ def get_ftp_files(build_type, tag_name, config) -> List[ReleaseFile] :
# Form the List[ReleaseFile] list with the download URL links
out_data.append(ReleaseFile(file, primary_url, group_match, None, mirrors))
return out_data
return out_data
+10 -7
View File
@@ -1,3 +1,4 @@
import os
from typing import List
import requests
@@ -33,14 +34,16 @@ class ForumAPI:
print("Post failed! No API or API_KEY given!")
return
resp = requests.post(self.config["hlp"]["api"], data={
"api_key": self.config["hlp"]["key"],
"board": str(board),
"subject": title,
"body": content
})
resp = requests.post(self.config["hlp"]["api"],
headers={"X-HLP-Bot": os.environ["FORUM_SECRET"]},
data={
"api_key": self.config["hlp"]["key"],
"board": str(board),
"subject": title,
"body": content
})
if resp.text != "OK":
if resp.status_code != 200:
print("Post failed! Response: %s" %resp.text)
return resp.json()
+13 -4
View File
@@ -18,8 +18,9 @@
# Credentials into hard-light.net for forum post
# HLP_API:
# HLP_KEY:
# FORUM_SECRET:
# LINUX_RESULT: bool, if the linux builds were sucessfully uploaded
# LINUX_RESULT: bool, if the linux builds were successfully uploaded
# WINDOWS_RESULT: bool, if the windows builds were successfully uploaded
import sys
@@ -42,7 +43,7 @@ MAJOR_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_MAJO
MINOR_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_MINOR (\d+)\)")
BUILD_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_BUILD (\d+)\)")
REVISION_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_REVISION (\d+)\)")
REVISION_STR_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_REVISION_STR (\w+)\)")
REVISION_STR_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_REVISION_STR (\w*)\)")
LOG_FORMAT = """
------------------------------------------------------------------------%n
@@ -124,6 +125,10 @@ def get_source_version(date_version: datetime, tag_name: str) -> semantic_versio
def main():
if "FORUM_SECRET" not in os.environ or not os.environ["FORUM_SECRET"]:
print(" ERROR: FORUM_SECRET environment variable not set")
sys.exit(1)
os.chdir(os.path.dirname(__file__)) # Change working directory to this file's directory
# Aggregate configuration data in a dictionary
@@ -137,8 +142,8 @@ def main():
"pass": os.environ["INDIEGAMES_SSHPASS"],
"path": "public_html/builds/{type}/{version}/",
"mirrors": (
"https://porphyrion.feralhosting.com/datacorder/builds/{type}/{version}/{file}",
"http://scp.indiegames.us/builds/{type}/{version}/{file}",
"https://perses.feralhosting.com/datacorder/builds/{type}/{version}/{file}",
"https://scp.indiegames.us/builds/{type}/{version}/{file}",
),
},
"nebula": {
@@ -260,6 +265,10 @@ def main():
if "Linux" not in groups.keys():
print("ERROR: No Linux builds were detected!")
sys.exit(1)
if "Mac" not in groups.keys():
print("ERROR: No Mac builds were detected!")
sys.exit(1)
# z64: What dose this do???
# print(installer.render_installer_config(version, groups, config))
+39 -20
View File
@@ -7,6 +7,16 @@ import requests
from file_list import ReleaseFile
from util import retry_multi, GLOBAL_TIMEOUT
LINUX_X64_KEY = "Linux-x86_64"
LINUX_ARM64_KEY = "Linux-arm64"
MACOSX_X64_KEY = "Mac-x86_64"
MACOSX_ARM64_KEY = "Mac-arm64"
WIN32_SSE2_KEY = "Win32-SSE2"
WIN64_SSE2_KEY = "Win64-SSE2"
WIN32_AVX_KEY = "Win32-AVX"
WIN64_AVX_KEY = "Win64-AVX"
WINARM64_KEY = "WinARM64"
metadata = {
'type': 'engine',
'title': 'FSO',
@@ -26,28 +36,34 @@ metadata = {
}
platforms = {
'Linux': 'linux',
'MacOSX': 'macosx',
'Win32-SSE2': 'windows',
'Win64-SSE2': 'windows',
'Win32-AVX': 'windows',
'Win64-AVX': 'windows'
LINUX_X64_KEY: 'linux',
LINUX_ARM64_KEY: 'linux',
MACOSX_X64_KEY: 'macosx',
MACOSX_ARM64_KEY: 'macosx',
WIN32_SSE2_KEY: 'windows',
WIN64_SSE2_KEY: 'windows',
WIN32_AVX_KEY: 'windows',
WIN64_AVX_KEY: 'windows',
WINARM64_KEY: 'windows',
}
envs = {
'Linux': 'linux && x86_64', # Linux only has 64bit builds
'MacOSX': 'macosx',
'Win32-SSE2': 'windows',
'Win64-SSE2': 'windows && x86_64',
'Win32-AVX': 'windows && avx',
'Win64-AVX': 'windows && avx && x86_64'
LINUX_X64_KEY: 'linux && x86_64',
LINUX_ARM64_KEY: 'linux && arm64',
MACOSX_X64_KEY: 'macosx && x86_64',
MACOSX_ARM64_KEY: 'macosx && arm64',
WIN32_SSE2_KEY: 'windows',
WIN64_SSE2_KEY: 'windows && x86_64',
WIN32_AVX_KEY: 'windows && avx',
WIN64_AVX_KEY: 'windows && avx && x86_64',
WINARM64_KEY: 'windows && arm64'
}
subdirs = {
'Win32-SSE2': 'x86',
'Win64-SSE2': 'x64',
'Win32-AVX': 'x86_avx',
'Win64-AVX': 'x64_avx'
WIN32_SSE2_KEY: 'x86',
WIN64_SSE2_KEY: 'x64',
WIN32_AVX_KEY: 'x86_avx',
WIN64_AVX_KEY: 'x64_avx'
}
@@ -103,7 +119,7 @@ def render_nebula_release(version, stability, files, config):
'filename': dest_fn
})
if group == 'Linux' and fn.endswith('.AppImage'):
if group.startswith('Linux') and fn.endswith('.AppImage'):
if 'qtfred' in fn:
if '-FASTDBG' in fn:
label = 'QtFRED Debug'
@@ -117,7 +133,8 @@ def render_nebula_release(version, stability, files, config):
label = None
props = {
"x64": True, # All Linux builds are 64-bit
"arm64": "arm64" in fn,
"x64": "x64" in fn,
"sse2": True, # Linux builds are forced to compile with SSE2 but not AVX
"avx": False,
"avx2": False,
@@ -128,7 +145,7 @@ def render_nebula_release(version, stability, files, config):
'label': label,
'properties': props,
})
elif group == 'MacOSX' and fn.startswith(os.path.basename(fn) + '.app/'):
elif group.startswith('Mac') and fn.startswith(os.path.basename(fn) + '.app/'):
if 'qtfred' in fn:
if '-FASTDBG' in fn:
label = 'QtFRED Debug'
@@ -141,7 +158,8 @@ def render_nebula_release(version, stability, files, config):
label = None
props = {
"x64": True, # All Mac builds are 64-bit
"arm64": "arm64" in fn,
"x64": "x64" in fn,
"sse2": True, # There are no forced options on mac but 64-bit always implies SSE2 so we set that here
"avx": False,
"avx2": False,
@@ -176,6 +194,7 @@ def render_nebula_release(version, stability, files, config):
"sse2": "SSE2" in fn or "AVX" in fn, # AVX implies SSE2
"avx": "AVX" in fn, # This conveniently also covers the AVX2 case since AVX2 implies AVX
"avx2": "AVX2" in fn,
"arm64": "arm64" in fn,
}
pkg['executables'].append({
+29 -18
View File
@@ -7,22 +7,22 @@ PLACEHOLDER
[b]Deprecations:[/b]
PLACEHOLDER
Deprecations are a mechanism in FSO where a certain feature or aspect of the engine has changed or is no longer supported. Since this would normally break existing mods we have the mod table feature "[tt]$Target Version:[/tt]" with which a mod can specify what version of FSO it was developed with. The features listed above will be removed or changed when the target version of a mod is at least the version released in this post.
Deprecations are a mechanism in FSO where a certain feature or aspect of the engine has changed or is no longer supported. Since this would normally break existing mods, we have the mod table feature "[tt]$Target Version:[/tt]" with which a mod can specify what version of FSO it was developed with. Any features listed under Deprecations will be removed or changed when the target version of a mod is at least the version released in this post.
[size=5pt]Previous [url=https://www.hard-light.net/forums/index.php?topic=97293.0]21.0 Release Thread[/url][/size]
[size=5pt]Previous [url=https://www.hard-light.net/forums/index.php?topic=99015.0]23.2.1 Release Thread[/url][/size]
Launchers, if you don't have one already:
[b]All platforms: [/b] For every day use, we recommend [url=https://www.hard-light.net/forums/index.php?topic=94068.0]Knossos[/url], an integrated solution for downloading and launching mods.
[b]All platforms: [/b] For every day use, we recommend [url=https://knossosnet.github.io/Knossos-Release-Page/]Knossos.NET[/url], an integrated solution for downloading and launching mods.
[hidden=Alternative Launchers]
Cross-platform: [url=http://www.hard-light.net/forums/index.php?topic=89162]wxLauncher 0.12.x Test Build[/url] (ongoing project for a unified launcher, you should upgrade to the latest RC/test build if you have not yet)
Cross-platform: [url=https://www.hard-light.net/forums/index.php?topic=89162]wxLauncher 0.12.x Test Build[/url] (legacy project for a unified launcher)
[b]Important:[/b] For best compatibility with FSO 3.8 and later you should use at least wxLauncher 0.12.
Windows: [url=http://scp.fsmods.net/files/Launcher55g.zip]Launcher 5.5g[/url] ([url=http://scp.indiegames.us/builds/Launcher55g.zip]Mirror[/url]) ([url=http://www.mediafire.com/?wdvzn7hhhzh418m]Mirror[/url]) Not compatible with Windows 8+, use wxLauncher above
OS X: Soulstorm's [url=http://www.hard-light.net/forums/index.php/topic,51391.0.html]OS X Launcher 3.0[/url]
Linux: [url=http://www.hard-light.net/forums/index.php/topic,53206.0.html]YAL[/url] or [url=http://www.hard-light.net/wiki/index.php/Fs2_open_on_Linux/Graphics_Settings]by hand[/url] or whatever you can figure out.[/hidden]
Windows: [url=http://scp.fsmods.net/builds/Launcher55g.zip]Launcher 5.5g[/url] ([url=https://scp.indiegames.us/builds/Launcher55g.zip]Mirror[/url]) ([url=https://www.mediafire.com/?wdvzn7hhhzh418m]Mirror[/url]) Not compatible with Windows 8+, use wxLauncher above
OS X: Soulstorm's [url=https://www.hard-light.net/forums/index.php/topic,51391.0.html]OS X Launcher 3.0[/url]
Linux: [url=https://www.hard-light.net/forums/index.php/topic,53206.0.html]YAL[/url] or [url=https://www.hard-light.net/wiki/index.php/Fs2_open_on_Linux/Graphics_Settings]by hand[/url] or whatever you can figure out.[/hidden]
[img]http://scp.indiegames.us/img/windows-icon.png[/img] [color=green][size=12pt]Windows (32/64-bit)[/size][/color]
[img]https://scp.indiegames.us/img/windows-icon.png[/img] [color=green][size=12pt]Windows (32/64-bit/ARM64)[/size][/color]
[size=8pt]Compiled using GitHub Actions on Windows Server 2019 (10.0.17763), Visual Studio Enterprise 2019[/size]
[b]64-bit:[/b] ${build(groups["Win64"].mainFile)}
@@ -30,6 +30,8 @@ Linux: [url=http://www.hard-light.net/forums/index.php/topic,53206.0.html]YAL[/
[b]32-bit:[/b] ${build(groups["Win32"].mainFile)}
[size=8pt]This one is based on the SSE2 Optimizations from the MSVC Compiler.[/size]
[b]ARM64:[/b] ${build(groups["WinARM64"].mainFile)}
[hidden=Alternative builds]
[b]64-bit AVX:[/b] ${build(groups["Win64"].subFiles["AVX"])}
@@ -40,29 +42,38 @@ Linux: [url=http://www.hard-light.net/forums/index.php/topic,53206.0.html]YAL[/
[size=8pt]This one is based on the AVX Optimizations from the MSVC Compiler.[/size]
[b]What are those SSE, SSE2 and AVX builds I keep seeing everywhere?[/b]
[url=http://www.hard-light.net/forums/index.php?topic=65628.0]Your answer is in this topic.[/url]
Don't want to deal with that? Use [url=https://www.hard-light.net/forums/index.php?topic=94068.0]Knossos[/url] and it will download the best build specifically for your PC!
[url=https://www.hard-light.net/forums/index.php?topic=65628.0]Your answer is in this topic.[/url]
Don't want to deal with that? Use [url=https://knossosnet.github.io/Knossos-Release-Page/]Knossos.NET[/url] and it will download the best build specifically for your PC!
[/hidden]
[img]http://scp.indiegames.us/img/linux-icon.png[/img] [color=green][size=12pt]Linux 64-bit[/size][/color]
[size=8pt]Compiled with Ubuntu 16.04 LTS 64-bit, GCC 5[/size]
${build(groups["Linux"].mainFile)}
[img]https://scp.indiegames.us/img/linux-icon.png[/img] [color=green][size=12pt]Linux[/size][/color]
[size=8pt]Compiled with Ubuntu 20.04 LTS, GCC 9[/size]
[b]x86_64:[/b] ${build(groups["Linux"].subFiles["x86_64"])}
[b]arm64:[/b] ${build(groups["Linux"].subFiles["arm64"])}
These builds use a mechanism called [url=http://appimage.org/]AppImage[/url] which should allow these builds to run on most Linux distributions. However, we recommend that you compile your own builds which will result in less issues.
These builds use a mechanism called [url=https://appimage.org/]AppImage[/url] which should allow these builds to run on most Linux distributions. However, we recommend that you compile your own builds which will result in less issues.
Alternatively, if there is a package in your software repository then you should use that. If you are the maintainer of such a package for a distribution then let us know and we will include that here.
[img]http://scp.indiegames.us/img/mac-icon.png[/img] [color=green][size=12pt]OS X[/size][/color]
[b][color=red]Not available[/color][/b] We recently lost access to our Mac CI environment which we usually used for compiling these builds so for the time being, there will be no builds for this OS.
[img]https://scp.indiegames.us/img/mac-icon.png[/img] [color=green][size=12pt]macOS[/size][/color]
[size=8pt]macOS 10.9+[/size]
[b]Intel (64-bit):[/b] ${build(groups["Mac"].subFiles["x86_64"])}
[b]Apple Silicon:[/b] ${build(groups["Mac"].subFiles["arm64"])}
These builds are not signed and so by default will fail to launch. To run them simply right-click on the app, click open, then click open again on the security confirmation dialog. You should only have to do this once for each app.
If running the game through Knossos or Knossos.NET this step should not be necessary.
[size=8pt][color=red][b]NOTE:[/b][/color] macOS builds currently have limited support and may exhibit issues not present on other platforms.[/size]
[hidden=TrackIR Users]
[size=12pt]Important!![/size]
An external DLL is required for FSO to use TrackIR functions. The following DLL is simply unpacked in to your main FreeSpace2 root dir.
TrackIR is only supported on Windows.
[url=http://www.mediafire.com/download.php?4zw024zrh44etse]TrackIR SCP DLL[/url] ([url=http://scp.fsmods.net/builds/scptrackir.zip]Mirror[/url]) ([url=http://scp.indiegames.us/builds/scptrackir.zip]Mirror[/url])[/hidden]
[url=https://www.mediafire.com/download.php?4zw024zrh44etse]TrackIR SCP DLL[/url] ([url=http://scp.fsmods.net/builds/scptrackir.zip]Mirror[/url]) ([url=https://scp.indiegames.us/builds/scptrackir.zip]Mirror[/url])[/hidden]
Known issues:
[list]
[li][url=https://github.com/scp-fs2open/fs2open.github.com/issues]Github issues[/url] and [url=https://github.com/scp-fs2open/fs2open.github.com/pulls]pending pull requests[/url][/li]
[li]See the list of [url=http://scp.indiegames.us/mantis/search.php?project_id=1&status_id%5B%5D=10&status_id%5B%5D=20&status_id%5B%5D=30&status_id%5B%5D=40&status_id%5B%5D=50&priority_id%5B%5D=40&priority_id%5B%5D=50&priority_id%5B%5D=60&sticky_issues=on&sortby=last_updated&dir=DESC&per_page=200&hide_status_id=-2]Fix for next release[/url] bugs - mark a bug as an elevated priority (high, urgent, immediate) to get it included in that filter.[/li]
[li]See the list of [url=https://github.com/scp-fs2open/fs2open.github.com/projects/8]bugs ranked by priority[/url][/li]
[/list]
+2 -2
View File
@@ -1,3 +1,3 @@
Mako==1.1.5
requests==2.26.0
Mako==1.4.2
requests==2.33.0
semantic-version==2.8.5
-8
View File
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
set -ex
if [ "$NIGHTLY_BUILD" = true ]; then
echo "Generating bintray config..."
sed -e "s/\$VERSION_NAME/$VERSION_NAME/" ci/bintray.template.json > ci/bintray.json
fi
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env sh
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export DEBIAN_FRONTEND=noninteractive
sudo add-apt-repository -y "ppa:msulikowski/valgrind" # For fixing a bug with valgrind 3.11 which does not recognize the rdrand instruction
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository -y 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
sudo apt-get -yq update
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
# Nothing to do here
:
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
# Nothing to do here
:
fi
-50
View File
@@ -1,50 +0,0 @@
#!/usr/bin/env bash
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
mkdir -p /tmp/builds
if [ "$RELEASE_BUILD" = true ]; then
# Package the source code in release builds
PARENT_DIR="$(basename "$PWD")"
(cd .. && tar -czvf /tmp/builds/$PACKAGE_NAME-source-Unix.tar.gz --exclude-vcs "$PARENT_DIR")
fi
fi
mkdir -p build
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
export CXXFLAGS
export CFLAGS
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
if [ "$BUILD_DEPLOYMENT" = true ]; then
for config in $BUILD_CONFIGS
do
mkdir -p $config
cd $config
eval $CMAKE -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_BUILD_TYPE=$config -DCMAKE_INSTALL_PREFIX="/tmp/release/$config" \
-DFSO_BUILD_APPIMAGE=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_QTFRED=OFF ../..
cd ..
done
else
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFSO_BUILD_QTFRED=ON ..
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ "$BUILD_DEPLOYMENT" = true ]; then
cmake -G "Xcode" -DFSO_FATAL_WARNINGS=ON -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_INSTALL_PREFIX="/tmp/release" ..
else
cmake -G "Xcode" $CMAKE_OPTIONS ..
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
if [ "$CMAKE_GENERATOR" = "Ninja" ]; then
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DFSO_BUILD_FRED2="OFF" -G "$CMAKE_GENERATOR" ..
else
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -G "$CMAKE_GENERATOR" -T "$CMAKE_TOOLSET" ..
fi
fi
-74
View File
@@ -1,74 +0,0 @@
#!/usr/bin/env sh
RELEASE_BUILD=false
NIGHTLY_BUILD=false
TEST_BUILD=false
BUILD_DEPLOYMENT=false
BUILD_CONFIGS="Release FastDebug"
VERSION_NAME=""
PACKAGE_NAME=""
RELEASE_PATTERN="^release_(.*)$"
NIGHTLY_PATTERN="^nightly_(.*)$"
TEST_BUILD_PATTERN="^test\/(.*)$"
# These are for testing
NIGHTLY_TEST=false
RELEASE_TEST=false
TEST_BUILD_TEST=false
if [ "$RELEASE_TEST" = true ] || [[ "$TRAVIS_TAG" =~ $RELEASE_PATTERN ]]; then
echo "This is a release tag!";
RELEASE_BUILD=true;
PACKAGE_NAME="fs2_open_${BASH_REMATCH[1]}";
fi
if [ "$NIGHTLY_TEST" = true ] || [[ "$TRAVIS_TAG" =~ $NIGHTLY_PATTERN ]]; then
echo "This is a nightly tag!";
NIGHTLY_BUILD=true;
VERSION_NAME="${BASH_REMATCH[1]}";
PACKAGE_NAME="nightly_${BASH_REMATCH[1]}";
fi
if [ "$TEST_BUILD_TEST" = true ] || [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" =~ $TEST_BUILD_PATTERN ]]; then
echo "This is a test build branch!";
TEST_BUILD=true;
if [ "$TEST_BUILD_TEST" = true ]; then
VERSION_NAME="test";
PACKAGE_NAME="test_test";
else
VERSION_NAME="${BASH_REMATCH[1]}";
PACKAGE_NAME="test_${BASH_REMATCH[1]}";
fi
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR $VERSION_NAME)" > "$TRAVIS_BUILD_DIR/version_override.cmake"
fi
if ([ "$RELEASE_BUILD" = true ] || [ "$NIGHTLY_BUILD" = true ] || [ "$TEST_BUILD" = true ]); then
BUILD_DEPLOYMENT=true;
fi
if [ "$BUILD_DEPLOYMENT" = true ]; then
if ([ "$TRAVIS_OS_NAME" = "linux" ] && (! [[ "$CC" =~ ^gcc-5.*$ ]])); then
echo "Skipping non-release compiler";
exit 0;
fi
if ([[ "$CONFIGURATION" == "Debug" ]]); then
echo "Skipping non-release configuration";
exit 0;
fi
if [ "$TRAVIS_OS_NAME" = "windows" ]; then
echo "Skipping non-release platform"
exit 0
fi
fi
export RELEASE_BUILD
export NIGHTLY_BUILD
export TEST_BUILD
export BUILD_DEPLOYMENT
export BUILD_CONFIGS
export VERSION_NAME
export PACKAGE_NAME
-89
View File
@@ -1,89 +0,0 @@
#!/usr/bin/env bash
set -e
set -u
if [[ ! "$(curl -V)" == *"sftp"* ]]; then
# Before
echo "Before:"
curl -V
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ -f ~/curl_cache/curl*.deb ]; then
cd ~/curl_cache
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
else
# Since the Travis CI people are not capable of enabling SSH/SCP support for their libcurl we need to build that manually...
# These commands are based on the tutorial from here: http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/
mkdir /tmp/curl
cd /tmp/curl
sudo apt-get update
sudo apt-get install build-essential debhelper libssh2-1-dev libgnutls-dev libidn11-dev libkrb5-dev libldap2-dev libnss3-dev librtmp-dev libtool openssh-server quilt
apt-get source curl
sudo apt-get build-dep curl
cd curl-*
export DEB_BUILD_OPTIONS="nocheck"
sudo dpkg-buildpackage -uc -us -j"$(grep -c ^processor /proc/cpuinfo)"
cd ..
dpkg -l | grep curl
ls -al
if [ ! -d ~/curl_cache ]; then
mkdir ~/curl_cache
fi
cp libcurl3*.deb curl*.deb ~/curl_cache
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install libssh2
if [ -d ~/curl_cache/curl ]; then
cd ~/curl_cache/curl
sudo make install
else
mkdir /tmp/curl
cd /tmp/curl
curl -LO "https://curl.haxx.se/download/curl-7.64.0.tar.bz2"
tar -xjf curl-7.64.0.tar.bz2
cd curl-7.64.0
./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --with-libssh2 --with-darwinssl --without-ca-bundle --without-ca-path
make -j"$(sysctl hw.logicalcpu | cut -d " " -f 2)"
if [ ! -d ~/curl_cache ]; then
mkdir ~/curl_cache
fi
cp -a . ~/curl_cache/curl
sudo make install
fi
export PATH=/usr/local/bin:$PATH
fi
# After
echo "After:"
curl -V
fi
cd /tmp/builds
for file in *; do
if [ "$TEST_BUILD" = true ]; then
# Upload to datacorder
curl -k "sftp://porphyrion.feralhosting.com/www/datacorder.porphyrion.feralhosting.com/public_html/builds/test/$VERSION_NAME/" --user "$DATACORDER_USER:$DATACORDER_PASSWORD" -T "$file" --ftp-create-dirs
else
# Upload to indiegames
curl -k "sftp://scp.indiegames.us/~/public_html/builds/nightly/$VERSION_NAME/" --user "$INDIEGAMES_USER:$INDIEGAMES_PASSWORD" -T "$file" --ftp-create-dirs
# Upload to datacorder
curl -k "sftp://porphyrion.feralhosting.com/~/www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly/$VERSION_NAME/" --user "$DATACORDER_USER:$DATACORDER_PASSWORD" -T "$file" --ftp-create-dirs
fi
done
-47
View File
@@ -1,47 +0,0 @@
#!/usr/bin/env bash
set -ex
FILENAME=
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export DEBIAN_FRONTEND=noninteractive
if [ ! -d "$HOME/cmake-3.8/bin" ]; then
# If the cache does not currently contain CMake then download and install it
mkdir -p $HOME/cmake-3.8/
wget -O /tmp/cmake.tar.gz --no-check-certificate https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake-3.8/ --strip-components=1
fi
export PATH=$HOME/cmake-3.8/bin:$PATH
cd $HOME
if [ "${BUILD_DEPLOYMENT}" = true ]; then
wget -O appimagetool -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" # (64-bit)
chmod a+x ./appimagetool
wget -O linuxdeployqt -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" # (64-bit)
chmod a+x ./linuxdeployqt
fi
sudo apt-get -yq install valgrind
if [[ "$CC" = "clang-9" ]]; then
sudo apt-get -yq install clang-9 clang-tidy-9
fi
if [[ "$CC" = "clang-4.0" ]]; then
# Fix a header bug present in ubuntu...
sudo ln -s /usr/include/libcxxabi/__cxxabi_config.h /usr/include/c++/v1/__cxxabi_config.h
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
gem install xcpretty
brew update
brew outdated cmake || brew upgrade cmake
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
choco install mingw ninja
fi
cmake --version
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env sh
set -ex
mkdir -p /tmp/builds
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
cd build
for config in $BUILD_CONFIGS
do
cd "$config"
# Compile all targets
ninja all
# Install Freespace2 targets
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/fso -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/fso -DCOMPONENT=Freespace2 -P cmake_install.cmake
# We need to be a bit creative for determining the AppImage name since we don't want to hard-code the name
FILENAME="$(find /tmp/release/$config/fso/bin -name 'fs2_open_*' -type f -printf "%f\n").AppImage"
$HOME/appimagetool -n /tmp/release/$config/fso "/tmp/release/$config/fso/$FILENAME"
: <<'END'
# Install qtFRED targets
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/qtfred/usr -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/qtfred/usr -DCOMPONENT=qtFRED -P cmake_install.cmake
PREV="$(pwd)"
cd /tmp/release/$config/qtfred
unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH
$HOME/linuxdeployqt usr/qtfred.desktop -bundle-non-qt-libs
# Move our AppRun script to the right location
mv usr/AppRun AppRun
echo "Embed newer libstdc++ for distros that don't come with it (ubuntu 14.04)";
mkdir -p usr/optional/; mkdir -p usr/optional/libstdc++/;
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./usr/optional/libstdc++/;
$HOME/appimagetool -n . "$(find /tmp/release/$config/qtfred/usr/bin -name 'qtfred_*' -type f -printf "%f\n").AppImage"
cd "$PREV"
END
cd ..
done
cp `find /tmp/release -name '*.AppImage' -print` /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-Linux.tar.gz *.AppImage)
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cd build
for config in $BUILD_CONFIGS
do
cmake --build . --config "$config" --target install | tee build.log \
| xcpretty
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://transfer.sh/build.log.tar.gz"
exit $XCODE_RET
fi
done
ls -al /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-MacOSX.tar.gz *)
fi
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env sh
set -e
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
ninja -k 20 all
if [ "$CONFIGURATION" = "Debug" ]; then
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
--suppressions="$TRAVIS_BUILD_DIR/ci/travis/valgrind.supp" ./bin/unittests --gtest_shuffle
else
./bin/unittests --gtest_shuffle
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cmake --build . --config "$CONFIGURATION" | tee build.log | xcpretty
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://keep.sh"
exit $XCODE_RET
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
if [ "$CMAKE_GENERATOR" = "Ninja" ]; then
cmake --build . --config "$CONFIGURATION"
else
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
fi
fi
+34
View File
@@ -0,0 +1,34 @@
# Installs ATL and MFC for the v143 toolset, which the Visual Studio 2026 runner images
# only ship for the latest toolset. ATL is needed by SAPI speech (sphelper.h) and MFC by FRED2.
$ErrorActionPreference = 'Stop'
$msvcVersion = '14.44'
$component = 'Microsoft.VisualStudio.Component.VC.14.44.17.14'
$suffix = if ($env:RUNNER_ARCH -eq 'ARM64') { '.ARM64' } else { '' }
$installerDir = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$installPath = & "$installerDir\vswhere.exe" -version '[18.0,19.0)' -latest -property installationPath
if (-not $installPath) {
Write-Error 'Visual Studio 2026 was not found'
}
$arguments = @(
'/c', 'vs_installer.exe', 'modify',
'--installPath', "`"$installPath`"",
'--add', "$component.ATL$suffix",
'--add', "$component.MFC$suffix",
'--quiet', '--norestart', '--nocache'
)
$process = Start-Process -FilePath cmd.exe -ArgumentList $arguments -WorkingDirectory $installerDir -Wait -PassThru -NoNewWindow
# 3010 = success, reboot required
if ($process.ExitCode -notin 0, 3010) {
Write-Error "vs_installer exited with code $($process.ExitCode)"
}
# fail here rather than with a confusing compile error if the components didn't install
foreach ($header in 'atlbase.h', 'afxwin.h') {
if (-not (Test-Path "$installPath\VC\Tools\MSVC\$msvcVersion.*\atlmfc\include\$header")) {
Write-Error "$header for MSVC $msvcVersion is missing after install"
}
}
+16
View File
@@ -0,0 +1,16 @@
buildType:
default: release
description: R
choices:
release:
short: Release
long: Release builds
buildType: Release
fastDebug:
short: FastDebug
long: Debug with optimizations
buildType: FastDebug
debug:
short: Debug
long: Debug without optimizations
buildType: Debug
+48
View File
@@ -0,0 +1,48 @@
# - Removes duplicate entries and non-directories from a provided list
#
# clean_directory_list(<listvar> [<additional list items>...])
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <[email protected]> <[email protected]>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__clean_directory_list)
return()
endif()
set(__clean_directory_list YES)
function(clean_directory_list _var)
# combine variable's current value with additional list items
set(_in ${${_var}} ${ARGN})
if(_in)
# Initial list cleaning
list(REMOVE_DUPLICATES _in)
# Grab the absolute path of each actual directory
set(_out)
foreach(_dir ${_in})
if(IS_DIRECTORY "${_dir}")
get_filename_component(_dir "${_dir}" ABSOLUTE)
file(TO_CMAKE_PATH "${_dir}" _dir)
list(APPEND _out "${_dir}")
endif()
endforeach()
if(_out)
# Clean up the output list now
list(REMOVE_DUPLICATES _out)
endif()
# return _out
set(${_var} "${_out}" PARENT_SCOPE)
endif()
endfunction()
+311
View File
@@ -0,0 +1,311 @@
# - Create launchers to set working directory, env. vars, etc.
#
# include(CreateLaunchers) - to make these available
# guess_runtime_library_dirs(<outputvarname> [<extralibrary> ...])
# create_default_target_launcher(<targetname>
# [ARGS <args...>]
# [FORWARD_ARGS]
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
#
# create_target_launcher(<targetname>
# [ARGS <args...>]
# [FORWARD_ARGS]
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
#
# create_generic_launcher(<launchername>
# [RUNTIME_LIBRARY_DIRS <dir...>]
# [WORKING_DIRECTORY <dir>]
# [ENVIRONMENT <VAR=value> [<VAR=value>...]])
# - sets GENERIC_LAUNCHER_COMMAND and GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION
#
# Requires these CMake modules:
# ListFilter
# ProgramFilesGlob
# CleanDirectoryList
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <[email protected]> <[email protected]>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__create_launchers)
return()
endif()
set(__create_launchers YES)
include(CleanDirectoryList)
# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_launchermoddir
${CMAKE_CURRENT_LIST_FILE}
PATH)
set(_launchermoddir "${_launchermoddir}/launcher-templates")
macro(_launcher_system_settings)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITS 64)
else()
set(BITS 32)
endif()
if(WIN32)
# Find user and system name
set(SYSTEM_NAME $ENV{USERDOMAIN})
set(USER_NAME $ENV{USERNAME})
set(VCPROJ_TYPE vcproj)
set(USERFILE_EXTENSION ${SYSTEM_NAME}.${USER_NAME}.user)
set(LAUNCHER_LINESEP "&#x0A;")
if(MSVC90)
set(USERFILE_VC_VERSION 9.00)
elseif(MSVC80)
set(USERFILE_VC_VERSION 8.00)
elseif(MSVC71)
set(USERFILE_VC_VERSION 7.10)
elseif(MSVC10 OR (MSVC AND MSVC_VERSION GREATER 1600)) # 2010 or newer
set(LAUNCHER_LINESEP "\n")
set(USERFILE_VC_VERSION 10.00)
set(USERFILE_EXTENSION user)
set(VCPROJ_TYPE vcxproj)
endif()
if(BITS EQUAL 64)
set(USERFILE_PLATFORM x64)
else()
set(USERFILE_PLATFORM Win${BITS})
endif()
set(_pathdelim ";")
set(_suffix "cmd")
else()
set(_pathdelim ":")
set(USERFILE_PLATFORM ${CMAKE_SYSTEM_NAME}${BITS})
set(_suffix "sh")
find_package(GDB QUIET)
if(GDB_FOUND)
set(LAUNCHERS_GOT_GDB YES)
if(GDB_HAS_RETURN_CHILD_RESULT)
set(LAUNCHERS_GDB_ARG --return-child-result)
endif()
else()
set(LAUNCHERS_GOT_GDB)
endif()
endif()
if(WIN32 AND NOT USERFILE_REMOTE_MACHINE)
site_name(USERFILE_REMOTE_MACHINE)
mark_as_advanced(USERFILE_REMOTE_MACHINE)
endif()
endmacro()
macro(_launcher_process_args)
set(_nowhere)
set(_curdest _nowhere)
set(_val_args
ARGS
RUNTIME_LIBRARY_DIRS
WORKING_DIRECTORY
ENVIRONMENT)
set(_bool_args FORWARD_ARGS)
foreach(_arg ${_val_args} ${_bool_args})
set(${_arg})
endforeach()
foreach(_element ${ARGN})
list(FIND _val_args "${_element}" _val_arg_find)
list(FIND _bool_args "${_element}" _bool_arg_find)
if("${_val_arg_find}" GREATER "-1")
set(_curdest "${_element}")
elseif("${_bool_arg_find}" GREATER "-1")
set("${_element}" ON)
set(_curdest _nowhere)
else()
list(APPEND ${_curdest} "${_element}")
endif()
endforeach()
if(_nowhere)
message(FATAL_ERROR
"Syntax error in use of a function in CreateLaunchers!")
endif()
# Turn into a list of native paths
set(_runtime_lib_dirs)
foreach(_dlldir ${RUNTIME_LIBRARY_DIRS})
file(TO_NATIVE_PATH "${_dlldir}" _path)
set(_runtime_lib_dirs "${_runtime_lib_dirs}${_path}${_pathdelim}")
endforeach()
if(NOT WORKING_DIRECTORY)
set(WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
if(FORWARD_ARGS)
if(WIN32)
set(FWD_ARGS %*)
else()
set(FWD_ARGS $*)
endif()
else()
set(FWD_ARGS)
endif()
set(USERFILE_WORKING_DIRECTORY "${WORKING_DIRECTORY}")
set(USERFILE_COMMAND_ARGUMENTS "${ARGS}")
set(LAUNCHERSCRIPT_COMMAND_ARGUMENTS "${ARGS} ${FWD_ARGS}")
if(WIN32)
set(RUNTIME_LIBRARIES_ENVIRONMENT "PATH=${_runtime_lib_dirs};%PATH%")
file(READ
"${_launchermoddir}/launcher.env.cmd.in"
_cmdenv)
else()
if(APPLE)
set(RUNTIME_LIBRARIES_ENVIRONMENT
"DYLD_LIBRARY_PATH=${_runtime_lib_dirs}:$DYLD_LIBRARY_PATH")
else()
set(RUNTIME_LIBRARIES_ENVIRONMENT
"LD_LIBRARY_PATH=${_runtime_lib_dirs}:$LD_LIBRARY_PATH")
endif()
file(READ
"${_launchermoddir}/launcher.env.sh.in"
_cmdenv)
endif()
set(USERFILE_ENVIRONMENT "${RUNTIME_LIBRARIES_ENVIRONMENT}")
set(USERFILE_ENV_COMMANDS)
foreach(_arg "${RUNTIME_LIBRARIES_ENVIRONMENT}" ${ENVIRONMENT})
string(CONFIGURE
"@USERFILE_ENVIRONMENT@@LAUNCHER_LINESEP@@_arg@"
USERFILE_ENVIRONMENT
@ONLY)
string(CONFIGURE
"@USERFILE_ENV_COMMANDS@${_cmdenv}"
USERFILE_ENV_COMMANDS
@ONLY)
endforeach()
endmacro()
macro(_launcher_produce_vcproj_user)
if(MSVC)
file(READ
"${_launchermoddir}/perconfig.${VCPROJ_TYPE}.user.in"
_perconfig)
file(TO_NATIVE_PATH "${USERFILE_WORKING_DIRECTORY}" NATIVE_WORKING_DIRECTORY)
set(USERFILE_CONFIGSECTIONS)
foreach(USERFILE_CONFIGNAME ${CMAKE_CONFIGURATION_TYPES})
string(CONFIGURE "${_perconfig}" _temp @ONLY ESCAPE_QUOTES)
set(USERFILE_CONFIGSECTIONS "${USERFILE_CONFIGSECTIONS}${_temp}")
endforeach()
configure_file("${_launchermoddir}/${VCPROJ_TYPE}.user.in"
"${VCPROJNAME}.${VCPROJ_TYPE}.${USERFILE_EXTENSION}"
@ONLY)
endif()
endmacro()
macro(_launcher_configure_executable _src _tmp _target)
# get_filename_component(_targetname "${_target}" NAME)
get_filename_component(_targetpath "${_target}" PATH)
configure_file("${_src}"
"${_tmp}"
@ONLY)
file(COPY "${_tmp}"
DESTINATION "${_targetpath}"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endmacro()
macro(_launcher_create_target_launcher)
set(TARGET_NAME ${_targetname})
set(_fn "launch-${_targetname}-generator.${_suffix}")
configure_file("${_launchermoddir}/targetlauncher.${_suffix}.in"
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_fn}"
@ONLY)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/launch-${_targetname}-$<CONFIGURATION>.${_suffix}"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_fn}")
endmacro()
function(create_default_target_launcher _targetname)
_launcher_system_settings()
_launcher_process_args(${ARGN})
set(VCPROJNAME "${CMAKE_BINARY_DIR}/ALL_BUILD")
_launcher_produce_vcproj_user()
_launcher_create_target_launcher()
endfunction()
function(create_target_launcher _targetname)
_launcher_system_settings()
_launcher_process_args(${ARGN})
set(VCPROJNAME "${CMAKE_CURRENT_BINARY_DIR}/${_targetname}")
_launcher_produce_vcproj_user()
_launcher_create_target_launcher()
endfunction()
function(create_generic_launcher _launchername)
_launcher_system_settings()
_launcher_process_args(${ARGN})
if(NOT IS_ABSOLUTE _launchername)
set(_launchername
"${CMAKE_CURRENT_BINARY_DIR}/${_launchername}.${_suffix}")
else()
set(_launchername "${_launchername}.${_suffix}")
endif()
if(WIN32)
set(GENERIC_LAUNCHER_COMMAND "${_launchername}" PARENT_SCOPE)
set(GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION)
else()
set(GENERIC_LAUNCHER_COMMAND sh "${_launchername}" PARENT_SCOPE)
set(GENERIC_LAUNCHER_FAIL_REGULAR_EXPRESSION
"Program terminated with signal")
endif()
_launcher_configure_executable("${_launchermoddir}/genericlauncher.${_suffix}.in"
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/genericlauncher.${_suffix}.in"
"${_launchername}")
endfunction()
function(guess_runtime_library_dirs _var)
# Start off with the link directories of the calling listfile's directory
get_directory_property(_libdirs LINK_DIRECTORIES)
# Add additional libraries passed to the function
foreach(_lib ${ARGN})
get_filename_component(_libdir "${_lib}" PATH)
list(APPEND _libdirs "${_libdir}")
endforeach()
# Now, build a list of potential dll directories
set(_dlldirs)
foreach(_libdir ${_libdirs})
# Add the libdir itself
list(APPEND _dlldirs "${_libdir}")
# Look also in libdir/../bin since the dll might not be with the lib
get_filename_component(_libdir "${_libdir}/../bin" ABSOLUTE)
list(APPEND _dlldirs "${_libdir}")
endforeach()
# Only keep the valid, unique directories
clean_directory_list(_dlldirs)
# Return _dlldirs
set(${_var} "${_dlldirs}" PARENT_SCOPE)
endfunction()
+88
View File
@@ -0,0 +1,88 @@
# - Add flags to compile with extra warnings
#
# enable_extra_compiler_warnings(<targetname>)
# globally_enable_extra_compiler_warnings() - to modify CMAKE_CXX_FLAGS, etc
# to change for all targets declared after the command, instead of per-command
#
#
# Original Author:
# 2010 Ryan Pavlik <[email protected]> <[email protected]>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__enable_extra_compiler_warnings)
return()
endif()
set(__enable_extra_compiler_warnings YES)
macro(_enable_extra_compiler_warnings_flags)
set(_flags)
if(MSVC)
option(COMPILER_WARNINGS_EXTREME
"Use compiler warnings that are probably overkill."
off)
mark_as_advanced(COMPILER_WARNINGS_EXTREME)
set(_flags "/W4")
if(COMPILER_WARNINGS_EXTREME)
set(_flags "${_flags} /Wall /wd4619 /wd4668 /wd4820 /wd4571 /wd4710")
endif()
else()
include(CheckCXXCompilerFlag)
set(_flags)
check_cxx_compiler_flag(-W SUPPORTS_W_FLAG)
if(SUPPORTS_W_FLAG)
set(_flags "${_flags} -W")
endif()
check_cxx_compiler_flag(-Wall SUPPORTS_WALL_FLAG)
if(SUPPORTS_WALL_FLAG)
set(_flags "${_flags} -Wall")
endif()
check_cxx_compiler_flag(-Wextra SUPPORTS_WEXTRA_FLAG)
if(SUPPORTS_WEXTRA_FLAG)
set(_flags "${_flags} -Wextra")
endif()
if(SUPPORTS_WALL_FLAG)
# At least GCC includes -Wmaybe-uninitialized in -Wall, which
# unneccesarily whines about boost::optional (by it's nature
# it's a "maybe" warning - prone to noisy false-positives)
check_cxx_compiler_flag(-Wno-maybe-uninitialized SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
if(SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
set(_flags "${_flags} -Wno-maybe-uninitialized")
endif()
endif()
endif()
endmacro()
function(enable_extra_compiler_warnings _target)
_enable_extra_compiler_warnings_flags()
get_target_property(_origflags ${_target} COMPILE_FLAGS)
if(_origflags)
set_property(TARGET
${_target}
PROPERTY
COMPILE_FLAGS
"${_flags} ${_origflags}")
else()
set_property(TARGET
${_target}
PROPERTY
COMPILE_FLAGS
"${_flags}")
endif()
endfunction()
function(globally_enable_extra_compiler_warnings)
_enable_extra_compiler_warnings_flags()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE)
endfunction()
+53
View File
@@ -0,0 +1,53 @@
# - Combine lists of prefixes and suffixes in all combinations
#
# list_combinations(var PREFIXES listitems... SUFFIXES listitems...) -
# where var is the name of your desired output variable and PREFIXES
# and SUFFIXES are special arguments that indicate the start of your
# list of prefixes or suffixes respectively.
#
# Original Author:
# 2009-2010 Ryan Pavlik <[email protected]> <[email protected]>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(__list_combinations)
return()
endif()
set(__list_combinations YES)
function(list_combinations var)
# Parse arguments
set(_prefixes)
set(_suffixes)
set(_nowhere)
set(_curdest _nowhere)
foreach(_element ${ARGN})
if("${_element}" STREQUAL "PREFIXES")
set(_curdest _prefixes)
elseif("${_element}" STREQUAL "SUFFIXES")
set(_curdest _suffixes)
else()
list(APPEND ${_curdest} "${_element}")
endif()
endforeach()
if(_nowhere)
message(STATUS "_prefixes ${_prefixes}")
message(STATUS "_prefixes ${_suffixes}")
message(STATUS "_prefixes ${_nowhere}")
message(FATAL_ERROR
"Syntax error in use of ${CMAKE_CURRENT_LIST_FILE}")
endif()
foreach(_prefix ${_prefixes})
foreach(_suffix ${_suffixes})
list(APPEND _out "${_prefix}${_suffix}")
endforeach()
endforeach()
set(${var} "${_out}" PARENT_SCOPE)
endfunction()
+31
View File
@@ -0,0 +1,31 @@
# - Compile with multiple processes on MSVC
#
# include(MSVCMultipleProcessCompile)
#
# Requires these CMake modules:
# ListCombinations.cmake
#
# Original Author:
# 2009-2010 Ryan Pavlik <[email protected]> <[email protected]>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(MSVC AND NOT "${MSVC_VERSION}" LESS 1400)
# Only available in VS 2005 and newer
string(TOUPPER "${CMAKE_CONFIGURATION_TYPES}" _conftypesUC)
include(ListCombinations)
list_combinations(_varnames
PREFIXES
CMAKE_C_FLAGS_
CMAKE_CXX_FLAGS_
SUFFIXES
${_conftypesUC})
foreach(_var ${_varnames})
set(${_var} "${${_var}} /MP")
endforeach()
endif()
-21
View File
@@ -1,21 +0,0 @@
SET(BINARY_DESTINATION "bin")
SET(LIBRAY_DESTINATION "lib")
configure_file("${CMAKE_CURRENT_LIST_DIR}/AppRun.in" "${CMAKE_CURRENT_BINARY_DIR}/AppRun.gen" @ONLY)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AppRun-$<CONFIG>"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/AppRun.gen")
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/AppRun-$<CONFIG>" DESTINATION "." RENAME "AppRun"
COMPONENT "Freespace2")
configure_file("${CMAKE_CURRENT_LIST_DIR}/AppImage.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/AppImage.desktop.gen" @ONLY)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AppImage-$<CONFIG>.desktop"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/AppImage.desktop.gen")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AppImage-$<CONFIG>.desktop" DESTINATION "." RENAME "fso.desktop"
COMPONENT "Freespace2")
install(FILES "${CMAKE_SOURCE_DIR}/freespace2/resources/app_icon.png" DESTINATION "."
COMPONENT "Freespace2")
+36 -14
View File
@@ -2,50 +2,72 @@
#ifdef _WIN32
#include <intrin.h>
// Windows
#define cpuid __cpuid
#define cpuid __cpuidex
#define xgetbv _xgetbv
#else
#include <cstdint>
// GCC Inline Assembly
void cpuid(int CPUInfo[4],int InfoType){
void cpuid(int CPUInfo[4], int InfoType, int SubType){
__asm__ __volatile__ (
"cpuid":
"=a" (CPUInfo[0]),
"=b" (CPUInfo[1]),
"=c" (CPUInfo[2]),
"=d" (CPUInfo[3]) :
"a" (InfoType)
"a" (InfoType),
"c" (SubType)
);
}
uint64_t xgetbv(uint32_t xcr) {
uint32_t lower, higher;
__asm__ __volatile__ (
"xgetbv":
"=a"(lower),
"=d"(higher) :
"c"(xcr)
);
return (static_cast<uint64_t>(higher) << static_cast<uint64_t>(32)) | static_cast<uint64_t>(lower);
}
#endif
#include <iostream>
int main( int argc, char* argv[] )
{
int SSE = false;
int SSE2 = false;
int AVX = false;
int AVX2 = false;
bool SSE = false;
bool SSE2 = false;
bool OSXSAVE = false;
bool AVX = false;
bool AVX2 = false;
int info[4];
cpuid(info, 0);
cpuid(info, 0, 0);
int nIds = info[0];
// Detect Instruction Set
if (nIds >= 1){
cpuid(info,0x00000001);
SSE = (info[3] & ((int)1 << 25)) != 0;
SSE2 = (info[3] & ((int)1 << 26)) != 0;
AVX = (info[2] & ((int)1 << 28)) != 0;
cpuid(info, 0x00000001, 0);
SSE = (info[3] & ((int)1 << 25)) != 0;
SSE2 = (info[3] & ((int)1 << 26)) != 0;
OSXSAVE = (info[2] & ((int)1 << 27)) != 0;
AVX = (info[2] & ((int)1 << 28)) != 0;
}
if (nIds >= 7){
cpuid(info,0x00000007);
cpuid(info,0x00000007, 0);
AVX2 = (info[1] & ((int)1 << 5)) != 0;
}
// Detect OS Support
if (!OSXSAVE || (xgetbv(0) & 0x6) == 0) {
AVX = false;
AVX2 = false;
}
if (AVX2)
std::cout << "AVX2";
else if(AVX)
+16
View File
@@ -24,3 +24,19 @@ set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
if (FSO_BUILD_WITH_DISCORD)
message(WARNING "Discord support is not tested for cross-compilation. Here be dragons! To disable, set -DFSO_BUILD_WITH_DISCORD:BOOL=OFF")
endif()
if (FSO_BUILD_FRED2)
message(WARNING "FRED2 support is not tested for cross-compilation. Here be dragons! To disable, set -DFSO_BUILD_FRED2:BOOL=OFF")
endif()
if (FSO_USE_SPEECH)
message(WARNING "Speech support is not tested for cross-compilation. Here be dragons! To disable, set -DFSO_USE_SPEECH:BOOL=OFF")
endif()
if (FSO_USE_VOICEREC)
message(WARNING "Voice recognition support is not tested for cross-compilation. Here be dragons! To disable, set -DFSO_USE_VOICEREC:BOOL=OFF")
endif()
+11 -1
View File
@@ -97,9 +97,19 @@ function(handle_embedded_files _target)
set(INCLUDE_LIST "${INCLUDE_LIST}\n#include \"${HEADER_FILE}\"")
set(ARRAY_ELEMENTS "${ARRAY_ELEMENTS}\n\t{ \"${_pathType}\", \"${FILE_NAME}\" , ${FIELD_NAME} , ${FIELD_NAME}_size },")
IF(CMAKE_CROSSCOMPILING)
SET(EMBEDFILE_PATH "EMBEDFILE-NOTFOUND" CACHE FILEPATH "Required for a cross compiling build, point to an embedfile of a cmake build for the host OS")
IF(EMBEDFILE_PATH STREQUAL "EMBEDFILE-NOTFOUND")
#This could, possibly, be configured to compile an embedfile using host compilation automatically, but that seems to be a challenge.
message(FATAL_ERROR "A manual embedfile path must be configured for cross compilation. Set EMBEDFILE_PATH to the location of an embedfile executable, found in the build directories for the host OS.")
ENDIF()
ELSE(CMAKE_CROSSCOMPILING)
SET(EMBEDFILE_PATH "embedfile")
ENDIF(CMAKE_CROSSCOMPILING)
add_custom_command(
OUTPUT ${ALL_OUTPUTS}
COMMAND embedfile "${_filePath}" "${_outputBasePath}" "${FIELD_NAME}"
COMMAND ${EMBEDFILE_PATH} "${_filePath}" "${_outputBasePath}" "${FIELD_NAME}"
MAIN_DEPENDENCY "${_filePath}"
COMMENT "Generating string file for ${_filePath}"
)
-4054
View File
File diff suppressed because it is too large. Load diff
+6
View File
@@ -9,6 +9,12 @@ if (WIN32)
if (NOT HAVE_SAPI_H)
message(SEND_ERROR "sapi.h could not be found on your platform. Please disable speech support.")
endif()
elseif(APPLE)
# it should just work
elseif(ANDROID)
# connects to a java TTS manager via SDL activity class
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# uses speech-dispatcher with dlopen
else()
message(SEND_ERROR "Text to Speech is not supported on this platform!")
endif()
+34
View File
@@ -7,3 +7,37 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
else()
set(IS_64BIT FALSE)
endif()
set(IS_ARM64 FALSE)
set(IS_ARMV7A FALSE)
if (NOT "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "") # needed to cover Visual Studio generator
if(CMAKE_GENERATOR_PLATFORM MATCHES "^(aarch64|arm64|ARM64)")
set(IS_ARM64 TRUE)
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^(armv7)")
set(IS_ARMV7A TRUE)
endif()
else()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|ARM64)")
set(IS_ARM64 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7)")
set(IS_ARMV7A TRUE)
endif()
endif()
set(IS_RISCV FALSE)
if (NOT "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "") # needed to cover Visual Studio generator
if(CMAKE_GENERATOR_PLATFORM MATCHES "^(riscv64|RISCV64|riscv32|RISCV32)")
set(IS_RISCV TRUE)
endif()
else()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(riscv64|RISCV64|riscv32|RISCV32)")
set(IS_RISCV TRUE)
endif()
endif()
set(IS_X86 FALSE)
if (NOT IS_ARM64 AND NOT IS_RISCV AND NOT IS_ARMV7A)
set(IS_X86 TRUE)
endif()
@@ -0,0 +1,14 @@
cd @USERFILE_WORKING_DIRECTORY@
@USERFILE_ENV_COMMANDS@
IF NOT [x%1]==[x--debugger] GOTO SkipDebuggingMess
ECHO Need to ditch the debugger!
SHIFT /1
%1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO EOF
:SkipDebuggingMess
%*
:EOF
@@ -0,0 +1,18 @@
#!/bin/sh
bindir=$(pwd)
cd @USERFILE_WORKING_DIRECTORY@
@USERFILE_ENV_COMMANDS@
if test "x$1" = "x--debugger"; then
shift
cmd="$1"
shift
if test "x@LAUNCHERS_GOT_GDB@" = "xYES"; then
echo "r $@" > $bindir/gdbscript
echo "bt" >> $bindir/gdbscript
@GDB_COMMAND@ -batch -command=$bindir/gdbscript @LAUNCHERS_GDB_ARG@ $cmd
else
$cmd $@
fi
else
$@
fi
@@ -0,0 +1 @@
set @_arg@
@@ -0,0 +1 @@
export @_arg@
@@ -0,0 +1,28 @@
<Configuration
Name="@USERFILE_CONFIGNAME@|@USERFILE_PLATFORM@"
>
<DebugSettings
Command="${USERFILE_@USERFILE_CONFIGNAME@_COMMAND}"
WorkingDirectory="@USERFILE_WORKING_DIRECTORY@"
CommandArguments="@USERFILE_COMMAND_ARGUMENTS@"
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="@USERFILE_REMOTE_MACHINE@"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment="@USERFILE_ENVIRONMENT@"
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
@@ -0,0 +1,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='@USERFILE_CONFIGNAME@|@USERFILE_PLATFORM@'">
<LocalDebuggerEnvironment>@USERFILE_ENVIRONMENT@</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>$(TargetPath)</LocalDebuggerCommand>
<LocalDebuggerCommandArguments>@USERFILE_COMMAND_ARGUMENTS@</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>@NATIVE_WORKING_DIRECTORY@</LocalDebuggerWorkingDirectory>
</PropertyGroup>
@@ -0,0 +1,8 @@
cd @USERFILE_WORKING_DIRECTORY@
@USERFILE_ENV_COMMANDS@
if [%1]==[--debugger] (
SHIFT
)
"@USERFILE_COMMAND@" @LAUNCHERSCRIPT_COMMAND_ARGUMENTS@
pause
@@ -0,0 +1,16 @@
#!/bin/sh
bindir=$(pwd)
cd @USERFILE_WORKING_DIRECTORY@
@USERFILE_ENV_COMMANDS@
if test "x$1" = "x--debugger"; then
shift
if test "x@LAUNCHERS_GOT_GDB@" = "xYES"; then
echo "r @LAUNCHERSCRIPT_COMMAND_ARGUMENTS@" > $bindir/gdbscript
echo "bt" >> $bindir/gdbscript
@GDB_COMMAND@ -batch -command=$bindir/gdbscript @LAUNCHERS_GDB_ARG@ @USERFILE_COMMAND@
else
"@USERFILE_COMMAND@" @LAUNCHERSCRIPT_COMMAND_ARGUMENTS@
fi
else
"@USERFILE_COMMAND@" @LAUNCHERSCRIPT_COMMAND_ARGUMENTS@
fi
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="@USERFILE_VC_VERSION@"
ShowAllFiles="false"
>
<Configurations>
@USERFILE_CONFIGSECTIONS@
</Configurations>
</VisualStudioUserFile>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@USERFILE_CONFIGSECTIONS@
</Project>
+8 -2
View File
@@ -11,8 +11,6 @@ endif()
target_link_libraries(platform INTERFACE ${COCOA_LIBRARY})
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
SET(CMAKE_SKIP_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH @loader_path/../Frameworks/)
@@ -22,6 +20,14 @@ SET(LIBRAY_DESTINATION "../Frameworks")
set(PLATFORM_MAC TRUE CACHE INTERNAL "" FORCE)
# Maybe override arm64 setting if we are compiling for different architecture
# If not specified, or if it's a universal build, then this should do nothing
if(CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
set(IS_ARM64 TRUE)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(IS_ARM64 FALSE)
endif()
# Generate and don't strip debug symbols
# These settings don't seem to generate debug symbols for code and Freespace2
# so those settings are set manually in code and Freespace2's CMakeLists.txt files
+1
View File
@@ -10,6 +10,7 @@ SET(WIN32_LIBS
winmm
ws2_32
psapi
shlwapi
)
IF (MINGW)
+2
View File
@@ -9,6 +9,8 @@
#cmakedefine SCP_HAVE_STD_MAX_ALIGN_T
#cmakedefine01 IS_64BIT
#cmakedefine01 IS_ARM64
#cmakedefine01 IS_RISCV
#cmakedefine01 SCP_HAVE_STRCASECMP
#cmakedefine01 SCP_HAVE_STRNCASECMP
+3 -3
View File
@@ -4,7 +4,7 @@ MESSAGE(STATUS "Doing configuration specific to Apple Clang...")
# TODO: Actually add Mac specific flags here...
# Suppress specific warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -fsigned-char -Wno-unknown-pragmas")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fsigned-char -Wno-unknown-pragmas")
# Omit "conversion from string literal to 'char *' is deprecated" warnings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
@@ -13,6 +13,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-unused-variable")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-unused-variable -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS_DEBUG "-Wextra -Wshadow -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wshadow")
+67 -16
View File
@@ -10,8 +10,40 @@ option(CLANG_ENABLE_ADDRESS_SANITIZER "Enable -fsanitize=address" OFF)
option(CLANG_USE_LIBCXX "Use libc++" OFF)
# These are the default values
set(C_BASE_FLAGS "-march=native -pipe")
set(CXX_BASE_FLAGS "-march=native -pipe")
set(C_BASE_FLAGS "-pipe")
set(CXX_BASE_FLAGS "-pipe")
if(IS_X86)
if(FORCED_NATIVE_SIMD_INSTRUCTIONS)
set(CLANG_EXTENSIONS "-march=native")
elseif (FSO_INSTRUCTION_SET STREQUAL "")
set(CLANG_EXTENSIONS "-march=x86-64")
elseif (FSO_INSTRUCTION_SET STREQUAL "SSE")
set(CLANG_EXTENSIONS "-march=x86-64 -msse -mfpmath=sse")
elseif (FSO_INSTRUCTION_SET STREQUAL "SSE2")
set(CLANG_EXTENSIONS "-march=x86-64 -msse -msse2 -mfpmath=sse")
elseif (FSO_INSTRUCTION_SET STREQUAL "AVX")
set(CLANG_EXTENSIONS "-march=x86-64-v2 -msse -msse2 -mavx -mfpmath=sse")
elseif (FSO_INSTRUCTION_SET STREQUAL "AVX2")
set(CLANG_EXTENSIONS "-march=x86-64-v3 -msse -msse2 -mavx -mavx2 -mfpmath=sse")
else ()
message( FATAL_ERROR "Unknown instruction set encountered for clang. Update toolchain-clang.cmake!" )
endif()
set(C_BASE_FLAGS "${C_BASE_FLAGS} ${CLANG_EXTENSIONS}")
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} ${CLANG_EXTENSIONS}")
elseif(IS_ARM)
if(FORCED_NATIVE_SIMD_INSTRUCTIONS)
set(C_BASE_FLAGS "${C_BASE_FLAGS} -march=native")
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -march=native")
endif ()
elseif(IS_RISCV)
# Default C/CXX_BASE_FLAGS are fine for RISC-V
endif()
if (USE_STATIC_LIBCXX)
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -static-libstdc++ -Qunused-arguments")
endif()
# For C and C++, the values can be overwritten independently
if(DEFINED ENV{CXXFLAGS})
@@ -33,12 +65,8 @@ set(COMPILER_FLAGS "")
_enable_extra_compiler_warnings_flags()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${_flags}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fsigned-char -Wno-unknown-pragmas")
# Omit "argument unused during compilation" when clang is used with ccache.
if(${CMAKE_CXX_COMPILER} MATCHES "ccache")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Qunused-arguments")
endif()
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
# Force color diagnostics for Ninja generator
@@ -83,20 +111,43 @@ if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-shift-negative-value")
endif()
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-parameter")
# Check if there is a user-set optimisation flag
string(REGEX MATCH "-O[a-zA-Z|0-9]+" CXX_OPT_FLAG ${CXX_BASE_FLAGS})
string(REGEX MATCH "-O[a-zA-Z|0-9]+" C_OPT_FLAG ${C_BASE_FLAGS})
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
# If no user-set opt flag, set -O3 and -Og
if ("${CXX_OPT_FLAG}" STREQUAL "")
set(CXX_OPT_FLAG_RELEASE "-O3")
set(CXX_OPT_FLAG_DEBUG "-O0")
else()
set(CXX_OPT_FLAG_RELEASE "${CXX_OPT_FLAG}")
set(CXX_OPT_FLAG_DEBUG "${CXX_OPT_FLAG}")
endif()
if ("${C_OPT_FLAG}" STREQUAL "")
set(C_OPT_FLAG_RELEASE "-O3")
set(C_OPT_FLAG_DEBUG "-O0")
else()
set(C_OPT_FLAG_RELEASE "${C_OPT_FLAG}")
set(C_OPT_FLAG_DEBUG "${C_OPT_FLAG}")
endif()
# Always use the base flags and add our compiler flags at the bacl
set(CXX_FLAGS_RELEASE "${CXX_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-parameter")
set(C_FLAGS_RELEASE "${C_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-parameter")
# Valgrind (as used by CI) does not understand the DWARF5 debug info that clang
# emits by default, so force DWARF4 to keep memcheck able to symbolize the binary.
set(CXX_FLAGS_DEBUG "${CXX_OPT_FLAG_DEBUG} -g -gdwarf-4 -Wshadow")
set(C_FLAGS_DEBUG "${C_OPT_FLAG_DEBUG} -g -gdwarf-4 -Wshadow")
# Always use the base flags and add our compiler flags at the back
set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${C_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_RELEASE ${CXX_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${C_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${CXX_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${C_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "")
@@ -120,7 +171,7 @@ if (FSO_FATAL_WARNINGS)
target_compile_options(compiler INTERFACE "-Werror")
endif()
# Always define this to make sure that the fixed width format macros are available
# Always define this to make sure that the fixed-width format macros are available
target_compile_definitions(compiler INTERFACE __STDC_FORMAT_MACROS)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW)
+73 -10
View File
@@ -12,8 +12,49 @@ option(GCC_USE_GOLD "Use the gold linker instead of the standard linker" OFF)
option(GCC_GENERATE_GDB_INDEX "Adds linker option to generate the gdb index for debug builds" OFF)
# These are the default values
set(C_BASE_FLAGS "-march=native -pipe")
set(CXX_BASE_FLAGS "-march=native -pipe")
set(C_BASE_FLAGS "-pipe")
set(CXX_BASE_FLAGS "-pipe")
if(IS_X86)
if(FORCED_NATIVE_SIMD_INSTRUCTIONS)
set(GCC_EXTENSIONS "-march=native")
elseif (FSO_INSTRUCTION_SET STREQUAL "")
set(GCC_EXTENSIONS "-march=x86-64")
elseif (FSO_INSTRUCTION_SET STREQUAL "SSE")
set(GCC_EXTENSIONS "-march=x86-64 -msse -mfpmath=sse")
elseif (FSO_INSTRUCTION_SET STREQUAL "SSE2")
set(GCC_EXTENSIONS "-march=x86-64 -msse -msse2 -mfpmath=sse")
elseif (FSO_INSTRUCTION_SET STREQUAL "AVX")
set(GCC_EXTENSIONS "-march=x86-64-v2 -msse -msse2 -mavx -mfpmath=sse")
elseif (FSO_INSTRUCTION_SET STREQUAL "AVX2")
set(GCC_EXTENSIONS "-march=x86-64-v3 -msse -msse2 -mavx -mavx2 -mfpmath=sse")
else ()
message( FATAL_ERROR "Unknown instruction set encountered for GCC. Update toolchain-gcc.cmake!" )
endif()
set(C_BASE_FLAGS "${C_BASE_FLAGS} ${GCC_EXTENSIONS}")
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} ${GCC_EXTENSIONS}")
if (IS_64BIT)
set(C_BASE_FLAGS "${C_BASE_FLAGS} -m64")
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -m64")
endif()
elseif(IS_ARM)
if(FORCED_NATIVE_SIMD_INSTRUCTIONS)
set(C_BASE_FLAGS "${C_BASE_FLAGS} -march=native")
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -march=native")
endif ()
elseif(IS_RISCV)
# You do not need to pass a -march, passing nothing will make gcc to choose itself.
# If you want a specific set of instructions like vectors, set -march in CFLAGS and CXXFLAGS env variables
# Example for vectors: -march=rv64gcv
# https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html
# As such, default C/CXX_BASE_FLAGS are sufficient.
endif()
if (USE_STATIC_LIBCXX)
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -static-libstdc++")
endif()
# For C and C++, the values can be overwritten independently
if(DEFINED ENV{CFLAGS})
@@ -45,7 +86,7 @@ endif()
_enable_extra_compiler_warnings_flags()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${_flags}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fsigned-char -Wno-unknown-pragmas")
if (NOT GCC_INCREMENTAL_LINKING)
# Place each function and data in its own section so the linker can
@@ -113,19 +154,41 @@ if(SUPPORTS_STRINGOP_TRUNCATION)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-stringop-overflow")
endif()
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered -Wno-unused-parameter")
# Check if there is a user-set optimisation flag
string(REGEX MATCH "-O[a-zA-Z|0-9]+" CXX_OPT_FLAG ${CXX_BASE_FLAGS})
string(REGEX MATCH "-O[a-zA-Z|0-9]+" C_OPT_FLAG ${C_BASE_FLAGS})
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
# If no user-set opt flag, set -O3 and -Og
if ("${CXX_OPT_FLAG}" STREQUAL "")
set(CXX_OPT_FLAG_RELEASE "-O3")
set(CXX_OPT_FLAG_DEBUG "-O0")
else()
set(CXX_OPT_FLAG_RELEASE "${CXX_OPT_FLAG}")
set(CXX_OPT_FLAG_DEBUG "${CXX_OPT_FLAG}")
endif()
if ("${C_OPT_FLAG}" STREQUAL "")
set(C_OPT_FLAG_RELEASE "-O3")
set(C_OPT_FLAG_DEBUG "-O0")
else()
set(C_OPT_FLAG_RELEASE "${C_OPT_FLAG}")
set(C_OPT_FLAG_DEBUG "${C_OPT_FLAG}")
endif()
set(CXX_FLAGS_RELEASE "${CXX_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered -Wno-unused-parameter")
set(C_FLAGS_RELEASE "${C_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered -Wno-unused-parameter")
set(CXX_FLAGS_DEBUG "${CXX_OPT_FLAG_DEBUG} -g -Wshadow")
set(C_FLAGS_DEBUG "${C_OPT_FLAG_DEBUG} -g -Wshadow")
# Always use the base flags and add our compiler flags at the back
set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${C_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_RELEASE ${CXX_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${C_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_DEBUG ${CXX_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${C_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}")
@@ -165,7 +228,7 @@ if (FSO_FATAL_WARNINGS)
target_compile_options(compiler INTERFACE "-Werror")
endif()
# Always define this to make sure that the fixed width format macros are available
# Always define this to make sure that the fixed-width format macros are available
target_compile_definitions(compiler INTERFACE __STDC_FORMAT_MACROS=1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW)
+40 -56
View File
@@ -13,6 +13,13 @@ option(MSVC_RELEASE_DEBUGGING "Set options that allow to debug release builds" O
MARK_AS_ADVANCED(FORCE MSVC_USE_RUNTIME_DLL)
MARK_AS_ADVANCED(FORCE MSVC_RELEASE_DEBUGGING)
# Qt is only available as DLL-runtime builds, so qtFRED forces the DLL runtime for the whole tree
if(MSVC_USE_RUNTIME_DLL OR FSO_BUILD_QTFRED)
set(FSO_MSVC_RUNTIME_DLL ON)
else()
set(FSO_MSVC_RUNTIME_DLL OFF)
endif()
# These are the warnings we disable
set(WARNING_FLAGS
/wd4100 # unreferenced formal parameters
@@ -46,9 +53,13 @@ target_compile_options(compiler INTERFACE ${WARNING_FLAGS})
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST /DYNAMICBASE:NO /SAFESEH:NO /ERRORREPORT:PROMPT /NOLOGO")
set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST /SAFESEH:NO /ERRORREPORT:PROMPT /NOLOGO")
set(CMAKE_STATIC_LINKER_FLAGS "")
if(NOT IS_ARM64)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DYNAMICBASE:NO")
endif()
# Release
set(CMAKE_C_FLAGS_RELEASE "/GL /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_CXX_FLAGS_RELEASE "/GL /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
@@ -67,77 +78,50 @@ if (MSVC_RELEASE_DEBUGGING)
endif()
endif()
IF(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
ELSE(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
ENDIF(MSVC_USE_RUNTIME_DLL)
# The debug runtime is not redistributable (statically linked or not), so only Debug may use it
IF(FSO_MSVC_RUNTIME_DLL)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
add_compile_definitions(_AFXDLL)
ELSE()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
ENDIF()
# Debug
set(CMAKE_C_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
set(CMAKE_CXX_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /INCREMENTAL:NO /MAPINFO:EXPORTS /NODEFAULTLIB:libcmt.lib")
IF(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
ELSE(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
ENDIF(MSVC_USE_RUNTIME_DLL)
INCLUDE(MSVCMultipleProcessCompile)
# Visual Studio supports compiling for multiple vector instruction sets
SET(POSSIBLE_INSTUCTION_SETS "" SSE SSE2 AVX AVX2)
if (NOT DEFINED MSVC_SIMD_INSTRUCTIONS)
detect_simd_instructions(MSVC_DETECTED_SIMD_INSTRUCTIONS)
if(IS_X86)
if(FORCED_NATIVE_SIMD_INSTRUCTIONS)
# MSVC has no direct -march=native equivalent, so just use the detected extensions.
SET(FSO_INSTRUCTION_SET ${DETECTED_SIMD_INSTRUCTIONS})
endif()
SET(MSVC_SIMD_INSTRUCTIONS "${MSVC_DETECTED_SIMD_INSTRUCTIONS}" CACHE FILEPATH "The SIMD instructions which will be used, possible values are ${POSSIBLE_INSTUCTION_SETS}")
MARK_AS_ADVANCED(FORCE MSVC_SIMD_INSTRUCTIONS)
endif()
set(FSO_INSTRUCTION_SET ${MSVC_SIMD_INSTRUCTIONS})
if(FSO_INSTRUCTION_SET STREQUAL "")
set(MSVC_SIMD_INSTRUCTIONS "IA32")
else()
set(MSVC_SIMD_INSTRUCTIONS ${FSO_INSTRUCTION_SET})
endif()
LIST(FIND POSSIBLE_INSTUCTION_SETS "${MSVC_SIMD_INSTRUCTIONS}" SET_INDEX)
if (NOT (IS_64BIT AND (MSVC_SIMD_INSTRUCTIONS STREQUAL "IA32" OR MSVC_SIMD_INSTRUCTIONS STREQUAL "SSE" OR MSVC_SIMD_INSTRUCTIONS STREQUAL "SSE2")))
# 32-Bit and SSE(2) mustn't be set, as these are implied in x86_64 and thus MSVC does not support it for the /arch argument
CHECK_CXX_COMPILER_FLAG("/arch:${MSVC_SIMD_INSTRUCTIONS}" COMPILER_SUPPORTS_ARCH)
if (SET_INDEX LESS 0)
MESSAGE(STATUS "An invalid instruction set was specified, defaulting to no special compiler options.")
else()
IF (NOT SET_INDEX EQUAL 0)
SET(FOUND)
IF(COMPILER_SUPPORTS_ARCH)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:${MSVC_SIMD_INSTRUCTIONS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:${MSVC_SIMD_INSTRUCTIONS}")
ELSE()
message( FATAL_ERROR "Your version of MSVC does not support the requested instruction set. Consider updating!" )
ENDIF()
endif()
FOREACH(list_index RANGE ${SET_INDEX} 1)
list(GET POSSIBLE_INSTUCTION_SETS ${list_index} _simd_set)
CHECK_CXX_COMPILER_FLAG("/arch:${_simd_set}" COMPILER_SUPPORTS_ARCH_${_simd_set})
IF(COMPILER_SUPPORTS_ARCH_${_simd_set})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:${_simd_set}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:${_simd_set}")
SET(FOUND TRUE)
BREAK()
ENDIF()
ENDFOREACH(list_index)
IF(NOT FOUND)
# Don't set anything, it will likely not work
MESSAGE(STATUS "Your compiler does not support any optimization flags, defaulting to none")
ENDIF(NOT FOUND)
ELSE()
CHECK_CXX_COMPILER_FLAG("/arch:IA32" COMPILER_SUPPORTS_ARCH_IA32)
IF(COMPILER_SUPPORTS_ARCH_IA32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:IA32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:IA32")
ENDIF(COMPILER_SUPPORTS_ARCH_IA32)
ENDIF()
endif()
target_compile_definitions(compiler INTERFACE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _SECURE_SCL=0 NOMINMAX
"$<$<CONFIG:FastDebug>:_ITERATOR_DEBUG_LEVEL=0>" _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
target_compile_definitions(compiler INTERFACE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _SECURE_SCL=0 NOMINMAX _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
if (FSO_FATAL_WARNINGS)
# Make warnings fatal if the right variable is set
+56 -10
View File
@@ -3,7 +3,62 @@
add_library(compiler INTERFACE)
target_compile_definitions(compiler INTERFACE "$<$<CONFIG:Release>:NDEBUG>;$<$<CONFIG:Debug>:_DEBUG>;$<$<CONFIG:FastDebug>:_DEBUG>")
set(FSO_CONFIG_DEFINITIONS "$<$<CONFIG:Release>:NDEBUG>" "$<$<CONFIG:Debug>:_DEBUG>")
if(NOT MSVC)
# On MSVC the debug runtime flags (/MTd, /MDd) define _DEBUG themselves, and a FastDebug
# build on the release runtime must not have it
list(APPEND FSO_CONFIG_DEFINITIONS "$<$<CONFIG:FastDebug>:_DEBUG>")
endif()
target_compile_definitions(compiler INTERFACE ${FSO_CONFIG_DEFINITIONS})
set(FORCED_NATIVE_SIMD_INSTRUCTIONS ON CACHE BOOL "Override instruction set detection and compile with the maximum possible instructions for the current system.")
IF(IS_X86)
SET(POSSIBLE_INSTRUCTION_SETS "" SSE SSE2 AVX AVX2)
if (CMAKE_CROSSCOMPILING)
message("Cross-Compile cannot detect supported instruction sets. Defaulting to SSE2. Disabling host-optimization.")
set(FORCED_NATIVE_SIMD_INSTRUCTIONS OFF)
set(DETECTED_SIMD_INSTRUCTIONS SSE2)
else()
detect_simd_instructions(DETECTED_SIMD_INSTRUCTIONS)
endif()
set(FORCED_SIMD_INSTRUCTIONS "" CACHE STRING "Overrides any instruction set settings (including forced-native). Any of ${POSSIBLE_INSTRUCTION_SETS}.")
if (NOT FORCED_SIMD_INSTRUCTIONS STREQUAL "")
set(FORCED_NATIVE_SIMD_INSTRUCTIONS OFF)
LIST(FIND POSSIBLE_INSTRUCTION_SETS "${FORCED_SIMD_INSTRUCTIONS}" SET_INDEX)
if (SET_INDEX LESS 0)
MESSAGE(STATUS "An invalid instruction set was specified, defaulting to no special compiler options.")
set(FSO_INSTRUCTION_SET "")
else ()
LIST(FIND POSSIBLE_INSTRUCTION_SETS "${DETECTED_SIMD_INSTRUCTIONS}" SET_INDEX)
if (SET_INDEX LESS 0)
MESSAGE(STATUS "An instruction set was specified which is unsupported on this platform. Compiled binary might not be executable.")
endif()
set(FSO_INSTRUCTION_SET ${FORCED_SIMD_INSTRUCTIONS})
endif()
else()
SET(FSO_INSTRUCTION_SET ${DETECTED_SIMD_INSTRUCTIONS})
endif()
MESSAGE(STATUS "Using instruction set level ${FSO_INSTRUCTION_SET}. Optimizations for host-system specifically: ${FORCED_NATIVE_SIMD_INSTRUCTIONS}.")
if (FSO_INSTRUCTION_SET STREQUAL "SSE")
add_compile_definitions(FSO_SIMD_SSE)
elseif (FSO_INSTRUCTION_SET STREQUAL "SSE2")
add_compile_definitions(FSO_SIMD_SSE)
add_compile_definitions(FSO_SIMD_SSE2)
elseif (FSO_INSTRUCTION_SET STREQUAL "AVX")
add_compile_definitions(FSO_SIMD_SSE)
add_compile_definitions(FSO_SIMD_SSE2)
add_compile_definitions(FSO_SIMD_AVX)
elseif (FSO_INSTRUCTION_SET STREQUAL "AVX2")
add_compile_definitions(FSO_SIMD_SSE)
add_compile_definitions(FSO_SIMD_SSE2)
add_compile_definitions(FSO_SIMD_AVX)
add_compile_definitions(FSO_SIMD_AVX2)
endif()
ENDIF()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
include(toolchain-gcc)
@@ -25,12 +80,3 @@ set(CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_FASTDEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
set(CMAKE_STATIC_LINKER_FLAGS_FASTDEBUG "${CMAKE_STATIC_LINKER_FLAGS_RELEASE}")
if (MSVC)
# Adjust runtime library
string(REPLACE "/MD" "/MDd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
string(REPLACE "/MT" "/MTd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
string(REPLACE "/MD" "/MDd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
string(REPLACE "/MT" "/MTd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
endif()
+56 -38
View File
@@ -66,31 +66,48 @@ ENDIF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
SET(${OUTVAR} "${CMAKE_COMMAND}" -P ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${NAME} PARENT_SCOPE)
ENDFUNCTION(EP_CHECK_FILE_EXISTS)
# Use rsync if possible for COPY_FILE_TO_TARGET macro in order to preserve
# symlinks as copy_if_different follows them which results in multiple copies
if(PLATFORM_UNIX AND NOT DEFINED RSYNC_BIN)
find_program(RSYNC_BIN rsync)
endif()
MACRO(COPY_FILE_TO_TARGET _target _file)
if(UNIX)
if(RSYNC_BIN)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND cp -a "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
TARGET ${_target} POST_BUILD
COMMAND ${RSYNC_BIN} -rlq "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}"
COMMENT "copying '${_file}'..."
VERBATIM
)
else()
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
)
if (IS_DIRECTORY "${_file}")
get_filename_component(_dirName "${_file}" NAME)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/${_dirName}"
COMMENT "copying '${_file}'..."
VERBATIM
)
else()
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
VERBATIM
)
endif()
endif()
endmacro(COPY_FILE_TO_TARGET)
MACRO(COPY_FILES_TO_TARGET _target)
if(UNIX)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND mkdir -p "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "Creating '$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/'..."
)
endif()
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "Creating '$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/'..."
VERBATIM
)
FOREACH(file IN LISTS TARGET_COPY_FILES)
COPY_FILE_TO_TARGET("${_target}" "${file}")
ENDFOREACH(file)
@@ -145,27 +162,17 @@ function(set_precompiled_header _target _headerPath)
target_compile_definitions(${_target} PRIVATE CMAKE_PCH)
target_precompile_headers(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${_headerPath}>")
else()
if (ENABLE_COTIRE)
message("${_headerPath}")
set_target_properties(${_target} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${_headerPath}")
# Disable unity build as it doesn't work well for us
set_target_properties(${_target} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${_target})
else()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/FI ${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
ELSE()
MESSAGE("Unknown compiler for global includes. This will probably break the build.")
ENDIF()
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/FI ${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
ELSE()
MESSAGE("Unknown compiler for global includes. This will probably break the build.")
ENDIF()
endif()
endfunction()
@@ -234,6 +241,17 @@ function(suppress_file_warnings)
endif()
endfunction(suppress_file_warnings)
# Suppress no symbols warnings in static libraries (on Xcode)
function(suppress_no_symbol_warnings _target)
if(XCODE)
get_target_property(target_type ${_target} TYPE)
if(target_type STREQUAL "STATIC_LIBRARY")
set_property(TARGET ${_target} APPEND PROPERTY
STATIC_LIBRARY_OPTIONS "-no_warning_for_no_symbols"
)
endif()
endif()
endfunction(suppress_no_symbol_warnings)
function(list_target_dependencies _target _out_var)
set(out_list)
+11 -3
View File
@@ -6,8 +6,8 @@ if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
endif()
set_if_not_defined(FSO_VERSION_MAJOR 22)
set_if_not_defined(FSO_VERSION_MINOR 1)
set_if_not_defined(FSO_VERSION_MAJOR 26)
set_if_not_defined(FSO_VERSION_MINOR 3)
set_if_not_defined(FSO_VERSION_BUILD 0)
# A numeric revision e.g. the CI build number
@@ -35,7 +35,15 @@ ELSE()
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}_${FSO_VERSION_REVISION_STR}")
ENDIF()
IF(IS_64BIT)
IF(IS_RISCV)
IF(IS_64BIT)
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_riscv64")
ELSE()
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_riscv32")
ENDIF()
ELSEIF(IS_ARM64)
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_arm64")
ELSEIF(IS_64BIT)
# This is a 64-bit builds
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_x64")
ENDIF()
+39 -12
View File
@@ -6,7 +6,7 @@ INCLUDE(voice_rec.cmake)
ADD_LIBRARY(code STATIC ${source_files} ${VOICE_REC_FILES})
target_compile_features(code PUBLIC cxx_std_11)
target_compile_features(code PUBLIC cxx_std_17)
if (MSVC)
target_compile_definitions(code PUBLIC "PDB_DEBUGGING=1")
@@ -20,6 +20,17 @@ TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR}/code)
if (FSO_BUILD_WITH_OPENGL)
target_link_libraries(code PUBLIC OpenGL)
if(FSO_BUILD_WITH_OPENGL_DEBUG)
add_definitions(-DFS_OPENGL_DEBUG)
endif()
endif()
if(FSO_BUILD_WITH_OPENXR)
add_definitions(-DFS_OPENXR)
endif()
if(FSO_BUILD_WITH_OPENXR_DEBUG AND FSO_BUILD_WITH_OPENXR)
add_definitions(-DFS_OPENXR_DEBUG)
endif()
TARGET_LINK_LIBRARIES(code PUBLIC openal)
@@ -28,7 +39,7 @@ TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC lz4)
TARGET_LINK_LIBRARIES(code PUBLIC sdl2)
TARGET_LINK_LIBRARIES(code PUBLIC sdl3)
if (FSO_BUILD_WITH_FFMPEG)
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
@@ -41,15 +52,14 @@ TARGET_LINK_LIBRARIES(code PUBLIC compiler)
target_link_libraries(code PUBLIC md5)
target_link_libraries(code PUBLIC discord-rpc)
if (FSO_BUILD_WITH_DISCORD)
target_link_libraries(code PUBLIC discord-rpc)
add_definitions(-DWITH_DISCORD)
endif()
target_link_libraries(code PUBLIC libRocket)
target_link_libraries(code PUBLIC pcp)
if (FSO_BUILD_WITH_VULKAN)
target_link_libraries(code PUBLIC vulkan-hpp)
endif()
target_link_libraries(code PUBLIC pcpnatpmp)
target_link_libraries(code PUBLIC parsers)
@@ -64,9 +74,21 @@ ENDIF(FSO_USE_SPEECH)
TARGET_LINK_LIBRARIES(code PUBLIC jansson)
target_link_libraries(code PUBLIC variant)
target_link_libraries(code PUBLIC anl)
target_link_libraries(code PUBLIC any)
target_link_libraries(code PUBLIC imgui)
target_link_libraries(code PUBLIC implot)
IF(FSO_BUILD_WITH_OPENXR)
target_link_libraries(code PUBLIC OpenXR::openxr_loader)
target_include_directories(code PUBLIC OpenXR::Headers)
ENDIF()
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# On Linux, we need to access X11 window data.
# On Windows, SDL already provides everything, so no need to do anything
find_package(X11)
target_link_libraries(code PUBLIC ${X11_LIBRARIES})
ENDIF()
# Headers for standalone "gui" on UNIX
IF(UNIX)
@@ -90,7 +112,9 @@ if (FSO_BUILD_WITH_OPENGL)
target_compile_definitions(code PUBLIC WITH_OPENGL)
endif()
if (FSO_BUILD_WITH_VULKAN)
target_compile_definitions(code PUBLIC WITH_VULKAN)
target_compile_definitions(code PUBLIC WITH_VULKAN VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VK_NO_PROTOTYPES)
target_include_directories(code PUBLIC Vulkan::Headers)
target_link_libraries(code PUBLIC VulkanMemoryAllocator)
endif()
include(shaders.cmake)
@@ -107,5 +131,8 @@ set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_COPY_PHASE_STRIP[variant=D
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT[variant=Debug] "NO")
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN[variant=Debug] "NO")
# Prevent warnings on files with no symbols on Mac
suppress_no_symbol_warnings(code)
# Prevent GCC warnings in third-party BitOp... see GitHub #4366
suppress_file_warnings(scripting/lua/bitop/bit.c)
suppress_file_warnings(scripting/lua/bitop/bit.c)
+1 -1
View File
@@ -30,7 +30,7 @@ class BuiltinActionDefinition : public ActionDefinition {
// This should have been caught earlier
Assertion(paramIter != parameterExpressions.cend(), "Could not find built-in parameter!");
return std::unique_ptr<Action>(new TAction(paramIter->second.template asTyped<ActionValueType>()));
return std::make_unique<TAction>(paramIter->second.template asTyped<ActionValueType>());
}
};
+1 -1
View File
@@ -47,7 +47,7 @@ ProgramInstance::ProgramInstance(const actions::Program* program) : _program(pro
ProgramState ProgramInstance::step()
{
if (!_locals.host.IsValid()) {
if (!_locals.host.isValid()) {
return ProgramState::Done;
}
+1 -1
View File
@@ -19,7 +19,7 @@ expression::ProgramVariables getDefaultTableVariables()
expression::ProgramVariables vars;
vars.setValue({"locals", "position"}, expression::Value(vmd_zero_vector));
vars.setValue({"locals", "direction"}, expression::Value(vmd_zero_vector));
vars.setValue({"locals", "direction"}, expression::Value(vmd_z_vector));
return vars;
}
+1 -1
View File
@@ -18,7 +18,7 @@ struct ProgramLocals {
matrix localOrient = vmd_identity_matrix;
int hostSubobject = -1;
int waitTimestamp = 0;
TIMESTAMP waitTimestamp = TIMESTAMP::invalid();
expression::ProgramVariables variables;
};
+2 -2
View File
@@ -24,7 +24,7 @@ ActionExpression ActionExpression::parseFromTable(ValueType expectedReturnType,
stuff_string(expressionText, F_NAME);
ExpressionParser parser(expressionText);
ExpressionParser parser(std::move(expressionText));
auto expression = parser.parse(context);
@@ -45,7 +45,7 @@ ActionExpression ActionExpression::parseFromTable(ValueType expectedReturnType,
}
// Everything is valid
return ActionExpression(expression);
return ActionExpression(std::move(expression));
}
Value ActionExpression::execute(const ProgramVariables& variables) const
+8 -8
View File
@@ -51,8 +51,8 @@ class ExpressionBuilderVisitor : public ActionExpressionVisitor {
operatorText = context->MINUS()->getText();
}
const auto leftExpr = visit(context->expression(0)).as<std::shared_ptr<nodes::AbstractExpression>>();
const auto rightExpr = visit(context->expression(1)).as<std::shared_ptr<nodes::AbstractExpression>>();
const auto leftExpr = std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(visit(context->expression(0)));
const auto rightExpr = std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(visit(context->expression(1)));
auto operatorExpression = std::make_shared<nodes::FunctionCallExpression>(operatorTok,
true,
@@ -88,8 +88,8 @@ class ExpressionBuilderVisitor : public ActionExpressionVisitor {
antlrcpp::Any visitRandom_range_expression(ActionExpressionParser::Random_range_expressionContext* context) override
{
auto expression = std::make_shared<nodes::RandomRangeExpression>(context->RAND_L_PAREN()->getSymbol(),
visit(context->expression(0)).as<std::shared_ptr<nodes::AbstractExpression>>(),
visit(context->expression(1)).as<std::shared_ptr<nodes::AbstractExpression>>());
std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(visit(context->expression(0))),
std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(visit(context->expression(1))));
return std::static_pointer_cast<nodes::AbstractExpression>(expression);
}
antlrcpp::Any visitLiteral_expression(ActionExpressionParser::Literal_expressionContext* context) override
@@ -122,9 +122,9 @@ class ExpressionBuilderVisitor : public ActionExpressionVisitor {
}
antlrcpp::Any visitVec3d_constructor(ActionExpressionParser::Vec3d_constructorContext* context) override
{
auto xExpression = visit(context->expression(0)).as<std::shared_ptr<nodes::AbstractExpression>>();
auto yExpression = visit(context->expression(1)).as<std::shared_ptr<nodes::AbstractExpression>>();
auto zExpression = visit(context->expression(2)).as<std::shared_ptr<nodes::AbstractExpression>>();
const auto xExpression = std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(visit(context->expression(0)));
const auto yExpression = std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(visit(context->expression(1)));
const auto zExpression = std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(visit(context->expression(2)));
auto expression = std::make_shared<nodes::VectorConstructorExpression>(context->L_PAREN()->getSymbol(),
xExpression,
@@ -157,7 +157,7 @@ std::shared_ptr<nodes::AbstractExpression> ExpressionParser::parse(const ParseCo
if (errListener.diagnostics.empty()) {
// Only do semantic checking if syntax is valid
ExpressionBuilderVisitor builder;
exprReturn = tree->accept(&builder).as<std::shared_ptr<nodes::AbstractExpression>>();
exprReturn = std::any_cast<std::shared_ptr<nodes::AbstractExpression>>(tree->accept(&builder));
if (!exprReturn->validate(&parser, context)) {
exprReturn = nullptr;
+1 -1
View File
@@ -6,7 +6,7 @@ namespace expression {
ProgramVariablesDefinition& ProgramVariablesDefinition::addScope(const SCP_string& name)
{
auto scope = std::unique_ptr<ProgramVariablesDefinition>(new ProgramVariablesDefinition());
auto scope = std::make_unique<ProgramVariablesDefinition>();
auto scopePtr = scope.get();
+1 -1
View File
@@ -38,7 +38,7 @@ const TypeDefinition& TypeDefinition::forValueType(ValueType type)
case ValueType::String:
return s_identifier;
default:
UNREACHABLE("Invalid value type!");
UNREACHABLE("Invalid value type %d!", static_cast<int>(type));
return s_integer; // Make compiler happy
}
}
+4 -4
View File
@@ -2,7 +2,7 @@
#include "globalincs/pstypes.h"
#include <mpark/variant.hpp>
#include <variant>
namespace actions {
namespace expression {
@@ -85,10 +85,10 @@ class Value {
if (currentType == expectedType) {
// No conversion necessary
return mpark::get<T>(m_value);
return std::get<T>(m_value);
}
return mpark::visit(detail::implicit_conversion<T>{}, m_value);
return std::visit(detail::implicit_conversion<T>{}, m_value);
}
friend bool operator==(const Value& lhs, const Value& rhs);
@@ -97,7 +97,7 @@ class Value {
friend std::ostream& operator<<(std::ostream& os, const Value& value);
private:
mpark::variant<mpark::monostate, int, float, vec3d, SCP_string> m_value;
std::variant<std::monostate, int, float, vec3d, SCP_string> m_value;
};
} // namespace expression
+4 -6
View File
@@ -26,10 +26,8 @@ ActionResult MoveToSubmodel::execute(ProgramLocals& locals) const
// The calling code should ensure that this never happens
Assertion(locals.hostSubobject >= 0, "Did not have a valid host subobject.");
auto instance = object_get_model_instance(locals.host.objp);
Assertion(instance != -1, "Model instances are required if a host subobject is specified.");
auto pmi = model_get_instance(instance);
auto pmi = object_get_model_instance(locals.host.objp());
Assertion(pmi != nullptr, "Model instances are required if a host subobject is specified.");
auto pm = model_get(pmi->model_num);
const auto destinationSubObject = m_subObjectExpression.execute(locals.variables);
@@ -57,7 +55,7 @@ ActionResult MoveToSubmodel::execute(ProgramLocals& locals) const
// We need to do a linear search for the right subobject
for (int i = 0; i < pm->n_models; ++i) {
const auto submodel = pm->submodel[i];
const auto& submodel = pm->submodel[i];
if (subsystem_stricmp(destinationSubObject.c_str(), submodel.name) == 0) {
// Found something!
@@ -72,7 +70,7 @@ ActionResult MoveToSubmodel::execute(ProgramLocals& locals) const
std::unique_ptr<Action> MoveToSubmodel::clone() const
{
return std::unique_ptr<Action>(new MoveToSubmodel(*this));
return std::make_unique<MoveToSubmodel>(*this);
}
} // namespace types
+9 -9
View File
@@ -3,6 +3,8 @@
#include "math/vecmat.h"
#include "parse/parselo.h"
#include "particle/hosts/EffectHostObject.h"
#include "particle/ParticleManager.h"
#include "ship/ship.h"
#include <utility>
@@ -37,10 +39,8 @@ ActionResult ParticleEffectAction::execute(ProgramLocals& locals) const
vec3d local_pos;
matrix local_orient;
if (locals.hostSubobject != -1) {
auto instance = object_get_model_instance(locals.host.objp);
Assertion(instance != -1, "Model instances are required if a host subobject is specified.");
auto pmi = model_get_instance(instance);
auto pmi = object_get_model_instance(locals.host.objp());
Assertion(pmi != nullptr, "Model instances are required if a host subobject is specified.");
auto pm = model_get(pmi->model_num);
model_instance_local_to_global_point_orient(&local_pos,
@@ -58,18 +58,18 @@ ActionResult ParticleEffectAction::execute(ProgramLocals& locals) const
local_pos += locals.variables.getValue({"locals", "position"}).getVector();
auto direction = locals.variables.getValue({"locals", "direction"}).getVector();
matrix orientation;
vm_vector_2_matrix_norm(&orientation, &direction); // direction is normalized in SetDirectionAction::execute
source.moveToObject(locals.host.objp, &local_pos);
source.setOrientationFromNormalizedVec(&direction, true);
source.finish();
source->setHost(std::make_unique<EffectHostObject>(locals.host.objp(), local_pos, orientation, true));
source->finishCreation();
return ActionResult::Finished;
}
std::unique_ptr<Action> ParticleEffectAction::clone() const
{
return std::unique_ptr<Action>(new ParticleEffectAction(*this));
return std::make_unique<ParticleEffectAction>(*this);
}
} // namespace types
@@ -2,7 +2,6 @@
#include "actions/Action.h"
#include "actions/expression/ActionExpression.h"
#include "particle/ParticleManager.h"
namespace actions {
namespace types {
+5 -7
View File
@@ -26,10 +26,8 @@ ActionResult PlaySoundAction::execute(ProgramLocals& locals) const
vec3d local_pos;
matrix local_orient;
if (locals.hostSubobject != -1) {
auto instance = object_get_model_instance(locals.host.objp);
Assertion(instance != -1, "Model instances are required if a host subobject is specified.");
auto pmi = model_get_instance(instance);
auto pmi = object_get_model_instance(locals.host.objp());
Assertion(pmi != nullptr, "Model instances are required if a host subobject is specified.");
auto pm = model_get(pmi->model_num);
model_instance_local_to_global_point_orient(&local_pos,
@@ -47,8 +45,8 @@ ActionResult PlaySoundAction::execute(ProgramLocals& locals) const
local_pos += locals.variables.getValue({"locals", "position"}).getVector();
vec3d global_pos;
vm_vec_unrotate(&global_pos, &local_pos, &locals.host.objp->orient);
global_pos += locals.host.objp->pos;
vm_vec_unrotate(&global_pos, &local_pos, &locals.host.objp()->orient);
global_pos += locals.host.objp()->pos;
const auto soundId = gamesnd_get_by_name(m_soundIdExpression.execute(locals.variables).c_str());
@@ -59,7 +57,7 @@ ActionResult PlaySoundAction::execute(ProgramLocals& locals) const
}
std::unique_ptr<Action> PlaySoundAction::clone() const
{
return std::unique_ptr<Action>(new PlaySoundAction(*this));
return std::make_unique<PlaySoundAction>(*this);
}
} // namespace types
} // namespace actions
+1 -1
View File
@@ -32,7 +32,7 @@ ActionResult SetDirectionAction::execute(ProgramLocals& locals) const
std::unique_ptr<Action> SetDirectionAction::clone() const
{
return std::unique_ptr<Action>(new SetDirectionAction(*this));
return std::make_unique<SetDirectionAction>(*this);
}
} // namespace types
+1 -1
View File
@@ -27,7 +27,7 @@ ActionResult SetPositionAction::execute(ProgramLocals& locals) const
std::unique_ptr<Action> SetPositionAction::clone() const
{
return std::unique_ptr<Action>(new SetPositionAction(*this));
return std::make_unique<SetPositionAction>(*this);
}
} // namespace types
+4 -4
View File
@@ -20,7 +20,7 @@ WaitAction::~WaitAction() = default;
ActionResult WaitAction::execute(actions::ProgramLocals& locals) const
{
if (!timestamp_valid(locals.waitTimestamp)) {
if (!locals.waitTimestamp.isValid()) {
auto waitTime = _waitTimeExpression.execute(locals.variables);
// Catch errors in the expression
@@ -28,7 +28,7 @@ ActionResult WaitAction::execute(actions::ProgramLocals& locals) const
waitTime = 0.001f;
}
locals.waitTimestamp = timestamp(fl2i(waitTime * TIMESTAMP_FREQUENCY));
locals.waitTimestamp = _timestamp(fl2i(waitTime * MILLISECONDS_PER_SECOND));
}
if (!timestamp_elapsed(locals.waitTimestamp)) {
// Wait until the timestamp is elapsed
@@ -36,12 +36,12 @@ ActionResult WaitAction::execute(actions::ProgramLocals& locals) const
}
// Timestamp is elapsed. The timestamp is elapsed so that timestamp_valid above returns false for the next wait
// action
locals.waitTimestamp = 0;
locals.waitTimestamp = TIMESTAMP::invalid();
return ActionResult::Finished;
}
std::unique_ptr<Action> WaitAction::clone() const
{
return std::unique_ptr<Action>(new WaitAction(*this));
return std::make_unique<WaitAction>(*this);
}
} // namespace types
+7 -40
View File
@@ -16,9 +16,11 @@
#include "ai/ai.h"
#include "object/object.h"
#include "ship/ship.h"
#include "utils/string_utils.h"
SCP_vector<char *> Goal_target_names;
// heap-allocated rather than SCP_string, so that the pointers held by ai goals stay valid when the vector grows
SCP_vector<SCP_vm_unique_ptr<char>> Goal_target_names;
ai_info Ai_info[MAX_AI_INFO];
ai_info *Player_ai;
@@ -52,53 +54,18 @@ void ai_free_slot(int ai_index)
Ai_info[ai_index].shipnum = -1;
}
int get_wingnum(int objnum)
{
int shipnum, ai_index;
shipnum = Objects[objnum].instance;
ai_index = Ships[shipnum].ai_index;
return Ai_info[ai_index].wing;
}
void set_wingnum(int objnum, int wingnum)
{
int shipnum, ai_index;
Assert(Objects[objnum].type == OBJ_SHIP);
shipnum = Objects[objnum].instance;
Assert((shipnum >= 0) && (shipnum < MAX_SHIPS));
ai_index = Ships[shipnum].ai_index;
Assert( (ai_index >= 0) && (ai_index < MAX_AI_INFO) );
Ai_info[ai_index].wing = wingnum;
}
const char *ai_get_goal_target_name(const char *name, int *index)
{
Assertion(name != nullptr && index != nullptr, "Arguments cannot be null!");
for (int i = 0; i < static_cast<int>(Goal_target_names.size()); ++i) {
if (!stricmp(name, Goal_target_names[i])) {
if (!stricmp(name, Goal_target_names[i].get())) {
*index = i;
return Goal_target_names[i];
return Goal_target_names[i].get();
}
}
*index = static_cast<int>(Goal_target_names.size());
Goal_target_names.push_back(vm_strdup(name));
return Goal_target_names[*index];
}
void ai_clear_goal_target_names()
{
for (auto ptr : Goal_target_names)
vm_free(ptr);
Goal_target_names.clear();
Goal_target_names.push_back(util::vm_unique_copy(name, false));
return Goal_target_names.back().get();
}
+50 -97
View File
@@ -12,6 +12,7 @@
#ifndef _AI_H
#define _AI_H
#include "ai/aigoals.h"
#include "ai/ai_profiles.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
@@ -33,8 +34,15 @@ typedef struct ai_flag_name {
char flag_name[TOKEN_LENGTH];
} ai_flag_name;
#define MAX_AI_FLAG_NAMES 2
typedef struct ai_flag_description {
AI::AI_Flags flag;
const char *flag_desc;
} ai_flag_description;
extern ai_flag_name Ai_flag_names[];
extern ai_flag_description Ai_flag_descriptions[];
extern const int Num_ai_flag_names;
extern const size_t Num_ai_flag_descriptions;
// dock_orient_and_approach() modes.
#define DOA_APPROACH 1 // Approach the current point on the path (aip->path_cur)
@@ -49,24 +57,6 @@ extern ai_flag_name Ai_flag_names[];
#define AIDO_DOCK_NOW 2 // Immediately move into dock position. For ships that start mission docked.
#define AIDO_UNDOCK 3 // Set goal of undocking with object.
// Submodes for seeking safety.
#define AISS_1 41 // Pick a spot to fly to.
#define AISS_2 42 // Flying to spot.
#define AISS_3 43 // Gotten near spot, fly about there.
#define AISS_1a 44 // Pick a new nearby spot because we are endangered, then go to AISS_2
#define MAX_AI_GOALS 5
// types of ai goals -- tyese types will help us to determination on which goals should
// have priority over others (i.e. when a player issues a goal to a wing, then a seperate
// goal to a ship in that wing). We would probably use this type in conjunction with
// goal priority to establish which goal to follow
#define AIG_TYPE_EVENT_SHIP 1 // from mission event direct to ship
#define AIG_TYPE_EVENT_WING 2 // from mission event direct to wing
#define AIG_TYPE_PLAYER_SHIP 3 // from player direct to ship
#define AIG_TYPE_PLAYER_WING 4 // from player direct to wing
#define AIG_TYPE_DYNAMIC 5 // created on the fly
// Flags to ai_turn_towards_vector().
#define AITTV_FAST (1<<0) // Turn fast, not slowed down based on skill level.
#define AITTV_VIA_SEXP (1<<1) // Goober5000 - via sexp
@@ -76,39 +66,7 @@ extern ai_flag_name Ai_flag_names[];
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
// structure for AI goals
typedef struct ai_goal {
int signature; // Unique identifier. All goals ever created (per mission) have a unique signature.
int ai_mode; // one of the AIM_* modes for this goal
int ai_submode; // maybe need a submode
int type; // one of the AIG_TYPE_* values above
flagset<AI::Goal_Flags> flags; // one of the AIGF_* values above
fix time; // time at which this goal was issued.
int priority; // how important is this goal -- number 0 - 100
const char *target_name; // name of the thing that this goal acts upon
int target_name_index; // index of goal_target_name in Goal_target_names[][]
waypoint_list *wp_list; // waypoints that this ship might fly.
int target_instance; // instance of thing this ship might be chasing (currently only used for weapons; note, not the same as objnum!)
int target_signature; // signature of object this ship might be chasing (currently only used for weapons; paired with above value to confirm target)
// unions for docking stuff.
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
// these are the dockpoints used on the docker and dockee ships, not the ships themselves
union {
const char *name;
int index;
} docker;
union {
const char *name;
int index;
} dockee;
object_ship_wing_point_team lua_ai_target;
} ai_goal;
// individual AI modes aka AI behaviors
#define AIM_CHASE 0
#define AIM_EVADE 1
#define AIM_GET_BEHIND 2 // This mode is not actually implemented.
@@ -130,7 +88,7 @@ typedef struct ai_goal {
#define AIM_BAY_DEPART 18 // Departing to a fighter bay, following path to do so
#define AIM_SENTRYGUN 19 // AI mode for sentry guns only (floating turrets)
#define AIM_WARP_OUT 20 // Commence warp out sequence. Point in legal direction. Then call John's code.
#define AIM_FLY_TO_SHIP 21 // [Kazan] Fly to a ship, doesn't matter if it's hostile or friendly -- for Autopilot usage
#define AIM_FLY_TO_SHIP 21 // Rendezvous with a ship. Like stay-near, but non-perpetual.
#define AIM_LUA 22 // Generic Lua-based AI mode
#define MAX_AI_BEHAVIORS 23 // Number of AIM_xxxx types
@@ -138,8 +96,8 @@ typedef struct ai_goal {
#define MAX_WAYPOINTS_PER_LIST 20
#define MAX_ENEMY_DISTANCE 2500.0f // Maximum distance from which a ship will pursue an enemy.
#define AI_GOAL_NONE -1
#define MAX_AI_GOALS 5
#define AI_ACTIVE_GOAL_NONE -1
#define AI_ACTIVE_GOAL_DYNAMIC 999
typedef struct ai_class {
@@ -224,6 +182,12 @@ typedef struct ai_class {
#define AIS_UNDOCK_3 33
#define AIS_UNDOCK_4 34
// Submodes for seeking safety.
#define AISS_1 41 // Pick a spot to fly to.
#define AISS_2 42 // Flying to spot.
#define AISS_3 43 // Gotten near spot, fly about there.
#define AISS_1a 44 // Pick a new nearby spot because we are endangered, then go to AISS_2. (Not implemented.)
// Submodes for Guard behavior
#define AIS_GUARD_PATROL 101
#define AIS_GUARD_ATTACK 102
@@ -277,10 +241,7 @@ extern pnode *Ppfp; // Free pointer in path points.
typedef struct ai_info {
flagset<AI::AI_Flags> ai_flags; // Special flags for AI behavior.
int shipnum; // Ship using this slot, -1 means none.
int type; //
int wing; // Member of what wing? -1 means none.
int behavior; // AI behavior; vestigial field from early development of FS1
int mode;
int previous_mode;
int mode_time; // timestamp at which current mode elapses.
@@ -317,8 +278,8 @@ typedef struct ai_info {
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
waypoint_list *wp_list; // waypoint list being followed
size_t wp_index; // waypoint index in list
int wp_list_index; // index of waypoint list being followed
int wp_index; // index of waypoint in list
int wp_flags; // waypoint flags, see WPF_xxxx
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
@@ -334,6 +295,7 @@ typedef struct ai_info {
vec3d path_create_pos; // Object's position at time of global path creation.
matrix path_create_orient; // Object's orientation at time of global path creation.
int mp_index; // Model path index. Index in polymodel:model_paths
int mp_randomized_vert; // Vertex of the model path that was given a random offset, or -1
fix path_next_check_time; // Last time checked to see if would collide with model.
int path_goal_dist; // minimum distance to first path point to consider path reached
int path_subsystem_next_check; // timestamp to next check if subsystem is still visible
@@ -348,6 +310,7 @@ typedef struct ai_info {
fix submode_start_time; // time at which we entered the current submode
int submode_parm0; // parameter specific to current submode
int submode_parm1; // SUSHI: Another optional parameter
float submode_float0; // Goober5000: a float parameter
fix next_predict_pos_time; // Next time to predict position.
int next_dynamic_path_check_time; //ETP: Time of next path check in ai_new_maybe_reposition_attack_subsys
@@ -357,7 +320,7 @@ typedef struct ai_info {
//Unlike the predicted position stuff, also takes into account velocity
//Only used against small ships
fix next_aim_pos_time;
vec3d last_aim_enemy_pos;
vec3d last_aim_enemy_pos; // Normally this is the position of the enemy a turret is targeting but in the F3 Lab, this is used to pass raw target coordinates to the turret firing methods.
vec3d last_aim_enemy_vel;
ai_goal goals[MAX_AI_GOALS];
@@ -369,7 +332,7 @@ typedef struct ai_info {
float time_enemy_near; // SUSHI: amount of time enemy continuously "near" the player
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
int last_hit_quadrant; // Shield section of last hit.
int danger_shield_quadrant; // Shield section AI will prefer to prioritize for recharging, it if possible.
fix last_hit_target_time; // Missiontime of last time this ship successfully hit target.
int hitter_objnum; // Object index of ship that hit this ship last time.
int hitter_signature; // Signature of hitter. Prevents stupidity if hitter gets killed.
@@ -413,11 +376,6 @@ typedef struct ai_info {
float ai_turret_max_aim_update_delay;
flagset<AI::Profile_Flags> ai_profile_flags; //Holds AI_Profiles flags (possibly overriden by AI class) that actually apply to AI
union {
float stay_near_distance; // Distance to stay within for AIM_STAY_NEAR mode.
};
ship_subsys* targeted_subsys; // Targeted subobject on current target. NULL if none;
ship_subsys* last_subsys_target; // last known subsystem target
int targeted_subsys_parent; // Parent objnum of subobject, not necessarily targeted
@@ -504,9 +462,12 @@ typedef struct ai_info {
int multilock_check_timestamp; // when to check for multilock next
SCP_vector<std::pair<int, ship_subsys*>> ai_missile_locks_firing; // a list of missile locks (locked objnum, locked subsys) the ai is currently firing
object_ship_wing_point_team lua_ai_target;
ai_lua_parameters lua_ai_target;
} ai_info;
int ai_maybe_autoscale(int absolute_index = -1);
int ai_get_autoscale_index(int absolute_index = -1);
// Goober5000
typedef struct {
vec3d docker_point;
@@ -526,27 +487,21 @@ typedef struct {
#define SUBSYS_PATH_DIST 500.0f
// Friendly damage defines
#define MAX_BURST_DAMAGE 20 // max damage that can be done in BURST_DURATION
#define MAX_BURST_DAMAGE 20.0f // max damage that can be done in BURST_DURATION
#define BURST_DURATION 500 // decay time over which Player->damage_this_burst falls from MAX_BURST_DAMAGE to 0
extern int Mission_all_attack; // !0 means all teams attack all teams.
extern void update_ai_info_for_hit(int hitter_obj, int hit_obj);
extern void ai_frame_all(void);
extern int find_guard_obj(void);
extern ai_info Ai_info[];
extern ai_info *Player_ai;
extern ai_class *Ai_classes;
extern char** Ai_class_names;
extern SCP_vector<ai_class> Ai_classes;
extern SCP_vector<const char*> Ai_class_names;
extern int Num_ai_classes;
extern int Ai_firing_enabled;
extern const char *Skill_level_names(int skill_level, int translate = 1);
extern int Ai_goal_signature;
extern control_info AI_ci;
@@ -570,25 +525,22 @@ void ai_object_init(object * obj, int ai_index);
// Called once a frame
void ai_process( object * obj, int ai_index, float frametime );
int get_wingnum(int objnum);
void set_wingnum(int objnum, int wingnum);
const char *ai_get_goal_target_name(const char *name, int *index);
void ai_clear_goal_target_names();
extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, int ship_info_index = -1);
extern void ai_attack_object(object *attacker, object *attacked, int ship_info_index = -1, int class_type = -1);
extern void ai_evade_object(object *evader, object *evaded);
extern void ai_ignore_object(object *ignorer, object *ignored, int ignore_new);
extern void ai_ignore_wing(object *ignorer, int wingnum);
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int dock_type);
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
extern void ai_do_default_behavior(object *obj);
extern void ai_start_waypoints(object *objp, waypoint_list *wp_list, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hit_normal);
extern void ai_reset_order_state(ai_info *aip);
extern void ai_start_waypoints(object *objp, int wl_index, int wp_flags, int start_index, bool force = false);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, const vec3d *hit_normal);
extern void ai_ship_destroy(int shipnum);
extern vec3d ai_get_acc_limit(vec3d* vel_limit, const object* objp);
extern void ai_turn_towards_vector(vec3d *dest, object *objp, vec3d *slide_vec, vec3d *rel_pos, float bank_override, int flags, vec3d *rvec = nullptr, vec3d* turnrate_mod = nullptr);
extern void ai_turn_towards_vector(const vec3d *dest, object *objp, const vec3d *slide_vec, const vec3d *rel_pos, float bank_override, int flags, const vec3d *rvec = nullptr, const vec3d* turnrate_mod = nullptr);
extern void init_ai_object(int objnum);
extern void ai_init(void); // Call this one to parse ai.tbl.
extern void ai_level_init(void); // Call before each level to reset AI
@@ -609,9 +561,9 @@ extern void ai_set_guard_wing(object *objp, int wingnum);
extern void ai_warp_out(object *objp, vec3d *vp);
extern void ai_attack_wing(object *attacker, int wingnum);
extern void ai_deathroll_start(object *ship_obj);
extern int set_target_objnum(ai_info *aip, int objnum);
extern int set_target_objnum(ai_info* aip, int objnum);
extern void ai_form_on_wing(object *objp, object *goal_objp);
extern void ai_do_stay_near(object *objp, object *other_obj, float dist);
extern void ai_do_stay_near(object *objp, object *other_obj, float dist, int additional_data);
extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, int parent_objnum);
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index );
extern void ai_add_rearm_goal( object *requester_objp, object *support_objp );
@@ -640,17 +592,22 @@ extern int ai_fire_primary_weapon(object *objp); //changed to return weather it
extern int ai_fire_secondary_weapon(object *objp);
extern float ai_get_weapon_dist(ship_weapon *swp);
extern void turn_towards_point(object *objp, vec3d *point, vec3d *slide_vec, float bank_override, matrix* target_orient = nullptr, int flags = 0);
extern bool ai_willing_to_afterburn_hard(ai_info* aip);
extern void ai_afterburn_hard(object* objp, ai_info* aip);
extern int ai_maybe_fire_afterburner(object *objp, ai_info *aip);
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, ai_info *aip);
extern int is_instructor(object *objp);
extern int find_enemy(int objnum, float range, int max_attackers, int ship_info_index = -1);
extern int find_enemy(int objnum, float range, int max_attackers, bool for_pursuit, int ship_info_index = -1, int class_type = -1);
extern bool ai_targets_for_pursuit(const ai_info *aip);
extern bool ai_declines_pursuit(const object *attacker_objp, const object *target_objp);
float ai_get_weapon_speed(ship_weapon *swp);
void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, float weapon_speed, float time_enemy_in_range);
float ai_get_weapon_speed(const ship_weapon *swp);
void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, const vec3d *gun_pos, const object *pobjp, const vec3d *enemy_pos, const vec3d *enemy_vel, float weapon_speed, float time_enemy_in_range);
// function to change rearm status for ai ships (called from sexpression code)
extern void ai_set_rearm_status( int team, int new_status );
extern void ai_set_good_rearm_time( int team, int time );
extern void ai_set_bad_rearm_time(int team, int time);
extern void ai_good_secondary_time( int team, int weapon_index, int num_weapons, const char *shipname );
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point, bool update_clients = true);
@@ -664,15 +621,11 @@ extern float dock_orient_and_approach(object *docker_objp, int docker_index, obj
void ai_set_mode_warp_out(object *objp, ai_info *aip);
// prototyped by Goober5000
int get_nearest_objnum(int objnum, int enemy_team_mask, int enemy_wing, float range, int max_attackers, int ship_info_index);
int get_nearest_objnum(int objnum, int enemy_team_mask, int enemy_wing, float range, int max_attackers, bool for_pursuit, int ship_info_index, int class_type = -1);
// moved to header file by Goober5000
void ai_announce_ship_dying(object *dying_objp);
// added by kazan
void ai_start_fly_to_ship(object *objp, int shipnum);
void ai_fly_to_ship();
//Moved declaration here for player ship -WMC
void ai_process_subobjects(int objnum);
@@ -687,6 +640,6 @@ void do_random_sidethrust(ai_info *aip, ship_info *sip);
void ai_formation_object_recalculate_slotnums(int form_objnum, int exiting_objnum = -1);
bool test_line_of_sight(vec3d* from, vec3d* to, std::unordered_set<const object*>&& excluded_objects = {}, float threshold = 10.0f, bool test_for_shields = false, bool test_for_hull = true, float* first_intersect_dist = nullptr);
bool test_line_of_sight(const vec3d* from, const vec3d* to, SCP_unordered_set<int>&& excluded_object_ids = {}, float threshold = 10.0f, bool test_for_shields = false, bool test_for_hull = true, float* first_intersect_dist = nullptr, object** first_intersect_obj = nullptr);
#endif
+71 -8
View File
@@ -32,6 +32,8 @@ namespace AI {
Unload_primaries, // Fire primaries as fast as possible!
Trying_unsuccessfully_to_warp, // Trying to warp, but can't warp at the moment
Free_afterburner_use, // Use afterburners while following waypoints or flying towards objects
Waypoints_no_formation, // wont get into formation when running waypoints as part of a wing
NUM_VALUES
};
@@ -41,11 +43,16 @@ namespace AI {
Dockee_index_valid, // when set, index field for dockee is valid
Goal_on_hold, // when set, this goal cannot currently be satisfied, although it could be in the future
Subsys_needs_fixup, // when set, the subsystem index (for a destroy subsystem goal) is invalid and must be gotten from the subsys name stored in docker.name field!!
Goal_override, // paired with AIG_TYPE_DYNAMIC to mean this goal overrides any other goal
Goal_override, // paired with ai_goal_type::DYNAMIC to mean this goal overrides any other goal
Want_override, // a goal should set this flag if Goal_override should be assigned when the goal is achievable
Purge, // purge this goal next time we process
Goals_purged, // this goal has already caused other goals to get purged
Purge_when_new_goal_added, // this goal is perpetual until any other goal is added, at which time it sets its own Purge flag
Goals_purged, // this goal has already caused other goals to get purged (because it is something like ai-disarm that renders other goals invalid)
Depart_sound_played,// Goober5000 - replacement for AL's hack ;)
Target_own_team,
Target_own_team, // this attack goal is allowed to target friendlies
Afterburn_hard, // afterburn as hard as possible to the goal
Waypoints_in_reverse, // decrement instead of increment
Clear_all_goals_first, // this goal wipes all goals (including itself) before it runs (handled separately, and in a different place, from purging invalid goals)
NUM_VALUES
};
@@ -97,6 +104,10 @@ namespace AI {
Fix_heat_seeker_stealth_bug,
Fix_linked_primary_bug,
Fix_ramming_stationary_targets_bug,
Fix_avoid_shockwave_bugs, // a) waiting until a homing weapon actually homes before evading;
// b) picking the correct expected impact position for capships;
// c) not clearing shockwave_object for ships;
// d) checking the explosion damage of the correct ship
Force_beam_turret_fov,
Free_afterburner_use,
Glide_decay_requires_thrust,
@@ -121,7 +132,8 @@ namespace AI {
Smart_shield_management,
Smart_subsystem_targeting_for_turrets,
Strict_turret_tagged_only_targeting,
Support_dont_add_primaries, //Prevents support ship from equipping new primary as requested in http://scp.indiegames.us/mantis/view.php?id=3198
Ships_intercept_mines, // all AI-controlled ships autonomously engage hostile mines within mine_targetable_range of themselves
Support_dont_add_primaries, //Prevents support ship from equipping new primary as requested in https://scp.indiegames.us/mantis/view.php?id=3198
Turrets_ignore_target_radius,
Use_actual_primary_range,
Use_subsystem_path_point_radii,
@@ -130,12 +142,15 @@ namespace AI {
Use_only_single_fov_for_turrets,
No_turning_directional_bias,
Use_axial_turnrate_differences,
all_nonshielded_ships_can_manage_ets,
fightercraft_nonshielded_ships_can_manage_ets,
Better_collision_avoidance,
All_nonshielded_ships_can_manage_ets,
Fightercraft_nonshielded_ships_can_manage_ets,
Ships_playing_dead_dont_manage_ets,
Better_combat_collision_avoidance,
Better_combat_collision_avoid_includes_target,
Better_guard_collision_avoidance,
Require_exact_los,
Improved_missile_avoidance,
Friendlies_use_countermeasure_firechance,
Unify_usage_countermeasure_firechance,
Improved_subsystem_attack_pathing,
Fixed_ship_weapon_collision,
No_shield_damage_from_ship_collisions,
@@ -145,6 +160,54 @@ namespace AI {
Prevent_negative_turret_ammo,
Fix_keep_safe_distance,
Ignore_aspect_when_leading,
Fix_good_rearm_time_bug,
No_continuous_turn_on_attack,
Fixed_removing_play_dead_order,
Disable_bay_emerge_timeout,
Adjusted_AI_class_autoscale,
Carry_shield_difficulty_scaling_bug,
Whackable_debris,
Whackable_asteroids,
Dynamic_goals_afterburn_hard,
Player_orders_afterburn_hard,
Hudsquadmsg_tactical_disarm_disable,
Align_to_target_when_guarding_still,
Debris_respects_big_damage,
Dont_limit_change_in_speed_due_to_physics_whack,
Guards_ignore_protected_attackers,
Fix_standard_strafe,
Fix_ai_target_recovery, // a) strafing ships that lose their target re-process their orders, like chasing ships already do
// b) ships parked in AIM_NONE while holding a standing chase order (attack-any etc.) re-process their orders;
// c) target selection for pursuit (chasing, guard reactions, retaliation) skips ships outside the attacker's
// actively-pursues list; targets held while not chasing are unaffected, and explicitly ordered targets are
// still assigned but not chased or strafed;
// d) enemy_wing is reset when a new order takes over (shared with Fix_stale_ai_order_state)
Standard_strafe_used_more,
Unify_usage_ai_shield_manage_delay,
Fix_AI_shield_management_bug,
AI_balances_shields_when_attacked,
Disable_ai_transferring_energy,
Freespace_1_missile_behavior,
ETS_uses_power_output,
ETS_energy_same_regardless_of_system_presence,
Dont_form_on_wing_at_mission_start,
Do_not_clear_goals_when_running_form_on_wing,
Do_not_clear_goals_when_running_stay_still,
Do_not_set_override_when_assigning_form_on_wing,
Purge_player_issued_form_on_wing_after_subsequent_order,
Cancel_future_waves_of_any_wing_launched_from_an_exited_ship,
Fix_ignore_if_dead_flag,
Kamikaze_no_collision_avoidance,
Fix_big_ship_waypoint_completion, // a) big ships complete a waypoint within their radius rather than sqrt(radius);
// b) completion no longer requires moving 0.1m in a single frame (framerate-dependent)
Fix_shockwave_expire_before_do_damage, // shockwaves whose lifetime is shorter than one frame apply their area damage at least once before expiring
Fix_small_ai_recover_after_engines_repaired, // ensure small ship AI can switch back to useful AI modes if engines get repaired
Fix_model_path_refresh_randomization, // a subsystem path keeps its randomized point when the path is refreshed because the target moved
Fix_bay_speed_ramp, // the fighterbay speed ramp covers only the bay path itself, not points that route a departing ship around the carrier, and never exceeds max speed
Fix_stale_ai_order_state, // a) enemy_wing, guard_*, previous_mode, resume_goal_time, and the targeted subsystem (with its path) are reset when a new order takes over (enemy_wing is also reset under Fix_ai_target_recovery);
// b) a dynamic chase saves previous_mode/previous_submode; it and strafe entry leave them alone during an ongoing dynamic goal (evading a weapon still overwrites them, which is harmless since the evade resume re-processes orders);
// c) resuming guard duty discards any subsystem target and path left over from the interruption;
// d) a ship ordered to guard itself, or to guard a wing it leads (including one that becomes leader mid-mission), treats that goal as unachievable instead of holding it forever
NUM_VALUES
};
+267 -24
View File
@@ -42,6 +42,7 @@ void set_flag(ai_profile_t *profile, const char *name, AI::Profile_Flags flag)
const char *AI_path_types[] = {
"normal",
"alt1",
"alt2",
};
int Num_ai_path_types = sizeof(AI_path_types)/sizeof(char*);
@@ -139,7 +140,7 @@ void parse_ai_profiles_tbl(const char *filename)
// don't create multiple profiles with the same name
if (previous_profile != NULL)
{
Warning(LOCATION, "An ai profile named '%s' already exists! The new one will not be created.\n", profile_name);
Warning(LOCATION, "An AI profile named '%s' already exists! The new one will not be created.\n", profile_name);
}
else
{
@@ -184,6 +185,14 @@ void parse_ai_profiles_tbl(const char *filename)
if (optional_string("$Max Beam Friendly Fire Damage:"))
parse_float_list(profile->beam_friendly_damage_cap, NUM_SKILL_LEVELS);
if (optional_string("$Max Weapon Friendly Fire Damage:")) {
parse_float_list(profile->weapon_friendly_damage_cap, NUM_SKILL_LEVELS);
}
if (optional_string("$Max Weapon Self Damage:")) {
parse_float_list(profile->weapon_self_damage_cap, NUM_SKILL_LEVELS);
}
if (optional_string("$Player Countermeasure Life Scale:"))
parse_float_list(profile->cmeasure_life_scale, NUM_SKILL_LEVELS);
@@ -223,6 +232,9 @@ void parse_ai_profiles_tbl(const char *filename)
if (optional_string("$Player Subsys Damage Factor:") || optional_string("$AI Damage Reduction to Player Subsys:"))
parse_float_list(profile->subsys_damage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Damage Inflicted Factor:"))
parse_float_list(profile->player_damage_inflicted_scale, NUM_SKILL_LEVELS);
// represented in fractions of F1_0
if (optional_string("$Predict Position Delay:"))
{
@@ -255,7 +267,7 @@ void parse_ai_profiles_tbl(const char *filename)
if (optional_string("$Glide Attack Percent:")) {
parse_float_list(profile->glide_attack_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//Percent is nice for modders, but here in the code we want it between 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_attack_percent[i] < 0.0f || profile->glide_attack_percent[i] > 100.0f) {
@@ -268,7 +280,7 @@ void parse_ai_profiles_tbl(const char *filename)
if (optional_string("$Circle Strafe Percent:")) {
parse_float_list(profile->circle_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//Percent is nice for modders, but here in the code we want it between 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->circle_strafe_percent[i] < 0.0f || profile->circle_strafe_percent[i] > 100.0f) {
@@ -281,7 +293,7 @@ void parse_ai_profiles_tbl(const char *filename)
if (optional_string("$Glide Strafe Percent:")) {
parse_float_list(profile->glide_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//Percent is nice for modders, but here in the code we want it between 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_strafe_percent[i] < 0.0f || profile->glide_strafe_percent[i] > 100.0f) {
@@ -294,7 +306,7 @@ void parse_ai_profiles_tbl(const char *filename)
if (optional_string("$Random Sidethrust Percent:")) {
parse_float_list(profile->random_sidethrust_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//Percent is nice for modders, but here in the code we want it between 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->random_sidethrust_percent[i] < 0.0f || profile->random_sidethrust_percent[i] > 100.0f) {
@@ -366,7 +378,7 @@ void parse_ai_profiles_tbl(const char *filename)
}
if (optional_string("$Detail Distance Multiplier:"))
parse_float_list(profile->detail_distance_mult, MAX_DETAIL_LEVEL + 1);
parse_float_list(profile->detail_distance_mult, MAX_DETAIL_VALUE + 1);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AI::Profile_Flags::Big_ships_can_attack_beam_turrets_on_untargeted_ships);
@@ -400,7 +412,7 @@ void parse_ai_profiles_tbl(const char *filename)
set_flag(profile, "$disable player secondary doublefire:", AI::Profile_Flags::Disable_player_secondary_doublefire);
set_flag(profile, "$disable ai secondary doublefire:", AI::Profile_Flags::Disable_ai_secondary_doublefire);
set_flag(profile, "$disable AI secondary doublefire:", AI::Profile_Flags::Disable_ai_secondary_doublefire);
set_flag(profile, "$disable weapon damage scaling:", AI::Profile_Flags::Disable_weapon_damage_scaling);
@@ -438,7 +450,7 @@ void parse_ai_profiles_tbl(const char *filename)
set_flag(profile, "$force beam turrets to use normal fov:", AI::Profile_Flags::Force_beam_turret_fov);
set_flag(profile, "$fix ai class bug:", AI::Profile_Flags::Fix_ai_class_bug);
set_flag(profile, "$fix AI class bug:", AI::Profile_Flags::Fix_ai_class_bug);
set_flag(profile, "$turrets ignore targets radius in range checks:", AI::Profile_Flags::Turrets_ignore_target_radius);
@@ -466,12 +478,25 @@ void parse_ai_profiles_tbl(const char *filename)
set_flag(profile, "$support don't add primaries:", AI::Profile_Flags::Support_dont_add_primaries);
if (optional_string("$max allies rearming threshold:"))
stuff_int(&profile->max_allies_rearming_threshold);
set_flag(profile, "$firing requires exact los:", AI::Profile_Flags::Require_exact_los);
if (optional_string("$exact los minimum detection radius:")) {
stuff_float(&profile->los_min_detection_radius);
}
set_flag(profile, "$fighterbay arrivals use carrier orientation:", AI::Profile_Flags::Fighterbay_arrivals_use_carrier_orient);
set_flag(profile, "$fighterbay departures use carrier orientation:", AI::Profile_Flags::Fighterbay_departures_use_carrier_orient);
set_flag(profile, "$debris damage respects 'big damage' flag:", AI::Profile_Flags::Debris_respects_big_damage);
set_flag(profile, "$don't limit change in speed due to physics whack:", AI::Profile_Flags::Dont_limit_change_in_speed_due_to_physics_whack);
set_flag(profile, "$guards ignore protected attackers:", AI::Profile_Flags::Guards_ignore_protected_attackers);
if (optional_string("$ai path mode:"))
{
stuff_string(buf, F_NAME, NAME_LENGTH);
@@ -480,13 +505,13 @@ void parse_ai_profiles_tbl(const char *filename)
profile->ai_path_mode = j;
}
else {
Warning(LOCATION, "Invalid ai path mode '%s' specified", buf);
Warning(LOCATION, "Invalid AI path mode '%s' specified", buf);
}
}
set_flag(profile, "$no warp camera:", AI::Profile_Flags::No_warp_camera);
set_flag(profile, "$fix ai path order bug:", AI::Profile_Flags::Fix_ai_path_order_bug);
set_flag(profile, "$fix AI path order bug:", AI::Profile_Flags::Fix_ai_path_order_bug);
set_flag(profile, "$strict turret-tagged-only targeting:", AI::Profile_Flags::Strict_turret_tagged_only_targeting);
@@ -546,22 +571,42 @@ void parse_ai_profiles_tbl(const char *filename)
mprintf(("Warning: \"$ships with no shields can manage ETS\" flag is deprecated in favor of \"$any ship with no shields can manage ETS\"\n"));
bool temp;
stuff_boolean(&temp);
profile->flags.set(AI::Profile_Flags::all_nonshielded_ships_can_manage_ets, temp);
profile->flags.set(AI::Profile_Flags::All_nonshielded_ships_can_manage_ets, temp);
}
set_flag(profile, "$no directional bias for missile and ship turning:", AI::Profile_Flags::No_turning_directional_bias);
// ----------
set_flag(profile, "$no directional bias for missile and ship turning:", AI::Profile_Flags::No_turning_directional_bias);
set_flag(profile, "$respect ship axial turnrate differences:", AI::Profile_Flags::Use_axial_turnrate_differences);
set_flag(profile, "$any ship with no shields can manage ETS:", AI::Profile_Flags::all_nonshielded_ships_can_manage_ets);
set_flag(profile, "$any ship with no shields can manage ETS:", AI::Profile_Flags::All_nonshielded_ships_can_manage_ets);
set_flag(profile, "$fighters/bombers with no shields can manage ETS:", AI::Profile_Flags::fightercraft_nonshielded_ships_can_manage_ets);
set_flag(profile, "$fighters/bombers with no shields can manage ETS:", AI::Profile_Flags::Fightercraft_nonshielded_ships_can_manage_ets);
set_flag(profile, "$better combat collision avoidance for fightercraft:", AI::Profile_Flags::Better_collision_avoidance);
set_flag(profile, "$ships playing dead don't manage ETS:", AI::Profile_Flags::Ships_playing_dead_dont_manage_ets);
set_flag(profile, "$better combat collision avoidance for fightercraft:", AI::Profile_Flags::Better_combat_collision_avoidance);
if (optional_string("+combat collision avoidance aggression for fightercraft:")) {
stuff_float(&profile->better_collision_avoid_aggression_combat);
}
set_flag(profile, "+combat collision avoidance for fightercraft includes target:", AI::Profile_Flags::Better_combat_collision_avoid_includes_target);
set_flag(profile, "$better guard collision avoidance for fightercraft:", AI::Profile_Flags::Better_guard_collision_avoidance);
if (optional_string("+guard collision avoidance aggression for fightercraft:")) {
stuff_float(&profile->better_collision_avoid_aggression_guard);
}
set_flag(profile, "$improved missile avoidance for fightercraft:", AI::Profile_Flags::Improved_missile_avoidance);
set_flag(profile, "$friendly ships use AI profile countermeasure chance:", AI::Profile_Flags::Friendlies_use_countermeasure_firechance);
if (optional_string_either("$friendly ships use AI profile countermeasure chance:", "$unify usage of AI profile countermeasure chance:", true) >= 0) {
bool val;
stuff_boolean(&val);
profile->flags.set(AI::Profile_Flags::Unify_usage_countermeasure_firechance, val);
}
set_flag(profile, "$improved subsystem attack pathing:", AI::Profile_Flags::Improved_subsystem_attack_pathing);
@@ -577,7 +622,7 @@ void parse_ai_profiles_tbl(const char *filename)
profile->ai_range_aware_secondary_select_mode = j;
}
else {
Warning(LOCATION, "Invalid ai secondary range awareness mode '%s' specified", buf);
Warning(LOCATION, "Invalid AI secondary range awareness mode '%s' specified", buf);
}
}
@@ -600,6 +645,135 @@ void parse_ai_profiles_tbl(const char *filename)
set_flag(profile, "$AI ignores aspect lock for leading:", AI::Profile_Flags::Ignore_aspect_when_leading);
set_flag(profile, "$fix good-rearm-time bug:", AI::Profile_Flags::Fix_good_rearm_time_bug);
set_flag(profile, "$no continuous turn on attack:", AI::Profile_Flags::No_continuous_turn_on_attack);
set_flag(profile, "$remove-goal properly removes play-dead order:", AI::Profile_Flags::Fixed_removing_play_dead_order);
set_flag(profile, "$bay arrivals not time limited:", AI::Profile_Flags::Disable_bay_emerge_timeout);
set_flag(profile, "$use adjusted AI class autoscale:", AI::Profile_Flags::Adjusted_AI_class_autoscale);
set_flag(profile, "$carry shield difficulty scaling bug:", AI::Profile_Flags::Carry_shield_difficulty_scaling_bug);
set_flag(profile, "$debris affected by physics whacks:", AI::Profile_Flags::Whackable_debris);
set_flag(profile, "$asteroids affected by physics whacks:", AI::Profile_Flags::Whackable_asteroids);
set_flag(profile, "$dynamic goals afterburn hard:", AI::Profile_Flags::Dynamic_goals_afterburn_hard);
set_flag(profile, "$player orders afterburn hard:", AI::Profile_Flags::Player_orders_afterburn_hard);
set_flag(profile, "$hud squad messages use tactical disarm/disable:", AI::Profile_Flags::Hudsquadmsg_tactical_disarm_disable);
set_flag(profile, "$align to target when guarding stationary ship:", AI::Profile_Flags::Align_to_target_when_guarding_still);
if (optional_string("$rotation factor multiplier for player collisions:")) {
stuff_float(&profile->rot_fac_multiplier_ply_collisions);
}
set_flag(profile, "$fix avoid-shockwave bugs:", AI::Profile_Flags::Fix_avoid_shockwave_bugs);
set_flag(profile, "$fix standard strafe:", AI::Profile_Flags::Fix_standard_strafe);
set_flag(profile, "$fix AI target recovery:", AI::Profile_Flags::Fix_ai_target_recovery);
set_flag(profile, "$standard strafe used more:", AI::Profile_Flags::Standard_strafe_used_more);
if (optional_string("$standard strafe triggers under this speed:")) {
stuff_float(&profile->standard_strafe_when_below_speed);
}
if (optional_string("$strafe distance from target bounding box:")) {
stuff_float(&profile->strafe_retreat_box_dist);
}
if (optional_string("$strafe stops after time unhit:")) {
stuff_float(&profile->strafe_max_unhit_time);
}
if (optional_string("$strafe retreat collide time:")) {
stuff_float(&profile->strafe_retreat_collide_time);
}
if (optional_string("$strafe retreat collide distance:")) {
stuff_float(&profile->strafe_retreat_collide_distance);
}
if (optional_string("$guard uses big-orbit for target radius above:")) {
stuff_float(&profile->guard_big_orbit_above_target_radius);
}
if (optional_string("$guard with big-orbit uses max speed percent:")) {
float max_percent;
stuff_float(&max_percent);
if (max_percent > 0.0f && max_percent <= 1.0f) {
profile->guard_big_orbit_max_speed_percent = max_percent;
} else {
mprintf(("Warning: \"$guard with big-orbit uses max speed percent:\" should be > 0 and <= 1 (read %f). Value will not be used.\n", max_percent));
}
}
if (optional_string("$attack-any idle circle distance:")) {
stuff_float(&profile->attack_any_idle_circle_distance);
}
set_flag(profile, "$unify usage of AI Shield Manage Delay:", AI::Profile_Flags::Unify_usage_ai_shield_manage_delay);
set_flag(profile, "$fix AI shield management bug:", AI::Profile_Flags::Fix_AI_shield_management_bug);
set_flag(profile, "$AI balances shields instead of directs when attacked:", AI::Profile_Flags::AI_balances_shields_when_attacked);
set_flag(profile, "$disable AI transferring energy:", AI::Profile_Flags::Disable_ai_transferring_energy);
set_flag(profile, "$enable freespace 1 style missile behavior:", AI::Profile_Flags::Freespace_1_missile_behavior);
set_flag(profile, "$ETS uses ship class power output:", AI::Profile_Flags::ETS_uses_power_output);
set_flag(profile, "$ETS energy same regardless of system presence:", AI::Profile_Flags::ETS_energy_same_regardless_of_system_presence);
set_flag(profile, "$don't issue form-on-wing goals at mission start:", AI::Profile_Flags::Dont_form_on_wing_at_mission_start);
if (optional_string("$default form-on-wing priority:")) {
int priority;
stuff_int(&priority);
if (priority > 0) {
profile->default_form_on_wing_priority = priority;
} else {
mprintf(("Warning: $default form-on-wing priority: should be > 0 (read %d). Value will not be used.\n", priority));
}
}
set_flag(profile, "$do not clear goals when running form-on-wing:", AI::Profile_Flags::Do_not_clear_goals_when_running_form_on_wing);
set_flag(profile, "$do not clear goals when running stay-still:", AI::Profile_Flags::Do_not_clear_goals_when_running_stay_still);
set_flag(profile, "$do not set override when assigning form-on-wing:", AI::Profile_Flags::Do_not_set_override_when_assigning_form_on_wing);
set_flag(profile, "$purge player-issued form-on-wing after subsequent order:", AI::Profile_Flags::Purge_player_issued_form_on_wing_after_subsequent_order);
set_flag(profile, "$cancel future waves of any wing launched from an exited ship:", AI::Profile_Flags::Cancel_future_waves_of_any_wing_launched_from_an_exited_ship);
set_flag(profile, "$ships intercept mines:", AI::Profile_Flags::Ships_intercept_mines);
set_flag(profile, "$fix 'ignore if dead' flag:", AI::Profile_Flags::Fix_ignore_if_dead_flag);
set_flag(profile, "$no collision avoidance for kamikaze fighters:", AI::Profile_Flags::Kamikaze_no_collision_avoidance);
set_flag(profile, "$fix big ship waypoint completion:", AI::Profile_Flags::Fix_big_ship_waypoint_completion);
set_flag(profile, "$fix shockwave expiring before dealing damage:", AI::Profile_Flags::Fix_shockwave_expire_before_do_damage);
set_flag(profile, "$fix fighter/bomber AI recovers after engines repaired:", AI::Profile_Flags::Fix_small_ai_recover_after_engines_repaired);
set_flag(profile, "$fix subsystem path randomization on refresh:", AI::Profile_Flags::Fix_model_path_refresh_randomization);
set_flag(profile, "$fix fighterbay speed ramp:", AI::Profile_Flags::Fix_bay_speed_ramp);
set_flag(profile, "$fix stale AI order state:", AI::Profile_Flags::Fix_stale_ai_order_state);
// end of options ----------------------------------------
// if we've been through once already and are at the same place, force a move
if (saved_Mp && (saved_Mp == Mp))
@@ -607,7 +781,7 @@ void parse_ai_profiles_tbl(const char *filename)
char tmp[60];
memset(tmp, 0, 60);
strncpy(tmp, Mp, 59);
mprintf(("WARNING: Unrecognized parameter in ai_profiles: %s\n", tmp));
mprintf(("WARNING: Unrecognized parameter in %s: %s\n", filename, tmp));
Mp++;
}
@@ -642,12 +816,21 @@ void ai_profiles_init()
// init retail entry first
parse_ai_profiles_tbl(NULL);
// Allow mission_profiles.tbl to be a alias of ai_profiles.tbl, but only load one or the other.
// mission_profiles.tbl would be newer so assume intended, but print to the log to be sure - Mjn
char filename[MAX_FILENAME_LEN] = "ai_profiles.tbl";
if (cf_exists_full("mission_profiles.tbl", CF_TYPE_TABLES)) {
mprintf(("mission_profiles.tbl was found! Using that instead of ai_profiles.tbl...\n"));
strcpy_s(filename, "mission_profiles.tbl");
}
// now parse the supplied table (if any)
if (cf_exists_full("ai_profiles.tbl", CF_TYPE_TABLES))
parse_ai_profiles_tbl("ai_profiles.tbl");
if (cf_exists_full(filename, CF_TYPE_TABLES))
parse_ai_profiles_tbl(filename);
// parse any modular tables
parse_modular_table("*-aip.tbm", parse_ai_profiles_tbl);
parse_modular_table("*-msp.tbm", parse_ai_profiles_tbl);
// set default if specified
temp = ai_profile_lookup(Default_profile_name);
@@ -657,7 +840,7 @@ void ai_profiles_init()
Ai_profiles_initted = 1;
}
int ai_profile_lookup(char *name)
int ai_profile_lookup(const char *name)
{
for (int i = 0; i < Num_ai_profiles; i++)
if (!stricmp(name, Ai_profiles[i].profile_name))
@@ -672,6 +855,7 @@ void ai_profile_t::reset()
flags.reset();
los_min_detection_radius = 10.0f;
ai_path_mode = AI_PATH_MODE_NORMAL;
subsystem_path_radii = 0;
bay_arrive_speed_mult = 1.0f;
@@ -679,6 +863,23 @@ void ai_profile_t::reset()
second_order_lead_predict_factor = 0;
ai_range_aware_secondary_select_mode = AI_RANGE_AWARE_SEC_SEL_MODE_RETAIL;
turret_target_recheck_time = 2000.0f;
rot_fac_multiplier_ply_collisions = 0.0f;
max_allies_rearming_threshold = 2;
better_collision_avoid_aggression_combat = 3.5f;
better_collision_avoid_aggression_guard = 3.5f;
standard_strafe_when_below_speed = 3.0f;
strafe_retreat_box_dist = 300.0f;
strafe_max_unhit_time = 20.0f;
strafe_retreat_collide_time = 2.0f;
strafe_retreat_collide_distance = 100.0f;
guard_big_orbit_above_target_radius = 500.0f;
guard_big_orbit_max_speed_percent = 1.0f;
attack_any_idle_circle_distance = 100.0f;
default_form_on_wing_priority = 99; // as originally assigned in ai_add_goal_sub_sexp()
for (int i = 0; i < NUM_SKILL_LEVELS; ++i) {
max_incoming_asteroids[i] = 0;
@@ -701,9 +902,12 @@ void ai_profile_t::reset()
shield_energy_scale[i] = 0;
afterburner_recharge_scale[i] = 0;
player_damage_scale[i] = 0;
player_damage_inflicted_scale[i] = 0;
subsys_damage_scale[i] = 0;
beam_friendly_damage_cap[i] = 0;
beam_friendly_damage_cap[i] = -1.f;
weapon_friendly_damage_cap[i] = -1.f;
weapon_self_damage_cap[i] = -1.f;
turn_time_scale[i] = 0;
glide_attack_percent[i] = 0;
circle_strafe_percent[i] = 0;
@@ -734,7 +938,7 @@ void ai_profile_t::reset()
player_autoaim_fov[i] = 0;
}
for (int i = 0; i <= MAX_DETAIL_LEVEL; ++i) {
for (int i = 0; i <= MAX_DETAIL_VALUE; ++i) {
detail_distance_mult[i] = 0;
}
@@ -750,7 +954,7 @@ void ai_profile_t::reset()
flags.set(AI::Profile_Flags::Fix_ai_path_order_bug);
flags.set(AI::Profile_Flags::Aspect_invulnerability_fix);
flags.set(AI::Profile_Flags::Use_actual_primary_range);
flags.set(AI::Profile_Flags::fightercraft_nonshielded_ships_can_manage_ets);
flags.set(AI::Profile_Flags::Fightercraft_nonshielded_ships_can_manage_ets);
}
// this flag has been enabled ever since 3.7.2
if (mod_supports_version(3, 7, 2)) {
@@ -760,6 +964,10 @@ void ai_profile_t::reset()
if (mod_supports_version(3, 6, 10)) {
flags.set(AI::Profile_Flags::Reset_last_hit_target_time_for_player_hits);
}
// backwards compatible flag for a bug accidentally introduced during this time
if (mod_supports_version(3, 6, 14) && !mod_supports_version(23, 1, 0)) {
flags.set(AI::Profile_Flags::Carry_shield_difficulty_scaling_bug);
}
if (mod_supports_version(21, 4, 0)) {
flags.set(AI::Profile_Flags::Fixed_ship_weapon_collision);
}
@@ -768,4 +976,39 @@ void ai_profile_t::reset()
flags.set(AI::Profile_Flags::Prevent_negative_turret_ammo);
flags.set(AI::Profile_Flags::Fix_keep_safe_distance);
}
if (mod_supports_version(23, 0, 0)) {
flags.set(AI::Profile_Flags::Fix_good_rearm_time_bug);
flags.set(AI::Profile_Flags::No_continuous_turn_on_attack);
flags.set(AI::Profile_Flags::Fixed_removing_play_dead_order);
}
if (mod_supports_version(23, 2, 0)) {
flags.set(AI::Profile_Flags::Ships_playing_dead_dont_manage_ets);
}
if (mod_supports_version(23, 4, 0)) {
flags.set(AI::Profile_Flags::Hudsquadmsg_tactical_disarm_disable);
}
if (mod_supports_version(24, 2, 0)) {
flags.set(AI::Profile_Flags::Debris_respects_big_damage);
flags.set(AI::Profile_Flags::Force_beam_turret_fov);
flags.set(AI::Profile_Flags::Guards_ignore_protected_attackers);
}
if (mod_supports_version(25, 0, 0)) {
flags.set(AI::Profile_Flags::Fix_avoid_shockwave_bugs);
flags.set(AI::Profile_Flags::Purge_player_issued_form_on_wing_after_subsequent_order);
flags.set(AI::Profile_Flags::Cancel_future_waves_of_any_wing_launched_from_an_exited_ship);
}
if (mod_supports_version(26, 0, 0)) {
flags.set(AI::Profile_Flags::Fix_ignore_if_dead_flag);
}
if (mod_supports_version(26, 2, 0)) {
flags.set(AI::Profile_Flags::Kamikaze_no_collision_avoidance);
flags.set(AI::Profile_Flags::Fix_big_ship_waypoint_completion);
flags.set(AI::Profile_Flags::Fix_shockwave_expire_before_do_damage);
flags.set(AI::Profile_Flags::Fix_small_ai_recover_after_engines_repaired);
flags.set(AI::Profile_Flags::Fix_standard_strafe);
flags.set(AI::Profile_Flags::Fix_ai_target_recovery);
flags.set(AI::Profile_Flags::Fix_model_path_refresh_randomization);
flags.set(AI::Profile_Flags::Fix_bay_speed_ramp);
flags.set(AI::Profile_Flags::Fix_stale_ai_order_state);
}
}
+42 -4
View File
@@ -17,11 +17,12 @@
// AI Path types
#define AI_PATH_MODE_NORMAL 0
#define AI_PATH_MODE_ALT1 1
#define AI_PATH_MODE_ALT2 2
#define AI_RANGE_AWARE_SEC_SEL_MODE_RETAIL 0
#define AI_RANGE_AWARE_SEC_SEL_MODE_AWARE 1
#define MAX_AI_PROFILES 5
#define MAX_AI_PROFILES 8
class ai_profile_t {
public:
@@ -53,9 +54,12 @@ public:
float shield_energy_scale[NUM_SKILL_LEVELS]; // shield energy available
float afterburner_recharge_scale[NUM_SKILL_LEVELS]; // speed of afterburner recharge
float player_damage_scale[NUM_SKILL_LEVELS]; // damage applied to the player
float player_damage_inflicted_scale[NUM_SKILL_LEVELS]; // damage applied by the player
float subsys_damage_scale[NUM_SKILL_LEVELS]; // damage applied to a player subsystem
float beam_friendly_damage_cap[NUM_SKILL_LEVELS]; // damage cap values for friendly beam fire
float weapon_friendly_damage_cap[NUM_SKILL_LEVELS];
float weapon_self_damage_cap[NUM_SKILL_LEVELS];
float turn_time_scale[NUM_SKILL_LEVELS]; // speed at which enemy ships turn
float glide_attack_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "glide attack" move
float circle_strafe_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "circle strafe" move
@@ -96,7 +100,13 @@ public:
// Player-specific autoaim FOV override
float player_autoaim_fov[NUM_SKILL_LEVELS];
float detail_distance_mult[MAX_DETAIL_LEVEL + 1]; //MAX_DETAIL_LEVEL really needs to be 4
float detail_distance_mult[MAX_DETAIL_VALUE + 1]; //MAX_DETAIL_VALUE really needs to be 4
// max number of allies allowed to be rearming at the same time
int max_allies_rearming_threshold;
// minimum radius for the line-of-sight (los) detection --wookieejedi
float los_min_detection_radius;
int ai_path_mode;
@@ -117,6 +127,34 @@ public:
// how often turrets shoulds check for new targets, milliseconds
float turret_target_recheck_time;
// Multiplier value so the player can also experience rotational effects from collisions --wookieejedi
float rot_fac_multiplier_ply_collisions;
// Collision avoidance options --developed by asteroth, exposed by wookieejedi
// Velocity / turn rate gives us a vector which represents the minimum 'bug out' distance.
// However this will be a significant underestimate, it doesn't take into account acceleration
// with regards to its turn speed, nor already existing rotvel, nor the angular distance
// to the particular avoidance vector it comes up with.
// These would significantly complicate the calculation, so for now, it is all bundled into these magic numbers.
float better_collision_avoid_aggression_combat;
float better_collision_avoid_aggression_guard;
// AI strafing options --wookieejedi
float standard_strafe_when_below_speed; // Speed at which standard strafing large ships is possibly triggered
float strafe_retreat_box_dist; // Distance beyond the bounding box to retreat to strafing point
float strafe_max_unhit_time; // Maximum amount of time to stay in strafe mode if not hit
float strafe_retreat_collide_time; // When anticipated collision time is less than this, begin retreat from strafe
float strafe_retreat_collide_distance; // When perpendicular distance to *surface* is less than this, begin retreat from strafe
// AI guard options --wookieejedi
float guard_big_orbit_above_target_radius; // Radius of guardee that triggers ai_big_guard()
float guard_big_orbit_max_speed_percent; // Max percent of forward speed that is used in ai_big_guard()
// AI attack any option --wookieejedi
float attack_any_idle_circle_distance; // Radius that AI circles around a point while waiting for new enemies in attack-any mode
int default_form_on_wing_priority; // the priority used if not specified in the sexp
void reset();
};
@@ -125,10 +163,10 @@ extern int Num_ai_profiles;
extern int Default_ai_profile;
extern ai_profile_t Ai_profiles[MAX_AI_PROFILES];
#define AI_PROFILES_INDEX(ai_p) ((int)((ai_p) - Ai_profiles))
#define AI_PROFILES_INDEX(ai_p) (static_cast<int>((ai_p)-Ai_profiles))
void ai_profiles_init();
int ai_profile_lookup(char *name);
int ai_profile_lookup(const char *name);
#endif
+259 -203
View File
@@ -39,11 +39,7 @@
#define MIN_DOT_TO_ATTACK_MOVING_SUBSYS 0.97f
// AI BIG MAGIC NUMBERS
#define STRAFE_RETREAT_COLLIDE_TIME 2.0 // when anticipated collision time is less than this, begin retreat
#define STRAFE_RETREAT_COLLIDE_DIST 100 // when perpendicular distance to *surface* is less than this, begin retreat
#define STRAFE_RETREAT_BOX_DIST 300 // distance beyond the bounding box to retreat
#define STRAFE_MAX_UNHIT_TIME 20 // Maximum amount of time to stay in strafe mode if not hit
// Select strafing options are now exposed to modders --wookieejedi
#define EVADE_BOX_BASE_DISTANCE 300 // standard distance to end evade submode
#define EVADE_BOX_MIN_DISTANCE 200 // minimun distance to end evade submode, after long time
@@ -63,13 +59,22 @@
void ai_big_evade_ship();
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float dist_to_enemy, int modelnum);
void ai_big_avoid_ship();
int ai_big_maybe_follow_subsys_path(int do_dot_check=1);
bool ai_big_maybe_follow_subsys_path(bool do_dot_check=true);
void ai_big_strafe_position();
static int ai_big_strafe_maybe_retreat(const vec3d *target_pos);
static bool ai_big_strafe_maybe_retreat(const vec3d *target_pos);
extern int model_which_octant_distant_many( vec3d *pnt, int model_num,matrix *model_orient, vec3d * model_pos, polymodel **pm, int *octs);
extern void compute_desired_rvec(vec3d *rvec, vec3d *goal_pos, vec3d *cur_pos);
extern void big_ship_collide_recover_start(object *objp, object *big_objp, vec3d *collision_normal);
extern void compute_desired_rvec(vec3d *rvec, const vec3d *goal_pos, const vec3d *cur_pos);
extern void big_ship_collide_recover_start(const object *objp, const object *big_objp, const vec3d *collision_normal);
// Record the mode being left as the one to return to, unless a dynamic goal is already in progress
// (in which case previous_mode still refers to the mode that goal interrupted).
static void ai_big_save_previous_mode(ai_info *aip)
{
if (The_mission.ai_profile->flags[AI::Profile_Flags::Fix_stale_ai_order_state] && aip->active_goal == AI_ACTIVE_GOAL_DYNAMIC)
return;
aip->previous_mode = aip->mode;
}
// Called by ai_big_pick_attack_point.
@@ -77,16 +82,15 @@ extern void big_ship_collide_recover_start(object *objp, object *big_objp, vec3d
// If truly_random flag set (haha), then generate a pretty random number. Otherwise, generate a static rand which
// tends to not change from frame to frame.
// Try four times and choose nearest point to increase chance of getting a good point.
void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec, vec3d *attack_point, vec3d *local_attack_point, float fov, float weapon_travel_dist, vec3d *surface_normal, ship_subsys *ss)
void ai_bpap(const object *objp, const vec3d *attacker_objp_pos, const vec3d *attacker_objp_fvec, vec3d *attack_point, vec3d *local_attack_point, float fov, float weapon_travel_dist, vec3d *surface_normal, const ship_subsys *ss)
{
float nearest_dist;
vec3d result_point, best_point;
vec3d rel_point;
int num_tries;
model_octant *octp;
polymodel *pm;
int i, q, octs[4];
int i;
ship_info *sip = &Ship_info[Ships[objp->instance].ship_info_index];
polymodel* pm = model_get(sip->model_num);
model_subsystem *tp = NULL;
if (ss != NULL)
tp = ss->system_info;
@@ -94,63 +98,53 @@ void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec,
best_point = objp->pos;
nearest_dist = weapon_travel_dist;
model_which_octant_distant_many(attacker_objp_pos, sip->model_num, &objp->orient, &objp->pos, &pm, octs);
// attempt anywhere from 16 to 4 times, more if we're closer
num_tries = (int) (vm_vec_dist(&objp->pos, attacker_objp_pos)/objp->radius);
if (num_tries >= 4)
num_tries = 1;
else
num_tries = 4 - num_tries;
num_tries = (4 - num_tries) * 4;
// Index #0 is best one.
if ( pm->octants[octs[0]].verts ) {
*local_attack_point = *pm->octants[octs[0]].verts[0]; // Set just in case it doesn't get set below.
} else {
vm_vec_zero(local_attack_point);
}
vm_vec_zero(local_attack_point);
for (q=0; q<4; q++) {
octp = &pm->octants[octs[q]];
if (octp->nverts > 0) {
auto collision_tree = model_get_bsp_collision_tree(pm->submodel[pm->detail[0]].collision_tree_index);
if (num_tries > octp->nverts)
num_tries = octp->nverts;
if (!collision_tree->poly_centers.empty()) {
int num_polies = (int)collision_tree->poly_centers.size();
if (num_tries > octp->nverts)
num_tries = octp->nverts;
if (num_tries > num_polies)
num_tries = num_polies;
for (i=0; i<num_tries; i++) {
int index;
float dist, dot;
vec3d v2p;
for (i=0; i<num_tries; i++) {
int index;
float dist, dot;
vec3d v2p;
index = (int) (frand() * (octp->nverts));
index = (int) (frand() * num_polies);
rel_point = *octp->verts[index];
vm_vec_unrotate(&result_point, &rel_point, &objp->orient);
vm_vec_add2(&result_point, &objp->pos);
rel_point = collision_tree->poly_centers[index];
vm_vec_unrotate(&result_point, &rel_point, &objp->orient);
vm_vec_add2(&result_point, &objp->pos);
dist = vm_vec_normalized_dir(&v2p, &result_point, attacker_objp_pos);
bool in_fov = false;
dist = vm_vec_normalized_dir(&v2p, &result_point, attacker_objp_pos);
bool in_fov = false;
dot = vm_vec_dot(&v2p, attacker_objp_fvec);
if (tp == NULL) {
if (dot > fov)
in_fov = true;
} else {
in_fov = turret_fov_test(ss, attacker_objp_fvec, &v2p);
}
dot = vm_vec_dot(&v2p, attacker_objp_fvec);
if (tp == NULL) {
if (dot > fov)
in_fov = true;
} else {
in_fov = turret_fov_test(ss, attacker_objp_fvec, &v2p);
}
if (in_fov) {
if (dist < nearest_dist) {
nearest_dist = dist;
best_point = result_point;
*local_attack_point = rel_point;
Assert( !vm_is_vec_nan(local_attack_point) );
if (dot > (1.0f + fov)/2.0f) // If this point is quite good, quit searching for a better one.
goto done_1;
}
if (in_fov) {
if (dist < nearest_dist) {
nearest_dist = dist;
best_point = result_point;
*local_attack_point = rel_point;
Assert( !vm_is_vec_nan(local_attack_point) );
if (dot > (1.0f + fov)/2.0f) // If this point is quite good, quit searching for a better one.
goto done_1;
}
}
}
@@ -159,6 +153,10 @@ done_1:
*attack_point = best_point;
//The following raycast tends to make up 10%(!) of total AI-frametime for basically no benefit, especially in the common case for turrets where the normal isn't even queried.
if (surface_normal == nullptr && Disable_expensive_turret_target_check)
return;
// Cast from attack_objp_pos to local_attack_pos and check for nearest collision.
// If no collision, cast to (0,0,0) [center of big ship]** [best_point initialized to 000]
@@ -174,8 +172,6 @@ done_1:
}
mc_info mc;
mc_info_init(&mc);
mc.model_instance_num = Ships[objp->instance].model_instance_num;
mc.model_num = sip->model_num;
mc.orient = &objp->orient;
@@ -207,7 +203,7 @@ done_1:
//
// Note: Default value for fov is 1.0f 1.0f means don't use fov parameter.
// If fov != 1.0f, try up to four times to find a point that's in the field of view.
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float fov, float weapon_travel_dist)
void ai_big_pick_attack_point_turret(const object *objp, ship_subsys *ssp, const vec3d *gpos, const vec3d *gvec, vec3d *attack_point, float fov, float weapon_travel_dist)
{
if (!timestamp_elapsed(ssp->turret_pick_big_attack_point_timestamp)) {
vec3d result_point;
@@ -227,7 +223,7 @@ void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos
// Note: Default value for fov is 1.0f 1.0f means don't use fov parameter.
// If fov != 1.0f, try up to four times to find a point that's in the field of view.
// Note, attacker_objp can be a ship or a weapon.
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov)
void ai_big_pick_attack_point(const object *objp, const object *attacker_objp, vec3d *attack_point, float fov)
{
Assert(objp->instance > -1);
Assert(objp->type == OBJ_SHIP);
@@ -362,10 +358,10 @@ void ai_big_subsys_path_cleanup(ai_info *aip)
}
// Maybe Pl_objp needs to follow a path to get in line-of-sight to a subsystem
// input: do_dot_check => default value 0, flag to indicate whether check should be done to ensure
// input: do_dot_check => default value true, flag to indicate whether check should be done to ensure
// subsystem is within certain field of view. We don't want to check fov when
// strafing, since ship is weaving to avoid turret fire
int ai_big_maybe_follow_subsys_path(int do_dot_check)
bool ai_big_maybe_follow_subsys_path(bool do_dot_check)
{
ai_info *aip;
float dot = 1.0f, min_dot;
@@ -425,7 +421,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
}
}
if ( ship_subsystem_in_sight(En_objp, aip->targeted_subsys, &geye, &gsubpos, 1) ) {
if ( ship_subsystem_in_sight(En_objp, aip->targeted_subsys, &geye, &gsubpos, true) ) {
subsys_in_sight = 1;
}
}
@@ -513,7 +509,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
// for now, only follow the path to the first point
if ( aip->path_cur < (aip->path_start+aip->path_length-1) ) {
if ( aip->goal_objnum != aip->target_objnum ) {
aip->previous_mode = aip->mode;
ai_big_save_previous_mode(aip);
aip->mode = AIM_NONE;
aip->submode = -1;
aip->submode_start_time = Missiontime;
@@ -549,18 +545,18 @@ bool ai_new_maybe_reposition_attack_subsys() {
// get world pos of eye (stored in geye)
ep = &(pm->view_positions[Ships[Pl_objp->instance].current_viewpoint]);
model_local_to_global_point(&geye, &ep->pnt, pm->id, 0, &Pl_objp->orient, &Pl_objp->pos);
model_local_to_global_point(&geye, &ep->pnt, pm, 0, &Pl_objp->orient, &Pl_objp->pos);
// get world pos of subsystem
vm_vec_unrotate(&gsubpos, &aip->targeted_subsys->system_info->pnt, &En_objp->orient);
vm_vec_add2(&gsubpos, &En_objp->pos);
get_subsystem_pos(&gsubpos, target_objp, aip->targeted_subsys);
// you're in sight! shoot it!
if (ship_subsystem_in_sight(En_objp, aip->targeted_subsys, &geye, &gsubpos, 0))
if (ship_subsystem_in_sight(En_objp, aip->targeted_subsys, &geye, &gsubpos, false))
return false;
// not in sight, gotta get there
vec3d* good_pos = nullptr;
vec3d world_goal_pos;
// For performance reasons we only recheck once a second, otherwise we reuse the last found target.
if (timestamp_elapsed(aip->next_dynamic_path_check_time)) {
vec3d tgt2pl = Pl_objp->pos - target_objp->pos;
@@ -582,7 +578,6 @@ bool ai_new_maybe_reposition_attack_subsys() {
vm_rot_point_around_line(&goal_pos, &tgt2pl, angle2goal, &vmd_zero_vector, &cross);
// then scale in (or out) towards our subsys
vec3d world_goal_pos;
float new_radius = ((subsys_dist - pl_dist) * (angle2goal / angle2subsys)) + pl_dist;
vm_vec_copy_scale(&world_goal_pos, &goal_pos, new_radius / pl_dist);
world_goal_pos += target_objp->pos;
@@ -618,6 +613,7 @@ bool ai_new_maybe_reposition_attack_subsys() {
else
good_pos = &world_goal_pos;
aip->next_dynamic_path_check_time = timestamp( AI_DYNAMIC_PATH_RECHECK_DELAY );
aip->last_dynamic_path_goal = *good_pos;
}
else{ //Not enough time has passed till recheck.
@@ -631,15 +627,17 @@ bool ai_new_maybe_reposition_attack_subsys() {
accelerate_ship(aip, subsys_distance > 200.0f ? 1.0f : subsys_distance / 200.0f);
if (!(Ships[Pl_objp->instance].flags[Ship::Ship_Flags::Afterburner_locked])) {
if (subsys_distance > 300.0f) {
if (ai_willing_to_afterburn_hard(aip) && subsys_distance > 1000.0f)
ai_afterburn_hard(Pl_objp, aip);
else if (subsys_distance > 300.0f) {
if (ai_maybe_fire_afterburner(Pl_objp, aip)) {
afterburners_start(Pl_objp);
aip->afterburner_stop_time = Missiontime + 2 * F1_0;
}
}
else
afterburners_stop(Pl_objp);
}
} else
afterburners_stop(Pl_objp);
return true;
}
@@ -661,16 +659,17 @@ int ai_big_maybe_start_strafe(ai_info *aip, ship_info *sip)
// are near
if ( sip->is_small_ship() ) {
if ( timestamp_elapsed(aip->scan_for_enemy_timestamp) ) {
ship_obj *so;
object *test_objp;
ship *test_sp;
float dist_squared;
aip->scan_for_enemy_timestamp = timestamp(SCAN_FIGHTERS_INTERVAL);
// iterate through ships, and see if any fighter/bomber from opposite team are near
so = GET_FIRST(&Ship_obj_list);
while( so != END_OF_LIST(&Ship_obj_list) ) {
for (auto so: list_range(&Ship_obj_list)) {
test_objp = &Objects[so->objnum];
if (test_objp->flags[Object::Object_Flags::Should_be_dead])
continue;
test_sp = &Ships[test_objp->instance];
if ( iff_x_attacks_y(Ships[Pl_objp->instance].team, test_sp->team) ) {
@@ -681,7 +680,6 @@ int ai_big_maybe_start_strafe(ai_info *aip, ship_info *sip)
}
}
}
so = GET_NEXT(so);
}
}
}
@@ -706,6 +704,9 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
if (Pl_objp->phys_info.speed < 3.0f) {
object *objp;
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->flags[Object::Object_Flags::Should_be_dead])
continue;
if ((objp->type == OBJ_WEAPON) && (iff_x_attacks_y(Ships[Pl_objp->instance].team, Weapons[objp->instance].team)))
if (Weapon_info[Weapons[objp->instance].weapon_info_index].subtype == WP_LASER) {
vec3d in_vec;
@@ -715,7 +716,8 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
if (vm_vec_dot(&in_vec, &objp->orient.vec.fvec) > 0.0f) {
dist = vm_vec_normalize(&in_vec);
if ((dist < 200.0f) && (vm_vec_dot(&in_vec, &objp->orient.vec.fvec) > 0.95f)) {
if ((Objects[objp->parent].signature == objp->parent_sig) && (vm_vec_dist_quick(&objp->pos, &Objects[objp->parent].pos) < 300.0f)) {
if ((Objects[objp->parent].signature == objp->parent_sig) && (vm_vec_dist_quick(&objp->pos, &Objects[objp->parent].pos) < 300.0f)
&& !ai_declines_pursuit(Pl_objp, &Objects[objp->parent])) {
set_target_objnum(aip, objp->parent);
aip->submode = SM_ATTACK;
aip->submode_start_time = Missiontime;
@@ -728,22 +730,24 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
}
}
}
// Since ship is moving slowly and attacking a large ship, scan if enemy fighters are near, if so
// then enter strafe mode
if ( ai_big_maybe_start_strafe(aip, sip) ) {
aip->previous_mode = aip->mode;
aip->mode = AIM_STRAFE;
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
ai_big_strafe_position();
return;
}
} // end if ( Pl_objp->phys_info.speed < 3.0f )
// if moving slowly and attacking a large ship,
// check if need to enter standard strafe mode
// including ai_profile flag and if enemy fighters are near
if (Pl_objp->phys_info.speed < The_mission.ai_profile->standard_strafe_when_below_speed &&
(The_mission.ai_profile->flags[AI::Profile_Flags::Standard_strafe_used_more] || ai_big_maybe_start_strafe(aip, sip))) {
ai_big_save_previous_mode(aip);
aip->mode = AIM_STRAFE;
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
ai_big_strafe_position();
return;
}
//Maybe enter glide strafe (check every 8 seconds, on a different schedule for each ship)
if ((sip->can_glide == true) && !(aip->ai_flags[AI::AI_Flags::Kamikaze]) && static_randf((Missiontime + static_rand(aip->shipnum)) >> 19) < aip->ai_glide_strafe_percent) {
aip->previous_mode = aip->mode;
ai_big_save_previous_mode(aip);
aip->mode = AIM_STRAFE;
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
aip->submode = AIS_STRAFE_GLIDE_ATTACK;
@@ -756,7 +760,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
if (ai_new_maybe_reposition_attack_subsys())
return;
} else if ( ai_big_maybe_follow_subsys_path() ) {
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags[AI::AI_Flags::Kamikaze])) {
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags[AI::AI_Flags::Kamikaze]) && !ai_willing_to_afterburn_hard(aip)) {
afterburners_stop(Pl_objp);
}
return;
@@ -848,7 +852,9 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
} else {
accelerate_ship(aip, accel);
if ((aip->ai_flags[AI::AI_Flags::Free_afterburner_use] || aip->ai_profile_flags[AI::Profile_Flags::Free_afterburner_use]) && !(shipp->flags[Ship::Ship_Flags::Afterburner_locked]) && (accel > 0.95f)) {
if (ai_willing_to_afterburn_hard(aip) && accel > 0.99f && !(shipp->flags[Ship::Ship_Flags::Afterburner_locked])) {
ai_afterburn_hard(Pl_objp, aip);
} else if ((aip->ai_flags[AI::AI_Flags::Free_afterburner_use] || aip->ai_profile_flags[AI::Profile_Flags::Free_afterburner_use]) && !(shipp->flags[Ship::Ship_Flags::Afterburner_locked]) && (accel > 0.95f)) {
if (ai_maybe_fire_afterburner(Pl_objp, aip)) {
afterburners_start(Pl_objp);
aip->afterburner_stop_time = Missiontime + 3*F1_0;
@@ -867,10 +873,10 @@ void ai_big_chase_ct()
ai_chase_ct();
}
extern void ai_select_secondary_weapon(object *objp, ship_weapon *swp, int priority1 = -1, int priority2 = -1);
extern bool ai_select_secondary_weapon(object *objp, ship_weapon *swp, int priority1 = -1, int priority2 = -1);
extern float set_secondary_fire_delay(ai_info *aip, ship *shipp, weapon_info *swip, bool burst);
extern void ai_choose_secondary_weapon(object *objp, ai_info *aip, object *en_objp);
extern int maybe_avoid_big_ship(object *objp, object *ignore_objp, ai_info *aip, vec3d *goal_point, float delta_time, float time_scale = 1.f);
extern bool ai_choose_secondary_weapon(object *objp, ai_info *aip, object *en_objp);
extern bool maybe_avoid_big_ship(object *objp, object *ignore_objp, ai_info *aip, vec3d *goal_point, float delta_time, float time_scale = 1.f);
extern void maybe_cheat_fire_synaptic(object *objp);
@@ -900,7 +906,7 @@ static void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy)
// Chance of hitting ship is based on dot product of firing ship's forward vector with vector to ship
// and also the size of the target relative to distance to target.
if (dot_to_enemy > MAX(0.5f, 0.90f + aip->ai_accuracy/10.0f - En_objp->radius/MAX(1.0f,dist_to_enemy))) {
if (dot_to_enemy > std::max(0.5f, 0.90f + aip->ai_accuracy / 10.0f - En_objp->radius / std::max(1.0f, dist_to_enemy))) {
ship *temp_shipp;
temp_shipp = &Ships[Pl_objp->instance];
@@ -920,13 +926,13 @@ static void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy)
}
if (tswp->num_secondary_banks > 0) {
if (!(En_objp->flags[Object::Object_Flags::Protected]) || (aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP))) {
ai_choose_secondary_weapon(Pl_objp, aip, En_objp);
if ( !(En_objp->flags[Object::Object_Flags::Protected]) || ai_goal_is_disable_or_disarm(aip->goals[0].ai_mode) ) {
bool valid_secondary = ai_choose_secondary_weapon(Pl_objp, aip, En_objp);
int current_bank = tswp->current_secondary_bank;
if (current_bank > -1) {
if (current_bank > -1 && valid_secondary) {
weapon_info *swip = &Weapon_info[tswp->secondary_bank_weapons[current_bank]];
if(!(En_objp->flags[Object::Object_Flags::Protected]) || ((aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)) && swip->wi_flags[Weapon::Info_Flags::Puncture] )) { //override lockdown on protected ships when using anti subsystem weapons - Valathil
if ( !(En_objp->flags[Object::Object_Flags::Protected]) || (ai_goal_is_disable_or_disarm(aip->goals[0].ai_mode) && swip->wi_flags[Weapon::Info_Flags::Puncture]) ) { //override lockdown on protected ships when using anti subsystem weapons - Valathil
// If ship is protected and very low on hits, don't fire missiles.
if (!(En_objp->flags[Object::Object_Flags::Protected]) || (En_objp->hull_strength > 10*swip->damage)) {
if (aip->ai_flags[AI::AI_Flags::Unload_secondaries]) {
@@ -1013,12 +1019,14 @@ static void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy)
// switch ai ship into chase mode
void ai_big_switch_to_chase_mode(ai_info *aip)
{
aip->previous_mode = aip->mode;
ai_big_save_previous_mode(aip);
aip->mode = AIM_CHASE;
aip->submode = SM_ATTACK;
aip->submode_start_time = Missiontime;
}
extern weapon_info* ai_get_weapon(ship_weapon* swp);
// Make object Pl_objp chase object En_objp, which is a big ship, not a small ship.
void ai_big_chase()
{
@@ -1038,16 +1046,38 @@ void ai_big_chase()
player_pos = Pl_objp->pos;
ai_big_pick_attack_point(En_objp, Pl_objp, &enemy_pos, 0.8f);
// Compute the predicted position of the center of the ship, then add the delta to the goal pos.
if (En_objp->phys_info.speed > 3.0f) {
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, &En_objp->pos, &En_objp->phys_info.vel, aip);
vm_vec_add2(&enemy_pos, &predicted_enemy_pos);
vm_vec_sub2(&enemy_pos, &En_objp->pos);
} else
predicted_enemy_pos = En_objp->pos;
weapon_info* wip = ai_get_weapon(&shipp->weapons);
bool ballistic_aiming = !IS_VEC_NULL(&The_mission.gravity) && wip && wip->gravity_const != 0.0f;
bool valid_ballistic_trajectory = true;
if (aip->targeted_subsys != NULL) {
get_subsystem_pos(&enemy_pos, En_objp, aip->targeted_subsys);
if (!ballistic_aiming) {
// Compute the predicted position of the center of the ship, then add the delta to the goal pos.
if (En_objp->phys_info.speed > 3.0f) {
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, &En_objp->pos, &En_objp->phys_info.vel, aip);
vm_vec_add2(&enemy_pos, &predicted_enemy_pos);
vm_vec_sub2(&enemy_pos, &En_objp->pos);
} else
predicted_enemy_pos = En_objp->pos;
if (aip->targeted_subsys != NULL) {
get_subsystem_pos(&enemy_pos, En_objp, aip->targeted_subsys);
}
} else {
if (aip->targeted_subsys != NULL) {
get_subsystem_pos(&enemy_pos, En_objp, aip->targeted_subsys);
}
vec3d gravity = The_mission.gravity * wip->gravity_const;
vec3d target;
valid_ballistic_trajectory =
physics_lead_ballistic_trajectory(&player_pos, &enemy_pos, &En_objp->phys_info.vel, wip->max_speed, &gravity, &target);
if (valid_ballistic_trajectory) {
enemy_pos = Pl_objp->pos + target * vm_vec_dist(&Pl_objp->pos, &enemy_pos);
predicted_enemy_pos = enemy_pos;
} else {
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, &En_objp->pos, &En_objp->phys_info.vel, aip);
}
}
dist_to_enemy = vm_vec_normalized_dir(&vec_to_enemy, &enemy_pos, &player_pos); // - En_objp->radius;
@@ -1078,7 +1108,7 @@ void ai_big_chase()
// If just acquired target, or target is not in reasonable cone, don't refine believed enemy position.
if ((dot_to_enemy < 0.25f) || (aip->target_time < 1.0f) || (aip->ai_flags[AI::AI_Flags::Seek_lock])) {
update_aspect_lock_information(aip, &vec_to_enemy, dist_to_enemy - En_objp->radius, En_objp->radius);
} else if (aip->targeted_subsys != NULL) {
} else if (aip->targeted_subsys != NULL && !ballistic_aiming) {
Assert(aip->targeted_subsys != NULL);
get_subsystem_pos(&enemy_pos, En_objp, aip->targeted_subsys);
vm_vec_add2(&enemy_pos, &predicted_enemy_pos);
@@ -1089,7 +1119,7 @@ void ai_big_chase()
} else if (En_objp->flags[Object::Object_Flags::Protected]) { // If protected and we're not attacking a subsystem, stop attacking!
update_aspect_lock_information(aip, &vec_to_enemy, dist_to_enemy - En_objp->radius, En_objp->radius);
aip->target_objnum = -1;
if (find_enemy(OBJ_INDEX(Pl_objp), MAX_ENEMY_DISTANCE, The_mission.ai_profile->max_attackers[Game_skill_level]) == -1) {
if (find_enemy(OBJ_INDEX(Pl_objp), MAX_ENEMY_DISTANCE, The_mission.ai_profile->max_attackers[Game_skill_level], ai_targets_for_pursuit(aip)) == -1) {
ai_do_default_behavior(Pl_objp);
return;
}
@@ -1110,7 +1140,7 @@ void ai_big_chase()
}
}
if (aip->target_time < 2.0f)
if (!aip->ai_profile_flags[AI::Profile_Flags::No_continuous_turn_on_attack] && aip->target_time < 2.0f)
if ((dot_to_enemy < 0.9f) || (dist_to_enemy > 300.0f)) {
aip->submode = SM_CONTINUOUS_TURN;
aip->submode_start_time = Missiontime - fl2f(2.75f); // This backdated start time allows immediate switchout.
@@ -1176,70 +1206,78 @@ void ai_big_chase()
}
// If a collision is expected, pull out!
float dist_normal_to_enemy;
if (!(The_mission.ai_profile->flags[AI::Profile_Flags::Kamikaze_no_collision_avoidance] && aip->ai_flags[AI::AI_Flags::Kamikaze])) {
if (vm_vec_mag_squared(&aip->big_attack_surface_normal) > 0.9) {
if (aip->ai_profile_flags[AI::Profile_Flags::Improved_subsystem_attack_pathing])
dist_normal_to_enemy = fl_abs((dist_to_enemy / vm_vec_dot(&vec_to_enemy, &aip->big_attack_surface_normal)));
else // I'm fairly sure this retail code VVV meant to use / instead of *
dist_normal_to_enemy = fl_abs((dist_to_enemy * vm_vec_dot(&vec_to_enemy, &aip->big_attack_surface_normal)));
} else {
// don;t have normal so use a conservative value here
dist_normal_to_enemy = 0.3f * dist_to_enemy;
}
float dist_normal_to_enemy;
// float time_to_enemy = dist_normal_to_enemy / Pl_objp->phys_info.speed * fl_abs(vm_vec_dot(&Pl_objp->phys_info.vel, &aip->big_attack_surface_normal));
// if (Framecount % 30 == 1) {
// mprintf(("normal dist; %.1f, time: %.1f\n", dist_normal_to_enemy, time_to_enemy));
// }
// since we're not in strafe and we may get a bad normal, cap dist_normal_to_enemy as MIN(0.3*dist_to_enemy, self)
// this will allow us to get closer on a bad normal
dist_normal_to_enemy = MAX(0.3f*dist_to_enemy, dist_normal_to_enemy);
if (dist_to_enemy < ATTACK_COLLIDE_BASE_DIST) {
// within 50m or 1sec
float time_to_enemy;
if (vm_vec_mag_squared(&aip->big_attack_surface_normal) > 0.9) {
if (Pl_objp->phys_info.speed > 0.1) {
time_to_enemy = dist_normal_to_enemy / fl_abs(vm_vec_dot(&Pl_objp->phys_info.vel, &aip->big_attack_surface_normal));
} else {
// a big time
time_to_enemy = 100.0f;
}
} else {
if (Pl_objp->phys_info.speed > 0.1) {
time_to_enemy = dist_normal_to_enemy / Pl_objp->phys_info.speed;
} else {
// a big time
time_to_enemy = 100.0f;
}
if (aip->ai_profile_flags[AI::Profile_Flags::Improved_subsystem_attack_pathing])
dist_normal_to_enemy = fl_abs((dist_to_enemy / vm_vec_dot(&vec_to_enemy, &aip->big_attack_surface_normal)));
else // I'm fairly sure this retail code VVV meant to use / instead of *
dist_normal_to_enemy = fl_abs((dist_to_enemy * vm_vec_dot(&vec_to_enemy, &aip->big_attack_surface_normal)));
}
else {
// don;t have normal so use a conservative value here
dist_normal_to_enemy = 0.3f * dist_to_enemy;
}
float speed_dist = MAX(0.0f, (Pl_objp->phys_info.speed-50) * 2);
if ((dist_normal_to_enemy < ATTACK_COLLIDE_AVOID_DIST + speed_dist) || (time_to_enemy < ATTACK_COLLIDE_AVOID_TIME) ) {
// get away, simulate crsh recovery (don't use avoid)
// accelerate_ship(aip, -1.0f);
big_ship_collide_recover_start(Pl_objp, En_objp, nullptr);
// aip->submode = SM_AVOID;
// aip->submode_start_time = Missiontime;
} else if ((dist_normal_to_enemy < ATTACK_COLLIDE_SLOW_DIST) || (time_to_enemy < ATTACK_COLLIDE_SLOW_TIME) ) {
// slow down
accelerate_ship(aip, -1.0f);
}
}
// float time_to_enemy = dist_normal_to_enemy / Pl_objp->phys_info.speed * fl_abs(vm_vec_dot(&Pl_objp->phys_info.vel, &aip->big_attack_surface_normal));
// if (Framecount % 30 == 1) {
// mprintf(("normal dist; %.1f, time: %.1f\n", dist_normal_to_enemy, time_to_enemy));
// }
/*
if ((dot_to_enemy > 1.0f - 0.1f * En_objp->radius/(dist_to_enemy + 1.0f)) && (Pl_objp->phys_info.speed > dist_to_enemy/5.0f)) {
if (might_collide_with_ship(Pl_objp, En_objp, dot_to_enemy, dist_to_enemy, (aip->targeted_subsys == NULL)*2.0f + 1.5f)) {
if ((Missiontime - aip->last_hit_time > F1_0*4) && (dist_to_enemy < Pl_objp->radius*2 + En_objp->radius*2)) {
// since we're not in strafe and we may get a bad normal, cap dist_normal_to_enemy as MIN(0.3*dist_to_enemy, self)
// this will allow us to get closer on a bad normal
dist_normal_to_enemy = MAX(0.3f * dist_to_enemy, dist_normal_to_enemy);
if (dist_to_enemy < ATTACK_COLLIDE_BASE_DIST) {
// within 50m or 1sec
float time_to_enemy;
if (vm_vec_mag_squared(&aip->big_attack_surface_normal) > 0.9) {
if (Pl_objp->phys_info.speed > 0.1) {
time_to_enemy = dist_normal_to_enemy / fl_abs(vm_vec_dot(&Pl_objp->phys_info.vel, &aip->big_attack_surface_normal));
}
else {
// a big time
time_to_enemy = 100.0f;
}
}
else {
if (Pl_objp->phys_info.speed > 0.1) {
time_to_enemy = dist_normal_to_enemy / Pl_objp->phys_info.speed;
}
else {
// a big time
time_to_enemy = 100.0f;
}
}
float speed_dist = MAX(0.0f, (Pl_objp->phys_info.speed - 50) * 2);
if ((dist_normal_to_enemy < ATTACK_COLLIDE_AVOID_DIST + speed_dist) || (time_to_enemy < ATTACK_COLLIDE_AVOID_TIME)) {
// get away, simulate crsh recovery (don't use avoid)
// accelerate_ship(aip, -1.0f);
big_ship_collide_recover_start(Pl_objp, En_objp, nullptr);
// aip->submode = SM_AVOID;
// aip->submode_start_time = Missiontime;
}
else if ((dist_normal_to_enemy < ATTACK_COLLIDE_SLOW_DIST) || (time_to_enemy < ATTACK_COLLIDE_SLOW_TIME)) {
// slow down
accelerate_ship(aip, -1.0f);
} else {
aip->submode = SM_AVOID;
aip->submode_start_time = Missiontime;
}
}
} */
/*
if ((dot_to_enemy > 1.0f - 0.1f * En_objp->radius/(dist_to_enemy + 1.0f)) && (Pl_objp->phys_info.speed > dist_to_enemy/5.0f)) {
if (might_collide_with_ship(Pl_objp, En_objp, dot_to_enemy, dist_to_enemy, (aip->targeted_subsys == NULL)*2.0f + 1.5f)) {
if ((Missiontime - aip->last_hit_time > F1_0*4) && (dist_to_enemy < Pl_objp->radius*2 + En_objp->radius*2)) {
accelerate_ship(aip, -1.0f);
} else {
aip->submode = SM_AVOID;
aip->submode_start_time = Missiontime;
}
}
} */
}
}
switch (aip->submode) {
@@ -1318,7 +1356,7 @@ void ai_big_chase()
// I noticed AI ships firing inappropriately when following a path near a big ship.
// TODO: investigate why ships fire (and aren't close to hitting ship) when following a path near
// a big ship
if (aip->mode != AIM_EVADE && aip->path_start == -1 ) {
if (aip->mode != AIM_EVADE && aip->path_start == -1 && (!ballistic_aiming || valid_ballistic_trajectory)) {
ai_big_maybe_fire_weapons(dist_to_enemy, dot_to_enemy);
} else {
if (flFrametime < 1.0f)
@@ -1398,7 +1436,7 @@ void ai_big_attack_get_data(vec3d *enemy_pos, float *dist_to_enemy, float *dot_t
// check to see if Pl_objp has gotten too close to attacking point.. if so, break off by entering
// AIS_STRAFE_RETREAT
static int ai_big_strafe_maybe_retreat(const vec3d *target_pos)
static bool ai_big_strafe_maybe_retreat(const vec3d *target_pos)
{
ai_info *aip;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
@@ -1406,37 +1444,54 @@ static int ai_big_strafe_maybe_retreat(const vec3d *target_pos)
vec3d vec_to_target;
vm_vec_sub(&vec_to_target, target_pos, &Pl_objp->pos);
float dist_to_target, dist_normal_to_target, time_to_target;
dist_to_target = vm_vec_mag_quick(&vec_to_target);
if (vm_vec_mag_quick(&aip->big_attack_surface_normal) > 0.9) {
dist_normal_to_target = -vm_vec_dot(&vec_to_target, &aip->big_attack_surface_normal);
} else {
dist_normal_to_target = 0.2f * vm_vec_mag_quick(&vec_to_target);
}
dist_normal_to_target = MAX(0.2f*dist_to_target, dist_normal_to_target);
time_to_target = dist_normal_to_target / Pl_objp->phys_info.speed;
float dist_to_target = vm_vec_mag(&vec_to_target);
// add distance penalty for going too fast
float speed_to_dist_penalty = MAX(0.0f, (Pl_objp->phys_info.speed-50));
bool collide_time;
bool collide_distance;
if (The_mission.ai_profile->flags[AI::Profile_Flags::Fix_standard_strafe]) {
// check if ship facing target, as likely will only collide if facing
vec3d vec_to_tpos;
vm_vec_normalized_dir(&vec_to_tpos, target_pos, &Pl_objp->pos);
float dot = vm_vec_dot(&vec_to_tpos, &Pl_objp->orient.vec.fvec);
if (dot <= 0.0f) {
collide_time = false;
collide_distance = false;
} else {
collide_time = (Pl_objp->phys_info.speed > 0.0f) && (dist_to_target / Pl_objp->phys_info.speed) < (The_mission.ai_profile->strafe_retreat_collide_time);
collide_distance = dist_to_target < ((The_mission.ai_profile->strafe_retreat_collide_distance) + speed_to_dist_penalty);
}
} else {
float dist_normal_to_target;
if (vm_vec_mag(&aip->big_attack_surface_normal) > 0.9) {
dist_normal_to_target =
MAX(0.2f * dist_to_target, -vm_vec_dot(&vec_to_target, &aip->big_attack_surface_normal));
} else {
dist_normal_to_target = 0.2f * dist_to_target;
}
collide_time = (Pl_objp->phys_info.speed > 0.0f) && (dist_normal_to_target / Pl_objp->phys_info.speed) < (The_mission.ai_profile->strafe_retreat_collide_time);
collide_distance = dist_normal_to_target < ((The_mission.ai_profile->strafe_retreat_collide_distance) + speed_to_dist_penalty);
}
//if ((dot_to_enemy > 1.0f - 0.1f * En_objp->radius/(dist_to_enemy + 1.0f)) && (Pl_objp->phys_info.speed > dist_to_enemy/5.0f))
// Inside 2 sec retreat, setting goal point to box point + 300m
// Inside 2 sec retreat, setting goal point to box point + strafe_retreat_box_dist
// If collision, use std collision resolution.
if ( !(aip->ai_flags[AI::AI_Flags::Kamikaze]) && ((aip->ai_flags[AI::AI_Flags::Target_collision]) || (time_to_target < STRAFE_RETREAT_COLLIDE_TIME) || (dist_normal_to_target < STRAFE_RETREAT_COLLIDE_DIST + speed_to_dist_penalty)) ) {
if ( !(aip->ai_flags[AI::AI_Flags::Kamikaze]) && ((aip->ai_flags[AI::AI_Flags::Target_collision]) || (collide_time) || (collide_distance)) ) {
if (aip->ai_flags[AI::AI_Flags::Target_collision]) {
// use standard collision resolution
aip->ai_flags.remove(AI::AI_Flags::Target_collision);
big_ship_collide_recover_start(Pl_objp, En_objp, nullptr);
} else {
// too close for comfort so fly to box point + 300
// too close for comfort so fly to box point + strafe_retreat_box_dist
aip->submode = AIS_STRAFE_RETREAT1;
aip->submode_start_time = Missiontime;
int is_inside;
vec3d goal_point;
get_world_closest_box_point_with_delta(&goal_point, En_objp, &Pl_objp->pos, &is_inside, STRAFE_RETREAT_BOX_DIST);
get_world_closest_box_point_with_delta(&goal_point, En_objp, &Pl_objp->pos, &is_inside, The_mission.ai_profile->strafe_retreat_box_dist);
// set goal point
aip->goal_point = goal_point;
@@ -1468,7 +1523,7 @@ void ai_big_strafe_attack()
if (aip->ai_profile_flags[AI::Profile_Flags::Improved_subsystem_attack_pathing]) {
if (ai_new_maybe_reposition_attack_subsys())
return;
} else if (ai_big_maybe_follow_subsys_path(0))
} else if (ai_big_maybe_follow_subsys_path(false))
return;
ai_big_attack_get_data(&target_pos, &target_dist, &target_dot);
@@ -1551,8 +1606,7 @@ void ai_big_strafe_attack()
accelerate_ship(aip, accel);
// if haven't been hit in quite a while, leave strafe mode
fix long_enough;
long_enough = F1_0 * STRAFE_MAX_UNHIT_TIME;
fix long_enough = fl2f(The_mission.ai_profile->strafe_max_unhit_time);
if ( (last_hit > long_enough) && ( (Missiontime - aip->submode_parm0) > long_enough) ) {
ai_big_switch_to_chase_mode(aip);
}
@@ -1589,7 +1643,7 @@ void ai_big_strafe_glide_attack()
if (aip->ai_profile_flags[AI::Profile_Flags::Improved_subsystem_attack_pathing]) {
if (ai_new_maybe_reposition_attack_subsys())
return;
} else if (ai_big_maybe_follow_subsys_path(0))
} else if (ai_big_maybe_follow_subsys_path(false))
return;
//Gets a point on the target ship to attack, as well as distance and the angle between the nose of the attacker and that point.
@@ -1599,11 +1653,11 @@ void ai_big_strafe_glide_attack()
//If we haven't chosen the goal point yet, do so now
if (aip->submode_parm1 == 0) {
//Pick goal point. This should be a random point that passes through the circle whose normal is the vector between attacker and target
vec3d targetToAttacker;
vec3d tangentPoint;
vm_vec_sub(&targetToAttacker, &Pl_objp->pos, &target_objp->pos);
vec3d targetToAttackerDir;
vm_vec_normalized_dir(&targetToAttackerDir, &Pl_objp->pos, &target_objp->pos);
matrix orient;
vm_vector_2_matrix(&orient, &targetToAttacker, NULL, NULL);
vm_vector_2_matrix_norm(&orient, &targetToAttackerDir, nullptr, nullptr);
vec3d tangentPoint;
vm_vec_random_in_circle(&tangentPoint, &target_objp->pos, &orient, target_objp->radius + GLIDE_STRAFE_DISTANCE, true);
//Get tangent point in coords relative to ship, scale it up so the actual goal point is far away, then put back in world coords
vm_vec_sub2(&tangentPoint, &Pl_objp->pos);
@@ -1624,7 +1678,7 @@ void ai_big_strafe_glide_attack()
//Keep going until we are too far away.
//If we are still on approach but too far away, this will still trigger. This will allow us to reposition the target
//point and allow for a "jinking" effect.
if (target_ship_dist > (STRAFE_RETREAT_BOX_DIST + target_objp->radius) &&
if (target_ship_dist > (The_mission.ai_profile->strafe_retreat_box_dist + target_objp->radius) &&
Missiontime - aip->submode_start_time > i2f(GLIDE_STRAFE_MIN_TIME)) {
//This checks whether we are moving toward the target or away from it. If moving towards, we reset the stage so that we
//pick a new attack vector (jinking). If moving away, we're at the end of a run so do a full reset (possibly allowing a
@@ -1674,7 +1728,7 @@ void ai_big_strafe_glide_attack()
// if haven't been hit in quite a while, leave strafe mode
// (same as ai_big_strafe_attack)
fix long_enough = F1_0 * STRAFE_MAX_UNHIT_TIME;
fix long_enough = fl2f(The_mission.ai_profile->strafe_max_unhit_time);
if ( (Missiontime - aip->last_hit_time > long_enough) && ( (Missiontime - aip->submode_parm0) > long_enough) ) {
ai_big_switch_to_chase_mode(aip);
}
@@ -1824,7 +1878,7 @@ void ai_big_strafe()
/*
if ( aip->goal_objnum != aip->target_objnum ) {
Int3(); // what is going on here? - Get Alan
Assertion(false, "The goal objnum does not match the target objnum in ai_big_strafe(), please report to the SCP!"); // what is going on here? - Get Alan
aip->mode = AIM_NONE;
return;
}
@@ -1870,7 +1924,7 @@ void ai_big_strafe()
{
//Re-roll for random sidethrust every 2 seconds
if (static_randf((Missiontime + static_rand(aip->shipnum)) >> 17) < aip->ai_random_sidethrust_percent) {
do_random_sidethrust(aip, &Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index]);
do_random_sidethrust(aip, &Ship_info[Ships[aip->shipnum].ship_info_index]);
}
}
}
@@ -1916,32 +1970,34 @@ int ai_big_maybe_enter_strafe_mode(const object *pl_objp, int weapon_objnum)
weapon_objp = &Objects[weapon_objnum];
Assert(weapon_objp->type == OBJ_WEAPON);
Assert(weapon_objp->parent >= 0 && weapon_objp->parent < MAX_OBJECTS);
if (weapon_objp->parent < 0) {
return 0;
}
Assert(weapon_objp->parent < MAX_OBJECTS);
parent_objp = &Objects[weapon_objp->parent];
if ( (parent_objp->signature != weapon_objp->parent_sig) || (parent_objp->type != OBJ_SHIP) ) {
return 0;
}
if (ai_declines_pursuit(pl_objp, parent_objp)) {
return 0;
}
// Maybe the ship which fired the weapon isn't the current target
if ( OBJ_INDEX(parent_objp) != aip->target_objnum ) {
//JAS IMPOSSIBLE if (1) { // consider_target_only ) {
//JAS IMPOSSIBLE return 0;
//JAS IMPOSSIBLE } else {
// switch targets
sip = &Ship_info[Ships[parent_objp->instance].ship_info_index];
if ( !(sip->is_big_or_huge()) || (sip->flags[Ship::Info_Flags::Transport]) ) {
return 0;
}
set_target_objnum(aip, OBJ_INDEX(parent_objp));
//JAS IMPOSSIBLE }
}
ai_big_strafe_maybe_attack_turret(pl_objp, weapon_objp);
// if we've got this far, the weapon must have come from the player's target, and it is a
// big/capital ship... so enter strafe mode
aip->previous_mode = aip->mode;
ai_big_save_previous_mode(aip);
aip->mode = AIM_STRAFE;
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
aip->submode = AIS_STRAFE_AVOID;
+2 -2
View File
@@ -24,8 +24,8 @@ void ai_big_subsys_path_cleanup(ai_info *aip);
void ai_big_strafe();
int ai_big_maybe_enter_strafe_mode(const object *objp, int weapon_objnum);
void ai_big_strafe_maybe_attack_turret(const object *ship_objp, const object *weapon_objp);
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov=1.0f);
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float weapon_travel_dist, float fov=1.0f);
void ai_big_pick_attack_point(const object *objp, const object *attacker_objp, vec3d *attack_point, float fov=1.0f);
void ai_big_pick_attack_point_turret(const object *objp, ship_subsys *ssp, const vec3d *gpos, const vec3d *gvec, vec3d *attack_point, float weapon_travel_dist, float fov=1.0f);
// default distance for following subsystem path points --wookieejedi
// the value is 5 because that was the original value specified in ai_big_maybe_follow_subsys_path()
Loaded 100 of 3208 files, more files were not shown because too many files have changed in this diff. Show more