yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::zelda3::Sprite Class Reference

A class for managing sprites in the overworld and underworld. More...

#include <sprite.h>

Inheritance diagram for yaze::app::zelda3::Sprite:
Collaboration diagram for yaze::app::zelda3::Sprite:

Public Member Functions

 Sprite ()=default
 
 Sprite (std::vector< uint8_t > src, uint8_t overworld_map_id, uint8_t id, uint8_t x, uint8_t y, int map_x, int map_y)
 
void InitSprite (const std::vector< uint8_t > &src, uint8_t overworld_map_id, uint8_t id, uint8_t x, uint8_t y, int map_x, int map_y)
 
void UpdateBoundaryBox ()
 
void Draw ()
 
void DrawSpriteTile (int x, int y, int srcx, int srcy, int pal, bool mirror_x=false, bool mirror_y=false, int sizex=2, int sizey=2)
 
void UpdateMapProperties (uint16_t map_id) override
 
void UpdateCoordinates (int map_x, int map_y)
 
auto PreviewGraphics () const
 
auto id () const
 
auto set_id (uint8_t id)
 
auto x () const
 
auto y () const
 
auto nx () const
 
auto ny () const
 
auto map_id () const
 
auto map_x () const
 
auto map_y () const
 
auto game_state () const
 
auto layer () const
 
auto subtype () const
 
auto Width () const
 
auto Height () const
 
auto name ()
 
auto deleted () const
 
auto set_deleted (bool deleted)
 
- Public Member Functions inherited from yaze::app::zelda3::GameEntity
auto set_x (int x)
 
auto set_y (int y)
 
 GameEntity ()=default
 

Private Attributes

uint8_t map_id_
 
uint8_t game_state_
 
uint8_t id_
 
uint8_t nx_
 
uint8_t ny_
 
uint8_t overlord_ = 0
 
uint8_t lowerX_
 
uint8_t lowerY_
 
uint8_t higherX_
 
uint8_t higherY_
 
int width_ = 16
 
int height_ = 16
 
int map_x_
 
int map_y_
 
int layer_
 
int subtype_
 
int key_drop_
 
bool deleted_ = false
 
bool overworld_
 
std::string name_
 
std::vector< uint8_t > preview_gfx_
 
std::vector< uint8_t > current_gfx_
 
SDL_Rect bounding_box_
 

Additional Inherited Members

- Public Types inherited from yaze::app::zelda3::GameEntity
enum  EntityType {
  kEntrance = 0 , kExit = 1 , kItem = 2 , kSprite = 3 ,
  kTransport = 4 , kMusic = 5 , kTilemap = 6 , kProperties = 7 ,
  kDungeonSprite = 8
}
 
- Public Attributes inherited from yaze::app::zelda3::GameEntity
enum yaze::app::zelda3::GameEntity::EntityType entity_type_
 
int x_
 
int y_
 
int game_x_
 
int game_y_
 
int entity_id_
 
uint16_t map_id_
 

Detailed Description

A class for managing sprites in the overworld and underworld.

Definition at line 285 of file sprite.h.

Constructor & Destructor Documentation

◆ Sprite() [1/2]

yaze::app::zelda3::Sprite::Sprite ( )
default

◆ Sprite() [2/2]

yaze::app::zelda3::Sprite::Sprite ( std::vector< uint8_t > src,
uint8_t overworld_map_id,
uint8_t id,
uint8_t x,
uint8_t y,
int map_x,
int map_y )
inline

Member Function Documentation

◆ InitSprite()

void yaze::app::zelda3::Sprite::InitSprite ( const std::vector< uint8_t > & src,
uint8_t overworld_map_id,
uint8_t id,
uint8_t x,
uint8_t y,
int map_x,
int map_y )
inline

◆ UpdateBoundaryBox()

void yaze::app::zelda3::Sprite::UpdateBoundaryBox ( )

Definition at line 20 of file sprite.cc.

References higherX_, higherY_, lowerX_, and lowerY_.

◆ Draw()

void yaze::app::zelda3::Sprite::Draw ( )
Todo
Add something here?

Definition at line 27 of file sprite.cc.

References bounding_box_, DrawSpriteTile(), height_, id_, lowerX_, lowerY_, nx_, ny_, overlord_, width_, x(), and y().

Here is the call graph for this function:

