* Correct `get_object_data` indexes
Currently they are raw offset pointers. This does not work with CE since pointers are wide (64bit) on some (most) platforms. So, we can treat these offsets like constants and return the appropriate fields instead.
There are already used for the most part as enum constants:
* Implement `set_unique_id`
* save/load watermark, including compat with previous saves (would be `0`)
* metarule to set and reset unique_id
* inventory stacking rules
* HRP's edg file support (WIP)
* Update docs and fix bug
* chore: auto-format with clang-format
* EDG: proper scroll blocking based on pre-calculated rects, exactly as in HRP
* chore: auto-format with clang-format
* EDG: fix scrolling past pixel-space bounds with sub-hex map edge mod
* EDG: review fixes
* EDG: proper edge clipping matching HRP logic
* chore: auto-format with clang-format
* EDG: code review fixes and refactoring
* chore: auto-format with clang-format
* EDG: fix clamping
* EDG: show arrow cursor and block events when over clipped area
* chore: auto-format with clang-format
* EDG: option to disable
* EDG: deobfuscate code
* chore: auto-format with clang-format
* EDG: get rid of rect2 and simplify algebra
* EDG: update docs, clarify that squareRect is not implemented
* EDG: square mask support
* chore: auto-format with clang-format
* Code review fixes
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add support for new talking heads
Add [Heads] config section in ddraw.ini that maps critter PIDs to talking
head indices in art\heads\heads.lst. When a dialog script starts with
headId=-1, the engine now checks the critter proto's headFid first, then
falls back to the [Heads] mapping. This lets mods add talking heads
without patching dialog scripts.
Includes Cassidy mapping (PID 16777305 → head index 13) for use with
cassidy_head.dat mod.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Implement HOOK_INVENWIELD, HOOK_CANUSEWEAPON and fix HOOK_ADJUSTFID
Wire the sfall hooks that npc_armor.mod relies on so party-member sprites
actually change when armor is equipped:
- HOOK_INVENWIELD fires from inventoryEquipFunc/inventoryUnequipFunc with
(critter, item, slot, isWield). Script may veto by returning 0. Slot
values mirror interpreter_extra.cc: WORN=0, RIGHT_HAND=1, LEFT_HAND=2.
- HOOK_CANUSEWEAPON fires from _ai_search_inven_weap so the mod's
weapon-anim restriction can veto AI weapon picks.
- HOOK_ADJUSTFID arg list corrected to match sfall (single currFid arg,
critter resolved via dude_obj).
- ProgramValue::isEmpty no longer treats string values as empty — sfall
scripts like npc_armor's `while (sect.PID)` loop depend on a non-empty
string being truthy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* enum class
* chore: auto-format with clang-format
* bad merge
* PR feedback
* restore isEmpty() to vanilla while fixing bug
* fixes
* minor fixes
* extra
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: tectiv3 <tectiv3@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Sfall-like sound system
(I would like a better name for this system, but the opcodes themselves are called `play|stop_sfall_sound` and I can't think of a better name)
This is a sound management system very similar to Sfall's. With a few differences:
* No support for new sound formats yet. Support for at least ogg+wav will come next
* Does support reading from .dat files, hence playing any sound effect in the base game
* Support mode=3 for speech volume. This exists in Sfall but is ignored when called from the opcode.
Also, change GaplessMusic to use this system to play the "wind2" loading sound. This restores the "vanilla" feel map transitions, so I think it's reasonable to make GaplessMusic=1 the default. I can't imagine someone wanting to change it to 0 unless they are ultra purists
* Sfall saved arrays support
* Add "...all_arrays..." special case for a list of saved arrays
* Adjust error message on load fail
* Fix crash in GetArrayKey when index == size
* chore: auto-format with clang-format
* Update sfall compatibility md
* Add keyIndex for Assoc Arrays for O(1) key lookups
* Review feedback, more error logging
* Fix build, increase ARRAY_MAX_STRING to 1024 to match sfall, fix gl_test_arrays triggering dynamic string block merge failure, prevent potential string buffer corruption on very long strings
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>