diff options
author | Treeki <treeki@gmail.com> | 2011-07-25 04:31:00 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-07-25 04:31:00 +0200 |
commit | 9e6e6cecaaec6cf27fd818a66a18edadd6804a2b (patch) | |
tree | 9afe0ff5e74d8d3339521b9a49cf0191dc3e0e17 /src/randtiles.cpp | |
parent | ebed8b9946f7755eb624dd62595ce87edaa5657a (diff) | |
download | kamek-9e6e6cecaaec6cf27fd818a66a18edadd6804a2b.tar.gz kamek-9e6e6cecaaec6cf27fd818a66a18edadd6804a2b.zip |
random tile hack complete! it's missing definitions though
Diffstat (limited to '')
-rw-r--r-- | src/randtiles.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/randtiles.cpp b/src/randtiles.cpp index 4af3bf7..92e31ae 100644 --- a/src/randtiles.cpp +++ b/src/randtiles.cpp @@ -109,7 +109,7 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { // Found it!!
// Try to make one until we meet the conditions
u8 *tileNums = entry->getTileNums();
- u8 chosen = 0xFF;
+ u16 chosen = 0xFF;
u16 *top = 0, *left = 0, *right = 0, *bottom = 0;
if (entry->type == RandomTileData::CHECK_HORZ || entry->type == RandomTileData::CHECK_BOTH) {
@@ -123,7 +123,8 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { }
while (true) {
- chosen = tileNums[MakeRandomNumber(entry->count)];
+ // is there even a point to using that special random function?
+ chosen = (tileset << 8) | tileNums[MakeRandomNumberForTiles(entry->count)];
if (top != 0 && *top == chosen)
continue;
|