123 Commits
Author SHA1 Message Date
phobos2077 a91e40e3cc mapper: EDG support (edges only) 2026-06-06 23:27:50 +02:00
phobos2077 7da7d75f30 mapper: move common utility functions to mp_utils.cc 2026-06-06 23:27:50 +02:00
Mike Klaas dc4753cde9 Improve music/sound system to allow .ogg/.wav map music + 44.1 kHz output (#465)
* 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
2026-05-26 23:12:42 -07:00
Vlad Kandgithub-actions[bot] c423d475c5 EDG support (#450)
* 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>
2026-05-26 07:25:40 +00:00
IronKing24 f76e310f10 Fix mapper compilation 2026-05-16 19:45:00 +03:00
IronKing24 471ebbf417 Merge branch 'main' into mingw 2026-05-11 10:37:26 +03:00
Vlad Kandgithub-actions[bot] e42d8021c1 WIP Mapper implementation (#438)
* Add mapper CMakeTarget, tool for mapping function names to originals, load/save toolbar & update_art implemented

* edit_mapper function + stubs

* Rename exe to mapper-ce

* load_lbm_to_buf

* Add comments for read/write functions in db.h

* load_dialog, save_dialog, save_as, info_dialog and some other functions

* Fix LBM loading

* Fix mouse input not working on initial empty map, changed error in partyMemberRecoverLoadInstance to print to log, matching vanilla

* mapper.cc: basic hi-res support, NULL->nullptr

* load_lbm_to_buf rewrite, print_toolbar_name background fix

* Stubs for enter/exit playmode, art slot indexes fix, map_scr_toggle_hexes

* Fix memory corruption on screen_width > 640, fix various UI offset bugs

* mapper.cc: UI code style, toggle button fixes, rotation keys, edit button placeholders, PAGEUP key fix

* Elevation display fix, object type switching

* Spatial script placement and display, basic object selection

* Fixed dragging objects, block object showing, add all missing cases in edit_mapper with stubs, move all keys codes to constants

* chore: auto-format with clang-format

* Fix non-win builds

* Add stub calls from edit_mapper, fix objects being incorrectly deleted when unselected, fix tile number display

* Fix compile on Linux

* Attempt to fix iOS signing error

* Placing of objects and tiles, F12 to erase map, bug fixes

* Fixed block object toggling logic and add missing switch cases to edit_mapper

* Object editing added, 'p' to scroll palette fixed

* Add new files to CMakeLists

* Attempt to fix some colors + alignment in critter edit window

* chore: auto-format with clang-format

* Linux build fix attempt

* Critter inventory editing

* Vanilla grid-based inventory item picker

* Review fixes

* More review fixes and const correctness

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-05 18:47:16 +00:00
Mike Klaas 8b2ead8a2b Sfall-like sound system (#429)
* 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
2026-05-04 07:21:37 -07:00
IronKing24 ec6647968b Merge branch 'main' into mingw 2026-05-02 19:15:08 +03:00
IronKing24 4247d7ac3f - Set correct checks for msvc or win
- change SDL2 cmake for mingw to link correctly
2026-05-02 15:56:41 +03:00
Mike Klaas 7d1c8e7eea Bundle ce.dat into release packages, and update README (#425) 2026-05-01 09:59:46 -07:00
tectiv3 4382ec3305 iOS/iPad: touch gestures, HUD tap-through, and quick-actions toolbar (#377)
* 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
2026-04-28 23:20:15 -07:00
Mike Klaas b012e62e32 ce-frm2png tool (#419) 2026-04-28 22:55:29 -07:00
Mike Klaas c3fa7107f9 Rename fallout2-dat to ce-dat-tool (#416)
This is a generic tool that works with FO1 and FO2 archives
2026-04-25 10:53:43 -07:00
Vlad KandCopilot efd8a4a525 Fix last remaining warnings in MSVC (#406)
* Fix last remaining warnings in MSVC

* Update CMakeLists.txt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-22 21:04:21 +00:00
Mike Klaas 066595f683 Add Fallout 1 .dat file support to fallout2-dat (#393) 2026-04-20 20:21:19 -07:00
Vlad Kandgithub-actions[bot] fbae40e9a8 Move content-related ddraw.ini settings into new DB config, introduce ce.dat (#387)
* 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>
2026-04-20 20:23:13 +00:00
Mike Klaas dcba8882bf Commandline .dat file viewer (#373) 2026-04-19 15:29:18 -07:00
f1d436b144 Move all HRP settings to fallout2.cfg (#345)
* 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>
2026-04-10 00:40:33 +02:00
Mike Klaas 7079da6e90 Sfall-style Context for metarules (#354) 2026-04-08 21:15:15 -07:00
Mike Klaas b97c9864aa Fix global script loading on non-Windows (#347)
* 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.
2026-04-01 20:20:57 -07:00
Mike Klaas c28c62727f Implement sfall animation opcodes and metarule (#326) 2026-03-30 08:24:57 -07:00
Vlad Kandgithub-actions[bot] 26978dedc5 Hook scripts, related opcodes and some deobfuscation (#312)
* 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>
2026-03-20 11:08:49 +01:00
Vlad 41eafedf87 Fix release standard library used in debug config (#280)
* Fix release standard library used in debug config

* Github Actions: Update MSVC build tools version
2026-02-17 17:54:07 +01:00
APAMk2 0e1270a606 Renamed sfall_behaviours to sfall_callbacks 2025-08-17 23:17:00 +04:00