summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-01-11 02:05:13 +0000
committerbelugas <belugas@openttd.org>2007-01-11 02:05:13 +0000
commit04694afabb3e8c8632dc5e158dfe9729ccffb711 (patch)
tree35400c488d5fac84250bbc2df5031789ffa75050 /src/misc.cpp
parente29124d48b794153be2f3c0e9772cbbda851727d (diff)
downloadopenttd-04694afabb3e8c8632dc5e158dfe9729ccffb711.tar.xz
(svn r8050) -Codechange: Rename map member extra to m6, since its usage has been widden.
Only doc landscape_grid.html has been updated, landscape.html will be done latter. -CodeChange: Replace a direct access to m6 with SetTropicZone in InitializeLandscape, as it is the only part of m6 still untouched without the brute-forced m6=0
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index d753445e9..39714bb55 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -546,8 +546,9 @@ static void Save_MAP5(void)
}
}
-static void Load_MAPE(void)
+static void Load_MAP6(void)
{
+ /* Still available for loading old games */
uint size = MapSize();
uint i;
@@ -558,10 +559,10 @@ static void Load_MAPE(void)
SlArray(buf, lengthof(buf), SLE_UINT8);
for (j = 0; j != lengthof(buf); j++) {
- _m[i++].extra = GB(buf[j], 0, 2);
- _m[i++].extra = GB(buf[j], 2, 2);
- _m[i++].extra = GB(buf[j], 4, 2);
- _m[i++].extra = GB(buf[j], 6, 2);
+ _m[i++].m6 = GB(buf[j], 0, 2);
+ _m[i++].m6 = GB(buf[j], 2, 2);
+ _m[i++].m6 = GB(buf[j], 4, 2);
+ _m[i++].m6 = GB(buf[j], 6, 2);
}
}
} else {
@@ -570,12 +571,12 @@ static void Load_MAPE(void)
uint j;
SlArray(buf, lengthof(buf), SLE_UINT8);
- for (j = 0; j != lengthof(buf); j++) _m[i++].extra = buf[j];
+ for (j = 0; j != lengthof(buf); j++) _m[i++].m6 = buf[j];
}
}
}
-static void Save_MAPE(void)
+static void Save_MAP6(void)
{
uint size = MapSize();
uint i;
@@ -585,7 +586,7 @@ static void Save_MAPE(void)
uint8 buf[4096];
uint j;
- for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].extra;
+ for (j = 0; j != lengthof(buf); j++) buf[j] = _m[i++].m6;
SlArray(buf, lengthof(buf), SLE_UINT8);
}
}
@@ -625,7 +626,7 @@ extern const ChunkHandler _misc_chunk_handlers[] = {
{ 'M3LO', Save_MAP3, Load_MAP3, CH_RIFF },
{ 'M3HI', Save_MAP4, Load_MAP4, CH_RIFF },
{ 'MAP5', Save_MAP5, Load_MAP5, CH_RIFF },
- { 'MAPE', Save_MAPE, Load_MAPE, CH_RIFF },
+ { 'MAPE', Save_MAP6, Load_MAP6, CH_RIFF },
{ 'NAME', Save_NAME, Load_NAME, CH_ARRAY},
{ 'DATE', SaveLoad_DATE, SaveLoad_DATE, CH_RIFF},