22 #ifndef NUVIE_CORE_TILE_MANAGER_H 23 #define NUVIE_CORE_TILE_MANAGER_H 25 #include "ultima/nuvie/core/nuvie_defs.h" 26 #include "ultima/shared/std/string.h" 36 #define U6TILE_PLAIN 0x0 37 #define U6TILE_TRANS 0x5 38 #define U6TILE_PBLCK 0xA 40 #define TILEFLAG_WALL_MASK 0xf0 // 11110000 42 #define TILEFLAG_WALL_NORTH 0x80 43 #define TILEFLAG_WALL_EAST 0x40 44 #define TILEFLAG_WALL_SOUTH 0x20 45 #define TILEFLAG_WALL_WEST 0x10 46 #define TILEFLAG_IMPEDANCE (TILEFLAG_WALL_NORTH|TILEFLAG_WALL_EAST|TILEFLAG_WALL_SOUTH|TILEFLAG_WALL_WEST) 47 #define TILEFLAG_IMPEDANCE_SHIFT 4 48 #define TILEFLAG_DAMAGING 0x8 49 #define TILEFLAG_WALL 0x4 50 #define TILEFLAG_BLOCKING 0x2 51 #define TILEFLAG_WATER 0x1 54 #define TILEFLAG_DOUBLE_WIDTH 0x80 55 #define TILEFLAG_DOUBLE_HEIGHT 0x40 56 #define TILEFLAG_MISSILE_BOUNDARY 0x20 57 #define TILEFLAG_TOPTILE 0x10 58 #define TILEFLAG_WINDOW 0x8 59 #define TILEFLAG_BOUNDARY 0x4 60 #define TILEFLAG_LIGHT_MSB 0x2 61 #define TILEFLAG_LIGHT_LSB 0x1 62 #define GET_TILE_LIGHT_LEVEL(x) (uint8)(x->flags2 & 0x3) // only use with a pointer 64 #define TILEFLAG_ARTICLE_MSB 0x80 // 00 01 10 11 65 #define TILEFLAG_ARTICLE_LSB 0x40 // - a an the 66 #define TILEFLAG_UNKNOWN_3_5 0x20 67 #define TILEFLAG_IGNORE 0x10 68 #define TILEFLAG_UNKNOWN_3_3 0x8 // Flammable? Mostly_non_metal_object (not affected by acid-slug)? 69 #define TILEFLAG_FORCED_PASSABLE 0x4 70 #define TILEFLAG_CAN_PLACE_ONTOP 0x2 71 #define TILEFLAG_UNKNOWN_LAVA 0x1 // associated with some lava tiles 74 #define TILE_U6_DIRECTION_CURSOR 364 75 #define TILE_U6_TARGET_CURSOR 365 77 #define TILE_U6_GREEN_MAGIC 380 78 #define TILE_U6_PURPLE_MAGIC 381 79 #define TILE_U6_RED_MAGIC 382 80 #define TILE_U6_BLUE_MAGIC 383 81 #define TILE_U6_BLOCKED_EQUIP 389 82 #define TILE_U6_LIGHTNING 392 83 #define TILE_U6_FIREBALL 393 84 #define TILE_U6_SOME_KIND_OF_BLUE_FIELD 394 // ghost's outline for casting/going invis 85 #define TILE_U6_IS_THIS_AN_ICE_SHOT 395 86 #define TILE_U6_KILL_SHOT 396 87 #define TILE_U6_FIRE_SHOT 397 88 #define TILE_U6_SLING_STONE 398 89 #define TILE_U6_CANNONBALL 399 90 #define TILE_U6_EQUIP 410 91 #define TILE_U6_GARGOYLE_LENS_ANIM_1 440 92 #define TILE_U6_GARGOYLE_LENS_ANIM_2 441 93 #define TILE_U6_BRITANNIAN_LENS_ANIM_1 442 94 #define TILE_U6_BRITANNIAN_LENS_ANIM_2 443 95 #define TILE_U6_WIZARD_EYE 563 96 #define TILE_U6_ARROW 566 97 #define TILE_U6_BOLT 567 99 #define TILE_SE_BLOCKED_EQUIP 391 100 #define TILE_SE_EQUIP 392 102 #define TILE_MD_EQUIP 273 103 #define TILE_MD_BLOCKED_EQUIP 274 105 #define TILE_MD_PURPLE_BERRY_MARKER 288 106 #define TILE_MD_GREEN_BERRY_MARKER 289 107 #define TILE_MD_BROWN_BERRY_MARKER 290 109 #define TILE_WIDTH 16 110 #define TILE_HEIGHT 16 111 #define TILE_DATA_SIZE 256 131 unsigned char data[256];
136 uint16 number_of_tiles_to_animate;
137 uint16 tile_to_animate[0x20];
138 uint16 first_anim_frame[0x20];
139 uint8 and_masks[0x20];
140 uint8 shift_values[0x20];
141 sint8 loop_count[0x20];
147 uint16 tileindex[2048];
148 uint16 game_counter, rgame_counter;
166 Tile *get_tile(uint16 tile_num);
167 Tile *get_anim_base_tile(uint16 tile_num);
168 Tile *get_original_tile(uint16 tile_num);
169 void set_tile_index(uint16 tile_index, uint16 tile_num);
170 uint16 get_tile_index(uint16 tile_index)
const {
171 return tileindex[tile_index];
173 void set_anim_loop(uint16 tile_num, sint8 loopc, uint8 loop = 0);
175 const char *lookAtTile(uint16 tile_num, uint16 qty,
bool show_prefix);
176 bool tile_is_stackable(uint16 tile_num);
178 void update_timed_tiles(uint8 hour);
180 uint8 get_number_of_animations()
const {
181 return animdata.number_of_tiles_to_animate;
183 uint16 get_numtiles()
const {
186 uint16 get_anim_tile(uint8 anim_index)
const {
187 return anim_index < animdata.number_of_tiles_to_animate ? animdata.tile_to_animate[anim_index] : 0;
189 uint16 get_anim_first_frame(uint8 anim_index)
const {
190 return anim_index < animdata.number_of_tiles_to_animate ? animdata.first_anim_frame[anim_index] : 0;
192 void set_anim_first_frame(uint16 anim_index, uint16 new_start_tile_num);
193 void anim_play_repeated(uint8 anim_index);
194 void anim_stop_playing(uint8 anim_index);
197 Tile *get_rotated_tile(
const Tile *tile,
float rotate, uint8 src_y_offset = 0);
198 void get_rotated_tile(
const Tile *tile,
Tile *dest_tile,
float rotate, uint8 src_y_offset = 0);
200 Tile *get_cursor_tile();
201 Tile *get_use_tile();
202 const Tile *get_gump_cursor_tile();
204 Tile *loadCustomTiles(
const Common::Path &filename,
bool overwrite_tiles,
bool copy_tileflags, uint16 tile_num_start_offset);
205 void freeCustomTiles();
206 void exportTilesetToBmpFile(
const Common::Path &filename,
bool fixupU6Shoreline =
true);
211 void decodePixelBlockTile(
const unsigned char *tile_data, uint16 tile_num);
217 Tile *get_extended_tile(uint16 tile_num);
218 void copyTileMetaData(
Tile *dest,
Tile *src);
219 Tile *addNewTiles(uint16 num_tiles);
221 void writeBmpTileData(
unsigned char *data,
const Tile *t,
bool transparent);
Definition: configuration.h:61
Definition: tile_manager.h:145
Definition: detection.h:27
Definition: tile_manager.h:135
Definition: tile_manager.h:113