17 data_.reserve(256 * 256);
18 for (
int i = 0; i < 256 * 256; i++) {
19 data_.push_back(0xFF);
22 for (
int i = 0; i < 0x500; i += 0x08) {
28 const int offsets[] = {0x00, 0x08, 0x800, 0x808};
33 for (
const auto& tile :
tiles_) {
34 int offset = offsets[i];
35 for (
auto y = 0; y < 0x08; ++y) {
36 for (
auto x = 0; x < 0x08; ++x) {
40 if (tile.horizontal_mirror_ != 0) {
44 if (tile.vertical_mirror_ != 0) {
48 int xpos = ((tile.id_ % 0x10) * 0x08);
49 int ypos = (((tile.id_ / 0x10)) * 0x400);
50 int source = ypos + xpos + (x + (y * 0x80));
52 auto destination = xx + yy + offset + (mx + (my * 0x100));
53 data_[destination] = (
test_[source] & 0x0F) + tile.palette_ * 0x08;
72 return absl::OkStatus();
77 for (
int i = 0; i < 6 * 0x2000; i++)
tilesheets_.push_back(0xFF);
79 std::vector<uint8_t> test;
80 for (
int i = 0; i < 0x4000; i++) {
83 for (
int i = 0x8000; i < +0x8000 + 0x2000; i++) {
87 auto hud_pal_group =
rom()->palette_group().hud;
91 return absl::OkStatus();
static Renderer & GetInstance()
void RenderBitmap(gfx::Bitmap *bitmap)
Used to render a bitmap to the screen.
absl::Status ApplyPalette(const SnesPalette &palette)
Copy color data from the SnesPalette into the SDL_Palette.
void Create(int width, int height, int depth, const std::vector< uint8_t > &data)
Creates a bitmap object with the provided graphical data.
std::vector< uint8_t > test_
std::vector< uint8_t > tilesheets_
std::vector< uint8_t > data_
gfx::Bitmap tilesheets_bmp_
gfx::SnesPalette palette_
std::vector< gfx::TileInfo > tiles_
absl::Status BuildTileset()
#define RETURN_IF_ERROR(expression)
#define ASSIGN_OR_RETURN(type_variable_name, expression)
TileInfo GetTilesInfo(uint16_t tile)
constexpr int kBowItemPos