(svn r3514) -Codechange: Replace direct fiddling of bits for the ground type and density of clear tiles with symbolic names and accessors.

See clear.h for details
This commit is contained in:
tron
2006-02-01 15:31:21 +00:00
parent 2b98509692
commit ac4f4e30d5
7 changed files with 197 additions and 255 deletions

View File

@@ -2,6 +2,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "clear.h"
#include "table/strings.h"
#include "table/sprites.h"
#include "functions.h"
@@ -885,32 +886,18 @@ static const byte _plantfarmfield_type[] = {1, 1, 1, 1, 1, 3, 3, 4, 4, 4, 5, 5,
static bool IsBadFarmFieldTile(TileIndex tile)
{
switch (GetTileType(tile)) {
case MP_CLEAR: {
byte m5 = _m[tile].m5 & 0x1C;
return m5 == 0xC || m5 == 0x10;
}
case MP_TREES:
return false;
default:
return true;
case MP_CLEAR: return IsClearGround(tile, CL_FIELDS) || IsClearGround(tile, CL_SNOW);
case MP_TREES: return false;
default: return true;
}
}
static bool IsBadFarmFieldTile2(TileIndex tile)
{
switch (GetTileType(tile)) {
case MP_CLEAR: {
byte m5 = _m[tile].m5 & 0x1C;
return m5 == 0x10;
}
case MP_TREES:
return false;
default:
return true;
case MP_CLEAR: return IsClearGround(tile, CL_SNOW);
case MP_TREES: return false;
default: return true;
}
}