summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/koopatlas/map.cpp4
-rw-r--r--src/koopatlas/shop.cpp48
-rw-r--r--src/koopatlas/shop.h4
3 files changed, 53 insertions, 3 deletions
diff --git a/src/koopatlas/map.cpp b/src/koopatlas/map.cpp
index 4d2bc1d..1c2de26 100644
--- a/src/koopatlas/map.cpp
+++ b/src/koopatlas/map.cpp
@@ -387,6 +387,7 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer, int alpha) {
else
frame = anim->start + (delta * value);
+ float scaleYMod;
// and apply it!
switch (anim->type) {
case dKPDoodad_s::animation_s::X_POS:
@@ -403,6 +404,9 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer, int alpha) {
break;
case dKPDoodad_s::animation_s::Y_SCALE:
effectiveHeight = (effectiveHeight * frame / 100.0);
+
+ scaleYMod = doodad->height - effectiveHeight;
+ effectiveY += scaleYMod;
break;
case dKPDoodad_s::animation_s::OPACITY:
// TODO
diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp
index 04d7e54..ed64c8e 100644
--- a/src/koopatlas/shop.cpp
+++ b/src/koopatlas/shop.cpp
@@ -165,6 +165,8 @@ int dWMShop_c::onCreate() {
layout.enableNonLoopAnim(i);
}
+ layout.drawOrder = 0x01;
+
layoutLoaded = true;
}
@@ -186,7 +188,7 @@ int dWMShop_c::onExecute() {
if (!layout.isAnyAnimOn()) {
if (nowPressed & WPAD_B) {
- MapSoundPlayer(SoundRelatedClass, SE_SYS_WINDOW_CLOSE, 1);
+ MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_OUT_AUTO, 1);
CloseUpShop();
} else if (nowPressed & WPAD_DOWN) {
if (currentItem == 6) { return true; }
@@ -252,6 +254,48 @@ int dWMShop_c::onDraw() {
return true;
}
+void dWMShop_c::specialDraw1() {
+ OSReport("Lakionnnne....");
+ if (!isHidden) {
+ Vec pos = {layout.posX, layout.posY, 40000.0};
+ S16Vec rot = {0,0,0};
+ Vec scale = {1.0, 1.0, 1.0};
+ matrix.translation(pos.x, pos.y, pos.z);
+ matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z);
+
+ shopkeep.setDrawMatrix(matrix);
+ shopkeep.setScale(&scale);
+ shopkeep.calcWorld(false);
+ shopkeep.scheduleForDrawing();
+ shopkeep._vf1C();
+
+ if(this->ska.isAnimationDone())
+ this->ska.setCurrentFrame(0.0);
+ }
+ return;
+}
+
+void dWMShop_c::specialDraw2() {
+ OSReport("Lakituuu....");
+ if (!isHidden) {
+ Vec pos = {layout.posX, layout.posY, 40000.0};
+ S16Vec rot = {0,0,0};
+ Vec scale = {1.0, 1.0, 1.0};
+ matrix.translation(pos.x, pos.y, pos.z);
+ matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z);
+
+ shopkeep.setDrawMatrix(matrix);
+ shopkeep.setScale(&scale);
+ shopkeep.calcWorld(false);
+ shopkeep.scheduleForDrawing();
+ shopkeep._vf1C();
+
+ if(this->ska.isAnimationDone())
+ this->ska.setCurrentFrame(0.0);
+ }
+ return;
+}
+
void dWMShop_c::changeItem(int last, int current) {
@@ -295,7 +339,7 @@ void dWMShop_c::LoadShopForWorld(int world) {
return; }
// Handle showing it
- MapSoundPlayer(SoundRelatedClass, SE_SYS_WINDOW_OPEN, 1);
+ MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_IN, 1);
isHidden = false;
layout.enableNonLoopAnim(18);
diff --git a/src/koopatlas/shop.h b/src/koopatlas/shop.h
index 64e4453..b4281b7 100644
--- a/src/koopatlas/shop.h
+++ b/src/koopatlas/shop.h
@@ -8,7 +8,7 @@ extern "C" void *MapSoundPlayer(void *SoundClass, int soundID, int unk);
class dShopItem;
-class dWMShop_c : public dBase_c {
+class dWMShop_c : public dActor_c {
public:
dWMShop_c();
@@ -16,6 +16,8 @@ class dWMShop_c : public dBase_c {
int onDelete();
int onExecute();
int onDraw();
+ void specialDraw1();
+ void specialDraw2();
bool layoutLoaded;
m2d::EmbedLayout_c layout;