McRogueFace/src
John McCardle 8f8b72da4a feat: auto-exit in --headless --exec mode when script completes
Closes #127

Previously, `./mcrogueface --headless --exec <script>` would hang
indefinitely after the script completed because the game loop ran
continuously. This required external timeouts and explicit mcrfpy.exit()
calls in every automation script.

This commit adds automatic exit detection for headless+exec mode:
- Added `auto_exit_after_exec` flag to McRogueFaceConfig
- Set flag automatically when both --headless and --exec are present
- Game loop exits when no timers remain (timers.empty())

Benefits:
- Documentation generation scripts work without explicit exit calls
- Testing scripts don't need timeout wrappers
- Clean process termination for automation
- Backward compatible (scripts with mcrfpy.exit() continue working)

Changes:
- src/McRogueFaceConfig.h: Add auto_exit_after_exec flag
- src/main.cpp: Set flag and recreate engine with modified config
- src/GameEngine.cpp: Check timers.empty() in game loop
- ROADMAP.md: Mark Phase 7 as complete (2025-10-30)
- CLAUDE.md: Add instruction about closing issues with commit messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 22:52:52 -04:00
..
scripts Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
ActionCode.h Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
Animation.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
Animation.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
CommandLineParser.cpp Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
CommandLineParser.h Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
Common.h Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
GameEngine.cpp feat: auto-exit in --headless --exec mode when script completes 2025-10-30 22:52:52 -04:00
GameEngine.h feat: Add comprehensive profiling system with F3 overlay 2025-10-25 00:45:44 -04:00
HeadlessRenderer.cpp Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
HeadlessRenderer.h Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
IndexTexture.cpp Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
IndexTexture.h Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
McRFPy_API.cpp docs: Phase 3 - Convert 19 module functions to MCRF_FUNCTION macros 2025-10-30 19:38:22 -04:00
McRFPy_API.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
McRFPy_Automation.cpp Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
McRFPy_Automation.h Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
McRFPy_Doc.h feat: add documentation macro system header 2025-10-30 11:16:44 -04:00
McRFPy_Libtcod.cpp Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
McRFPy_Libtcod.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
McRogueFaceConfig.h feat: auto-exit in --headless --exec mode when script completes 2025-10-30 22:52:52 -04:00
Profiler.cpp feat: Add comprehensive profiling system with F3 overlay 2025-10-25 00:45:44 -04:00
Profiler.h feat: Add comprehensive profiling system with F3 overlay 2025-10-25 00:45:44 -04:00
ProfilerOverlay.cpp feat: Add comprehensive profiling system with F3 overlay 2025-10-25 00:45:44 -04:00
PyAnimation.cpp docs: convert Phase 2 classes to documentation macros (Animation, Window, SceneObject) 2025-10-30 17:03:28 -04:00
PyAnimation.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
PyCallable.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
PyCallable.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
PyColor.cpp docs: convert Phase 1 classes to documentation macros (Color, Font, Texture, Timer) 2025-10-30 16:59:40 -04:00
PyColor.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
PyDrawable.cpp feat: convert PyDrawable properties to documentation macros 2025-10-30 12:22:00 -04:00
PyDrawable.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
PyFont.cpp docs: convert Phase 1 classes to documentation macros (Color, Font, Texture, Timer) 2025-10-30 16:59:40 -04:00
PyFont.h Squashed commit of the following: [alpha_streamline_1] 2025-07-05 18:56:02 -04:00
PyObjectUtils.h Iterators, other Python C API improvements 2025-05-31 09:11:51 -04:00
PyPositionHelper.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
PyRAII.h Iterators, other Python C API improvements 2025-05-31 09:11:51 -04:00
PyScene.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
PyScene.h Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
PySceneObject.cpp docs: convert Phase 2 classes to documentation macros (Animation, Window, SceneObject) 2025-10-30 17:03:28 -04:00
PySceneObject.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
PyTexture.cpp docs: convert Phase 1 classes to documentation macros (Color, Font, Texture, Timer) 2025-10-30 16:59:40 -04:00
PyTexture.h Squashed commit of the following: [alpha_streamline_1] 2025-07-05 18:56:02 -04:00
PyTimer.cpp docs: convert Phase 1 classes to documentation macros (Color, Font, Texture, Timer) 2025-10-30 16:59:40 -04:00
PyTimer.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
PyVector.cpp feat: convert PyVector properties to use macros 2025-10-30 11:33:49 -04:00
PyVector.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
PyWindow.cpp docs: convert Phase 2 classes to documentation macros (Animation, Window, SceneObject) 2025-10-30 17:03:28 -04:00
PyWindow.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
PythonObjectCache.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
PythonObjectCache.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
Resources.cpp Adding text functionality to Caption (why was that missing???) 2024-03-07 12:35:07 -05:00
Resources.h Adding text functionality to Caption (why was that missing???) 2024-03-07 12:35:07 -05:00
Scene.cpp Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
Scene.h Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
SceneTransition.cpp Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
SceneTransition.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
Timer.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
Timer.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UI.h Squashed commit of the following: [break_up_ui_h] 2024-04-20 10:32:04 -04:00
UIBase.h fix: update child class property overrides to use MCRF_PROPERTY macros 2025-10-30 12:33:27 -04:00
UICaption.cpp fix: update child class property overrides to use MCRF_PROPERTY macros 2025-10-30 12:33:27 -04:00
UICaption.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UICollection.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UICollection.h Squashed commit of the following: [alpha_streamline_1] 2025-07-05 18:56:02 -04:00
UIContainerBase.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
UIDrawable.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UIDrawable.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UIEntity.cpp Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UIEntity.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UIEntityPyMethods.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
UIFrame.cpp fix: update child class property overrides to use MCRF_PROPERTY macros 2025-10-30 12:33:27 -04:00
UIFrame.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UIGrid.cpp fix: update child class property overrides to use MCRF_PROPERTY macros 2025-10-30 12:33:27 -04:00
UIGrid.h feat: Thread-safe FOV system with improved API 2025-07-22 23:00:34 -04:00
UIGridPoint.cpp Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
UIGridPoint.h Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
UISprite.cpp fix: update child class property overrides to use MCRF_PROPERTY macros 2025-10-30 12:33:27 -04:00
UISprite.h Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
UITestScene.cpp Squashed commit of 53 Commits: [alpha_streamline_2] 2025-07-09 22:41:15 -04:00
UITestScene.h Refactor: remove "s" prefix from "sRender" method ( -> "render") Closes #44 2024-04-20 14:16:14 -04:00
main.cpp feat: auto-exit in --headless --exec mode when script completes 2025-10-30 22:52:52 -04:00