yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
background_buffer.h
Go to the documentation of this file.
1#ifndef YAZE_APP_GFX_BACKGROUND_BUFFER_H
2#define YAZE_APP_GFX_BACKGROUND_BUFFER_H
3
4#include <cstdint>
5#include <vector>
6
7#include "app/gfx/bitmap.h"
8#include "app/gfx/snes_tile.h"
9
10namespace yaze {
11namespace gfx {
12
14 public:
15 BackgroundBuffer(int width = 512, int height = 512);
16
17 // Buffer manipulation methods
18 void SetTileAt(int x, int y, uint16_t value);
19 uint16_t GetTileAt(int x, int y) const;
20 void ClearBuffer();
21
22 // Drawing methods
23 void DrawTile(const TileInfo& tile_info, uint8_t* canvas,
24 const uint8_t* tiledata, int indexoffset);
25 void DrawBackground(std::span<uint8_t> gfx16_data);
26
27 // Floor drawing methods
28 void DrawFloor(const std::vector<uint8_t>& rom_data, int tile_address,
29 int tile_address_floor, uint8_t floor_graphics);
30
31 // Accessors
32 auto buffer() { return buffer_; }
33 auto& bitmap() { return bitmap_; }
34
35 private:
36 std::vector<uint16_t> buffer_;
38 int width_;
40};
41
42} // namespace gfx
43} // namespace yaze
44
45#endif // YAZE_APP_GFX_BACKGROUND_BUFFER_H
void DrawTile(const TileInfo &tile_info, uint8_t *canvas, const uint8_t *tiledata, int indexoffset)
void DrawBackground(std::span< uint8_t > gfx16_data)
BackgroundBuffer(int width=512, int height=512)
void SetTileAt(int x, int y, uint16_t value)
void DrawFloor(const std::vector< uint8_t > &rom_data, int tile_address, int tile_address_floor, uint8_t floor_graphics)
uint16_t GetTileAt(int x, int y) const
std::vector< uint16_t > buffer_
Represents a bitmap image.
Definition bitmap.h:59
SNES 16-bit tile metadata container.
Definition snes_tile.h:50
Contains classes for handling graphical data.
Definition arena.cc:8
Main namespace for the application.
Definition controller.cc:18