14 data_.reserve(256 * 256);
15 for (
int i = 0; i < 256 * 256; i++) {
16 data_.push_back(0xFF);
19 for (
int i = 0; i < 0x500; i += 0x08) {
29 const int offsets[] = {0x00, 0x08, 0x800, 0x808};
34 for (
const auto& tile :
tiles_) {
35 int offset = offsets[i];
36 for (
auto y = 0; y < 0x08; ++y) {
37 for (
auto x = 0; x < 0x08; ++x) {
41 if (tile.horizontal_mirror_ != 0) {
45 if (tile.vertical_mirror_ != 0) {
49 int xpos = ((tile.id_ % 0x10) * 0x08);
50 int ypos = (((tile.id_ / 0x10)) * 0x400);
51 int source = ypos + xpos + (x + (y * 0x80));
53 auto destination = xx + yy + offset + (mx + (my * 0x100));
73 return absl::OkStatus();
78 for (
int i = 0; i < 6 * 0x2000; i++)
tilesheets_.push_back(0xFF);
80 std::vector<uint8_t>
test;
81 for (
int i = 0; i < 0x4000; i++) {
84 for (
int i = 0x8000; i < +0x8000 + 0x2000; i++) {
88 auto hud_pal_group =
rom()->palette_group().hud;
92 return absl::OkStatus();
void RenderBitmap(gfx::Bitmap *bitmap)
Used to render a bitmap to the screen.
absl::Status BuildTileset()
gfx::SnesPalette palette_
std::vector< uint8_t > data_
gfx::Bitmap tilesheets_bmp_
std::vector< uint8_t > test_
std::vector< gfx::TileInfo > tiles_
std::vector< uint8_t > tilesheets_
static Renderer & GetInstance()
#define RETURN_IF_ERROR(expression)
#define ASSIGN_OR_RETURN(type_variable_name, expression)
TileInfo GetTilesInfo(uint16_t tile)
Zelda 3 specific classes and functions.
constexpr int kBowItemPos
Main namespace for the application.
absl::StatusOr< std::vector< uint8_t > > Load2BppGraphics(const Rom &rom)
Loads 2bpp graphics from Rom data.