summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-03-19 11:27:30 +0000
committermaedhros <maedhros@openttd.org>2007-03-19 11:27:30 +0000
commit209101391abfaf901bfc68c83c79bf8c9865b0bb (patch)
tree8ccaccab74c6399452d6ff3f09d5c94335516a62 /src/misc.cpp
parent3d3d8d7c47f3fb98abeefe943f7c94f4485f3dec (diff)
downloadopenttd-209101391abfaf901bfc68c83c79bf8c9865b0bb.tar.xz
(svn r9315) -Merge: The newhouses branch. With this merge comes almost complete support for
the newhouses grf specs, so all newhouses grfs will be playable in the game. Many thanks to everyone who contributed code and ideas, and all the testers who found things we missed.
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 01b73fee2..fdd35ad56 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -18,6 +18,7 @@
#include "vehicle_gui.h"
#include "variables.h"
#include "ai/ai.h"
+#include "newgrf_house.h"
#include "date.h"
#include "cargotype.h"
@@ -132,6 +133,7 @@ void InitializeGame(int mode, uint size_x, uint size_y)
InitializeSigns();
InitializeStations();
InitializeIndustries();
+ InitializeBuildingCounts();
InitializeMainGui();
InitializeNameMgr();
@@ -578,6 +580,34 @@ static void Save_MAP6()
}
}
+static void Load_MAP7()
+{
+ uint size = MapSize();
+ uint i;
+
+ for (i = 0; i != size;) {
+ uint8 buf[4096];
+ uint j;
+
+ SlArray(buf, lengthof(buf), SLE_UINT8);
+ for (j = 0; j != lengthof(buf); j++) _me[i++].m7 = buf[j];
+ }
+}
+
+static void Save_MAP7()
+{
+ uint size = MapSize();
+ uint i;
+
+ SlSetLength(size);
+ for (i = 0; i != size;) {
+ uint8 buf[4096];
+ uint j;
+
+ for (j = 0; j != lengthof(buf); j++) buf[j] = _me[i++].m7;
+ SlArray(buf, lengthof(buf), SLE_UINT8);
+ }
+}
static void Save_CHTS()
{
@@ -614,6 +644,7 @@ extern const ChunkHandler _misc_chunk_handlers[] = {
{ 'M3HI', Save_MAP4, Load_MAP4, CH_RIFF },
{ 'MAP5', Save_MAP5, Load_MAP5, CH_RIFF },
{ 'MAPE', Save_MAP6, Load_MAP6, CH_RIFF },
+ { 'MAP7', Save_MAP7, Load_MAP7, CH_RIFF },
{ 'NAME', Save_NAME, Load_NAME, CH_ARRAY},
{ 'DATE', SaveLoad_DATE, SaveLoad_DATE, CH_RIFF},