* Change output sound buffer to 44.1 kHz
This allow CE to play 44.1 kHz input files without loss of precision. In particular, it plays HQ music that ships with RPU.
There is a very similar fix in Sfall
* use generic sound loading path to allow .ogg/.wav music files
* rm a few dangling references
* PR feedback
* rm references to audio file
* rm audio_file.cc/h
* restore default audio io
* PR fixes
* 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>
* 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
* iOS: add touch gestures, HUD tap-through, quick-actions toolbar
Makes fallout2-ce playable on iPad without a keyboard, while leaving
non-iOS builds unchanged (all additions are TARGET_OS_IOS-guarded).
Touch gestures (src/mouse.cc):
- 3-finger swipe down → ESC
- 4-finger long-press → F6 (quicksave)
- 3-finger long-press → hold LShift (FO2tweaks highlighting). Uses
SDL_PushEvent so sfall's SDL_GetKeyboardState-based key_pressed()
sees the held key, not just the engine's own kb state.
HUD ergonomics (src/mouse.cc):
- Taps on interface-bar buttons inject the button's keyCode directly
so the cursor stays put. Taps on belt chrome are consumed rather
than teleporting the cursor to inert pixels.
- Two-finger taps on belt buttons → right-click handler.
Gameplay cursor (src/game_mouse.cc):
- On iPad, keep GAME_MOUSE_MODE_MOVE in relative (trackpad) mode so
screen taps don't teleport the cursor during combat. UI screens
that explicitly enable touchscreen mode are unaffected.
Quick-actions toolbar (src/platform/ios/quick_toolbar.{cc,h}):
- Optional iOS-only HUD strip above the belt with skill shortcuts
and end-turn. Header provides no-op stubs for non-iOS builds so
interface.cc can call it unconditionally.
- game.cc refactor: skilldex result handling factored into
gameHandleSkilldexResult() so the toolbar and the keyboard
shortcut share one path.
README: iPad controls section.
* iOS: add quick toolbar visibility preference
Adds a ui.quick_toolbar_visible config flag (default true)
* iOS: skip HUD tap-through when interface bar is hidden
When the interface bar window is hidden (e.g. on the world map),
windowGetRect still returns its rect, causing taps in that screen
area to be consumed as overHud even though there's nothing to interact
with. Check WINDOW_HIDDEN before treating the rect as active HUD.
Addresses Copilot review comment on PR #377.
* iOS: fix dialog options near bottom unclickable on iPad
Enable touchscreen mode for dialog UI so taps reach dialog option
buttons directly. The HUD tap interception in mouse.cc was consuming
taps that landed inside the interface bar rect, even when a dialog
window overlapped that region. Dialog options near the bottom of the
screen were silently swallowed by the belt chrome catch-all.
Skip HUD tap interception when touchscreen mode is active, since a UI
screen (dialog, inventory, skilldex, etc.) owns input in that state.
Add touch_get_touchscreen_mode() getter to support the check.
* iOS: add pipboy touch exception
* Apply fixes from review
* Change quick toolbar default visibility to false
* Add touch mode to character selector
update readme and simplify switch condition
* Add basic content config structure
* Moved non-file related settings from ddraw.ini to game.cfg
* Various fixes from self review
* Moved remaining worldmap settings to game.cfg
* Migrate character and text related settings
* Update docs
* chore: auto-format with clang-format
* Add hard-coded foce_base.dat to have reliable location to load CE-provided content from
* Move game.cfg to new base mod
* Automatic migration from ddraw.ini
* chore: auto-format with clang-format
* Removed option to disable cities limit fix
* Minor review comment fixes
* Migrate to /data instead of CE dat
* Migrate to local game#patch.cfg and skip fields with default values
- This was if some mod modifies/overwrites game.cfg later, only fields that user cares about will be loaded from user's override, and said mod is less likely to break
* Fix potential issue when "master_patches" is an absolute path and move recursive mkdir into a helper function
* Refactor code and fix some edge cases: data folder not exists when migrating, ddraw.ini doesn't exist
* Rename face_base.dat -> ce.dat
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Moved f2_res.ini settings into regular game config
* Rename resolution fields
* chore: auto-format with clang-format
* Code review fixes
* chore: auto-format with clang-format
* One-time migration of f2_res.ini to fallout2.cfg (#350)
* One-time migration of f2_res.ini to fallout2.cfg
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mike Klaas <mike.klaas@gmail.com>
* Fix global script loading on non-Windows
Previously, global scripts in .dats and in local FS didn't work due to path separator confusion.
Now:
* Hardcode global script path to "scripts\gl*.int" (windows separator)
* Use Windows fpattern matching inside of dFile (.dats, which always use windows separators)
* Use \-paths when listing found global scripts
The awkward part is having to vendor a copy of fpattern to force it to use "windows mode". It's possible that we could use this everywhere since windows allows / as separator, but that could cause bugs where we're using fpattern on the native FS. For now keeping the dFile implementation separate makes sense.
* hooks: an empty cc and a list of hook types with useful comments
* Deobfuscate some script-related procedures and flags
* Script hooks WIP
* Interpreter: add programPrintError(), Program->procedureCount(), rename string-related functions
* ScriptHookCall refactoring and all basic hook script opcode implementation
* HOOK_KEYPRESS and first working hooks
* mf_obj_under_cursor + some test script
* HOOK_TOHIT
* chore: auto-format with clang-format
* Add hooks: useobj, useobjon
* chore: auto-format with clang-format
* opcode: get_sfall_args
* Code review fixes
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>