Commit Graph

278 Commits

Author SHA1 Message Date
scawful
8bc896265f Refactor BackgroundBuffer tile access methods for improved validation and performance
- Updated SetTileAt and GetTileAt methods to enhance boundary checks, ensuring valid tile coordinates are used.
- Simplified buffer resizing logic in DrawBackground to accurately reflect the number of tiles based on width and height.
- Improved tile drawing logic to prevent unnecessary operations when the tile value is 0xFFFF, enhancing rendering efficiency.
2025-09-23 22:01:43 -04:00
scawful
223544fa01 Add copy and move constructors to Bitmap class for better resource management
- Implemented a copy constructor and copy assignment operator to enable deep copying of Bitmap objects.
- Added move constructor and move assignment operator to optimize resource handling and prevent unnecessary data duplication.
- Introduced SetPixel method for modifying individual pixels in the bitmap.
- Added Resize method to adjust bitmap dimensions while preserving existing pixel data, enhancing flexibility in bitmap manipulation.
2025-09-23 22:01:06 -04:00
scawful
c9921c91bf Refactor editor manager and dungeon editor for improved clarity and performance
- Removed unused functions and streamlined shortcut registration in EditorManager for better readability.
- Updated lambda captures to use 'this' pointer for consistency and clarity.
- Refactored DungeonEditor to utilize ranges for sorting and filling operations, enhancing performance and readability.
- Simplified table setup in DungeonEditor by using a static array for tool names, improving maintainability.
2025-08-03 17:53:34 -04:00
scawful
fdda77c172 Refactor ROM handling and remove SharedRom singleton for improved architecture
- Eliminated the SharedRom class to enhance modularity and reduce global state management.
- Updated various classes to directly manage ROM instances, improving clarity and encapsulation.
- Added new functions for loading messages and colors from ROM, enhancing functionality.
- Refactored Canvas and Editor classes to utilize direct ROM references, streamlining interactions.
- Improved documentation and comments for better code understanding and maintainability.
2025-08-03 17:52:02 -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
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
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
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
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
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
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
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
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
3bd05f6beb Enhance Renderer class with Clear and Present methods for improved rendering control; remove unnecessary comments and streamline SDL_Surface and SDL_Texture deleters by eliminating memory tracking logic. Additionally, remove unused TexturePool class to simplify the codebase. 2025-04-30 00:44:12 -04:00
scawful
ad60cd3fd3 Remove snes.h header file and migrate SNES-related structures to yaze.h for better organization; update includes in snes_color.h and snes_tile.h accordingly. 2025-04-29 13:38:20 -04:00
scawful
0b9002e455 Refactor TexturePool class for improved readability and maintainability; reorganize method definitions and formatting for consistency. 2025-04-29 08:20:59 -04:00
scawful
3dc8a1f0ee Add Tile class and constructor overloads for tile data initialization 2025-04-29 00:09:58 -04:00
scawful
102f7b95e0 Add Tilemap functionality with creation, updating, and rendering capabilities; implement data retrieval for individual tiles, enhancing graphics management in the application. 2025-04-29 00:09:32 -04:00
scawful
8c207dc292 Implement SnesColor and SnesPalette constructors for enhanced color initialization; add methods for setting RGB and SNES values in SnesColor, improving color management and conversion capabilities. 2025-04-18 19:04:59 -04:00
scawful
9ad41f9f8b Refactor SnesColor class to use constexpr for constructors and methods, improving compile-time evaluation and performance; include <array> for better type handling. 2025-04-17 21:49:55 -04:00
scawful
44e13cf4bb Refactor bitmap palette management across various components to streamline palette setting and improve error handling; remove unnecessary status checks and enhance consistency in palette application methods. 2025-04-17 21:49:47 -04:00
scawful
a267e18f46 Refactor Bitmap class to improve texture management and memory tracking; implement custom allocators for SDL_Surface and SDL_Texture, enhance bitmap constructors, and add utility functions for tile extraction and pixel manipulation. 2025-04-16 22:35:47 -04:00
scawful
875d3d2bcf Introduce TexturePool for efficient texture reuse. 2025-04-16 22:35:42 -04:00
scawful
5637c20cb5 Add palette constants 2025-04-12 13:24:56 -04:00
scawful
95df0b5d8b Refactor Bitmap class: remove deprecated constructor and update Initialize method signature 2025-03-20 18:17:45 -04:00
scawful
c99a4b0bc4 rename ApplyPalette with SetPalette 2025-03-02 17:06:46 -05:00
scawful
4dc09ad5fc Refactor graphics loading: simplify function calls by removing namespace prefixes and improve header organization in scad_format 2025-02-28 00:46:39 -05:00
scawful
26cda69d44 Refactor common functionality into zelda3 namespace; remove references to core::common 2025-01-22 13:53:01 -05:00
scawful
e0797fee24 Rename snes_color.h to snes.h and consolidate tile structures 2025-01-19 21:00:51 -05:00
scawful
809282edad remove nonstandard type aliases 2025-01-19 20:16:40 -05:00
scawful
20ab684aae Add begin() and end() methods to SnesPalette for improved iteration 2025-01-18 22:01:45 -05:00
scawful
339df53674 Refactor ROM loading methods 2025-01-18 12:33:33 -05:00
scawful
c8883a1e54 Remove unused includes and clean up header files 2025-01-16 03:44:37 -05:00
scawful
65be2d0bd2 move sdl_delete.h to platform 2025-01-06 13:23:07 -05:00
Justin Scofield
cf13d6bf9e Update Bitmap and add Initialize function 2025-01-05 20:55:36 -05:00
scawful
92d6738a5c remove cached converted surface from Bitmap class 2025-01-01 16:08:43 -05:00
scawful
d711a84ed3 refactor Bitmap class: rename ConvertSurfaceToPNG to ConvertSurfaceToPng and streamline GetPngData method 2025-01-01 15:53:17 -05:00
Justin Scofield
ef44313671 housekeeping combo 2024-12-31 20:50:24 -05:00
scawful
a54143cbab Refactor Hyrule Magic compression functions to return std::vector<uint8_t> instead of raw pointers for improved memory management 2024-12-31 18:32:25 -05:00
scawful
308eb4b287 Rename Hyrule Magic compression functions; update deprecation notes 2024-12-31 18:20:18 -05:00
scawful
fd102a5d3c Refactor CompressionPiece constructor to accept string by reference and clean up unused comments 2024-12-31 18:19:49 -05:00
scawful
da36236433 Refactor SnesPalette and PaletteGroup, fix bug with group names 2024-12-31 17:39:25 -05:00