22 #ifndef NUVIE_CORE_ANIM_MANAGER_H 23 #define NUVIE_CORE_ANIM_MANAGER_H 25 #include "ultima/nuvie/core/nuvie_defs.h" 26 #include "ultima/nuvie/gui/widgets/map_window.h" 27 #include "ultima/nuvie/core/timed_event.h" 28 #include "ultima/nuvie/misc/call_back.h" 29 #include "ultima/nuvie/misc/map_entity.h" 30 #include "ultima/nuvie/misc/u6_line_walker.h" 46 #define MESG_TIMED CB_TIMED 62 sint16 mapwindow_x_offset;
63 sint16 mapwindow_y_offset;
65 AnimIterator get_anim_iterator(uint32 anim_id);
74 void display(
bool top_anims =
false);
79 void set_surface(
Screen *screen) {
85 void set_tile_pitch(uint8 p) {
88 uint8 get_tile_pitch()
const {
95 bool destroy_anim(uint32 anim_id);
100 void drawTile(
const Tile *tile, uint16 x, uint16 y);
101 void drawTileAtWorldCoords(
const Tile *tile, uint16 wx, uint16 wy, uint16 add_x = 0, uint16 add_y = 0);
102 void drawText(
Font *font,
const char *text, uint16 x, uint16 y);
121 uint32 last_move_time;
130 virtual bool update() {
133 virtual void display() = 0;
135 void update_position();
147 bool is_paused()
const {
154 uint32 get_id()
const {
158 void set_safe_to_delete(
bool val) {
159 safe_to_delete = val;
161 void set_velocity(sint32 sx, sint32 sy) {
165 void set_velocity_for_speed(sint16 xdir, sint16 ydir, uint32 spd);
167 virtual void stop() {
168 updated = running =
false;
170 virtual void start() { }
171 uint16 message(uint16 msg,
void *msg_data =
nullptr,
void *my_data =
nullptr) {
172 if (callback_target)
return (CallBack::message(msg, msg_data, my_data));
176 virtual void move(uint32 x, uint32 y, uint32 add_x = 0, uint32 add_y = 0) {
180 virtual void shift(sint32 sx, sint32 sy) {
210 void display()
override;
219 void get_offset(uint32 &x_add, uint32 &y_add)
const {
225 void move(uint32 x, uint32 y, uint32 add_x = 0, uint32 add_y = 0)
override {
231 void shift(sint32 sx, sint32 sy)
override;
232 void shift_tile(uint32 ptile_num, sint32 sx, sint32 sy);
236 PositionedTile *add_tile(
Tile *tile, sint16 x, sint16 y, uint16 add_x = 0, uint16 add_y = 0);
237 void remove_tile(uint32 i = 0);
254 void start_timer(uint32 delay) {
255 if (!timer) timer =
new TimedCallback(
this,
nullptr, delay,
true);
259 timer->clear_target();
264 void stop()
override {
272 #define TOSS_TO_BLOCKING 0x01 273 #define TOSS_TO_ACTOR 0x02 274 #define TOSS_TO_OBJECT 0x04 287 uint32 start_px, start_py, target_px, target_py;
288 uint8 mapwindow_level;
296 float x_left, y_left;
297 uint16 x_dist, y_dist;
299 bool update()
override;
302 void display()
override;
309 void init(
const Tile *tile, uint16 degrees,
const MapCoord &start,
const MapCoord &stop, uint16 pixels_per_sec, uint8 stop_flags);
310 void start()
override;
311 void stop()
override;
312 uint32 update_position(uint32 max_move = 0);
313 inline void accumulate_moves(
float moves, sint32 &x_move, sint32 &y_move, sint8 xdir, sint8 ydir);
316 virtual void hit_target();
317 virtual void hit_object(
Obj *obj);
318 virtual void hit_actor(
Actor *actor);
319 virtual void hit_blocking(
const MapCoord &obj_loc);
343 uint16 exploding_tile_num;
349 void start()
override;
350 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
351 bool update()
override;
353 void hit_object(
Obj *obj);
354 void hit_actor(
Actor *actor);
355 void get_shifted_location(uint16 &x, uint16 &y, uint16 &px, uint16 &py,
356 uint32 sx, uint32 sy);
365 uint16 rotation_amount;
374 uint8 src_tile_y_offset;
376 uint16 stopped_count;
381 ProjectileAnim(uint16 tileNum,
MapCoord *start,
vector<MapCoord> target, uint8 animSpeed,
bool leaveTrailFlag =
false, uint16 initialTileRotation = 0, uint16 rotationAmount = 0, uint8 src_y_offset = 0);
383 void start()
override;
385 bool update()
override;
395 sint32 x, y, finish_x;
398 Tile *wing_bottom[2];
406 void start()
override;
407 bool update()
override;
417 #define HAILSTORM_ANIM_MAX_STONES 6 421 Tile *hailstone_tile;
423 Hailstone hailstones[HAILSTORM_ANIM_MAX_STONES];
424 uint8 num_hailstones_left;
430 void start()
override;
431 bool update()
override;
434 sint8 find_free_hailstone();
443 bool update()
override;
449 uint16 callback(uint16 msg,
CallBack *caller,
void *msg_data)
override;
450 void start()
override {
463 uint16 callback(uint16 msg,
CallBack *caller,
void *msg_data)
override;
464 void start()
override {
465 start_timer(duration);
468 void display()
override;
475 bool should_delete_to_tile;
476 uint16 pixels_per_update;
477 unsigned char mask[256];
485 bool update()
override;
487 void init(uint16 speed);
Definition: map_window.h:73
Definition: anim_manager.h:244
Definition: anim_manager.h:455
Definition: atari-screen.h:60
Definition: actor_manager.h:42
Definition: timed_event.h:209
Definition: anim_manager.h:393
Definition: anim_manager.h:359
Definition: detection.h:27
Definition: u6_line_walker.h:30
Definition: anim_manager.h:471
Definition: map_entity.h:45
Definition: anim_manager.h:280
Definition: call_back.h:50
Definition: anim_manager.h:440
Definition: anim_manager.h:331
Definition: anim_manager.h:202
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
Definition: anim_manager.h:418
Definition: containers.h:200
Definition: obj_manager.h:75
Definition: anim_manager.h:411
Definition: anim_manager.h:339
Definition: anim_manager.h:112
Definition: list_intern.h:51
Definition: anim_manager.h:370
Definition: tile_manager.h:113
Definition: anim_manager.h:193
Definition: anim_manager.h:53
Definition: anim_manager.h:324