summaryrefslogtreecommitdiff
path: root/src/worldmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/worldmap.cpp47
1 files changed, 31 insertions, 16 deletions
diff --git a/src/worldmap.cpp b/src/worldmap.cpp
index d24710c..d537ff6 100644
--- a/src/worldmap.cpp
+++ b/src/worldmap.cpp
@@ -19,6 +19,23 @@ dScNewerWorldMap_c *dScNewerWorldMap_c::build() {
}
+/*ChainedFunc *initFunctions[] = {
+ WMInit_StartLoading,
+ WMInit_LoadResources,
+ WMInit_EndLoading,
+ WMInit_CreateManagers,
+ WMInit_SetupWait,
+ WMInit_SetupWipe
+};
+
+
+dScNewerWorldMap_c::dScNewerWorldMap_c() {
+ initChain.setup(
+
+ setInitChain(initChain);
+}*/
+
+
#define SELC_SETUP_DONE(sc) (*((bool*)(((u32)(sc))+0xD38)))
#define EASYP_SETUP_DONE(ep) (*((bool*)(((u32)(ep))+0x278)))
@@ -172,22 +189,8 @@ int dScNewerWorldMap_c::onCreate() {
levelInfoFile.open("/NewerRes/LevelInfo.bin");
levelInfo.load(levelInfoFile.ptr());
- // load the menu info
- SaveBlock *save = GetSaveFile()->GetBlock(-1);
-
LoadModel();
- wmData.load("/NewerRes/TestMap.wm");
-
-
- WMDataHeader *hdr = (WMDataHeader*)wmData.fh.filePtr;
- if (save->current_path_node >= hdr->pointCount) {
- this->currentPoint = wmData.getPath(0)->startPoint;
- } else {
- this->currentPoint = hdr->pointList[save->current_path_node];
- }
-
-
return true;
}
@@ -306,12 +309,23 @@ int dScNewerWorldMap_c::onExecute() {
this->state = STATE_NORMAL;
}
+ // since we've got all the resources, set up the path data too
+ pathData.load(resMng['PATH']);
+
+ SaveBlock *save = GetSaveFile()->GetBlock(-1);
+
+ if (save->current_path_node >= pathData.pointCount()) {
+ this->currentPoint = pathData.getPath(0)->startPoint;
+ } else {
+ this->currentPoint = pathData.getPoint(save->current_path_node);
+ }
+
// and now Player setup
this->player = (daWMPlayer_c*)CreateParentedObject(WM_PLAYER, this, 0, 2);
this->player->modelHandler->mdlClass->setPowerup(2);
this->player->modelHandler->mdlClass->startAnimation(0, 1.2f, 10.0f, 0.0f);
this->player->pos = this->currentPoint->position;
- }
+s }
} break;
@@ -791,6 +805,7 @@ void dScNewerWorldMap_c::HandleMovement() {
else if (nowPressed & WPAD_DOWN && currentPoint->exits.asDirection.down.isValid())
StartMovementTo(DOWN);
+
if (nowPressed & WPAD_TWO)
ActivatePoint();
}
@@ -855,7 +870,7 @@ void dScNewerWorldMap_c::MoveThroughPath() {
SaveBlock *save = GetSaveFile()->GetBlock(-1);
//save->current_world = newPage; ?
- save->current_path_node = wmData.getPointID(this->currentPoint);
+ save->current_path_node = pathData.getPointID(this->currentPoint);
} else {
this->MoveToSegment(nextSegment);
}