yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
tile16_renderer.h
Go to the documentation of this file.
1#ifndef YAZE_ZELDA3_OVERWORLD_TILE16_RENDERER_H
2#define YAZE_ZELDA3_OVERWORLD_TILE16_RENDERER_H
3
4#include <array>
5#include <cstdint>
6#include <vector>
7
8#include "absl/status/status.h"
12
13namespace yaze::zelda3 {
14
15using Tile8PixelData = std::array<uint8_t, 64>;
16
17// Compose a tile16 pixel buffer from ALTTP TileInfo metadata.
18//
19// Rules:
20// - Each quadrant resolves tile8 ID + h/v flip from TileInfo.
21// - Pixel index is low nibble from source tile8.
22// - Palette row is encoded per quadrant: (pixel & 0x0F) + (palette * 0x10).
23std::vector<uint8_t> RenderTile16PixelsFromMetadata(
24 const gfx::Tile16& tile_data,
25 const std::vector<Tile8PixelData>& tile8_pixels);
26std::vector<uint8_t> RenderTile16PixelsFromMetadata(
27 const gfx::Tile16& tile_data,
28 const std::vector<gfx::Bitmap>& tile8_bitmaps);
29
30// Compose a tile16 bitmap (16x16, 8bpp) from metadata using the same transform
31// as RenderTile16PixelsFromMetadata.
33 const gfx::Tile16& tile_data,
34 const std::vector<Tile8PixelData>& tile8_pixels,
35 gfx::Bitmap* output_bitmap);
37 const gfx::Tile16& tile_data, const std::vector<gfx::Bitmap>& tile8_bitmaps,
38 gfx::Bitmap* output_bitmap);
39
40// Compute tile count from an active tile16 atlas using 16x16 tiles.
41// Falls back to kNumTile16Individual when atlas metadata is unavailable.
42int ComputeTile16Count(const gfx::Tilemap* tile16_blockset);
43
44// Blit a 16x16 tile bitmap into a destination atlas at tile_id location.
46 const gfx::Bitmap& source_bitmap);
47
48} // namespace yaze::zelda3
49
50#endif // YAZE_ZELDA3_OVERWORLD_TILE16_RENDERER_H
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
Tile composition of four 8x8 tiles.
Definition snes_tile.h:142
Zelda 3 specific classes and functions.
absl::Status RenderTile16BitmapFromMetadata(const gfx::Tile16 &tile_data, const std::vector< Tile8PixelData > &tile8_pixels, gfx::Bitmap *output_bitmap)
int ComputeTile16Count(const gfx::Tilemap *tile16_blockset)
std::vector< uint8_t > RenderTile16PixelsFromMetadata(const gfx::Tile16 &tile_data, const std::vector< Tile8PixelData > &tile8_pixels)
void BlitTile16BitmapToAtlas(gfx::Bitmap *destination, int tile_id, const gfx::Bitmap &source_bitmap)
std::array< uint8_t, 64 > Tile8PixelData
Room transition destination.
Definition zelda.h:448
Tilemap structure for SNES tile-based graphics management.
Definition tilemap.h:118