Compare commits

...
Author SHA1 Message Date
Mike Klaas 6efe7ed869 Implement sfall HOOK_ONGAMEMODECHANGE
Pretty straight forward one
2026-03-19 23:08:19 -07:00
phobos2077 5a71d7c46d opcode: get_sfall_args 2026-03-20 00:26:07 +01:00
github-actions[bot] f7fe0a92d6 chore: auto-format with clang-format 2026-03-19 23:17:34 +00:00
phobos2077 b4756744a7 Add hooks: useobj, useobjon 2026-03-20 00:17:02 +01:00
github-actions[bot] 189361c2cb chore: auto-format with clang-format 2026-03-18 21:58:23 +00:00
phobos2077 094c377637 HOOK_TOHIT 2026-03-18 22:54:30 +01:00
phobos2077 66903073b9 mf_obj_under_cursor + some test script 2026-03-18 22:39:43 +01:00
phobos2077 0c0f0fa423 HOOK_KEYPRESS and first working hooks 2026-03-18 21:00:47 +01:00
phobos2077 2c80f4b1ad ScriptHookCall refactoring and all basic hook script opcode implementation 2026-03-18 13:23:22 +01:00
phobos2077 4c50266aa1 Interpreter: add programPrintError(), Program->procedureCount(), rename string-related functions 2026-03-18 13:22:11 +01:00
phobos2077 be5d8bf4fe Script hooks WIP 2026-03-18 00:49:51 +01:00
phobos2077 caa6ebdea0 Deobfuscate some script-related procedures and flags 2026-03-18 00:49:33 +01:00
phobos2077 3ba666d033 hooks: an empty cc and a list of hook types with useful comments 2026-03-17 20:54:40 +01:00
Vlad K ed23b0f502 Fix crash when trying to run missing combat_p_proc and start is not the first in the script (#310) 2026-03-17 07:38:04 +00:00
Vlad K f0404596d0 Add fallout2.cfg->preferences->ui_anim_speed setting (#305)
* Use ui_anim_speed for fading, dialog panel, combat panel, pipboy rest
2026-03-17 08:33:16 +01:00
Vasilii Rogin 72da5eb879 Merge pull request #308 from fallout2-ce/fix/tile-from-screen-xy-signature
Remove unused elevation from tileFromScreenXY call sites
2026-03-16 22:14:21 +02:00
Vasilii Rogin e0384a37b5 Fix tileFromScreenXY signature cleanup 2026-03-16 18:18:02 +02:00
Vasilii Rogin c8cf50540f Merge pull request #304 from fallout2-ce/remove_unused_elevation_from_tileToScreenXY
Remove unused elevation in tileToScreenXY
2026-03-16 18:09:29 +02:00
Mike KlaasandCopilot Autofix powered by AI ebcd124ba4 Add a few more proto extendedFlags names (#306)
* Add a few more proto extendedFlags

Added a few names based on the list in fallout-tools: https://github.com/rotators/fallout-tools/blob/4a54255f3403e90cff8a20e657df152cb2602a65/F2_ProtoManager/ProtoManager/SetFlagsForm.Designer.vb#L883

Follow up to https://github.com/fallout2-ce/fallout2-ce/pull/301

* Potential fix for pull request finding

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

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-15 23:51:23 +00:00
Mike Klaas 07c55842b4 Enums for proto flags (#301) 2026-03-15 22:43:52 +00:00
Vasilii Rogin 7ad7c43ce6 Remove unused elevation in tileToScreenXY 2026-03-15 20:42:42 +02:00
Mike Klaas c352107b09 Dobfuscate region, game_sound, art (#300) 2026-03-14 22:05:30 -07:00
Mike Klaas b6bfcff9b3 Deobfuscate window_manager, inventory, string_parsers (#299)
Also fix bug in _adjust_fid
2026-03-14 04:45:16 +00:00
Mike Klaas 1df5841810 Update preferences window slider when +/- is pressed (#298)
* Update preferences window slider when +/- is pressed

* do not save brightness when in perferences window
2026-03-13 20:54:31 -07:00
Mike Klaas 98ff03c0b9 Deobfuscations of draw,endgame,interface,preferences (#297)
* Deobfuscations of draw,endgame,interface,preferences

This is _mostly_ mechanical renames.

There are a few other changes:
* Extracted two helper functions
* Added a couple constants that virtually eliminated "magic numbers" in a couple functions
* Switched one int -> bool
* Made sure interfaceGetCurrentHand() is compared against HAND_RIGHT/LEFT instead of treated as boolean

* comment dev by zero issues
2026-03-13 04:14:22 +00:00
Mike Klaas 404236c0cb Deobfuscate audio_file, character_selector, options, dictionary, map, elevator, movie.cc/h (#293)
* Debobfuscate audio_file, character_selector, options, and others

* dictionary, font_manager, nevs

* elevator, map, movie

* item, mp_proto, skill

* proto_instance

* proto, proto_types

* revert dictionary, step -> i

* PR feedback

* criticalChanceModifier -> skillBonus

* skillOrCritSuccessBonus
2026-03-09 05:14:20 +00:00
Mike Klaas 3cd817d4b5 Deobfuscate export,game_movie,random,select_file_list,widget and more (#292)
* Deobfuscate export,game_movie,random,select_file_list,widget

* add automap,cache,display_monitor,game_mouse,geometry,window_manager_pricate

* add static to forward-declared static functions for c++ tidiness
2026-03-01 09:23:04 -08:00
Mike Klaas e8d85dbdd8 Revert to original behaviour in window.cc window existence checks (#291)
revert to original behaviour in window.cc window existence checks

* flagging probably mistaken function
2026-02-28 16:39:56 -08:00
Mike Klaas 3633652884 Rename window* -> scriptWindow* (#288)
* Rename window* -> scriptWindow*

This disambiguates the function names from those in managed_window.cc (which also used window*)

Plus a few items of PR feedback from https://github.com/fallout2-ce/fallout2-ce/pull/286
2026-02-27 05:05:49 +00:00
Mike Klaas e86dce3266 more deobfuscation (#286)
Deobfuscation of several files that were close to complete. There are mechanical renames for the most part. A couple exceptions noted in the changeset
2026-02-22 21:55:37 -08:00
a738c38a81 Function renaming part 2 (#285)
* Rename functions with RE-based names for consistency with new scheme

* Rename sub_* that have equivalents in original source

sub_* names pulled from https://raw.githubusercontent.com/sfall-team/sfall/master/sfall/FalloutEngine/FunctionOffsets_def.h if possible

Per discussion in Discord, sticking with camelCase names

* build fix

* window*

* Rename several more window* functions, add explanatory comment

---------

Co-authored-by: phobos2077 <phobos2077@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad K <phobos2077@users.noreply.github.com>
2026-02-22 16:58:01 +00:00
Vlad Kandgithub-actions[bot] be4569315f Function naming consistency, part 1 (#284)
* Rename functions with RE-based names for consistency with new scheme

* chore: auto-format with clang-format

* Fix typo

* critterHealByHours - better comment

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-22 17:47:45 +01:00
Mike Klaas a2505f8412 Deobfuscate audio/critter/heap.cc (#282)
Mechanical renames only
2026-02-17 22:35:36 -08:00
Mike Klaas 018d3dd48b Deobfuscate datafile.cc/h (#281)
Also, removed unused functions from the .h file

This PR contains only mechanical renames
2026-02-17 22:35:05 -08: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
Vasilii Rogin c914e62f44 Merge pull request #277 from ololoken/emscripten-mouse-touch
[emscripten] do not lock mouse; improve mobile browsers compatibility;
2026-02-17 10:23:20 +02:00
cambragol a478e24c8a Merge pull request #279 from fallout2-ce/context-menu-fix
Update game_mouse.cc to fix context menu
2026-01-31 09:19:39 +09:00
cambragol 2703af882c Update game_mouse.cc to fix context menu
Don't set mouse to new position, set it to the original click point.
2026-01-30 22:27:18 +09:00
Roman Turchin 36e8b90831 [emscripten] do not lock mouse; improve mobile browsers compatibility; 2026-01-27 13:24:20 +01:00
Vasilii Rogin 3249b7dc07 Merge pull request #276 from fallout2-ce/improvements_for_map_edge
Disable hi-res stencil if ignoreMapEdges is enabled
2026-01-25 10:37:23 +02:00
Vasilii Rogin f291f52a61 Merge pull request #275 from fallout2-ce/click_through_fix
Click through fix
2026-01-25 10:32:57 +02:00
Vasilii Rogin 4bc2ed5d0d Show message only once 2026-01-25 10:30:14 +02:00
Vasilii Rogin b6a522a065 Disable stencil on tile_hires_stencil_init 2026-01-25 10:28:40 +02:00
github-actions[bot] bbb01398ef chore: auto-format with clang-format 2026-01-20 18:11:36 +00:00
Vasilii Rogin fb5e1f9c07 Auto-disable stencil if gTileIgnoreMapEdges is enabled 2026-01-20 20:08:50 +02:00
Vasilii Rogin 625928265e Merge pull request #274 from JanSimek/ignore-map-edges
Ignore map edges
2026-01-20 20:03:56 +02:00
Jan Ĺ imek a6ccac2a58 Added IGNORE_MAP_EDGES configuration option to f2_res.ini 2026-01-19 19:23:50 +01:00
cambragol 19e72a5b6d Update inventory.cc
The block here prevents clicking triggering on window close.
2026-01-19 07:42:34 +09:00
cambragol 44f5477ee5 Update input.h
Define the global
2026-01-19 07:40:01 +09:00
cambragol 8d0587566f Update input.cc
Defined the global
2026-01-19 07:38:21 +09:00
cambragol 0ed3725124 Update game_mouse.cc
Adding block for mouse left mouse button up
2026-01-19 07:36:25 +09:00
Jan Ĺ imek 86787e2c97 correct SSL function names in comments 2026-01-18 21:46:20 +01:00
Vasilii Rogin f60b773ed4 Merge pull request #273 from fallout2-ce/add_cities_limit_fix_fallout2-ce
Add sfall CitiesLimitFix to fix Resurrection startup
2026-01-18 22:44:51 +02:00
Vasilii Rogin b6384ce8e9 Merge remote-tracking branch 'roginvs/add_cities_limit_fix' into add_cities_limit_fix_fallout2-ce 2026-01-18 20:11:20 +02:00
Vasilii Rogin 15aa1db286 Revert initialization order of gTownMapHotkeysFix 2026-01-18 20:09:17 +02:00
Vasilii Rogin 763169f33e Merge branch 'main' into add_cities_limit_fix 2026-01-18 19:57:07 +02:00
Vasilii Rogin 58b811f2ae Fix overlapping memory copy (#265) 2025-12-26 15:57:39 +02:00
Vasilii Rogin bfcfaa9540 Fix negative ammo for Mega Power Fist (#267)
* Add non-negative check for ammo

* Rename variables
2025-12-23 20:09:03 +02:00
Vasilii Rogin a478bad7fa Merge pull request #260 from fallout2-ce/allow_lower_mouse_sensivity
Allow lower mouse sensitivity
2025-09-11 18:21:15 +03:00
Vasilii Rogin 9a3ec752dd Fix typo 2025-09-09 20:45:03 +03:00
Vasilii Rogin f940766379 Allow 0.25-2.5 for mouse sensivity 2025-09-09 17:46:42 +03:00
Vasilii Rogin 87e1d1f11b Merge pull request #256 from fallout2-ce/ci_add_wait_for_deployment
Mark CI as done when preview is actually deployed
2025-09-08 08:04:44 +03:00
Vasilii Rogin 5d17e0ef89 Update deployment status AFTER website is actually deployed 2025-09-07 13:05:33 +03:00
Vasilii Rogin 2bf08228c5 Add step to ensure that deployment went well 2025-09-07 12:46:33 +03:00
Mike Klaas 571b43410d Fix crash during encounter (#254)
Initial report: https://github.com/BGforgeNet/Fallout2_Restoration_Project/issues/350, first fixed in sfall.

h/t @NovaRain for the fix!

Fixes #253
2025-08-26 08:36:43 -07:00
APAmk2 f0e6002df9 Merge pull request #252. SFall callbacks implementation. 2025-08-18 21:07:58 +04:00
APAMk2 d593c481f2 Clang-format fix & proper variable name 2025-08-18 21:01:26 +04:00
APAMk2 76f3d82679 Clang-format fixes 2025-08-17 23:26:49 +04:00
APAMk2 0e1270a606 Renamed sfall_behaviours to sfall_callbacks 2025-08-17 23:17:00 +04:00
APAMk2 55a32a00ab SFall callbacks implementation (EXPERIMENTAL) 2025-08-17 20:55:09 +04:00
Vasilii Rogin 7b9b545baa Merge pull request #251 from fallout2-ce/minor-more-deobfus
Yet more deobfuscation
2025-08-17 18:42:10 +03:00
Mike Klaas a96edd9f0c one more 2025-08-17 07:36:45 -07:00
Mike Klaas 55c528f346 fixes 2025-08-17 07:22:45 -07:00
Mike Klaas 5c28dc798f Yet more deobfuscation
Focusing on the files that are "almost" fully deobfuscated.  As usual, no semantic changes
2025-08-17 07:17:45 -07:00
APAmk2 7ef6943588 Merge pull request #249 from APAmk2/png-screenshots
PNG Screenshots implementation
2025-08-17 18:07:41 +04:00
Mike Klaas 40bbd6c02a Minor deobfuscation of function parameters (#250)
No semantic changes, just chipping away at removing placeholder function parameters
2025-08-17 06:56:21 -07:00
APAMk2 45c491c11f Added lodepng license file 2025-08-17 17:02:50 +04:00
APAMk2 18c05d438e Fixed clang-format error
Want to believe
2025-08-17 16:58:51 +04:00
APAMk2 c3a501a644 Changed PngScreenshots option to ScreenshotsFormat for new formats in future 2025-08-17 16:54:09 +04:00
APAMk2 2767a399c5 Moved lodepng to third_party folder 2025-08-17 16:39:31 +04:00
APAMk2 1237d8561d Use std::vector, instead of c-style array 2025-08-17 16:07:04 +04:00
APAMk2 89b6812711 Typo fix 2025-08-17 15:50:51 +04:00
APAMk2 339146c5b3 PNG Screenshots implementation 2025-08-17 15:30:06 +04:00
Vasilii Rogin 3949c5d7c1 Merge pull request #248 from fallout2-ce/use-precise-distance-for-walking
Use path length instead of tile distance for determining walk vs run
2025-08-17 10:16:49 +03:00
github-actions[bot] 84a64035e8 chore: auto-format with clang-format 2025-08-16 11:41:39 +00:00
Mike Klaas 164be5105a Use path length instead of tile distance for determining walk vs run
Fallout tries to be smart about walking vs running: if an object you're interacting with is "close" (<5 tiles), the PC will walk, otherwise, they'll run.

The problem with this is that the distance is calculated "as the crow flies" and doesn't take into account the path length.  So not rarely, your character will end up slowly walking a long distance to interact with an object.

This PR fixes that by using path length instead of tile distance.  This is slightly less performant, but extremely unlikely to ever be noticable.  Regardless, I used actual pathfinding only when the tile distance is short, so it is very unlikely to generate long paths (which, in any case, can happen just by trying to move to that tile).

To test, load the given save file.  Interacting with things on the other side of the wall usually triggers annoying walk behaviour.  E.g.:
* Looting the shelves on the other side of the wall
* Using Steal on the shelves / on an NPC
* Dropping an item on one side then picking it up from the other side.
2025-08-16 04:36:02 -07:00
Vasilii Rogin d532e4c398 Merge pull request #244 from fallout2-ce/fix_uncompressed_database_seek
Fix uncompressed database seek
2025-08-06 08:44:28 +03:00
Vasilii Rogin 950c12dbf7 Merge pull request #245 from fallout2-ce/fix_indexes_in_file_list_init
Fix off-by-one error in duplicates cleanup
2025-08-06 08:41:57 +03:00
Vasilii Rogin 2be9b7db65 Fix off-by-one error in duplicates cleanup 2025-08-05 22:43:27 +03:00
github-actions[bot] 138ce8be9b chore: auto-format with clang-format 2025-08-05 19:14:10 +00:00
Vasilii Rogin 96b9323a97 Add assertion about elements count 2025-08-05 22:09:27 +03:00
Vasilii Rogin 7c6d339e3d Do not initialize zlib on non-compressed files 2025-08-05 22:04:40 +03:00
Vasilii Rogin 2ec8240820 Merge pull request #239 from fallout2-ce/fix_gMapGlobalPointers_resize
Resize gMapGlobalPointers if inconsistency between .map and .gam file
2025-08-05 17:57:45 +03:00
Vasilii Rogin ca72573c14 Merge branch 'main' into fix_gMapGlobalPointers_resize 2025-08-05 09:47:15 +03:00
Vasilii Rogin 9974a23c1e Merge pull request #243 from fallout2-ce/fix-deployments-cleanup
Fix deployments cleanup
2025-08-05 08:39:47 +03:00
Vasilii Rogin cd6cce3f34 Update ci-delete-pr-preview.yml 2025-08-05 08:25:26 +03:00
Vasilii Rogin 361b9a0b30 Merge pull request #242 from fallout2-ce/try_to_use_github_deploy_field
Use deployment action instead of comment
2025-08-05 08:04:39 +03:00
Vasilii Rogin 7c7cb87f65 Merge pull request #238 from fallout2-ce/fix_memory_overlap_with_sound
Do not copy the same string, prevent sanitizer crash
2025-08-05 08:02:29 +03:00
Vasilii Rogin 20bcb2360c Fix env, add prune 2025-08-04 20:48:12 +03:00
Vasilii Rogin 75dbc98321 Add debug: true 2025-08-04 20:38:46 +03:00
Vasilii Rogin d792cfa32e add status 2025-08-04 20:38:16 +03:00
Vasilii Rogin e81a07dcaf Add ref, add deployment_id 2025-08-04 20:33:28 +03:00
Vasilii Rogin 0d78119680 Use deployment action instead of comment 2025-08-04 20:27:47 +03:00
github-actions[bot] 79d0fcfcaa chore: auto-format with clang-format 2025-08-04 16:57:36 +00:00
Vasilii Rogin 2d5e69d740 Resize gMapGlobalPointers if inconsistency between .map and .gam file 2025-08-04 19:51:31 +03:00
Vasilii Rogin b5cf3ee148 Do not copy the same string 2025-08-04 19:16:54 +03:00
Mike Klaas a571a985c6 Use FID_ROTATION macro to remove manual bit shifting (#236)
* Use `FID_ROTATION` macro to remove manual bit shifting

This is a mechanical change.

Note: this uncovered what I'm almost certain is a bug in the interpreter code.  I can fix it based on code inspection... this is how it's used everywhere else.  I'm not confident about reproducing it in game though, so open to thoughts on how to preceed here.

* Fix bugs
2025-07-30 21:27:01 -07:00
cambragol 6ccba74836 Merge pull request #230 from fallout2-ce/cambragol-patch-1
Full Transparency Fix
2025-07-23 11:22:25 +09:00
cambragol 30c3af01f5 Merge pull request #231 from fallout2-ce/cambragol-patch-2
Button Fix for Loadsave.cc
2025-07-23 11:22:01 +09:00
Vasilii Rogin fd25944a9e Merge pull request #235 from fallout2-ce/deobfus-iextra
Deobfuscate one function in interpreter_extra.cc
2025-07-22 21:01:48 +03:00
Vasilii Rogin 41c5d77f89 Merge branch 'main' into deobfus-iextra 2025-07-22 20:55:18 +03:00
cambragol 75513058a5 Merge branch 'main' into cambragol-patch-1 2025-07-23 02:07:04 +09:00
cambragol 0cf55eca75 Merge branch 'main' into cambragol-patch-2 2025-07-23 02:06:51 +09:00
Vasilii Rogin e6cbdd5466 Merge pull request #234 from fallout2-ce/test-cache-bust
Test ci cache busting
2025-07-22 18:48:47 +03:00
github-actions[bot] 90f634b285 chore: auto-format with clang-format 2025-07-22 05:23:02 +00:00
Mike Klaas 666ee6f41c Deobfuscate one function in interpreter_extra.cc
Introduces FID_WEAPON_CODE and FID_ROTATION.  In future PRs we can use these to eliminate a lot of inlined bit shifts
2025-07-21 22:21:06 -07:00
Mike Klaas 4342aefa5d Test ci cache busting 2025-07-21 21:55:00 -07:00
cambragol 7224c7d7fb Button Fix for Loadsave.cc
Fixes two missing button sounds for loadsave
2025-07-20 19:02:56 +09:00
cambragol dff7529707 Full Transparency Fix
Fix to restore full transparency. Without this, transparent windows leave a 'trail' within their frame.
2025-07-20 18:51:55 +09:00
Mike Klaas 2435b33480 Fix missing cursor on the right (mirrored) context menu (#227)
* Fix missing cursor on the right (mirrored) context menu

Fixes #226

* Additional deobfuscation + missing artUnlock)
2025-07-13 20:30:37 -07:00
Vasilii Rogin c4652d799a Merge pull request #220 from fallout2-ce/message-box
`message_box` metarule
2025-07-12 10:46:28 +03:00
Mike Klaas 5140b00ccf Implement show/hide_iface_tag,is_iface_tag_active for vanilla tags (#217)
* Implement `show/hide_iface_tag,is_iface_tag_active` for vanilla tags

This is all that is used by RPU (absent partycontrol mod)
2025-07-10 21:39:28 -07:00
Vasilii Rogin f1ba068d05 Merge pull request #198 from fallout2-ce/add_sfall_metarule_exists_metarule
Add opcode_exists metarule
2025-07-10 19:44:59 +03:00
Mike Klaas 01db7078c7 Decrypt some of tile.cc/h (#211)
Mostly functional changes, but did un-inline one function that Alex indicated likely should be uninlined.
2025-07-10 19:34:18 +03:00
Mike Klaas 64fd857da6 Update README.md for clearer OS X instructions (#223) 2025-06-29 20:47:48 -03:00
cambragol 555652d9c3 Merge pull request #216 from fallout2-ce/window-transparent
Window transparent
2025-06-25 16:11:02 +09:00
cambragol 8c35203b7d Merge branch 'main' into window-transparent 2025-06-24 17:33:06 +09:00
cambragol 0303a00299 Merge pull request #219 from fallout2-ce/trade-and-barter-glitch-fix
Trade/Barter background fix
2025-06-24 14:48:16 +09:00
cambragol dd16e374ee Update main.cc
fixed spelling typo
2025-06-24 14:40:27 +09:00
cambragol ce4495589b Update window_manager.cc
removed unneeded comments
2025-06-24 14:39:36 +09:00
github-actions[bot] af350914ef chore: auto-format with clang-format 2025-06-24 05:14:13 +00:00
Mike Klaas 8dd2afc4fa message_box metarule
This is used by Et Tu and RPU.

Also: some decyption of the underlying dialog box code
2025-06-23 22:11:51 -07:00
github-actions[bot] 240aa8a212 chore: auto-format with clang-format 2025-06-23 22:14:36 +00:00
cambragol c58b5eac1d Update window_manager.cc
Removed unneeded if/else switch.
2025-06-24 07:14:09 +09:00
cambragol 0bd8a76b05 Update inventory.cc
Fix background blits positions for moved inventory items
2025-06-23 22:13:23 +09:00
cambragol 853266b380 Merge branch 'main' into window-transparent 2025-06-23 20:55:44 +09:00
Mike Klaas 0adc9c9e77 Prevent pop-in by drawing city circles/names to temp buffer (#178)
* Draw city/name to a temp buffer to prevent pop-in
2025-06-22 22:48:08 -07:00
github-actions[bot] 150e734955 chore: auto-format with clang-format 2025-06-23 05:27:35 +00:00
cambragol d0ba0151d1 Update window_manager.cc
initialised _buffering as false, and put the switch to true in the if statement for the flag from the game init.
2025-06-23 14:27:07 +09:00
cambragol 67c70661a6 Update window_manager.cc
made _buffering conditional on the gameInitWithOptions flag for allocating _screen_buffer
2025-06-22 12:56:20 +09:00
cambragol 9c4efeb59d Merge branch 'main' into window-transparent 2025-06-22 11:18:20 +09:00
cambragol ea0afc84fa Merge pull request #215 from fallout2-ce/decrypt-win-refresh
Decryption of `_GNW_win_refresh`
2025-06-22 11:03:10 +09:00
Mike Klaas c663d79b97 fix bug(?) 2025-06-21 14:43:10 -07:00
cambragol 8bd87be687 Update window_manager.cc
removed unused bool
2025-06-21 13:51:54 +09:00
cambragol 8101c78e78 Update window_manager.cc
cleaning up from testing code
2025-06-21 13:46:20 +09:00
cambragol 9b5737a14e Update automap.cc
Added WINDOW_TRANSPARENT | WINDOW_DRAGGABLE_BY_BACKGROUND temporarily for testing. The automap window default texture has transparency built in.
2025-06-21 11:31:58 +09:00
cambragol 3d4c073856 Update window_manager.cc
Set _buffering to true, add refresh for transparent windows
2025-06-21 10:19:33 +09:00
cambragol f868ac0e1a Update main.cc
Change game ini options to turn on _screen_buffer allocation
2025-06-21 10:09:19 +09:00
Mike Klaas eaa9091bcd one omre 2025-06-19 23:48:01 -07:00
Mike Klaas 76ab99cf73 add a few more notes 2025-06-19 23:47:42 -07:00
github-actions[bot] bed9555f9a chore: auto-format with clang-format 2025-06-20 06:10:55 +00:00
Mike Klaas 9c5294ca88 Decryption of _GNW_win_refresh 2025-06-19 23:09:16 -07:00
cambragol 781d8ab282 Merge pull request #177 from fallout2-ce/dat-error-handling
Update xfile.cc
2025-06-20 08:44:44 +09:00
cambragol 34ef1c2f26 Merge pull request #213 from fallout2-ce/disappearing-inventory-item-fix
Update inventory.cc
2025-06-18 14:17:52 +09:00
cambragol fdc54cfd0b Update inventory.cc
Restoring fix to make items disappear when selecting in inventory #160
2025-06-18 07:53:59 +09:00
Mike Klaas a63aff09ce (sfall) Implement set_map_time_multi (#207)
* (sfall) Implement `set_map_time_multi`
2025-06-16 12:02:40 -07:00
cambragol 3d2aced2f7 Merge pull request #149 from fallout2-ce/worldmap-fallout1-trail-feature
Worldmap Fallout1 trail Feature
2025-06-12 14:26:27 +09:00
cambragol 1d6111b89f Merge pull request #202 from fallout2-ce/fix-for-splash-screens
Fix for Splash Screens
2025-06-12 14:24:04 +09:00
Mike Klaas 21c906cc5c Implement op_get_world_map_x/y_pos (#205) 2025-06-11 22:16:55 -07:00
Vasilii Rogin a67fe7ead1 Merge pull request #191 from fallout2-ce/scan_scripts_for_unknown_opcodes_2
Scanner of not implemented opcodes, metarules, config options
2025-06-11 16:18:21 +03:00
Vasilii Rogin f0691d2c24 Fix for hooks 2025-06-11 16:00:55 +03:00
github-actions[bot] fb30648e2e chore: auto-format with clang-format 2025-06-11 12:53:54 +00:00
Vasilii Rogin 216cbb3861 Add hooks scan 2025-06-11 15:52:41 +03:00
github-actions[bot] be63df4bf6 chore: auto-format with clang-format 2025-06-11 12:10:59 +00:00
Vasilii Rogin 4cf35fd946 Enable scanner of unimplemented by command line argument 2025-06-11 15:10:27 +03:00
Vasilii Rogin dd418ee0f5 Merge branch 'main' into scan_scripts_for_unknown_opcodes_2 2025-06-11 14:47:56 +03:00
Mike Klaas eb5cc7be4f QoL: Ctrl-click to equip in inventory screen (#175)
Very similar to sfall's implementation.
2025-06-10 22:27:22 -07:00
Vasilii Rogin 8c6f28b018 Merge pull request #193 from fallout2-ce/update_sdl2_into_2_32_8
Update SDL2 into 2.32.8
2025-06-10 11:17:26 +03:00
Vasilii Rogin 2e36030389 Merge branch 'main' into update_sdl2_into_2_32_8 2025-06-09 23:19:02 +03:00
Mike Klaas a88ca9f7e7 Fix build warnings introduced by sfall opcodes/metarules (#201) 2025-06-09 08:26:47 -07:00
Mike Klaas 72d9ae85c8 sfall: get_ini_section(s) (#199)
Implements get_ini_section, needed for Et Tu, and get_ini_sections. Fixes buggy set_ini_setting.

Also includes tests for existing ini functions, and moves them all to sfall_init.cc. (opcodes and metarules files were getting long, and this matches sfall's structure)
2025-06-09 08:26:30 -07:00
cambragol a8f2de1a56 Update xfile.cc
removed redundant chdir and added final cleanup for failure
2025-06-09 21:09:15 +09:00
github-actions[bot] 51b82ac1ac chore: auto-format with clang-format 2025-06-09 11:37:04 +00:00
cambragol 0d97222797 Update game.cc
Load options before show splash, so brightness is correct
2025-06-09 20:34:22 +09:00
cambragol b30463ab01 Update svga.cc
Missing fix for Splash Screens courtesy of Alex
2025-06-09 20:31:29 +09:00
github-actions[bot] 9d932b0d2c chore: auto-format with clang-format 2025-06-09 10:25:20 +00:00
Vasilii Rogin 8d76b9655c Use custom to_lower 2025-06-09 13:24:51 +03:00
Vasilii Rogin 0e6c4d9684 Use custom comparator 2025-06-09 13:01:03 +03:00
Vasilii Rogin 02c5efac26 Merge remote-tracking branch 'fallout2-ce/main' into scan_scripts_for_unknown_opcodes_2 2025-06-09 12:52:29 +03:00
cambragol b7933f6b80 Merge pull request #159 from fallout2-ce/inventory-character-display-fix
Fix Backgrounds on Spinning Characters
2025-06-09 17:03:46 +09:00
cambragol fcb1680db2 Merge pull request #144 from fallout2-ce/Localize-Fonts
Localize fonts
2025-06-09 17:03:23 +09:00
github-actions[bot] ea4d978bc1 chore: auto-format with clang-format 2025-06-08 06:48:28 +00:00
Vasilii Rogin 22548a3c70 Merge branch 'main' into scan_scripts_for_unknown_opcodes_2 2025-06-08 09:47:58 +03:00
Vasilii Rogin 7767aabdce Merge pull request #197 from fallout2-ce/change_stencil_option
Change high resolution stencil option
2025-06-08 09:46:34 +03:00
Vasilii Rogin 9cb2b83db1 Merge pull request #185 from fallout2-ce/improve_tests_report
Use global variables and arrays to show tests summary
2025-06-07 20:45:11 +03:00
Vasilii Rogin 75ca12e07c Improve tests reporting 2025-06-07 19:06:48 +03:00
Vasilii Rogin f85e8ba67b Use lowercase for test results 2025-06-07 18:54:56 +03:00
Vasilii Rogin 07876ddaf9 Use arrays for sharing data between tests 2025-06-07 18:51:56 +03:00
Vasilii Rogin 7288f8eeb7 Merge remote-tracking branch 'fallout2-ce/main' into improve_tests_report 2025-06-07 18:27:45 +03:00
github-actions[bot] cd6ca76988 chore: auto-format with clang-format 2025-06-07 15:27:27 +00:00
Vasilii Rogin 5d3cbd567a Add test for OP_WRITE_INT opcode 2025-06-07 18:24:56 +03:00
Vasilii Rogin 70ef1d4009 Add opcode_exists metarule 2025-06-07 18:21:50 +03:00
Vasilii Rogin 3acf0ac6c4 Add assert for opcode_exists 2025-06-07 18:12:43 +03:00
Vasilii Rogin a73c336ead Add tests for metarule_exist/opcode_exists 2025-06-07 18:08:47 +03:00
Vasilii Rogin d46aea53bd Add initial test 2025-06-07 17:59:18 +03:00
Vasilii Rogin 1a46d0f59f Make EnableHighResolutionStencil enabled by default in proper place 2025-06-07 17:40:11 +03:00
Vasilii Rogin 7c2dfa9af1 Change HiResMode into EnableHighResolutionStencil 2025-06-07 17:38:12 +03:00
Vasilii Rogin 3dc89d49e2 Merge branch 'main' into scan_scripts_for_unknown_opcodes_2 2025-06-07 12:43:50 +03:00
Vasilii Rogin 822d5dfd7d Do not use build-in directory_iterator for android 2025-06-07 12:37:14 +03:00
Vasilii Rogin 879634bf9c Remove import of dirent 2025-06-07 12:28:29 +03:00
Vasilii Rogin d681e7be69 Merge pull request #192 from fallout2-ce/toggle-active-hand
Add `toggle_active_hand` (sfall)
2025-06-07 12:23:06 +03:00
Vasilii Rogin 795ef54d70 fix formatting 2025-06-07 12:21:45 +03:00
Vasilii Rogin 14b06d2dcc Add scan for windows 2025-06-07 12:21:20 +03:00
Vasilii Rogin ed959edbbb Split scanned by files 2025-06-07 12:15:26 +03:00
Vasilii Rogin 7940ea791c Add polyfill for directory_iterator 2025-06-07 11:19:53 +03:00
Vasilii Rogin 3f270aa4cc Merge branch 'main' into scan_scripts_for_unknown_opcodes_2 2025-06-07 11:10:41 +03:00
Mike Klaas 8294e15d3c Default to 800px interface bar (#181)
(still can be overriden by config)

Will fall back to 640px version if screen is narrower than 800px or asset doesn't exist
2025-06-06 21:07:11 -07:00
Mike Klaas 4278d1a1d0 fix crash 2025-06-06 20:54:24 -07:00
Vasilii Rogin b8769fded1 Bump CI cache 2025-06-06 21:30:38 +03:00
Vasilii Rogin 43d5b6028d Update SDL2 into 2.32.8 2025-06-06 21:21:53 +03:00
Mike Klaas b2675ad1ac Add toggle_active_hand (sfall) 2025-06-06 00:34:36 -07:00
Vasilii Rogin da3f1cc426 Fixes 2025-06-04 21:25:47 +03:00
github-actions[bot] a892461dac chore: auto-format with clang-format 2025-06-04 17:56:15 +00:00
Vasilii Rogin 209d2d027b Add TODO 2025-06-04 20:52:25 +03:00
Vasilii Rogin b8385d7775 Do not exit 2025-06-04 20:45:16 +03:00
Vasilii Rogin a3c365f9fe Rename scanner 2025-06-04 20:44:53 +03:00
Vasilii Rogin 87d4a4b8ca Scan f2_res.ini 2025-06-04 20:41:37 +03:00
Vasilii Rogin 1aa53a4720 Add scan for fallout2.cfg 2025-06-04 20:31:32 +03:00
Vasilii Rogin 6bcf2952f6 Add config scan 2025-06-04 20:26:40 +03:00
Vasilii Rogin e2927e1d0e Some intermedite progress 2025-06-04 20:00:26 +03:00
Vasilii Rogin bb839cd6c1 some fixes & improvements 2025-06-04 19:34:56 +03:00
Vasilii Rogin caa0e1bf1a Add scan in .dat files 2025-06-04 19:08:27 +03:00
Vasilii Rogin f3759d07a5 Adding .dat files scan 2025-06-04 18:58:43 +03:00
Vasilii Rogin 604fde895f Split by funcs 2025-06-04 18:45:46 +03:00
Vasilii Rogin f46c391e5d Merge remote-tracking branch 'fallout2-ce/main' into scan_scripts_for_unknown_opcodes_2 2025-06-03 23:06:35 +03:00
Vasilii Rogin 5dafa019c9 Merge pull request #190 from fallout2-ce/all-opcodes
Reformat sfall opcode list to contain all opcodes
2025-06-03 20:10:25 +03:00
Mike Klaas 8888fc46d6 Reformat sfall opcode list to contain all opcodes
This pulls in every sfall opcode, including param types and returnval.  It is grouped in a more "natural" order (i.e. what the sfall doc lists) instead of numeric order, which helps see which opcodes from a logical group are missing
2025-06-03 08:56:16 -07:00
Mike Klaas 001bdbee5c Add all remaining sfall math functions (#187)
* Add all remaining sfall math functions

* Fix op_round
2025-06-03 08:06:29 -07:00
Vasilii Rogin 1e45b0184b Merge remote-tracking branch 'fallout2-ce/main' into scan_scripts_for_unknown_opcodes_2 2025-06-02 21:10:35 +03:00
Vasilii Rogin 40471e5a0b Merge pull request #186 from fallout2-ce/experiment_with_gh-pages_cleanup
Add single-commit option for preview deployments
2025-06-02 21:00:24 +03:00
Vasilii Rogin ad776876a1 Add check that it is gh-pages branch 2025-06-02 20:53:30 +03:00
Vasilii Rogin 224f1088f2 Also force-push to gh-pages on PR cleanup 2025-06-02 20:52:46 +03:00
Vasilii Rogin 05b692f403 Add single-commit option for preview deployments 2025-06-02 20:43:56 +03:00
Vasilii Rogin 190906bb5f Use global variables to show tests summary 2025-06-02 18:31:40 +03:00
Vasilii Rogin 447ea23862 Merge remote-tracking branch 'fallout2-ce/main' into scan_scripts_for_unknown_opcodes_2 2025-06-02 17:55:56 +03:00
Mike Klaasandgithub-actions[bot] 41dd2ccd81 Implement all remaining sfall string functions (#184)
Implement string_to_case, and add comments for missing metarules/opcodes
    string_find
    string_compare
    charcode

This should complete all string functions listed here that aren't deprecated.


* chore: auto-format with clang-format

* PR feedback

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-02 10:12:25 +03:00
Vasilii Rogin 72786c4d43 Merge remote-tracking branch 'fallout2-ce/main' into scan_scripts_for_unknown_opcodes_2 2025-06-01 20:04:07 +03:00
Vasilii Rogin 04e93cabd7 Merge pull request #183 from fallout2-ce/add_sprintf
Add sprintf, add test utils
2025-06-01 20:03:04 +03:00
Vasilii Rogin a31af0671d Use .h for test utils 2025-06-01 19:54:25 +03:00
Vasilii Rogin 72df28f53a Use const to reduce warnings 2025-06-01 17:07:13 +03:00
github-actions[bot] 7e3bd36f86 chore: auto-format with clang-format 2025-06-01 14:03:26 +00:00
Vasilii Rogin 94ce0fbe11 Merge remote-tracking branch 'fallout2-ce/main' into add_sprintf 2025-06-01 17:01:28 +03:00
Vasilii Rogin a368f27ad4 Add one more byte to be safe 2025-06-01 16:56:12 +03:00
Vasilii Rogin d8d411e847 Add test for big strings 2025-06-01 16:53:29 +03:00
Vasilii Rogin 5eef9af7a9 Add one more test 2025-06-01 16:46:20 +03:00
Vasilii Rogin 0419efad8f Add sprintf 2025-06-01 16:42:42 +03:00
Vasilii Rogin 21f432afbb Register opcode 2025-06-01 16:13:37 +03:00
Vasilii Rogin aed05c0daf Initial implemenation of sprintf 2025-06-01 16:10:12 +03:00
Vasilii Rogin 8a8b54d4b7 Increase metarules params to 8 2025-06-01 15:30:13 +03:00
Vasilii Rogin 8ee543ec16 Add tests for metarules with multiple params 2025-06-01 15:27:42 +03:00
Vasilii Rogin 161bb82f30 Slightly better output for tests 2025-06-01 14:08:18 +03:00
Vasilii Rogin 22bd1ffbba Small cleanup in tests 2025-06-01 13:57:29 +03:00
Vasilii Rogin f46f1c78d4 Add test for string_format 2025-06-01 13:15:58 +03:00
Vasilii Rogin 3d0e206825 Add tests for float 2025-06-01 13:01:14 +03:00
Vasilii Rogin 47a9891e0e Add test for %c 2025-06-01 12:58:51 +03:00
Vasilii Rogin f1e5cde84f Add tests for sprintf 2025-06-01 12:56:45 +03:00
Vasilii Rogin 015909fdef Use lowercase for scripts 2025-06-01 12:47:30 +03:00
Vasilii Rogin 1e91b401f1 Fix stats test 2025-06-01 12:31:23 +03:00
Vasilii Rogin 29a0be50f4 Update stats test 2025-06-01 12:28:23 +03:00
Vasilii Rogin 9e3ce4cd8d Fix stats test 2025-06-01 12:22:33 +03:00
Vasilii Rogin 592882b7b8 Adding tests 2025-06-01 12:18:12 +03:00
Vasilii Rogin 3d3e47c9db Scan for .int.expected too 2025-06-01 11:56:22 +03:00
Vasilii Rogin a9726cab56 Show by-file 2025-06-01 11:21:18 +03:00
Vasilii Rogin 400aa4d8a3 Update visual 2025-06-01 11:11:46 +03:00
Vasilii Rogin cbd7b45736 Merge pull request #182 from fallout2-ce/add_test_script_for_sfall_opcodes
Add test for derived stats
2025-06-01 10:47:45 +03:00
Vasilii Rogin 599d3ab392 Merge remote-tracking branch 'fallout2-ce/main' into scan_scripts_for_unknown_opcodes_2 2025-06-01 10:46:24 +03:00
Vasilii Rogin 84336d4655 Fix warning 2025-06-01 10:45:49 +03:00
Vasilii Rogin 220fb8e190 Add test for derived stats 2025-06-01 10:39:43 +03:00
Vasilii Rogin 5a29fc1815 Merge pull request #180 from fallout2-ce/make-sfall-opcodes-consistent
Rename sfall opcodes to use underscores for consistency.
2025-06-01 09:36:53 +03:00
Mike Klaas a083779fb2 Rename sfall opcodes to use underscores for consistency.
This also makes them significantly easier to find in the codebase
2025-05-31 14:11:32 -07:00
Vasilii Rogin 95d254cd45 Merge pull request #179 from fallout2-ce/add_test_script_for_sfall_opcodes
Add critter stats opcodes
2025-05-31 23:32:22 +03:00
Vasilii Rogin 0d8f4cc711 Merge branch 'main' into add_test_script_for_sfall_opcodes 2025-05-31 23:11:27 +03:00
Vasilii Rogin aabc971dd5 Merge pull request #176 from fallout2-ce/update_windows_runner
Update windows runner
2025-05-31 23:11:06 +03:00
Vasilii Rogin 696e926177 Add note 2025-05-31 22:57:37 +03:00
Vasilii Rogin 30babd7e1f Improvements 2025-05-31 22:47:51 +03:00
Vasilii Rogin 6ff0b411e4 Show opcode cmd name 2025-05-31 22:26:16 +03:00
Vasilii Rogin 9f623f3f3e Add sfall human-readable opcodes 2025-05-31 22:09:52 +03:00
Vasilii Rogin d8bee457f4 Improve scanner 2025-05-31 22:04:14 +03:00
Vasilii Rogin fcabd63561 Still scanning for strings 2025-05-31 22:00:18 +03:00
Vasilii Rogin 73c024c705 Make kMetarules available 2025-05-31 21:09:19 +03:00
Vasilii Rogin 27da084b65 Scanning opcodes 2025-05-31 21:00:59 +03:00
Vasilii Rogin dfa610f352 Adding script scanner 2025-05-31 20:57:27 +03:00
Vasilii Rogin a0a597725a Fix extensions scan 2025-05-31 20:47:23 +03:00
Vasilii Rogin 7ae194a8ee Adding .ssl scanner 2025-05-31 20:44:30 +03:00
Vasilii Rogin b069e3b941 Update testing script 2025-05-31 20:06:25 +03:00
Vasilii Rogin 823f72492f Implement critter stat opcodes 2025-05-31 20:06:16 +03:00
Vasilii Rogin e5f3734e08 Add opcodes 2025-05-31 19:57:52 +03:00
Vasilii Rogin e37522d388 Add test for critter stats set/get 2025-05-31 19:51:37 +03:00
Vasilii Rogin 07a361f63a Add float_msg 2025-05-31 19:32:01 +03:00
Vasilii Rogin 515bec4c82 Adding simple test for stats 2025-05-31 18:34:56 +03:00
Vasilii Rogin 42bfdc7343 Update testing docs to use global scripts 2025-05-31 16:57:51 +03:00
Vasilii Rogin 0fd5e59575 Remove choco cache because it does not work properly 2025-05-31 15:01:02 +03:00
Vasilii Rogin 0d0578f111 Revert "Add --force flag to re-install in case of used cache"
This reverts commit dacda99b98.
2025-05-31 14:59:33 +03:00
Vasilii Rogin dacda99b98 Add --force flag to re-install in case of used cache 2025-05-31 14:56:39 +03:00
Vasilii Rogin dfb0463b02 Add arch into choco cache 2025-05-31 14:34:53 +03:00
Vasilii Rogin 1903e04c6e Update release workflow too 2025-05-31 14:25:49 +03:00
Vasilii Rogin abec3681b0 Use win2025 with vs2019 2025-05-31 14:14:18 +03:00
cambragol 7f7e103465 Update xfile.cc
This removes the creation of a 'dat' folder when opening or path finding fails. This may have been a leftover from development, or part of the mapper, however, in practice it prevents users getting correct error messages when opening the app with missing dats or incorrect dat paths.

With this fix, missing dats or paths should give a popup message to the user, instead of the ubiquitous 'cannot find fonts error'
2025-05-31 10:58:28 +09:00
cambragol 5a9f8fb46c Merge pull request #164 from fallout2-ce/character-screen-button-fix
Character Screen Button Fix
2025-05-31 10:03:03 +09:00
cambragol 721e40f784 Merge branch 'main' into inventory-character-display-fix 2025-05-31 09:56:20 +09:00
cambragol 3659c834ae Merge pull request #166 from fallout2-ce/animations-behind-worldmap-fix
Animations behind worldmap fix
2025-05-31 09:54:19 +09:00
Mike Klaas 196553ec46 Don't crash if game resolution is <800 with custom interface bar (#174)
* Don't crash if game resolution is <800 with custom interface bar
2025-05-29 22:52:26 -07:00
Mike Klaas 57f1229a51 Add click when using a to Take all or move All (#169)
Most other button make a sound when you use the keyboard shortcut, and so ought these
2025-05-29 15:22:34 -07:00
Mike Klaasandgithub-actions[bot] 413c843ff5 Fix bug that stopped music when reloading on the same map (#168)
* Fix bug that stopped music when reloading on the same map

If you have GaplessMusic=1 and load a saved game on the same map you're currently on, we erroneously skip playing music.  This fixes that problem.

Also, still playing loading sound if no background music is playing (not sure there can actually happen).  I still want to get the loading sound back in eventually.

Finally, added a bit of decyption.  It's not complete yet but has some deciphering

* chore: auto-format with clang-format

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-29 00:21:29 -07:00
cambragol 995102d515 Update worldmap.h
removed unneeded global
2025-05-29 16:08:38 +09:00
cambragol dd867446ea Update worldmap.cc
removed unneeded global
2025-05-29 16:07:48 +09:00
cambragol 4f91e38cc0 Update animation.cc 2025-05-29 16:05:53 +09:00
cambragol 016c83bc48 Inventory Item not Disappearing Fix (#161)
Fixes #160 

Conditional was incorrect.
2025-05-28 21:58:23 -07:00
github-actions[bot] 59c64451ff chore: auto-format with clang-format 2025-05-28 22:40:35 +00:00
cambragol 965f360578 Update worldmap.cc
Enclosed trail logic in config option
2025-05-29 07:40:09 +09:00
cambragol 3f79d79f25 Update sfall_config.h
Config option for worldmap trails. Name is from an Sfall option (I believe): WorldMapTravelMarkers
2025-05-29 07:19:31 +09:00
github-actions[bot] cad023a73e chore: auto-format with clang-format 2025-05-28 22:18:21 +00:00
cambragol 7490c900b3 Update sfall_config.cc
adding config option for the worldmap trail
2025-05-29 07:17:55 +09:00
cambragol d8dc05597b Update worldmap.cc
Fixed placement of  inWorldMap = true; and inWorldMap = false; Was preventing animations outside of worldmp.
2025-05-27 19:49:44 +09:00
github-actions[bot] 7d9e1612c6 chore: auto-format with clang-format 2025-05-27 08:42:47 +00:00
cambragol 848bd97e42 Update animation.cc
Check for 'isWorldMapActive', so we know to turn off fidget animation behind the map.
2025-05-27 17:39:08 +09:00
cambragol 5c5512277d Update worldmap.cc
Adding global for inWorldMap - so we know if the world map is active or not.
2025-05-27 17:37:22 +09:00
cambragol 016f853c0a Update worldmap.h
Adding a bool for 'inWorldMap' to fix animations behind worldmap
2025-05-27 17:32:01 +09:00
cambragol 9edbf0dd72 Update character_editor.cc
Adjusted the correct button x coordinates. Previously had adjusted the x coordinates of the button labels.
2025-05-27 14:25:28 +09:00
cambragol 36af4b2ea8 Update character_editor.cc
Moved 3 bottom buttons 1 pixel to right. Affects both screens, and aligns them better to the baked in buttons.
2025-05-26 21:33:45 +09:00
github-actions[bot] 67a6119f34 chore: auto-format with clang-format 2025-05-26 07:36:34 +00:00
cambragol aa036c574e Update inventory.cc
Added some comments regarding which window is which
2025-05-26 16:36:06 +09:00
github-actions[bot] a17d7fb7d5 chore: auto-format with clang-format 2025-05-25 11:07:47 +00:00
cambragol 8ed777ba83 Merge branch 'main' into Localize-Fonts 2025-05-25 19:53:57 +09:00
Vasilii Rogin 145cf6bbcc Merge pull request #157 from fallout2-ce/deobfus-window-2
More deobfuscation in `window.cc,h`
2025-05-25 08:59:40 +03:00
Mike Klaas 5b39307f61 More deobfuscation in window.cc,h
As usualy, no logic changes
2025-05-24 22:45:21 -07:00
Vasilii Rogin 547cabc42d Merge pull request #153 from roginvs/auto-fix-formatting-on-main-branch
Auto fix formatting on main branch or PR branch
2025-05-24 17:34:47 +03:00
Vasilii Rogin d2a3d61dcb Trying auto-format 2025-05-24 14:16:53 +03:00
Vasilii Rogin 2d1966f0af Adding manual workflow 2025-05-24 13:56:48 +03:00
Vasilii Rogin a406c5f019 CI fixes 2025-05-24 13:43:31 +03:00
Vasilii Rogin 9ca540f05e Auto-format only PRs from the same repo 2025-05-24 13:32:12 +03:00
Vasilii Rogin 4678e19edd Add formatter for PR too 2025-05-24 13:31:06 +03:00
Vasilii Rogin 485d2253f4 Add auto-formatting workflow 2025-05-24 13:29:16 +03:00
Mike Klaas 72309fc9dc Deobfuscate some parameters in window.h,cc (#152)
Note: no logic changes

Removed a parameter which was never used
2025-05-23 23:45:05 -07:00
cambragol fda6fd0646 Update game_dialog.cc (#139)
* Update game_dialog.cc

* Update game_dialog.cc

* Update game_dialog.cc
2025-05-23 21:24:59 -07:00
Mike Klaas 2126e23161 QoL: Add Ctrl-click to move items in inventory, barter, looting/stealing (#133)
* Add Ctrl-click to move items in inventory, barter, looting/stealing

Barter: move from table (offer) to inventory, on both merchant and pc.
Looting/stealing: move from one side to the other.
Inventory: ctrl-click to unequip armor or item in hand.

Modeled after the SFALL feature.

* skip quantity selection when quick moving

* Add `a` to inventory quantity select screen as a quick way to select ALL

* format

* Add Readme changes, and `a` to `Take All`

* try to format

* fmt
2025-05-24 13:06:41 +09:00
Vasilii Rogin 0fa90a1a00 Merge pull request #140 from fallout2-ce/add_test_script_for_sfall_opcodes
Add test script for sFall opcodes
2025-05-23 22:43:21 +03:00
Vasilii Rogin 9bfc3e83cd Add fix_formatting script 2025-05-23 22:34:41 +03:00
Vasilii Rogin 2f974aefed Fix formatting 2025-05-23 22:29:47 +03:00
Vasilii Rogin b27093b7ac Merge remote-tracking branch 'fallout2-ce/main' into add_test_script_for_sfall_opcodes 2025-05-23 22:29:26 +03:00
Vasilii Rogin 6f240acf0a Fix typo 2025-05-23 21:35:20 +03:00
cambragol 7c182b66a6 Update worldmap.cc
tweaked the drop parameters - looks closer to Fallout 1, paths more clearly defined (speeds).
2025-05-23 23:15:44 +09:00
cambragol f6320d3a66 Update worldmap.cc
Removed 'scaled' variables (leftover from my personal builds)
scaledViewWidth, scaledViewHeight, scaledWidth, scaledViewY, and scaledViewX
2025-05-23 20:03:32 +09:00
cambragol 5dbcfd997c Fixes slightly misaligned buttons in the pipboy (#147) 2025-05-22 23:17:07 -07:00
cambragol ec2ecd17d9 Update inventory.cc
First pass on fix for #148 

Adds correct blitting backgrounds for behind the spinning character
2025-05-23 15:13:07 +09:00
cambragol de06827c01 Update worldmap.cc
First draft (after many different tries) of worldmap trail enhancement, like in Fallout 1. Meant to be optional in the end.
2025-05-23 14:45:09 +09:00
cambragol e3437a8d0e Merge branch 'main' into Localize-Fonts 2025-05-21 09:26:38 +09:00
cambragol f12babe525 Update text_font.cc 2025-05-20 14:45:07 +09:00
cambragol cb990ac154 Update font_manager.cc 2025-05-20 14:44:33 +09:00
cambragol a3fc8d21be Update text_font.cc 2025-05-20 14:36:33 +09:00
cambragol cc805db194 Update font_manager.cc 2025-05-20 14:35:37 +09:00
Vasilii Rogin a3d37e11c1 Update README 2025-05-18 22:49:32 +03:00
Vasilii Rogin 0e18e77901 Fix formatting 2025-05-18 18:43:07 +03:00
Vasilii Rogin 9d2db5b36a Remove note 2025-05-18 16:17:25 +03:00
Vasilii Rogin b88230426d Update README 2025-05-18 16:14:40 +03:00
Vasilii Rogin bbf52f6b2d Add testing information 2025-05-18 15:51:25 +03:00
Vasilii Rogin 89a9d1ae12 Add initial version of test scripts 2025-05-18 15:15:28 +03:00
Vasilii Rogin 41a7c97e69 Show warning if cities amount differs 2024-06-04 20:56:42 +03:00
Vasilii Rogin 2ca921c525 Revert "Remove cities amount check on game load"
This reverts commit e676089f83.
2024-06-04 20:50:03 +03:00
Vasilii Rogin e676089f83 Remove cities amount check on game load 2024-06-04 19:43:37 +03:00
Vasilii Rogin e119aa4c4d Use cities limit patch by default 2024-04-19 12:55:51 +03:00
Vasilii Rogin ea66287551 Load gCitiesLimitFix state before it is used 2024-04-18 23:23:41 +03:00
Vasilii Rogin db07e95f5b Use gCitiesLimitFix variable 2024-04-18 23:10:56 +03:00
Vasilii Rogin acd0413626 Check that save file have the same amount of cities 2024-04-18 23:02:22 +03:00
Vasilii Rogin 196ad2267f Fix formatting 2024-04-18 22:59:24 +03:00
Vasilii Rogin 22a864a0c9 Ignore cities count if CitiesLimitFix is enabled 2024-04-18 22:55:17 +03:00
Vasilii Rogin 252d7fe83e Add CitiesLimitFix into sFall config with default=true 2024-04-18 22:51:45 +03:00
186 changed files with 18062 additions and 3625 deletions
+42
View File
@@ -0,0 +1,42 @@
name: Auto Format with Clang
on:
pull_request:
types: [opened, synchronize]
push:
branches: [main]
jobs:
format:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.PAT_FOR_ACTIONS }}
- name: Run clang-format via Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/app --workdir /app \
--user $(id -u):$(id -g) silkeh/clang:18 \
bash -c 'find src -type f \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 clang-format -i'
# https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-to-a-pr-using-the-built-in-token
- name: Check and commit changes if needed
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet; then
git diff
git commit -am "chore: auto-format with clang-format"
git push
else
echo "No formatting changes"
fi
+47 -5
View File
@@ -14,6 +14,16 @@ jobs:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: start deployment
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: bobheadxi/deployments@v1
id: deployment
with:
ref: ${{ github.event.pull_request.head.sha }}
step: start
debug: true
env: preview-${{ github.event.pull_request.number }}
- name: Clone
uses: actions/checkout@v4
@@ -76,6 +86,10 @@ jobs:
SITE_BASE: ${{ steps.set-path.outputs.SITE_BASE }}
F2_GAME_VERSION: Game=${{github.event.pull_request.head.sha || github.sha }}
- name: Place hash file
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
run: echo "$GITHUB_SHA" > fallout2-ce-ems/dist/site_hash.txt
- name: Install rsync (required for the next step)
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
run: |
@@ -89,11 +103,39 @@ jobs:
folder: fallout2-ce-ems/dist
target-folder: ${{ steps.set-path.outputs.DEST_DIR }}
clean: false
single-commit: true
- name: Comment preview URL on PR
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
- name: Check that site is deployed
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
run: |
gh pr comment ${{ github.event.pull_request.number }} \
--body "🚀 WebAssembly PR Preview for ${{github.event.pull_request.head.sha || github.sha }} is available at: https://${{ github.repository_owner }}.github.io/fallout2-ce/PR-${{ github.event.pull_request.number }}/"
URL="$SITE_ORIGIN""$SITE_BASE""site_hash.txt"
echo "Expecting $GITHUB_SHA from $URL"
for i in `seq 1 80`; do
got="$(curl -fsSL --max-time 10 "$URL" | tr -d '\r\n' || true)"
if [ "$got" = "$GITHUB_SHA" ]; then
echo "âś… Match on attempt $i: ${got}"
exit 0
fi
echo "Received $got, waiting"
sleep 5
done
exit 1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SITE_ORIGIN: https://${{ github.repository_owner }}.github.io
SITE_BASE: ${{ steps.set-path.outputs.SITE_BASE }}
- name: Update deployment status
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: bobheadxi/deployments@v1
with:
step: finish
status: success
debug: true
env: ${{ steps.deployment.outputs.env }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
ref: ${{ github.event.pull_request.head.sha }}
env_url: https://${{ github.repository_owner }}.github.io/fallout2-ce/PR-${{ github.event.pull_request.number }}/
+18 -9
View File
@@ -87,7 +87,7 @@ jobs:
uses: actions/cache@v4
with:
path: os/android/app/.cxx
key: android-cmake-v2
key: android-cmake-v101
- name: Setup signing config
if: env.KEYSTORE_FILE_BASE64 != '' && env.KEYSTORE_PROPERTIES_FILE_BASE64 != ''
@@ -128,7 +128,7 @@ jobs:
uses: actions/cache@v4
with:
path: out
key: ios-cmake-v5
key: ios-cmake-v101
- name: Configure
run: |
@@ -183,7 +183,7 @@ jobs:
uses: actions/cache@v4
with:
path: out
key: linux-${{ matrix.arch }}-cmake-v3
key: linux-${{ matrix.arch }}-cmake-v101
- name: Configure
run: |
@@ -288,7 +288,7 @@ jobs:
uses: actions/cache@v4
with:
path: out
key: macos-cmake-v6
key: macos-cmake-v101
- name: Configure
run: |
@@ -313,7 +313,7 @@ jobs:
windows:
name: Windows (${{ matrix.arch }})
runs-on: windows-2019
runs-on: windows-2025
strategy:
fail-fast: false
@@ -328,19 +328,28 @@ jobs:
- name: Clone
uses: actions/checkout@v4
- name: Install Visual Studio 2022 Build Tools with v141_xp
shell: cmd
run: |
choco install visualstudio2022buildtools -y --package-parameters="'--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.10240 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --add Microsoft.VisualStudio.Component.WinXP'"
- name: Cache cmake build
uses: actions/cache@v4
with:
path: out
key: windows-${{ matrix.arch }}-cmake-v2
key: windows-${{ matrix.arch }}-cmake-v102
- name: Configure
shell: cmd
run: |
cmake --preset windows-${{ matrix.arch }}
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
&& cmake --preset windows-${{ matrix.arch }}
- name: Build
shell: cmd
run: |
cmake --build --preset windows-${{ matrix.arch }}-release
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
&& cmake --build --preset windows-${{ matrix.arch }}-release
- name: Change executable file name
run: |
@@ -423,4 +432,4 @@ jobs:
tag_name: continious
draft: false
prerelease: true
name: Fallout2-CE Continuous Build
name: Fallout2-CE Continuous Build
+24 -2
View File
@@ -12,6 +12,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
@@ -29,5 +30,26 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "đźš® Remove preview for closed PR #${{ github.event.pull_request.number }}"
git push
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: $CURRENT_BRANCH"
if [ "$CURRENT_BRANCH" != "gh-pages" ]; then
echo "❌ Refusing to force-push to non-gh-pages branch: $CURRENT_BRANCH"
exit 1
fi
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit --amend -m "đźš® Remove preview for closed PR #${{ github.event.pull_request.number }}"
git push --force
fi
- name: mark environment as deactivated
uses: bobheadxi/deployments@v1
with:
step: deactivate-env
env: preview-${{ github.event.pull_request.number }}
desc: Environment was pruned
debug: true
+12 -10
View File
@@ -243,7 +243,7 @@ jobs:
windows:
name: Windows (${{ matrix.arch }})
runs-on: windows-2019
runs-on: windows-2025
strategy:
fail-fast: false
@@ -258,6 +258,11 @@ jobs:
- name: Clone
uses: actions/checkout@v4
- name: Install Visual Studio 2019 Build Tools with v141_xp
shell: cmd
run: |
choco install visualstudio2019buildtools -y --package-parameters="'--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.xp --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.10240 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --add Microsoft.VisualStudio.Component.WinXP'"
- name: Cache cmake build
uses: actions/cache@v4
with:
@@ -265,19 +270,16 @@ jobs:
key: windows-${{ matrix.arch }}-cmake-v1
- name: Configure
shell: cmd
run: |
cmake \
-B build \
-G "Visual Studio 16 2019" \
-A ${{ matrix.generator-platform }} \
# EOL
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
&& cmake -B build -G "Visual Studio 16 2019" -A ${{ matrix.generator-platform }}
- name: Build
shell: cmd
run: |
cmake \
--build build \
--config RelWithDebInfo \
# EOL
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" ^
&& cmake --build build --config RelWithDebInfo
- name: Upload
run: |
+9 -1
View File
@@ -286,12 +286,19 @@ target_sources(${EXECUTABLE_NAME} PUBLIC
"src/sfall_metarules.h"
"src/sfall_opcodes.cc"
"src/sfall_opcodes.h"
"src/sfall_script_hooks.cc"
"src/sfall_arrays.cc"
"src/sfall_arrays.h"
"src/sfall_callbacks.cc"
"src/sfall_callbacks.h"
"src/touch.cc"
"src/touch.h"
"src/scan_unimplemented.cc"
"third_party/lodepng/lodepng.cpp"
)
target_include_directories(${EXECUTABLE_NAME} PUBLIC "third_party/lodepng")
if(IOS)
target_sources(${EXECUTABLE_NAME} PUBLIC
"src/platform/ios/paths.h"
@@ -312,7 +319,8 @@ endif()
if(WIN32)
target_link_libraries(${EXECUTABLE_NAME}
winmm
libcpmt
debug libcpmtd
optimized libcpmt
)
endif()
+2 -2
View File
@@ -28,7 +28,7 @@
"inherits": [
"windows-base"
],
"generator": "Visual Studio 16 2019",
"generator": "Visual Studio 17 2022",
"architecture": "Win32",
"cacheVariables": {
"CMAKE_GENERATOR_TOOLSET": "v141_xp",
@@ -42,7 +42,7 @@
"inherits": [
"windows-base"
],
"generator": "Visual Studio 16 2019",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>"
+24 -2
View File
@@ -44,7 +44,7 @@ $ sudo apt install libsdl2-2.0-0
- Alternatively you can use Fallout 2 from Macplay/The Omni Group as a base - you need to extract game assets from the original bundle. Mount CD/DMG, right click `Fallout 2` -> `Show Package Contents`, navigate to `Contents/Resources`. Copy `GameData` folder somewhere, for example `/Applications/Fallout2`.
- Or if you're a Terminal user and have Homebrew installed you can extract the needed files from the GoG installer:
- Or if you're a Terminal user and have Homebrew installed you can extract the needed files from the GoG installer. **Note**: You must use "Offline backup game installer", not the main game installer.
```console
$ brew install innoextract
@@ -125,7 +125,18 @@ IFACE_BAR_SIDES_ORI=0
;This will increase the width of the interface bar expanding the area used to display text.
;if IFACE_BAR_WIDTH=640 - Interface bar will remain at it's original width.
;if IFACE_BAR_WIDTH=800 - Interface bar will use 800pix wide asset from f2_res.dat.
IFACE_BAR_WIDTH=640
;IFACE_BAR_WIDTH=640
[STATIC_SCREENS]
;if SPLASH_SCRN_SIZE=0 - Splash screen shows at original size if it fits, otherwise scales down while preserving aspect ratio.
;if SPLASH_SCRN_SIZE=1 - Splash screen scales to fit the screen while preserving aspect ratio.
;if SPLASH_SCRN_SIZE=2 - Splash screen stretches to fill the entire screen.
SPLASH_SCRN_SIZE=0
[MAPS]
;if IGNORE_MAP_EDGES=0 - Hi-Res map scroll edges are enabled.
;if IGNORE_MAP_EDGES=1 - Hi-Res map scroll edges are ignored.
IGNORE_MAP_EDGES=0
```
Recommendations:
@@ -141,6 +152,17 @@ The third configuration file is `ddraw.ini` (part of Sfall). There are dozens of
For a sample ddraw.ini configuration file, containing all currently working settings use this link: [ddraw.ini](https://raw.githubusercontent.com/fallout2-ce/fallout2-ce/refs/heads/main/files/ddraw.ini)
## Quality of life benefits over vanilla Fallout
* High resolution support
* Increased pathfinding nodes 5x for more accurate pathfinding
* Ctrl-click to quickly move items when bartering, looting, or stealing
* _a_ to select "all" when selecting item quantity
* _a_ to `Take All` when looting
* When bartering, caps default to the right amount to balance the trade (if possible)
* Music continues playing between maps (requires config)
* Auto open doors (requires config)
## Contributing
Integrating Sfall goodies is the top priority. Quality of life updates are OK too. Please no large scale refactorings at this time as we need to reconcile changes from Reference Edition, which will make this process slow and error-prone. In any case open up an issue with your suggestion or to notify other people that something is being worked on.
+2 -1
View File
@@ -4,7 +4,8 @@
[Main]
;Set to one to hide areas outside map bounds when using higher than 640x480 resolution, and to zero to disable
;HiResMode=1
;EnableHighResolutionStencil=1
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Misc]
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
docker run --rm \
-v $(pwd):/app --workdir /app \
--user $(id -u):$(id -g) silkeh/clang:18 \
bash -c 'find src -type f -name \*.cc -o -name \*.h | xargs clang-format -i'
+2
View File
@@ -0,0 +1,2 @@
*.int
sfall
+51
View File
@@ -0,0 +1,51 @@
# Testing sFall scripting features
## Basic info
This folder contains scripts which can be used for sFall opcodes.
## Building
Get latest `compile.exe` from [modders pack](https://sourceforge.net/projects/sfall/files/Modders%20pack/) or from [repository](https://github.com/sfall-team/sslc) and run it this way:
```sh
compile.exe -q -p -l -O2 -d -s -n -I<sfall_headers_id> <script_name.ssl>
```
(sfall headers can be found in modderspack)
### Build script using sFall Script Editor
- Get "Fallout sFall Script Editor v4.1.7.RC1", for example from https://nuclear-grot.ucoz.net/forum/12-20-1
- Run script editor, add "sfall_headers" into "Location folder of headers files" in the options
- Open any script here and compile it
- This shoud create compiled script <file.int>
### Build script using VSCode extension
- Install [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=BGforge.bgforge-mls)
## Run test script
1. Move compiled `.int` file into game folder as `data/scripts/gl_<script_name>.int`
2. Change `ddraw.ini` and add this section:
```ini
[Scripts]
GlobalScriptPaths=data/scripts/gl*.int
```
(or add new path using comma as separator)
Note that on non-Windows it have to be `/` as folder separator
3. Run game, check that game displays message about tests
+181
View File
@@ -0,0 +1,181 @@
#include "lib.arrays.h"
#include "test_utils.h"
// #include "define_lite.h"
#define ARRAY_MAX_STRING (255)
#define ARRAY_MAX_SIZE (100000)
procedure array_test_suite begin
variable arr, i, arr2, map, k, v, s;
test_suite_errors := 0;
display_msg("Testing arrays_equal functions...");
call assertEquals("array_equals 1", arrays_equal([9, 7, 2, 1], [9, 7, 2, 1]), true);
call assertEquals("array_equals 2", arrays_equal([9, 7, 0, 1], [9, 7, 2, 1]), false);
call assertEquals("array_equals 3", arrays_equal([1, 1, 1, 1], [1, 1, 1]), false);
call assertEquals("array_equals 4", arrays_equal([], []), true);
call assertEquals("array_equals 5", arrays_equal({}, []), false);
call assertEquals("array_equals 6", arrays_equal({1: 1.0, 2: 2.0}, {1: 1.000, 2: 2.000}), true);
call assertEquals("array_equals 7", arrays_equal({"name": "John", "dept": 15.20}, {"name": "John"}), false);
display_msg("Testing utility functions...");
call assertEquals("strlen", strlen("testing"), 7);
call assertEquals("substr 1", substr("testing", 4, 2), "in");
call assertEquals("substr 2", substr("testing", 1, -1), "estin");
call assertEquals("substr 3", substr("testing", -5, 5), "sting");
call assertEquals("typeof 1", typeof(1), VALTYPE_INT);
call assertEquals("typeof 2", typeof(1.0), VALTYPE_FLOAT);
call assertEquals("typeof 3", typeof("1.0"), VALTYPE_STR);
// Basic array functionality
display_msg("Testing basic arrays functionality...");
arr := create_array(5,0);
call assertEquals("array size", len_array(arr), 5);
arr[0]:=100;
call assertEquals("get array", get_array(arr, 0), 100);
arr[1]:=5.555;
call assertEquals("get array float", get_array(arr, 1), 5.555);
arr[2]:="hello";
call assertEquals("get array str", get_array(arr, 2), "hello");
call assertEquals("get array invalid index", get_array(arr, -1), 0);
call assertEquals("get array invalid index", get_array(arr, 6), 0);
resize_array(arr, 77);
call assertEquals("list resize", len_array(arr), 77);
resize_array(arr, ARRAY_MAX_SIZE + 100);
call assertEquals("resize max", len_array(arr), ARRAY_MAX_SIZE);
free_array(arr);
call assertEquals("not exists check", len_array(arr), -1);
arr := create_array(ARRAY_MAX_SIZE + 100, 0);
call assertEquals("create max", len_array(arr), ARRAY_MAX_SIZE);
free_array(arr);
arr := [6, 1, 10, "one", 10, "two", 5, "three"];
arr[0] := "wtf";
//display_msg(debug_array_str(arr));
call assertEquals("scan list", scan_array(arr, 10), 2);
call assertEquals("scan list 2", scan_array(arr, "two"), 5);
call assertEquals("array_key", array_key(arr, 5), 5);
call assertEquals("array_key out of range", array_key(arr, 9), 0);
call assertEquals("is list", array_key(arr, -1), 0);
call assertEquals("get array as substr", get_array("NiCe", 1), "i");
arr := [78, 12, 99, 1, -5];
sort_array(arr);
call assertEquals("sort ASC", arrays_equal(arr, [-5, 1, 12, 78, 99]), true);
arr := ["Albert", "John", "Mike", "David"];
sort_array_reverse(arr);
call assertEquals("sort DESC", arrays_equal(arr, ["Mike", "John", "David", "Albert"]), true);
reverse_array(arr);
call assertEquals("reverse list", arrays_equal(arr, ["Albert", "David", "John", "Mike"]), true);
shuffle_array(arr);
call assertEquals("shuffle list 1", arrays_equal(arr, ["Albert", "David", "John", "Mike"]), false);
call assertEquals("shuffle list 2", len_array(arr), 4);
if (test_suite_verbose) then display_array(arr);
// some additional stuff
call assertEquals("string_split", get_array(string_split("this+is+good", "+"), 2), "good");
call assertEquals("string_split 2", len_array(string_split("advice", "")), 6);
s := "";
for (i := 0; i < ARRAY_MAX_STRING+30; i+=10) begin
s += "Verbosity.";
end
arr[0] := s;
call assertEquals("array max string", strlen(arr[0]), ARRAY_MAX_STRING-1);
// ASSOC ARRAYS TEST
display_msg("Testing associative arrays...");
arr := create_array(-1,0);
call assertEquals("is map", array_key(arr, -1), 1);
call assertEquals("exists check", len_array(arr), 0);
arr["123"] := 100;
call assertEquals("set/get str=>int", arr["123"], 100);
arr["123"] := 50;
call assertEquals("overwrite 1", arr["123"], 50);
call assertEquals("overwrite 2", len_array(arr), 1);
arr[-1] := "wtf";
call assertEquals("set/get int=>str", arr[-1], "wtf");
arr[3.14] := 0.00001;
call assertEquals("set/get float=>float", arr[3.14], 0.00001);
arr["fourth"] := "elem";
call assertEquals("map size", len_array(arr), 4);
arr[-1] := 0;
call assertEquals("unset key: length", len_array(arr), 3);
call assertEquals("unset key: hashmap", arr[3.14], 0.00001);
call assertEquals("key not exist", arr[777], 0);
free_array(arr);
call assertEquals("not exists check", len_array(arr), -1);
arr := {6:5, 1.001:0.5, 10:"A", 5:0, "wtf":1.1, 10:0.0001, "some":"What"}; // 7 here
// 10:"A" will be overwritten by 10:0.0001
call assertEquals("assoc array expr", len_array(arr), 6); // 6 actual
call assertEquals("scan map 1", scan_array(arr, 1.1), "wtf");
call assertEquals("scan map 2", scan_array(arr, 5), 6);
call assertEquals("scan map 3", scan_array(arr, "What"), "some");
call assertEquals("array_key 1", array_key(arr, 0), 6);
call assertEquals("array_key 2", array_key(arr, 4), "wtf");
call assertEquals("array_key 3", array_key(arr, 1), 1.001);
resize_array(arr, 2);
call assertEquals("map resize 1", len_array(arr), 2);
call assertEquals("map resize 2", arrays_equal(arr, {6:5, 1.001:0.5}), true);
resize_array(arr, 0);
call assertEquals("map clear", len_array(arr), 0);
display_msg("Testing foreach...");
s := "ar";
arr := [6, 10, 0.5, "wtf"];
foreach v in arr begin
s += v;
end
call assertEquals("foreach 1", s, "ar6100.50000wtf");
s := "ar2=";
arr := {"name": "John", "hp": 25, 0: 5.5};
foreach k: v in arr begin
s += k+":"+v+";";
end
call assertEquals("foreach 2", s, "ar2=name:John;hp:25;0:5.50000;");
/*
display_msg("Testing save/load...");
arr := [2,1];
arr2 := {1:2};
save_array("myarray", arr);
call assertEquals("load 1", load_array("myarray"), arr);
save_array("myarray", arr2);
call assertEquals("load 2", load_array("myarray"), arr2);
free_array(arr2);
call assertEquals("not exists check", len_array(arr2), -1);
call assertEquals("load fail", load_array("myarray"), 0);
save_array(0.1, arr);
call assertEquals("save as float", load_array(0.1), arr);
arr2 := list_saved_arrays; // list of array names
//display_msg(debug_array_str(arr2));
call assertNotEquals("saved arrays 1", scan_array(arr2, 0.1), -1);
call assertEquals("saved arrays 2", scan_array(arr2, "myarray"), -1);
save_array(0, arr);
call assertEquals("unsave array 1", load_array(0.1), 0);
call assertEquals("unsave array 2", len_array(arr), 2);
call assertEquals("saved arrays 3", len_array(list_saved_arrays), len_array(arr2) - 1);
*/
display_msg("All tests finished with "+test_suite_errors+" errors.");
call report_test_results("arrays");
end
procedure start begin
display_msg("Starting tests");
call array_test_suite();
end
+33
View File
@@ -0,0 +1,33 @@
#include "test_utils.h"
#include "sfall.h"
procedure start begin
display_msg("Testing iface_tag functions...");
// assumes no iface tags active in the save game
// SNEAK
show_iface_tag(0);
call assertTrue("show_iface_tag(SNEAK)", is_iface_tag_active(0));
hide_iface_tag(0);
call assertFalse("hide_iface_tag(SNEAK)", is_iface_tag_active(0));
// LEVEL
show_iface_tag(3);
call assertTrue("show_iface_tag(LEVEL)", is_iface_tag_active(3));
hide_iface_tag(3);
call assertFalse("hide_iface_tag(LEVEL)", is_iface_tag_active(3));
// ADDICTED
show_iface_tag(4);
call assertTrue("show_iface_tag(ADDICTED)", is_iface_tag_active(4));
hide_iface_tag(4);
call assertFalse("hide_iface_tag(ADDICTED)", is_iface_tag_active(4));
// POISONED
call assertFalse("hide_iface_tag(POISONED)", is_iface_tag_active(1));
// RADIATED
call assertFalse("hide_iface_tag(RADIATED)", is_iface_tag_active(2));
call report_test_results("iface_tag");
end
+69
View File
@@ -0,0 +1,69 @@
#include "lib.arrays.h" // For arrays_equal, len_array, etc.
#include "test_utils.h" // For assertEquals, VALTYPE_STR, report_test_results
// To test: copy test.ini into the game folder before running
procedure ini_test_suite begin
variable result_array, expected_array, key_type, value_type, count, key_val_pair;
display_msg("--- Testing ini functions");
// Test Case 1: Valid file, valid section
result_array := get_ini_section("test.ini", "ValidSection");
expected_array := {"Key1": "Value1", "Key2": "2"};
call assertEquals("TC1 Size", len_array(result_array), 2);
call assertEquals("TC1 Content", arrays_equal(result_array, expected_array), true);
count := 0;
foreach key_val_pair in result_array begin
count += 1;
call assertEquals("TC1 Key Type " + count, typeof(key_val_pair[0]), VALTYPE_STR);
call assertEquals("TC1 Value Type " + count, typeof(key_val_pair[1]), VALTYPE_STR);
end
// basic fetchers
call assertEquals("TC2 Specific Key1 Value", result_array["Key1"], "Value1");
call assertEquals("TC2 get_ini_setting string", get_ini_setting("test.ini|ValidSection|Key1"), 0);
call assertEquals("TC2 get_ini_string string", get_ini_string("test.ini|ValidSection|Key1"), "Value1");
call assertEquals("TC2 get_ini_setting int", get_ini_setting("test.ini|ValidSection|Key2"), 2);
call assertEquals("TC2 get_ini_string int", get_ini_string("test.ini|ValidSection|Key2"), "2");
// INI file not found
result_array := get_ini_section("nonexistent.ini", "AnySection");
call assertEquals("TC3 Size", len_array(result_array), 0);
call assertEquals("TC3 Is Map", array_key(result_array, -1), 1); // Should still be an associative array
call assertEquals("TC3 get_ini_setting", get_ini_setting("notexist.ini|ValidSection|Key2"), 0);
call assertEquals("TC3 get_ini_string", get_ini_string("notexist.ini|ValidSection|Key2"), "");
// Valid file, section not found
result_array := get_ini_section("test.ini", "NonExistentSection");
call assertEquals("TC4 Size", len_array(result_array), 0);
call assertEquals("TC4 Is Map", array_key(result_array, -1), 1);
call assertEquals("TC4 get_ini_setting", get_ini_setting("test.ini|NonExistentSection|Key2"), 0);
call assertEquals("TC4 get_ini_string", get_ini_string("test.ini|NonExistentSection|Key2"), "");
// Valid file, empty section
result_array := get_ini_section("test.ini", "EmptySection");
call assertEquals("TC5 Size", len_array(result_array), 0);
call assertEquals("TC5 Is Map", array_key(result_array, -1), 1);
call assertEquals("TC5 get_ini_setting", get_ini_setting("test.ini|EmptySection|Key2"), 0);
call assertEquals("TC5 get_ini_string", get_ini_string("test.ini|EmptySection|Key2"), "");
// set ini setting
set_ini_setting("test_set.ini|ValidSection|Key3", "OldValue");
call assertEquals("TC6 set_ini_setting 1", get_ini_string("test_set.ini|ValidSection|Key3"), "OldValue");
set_ini_setting("test_set.ini|ValidSection|Key3", "NewValue");
call assertEquals("TC6 set_ini_setting 2", get_ini_string("test_set.ini|ValidSection|Key3"), "NewValue");
set_ini_setting("test_set.ini|ValidSection|Key3", 2);
call assertEquals("TC6 set_ini_setting int", get_ini_setting("test_set.ini|ValidSection|Key3"), 2);
// get_init_sections
result_array := get_ini_sections("test.ini");
call assertEquals("TC7 get_ini_sections size", len_array(result_array), 3);
call assertTrue("TC7 get_ini_sections", scan_array(result_array, "TestMisc") >= 0);
call report_test_results("ini");
end
procedure start begin
call ini_test_suite();
end
+71
View File
@@ -0,0 +1,71 @@
#include "test_utils.h"
#include "sfall.h"
procedure start begin
display_msg("Testing math functions...");
call assertFloat("sin(0)", sin(0), 0.0);
call assertFloat("sin(PI/2)", sin(1.5708), 1.0);
call assertFloat("sin(PI)", sin(3.1416), 0.0);
call assertFloat("sin(-PI/2)", sin(-1.5708), -1.0);
call assertFloat("cos(0)", cos(0), 1.0);
call assertFloat("cos(PI/2)", cos(1.5708), 0.0);
call assertFloat("cos(PI)", cos(3.1416), -1.0);
call assertFloat("cos(-PI)", cos(-3.1416), -1.0);
call assertFloat("tan(0)", tan(0), 0.0);
call assertFloat("tan(PI/4)", tan(0.7854), 1.0);
call assertFloat("tan(-PI/4)", tan(-0.7854), -1.0);
call assertFloat("arctan(0, 1)", arctan(0, 1), 0.0);
call assertFloat("arctan(1, 1)", arctan(1, 1), 0.7854);
call assertFloat("arctan(-1, 1)", arctan(-1, 1), -0.7854);
call assertFloat("arctan(1, 0)", arctan(1, 0), 1.5708);
call assertFloat("log(1)", log(1), 0.0);
call assertFloat("log(e)", log(2.7183), 1.0);
call assertFloat("log(10)", log(10), 2.3026);
call assertFloat("exponent(0)", exponent(0), 1.0);
call assertFloat("exponent(1)", exponent(1), 2.7183);
call assertFloat("exponent(2)", exponent(2), 7.3891);
call assertFloat("exponent(-1)", exponent(-1), 0.3679);
call assertEquals("ceil(2.1)", ceil(2.1), 3);
call assertEquals("ceil(2.0)", ceil(2.0), 2);
call assertEquals("ceil(-2.1)", ceil(-2.1), -2);
call assertEquals("ceil(-2.9)", ceil(-2.9), -2);
call assertEquals("floor2(2.1)", floor2(2.1), 2);
call assertEquals("floor2(2.9)", floor2(2.9), 2);
call assertEquals("floor2(-2.1)", floor2(-2.1), -3);
call assertEquals("floor2(-2.9)", floor2(-2.9), -3);
call assertEquals("2^3", 2^3, 8);
call assertEquals("4^2", 4^2, 16);
call assertEquals("3^0", 3^0, 1);
call assertFloat("2^-1", 2^-1, 0); // note: int truncation
call assertFloat("2^-1", 2^-1.0, 0.5);
call assertFloat("4^0.5", 4^0.5, 2.0);
call assertFloat("8^(1/3)", 8^(1.0/3.0), 2.0);
call assertFloat("2.5^2", 2.5^2, 6.25);
call assertEquals("round(2.3)", round(2.3), 2);
call assertEquals("round(2.5)", round(2.5), 3);
call assertEquals("round(2.7)", round(2.7), 3);
call assertEquals("round(-2.3)", round(-2.3), -2);
call assertEquals("round(-2.5)", round(-2.5), -3);
call assertEquals("round(-2.7)", round(-2.7), -3);
call assertEquals("round(0.0)", round(0.0), 0);
call assertEquals("round(1.0)", round(1.0), 1);
call assertEquals("round(<int>)", round(1), 1);
call assertFloat("sin(arctan(1, 1))", sin(arctan(1, 1)), 0.7071);
call assertFloat("cos(arctan(1, 1))", cos(arctan(1, 1)), 0.7071);
call assertFloat("log(ceil(2.7))", log(ceil(2.7)), 1.0986);
call assertFloat("exponent(log(5))", exponent(log(5)), 5.0);
call report_test_results("math");
end
+14
View File
@@ -0,0 +1,14 @@
#include "sfall.h"
// this is the basic message_box function used by RPU and Et Tu
#define message_box_warning(text) message_box4(text, 0x01, 134, 145)
procedure start begin
// I don't see a practice way to auto test message_box, so this is just a way to do manual testing
variable ret = message_box1("Basic Dialog\nwith multiple lines\nand such.");
display_msg("chose: " + ret);
message_box2("Basic Dialog\nwith default flags.", -1); // -1 means use default flags
message_box2("Basic Dialog\nsmall.", 0x02);
message_box_warning("Missing config values\n(just testing).");
end
+30
View File
@@ -0,0 +1,30 @@
#include "test_utils.h"
#include "sfall.h"
procedure start begin
display_msg("Testing metarule_exist functions...");
call assertEquals("string_format", metarule_exist("string_format"), 1);
call assertEquals("metarule_exist", metarule_exist("metarule_exist"), 1);
// This will fail on sFall
call assertEquals("opcode_exists", metarule_exist("opcode_exists"), 1);
if metarule_exist("opcode_exists") then begin // And example if how to use it
#define opcode_exists(opcode) sfall_func1("opcode_exists", opcode)
#define OP_GET_UPTIME 0x81B3
#define OP_NOOP 0x8000
#define OP_WRITE_INT 0x81D1
call assertEquals("opcode_exists OP_GET_UPTIME", opcode_exists(OP_GET_UPTIME), 1);
call assertEquals("opcode_exists OP_NOOP", opcode_exists(OP_NOOP), 1);
// Probably will never be implemented on fallout2-ce
call assertEquals("opcode_exists OP_WRITE_INT", opcode_exists(OP_WRITE_INT), 0);
call assertEquals("opcode_exists 0xFFFF", opcode_exists(0xFFFF), 0);
end else begin
display_msg("Opcode exists metarule is not available, skipping tests.");
end
call report_test_results("metarule_exist");
end
+15
View File
@@ -0,0 +1,15 @@
#include "test_utils.h"
#include "sfall.h"
procedure start begin
// TODO: move this to a more suitable place, once we have more functions implemented
// These are in the "Other" category in the sfall documentation
display_msg("Testing misc functions...");
variable hand := active_hand;
toggle_active_hand;
call assertEquals("active_hand toggled", active_hand, 1 - hand);
toggle_active_hand;
call assertEquals("active_hand toggled", active_hand, hand);
call report_test_results("misc");
end
+82
View File
@@ -0,0 +1,82 @@
#include "test_utils.h"
#include "sfall.h"
#define REPEAT_64 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
#define REPEAT_512 REPEAT_64 REPEAT_64 REPEAT_64 REPEAT_64 REPEAT_64 REPEAT_64 REPEAT_64 REPEAT_64
#define REPEAT_1024 REPEAT_512 REPEAT_512
procedure start begin
display_msg("Testing sprintf...");
call assertEquals("sprintf hello world", sprintf("Hello %s", "World"), "Hello World");
call assertEquals("sprintf empty string", sprintf("", 123), "");
call assertEquals("sprintf number string", sprintf("%d", 123), "123");
call assertEquals("sprintf number inside string", sprintf("Hello %d !", 123), "Hello 123 !");
call assertEquals("sprintf ascii code", sprintf("Hello %c !", 123), "Hello { !");
call assertEquals("sprintf float string", sprintf("Hello %f !", 3.4), "Hello 3.400000 !");
call assertEquals("sprintf float string", sprintf("Hello %d !", 10/4), "Hello 2 !");
call assertEquals("sprintf two strings", sprintf("Hello %s %s", "World"), "Hello World World");
call assertEquals("Long string", sprintf(REPEAT_1024"x", 1), "Error");
call assertEquals("Not so long", sprintf(REPEAT_1024, 1), REPEAT_1024);
call assertEquals("string_format1 hello world", string_format1("Hello %s!", "World"), "Hello World!");
call assertEquals("string_format1 auto hello world", string_format("Hello %s!", "World"), "Hello World!");
call assertEquals("string_format2 hello world", string_format2("Hello %s%s!", "Wo","rld"), "Hello World!");
call assertEquals("string_format2 auto hello world", string_format("Hello %s%s!", "Wo","rld"), "Hello World!");
call assertEquals("string_format3 hello world", string_format3("Hell%s %s%s!", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format3 auto hello world", string_format("Hell%s %s%s!", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format4 hello world", string_format4("Hel%s%s %s%s!", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format4 auto hello world", string_format("Hel%s%s %s%s!", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format5 hello world", string_format5("He%s%s%s %s%s!", "l", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format5 auto hello world", string_format("He%s%s%s %s%s!", "l", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format6 hello world", string_format6("H%s%s%s%s %s%s!", "e", "l", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format6 auto hello world", string_format("H%s%s%s%s %s%s!", "e", "l", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format7 hello world", string_format7("%s%s%s%s%s %s%s!", "H", "e", "l", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("string_format7 auto hello world", string_format("%s%s%s%s%s %s%s!", "H", "e", "l", "l", "o", "Wo","rld"), "Hello World!");
call assertEquals("formatted string length 1024", strlen(sprintf(REPEAT_1024, 1)), 1024);
call assertEquals("formatted string length 5119", strlen(
string_format7(
"%s%s%s%s%s%s%s",
REPEAT_1024,
REPEAT_1024,
REPEAT_1024,
REPEAT_1024,
REPEAT_1024,
REPEAT_1024,
REPEAT_1024)), 5119);
call assertEquals("string_tolower", string_tolower("miXeD CaSe"), "mixed case");
call assertEquals("string_toupper", string_toupper("miXeD CaSe"), "MIXED CASE");
call assertEquals("string_find ok", string_find("Hello World", "World"), 6);
call assertEquals("string_find missing", string_find("Hello World", "Zebra"), -1);
call assertEquals("string_find_from", string_find_from("Hello World", "o", 6), 7);
call assertEquals("string_compare ok", string_compare("Hello World", "HeLlO WoRld"), 1);
call assertEquals("string_compare neq", string_compare("Hello World", "HeLlO WoRld!"), 0);
call assertEquals("string_compare_locale", string_compare_locale("Hello World", "HeLlO WoRld", 866), 1); // TODO: would be nice to compare cyrillic
call assertEquals("charcode", charcode("A"), 65);
call assertEquals("charcode empty", charcode(""), 0);
call report_test_results("sprintf");
end

Some files were not shown because too many files have changed in this diff Show More