changeset 18316:d3f4c0cd3f06 draft

(svn r23152) -Change: [NewGRF v8] Snow line height table uses values between 0x00 and 0xFF independent of number of height levels.
author frosch <frosch@openttd.org>
date Tue, 08 Nov 2011 17:28:42 +0000
parents f8f4556edf99
children a04775eae135
files src/newgrf.cpp
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2429,7 +2429,16 @@
 					for (uint i = 0; i < SNOW_LINE_MONTHS; i++) {
 						for (uint j = 0; j < SNOW_LINE_DAYS; j++) {
 							table[i][j] = buf->ReadByte();
-							if (table[i][j] != 0xFF) table[i][j] /= TILE_HEIGHT;
+							if (_cur.grffile->grf_version >= 8) {
+								if (table[i][j] != 0xFF) table[i][j] = table[i][j] * (1 + MAX_TILE_HEIGHT) / 256;
+							} else {
+								if (table[i][j] >= 128) {
+									/* no snow */
+									table[i][j] = 0xFF;
+								} else {
+									table[i][j] = table[i][j] * (1 + MAX_TILE_HEIGHT) / 128;
+								}
+							}
 						}
 					}
 					SetSnowLine(table);