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