summaryrefslogtreecommitdiff
path: root/src/koopatlas
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-27 23:29:46 +0200
committerTreeki <treeki@gmail.com>2012-09-27 23:29:46 +0200
commit81ef1a8b7f7d63c72b92f779d73a8b2b0f8158c1 (patch)
treeeb3567c82f79dd6290f95cfb6a6e600cea1e870f /src/koopatlas
parent624a89dc12d88973486b39937871c5facf6b9bb6 (diff)
downloadkamek-81ef1a8b7f7d63c72b92f779d73a8b2b0f8158c1.tar.gz
kamek-81ef1a8b7f7d63c72b92f779d73a8b2b0f8158c1.zip
new levelinfo format and a couple of fixes
Diffstat (limited to '')
-rw-r--r--src/koopatlas/core.cpp10
-rw-r--r--src/koopatlas/hud.cpp16
-rw-r--r--src/koopatlas/hud.h4
-rw-r--r--src/koopatlas/pathmanager.cpp9
-rw-r--r--src/koopatlas/pathmanager.h1
-rw-r--r--src/koopatlas/starcoin.cpp2
6 files changed, 30 insertions, 12 deletions
diff --git a/src/koopatlas/core.cpp b/src/koopatlas/core.cpp
index c20d715..cb13119 100644
--- a/src/koopatlas/core.cpp
+++ b/src/koopatlas/core.cpp
@@ -970,13 +970,13 @@ void dScKoopatlas_c::startLevel(dLevelInfo_c::entry_s *entry) {
sl.unk4 = 0;
sl.purpose = 0;
- sl.world1 = entry->world;
- sl.world2 = entry->world;
- sl.level1 = entry->level;
- sl.level2 = entry->level;
+ sl.world1 = entry->worldSlot;
+ sl.world2 = entry->worldSlot;
+ sl.level1 = entry->levelSlot;
+ sl.level2 = entry->levelSlot;
// hopefully this will fix the Star Coin issues
- SetSomeConditionShit(entry->world, entry->level, 2);
+ SetSomeConditionShit(entry->worldSlot, entry->levelSlot, 2);
ActivateWipe(WIPE_MARIO);
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp
index 90e769e..667feb2 100644
--- a/src/koopatlas/hud.cpp
+++ b/src/koopatlas/hud.cpp
@@ -156,6 +156,7 @@ dWMHud_c *dWMHud_c::build() {
dWMHud_c::dWMHud_c() {
layoutLoaded = false;
displayedControllerType = -1;
+ isFooterVisible = false;
}
enum WMHudAnimation {
@@ -267,6 +268,7 @@ int dWMHud_c::onExecute() {
if (willShowFooter && (!(layout.isAnimOn(SHOW_FOOTER)))) {
willShowFooter = false;
+ isFooterVisible = true;
loadFooterInfo();
playShowAnim(SHOW_FOOTER);
}
@@ -310,13 +312,15 @@ void dWMHud_c::playHideAnim(int id) {
layout.enableNonLoopAnim(id, true);
}
layout.grpHandlers[id].frameCtrl.flags = 3; // NO_LOOP | REVERSE
+ if (id == SHOW_FOOTER)
+ isFooterVisible = false;
}
void dWMHud_c::loadHeaderInfo() {
dLevelInfo_c *levelInfo = &dScKoopatlas_c::instance->levelInfo;
- dLevelInfo_c::entry_s *infEntry = levelInfo->search(
+ dLevelInfo_c::entry_s *infEntry = levelInfo->searchBySlot(
nodeForHeader->levelNumber[0]-1, nodeForHeader->levelNumber[1]-1);
if (infEntry == 0) {
@@ -434,9 +438,15 @@ void dWMHud_c::leftNode() {
}
-void dWMHud_c::hideAndShowFooter() {
+void dWMHud_c::hideFooter() {
+ if (isFooterVisible)
+ playHideAnim(SHOW_FOOTER);
+}
+
+void dWMHud_c::showFooter() {
willShowFooter = true;
- playHideAnim(SHOW_FOOTER);
+ if (isFooterVisible)
+ playHideAnim(SHOW_FOOTER);
}
diff --git a/src/koopatlas/hud.h b/src/koopatlas/hud.h
index c0079af..05ad07c 100644
--- a/src/koopatlas/hud.h
+++ b/src/koopatlas/hud.h
@@ -38,7 +38,8 @@ class dWMHud_c : public dBase_c {
void enteredNode(dKPNode_s *node = 0);
void leftNode();
- void hideAndShowFooter();
+ void hideFooter();
+ void showFooter();
void setupLives();
@@ -55,6 +56,7 @@ class dWMHud_c : public dBase_c {
void loadFooterInfo();
bool willShowFooter;
+ bool isFooterVisible;
dTexMapColouriser_c headerCol, footerCol;
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index 8a05ea4..c691a89 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -628,8 +628,13 @@ void dWMPathManager_c::moveThroughPath() {
save->hudHintL = world->hudHintL;
if (dWMHud_c::instance)
- dWMHud_c::instance->hideAndShowFooter();
+ dWMHud_c::instance->showFooter();
}
+ } else if (to->worldID == 0) {
+ OSReport("No world\n");
+ save->newerWorldName[0] = 0;
+ if (dWMHud_c::instance)
+ dWMHud_c::instance->hideFooter();
} else {
OSReport("Not found!\n");
}
@@ -710,7 +715,7 @@ void dWMPathManager_c::activatePoint() {
isEnteringLevel = true;
levelStartWait = 40;
- enteredLevel = dScKoopatlas_c::instance->levelInfo.search(w, l);
+ enteredLevel = dScKoopatlas_c::instance->levelInfo.searchBySlot(w, l);
}
}
diff --git a/src/koopatlas/pathmanager.h b/src/koopatlas/pathmanager.h
index 5579f66..a1d916d 100644
--- a/src/koopatlas/pathmanager.h
+++ b/src/koopatlas/pathmanager.h
@@ -9,6 +9,7 @@
#endif
#include "koopatlas/mapdata.h"
+#include "levelinfo.h"
extern "C" void *SoundRelatedClass;
extern "C" void *MapSoundPlayer(void *SoundClass, int soundID, int unk);
diff --git a/src/koopatlas/starcoin.cpp b/src/koopatlas/starcoin.cpp
index 3842f87..4366895 100644
--- a/src/koopatlas/starcoin.cpp
+++ b/src/koopatlas/starcoin.cpp
@@ -238,7 +238,7 @@ void dWMStarCoin::LoadCoinsForWorld(int world) {
if (levelArray[world][l][i]) {
levelNum--;
dLevelInfo_c *li = &dScKoopatlas_c::instance->levelInfo;
- dLevelInfo_c::entry_s *entry = li->search(world, levelNum);
+ dLevelInfo_c::entry_s *entry = li->searchBySlot(world, levelNum);
setText(li->getNameForLevel(entry), levelPane);
totalCoins += 3;