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) | |
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_ |
A class for managing sprites in the overworld and underworld.
|
default |
|
inline |
Definition at line 288 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 306 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 335 of file sprite.h.
References preview_gfx_.
|
inline |
Definition at line 336 of file sprite.h.
References id_.
Referenced by InitSprite(), yaze::app::zelda3::dungeon::Room::LoadSprites(), set_id(), and Sprite().
|
inline |
Definition at line 337 of file sprite.h.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
inline |
Definition at line 338 of file sprite.h.
References yaze::app::zelda3::GameEntity::x_.
Referenced by Draw(), DrawSpriteTile(), InitSprite(), and yaze::app::zelda3::dungeon::Room::LoadSprites().
|
inline |
Definition at line 339 of file sprite.h.
References yaze::app::zelda3::GameEntity::y_.
Referenced by Draw(), DrawSpriteTile(), InitSprite(), and yaze::app::zelda3::dungeon::Room::LoadSprites().
|
inline |
|
inline |
|
inline |
Definition at line 342 of file sprite.h.
References map_id_.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
inline |
Definition at line 343 of file sprite.h.
References map_x_.
Referenced by InitSprite(), and UpdateCoordinates().
|
inline |
Definition at line 344 of file sprite.h.
References map_y_.
Referenced by InitSprite(), and UpdateCoordinates().
|
inline |
Definition at line 345 of file sprite.h.
References game_state_.
|
inline |
Definition at line 347 of file sprite.h.
References layer_.
Referenced by yaze::app::zelda3::dungeon::Room::LoadSprites().
|
inline |
Definition at line 348 of file sprite.h.
References subtype_.
Referenced by yaze::app::zelda3::dungeon::Room::LoadSprites().
|
inline |
Definition at line 350 of file sprite.h.
References bounding_box_.
|
inline |
Definition at line 351 of file sprite.h.
References bounding_box_.
|
inline |
Definition at line 352 of file sprite.h.
References name_.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
inline |
|
inline |
Definition at line 354 of file sprite.h.
References deleted(), and deleted_.
Referenced by yaze::app::editor::DrawSpriteEditorPopup().
|
private |
Definition at line 357 of file sprite.h.
Referenced by InitSprite(), and map_id().
|
private |
Definition at line 358 of file sprite.h.
Referenced by game_state().
|
private |
Definition at line 359 of file sprite.h.
Referenced by Draw(), id(), InitSprite(), set_id(), and UpdateMapProperties().
|
private |
Definition at line 360 of file sprite.h.
Referenced by Draw(), InitSprite(), and nx().
|
private |
Definition at line 361 of file sprite.h.
Referenced by Draw(), InitSprite(), and ny().
|
private |
|
private |
Definition at line 363 of file sprite.h.
Referenced by Draw(), and UpdateBoundaryBox().
|
private |
Definition at line 364 of file sprite.h.
Referenced by Draw(), and UpdateBoundaryBox().
|
private |
Definition at line 365 of file sprite.h.
Referenced by UpdateBoundaryBox().
|
private |
Definition at line 366 of file sprite.h.
Referenced by UpdateBoundaryBox().
|
private |
|
private |
|
private |
Definition at line 370 of file sprite.h.
Referenced by InitSprite(), map_x(), Sprite(), UpdateCoordinates(), and UpdateMapProperties().
|
private |
Definition at line 371 of file sprite.h.
Referenced by InitSprite(), map_y(), Sprite(), UpdateCoordinates(), and UpdateMapProperties().
|
private |
|
private |
|
private |
Definition at line 376 of file sprite.h.
Referenced by deleted(), and set_deleted().
|
private |
Definition at line 377 of file sprite.h.
Referenced by InitSprite(), and Sprite().
|
private |
Definition at line 379 of file sprite.h.
Referenced by InitSprite(), name(), Sprite(), and UpdateMapProperties().
|
private |
Definition at line 380 of file sprite.h.
Referenced by DrawSpriteTile(), InitSprite(), PreviewGraphics(), and Sprite().
|
private |
Definition at line 381 of file sprite.h.
Referenced by DrawSpriteTile(), and InitSprite().
|
private |