summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2010-02-25 09:43:00 +0000
committerpeter1138 <peter1138@openttd.org>2010-02-25 09:43:00 +0000
commitf9709a6f50044683e6c165ca9104c5e68a9bd905 (patch)
tree332b6083f155c5cc14fc304ce824eb8c716fde08
parent29c05e2dd28e1ed84f688825917b6b04649c143d (diff)
downloadopenttd-f9709a6f50044683e6c165ca9104c5e68a9bd905.tar.xz
(svn r19235) -Add: [NewGRF] Add 2 bits of pseudo-random data for rail types, based on tile location.
-rw-r--r--src/newgrf_railtype.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp
index b76eb2aef..931f544e9 100644
--- a/src/newgrf_railtype.cpp
+++ b/src/newgrf_railtype.cpp
@@ -14,10 +14,13 @@
#include "newgrf_commons.h"
#include "newgrf_railtype.h"
#include "newgrf_spritegroup.h"
+#include "core/bitmath_func.hpp"
static uint32 RailTypeGetRandomBits(const ResolverObject *object)
{
- return 0;
+ TileIndex tile = object->u.routes.tile;
+ uint tmp = CountBits(tile + (TileX(tile) + TileY(tile)) * TILE_SIZE);
+ return GB(tmp, 0, 2);
}
static uint32 RailTypeGetTriggers(const ResolverObject *object)