summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-08-14 13:54:14 +0200
committerTreeki <treeki@gmail.com>2011-08-14 13:54:14 +0200
commitdf2a6c031daa43c948eaebd5c53c1434d48851b6 (patch)
tree81216bf4b30b605f0529ca634981ebe8d9f77813
parentebdd733a35511127a4f6b79eb3868b557c3033ce (diff)
downloadkamek-df2a6c031daa43c948eaebd5c53c1434d48851b6.tar.gz
kamek-df2a6c031daa43c948eaebd5c53c1434d48851b6.zip
random tile engine is fixed once and for all!
-rw-r--r--src/randtiles.cpp10
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);
}