| 1 |
/** |
| 2 |
* Game-specific processing |
| 3 |
|
| 4 |
* Copyright (C) 1997, 1998, 1999, 2002, 2003 Seth A. Robinson |
| 5 |
* Copyright (C) 2008, 2009, 2012 Sylvain Beucler |
| 6 |
|
| 7 |
* This file is part of GNU FreeDink |
| 8 |
|
| 9 |
* GNU FreeDink is free software; you can redistribute it and/or |
| 10 |
* modify it under the terms of the GNU General Public License as |
| 11 |
* published by the Free Software Foundation; either version 3 of the |
| 12 |
* License, or (at your option) any later version. |
| 13 |
|
| 14 |
* GNU FreeDink is distributed in the hope that it will be useful, but |
| 15 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
* General Public License for more details. |
| 18 |
|
| 19 |
* You should have received a copy of the GNU General Public License |
| 20 |
* along with this program. If not, see |
| 21 |
* <http://www.gnu.org/licenses/>. |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef _GAME_ENGINE_H |
| 25 |
#define _GAME_ENGINE_H |
| 26 |
|
| 27 |
#include <time.h> |
| 28 |
|
| 29 |
#include "SDL.h" |
| 30 |
#include "io_util.h" |
| 31 |
#include "dinkc.h" |
| 32 |
#include "gfx_tiles.h" |
| 33 |
#include "inventory.h" |
| 34 |
|
| 35 |
struct attackinfo_struct |
| 36 |
{ |
| 37 |
int time; |
| 38 |
/*bool*/int active; |
| 39 |
int script; |
| 40 |
/*bool*/int hitme; |
| 41 |
int last_power; |
| 42 |
Uint32 wait; |
| 43 |
Uint32 pull_wait; |
| 44 |
}; |
| 45 |
extern struct attackinfo_struct bow; |
| 46 |
|
| 47 |
extern int walk_off_screen; |
| 48 |
|
| 49 |
struct wait_for_button |
| 50 |
{ |
| 51 |
int script; |
| 52 |
int button; |
| 53 |
/*bool*/int active; |
| 54 |
}; |
| 55 |
extern struct wait_for_button wait4b; |
| 56 |
|
| 57 |
extern int stop_entire_game; |
| 58 |
|
| 59 |
extern int screenlock; |
| 60 |
|
| 61 |
|
| 62 |
extern int last_saved_game; |
| 63 |
|
| 64 |
extern char *dversion_string; |
| 65 |
extern int dversion; |
| 66 |
#define LEN_SAVE_GAME_INFO 200 |
| 67 |
extern char save_game_info[LEN_SAVE_GAME_INFO]; |
| 68 |
|
| 69 |
extern time_t time_start; |
| 70 |
|
| 71 |
extern int smooth_follow; |
| 72 |
|
| 73 |
|
| 74 |
/* Editor sprite containing the current warp (teleporter), 0 if no active warp: */ |
| 75 |
extern int process_warp; |
| 76 |
extern int process_downcycle; |
| 77 |
extern int process_upcycle; |
| 78 |
extern unsigned long cycle_clock; |
| 79 |
extern int cycle_script; |
| 80 |
|
| 81 |
extern /*bool*/int screen_main_is_running; |
| 82 |
|
| 83 |
extern Uint32 thisTickCount; |
| 84 |
extern Uint32 lastTickCount; |
| 85 |
extern int fps_final; |
| 86 |
extern int base_timing; |
| 87 |
|
| 88 |
extern int keep_mouse; |
| 89 |
extern int mode; |
| 90 |
|
| 91 |
extern int warp_editor_sprite; |
| 92 |
extern int show_inventory; |
| 93 |
|
| 94 |
|
| 95 |
extern void game_init(int version); |
| 96 |
extern void game_quit(); |
| 97 |
extern void game_restart(); |
| 98 |
|
| 99 |
extern void game_compute_speed(); |
| 100 |
extern Uint32 game_GetTicks(void); |
| 101 |
extern void game_set_high_speed(void); |
| 102 |
extern void game_set_normal_speed(void); |
| 103 |
|
| 104 |
extern int next_raise(); |
| 105 |
extern void add_exp_force(int num, int source_sprite); |
| 106 |
extern void add_exp(int num, int killed_sprite); |
| 107 |
|
| 108 |
extern void fix_dead_sprites(); |
| 109 |
|
| 110 |
extern int game_load_screen(int num); |
| 111 |
extern void update_screen_time(void); |
| 112 |
extern void update_play_changes( void ); |
| 113 |
extern void game_place_sprites(void); |
| 114 |
extern void game_place_sprites_background(void); |
| 115 |
extern void fill_back_sprites(void); |
| 116 |
|
| 117 |
extern void draw_screen_game(void); |
| 118 |
extern void draw_screen_game_background(void); |
| 119 |
|
| 120 |
extern void set_mode(int new_mode); |
| 121 |
extern void apply_mode(); |
| 122 |
extern void set_keep_mouse(int on); |
| 123 |
|
| 124 |
#endif |