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)
 
 Sprite (uint8_t id, uint8_t x, uint8_t y, uint8_t subtype, uint8_t layer)
 
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)
 
auto set_key_drop (int key)
 
- 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 lower_x_ = 32
 
uint8_t lower_y_ = 32
 
uint8_t higher_x_ = 0
 
uint8_t higher_y_ = 0
 
int width_ = 16
 
int height_ = 16
 
int map_x_ = 0
 
int map_y_ = 0
 
int layer_ = 0
 
int subtype_ = 0
 
int key_drop_ = 0
 
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 280 of file sprite.h.

Constructor & Destructor Documentation

◆ Sprite() [1/3]

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

◆ Sprite() [2/3]

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

◆ Sprite() [3/3]

yaze::app::zelda3::Sprite::Sprite ( uint8_t id,
uint8_t x,
uint8_t y,
uint8_t subtype,
uint8_t layer )
inline

Definition at line 301 of file sprite.h.

References id(), name_, overlord_, subtype(), x(), yaze::app::zelda3::GameEntity::x_, y(), and yaze::app::zelda3::GameEntity::y_.

Here is the call graph for this function:

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 higher_x_, lower_x_, and lower_y_.

◆ 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_, lower_x_, lower_y_, 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 341 of file sprite.h.

References preview_gfx_.

◆ id()

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

Definition at line 342 of file sprite.h.

References id_.

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

◆ set_id()

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

Definition at line 343 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 346 of file sprite.h.

References nx_.

◆ ny()

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

Definition at line 347 of file sprite.h.

References ny_.

◆ map_id()

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

Definition at line 348 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 349 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 350 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 351 of file sprite.h.

References game_state_.

◆ layer()

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

Definition at line 353 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 354 of file sprite.h.

References subtype_.

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

◆ width()

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

Definition at line 356 of file sprite.h.

References bounding_box_.

◆ height()

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

Definition at line 357 of file sprite.h.

References bounding_box_.

◆ name()

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

Definition at line 358 of file sprite.h.

References name_.

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

◆ deleted()

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

Definition at line 359 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 360 of file sprite.h.

References deleted(), and deleted_.

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

Here is the call graph for this function:

◆ set_key_drop()

auto yaze::app::zelda3::Sprite::set_key_drop ( int key)
inline

Definition at line 361 of file sprite.h.

References key_drop_.

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

Member Data Documentation

◆ map_id_

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

Definition at line 364 of file sprite.h.

Referenced by InitSprite(), and map_id().

◆ game_state_

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

Definition at line 365 of file sprite.h.

Referenced by game_state().

◆ id_

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

Definition at line 366 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 367 of file sprite.h.

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

◆ ny_

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

Definition at line 368 of file sprite.h.

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

◆ overlord_

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

Definition at line 369 of file sprite.h.

Referenced by Draw(), and Sprite().

◆ lower_x_

uint8_t yaze::app::zelda3::Sprite::lower_x_ = 32
private

Definition at line 370 of file sprite.h.

Referenced by Draw(), and UpdateBoundaryBox().

◆ lower_y_

uint8_t yaze::app::zelda3::Sprite::lower_y_ = 32
private

Definition at line 371 of file sprite.h.

Referenced by Draw(), and UpdateBoundaryBox().

◆ higher_x_

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

Definition at line 372 of file sprite.h.

Referenced by UpdateBoundaryBox().

◆ higher_y_

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

Definition at line 373 of file sprite.h.

◆ width_

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

Definition at line 375 of file sprite.h.

Referenced by Draw().

◆ height_

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

Definition at line 376 of file sprite.h.

Referenced by Draw().

◆ map_x_

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

Definition at line 377 of file sprite.h.

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

◆ map_y_

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

Definition at line 378 of file sprite.h.

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

◆ layer_

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

Definition at line 379 of file sprite.h.

Referenced by layer().

◆ subtype_

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

Definition at line 380 of file sprite.h.

Referenced by subtype().

◆ key_drop_

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

Definition at line 381 of file sprite.h.

Referenced by set_key_drop().

◆ deleted_

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

Definition at line 383 of file sprite.h.

Referenced by deleted(), and set_deleted().

◆ overworld_

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

Definition at line 384 of file sprite.h.

Referenced by InitSprite(), and Sprite().

◆ name_

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

Definition at line 386 of file sprite.h.

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

◆ preview_gfx_

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

Definition at line 387 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 388 of file sprite.h.

Referenced by DrawSpriteTile(), and InitSprite().

◆ bounding_box_

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

Definition at line 390 of file sprite.h.

Referenced by Draw(), height(), and width().


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