-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.cpp
89 lines (69 loc) · 1.43 KB
/
globals.cpp
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <time.h>
#include <SDL/SDL.h>
#include <libtcod/libtcod.h>
#include "def.h"
#include "structs.h"
#include "globals.h"
sEgoData g_ego;
int g_iWorld[DEF_WORLD_X][DEF_WORLD_Y];
bool g_bVisible[DEF_WORLD_X][DEF_WORLD_Y];
sInventory *g_inventoryWorldList[DEF_WORLD_X][DEF_WORLD_Y];
sILightmap g_iWorldLightmap[DEF_WORLD_X][DEF_WORLD_Y];
sNPCData *g_npcMap[DEF_WORLD_X][DEF_WORLD_Y];
TCOD_map_t g_tcodMap;
TCOD_map_t g_tcodLightmap;
sItemList *g_itemDynamic;
sInventory *g_itemLook; /* Built when using the look command, for the inventory interface. */
sNPCList *g_npcList;
int g_iItemTracker;
int g_iGameMode;
char g_cConsole[32][672];
char g_cConsoleInput[32];
int g_iConsoleInputCount;
void globalsInit() {
g_itemDynamic = NULL; // You just never know ...
g_npcList = NULL;
memset(&g_cConsole, 0, sizeof(g_cConsole));
sILightmap tempLightmap = {-1, -1};
for (int x = 0; x < DEF_WORLD_X; x++) {
for (int y = 0; y < DEF_WORLD_Y; y++) {
g_iWorldLightmap[x][y] = tempLightmap;
g_npcMap[x][y] = NULL;
}
}
return;
}
/* Tables */
char g_cRaceNames[][32] = {
"NIL",
"Human"
};
char g_cRaceNamesShort[][4] = {
"NIL",
"HUM"
};
char g_cSexNames[][32] = {
"NIL",
"Male",
"Female",
"Sexless",
"Both"
};
char g_cSexNameShort[][4] = {
"X",
"M",
"F",
"N",
"B"
};
char g_cJobNames[][32] = {
"NIL",
"Warrior"
};
char g_cJobNamesShort[][32] = {
"NIL",
"WAR"
};