summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-07-19 17:24:33 +0000
committerrubidium <rubidium@openttd.org>2010-07-19 17:24:33 +0000
commit644deff9d2939f49d7a4d22c1168ba3f46e98dfa (patch)
tree3554d097da4f07e97c455d615c78b8e0280ed680
parent73527b7b4506cb7f34ac44a1fbcfbc200c320dbd (diff)
downloadopenttd-644deff9d2939f49d7a4d22c1168ba3f46e98dfa.tar.xz
(svn r20191) -Codechange: unVARDEF _tick_counter and move it to a more logical location
-rw-r--r--src/date.cpp2
-rw-r--r--src/date_func.h1
-rw-r--r--src/gamelog.cpp1
-rw-r--r--src/newgrf_airporttiles.cpp1
-rw-r--r--src/newgrf_house.cpp1
-rw-r--r--src/newgrf_industrytiles.cpp1
-rw-r--r--src/variables.h3
7 files changed, 6 insertions, 4 deletions
diff --git a/src/date.cpp b/src/date.cpp
index 9a361d294..4b9a49f6d 100644
--- a/src/date.cpp
+++ b/src/date.cpp
@@ -26,7 +26,7 @@ Year _cur_year; ///< Current year, starting at 0
Month _cur_month; ///< Current month (0..11)
Date _date; ///< Current date in days (day counter)
DateFract _date_fract;
-
+uint16 _tick_counter; ///< Ever incrementing (and sometimes wrapping) tick counter for setting off various events
void SetDate(Date date)
{
diff --git a/src/date_func.h b/src/date_func.h
index 217ac2f1b..43c858379 100644
--- a/src/date_func.h
+++ b/src/date_func.h
@@ -18,6 +18,7 @@ extern Year _cur_year;
extern Month _cur_month;
extern Date _date;
extern DateFract _date_fract;
+extern uint16 _tick_counter;
void SetDate(Date date);
void ConvertDateToYMD(Date date, YearMonthDay *ymd);
diff --git a/src/gamelog.cpp b/src/gamelog.cpp
index 7d56a0ba5..7d827a379 100644
--- a/src/gamelog.cpp
+++ b/src/gamelog.cpp
@@ -19,6 +19,7 @@
#include "gamelog_internal.h"
#include "console_func.h"
#include "debug.h"
+#include "date_func.h"
#include "rev.h"
#include <stdarg.h>
diff --git a/src/newgrf_airporttiles.cpp b/src/newgrf_airporttiles.cpp
index 520438c5a..6b239c1a7 100644
--- a/src/newgrf_airporttiles.cpp
+++ b/src/newgrf_airporttiles.cpp
@@ -28,6 +28,7 @@
#include "core/random_func.hpp"
#include "table/strings.h"
#include "table/airporttiles.h"
+#include "date_func.h"
AirportTileSpec AirportTileSpec::tiles[NUM_AIRPORTTILES];
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index 052594bbd..c3a309c33 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -28,6 +28,7 @@
#include "core/random_func.hpp"
#include "sprite.h"
#include "genworld.h"
+#include "date_func.h"
static BuildingCounts<uint32> _building_counts;
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 4ab1d4e91..479f51ede 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -27,6 +27,7 @@
#include "animated_tile_func.h"
#include "water.h"
#include "sprite.h"
+#include "date_func.h"
#include "table/strings.h"
diff --git a/src/variables.h b/src/variables.h
index 1d63d02f9..1fe9e2978 100644
--- a/src/variables.h
+++ b/src/variables.h
@@ -16,7 +16,4 @@
#define VARDEF extern
#endif
-/* Amount of game ticks */
-VARDEF uint16 _tick_counter;
-
#endif /* VARIABLES_H */