]> icculus.org git repositories - btb/d2x.git/blob - main/effects.h
remove rcs tags
[btb/d2x.git] / main / effects.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 /*
15  *
16  * Headerfile for effects.c
17  *
18  */
19
20
21 #ifndef _EFFECTS_H
22 #define _EFFECTS_H
23
24 #include "vclip.h"
25
26 #define MAX_EFFECTS 110
27
28 //flags for eclips.  If no flags are set, always plays
29
30 #define EF_CRITICAL 1   //this doesn't get played directly (only when mine critical)
31 #define EF_ONE_SHOT 2   //this is a special that gets played once
32 #define EF_STOPPED  4   //this has been stopped
33
34 typedef struct eclip {
35         vclip   vc;             //imbedded vclip
36         fix     time_left;      //for sequencing
37         int     frame_count;    //for sequencing
38         short   changing_wall_texture;      //Which element of Textures array to replace.
39         short   changing_object_texture;    //Which element of ObjBitmapPtrs array to replace.
40         int     flags;          //see above
41         int     crit_clip;      //use this clip instead of above one when mine critical
42         int     dest_bm_num;    //use this bitmap when monitor destroyed
43         int     dest_vclip;     //what vclip to play when exploding
44         int     dest_eclip;     //what eclip to play when exploding
45         fix     dest_size;      //3d size of explosion
46         int     sound_num;      //what sound this makes
47         int     segnum,sidenum; //what seg & side, for one-shot clips
48 } __pack__ eclip;
49
50 extern int Num_effects;
51 extern eclip Effects[MAX_EFFECTS];
52
53 // Set up special effects.
54 extern void init_special_effects();
55
56 // Clear any active one-shots
57 void reset_special_effects();
58
59 // Function called in game loop to do effects.
60 extern void do_special_effects();
61
62 // Restore bitmap
63 extern void restore_effect_bitmap_icons();
64
65 //stop an effect from animating.  Show first frame.
66 void stop_effect(int effect_num);
67
68 //restart a stopped effect
69 void restart_effect(int effect_num);
70
71 #ifdef FAST_FILE_IO
72 #define eclip_read_n(ec, n, fp) cfread(ec, sizeof(eclip), n, fp)
73 #else
74 /*
75  * reads n eclip structs from a CFILE
76  */
77 extern int eclip_read_n(eclip *ec, int n, CFILE *fp);
78 #endif
79
80 #endif /* _EFFECTS_H */