-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefines.h
71 lines (50 loc) · 1.32 KB
/
defines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#pragma once
#include "vector2d.h"
/* main window size */
#define WINDOW_WIDTH 640
#define WINDOW_HEIGHT 480
/* level size */
#define LEVEL_WIDTH 200
#define LEVEL_HEIGHT 15
/* ERRORS */
#define ERR_NONE 0
#define ERR_SDL_NOT_INITIALIZED 1
#define ERR_SDL_WINDOW_NOT_CREATED 2
#define ERR_SDL_RENDERER_NOT_CREATED 3
#define ERR_SDL_AUDIO_NOT_INITIALIZED 4
#define SQR(X) (X)*(X)
#define EPSILON 0.01
/* game logics*/
#define BLOCK_SIZE 32
#define TILE_SIZE 32
#define COUNT_TILES_HORIZONTAL 19
#define COUNT_TILES_VERTICAL 12
/* physics */
#define GRAVITY BLOCK_SIZE/3.0f
#define MIN_VERTICAL_IMPULSE -GRAVITY
#define MAX_VERTICAL_IMPULSE GRAVITY
#define MIN_HORIZONTAL_IMPULSE -GRAVITY
#define MAX_HORIZONTAL_IMPULSE GRAVITY
/* 60 frames per second */
#define LIMIT_FPS 60
/* === NEW TYPES === */
/* booleans */
#define false 0
#define true 1
typedef unsigned char bool;
/* byte */
typedef char byte;
typedef unsigned char ubyte;
/* int16 */
typedef signed short int int16;
typedef unsigned short int uint16;
/* int32 */
typedef signed int int32;
typedef unsigned int uint32;
/* int64 */
typedef signed long int int64;
typedef unsigned long int uint64;
/* === GLOBALS === */
float deltaTime;
uint16 fps;
SVector2f cameraPos;