yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::usage_preview::Tile16UsagePreview Class Reference

#include <usage_preview.h>

Collaboration diagram for yaze::editor::usage_preview::Tile16UsagePreview:

Public Member Functions

absl::Status Configure (Rom *rom, zelda3::GameData *game_data, int area)
 Loads overworld area area (graphics and palette) and the tile16 table.
 
std::vector< int > Tile16sUsingTile (uint16_t sheet, int tile_index) const
 
PreviewImage Render (const SheetPixels &sheets, const std::vector< int > &tile16s, uint16_t sheet, int tile_index, std::vector< SDL_Rect > *highlights=nullptr)
 
int area () const
 

Private Member Functions

std::vector< int > TileIdsFor (uint16_t sheet, int tile_index) const
 

Private Attributes

Rom * rom_ = nullptr
 
zelda3::GameData * game_data_ = nullptr
 
int area_ = -1
 
std::unique_ptr< zelda3::OverworldMap > map_
 
std::vector< gfx::Tile16 > tiles16_
 

Detailed Description

Definition at line 224 of file usage_preview.h.

Member Function Documentation

◆ Configure()

absl::Status yaze::editor::usage_preview::Tile16UsagePreview::Configure ( Rom * rom,
zelda3::GameData * game_data,
int area )

Loads overworld area area (graphics and palette) and the tile16 table.

Definition at line 545 of file usage_preview.cc.

References area(), area_, game_data_, yaze::Rom::is_loaded(), yaze::zelda3::kNumOverworldAreas, map_, yaze::zelda3::ReadMap16Tiles(), rom_, and tiles16_.

Here is the call graph for this function:

◆ Tile16sUsingTile()

std::vector< int > yaze::editor::usage_preview::Tile16UsagePreview::Tile16sUsingTile ( uint16_t sheet,
int tile_index ) const

Tile16s in the loaded area's blockset that use 8x8 tile tile_index (0-63) of sheet, in any of the slots the area loads it into.

Definition at line 593 of file usage_preview.cc.

References TileIdsFor(), and tiles16_.

Here is the call graph for this function:

◆ Render()

PreviewImage yaze::editor::usage_preview::Tile16UsagePreview::Render ( const SheetPixels & sheets,
const std::vector< int > & tile16s,
uint16_t sheet,
int tile_index,
std::vector< SDL_Rect > * highlights = nullptr )

Draws tile16s in rows of 8 (16x16 each) with sheets swapped in. Quadrants that use sheet/tile_index are listed in highlights as pixel rectangles.

Definition at line 611 of file usage_preview.cc.

References yaze::editor::usage_preview::PreviewImage::colors, yaze::editor::usage_preview::PreviewImage::height, yaze::editor::usage_preview::PreviewImage::index0_transparent, map_, yaze::editor::usage_preview::PreviewImage::pixels, TileIdsFor(), tiles16_, and yaze::editor::usage_preview::PreviewImage::width.

Here is the call graph for this function:

◆ area()

int yaze::editor::usage_preview::Tile16UsagePreview::area ( ) const
inline

Definition at line 241 of file usage_preview.h.

References area_.

Referenced by Configure().

◆ TileIdsFor()

std::vector< int > yaze::editor::usage_preview::Tile16UsagePreview::TileIdsFor ( uint16_t sheet,
int tile_index ) const
private

Definition at line 577 of file usage_preview.cc.

References map_.

Referenced by Render(), and Tile16sUsingTile().

Member Data Documentation

◆ rom_

Rom* yaze::editor::usage_preview::Tile16UsagePreview::rom_ = nullptr
private

Definition at line 246 of file usage_preview.h.

Referenced by Configure().

◆ game_data_

zelda3::GameData* yaze::editor::usage_preview::Tile16UsagePreview::game_data_ = nullptr
private

Definition at line 247 of file usage_preview.h.

Referenced by Configure().

◆ area_

int yaze::editor::usage_preview::Tile16UsagePreview::area_ = -1
private

Definition at line 248 of file usage_preview.h.

Referenced by area(), and Configure().

◆ map_

std::unique_ptr<zelda3::OverworldMap> yaze::editor::usage_preview::Tile16UsagePreview::map_
private

Definition at line 249 of file usage_preview.h.

Referenced by Configure(), Render(), and TileIdsFor().

◆ tiles16_

std::vector<gfx::Tile16> yaze::editor::usage_preview::Tile16UsagePreview::tiles16_
private

Definition at line 250 of file usage_preview.h.

Referenced by Configure(), Render(), and Tile16sUsingTile().


The documentation for this class was generated from the following files: