Commit Graph

2320 Commits

Author SHA1 Message Date
scawful
a9a9cc888b Refactor event handling and controller initialization for improved clarity
- Moved event handling logic from the Controller class to a new HandleEvents function in the Window class, enhancing separation of concerns.
- Simplified the OnEntry method by removing the Initialize function call and directly initializing the editor manager.
- Updated the OnLoad method to check for window activity, improving the logic for managing the controller's active state.
- Cleaned up the controller header by removing the obsolete Initialize method, streamlining the interface.
2025-08-03 16:42:06 -04:00
scawful
b5f6930d38 Refactor window management and renderer integration for improved structure
- Replaced platform backend references with a dedicated Window class for better encapsulation of window and audio device management.
- Updated various files to include the new window header, enhancing clarity and reducing dependencies on the platform backend.
- Removed obsolete platform backend code to streamline the codebase and improve maintainability.
- Refactored controller and editor classes to utilize the new window management system, ensuring consistent handling of window creation and rendering.
2025-08-03 16:09:51 -04:00
scawful
e05e59fb14 Refactor color conversion logic for improved accuracy and consistency
- Updated color channel assignments in ConvertRgbToSnes and SnesColor constructor to remove unnecessary static_cast, enhancing clarity and ensuring correct value usage.
- Simplified namespace declaration in snes_palette.cc for better readability.
- Changed Paletteset constructor parameters to use const references, improving performance and consistency in object handling.
2025-05-26 13:55:38 -04:00
scawful
006624c0d8 Refactor assembly and overworld editor code for improved readability and performance
- Updated namespace usage to yaze::editor for consistency.
- Replaced string search methods with contains and ranges::find for better clarity and performance.
- Simplified Load function in AssemblyEditor for conciseness.
- Enhanced OverworldEditor by consolidating GUI element bindings and improving input handling.
- Refactored toolset drawing logic to streamline the editor interface and improve user experience.
2025-05-26 13:54:58 -04:00
scawful
3c734207be Enhance Dungeon Map functionality and refactor code structure
- Added dungeon_map.cc to the build configuration for improved organization.
- Refactored namespace usage to yaze::zelda3 for better clarity.
- Updated LoadDungeonMaps and SaveDungeonMaps functions to use kNumRooms constant for room handling.
- Improved error handling in LoadDungeonMapGfxFromBinary function and added comments for better documentation.
2025-05-19 17:28:45 -04:00
scawful
095b3df27e Refactor graphics loading and decompression for consistency
- Updated various graphics loading functions to ensure consistent use of semicolons in ASSIGN_OR_RETURN statements.
- Changed set_filename method in Rom class to accept std::string_view for improved efficiency.
- Enhanced code readability and maintainability across multiple files by standardizing syntax.
2025-05-19 17:15:15 -04:00
scawful
30f0ae37a3 Add Save/Load for Dungeon Maps and Dungeon Map Tile16 2025-05-18 16:46:20 -04:00
scawful
a682ea9553 Port ScreenEditor to use Tilemap, remove Tilesheet class 2025-05-18 16:46:04 -04:00
scawful
7cc808918d Enhance Bitmap class with error handling and code improvements
- Introduced BitmapError class for more specific error handling in the Bitmap class.
- Updated data checks to use `empty()` for clarity and consistency.
- Improved pixel data handling by ensuring proper type usage and modifying loop constructs for better performance.
- Refactored constructor and method implementations for improved readability and maintainability.
2025-05-18 16:44:15 -04:00
scawful
f632650568 Update SnesColor constructor and add SnesTile tests
- Changed SnesColor constructor to remove constexpr, improving compatibility with non-constant expressions.
- Added new tests for SnesTile functionality, including unpacking, packing, and conversion between different bit depths.
- Enhanced TileInfo and Tile32 tests to verify construction, operations, and bit manipulation for better coverage.
2025-05-15 23:05:25 -04:00
scawful
ceab496226 Refactor Bitmap class for improved data handling
- Removed unused data_size_ member and updated size() method to return the size of data_ directly.
- Simplified data size checks in Create method to enhance clarity.
- Updated UpdateTexture method to use memcpy for pixel data assignment, improving performance.
- Ensured WriteToPixel method updates both pixel_data_ and data_ for consistency in modifications.
2025-05-15 23:01:03 -04:00
scawful
ab729fc198 Fix color conversion to ensure proper type casting in SNES color functions
- Updated ConvertRgbToSnes function to use static_cast for color channel values, ensuring correct conversion to uint8_t.
- Modified SnesColor constructor to apply static_cast for color channel values during initialization, improving accuracy in color representation.
2025-05-15 22:59:17 -04:00
scawful
47ab1bdfd5 Add tests for ParseSingleMessage handling special characters and dictionary references
- Introduced tests for ParseSingleMessage to validate parsing of special characters and dictionary references.
- Added a test case for handling invalid terminators in message data.
- Enhanced existing tests for better coverage of message parsing scenarios.
2025-05-15 22:59:02 -04:00
scawful
1031509e8a Refactor Emulator and Snes classes for improved memory access
- Updated Emulator class to remove inheritance from SharedRom and streamline ROM handling.
- Refactored memory access methods in Emulator and Snes classes to use consistent naming conventions.
- Enhanced DungeonObjectRenderer to utilize the updated Snes class for CPU and memory operations, improving clarity and maintainability.
- Cleaned up unnecessary comments and improved code formatting for better readability.
2025-05-15 22:53:37 -04:00
scawful
86d72fe0ca Refactor shortcut key constants to use static storage duration 2025-05-15 22:50:27 -04:00
scawful
206a1a6935 Refactor ROM saving process to utilize SaveSettings struct
- Updated yaze_save_rom and Backup command to use the new SaveSettings struct for improved clarity and maintainability.
- Adjusted SaveToFile calls in Tile16Transfer to align with the new structured settings approach.
- Enhanced parameter management for ROM saving operations across multiple components.
2025-05-15 22:47:34 -04:00
scawful
120eb544bf Add 16x16 tile rendering and modification functions
- Introduced RenderTile16 and UpdateTile16 functions for rendering and updating 16x16 tiles in the Tilemap.
- Added ModifyTile16 function to facilitate the composition and placement of tile parts within the Tilemap.
- Updated Tilemap structure to include a vector for storing tile information.
- Refactored related functions to enhance tile handling and rendering capabilities.
2025-05-15 22:40:54 -04:00
scawful
8d34ebf534 Refactor ROM save functionality to use structured settings
- Introduced a new SaveSettings struct to encapsulate parameters for the SaveToFile method, improving clarity and maintainability.
- Updated SaveToFile method signature to accept SaveSettings instead of individual parameters.
- Adjusted SaveRom method in EditorManager to utilize the new SaveSettings struct for better parameter management.
- Removed redundant label loading from LoadFromFile when z3_load is true, streamlining the loading process.
2025-05-13 21:00:53 -04:00
scawful
0863b7c606 Refactor graphics editor and screen editor tab handling
- Updated tab item handling in GraphicsEditor and ScreenEditor to ensure proper opening and closing of tab items.
- Improved layout management by replacing deprecated macros with ImGui table functions for better readability and maintainability.
- Adjusted palette display function signature in color handling to return a boolean for success status instead of absl::Status.
- Enhanced tile rendering functions for consistency and clarity in the graphics editing workflow.
2025-05-13 17:30:18 -04:00
scawful
afc33cb7dd Refactor RoomEntrance class to use pointer for Rom parameter
- Updated RoomEntrance constructor and Save method to accept a pointer to Rom instead of a reference, improving memory management.
- Refactored data access methods to utilize the new pointer syntax for reading and writing ROM data.
- Enhanced code readability and consistency by applying the pointer approach throughout the class methods.
2025-05-13 17:29:18 -04:00
scawful
951fc6a8a2 Enhance message data handling and editor functionality
- Updated ReadAllTextData to return a vector of MessageData instead of modifying an external list, improving data management.
- Added support for special elements in ParseMessageData to enhance message parsing capabilities.
- Introduced DisplayTextOverflowError function for better error handling in message saving.
- Refactored MessageEditor to utilize the new ReadAllTextData signature and improved expanded message handling.
- Cleaned up unused functions and variables in MessageEditor for better code organization.
2025-05-12 11:46:00 -04:00
scawful
ce6cde438c Refactor message handling and improve message editor functionality
- Combined TextCommands and SpecialChars into a single vector for streamlined matching in FindMatchingElement.
- Removed unnecessary logging in ParseMessageToData for cleaner error handling.
- Updated FindRealDictionaryEntry function signature for improved readability.
- Enhanced DrawCurrentMessage to strip newline characters from input before parsing.
- Added command parameter input in DrawTextCommands for better user interaction.
- Cleaned up unused ToString methods in MessageData and TextElement structures.
2025-05-10 12:52:34 -04:00
scawful
f75830c06c Add LoadFontGraphics function and update Load2BppGraphics sheet IDs
- Introduced LoadFontGraphics function to handle font graphics loading from ROM data.
- Updated Load2BppGraphics to use hex sheet IDs.
2025-05-10 11:01:24 -04:00
scawful
a393303d41 Refactor tile handling functions to use std::span for improved performance and safety
- Updated UnpackBppTile and ConvertBpp functions to accept std::span instead of std::vector, enhancing flexibility and reducing unnecessary copies.
- Refactored LoadSNES4bppGFXToIndexedColorMatrix to return a std::vector instead of modifying a destination span, improving usability.
- Cleaned up variable names for consistency and readability throughout the affected functions.
2025-05-10 11:00:38 -04:00
scawful
d97824c575 Update DrawTileSelector to support variable tile height
- Modified DrawTileSelector function to accept an additional parameter for tile height, defaulting to the original size if not provided.
- Adjusted the logic for calculating the second point in the tile selection to use the new height parameter, improving flexibility in tile rendering.
2025-05-10 11:00:08 -04:00
scawful
b872fd9672 Add message preview functionality and refactor MessageEditor
- Introduced MessagePreview class to handle message rendering and preview logic.
- Updated MessageEditor to utilize MessagePreview for drawing messages and managing font graphics.
- Refactored drawing methods to improve organization and clarity, including the addition of DrawFontAtlas and DrawExpandedMessageSettings.
- Enhanced message handling by integrating new dictionary entry lookup and improved bitmap updates for message previews.
- Cleaned up unused functions and variables to streamline the codebase.
2025-05-10 10:59:55 -04:00
scawful
4b7bbfaf1c Add MemoryEditorPopup function 2025-05-10 09:43:45 -04:00
scawful
a2af47fd0a housekeeping 2025-05-10 09:43:17 -04:00
scawful
179ab5bc40 Refactor dungeon entrance loading and clean up unused renderer object 2025-05-08 22:35:10 -04:00
scawful
68c1ab2f02 Enhance tilemap functionality and improve bitmap handling
- Replaced instances of Renderer::GetInstance() with Renderer::Get() for consistency in tilemap rendering.
- Introduced new functions for fetching and mirroring tile data, enhancing tile manipulation capabilities.
- Added ComposeTile16 function to facilitate the composition of 16x16 tile graphics from individual tile parts.
- Updated RenderTile to handle bitmap updates more efficiently and ensure proper rendering of tiles.
- Included necessary header for SNES tile handling to support new functionalities.
2025-05-08 22:34:39 -04:00
scawful
5167bb7206 Refactor bitmap handling and remove unused functions for improved clarity
- Simplified pixel format handling by removing the 2BPP format and adjusting related cases.
- Eliminated unused texture tracking variables from the Bitmap class.
- Removed the ExtractTile8Bitmaps function to streamline bitmap processing and reduce complexity.
2025-05-08 19:42:20 -04:00
scawful
2901c9a486 Refactor message handling and improve graphics rendering in MessageEditor
- Added SNES header include to message_data.cc for better integration.
- Simplified dictionary token formatting in ReadAllTextData function.
- Removed unused ImportMessageData function from message_data.h.
- Streamlined bitmap updates and rendering in MessageEditor, replacing instances of Renderer::GetInstance() with Renderer::Get().
- Enhanced message preview functionality with improved scrolling and drawing logic.
- Adjusted canvas sizes for better layout consistency.
2025-05-08 19:40:29 -04:00
scawful
fcb6a46bb1 Refactor Renderer access and improve gesture handling in iOS and test files
- Replaced instances of Renderer::GetInstance() with Renderer::Get() for consistency across the codebase.
- Enhanced gesture handling in iOS by adding mouse position events for touch gestures.
- Streamlined test initialization for ImGui to align with recent renderer access changes.
2025-05-08 19:39:49 -04:00
scawful
11504ca4c1 Refactor Renderer access and enhance graphics loading functionality
- Replaced instances of Renderer::GetInstance() with Renderer::Get() for consistency across the codebase.
- Updated various rendering methods to streamline bitmap updates and enhance performance.
- Removed unused includes and comments to improve code clarity and maintainability.
2025-05-08 19:37:48 -04:00
scawful
fb015523dc Refactor SNES tile handling and introduce new graphics loading functionality
- Removed unused conversion functions for 3bpp to 4bpp and vice versa to streamline code.
- Updated SnesTo8bppSheet function to use std::span for improved performance and flexibility.
- Added LoadSNES4bppGFXToIndexedColorMatrix function to handle loading graphics data into an indexed color matrix, enhancing graphics management capabilities.
2025-05-08 11:44:22 -04:00
scawful
43bf1e04c5 Refactor PaletteEditor to enhance color management and UI functionality
- Removed unused methods and streamlined color handling in the PaletteEditor.
- Introduced a quick access tab for palette categories and improved custom palette editing with context menus.
- Enhanced color picker functionality and added recently used colors feature for better user experience.
- Updated palette drawing methods to improve clarity and maintainability.
2025-05-05 16:17:39 -04:00
scawful
0e39c2b201 Remove kDrawDungeonRoomGraphics feature and related code from FeatureFlags and DungeonEditor for improved clarity and performance. Update room loading and rendering methods to streamline graphics management using gfx::Arena. 2025-05-05 12:28:25 -04:00
scawful
cb2473e656 Refactor LoadAssets method in EditorManager to streamline asset loading 2025-05-05 11:42:37 -04:00
scawful
c08386801e Add BackgroundBuffer class for managing SNES background graphics
Introduce the BackgroundBuffer class to handle tile management and rendering for SNES backgrounds. This includes methods for setting and getting tile values, clearing the buffer, and drawing tiles and backgrounds using provided graphics data. The class is designed to facilitate efficient graphics rendering in the application.
2025-05-03 23:40:41 -04:00
scawful
38b459777d Add RenderRoomGraphics method to Room class for improved graphics rendering
Implement RenderRoomGraphics in the Room class to handle the rendering of room graphics, including floor and background drawing. This addition enhances the graphics management by utilizing the gfx::Arena for rendering operations and updating bitmaps as needed. Update room.h to declare the new method.
2025-05-03 23:40:26 -04:00
scawful
d98e8bc324 Refactor Inventory class to remove inheritance from SharedRom and add ROM pointer management. Update LoadDungeonMapGfxFromBinary to simplify palette setting logic, enhancing code clarity and maintainability. 2025-05-03 17:24:43 -04:00
scawful
6e09630733 Refactor HandleHexStringParams to modify hex string directly and add hex_test for comprehensive testing of hex conversion functions with various prefixes. 2025-05-03 14:09:35 -04:00
scawful
95ff46a73f Remove redundant bitmap clearing logic in OverworldEditor::Clear for improved performance and clarity. 2025-05-03 14:08:12 -04:00
scawful
1710430c2e Remove unused methods and comments from Bitmap class for improved clarity and maintainability. This includes the removal of surface saving, initialization, cleanup, and palette management functions that are no longer needed. 2025-05-02 12:14:04 -04:00
scawful
d6551f84d2 Refactor graphics handling to utilize Arena for graphics sheets management
Update various editors to replace instances of GraphicsSheetManager with gfx::Arena for accessing graphics sheets. This change enhances memory management and performance by centralizing graphics data handling within the Arena class. Clean up related code for improved clarity and maintainability.
2025-05-02 12:06:46 -04:00
scawful
4f8d765c48 Refactor Bitmap class to utilize Arena for surface and texture management
Replace custom surface and texture allocation methods with Arena's allocation, improving memory management. Update related methods to work with raw pointers instead of smart pointers, enhancing performance and reducing overhead. Clean up unused code and comments for better clarity.
2025-04-30 18:00:44 -04:00
scawful
d92f9b7b04 Add Arena class for texture and surface management in graphics module
Introduce the Arena class to manage a collection of SDL textures and surfaces, providing methods for allocation, deallocation, and updating textures.
2025-04-30 17:59:34 -04:00
scawful
6d23128060 Refactor Room and RoomObject classes to remove inheritance from SharedRom, enhancing code clarity and maintainability. Introduce ROM pointer management in both classes for improved functionality. Update LoadRoomFromRom to accommodate new constructor signature. 2025-04-30 17:51:42 -04:00
scawful
8f50d78ec7 Refactor DungeonEditor to use arrays for rooms and entrances, improving memory management and performance. Remove unused variables and streamline drawing methods for better clarity. 2025-04-30 17:50:13 -04:00
scawful
e202d65780 Move GraphicsSheetManager to snes.h 2025-04-30 17:49:09 -04:00