summaryrefslogtreecommitdiffstats
path: root/pacman-c++/constants.h
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/constants.h')
-rw-r--r--pacman-c++/constants.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/pacman-c++/constants.h b/pacman-c++/constants.h
index 15d3022..34f29d0 100644
--- a/pacman-c++/constants.h
+++ b/pacman-c++/constants.h
@@ -1,12 +1,17 @@
1#ifndef CONSTANTS_H 1#ifndef CONSTANTS_H
2#define CONSTANTS_H 2#define CONSTANTS_H
3 3
4#define SPRITE_MARGIN 2 4namespace Constants {
5#define SPRITE_WIDTH 16
6#define SPRITE_HEIGHT 16
7 5
8const unsigned int map_size[2] = { 20, 20 }; 6 const struct {
9const unsigned int field_size[2] = { 16, 16 }; 7 const unsigned int width, height;
8 } field_size = { 16, 16 },
9 map_size = { 20, 20 },
10 map_size_pixel = { field_size.width * map_size.width,
11 field_size.height * map_size.height};
12
13 const unsigned int sprite_margin = 2;
14}
10 15
11namespace Color 16namespace Color
12{ 17{
@@ -18,13 +23,13 @@ namespace Color
18 green = (1 << 2), 23 green = (1 << 2),
19 }; 24 };
20} 25}
21 26
22// constants for data transmission to client 27// constants for data transmission to client
23namespace transmission 28namespace Transmission
24{ 29{
25 typedef unsigned int field_t; 30 typedef unsigned int field_t;
26 typedef unsigned int mask_t; 31 typedef unsigned int mask_t;
27 32
28 const field_t block = (1 << 3); 33 const field_t block = (1 << 3);
29 const field_t bonuspoint = (1 << 4); 34 const field_t bonuspoint = (1 << 4);
30 const field_t pacman = (1 << 5); 35 const field_t pacman = (1 << 5);