A class for managing sprites in the overworld and underworld. More...
#include <sprite.h>
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_ |
A class for managing sprites in the overworld and underworld.
|
default |
|
inline |
Definition at line 283 of file sprite.h.
References yaze::app::zelda3::GameEntity::entity_id_, yaze::app::zelda3::GameEntity::entity_type_, id(), yaze::app::zelda3::GameEntity::kSprite, map_x_, map_y_, name_, overworld_, preview_gfx_, yaze::app::zelda3::GameEntity::x_, and yaze::app::zelda3::GameEntity::y_.
|
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_.
|
inline |
Definition at line 312 of file sprite.h.
References current_gfx_, yaze::app::zelda3::GameEntity::entity_id_, yaze::app::zelda3::GameEntity::entity_type_, id(), id_, yaze::app::zelda3::GameEntity::kSprite, map_id_, map_x(), map_x_, map_y(), map_y_, name_, nx_, ny_, overworld_, preview_gfx_, x(), yaze::app::zelda3::GameEntity::x_, y(), and yaze::app::zelda3::GameEntity::y_.
void yaze::app::zelda3::Sprite::UpdateBoundaryBox | ( | ) |
void yaze::app::zelda3::Sprite::Draw | ( | ) |
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().
|
overridevirtual |
Implements yaze::app::zelda3::GameEntity.
Definition at line 9 of file sprite.cc.
References id_, map_x_, map_y_, name_, yaze::app::zelda3::GameEntity::x_, and yaze::app::zelda3::GameEntity::y_.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
void yaze::app::zelda3::Sprite::UpdateCoordinates | ( | int | map_x, |
int | map_y ) |
|
inline |
Definition at line 341 of file sprite.h.
References preview_gfx_.
|
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().
|
inline |
Definition at line 343 of file sprite.h.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
inline |
Definition at line 344 of file sprite.h.
References yaze::app::zelda3::GameEntity::x_.
Referenced by Draw(), DrawSpriteTile(), InitSprite(), yaze::app::zelda3::dungeon::Room::LoadSprites(), and Sprite().
|
inline |
Definition at line 345 of file sprite.h.
References yaze::app::zelda3::GameEntity::y_.
Referenced by Draw(), DrawSpriteTile(), InitSprite(), yaze::app::zelda3::dungeon::Room::LoadSprites(), and Sprite().
|
inline |
|
inline |
|
inline |
Definition at line 348 of file sprite.h.
References map_id_.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
inline |
Definition at line 349 of file sprite.h.
References map_x_.
Referenced by InitSprite(), and UpdateCoordinates().
|
inline |
Definition at line 350 of file sprite.h.
References map_y_.
Referenced by InitSprite(), and UpdateCoordinates().
|
inline |
Definition at line 351 of file sprite.h.
References game_state_.
|
inline |
Definition at line 353 of file sprite.h.
References layer_.
Referenced by yaze::app::zelda3::dungeon::Room::LoadSprites().
|
inline |
Definition at line 354 of file sprite.h.
References subtype_.
Referenced by yaze::app::zelda3::dungeon::Room::LoadSprites(), and Sprite().
|
inline |
Definition at line 356 of file sprite.h.
References bounding_box_.
|
inline |
Definition at line 357 of file sprite.h.
References bounding_box_.
|
inline |
Definition at line 358 of file sprite.h.
References name_.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
inline |
|
inline |
Definition at line 360 of file sprite.h.
References deleted(), and deleted_.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
inline |
Definition at line 361 of file sprite.h.
References key_drop_.
Referenced by yaze::app::zelda3::dungeon::Room::LoadSprites().
|
private |
Definition at line 364 of file sprite.h.
Referenced by InitSprite(), and map_id().
|
private |
Definition at line 365 of file sprite.h.
Referenced by game_state().
|
private |
Definition at line 366 of file sprite.h.
Referenced by Draw(), id(), InitSprite(), set_id(), and UpdateMapProperties().
|
private |
Definition at line 367 of file sprite.h.
Referenced by Draw(), InitSprite(), and nx().
|
private |
Definition at line 368 of file sprite.h.
Referenced by Draw(), InitSprite(), and ny().
|
private |
|
private |
Definition at line 370 of file sprite.h.
Referenced by Draw(), and UpdateBoundaryBox().
|
private |
Definition at line 371 of file sprite.h.
Referenced by Draw(), and UpdateBoundaryBox().
|
private |
Definition at line 372 of file sprite.h.
Referenced by UpdateBoundaryBox().
|
private |
|
private |
|
private |
Definition at line 377 of file sprite.h.
Referenced by InitSprite(), map_x(), Sprite(), UpdateCoordinates(), and UpdateMapProperties().
|
private |
Definition at line 378 of file sprite.h.
Referenced by InitSprite(), map_y(), Sprite(), UpdateCoordinates(), and UpdateMapProperties().
|
private |
|
private |
|
private |
Definition at line 381 of file sprite.h.
Referenced by set_key_drop().
|
private |
Definition at line 383 of file sprite.h.
Referenced by deleted(), and set_deleted().
|
private |
Definition at line 384 of file sprite.h.
Referenced by InitSprite(), and Sprite().
|
private |
Definition at line 386 of file sprite.h.
Referenced by InitSprite(), name(), Sprite(), Sprite(), and UpdateMapProperties().
|
private |
Definition at line 387 of file sprite.h.
Referenced by DrawSpriteTile(), InitSprite(), PreviewGraphics(), and Sprite().
|
private |
Definition at line 388 of file sprite.h.
Referenced by DrawSpriteTile(), and InitSprite().
|
private |