yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_map_screen.h
Go to the documentation of this file.
1#ifndef YAZE_APP_ZELDA3_OVERWORLD_MAP_SCREEN_H
2#define YAZE_APP_ZELDA3_OVERWORLD_MAP_SCREEN_H
3
4#include <array>
5
6#include "absl/status/status.h"
9#include "rom/rom.h"
10
11namespace yaze {
12namespace zelda3 {
13
25 public:
30 absl::Status Create(Rom* rom);
31
32 // Clear ROM-derived logical state without moving queued Bitmap owners.
33 void ResetForReload();
34
39 absl::Status Save(Rom* rom);
40
41 // Accessors for tile data
42 auto& lw_tiles() { return lw_map_tiles_; }
43 auto& dw_tiles() { return dw_map_tiles_; }
44
45 // Mutable accessors for editing
46 auto& mutable_lw_tiles() { return lw_map_tiles_; }
47 auto& mutable_dw_tiles() { return dw_map_tiles_; }
48
49 // Bitmap accessors
50 auto& tiles8_bitmap() { return tiles8_bitmap_; }
51 auto& map_bitmap() { return map_bitmap_; }
52
53 // Palette accessors
54 auto& lw_palette() { return lw_palette_; }
55 auto& dw_palette() { return dw_palette_; }
56
61 absl::Status RenderMapLayer(bool use_dark_world);
62
67 absl::Status LoadCustomMap(const std::string& file_path);
68
74 absl::Status SaveCustomMap(const std::string& file_path, bool use_dark_world);
75
76 private:
81 absl::Status LoadMapData(Rom* rom);
82
83 std::array<uint8_t, 64 * 64> lw_map_tiles_; // Light World tile indices
84 std::array<uint8_t, 64 * 64> dw_map_tiles_; // Dark World tile indices
85
86 gfx::Bitmap tiles8_bitmap_; // 128x128 tileset (mode 7 graphics)
87 gfx::Bitmap map_bitmap_; // 512x512 rendered map (64 tiles × 8 pixels)
88
89 gfx::SnesPalette lw_palette_; // Light World palette
90 gfx::SnesPalette dw_palette_; // Dark World palette
91};
92
93} // namespace zelda3
94} // namespace yaze
95
96#endif // YAZE_APP_ZELDA3_OVERWORLD_MAP_SCREEN_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
OverworldMapScreen manages the overworld map (pause menu) graphics.
std::array< uint8_t, 64 *64 > dw_map_tiles_
absl::Status SaveCustomMap(const std::string &file_path, bool use_dark_world)
Save map data to external binary file.
absl::Status LoadCustomMap(const std::string &file_path)
Load custom map from external binary file.
std::array< uint8_t, 64 *64 > lw_map_tiles_
absl::Status LoadMapData(Rom *rom)
Load map tile data from ROM Reads the interleaved tile format from 4 ROM sections.
absl::Status Save(Rom *rom)
Save changes back to ROM.
absl::Status RenderMapLayer(bool use_dark_world)
Render map tiles into bitmap.
absl::Status Create(Rom *rom)
Initialize and load overworld map data from ROM.