bzr branch
http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad_ducktape
21
by Gustav Hatvigsson
* added Modeline to (almost) all files. |
1 |
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
|
2 |
* vi: set shiftwidth=2 tabstop=2 expandtab:
|
|
3 |
* :indentSize=2:tabSize=2:noTabs=true:
|
|
4 |
*/
|
|
5 |
||
1
by Gustav Hartvigsson
Initial code. |
6 |
#ifndef __H_GAME__
|
7 |
#define __H_GAME__
|
|
8 |
||
32
by Gustav Hartvigsson
* Removed code that is not needed |
9 |
|
10 |
#include "defs.h" |
|
1
by Gustav Hartvigsson
Initial code. |
11 |
#include <SDL2/SDL.h> |
12 |
#include <stdbool.h> |
|
13 |
||
32
by Gustav Hartvigsson
* Removed code that is not needed |
14 |
BEGIN_DECLS
|
15 |
||
1
by Gustav Hartvigsson
Initial code. |
16 |
#include "MousePointer.h" |
17 |
#include "GameButton.h" |
|
7
by Gustav Hartvigsson
* Added licensing information to the files. |
18 |
//#include "JSParser.h"
|
19 |
#include "game_utils.h" |
|
20 |
||
34
by Gustav Hartvigsson
* Fixed more problem with Doxygen. |
21 |
/* This file, as the rest of the project is under MIT license.
|
7
by Gustav Hartvigsson
* Added licensing information to the files. |
22 |
* see http://opensource.org/licenses/MIT
|
23 |
*
|
|
8
by Gustav Hartvigsson
* added and changed little in the files Lincening information. |
24 |
* Author Gustav Hartvigsson <gustav.hartvigsson _at_ gmail.com> 2014
|
7
by Gustav Hartvigsson
* Added licensing information to the files. |
25 |
*/
|
26 |
||
32
by Gustav Hartvigsson
* Removed code that is not needed |
27 |
#define J_SCALE_FACTOR 5000 //TODO: change the movement to time-based |
28 |
||
29 |
/** @file
|
|
30 |
* A Game represents the game itself. This is going to be re-implementation in
|
|
31 |
* the future.
|
|
32 |
*/
|
|
33 |
||
34 |
/**
|
|
35 |
* Quits the program in an unsafe way.
|
|
36 |
*/
|
|
1
by Gustav Hartvigsson
Initial code. |
37 |
void quit (int rc); |
38 |
||
12
by Gustav Hartvigsson
* reorganising code to be remove extra typedefs. |
39 |
typedef struct Game { |
1
by Gustav Hartvigsson
Initial code. |
40 |
SDL_Event event; |
41 |
SDL_Point mouse_delta; |
|
42 |
bool mouse_pressed; |
|
25
by Gustav Hartvigsson
* Switched variable names to something more consistant |
43 |
bool bg_color_toggle; |
1
by Gustav Hartvigsson
Initial code. |
44 |
int done; |
25
by Gustav Hartvigsson
* Switched variable names to something more consistant |
45 |
SDL_Color background_color; |
1
by Gustav Hartvigsson
Initial code. |
46 |
SDL_Window * window; |
47 |
SDL_Renderer * renderer; |
|
48 |
SDL_GameController * game_controller; |
|
49 |
MousePointer * mouse; |
|
50 |
GameButton * button; |
|
12
by Gustav Hartvigsson
* reorganising code to be remove extra typedefs. |
51 |
} Game; |
1
by Gustav Hartvigsson
Initial code. |
52 |
|
32
by Gustav Hartvigsson
* Removed code that is not needed |
53 |
/**
|
54 |
* Creates a new Game.
|
|
55 |
*/
|
|
1
by Gustav Hartvigsson
Initial code. |
56 |
Game * game_new (); |
32
by Gustav Hartvigsson
* Removed code that is not needed |
57 |
|
58 |
/**
|
|
59 |
* The function that possesses the events of the game.
|
|
60 |
* Should generally not be called from outside the Game.
|
|
61 |
*/
|
|
1
by Gustav Hartvigsson
Initial code. |
62 |
void game_process_events (Game * self); |
32
by Gustav Hartvigsson
* Removed code that is not needed |
63 |
|
64 |
/**
|
|
65 |
* The function that has to be run for the game to run. executes the main loop
|
|
66 |
* of the game.
|
|
67 |
*/
|
|
1
by Gustav Hartvigsson
Initial code. |
68 |
void game_main_loop (Game * self); |
32
by Gustav Hartvigsson
* Removed code that is not needed |
69 |
/**
|
70 |
* Frees the Game and the resources associated with it.
|
|
71 |
*/
|
|
1
by Gustav Hartvigsson
Initial code. |
72 |
void game_free (Game * self); |
32
by Gustav Hartvigsson
* Removed code that is not needed |
73 |
|
74 |
/**
|
|
75 |
* a function that internally is called to draw all the objects on the screen.
|
|
76 |
*/
|
|
1
by Gustav Hartvigsson
Initial code. |
77 |
void game_draw (Game * self); |
78 |
||
32
by Gustav Hartvigsson
* Removed code that is not needed |
79 |
END_DECLS
|
80 |
||
1
by Gustav Hartvigsson
Initial code. |
81 |
#endif
|