◆ DrawSpriteTile()

void yaze::app::zelda3::Sprite::DrawSpriteTile ( int x,
int y,
int srcx,
int srcy,
int pal,
bool mirror_x = false,
bool mirror_y = false,
int sizex = 2,
int sizey = 2 )

Definition at line 873 of file sprite.cc.

References current_gfx_, preview_gfx_, x(), and y().

Referenced by Draw().

Here is the call graph for this function:

◆ UpdateMapProperties()

void yaze::app::zelda3::Sprite::UpdateMapProperties ( uint16_t map_id)
overridevirtual

◆ UpdateCoordinates()

void yaze::app::zelda3::Sprite::UpdateCoordinates ( int map_x,
int map_y )

Definition at line 15 of file sprite.cc.

References map_x(), map_x_, map_y(), and map_y_.

Here is the call graph for this function:

◆ PreviewGraphics()

auto yaze::app::zelda3::Sprite::PreviewGraphics ( ) const
inline

Definition at line 335 of file sprite.h.

References preview_gfx_.

◆ id()

auto yaze::app::zelda3::Sprite::id ( ) const
inline

Definition at line 336 of file sprite.h.

References id_.

Referenced by InitSprite(), yaze::app::zelda3::dungeon::Room::LoadSprites(), set_id(), and Sprite().

◆ set_id()

auto yaze::app::zelda3::Sprite::set_id ( uint8_t id)
inline

Definition at line 337 of file sprite.h.

References id(), and id_.

Referenced by yaze::app::editor::DrawSpriteEditorPopup().

Here is the call graph for this function:

◆ x()

auto yaze::app::zelda3::Sprite::x ( ) const
inline

◆ y()

auto yaze::app::zelda3::Sprite::y ( ) const
inline

◆ nx()

auto yaze::app::zelda3::Sprite::nx ( ) const
inline

Definition at line 340 of file sprite.h.

References nx_.

◆ ny()

auto yaze::app::zelda3::Sprite::ny ( ) const
inline

Definition at line 341 of file sprite.h.

References ny_.

◆ map_id()

auto yaze::app::zelda3::Sprite::map_id ( ) const
inline

Definition at line 342 of file sprite.h.

References map_id_.

Referenced by yaze::app::editor::DrawSpriteEditorPopup().

◆ map_x()

auto yaze::app::zelda3::Sprite::map_x ( ) const
inline

Definition at line 343 of file sprite.h.

References map_x_.

Referenced by InitSprite(), and UpdateCoordinates().

◆ map_y()

auto yaze::app::zelda3::Sprite::map_y ( ) const
inline

Definition at line 344 of file sprite.h.

References map_y_.

Referenced by InitSprite(), and UpdateCoordinates().

◆ game_state()

auto yaze::app::zelda3::Sprite::game_state ( ) const
inline

Definition at line 345 of file sprite.h.

References game_state_.

◆ layer()

auto yaze::app::zelda3::Sprite::layer ( ) const
inline

Definition at line 347 of file sprite.h.

References layer_.

Referenced by yaze::app::zelda3::dungeon::Room::LoadSprites().

◆ subtype()

auto yaze::app::zelda3::Sprite::subtype ( ) const
inline

Definition at line 348 of file sprite.h.

References subtype_.

Referenced by yaze::app::zelda3::dungeon::Room::LoadSprites().

◆ Width()

auto yaze::app::zelda3::Sprite::Width ( ) const
inline

Definition at line 350 of file sprite.h.

References bounding_box_.

◆ Height()

auto yaze::app::zelda3::Sprite::Height ( ) const
inline

Definition at line 351 of file sprite.h.

References bounding_box_.

◆ name()

auto yaze::app::zelda3::Sprite::name ( )
inline

Definition at line 352 of file sprite.h.

References name_.

Referenced by yaze::app::editor::DrawSpriteEditorPopup().

◆ deleted()

auto yaze::app::zelda3::Sprite::deleted ( ) const
inline

Definition at line 353 of file sprite.h.

References deleted_.

Referenced by set_deleted().

◆ set_deleted()

auto yaze::app::zelda3::Sprite::set_deleted ( bool deleted)
inline

Definition at line 354 of file sprite.h.

References deleted(), and deleted_.

Referenced by yaze::app::editor::DrawSpriteEditorPopup().

Here is the call graph for this function:

