1#ifndef YAZE_APP_ZELDA3_SPRITE_H
2#define YAZE_APP_ZELDA3_SPRITE_H
17static const std::string kSpriteDefaultNames[]{
20 "02 Flying Stalfos Head",
21 "03 No Pointer (Empty",
22 "04 Pull Switch (good",
23 "05 Pull Switch (unused",
24 "06 Pull Switch (bad",
25 "07 Pull Switch (unused",
26 "08 Octorock (one way",
28 "0A Octorock (four way",
34 "10 Octoballon Hatchlings",
38 "14 Gargoyle's Domain Gate",
40 "16 Sahasrahla / Aginah",
49 "1F Bug-Catching Kid",
59 "29 Blind Hideout attendant",
63 "2D Telepathic Stones",
64 "2E Multipurpose Sprite",
79 "3D Signs? Chicken lady also showed up / Scared ladies outside houses.",
81 "3F Tutorial Soldier",
83 "41 Blue Sword Soldier / Used by guards to detect player",
84 "42 Green Sword Soldier",
85 "43 Red Spear Soldier",
86 "44 Assault Sword Soldier",
87 "45 Green Spear Soldier",
90 "48 Red Javelin Soldier",
91 "49 Red Javelin Soldier 2",
92 "4A Red Bomb Soldiers",
93 "4B Green Soldier Recruits",
101 "53 Armos Knights (Boss",
105 "57 Desert Palace Barriers",
109 "5B Spark (Left to Right",
110 "5C Spark (Right to Left",
111 "5D Roller (vertical moving",
112 "5E Roller (vertical moving",
114 "60 Roller (horizontal moving",
118 "64 Devalant (Shooter",
119 "65 Shooting Gallery Proprietor",
120 "66 Moving Cannon Ball Shooters (Right",
121 "67 Moving Cannon Ball Shooters (Left",
122 "68 Moving Cannon Ball Shooters (Down",
123 "69 Moving Cannon Ball Shooters (Up",
124 "6A Ball N' Chain Trooper",
130 "70 Helmasaur King Fireball",
132 "72 Activator for the ponds (where you throw in items",
135 "75 Bottle Salesman",
137 "77 Antifairy (Alternate",
141 "7B Agahnim Energy Ball",
144 "7E Guruguru Bar (Clockwise",
145 "7F Guruguru Bar (Counter Clockwise",
148 "82 Antifairy Circle",
167 "95 Eye Laser (Right",
168 "96 Eye Laser (Left",
169 "97 Eye Laser (Down",
176 "9E Ostrich (Haunted Grove",
178 "A0 Birds (Haunted Grove",
180 "A2 Kholdstare (Boss",
181 "A3 Kholdstare's Shell",
186 "A8 Bomber Flying Creatures from Darkworld",
187 "A9 Bomber Flying Creatures from Darkworld",
196 "B2 Good bee again?",
197 "B3 Hylian Inscription",
198 "B4 Thief?s chest (not the one that follows you",
201 "B7 Maiden following you in Blind Dungeon",
202 "B8 Monologue Testing Sprite",
203 "B9 Feuding Friends on Death Mountain",
205 "BB Salesman / chestgame guy / 300 rupee giver guy / Chest game thief",
206 "BC Drunk in the inn",
207 "BD Vitreous (Large Eyeball",
208 "BE Vitreous (Small Eyeball",
209 "BF Vitreous' Lightning",
210 "C0 Monster in Lake of Ill Omen / Quake Medallion",
211 "C1 Agahnim teleporting Zelda to dark world",
216 "C6 Four Way Fireball Spitters (spit when you use your sword",
218 "C8 Big Fairy who heals you",
222 "CC Another part of trinexx",
223 "CD Yet another part of trinexx",
224 "CE Blind The Thief (Boss)",
231 "D5 Digging Game Proprietor",
238 "DC Bomb Refill (1)",
239 "DD Bomb Refill (4)",
240 "DE Bomb Refill (8)",
241 "DF Small Magic Refill",
242 "E0 Full Magic Refill",
243 "E1 Arrow Refill (5)",
244 "E2 Arrow Refill (10)",
250 "E8 Fake Master Sword",
251 "E9 Magic Shop dude / His items",
252 "EA Heart Container",
255 "ED Cane Of Somaria Platform",
257 "EF Cane of Somaria Platform (Unused)",
258 "F0 Cane of Somaria Platform (Unused)",
259 "F1 Cane of Somaria Platform (Unused)",
260 "F2 Medallion Tablet",
283 Sprite(std::vector<uint8_t> src, uint8_t overworld_map_id, uint8_t
id,
285 :
map_id_(static_cast<int>(overworld_map_id)),
297 name_ = kSpriteDefaultNames[
id];
305 name_ = kSpriteDefaultNames[
id];
306 if (((
subtype & 0x07) == 0x07) &&
id > 0 &&
id <= 0x1A) {
307 name_ = kOverlordNames[
id - 1];
312 void InitSprite(
const std::vector<uint8_t> &src, uint8_t overworld_map_id,
313 uint8_t
id, uint8_t
x, uint8_t
y,
int map_x,
int map_y) {
316 map_id_ =
static_cast<int>(overworld_map_id);
324 name_ = kSpriteDefaultNames[
id];
333 bool mirror_x =
false,
bool mirror_y =
false,
334 int sizex = 2,
int sizey = 2);
344 auto x()
const {
return x_; }
345 auto y()
const {
return y_; }
Base class for all overworld and dungeon entities.
enum yaze::app::zelda3::GameEntity::EntityType entity_type_
A class for managing sprites in the overworld and underworld.
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 UpdateMapProperties(uint16_t map_id) override
auto PreviewGraphics() const
auto set_deleted(bool deleted)
auto set_key_drop(int key)
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)
std::vector< uint8_t > preview_gfx_
void UpdateCoordinates(int map_x, int map_y)
std::vector< uint8_t > current_gfx_
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)