From a50b7bf422d8ba402fedec7cfda6ffc77d335ac2 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 30 Aug 2012 05:37:09 +0200 Subject: quick fix so the WORLD_MAP settings don't conflict with nintendo's --- src/koopatlas/pathmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index fa618b0..0ff9473 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -26,7 +26,7 @@ void dWMPathManager_c::setup() { // Figure out what path node to start at if (dScKoopatlas_c::instance->settings & 0x10000000) { // Start off from a "Change" - u8 changeID = dScKoopatlas_c::instance->settings & 0xFF; + u8 changeID = (dScKoopatlas_c::instance->settings >> 20) & 0xFF; SpammyReport("entering at Change ID %d\n", changeID); SpammyReport("Path layer: %p\n", pathLayer); SpammyReport("Node count: %d\n", pathLayer->nodeCount); @@ -539,7 +539,7 @@ void dWMPathManager_c::moveThroughPath() { OSReport("Change to map ID %d (%s), entrance ID %d\n", save->current_world, to->destMap, to->foreignID); - DoSceneChange(WORLD_MAP, 0x10000000 | to->foreignID, 0); + DoSceneChange(WORLD_MAP, 0x10000000 | (to->foreignID << 20), 0); } else if (reallyStop) { // Stop here -- cgit v1.2.3 From 13bd79fc484ff3b57d9994d3ea02500a87786715 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 30 Aug 2012 19:52:32 +0200 Subject: fix for this linker script error that somehow got in --- kamek_pal.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kamek_pal.x b/kamek_pal.x index c1194c9..0afeab8 100644 --- a/kamek_pal.x +++ b/kamek_pal.x @@ -365,7 +365,7 @@ SECTIONS { blockUpdate__15daEnBlockMain_cFv = 0x800217B0; blockResult__15daEnBlockMain_cFv = 0x800212C0; PhysicsCallback1__15daEnBlockMain_c = 0x80021180; - g = 0x80021170; + PhysicsCallback2__15daEnBlockMain_c = 0x80021170; PhysicsCallback3__15daEnBlockMain_c = 0x800211A0; OPhysicsCallback1__15daEnBlockMain_c = 0x80020BF0; OPhysicsCallback2__15daEnBlockMain_c = 0x80020E70; -- cgit v1.2.3 From 2b5bc0f0397e50b7cad585196e403c99d27b6207 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 30 Aug 2012 19:52:41 +0200 Subject: collision types for magic platforms --- src/magicplatform.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/src/magicplatform.cpp b/src/magicplatform.cpp index fe2eb9b..4997945 100644 --- a/src/magicplatform.cpp +++ b/src/magicplatform.cpp @@ -9,7 +9,14 @@ class daEnMagicPlatform_c : public dEn_c { int onExecute(); int onDelete(); + enum CollisionType { + Solid = 0, + SolidOnTop = 1, + None = 2 + }; + // Settings + CollisionType collisionType; u8 rectID, moveSpeed, moveDirection, moveLength; u8 moveDelay, currentMoveDelay; @@ -24,6 +31,7 @@ class daEnMagicPlatform_c : public dEn_c { void handleMovement(); Physics physics; + StandOnTopCollider sotCollider; TileRenderer *renderers; int rendererCount; @@ -129,6 +137,8 @@ int daEnMagicPlatform_c::onCreate() { moveDelay = ((settings & 0xF00000) >> 20) * 6; + collisionType = (CollisionType)((settings & 0x3000000) >> 24); + doesMoveInfinitely = (settings & 0x10000000); setupMovement(); @@ -138,15 +148,35 @@ int daEnMagicPlatform_c::onCreate() { float fWidth = width * 16.0f; float fHeight = height * 16.0f; - physics.setup(this, - 0.0f, 0.0f, fWidth, -fHeight, - &PhysCB1, &PhysCB2, &PhysCB3, 1, 0, 0); - physics.callback1 = &PhysCB4; - physics.callback2 = &PhysCB5; - physics.callback3 = &PhysCB6; + switch (collisionType) { + case Solid: + physics.setup(this, + 0.0f, 0.0f, fWidth, -fHeight, + &PhysCB1, &PhysCB2, &PhysCB3, 1, 0, 0); + + physics.callback1 = &PhysCB4; + physics.callback2 = &PhysCB5; + physics.callback3 = &PhysCB6; + + physics.addToList(); + break; + case SolidOnTop: + sotCollider.init(this, + /*xOffset=*/0.0f, /*yOffset=*/0.0f, + /*topYOffset=*/0, + /*rightSize=*/fWidth, /*leftSize=*/0, + /*rotation=*/0, /*_45=*/1 + ); + + // What is this for. I dunno + sotCollider._47 = 0xA; + sotCollider.flags = 0x80180 | 0xC00; - physics.addToList(); + sotCollider.addToList(); + + break; + } return 1; } @@ -154,7 +184,9 @@ int daEnMagicPlatform_c::onCreate() { int daEnMagicPlatform_c::onDelete() { deleteTiles(); - physics.removeFromList(); + switch (collisionType) { + case Solid: physics.removeFromList(); break; + } return 1; } @@ -165,7 +197,11 @@ int daEnMagicPlatform_c::onExecute() { checkVisibility(); updateTilePositions(); - physics.update(); + + switch (collisionType) { + case Solid: physics.update(); break; + case SolidOnTop: sotCollider.update(); break; + } return 1; } -- cgit v1.2.3