1 // SONIC ROBO BLAST 2
2 //-----------------------------------------------------------------------------
3 // Copyright (C) 1993-1996 by id Software, Inc.
4 // Copyright (C) 1998-2000 by DooM Legacy Team.
5 // Copyright (C) 1999-2020 by Sonic Team Junior.
6 //
7 // This program is free software distributed under the
8 // terms of the GNU General Public License, version 2.
9 // See the 'LICENSE' file for more details.
10 //-----------------------------------------------------------------------------
11 /// \file  p_pspr.h
12 /// \brief Sprite animation
13 ///        Frame flags:
14 ///        handles maximum brightness (torches, muzzle flare, light sources)
15 
16 // we use the upper 16 bits of the frame field for effects.
17 #ifndef __P_PSPR__
18 #define __P_PSPR__
19 
20 // Basic data types.
21 // Needs fixed point, and BAM angles.
22 #include "m_fixed.h"
23 #include "tables.h"
24 
25 //
26 // Needs to include the precompiled
27 //  sprite animation tables.
28 // Header generated by multigen utility.
29 // This includes all the data for thing animation,
30 // i.e. the Thing Atrributes table
31 // and the Frame Sequence table.
32 #include "info.h"
33 
34 #ifdef __GNUG__
35 #pragma interface
36 #endif
37 
38 /// \brief Frame flags: only the frame number - 0 to 256 (Frames from 0 to 63, Sprite2 number uses 0 to 127 plus FF_SPR2SUPER)
39 #define FF_FRAMEMASK 0xff
40 
41 /// \brief Frame flags - SPR2: Super sprite2
42 #define FF_SPR2SUPER 0x80
43 /// \brief Frame flags - SPR2: A change of state at the end of Sprite2 animation
44 #define FF_SPR2ENDSTATE 0x1000
45 /// \brief Frame flags - SPR2: 50% of starting in middle of Sprite2 animation
46 #define FF_SPR2MIDSTART 0x2000
47 
48 /// \brief Frame flags: 0 = no trans(opaque), 1-15 = transl. table
49 #define FF_TRANSMASK 0xf0000
50 /// \brief shift for FF_TRANSMASK
51 #define FF_TRANSSHIFT 16
52 /// \brief preshifted translucency flags
53 #define FF_TRANS10 (tr_trans10<<FF_TRANSSHIFT)
54 #define FF_TRANS20 (tr_trans20<<FF_TRANSSHIFT)
55 #define FF_TRANS30 (tr_trans30<<FF_TRANSSHIFT)
56 #define FF_TRANS40 (tr_trans40<<FF_TRANSSHIFT)
57 #define FF_TRANS50 (tr_trans50<<FF_TRANSSHIFT)
58 #define FF_TRANS60 (tr_trans60<<FF_TRANSSHIFT)
59 #define FF_TRANS70 (tr_trans70<<FF_TRANSSHIFT)
60 #define FF_TRANS80 (tr_trans80<<FF_TRANSSHIFT)
61 #define FF_TRANS90 (tr_trans90<<FF_TRANSSHIFT)
62 
63 /// \brief Frame flags: frame always appears full bright
64 #define FF_FULLBRIGHT 0x00100000
65 /// \brief Frame flags: Flip sprite vertically (relative to what it should be for its gravity)
66 #define FF_VERTICALFLIP 0x00200000
67 /// \brief Frame flags: Flip sprite horizontally
68 #define FF_HORIZONTALFLIP 0x00400000
69 /// \brief Frame flags: Thin, paper-like sprite (for collision equivalent, see MF_PAPERCOLLISION)
70 #define FF_PAPERSPRITE 0x00800000
71 
72 /// \brief Frame flags - Animate: Simple stateless animation
73 #define FF_ANIMATE 0x01000000
74 /// \brief Frame flags - Animate: Start at a random place in the animation (mutually exclusive with below)
75 #define FF_RANDOMANIM 0x02000000
76 /// \brief Frame flags - Animate: Sync animation to global timer (mutually exclusive with above)
77 #define FF_GLOBALANIM 0x04000000
78 
79 /**	\brief translucency tables
80 
81 	\todo add another asm routine which use the fg and bg indexes in the
82 	inverse order so the 20-80 becomes 80-20 translucency, no need
83 	for other tables (thus 1090,2080,5050,8020,9010, and fire special)
84 
85 	\todo render all this obsolete by writing some goddamn realtime
86 	translucency and 32-bit color support
87 */
88 typedef enum
89 {
90 	tr_trans10 = 1,
91 	tr_trans20,
92 	tr_trans30,
93 	tr_trans40,
94 	tr_trans50,
95 	tr_trans60,
96 	tr_trans70,
97 	tr_trans80,
98 	tr_trans90,
99 	NUMTRANSMAPS
100 } transnum_t;
101 
102 #endif
103