|
Line 0
Link Here
|
|
|
1 |
--- src/sys.h.orig 2015-03-09 12:48:31 UTC |
| 2 |
+++ src/sys.h |
| 3 |
@@ -99,62 +99,63 @@ enum KEYBINDS { |
| 4 |
|
| 5 |
extern const char* const key_desc[]; |
| 6 |
|
| 7 |
-SDL_Surface* screen; |
| 8 |
-TTF_Font* font; |
| 9 |
+extern SDL_Surface* screen; |
| 10 |
+extern TTF_Font* font; |
| 11 |
|
| 12 |
-int score; |
| 13 |
-int high_scores[10]; |
| 14 |
-bool title_screen; |
| 15 |
-bool high_scores_screen; |
| 16 |
-int options_screen; |
| 17 |
-bool game_over; |
| 18 |
-bool paused; |
| 19 |
-bool quit; |
| 20 |
-int game_mode; |
| 21 |
+extern int score; |
| 22 |
+extern int high_scores[10]; |
| 23 |
+extern bool title_screen; |
| 24 |
+extern bool high_scores_screen; |
| 25 |
+extern int options_screen; |
| 26 |
+extern bool game_over; |
| 27 |
+extern bool paused; |
| 28 |
+extern bool quit; |
| 29 |
+extern int game_mode; |
| 30 |
|
| 31 |
struct Cursor { |
| 32 |
int x1; |
| 33 |
int y1; |
| 34 |
int x2; |
| 35 |
int y2; |
| 36 |
-}cursor; |
| 37 |
+}; |
| 38 |
+extern struct Cursor cursor; |
| 39 |
|
| 40 |
-int action_cooldown; |
| 41 |
+extern int action_cooldown; |
| 42 |
typedef enum { |
| 43 |
ACTION_NONE, ACTION_LEFT, ACTION_RIGHT, ACTION_UP, ACTION_DOWN |
| 44 |
}ActionMove; |
| 45 |
-ActionMove action_move; |
| 46 |
-ActionMove action_last_move; |
| 47 |
-ActionMove action_switch; |
| 48 |
-bool action_bump; |
| 49 |
-bool action_accept; |
| 50 |
-bool action_pause; |
| 51 |
-bool action_exit; |
| 52 |
+extern ActionMove action_move; |
| 53 |
+extern ActionMove action_last_move; |
| 54 |
+extern bool action_switch; |
| 55 |
+extern bool action_bump; |
| 56 |
+extern bool action_accept; |
| 57 |
+extern bool action_pause; |
| 58 |
+extern bool action_exit; |
| 59 |
|
| 60 |
-Dork_String path_dir_config; |
| 61 |
-Dork_String path_file_config; |
| 62 |
-Dork_String path_file_highscores; |
| 63 |
-Dork_String path_file_highscores_jewels; |
| 64 |
+extern Dork_String path_dir_config; |
| 65 |
+extern Dork_String path_file_config; |
| 66 |
+extern Dork_String path_file_highscores; |
| 67 |
+extern Dork_String path_file_highscores_jewels; |
| 68 |
|
| 69 |
-int option_joystick; |
| 70 |
-int option_sound; |
| 71 |
-int option_music; |
| 72 |
-int option_fullscreen; |
| 73 |
+extern int option_joystick; |
| 74 |
+extern int option_sound; |
| 75 |
+extern int option_music; |
| 76 |
+extern int option_fullscreen; |
| 77 |
|
| 78 |
-SDLKey option_key[9]; |
| 79 |
-int option_joy_button[5]; |
| 80 |
-int option_joy_axis_x; |
| 81 |
-int option_joy_axis_y; |
| 82 |
+extern SDLKey option_key[9]; |
| 83 |
+extern int option_joy_button[5]; |
| 84 |
+extern int option_joy_axis_x; |
| 85 |
+extern int option_joy_axis_y; |
| 86 |
|
| 87 |
-SDLKey last_key; |
| 88 |
-int last_joy_button; |
| 89 |
+extern SDLKey last_key; |
| 90 |
+extern int last_joy_button; |
| 91 |
|
| 92 |
-SDL_Event event; |
| 93 |
+extern SDL_Event event; |
| 94 |
|
| 95 |
// Timers |
| 96 |
-unsigned int startTimer; |
| 97 |
-unsigned int endTimer; |
| 98 |
-unsigned int deltaTimer; |
| 99 |
+extern unsigned int startTimer; |
| 100 |
+extern unsigned int endTimer; |
| 101 |
+extern unsigned int deltaTimer; |
| 102 |
|
| 103 |
// Functions |
| 104 |
bool sysInit(); |
| 105 |
@@ -176,26 +177,26 @@ void sysHighScoresSave(); |
| 106 |
void sysHighScoresClear(); |
| 107 |
|
| 108 |
// Images |
| 109 |
-SDL_Surface* surface_blocks; |
| 110 |
-SDL_Surface* surface_clear; |
| 111 |
-SDL_Surface* surface_cursor; |
| 112 |
-SDL_Surface* surface_cursor_highlight; |
| 113 |
-SDL_Surface* surface_bar; |
| 114 |
-SDL_Surface* surface_bar_inactive; |
| 115 |
-SDL_Surface* surface_background; |
| 116 |
-SDL_Surface* surface_background_jewels; |
| 117 |
-SDL_Surface* surface_title; |
| 118 |
-SDL_Surface* surface_highscores; |
| 119 |
+extern SDL_Surface* surface_blocks; |
| 120 |
+extern SDL_Surface* surface_clear; |
| 121 |
+extern SDL_Surface* surface_cursor; |
| 122 |
+extern SDL_Surface* surface_cursor_highlight; |
| 123 |
+extern SDL_Surface* surface_bar; |
| 124 |
+extern SDL_Surface* surface_bar_inactive; |
| 125 |
+extern SDL_Surface* surface_background; |
| 126 |
+extern SDL_Surface* surface_background_jewels; |
| 127 |
+extern SDL_Surface* surface_title; |
| 128 |
+extern SDL_Surface* surface_highscores; |
| 129 |
|
| 130 |
// Music and Sounds |
| 131 |
-Mix_Music* music; |
| 132 |
-Mix_Music* music_jewels; |
| 133 |
-Mix_Chunk* sound_menu; |
| 134 |
-Mix_Chunk* sound_switch; |
| 135 |
-Mix_Chunk* sound_match; |
| 136 |
-Mix_Chunk* sound_drop; |
| 137 |
+extern Mix_Music* music; |
| 138 |
+extern Mix_Music* music_jewels; |
| 139 |
+extern Mix_Chunk* sound_menu; |
| 140 |
+extern Mix_Chunk* sound_switch; |
| 141 |
+extern Mix_Chunk* sound_match; |
| 142 |
+extern Mix_Chunk* sound_drop; |
| 143 |
|
| 144 |
// Joystick |
| 145 |
-SDL_Joystick* joy; |
| 146 |
+extern SDL_Joystick* joy; |
| 147 |
|
| 148 |
#endif |