JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
final changes to README, bumped to version 3
[vor.git] / globals.h
1 #ifndef VOR_GLOBALS_H
2 #define VOR_GLOBALS_H
3
4 #include <SDL.h>
5 #include "shape.h"
6 #include "SFont.h"
7
8 struct bangdots {
9         // Bang dots have the same colour as shield dots.
10         // Bang dots get darker as they age.
11         // Some are coloured the same as the ex-ship.
12         float x,y,dx,dy;
13         Uint16 c; // when zero, use heatcolor[bangdotlife]
14         float life;     // When reduced to 0, set active = 0
15         int active;
16         float decay;// Amount by which to reduce life each time dot is drawn
17 };
18 struct enginedots {
19         // Engine dots stream out the back of the ship, getting darker as they go.
20         int active;
21         float x,y,dx,dy;
22         // The life of an engine dot 
23         // is a number starting at between 0 and 50 and counting backward.
24         float life;     // When reduced to 0, set active = 0
25 };
26 struct spacedot {
27         // Space dots are harmless background items
28         // All are active. When one falls off the edge, another is created at the start.
29         float x,y,z;
30         Uint16 color;
31 };
32
33 // ************************************* VARS
34 // SDL_Surface global variables
35 extern SDL_Surface 
36         *surf_screen,   // Screen
37         *surf_b_variations, // "variations" banner
38         *surf_b_on, // "on" banner
39         *surf_b_rockdodger, // "rockdodger" banner
40         *surf_b_game,   // Title element "game"
41         *surf_b_over,   // Title element "over"
42         *surf_ship,             // Spaceship element
43         *surf_life,     // Indicator of number of ships remaining
44         *surf_rock[NROCKS],     // THE ROCKS
45         *surf_font_big; // The big font
46
47 extern SFont_Font *g_font;
48
49 extern uint32_t area;
50
51 // Structure global variables
52 extern struct enginedots edot[MAXENGINEDOTS], *dotptr;
53 extern struct bangdots bdot[MAXBANGDOTS], *bdotptr;
54 extern struct spacedot sdot[MAXSPACEDOTS];
55
56 // Other global variables
57 extern char topline[1024];
58 extern char *initerror;
59
60 extern struct shape shipshape;
61 extern float shipx,shipy;       // X position, 0..XSIZE
62 extern float shipdx,shipdy;     // Change in X position per tick.
63 extern float screendx, screendy;
64 extern float xscroll, yscroll;
65 extern float gamerate;  // this controls the speed of everything that moves.
66 extern float yscroll;
67 extern float scrollvel;
68
69 extern int nships,score,initticks,ticks_since_last, last_ticks;
70 extern int gameover;
71 extern int maneuver;
72 extern int sound_flag, music_flag;
73 extern int tail_plume; // display big engine at the back?
74 extern int friction;    // should there be friction?
75 extern float fadetimer, faderate;
76
77 extern int pausedown, paused;
78
79 // bangdot start (bd1) and end (bd2) position:
80 extern int bd1, bd2;
81
82 extern int bangdotlife, nbangdots;
83 extern Uint16 heatcolor[W*3];
84
85 extern char *data_dir;
86
87 #endif // VOR_GLOBALS_H