Member Data Documentation

◆ map_id_

uint8_t yaze::app::zelda3::Sprite::map_id_
private

Definition at line 357 of file sprite.h.

Referenced by InitSprite(), and map_id().

◆ game_state_

uint8_t yaze::app::zelda3::Sprite::game_state_
private

Definition at line 358 of file sprite.h.

Referenced by game_state().

◆ id_

uint8_t yaze::app::zelda3::Sprite::id_
private

Definition at line 359 of file sprite.h.

Referenced by Draw(), id(), InitSprite(), set_id(), and UpdateMapProperties().

◆ nx_

uint8_t yaze::app::zelda3::Sprite::nx_
private

Definition at line 360 of file sprite.h.

Referenced by Draw(), InitSprite(), and nx().

◆ ny_

uint8_t yaze::app::zelda3::Sprite::ny_
private

Definition at line 361 of file sprite.h.

Referenced by Draw(), InitSprite(), and ny().

◆ overlord_

uint8_t yaze::app::zelda3::Sprite::overlord_ = 0
private

Definition at line 362 of file sprite.h.

Referenced by Draw().

◆ lowerX_

uint8_t yaze::app::zelda3::Sprite::lowerX_
private

Definition at line 363 of file sprite.h.

Referenced by Draw(), and UpdateBoundaryBox().

◆ lowerY_

uint8_t yaze::app::zelda3::Sprite::lowerY_
private

Definition at line 364 of file sprite.h.

Referenced by Draw(), and UpdateBoundaryBox().

◆ higherX_

uint8_t yaze::app::zelda3::Sprite::higherX_
private

Definition at line 365 of file sprite.h.

Referenced by UpdateBoundaryBox().

◆ higherY_

uint8_t yaze::app::zelda3::Sprite::higherY_
private

Definition at line 366 of file sprite.h.

Referenced by UpdateBoundaryBox().

◆ width_

int yaze::app::zelda3::Sprite::width_ = 16
private

Definition at line 368 of file sprite.h.

Referenced by Draw().

◆ height_

int yaze::app::zelda3::Sprite::height_ = 16
private

Definition at line 369 of file sprite.h.

Referenced by Draw().

◆ map_x_

int yaze::app::zelda3::Sprite::map_x_
private

Definition at line 370 of file sprite.h.

Referenced by InitSprite(), map_x(), Sprite(), UpdateCoordinates(), and UpdateMapProperties().

◆ map_y_

int yaze::app::zelda3::Sprite::map_y_
private

Definition at line 371 of file sprite.h.

Referenced by InitSprite(), map_y(), Sprite(), UpdateCoordinates(), and UpdateMapProperties().

◆ layer_

int yaze::app::zelda3::Sprite::layer_
private

Definition at line 372 of file sprite.h.

Referenced by layer().

◆ subtype_

int yaze::app::zelda3::Sprite::subtype_
private

Definition at line 373 of file sprite.h.

Referenced by subtype().

◆ key_drop_

int yaze::app::zelda3::Sprite::key_drop_
private

Definition at line 374 of file sprite.h.

◆ deleted_

bool yaze::app::zelda3::Sprite::deleted_ = false
private

Definition at line 376 of file sprite.h.

Referenced by deleted(), and set_deleted().

◆ overworld_

bool yaze::app::zelda3::Sprite::overworld_
private

Definition at line 377 of file sprite.h.

Referenced by InitSprite(), and Sprite().

◆ name_

std::string yaze::app::zelda3::Sprite::name_
private

Definition at line 379 of file sprite.h.

Referenced by InitSprite(), name(), Sprite(), and UpdateMapProperties().

◆ preview_gfx_

std::vector<uint8_t> yaze::app::zelda3::Sprite::preview_gfx_
private

Definition at line 380 of file sprite.h.

Referenced by DrawSpriteTile(), InitSprite(), PreviewGraphics(), and Sprite().

◆ current_gfx_

std::vector<uint8_t> yaze::app::zelda3::Sprite::current_gfx_
private

Definition at line 381 of file sprite.h.

Referenced by DrawSpriteTile(), and InitSprite().

◆ bounding_box_

SDL_Rect yaze::app::zelda3::Sprite::bounding_box_
private

Definition at line 383 of file sprite.h.

Referenced by Draw(), Height(), and Width().


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