yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
room_layout.h
Go to the documentation of this file.
1#ifndef YAZE_APP_ZELDA3_DUNGEON_ROOM_LAYOUT_H
2#define YAZE_APP_ZELDA3_DUNGEON_ROOM_LAYOUT_H
3
4#include <vector>
5
6#include "absl/status/status.h"
7#include "absl/status/statusor.h"
10#include "rom/rom.h"
11#include "util/stop_token.h"
14
15namespace yaze::zelda3 {
16
18 public:
19 RoomLayout() = default;
20 explicit RoomLayout(Rom* rom) : rom_(rom) {}
21
22 void SetRom(Rom* rom) { rom_ = rom; }
23
24 // Reject unterminated/truncated fixed-layout streams. Failed or cancelled
25 // loads leave no decoded objects, including after a prior successful load.
26 absl::Status LoadLayout(int layout_id, util::StopToken stop_token = {});
27
28 // Render the layout objects into the provided buffers
29 absl::Status Draw(int room_id, const uint8_t* gfx_data,
31 const gfx::PaletteGroup& palette_group, DungeonState* state,
32 uint8_t floor1_graphics, uint8_t floor2_graphics) const;
33
34 const std::vector<RoomObject>& GetObjects() const { return objects_; }
35
36 private:
37 absl::StatusOr<int> GetLayoutAddress(int layout_id) const;
38
39 Rom* rom_ = nullptr;
40 std::vector<RoomObject> objects_;
41};
42
43} // namespace yaze::zelda3
44
45#endif // YAZE_APP_ZELDA3_DUNGEON_ROOM_LAYOUT_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:49
void SetRom(Rom *rom)
Definition room_layout.h:22
std::vector< RoomObject > objects_
Definition room_layout.h:40
absl::Status Draw(int room_id, const uint8_t *gfx_data, gfx::BackgroundBuffer &bg1, gfx::BackgroundBuffer &bg2, const gfx::PaletteGroup &palette_group, DungeonState *state, uint8_t floor1_graphics, uint8_t floor2_graphics) const
const std::vector< RoomObject > & GetObjects() const
Definition room_layout.h:34
absl::StatusOr< int > GetLayoutAddress(int layout_id) const
absl::Status LoadLayout(int layout_id, util::StopToken stop_token={})
Zelda 3 specific classes and functions.
Represents a group of palettes.