mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r26884) -Change: scale the NewGRF's snow line level according to the configured maximum map height
This commit is contained in:
parent
cfe08b86c9
commit
ddfc8372ee
|
@ -2696,13 +2696,13 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
|
||||||
for (uint j = 0; j < SNOW_LINE_DAYS; j++) {
|
for (uint j = 0; j < SNOW_LINE_DAYS; j++) {
|
||||||
table[i][j] = buf->ReadByte();
|
table[i][j] = buf->ReadByte();
|
||||||
if (_cur.grffile->grf_version >= 8) {
|
if (_cur.grffile->grf_version >= 8) {
|
||||||
if (table[i][j] != 0xFF) table[i][j] = table[i][j] * (1 + MAX_TILE_HEIGHT) / 256;
|
if (table[i][j] != 0xFF) table[i][j] = table[i][j] * (1 + _settings_game.construction.max_heightlevel) / 256;
|
||||||
} else {
|
} else {
|
||||||
if (table[i][j] >= 128) {
|
if (table[i][j] >= 128) {
|
||||||
/* no snow */
|
/* no snow */
|
||||||
table[i][j] = 0xFF;
|
table[i][j] = 0xFF;
|
||||||
} else {
|
} else {
|
||||||
table[i][j] = table[i][j] * (1 + MAX_TILE_HEIGHT) / 128;
|
table[i][j] = table[i][j] * (1 + _settings_game.construction.max_heightlevel) / 128;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5827,7 +5827,7 @@ bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile)
|
||||||
|
|
||||||
case 0x20: { // snow line height
|
case 0x20: { // snow line height
|
||||||
byte snowline = GetSnowLine();
|
byte snowline = GetSnowLine();
|
||||||
if (_settings_game.game_creation.landscape == LT_ARCTIC && snowline <= MAX_TILE_HEIGHT) {
|
if (_settings_game.game_creation.landscape == LT_ARCTIC && snowline <= _settings_game.construction.max_heightlevel) {
|
||||||
*value = Clamp(snowline * (grffile->grf_version >= 8 ? 1 : TILE_HEIGHT), 0, 0xFE);
|
*value = Clamp(snowline * (grffile->grf_version >= 8 ? 1 : TILE_HEIGHT), 0, 0xFE);
|
||||||
} else {
|
} else {
|
||||||
/* No snow */
|
/* No snow */
|
||||||
|
@ -6484,7 +6484,7 @@ static uint32 GetPatchVariable(uint8 param)
|
||||||
|
|
||||||
/* The maximum height of the map. */
|
/* The maximum height of the map. */
|
||||||
case 0x14:
|
case 0x14:
|
||||||
return MAX_TILE_HEIGHT;
|
return _settings_game.construction.max_heightlevel;
|
||||||
|
|
||||||
/* Extra foundations base sprite */
|
/* Extra foundations base sprite */
|
||||||
case 0x15:
|
case 0x15:
|
||||||
|
|
|
@ -278,7 +278,7 @@ struct GameCreationSettings {
|
||||||
uint8 map_y; ///< Y size of map
|
uint8 map_y; ///< Y size of map
|
||||||
byte land_generator; ///< the landscape generator
|
byte land_generator; ///< the landscape generator
|
||||||
byte oil_refinery_limit; ///< distance oil refineries allowed from map edge
|
byte oil_refinery_limit; ///< distance oil refineries allowed from map edge
|
||||||
byte snow_line_height; ///< a number 0-15 that configured snow line height
|
byte snow_line_height; ///< the configured snow line height
|
||||||
byte tgen_smoothness; ///< how rough is the terrain from 0-3
|
byte tgen_smoothness; ///< how rough is the terrain from 0-3
|
||||||
byte tree_placer; ///< the tree placer algorithm
|
byte tree_placer; ///< the tree placer algorithm
|
||||||
byte heightmap_rotation; ///< rotation director for the heightmap
|
byte heightmap_rotation; ///< rotation director for the heightmap
|
||||||
|
|
Loading…
Reference in New Issue