Browse Source

access: wire extracted modules into diablo.cpp and build system

Remove ~4,042 lines of extracted function bodies and forward
declarations from diablo.cpp. Add includes for the 6 new module
headers. Update CancelAutoWalkInternal() to delegate to
ResetAutoWalkTracker() and ResetAutoWalkTownNpc().

Remove unused includes from diablo.cpp that were only needed by the
extracted code (<queue>, format_int.hpp, tile_properties.hpp).

Add the 6 new .cpp files to Source/CMakeLists.txt so they are
compiled into libdevilutionx.

Also includes post-review cleanups:
- Remove unused automap.h include from accessibility_keys.cpp
- Remove unused walk_path_speech.hpp include from diablo.cpp
- Replace .size() == 0 with .empty() in accessibility_keys.cpp
- Simplify CanAutomapBeToggledOff to direct return expression
- Remove unreachable dead code and dead FindPreferredExitTriggerIndex
  function from navigation_speech.cpp

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
pull/8474/head
hidwood 2 months ago
parent
commit
0ea5705dbf
  1. 54
      Source/CMakeLists.txt
  2. 11363
      Source/diablo.cpp

54
Source/CMakeLists.txt

@ -41,6 +41,7 @@ set(libdevilutionx_SRCS
control/control_infobox.cpp control/control_infobox.cpp
control/control_panel.cpp control/control_panel.cpp
controls/accessibility_keys.cpp
controls/axis_direction.cpp controls/axis_direction.cpp
controls/controller_motion.cpp controls/controller_motion.cpp
controls/controller.cpp controls/controller.cpp
@ -51,6 +52,8 @@ set(libdevilutionx_SRCS
controls/menu_controls.cpp controls/menu_controls.cpp
controls/modifier_hints.cpp controls/modifier_hints.cpp
controls/plrctrls.cpp controls/plrctrls.cpp
controls/town_npc_nav.cpp
controls/tracker.cpp
DiabloUI/button.cpp DiabloUI/button.cpp
DiabloUI/credits.cpp DiabloUI/credits.cpp
@ -160,13 +163,16 @@ set(libdevilutionx_SRCS
tables/textdat.cpp tables/textdat.cpp
tables/townerdat.cpp tables/townerdat.cpp
utils/accessibility_announcements.cpp
utils/display.cpp utils/display.cpp
utils/language.cpp utils/language.cpp
utils/proximity_audio.cpp utils/navigation_speech.cpp
utils/sdl_bilinear_scale.cpp utils/proximity_audio.cpp
utils/sdl_thread.cpp utils/sdl_bilinear_scale.cpp
utils/surface_to_clx.cpp utils/sdl_thread.cpp
utils/timer.cpp) utils/surface_to_clx.cpp
utils/timer.cpp
utils/walk_path_speech.cpp)
# These files are responsible for most of the runtime in Debug mode. # These files are responsible for most of the runtime in Debug mode.
# Apply some optimizations to them even in Debug mode to get reasonable performance. # Apply some optimizations to them even in Debug mode to get reasonable performance.
@ -739,15 +745,15 @@ target_link_dependencies(libdevilutionx_utf8 PRIVATE
SheenBidi::SheenBidi SheenBidi::SheenBidi
) )
if(NOSOUND) if(NOSOUND)
add_devilutionx_object_library(libdevilutionx_sound add_devilutionx_object_library(libdevilutionx_sound
effects_stubs.cpp effects_stubs.cpp
engine/sound_pool_stubs.cpp engine/sound_pool_stubs.cpp
engine/sound_stubs.cpp engine/sound_stubs.cpp
) )
target_link_dependencies(libdevilutionx_sound PUBLIC target_link_dependencies(libdevilutionx_sound PUBLIC
DevilutionX::SDL DevilutionX::SDL
fmt::fmt fmt::fmt
magic_enum::magic_enum magic_enum::magic_enum
tl tl
unordered_dense::unordered_dense unordered_dense::unordered_dense
@ -755,15 +761,15 @@ if(NOSOUND)
libdevilutionx_random libdevilutionx_random
libdevilutionx_sdl2_to_1_2_backports libdevilutionx_sdl2_to_1_2_backports
) )
else() else()
add_devilutionx_object_library(libdevilutionx_sound add_devilutionx_object_library(libdevilutionx_sound
effects.cpp effects.cpp
engine/sound_pool.cpp engine/sound_pool.cpp
engine/sound.cpp engine/sound.cpp
utils/soundsample.cpp utils/soundsample.cpp
) )
if(USE_SDL3) if(USE_SDL3)
target_link_dependencies(libdevilutionx_sound PUBLIC target_link_dependencies(libdevilutionx_sound PUBLIC
SDL3_mixer::SDL3_mixer SDL3_mixer::SDL3_mixer
) )
else() else()

11363
Source/diablo.cpp

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save