1 /***************************************************************************
2     Animation Sequences.
3 
4     Used in three areas of the game:
5     - The sequence at the start with the Ferrari driving in from the side
6     - Flag Waving Man
7     - 5 x End Sequences
8 
9     See "oanimsprite.hpp" for the specific format used by animated sprites.
10     It is essentially a deviation from the normal sprites in the game.
11 
12     Copyright Chris White.
13     See license.txt for more details.
14 ***************************************************************************/
15 
16 #pragma once
17 
18 #include "oanimsprite.hpp"
19 
20 class OAnimSeq
21 {
22 public:
23     // Man at line with start flag
24     oanimsprite anim_flag;
25 
26     // Ferrari Animation Sequence
27     oanimsprite anim_ferrari;               // 1
28 
29     // Passenger Animation Sequences
30     oanimsprite anim_pass1;                 // 2
31     oanimsprite anim_pass2;                 // 3
32 
33     // End Sequence Stuff
34     oanimsprite anim_obj1;                  // 4
35     oanimsprite anim_obj2;                  // 5
36     oanimsprite anim_obj3;                  // 6
37     oanimsprite anim_obj4;                  // 7
38     oanimsprite anim_obj5;                  // 8
39     oanimsprite anim_obj6;                  // 9
40     oanimsprite anim_obj7;                  // 10
41     oanimsprite anim_obj8;                  // 10
42 
43     // End sequence to display (0-4)
44     uint8_t end_seq;
45 
46     OAnimSeq(void);
47     ~OAnimSeq(void);
48 
49     //void init(oentry*, oentry*, oentry*, oentry*);
50     void init(oentry*);
51     void flag_seq();
52     void ferrari_seq();
53     void anim_seq_intro(oanimsprite*);
54     void init_end_seq();
55     void tick_end_seq();
56 
57 private:
58     // End Sequence Animation Position
59     int16_t seq_pos;
60 
61     // End Sequence State (0 = Init, 1 = Tick)
62     uint8_t end_seq_state;
63 
64     // Used for Ferrari End Animation Sequence
65     bool ferrari_stopped;
66 
67     void init_end_sprites();
68     void tick_ferrari();
69     void anim_seq_outro(oanimsprite*, int pal_override = -1);
70     void anim_seq_shadow(oanimsprite*, oanimsprite*);
71     void anim_seq_outro_ferrari();
72     bool read_anim_data(oanimsprite*);
73 };
74 
75 extern OAnimSeq oanimseq;
76