diff options
author | Treeki <treeki@gmail.com> | 2011-08-14 13:53:39 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-08-14 13:53:39 +0200 |
commit | 3f8674bd26a2b2718b16817117a047ac3e9b61c3 (patch) | |
tree | 7124ff61a6f1931ad3bd12cf6c5028837fc3ca2c /src/randtiles.cpp | |
parent | 5232eea9c7626d83eb973ab7d33e4b8fd3f703e7 (diff) | |
download | kamek-3f8674bd26a2b2718b16817117a047ac3e9b61c3.tar.gz kamek-3f8674bd26a2b2718b16817117a047ac3e9b61c3.zip |
random tile engine is fixed once and for all!
Diffstat (limited to 'src/randtiles.cpp')
-rw-r--r-- | src/randtiles.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/randtiles.cpp b/src/randtiles.cpp index f4853d4..1508200 100644 --- a/src/randtiles.cpp +++ b/src/randtiles.cpp @@ -146,13 +146,13 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { u16 *top = 0, *left = 0, *right = 0, *bottom = 0;
if (type == RandomTileData::CHECK_HORZ || type == RandomTileData::CHECK_BOTH) {
- left = self->getPointerToTile(bgr->curX - 1, bgr->curY);
- right = self->getPointerToTile(bgr->curX + 1, bgr->curY);
+ left = self->getPointerToTile((bgr->curX - 1) * 16, bgr->curY * 16);
+ right = self->getPointerToTile((bgr->curX + 1) * 16, bgr->curY * 16);
}
if (type == RandomTileData::CHECK_VERT || type == RandomTileData::CHECK_BOTH) {
- top = self->getPointerToTile(bgr->curX, bgr->curY - 1);
- bottom = self->getPointerToTile(bgr->curX, bgr->curY + 1);
+ top = self->getPointerToTile(bgr->curX * 16, (bgr->curY - 1) * 16);
+ bottom = self->getPointerToTile(bgr->curX * 16, (bgr->curY + 1) * 16);
}
int attempts = 0;
@@ -180,7 +180,7 @@ extern "C" void TryAndRandomise(RTilemapClass *self, BGRender *bgr) { if (special == RandomTileData::SP_VDOUBLE_BOTTOM) {
if (top == 0)
- top = self->getPointerToTile(bgr->curX, bgr->curY - 1);
+ top = self->getPointerToTile(bgr->curX * 16, (bgr->curY - 1) * 16);
*top = (chosen - 0x10);
}
|