Commit Graph

61 Commits

Author SHA1 Message Date
hans 3a7ec50abf feat: Add triggerQuitOnInitForTest to GameScreen for deterministic testing
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 17:52:02 +01:00
hans ae3b0deb04 feat: Add app exit handler and corresponding tests for audio shutdown
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 17:48:59 +01:00
hans a7353e45b3 feat: Implement audio shutdown procedure for graceful app exit
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 17:38:18 +01:00
hans f4d6db2db0 feat: Enhance audio management by implementing shutdown procedures on exit
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 17:36:49 +01:00
hans fdf84b3a9d Refactor audio handling in Wolfenstein 3D
- Updated main.dart to use NativeSubprocessAudio instead of CliSubprocessAudio.
- Introduced DebugMusicPlayer interface for music playback.
- Implemented NativeSubprocessAudio for native audio handling with subprocesses.
- Added SilentAudio class as a no-op fallback for audio.
- Removed deprecated FlutterAudioAdapter and default audio backend implementations.
- Integrated Wolf3dPlatformAudio to manage audio across platforms, selecting between NativeSubprocessAudio and an embedded audio player.
- Updated wolf_3d_engine.dart to use SilentAudio as the default audio backend.
- Cleaned up audio-related files and ensured proper audio initialization and playback functionality.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 17:30:02 +01:00
hans ea6825341e feat: Add FPS toggle shortcut and corresponding input handling in CLI
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 17:12:27 +01:00
hans b88475882b feat: Implement audio backend with subprocess support and refactor audio handling
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 17:10:07 +01:00
hans 26c738b702 feat: Implement platform-specific persistence for renderer settings and save games
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 16:28:35 +01:00
hans dcfb2e8e02 refactor: Moved renderer package into Flutter package
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 16:12:03 +01:00
hans f05a861998 feat: Add exists method for checking save game file existence in CLI and Flutter persistence
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 15:39:02 +01:00
hans db06f5f5cb feat: Implement save game functionality with encoding/decoding
- Added SaveGameCodec for encoding and decoding save game files.
- Introduced SaveGamePersistence interface for slot-based save game persistence.
- Implemented FlutterSaveGamePersistence for file-based save management on Flutter.
- Enhanced WolfEngine to support saving and loading game states.
- Updated menu manager to include save/load game options.
- Created tests for SaveGameCodec to ensure proper functionality.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 14:50:53 +01:00
hans 35cfe8d88c feat: Conditionally display debug tools button based on debug mode and engine difficulty
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 11:24:29 +01:00
hans a84c677845 feat: Add Spear of Destiny demo support with dedicated asset registry and entity definitions
- Introduced SpearDemoAssetRegistry for managing assets specific to the Spear of Destiny demo.
- Created SpearDemoEntityModule to define enemy animations with adjusted sprite ranges.
- Implemented SpearDemoHudModule and SpearDemoMenuPicModule for HUD and menu assets.
- Added SpearDemoSfxModule for sound effect mappings specific to the demo version.
- Updated enemy classes (Guard, Mutant, Officer, SS) to support custom animation sets.
- Modified entity registry to accept a custom AssetRegistry for spawning entities.
- Enhanced rendering with CRT phosphor bloom effect in GLSL shaders.
- Adjusted ASCII and software renderer layouts for improved UI spacing.
- Added tests for SpearDemoAssetRegistry to ensure correct asset resolution and enemy spawning.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 10:37:50 +01:00
hans 3270338f44 feat: Implement Change View and Renderer Options menus
- Added functionality to display and navigate the Change View menu in SixelRenderer and SoftwareRenderer.
- Introduced methods to draw the Change View and Renderer Options menus, including handling cursor and selection states.
- Updated WolfClassicMenuArt to include a customize label for the new menu.
- Enhanced WolfMenuScreen to support new menu states.
- Created tests for Change View menu interactions, ensuring proper transitions and renderer settings toggling.
- Implemented persistence for renderer settings in Flutter, allowing settings to be saved and loaded from a local file.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 20:49:37 +01:00
hans 45e5302eac Automatically use sixel if it's available
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 18:19:19 +01:00
hans 2598218a4d feat: Improve Sixel rendering stability by adjusting output height and anchoring behavior
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 18:03:19 +01:00
hans 10417d26ba Refactor audio module to use built-in music and sound effect identifiers
- Introduced BuiltInMusicModule and BuiltInSfxModule to replace RetailMusicModule and RetailSfxModule.
- Updated RetailAssetRegistry and SharewareAssetRegistry to utilize the new built-in modules.
- Removed deprecated MusicKey and SfxKey classes, replacing them with Music and SoundEffect enums for better clarity and maintainability.
- Adjusted music and sound effect resolution methods to align with the new structure.
- Updated audio playback methods in WolfAudio and FlutterAudioAdapter to accept the new Music and SoundEffect types.
- Refactored tests to accommodate changes in audio event handling and ensure compatibility with the new identifiers.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 17:07:25 +01:00
hans 8cca66e966 feat: Add Audio Gallery screen and integrate into Debug Tools menu
feat: Implement audio playback controls and audio management in the gallery
refactor: Update audio engine interface to include stopAllAudio method

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 16:15:46 +01:00
hans 03dd871a46 feat: Implement game selection in sprite and VGA galleries with GalleryGameSelector
refactor: Update VgaGallery and SpriteGallery to use selected game data
chore: Remove unused plugins from generated plugin registrant and CMake files
chore: Clean up pubspec.yaml by removing super_clipboard dependency

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 15:53:24 +01:00
hans 4d5b30f007 feat: Enhance menu rendering and input handling
- Added support for new plugins: IrondashEngineContext and SuperNativeExtensions in the Flutter plugin registrant.
- Updated CMake configuration to include new plugins.
- Introduced a new dependency, super_clipboard, in pubspec.yaml.
- Enhanced the WolfEngine to set the menu background color.
- Implemented keyboard shortcuts for renderer mode toggling and ASCII theme cycling in CLI input handling.
- Updated menu manager to include a universal menu background color.
- Refactored ASCII and Sixel renderers to utilize the new menu background color and improved header drawing logic.
- Simplified the drawing of menu options sidebars and header bars across different renderers.
- Improved the layout and centering of menu titles in the header bar.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 14:46:08 +01:00
hans 862191d245 feat: Implement host shortcut system for desktop window management and input suppression
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 11:35:22 +01:00
hans c81eb6750d feat: Integrate window manager for desktop windowing support and enhance input handling
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 11:25:05 +01:00
hans abca679a99 feat: Add GLSL effects toggle and enhance shader for CRT-like post-processing
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 11:03:33 +01:00
hans cbbcd3223a refactor: Update renderer mode enum and input key handling for improved clarity
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 10:54:10 +01:00
hans e060aef3f1 feat: Add quit callback support to engine and UI components
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 10:04:01 +01:00
hans add8bcfde1 feat: Implement ASCII theme cycling and add quadrant theme support
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 23:29:00 +01:00
hans bb1d04563a feat: Refactor renderer key event handling and disable FPS counter by default
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 19:33:49 +01:00
hans 3e091c3d5d Fixed HUD and menu position and scaling in hardware renderer
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 19:25:24 +01:00
hans c8cd2cb144 feat: Add GLSL renderer and implement FPS overlay across rendering backends
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 19:12:39 +01:00
hans 786ba4b450 Refactor rendering architecture and replace rasterizer with renderer
- Introduced SoftwareRenderer as a pixel-accurate software rendering backend.
- Removed the obsolete wolf_3d_rasterizer.dart file.
- Created a new wolf_3d_renderer.dart file to centralize rendering exports.
- Updated tests to accommodate the new rendering structure, including pushwall and projection sampling tests.
- Modified the WolfAsciiRenderer and WolfFlutterRenderer to utilize the new SoftwareRenderer.
- Enhanced enemy spawn tests to include new enemy states.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 11:38:07 +01:00
hans 0e143892f0 Refactor menu rendering and improve projection sampling
- Updated AsciiRasterizer to support game and episode selection menus with improved layout and cursor handling.
- Enhanced SixelRasterizer and SoftwareRasterizer to modularize menu drawing logic for game and episode selection.
- Introduced new methods for drawing menus and applying fade effects across rasterizers.
- Adjusted wall texture sampling in Rasterizer to anchor to projection height center for consistent rendering.
- Added tests for wall texture sampling behavior to ensure legacy compatibility and new functionality.
- Modified Flutter audio adapter to use nullable access for active game and adjusted game selection logic in the main class.
- Cleaned up input handling in Wolf3dFlutterInput by removing unused menu tap variables.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 20:06:18 +01:00
hans be03bd45c8 Refactor ASCII rasterizer to support terminal ANSI mode and improve menu text rendering
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 16:06:20 +01:00
hans 839fae700f WIP fixing menu rendering in CLI ASCII mode
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 14:08:21 +01:00
hans dc1acb7a2f WIP pushing menu to game engine - improving menu text clarity in ASCII mode
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 12:45:04 +01:00
hans e39dfd5da0 WIP moving difficulty selection to engine
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 12:25:59 +01:00
hans 0f7c77e85a Set default CLI rasterizer to be ASCII
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 10:03:30 +01:00
hans 3c6a4672f7 Refactor and enhance documentation across the Wolf3D project
- Updated library imports to use the correct package paths for consistency.
- Added detailed documentation comments to various classes and methods, improving code readability and maintainability.
- Refined the GameSelectScreen, SpriteGallery, and VgaGallery classes with clearer descriptions of their functionality.
- Enhanced the CliInput class to better explain the input handling process and its interaction with the engine.
- Improved the SixelRasterizer and Opl2Emulator classes with comprehensive comments on their operations and state management.
- Removed the deprecated wolf_3d.dart file and consolidated its functionality into wolf_3d_flutter.dart for a cleaner architecture.
- Updated the Wolf3dFlutterInput class to clarify its role in merging keyboard and pointer events.
- Enhanced the rendering classes to provide better context on their purpose and usage within the Flutter framework.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 10:01:12 +01:00
hans 28938f7301 Refactor game loop to await start and enhance Sixel rasterizer terminal support detection
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:43:39 +01:00
hans b040b88d8a Cleaned up cli initialization
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:06:07 +01:00
hans 7ee1d0704d Fixes pushwalls and a bunch of ASCII/sixel rasterizer issues
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:02:39 +01:00
hans d7692ea325 Improves ASCII rasterization speed and simplifies API
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 01:37:04 +01:00
hans 309bf5c699 Added ability to swap between ASCII and sixel renderers when pressing tab
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 01:02:46 +01:00
hans 58838a1baa Remove ascii theme switching since we don't need it anymore with the updated ascii rasterizer
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 00:16:07 +01:00
hans 458c0a5d14 Double "resolution" in the CLI
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 23:41:05 +01:00
hans f9e4f08363 Added ability to switch ascii themes by pressing tab
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 23:12:35 +01:00
hans c424e10475 Enable option to turn on mouselook
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 20:45:29 +01:00
hans 55cf73f7f5 Moved away from singleton pattern
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 20:24:39 +01:00
hans 4c28a66554 Corrected enemy entity mapping
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 20:06:11 +01:00
hans 815ca4a13e Added tests for validating enemy sprite ranges
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 17:30:56 +01:00
hans ff051d1f34 Update enemy sprite IDs
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 13:15:35 +01:00