summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-10-19 03:03:11 +0200
committerTreeki <treeki@gmail.com>2012-10-19 03:03:11 +0200
commite46b9fd64bfe675085d8117b4f7842fdf7d09bbb (patch)
tree1246ef27650f51507460c24447c21afd480e40de
parent9640a0b9ea3e031c86187f10e53553a8cc9b5213 (diff)
downloadkamek-e46b9fd64bfe675085d8117b4f7842fdf7d09bbb.tar.gz
kamek-e46b9fd64bfe675085d8117b4f7842fdf7d09bbb.zip
fixed sounds
-rwxr-xr-xinclude/game.h15
-rw-r--r--kamek_pal.x2
-rw-r--r--src/koopatlas/pathmanager.cpp20
3 files changed, 27 insertions, 10 deletions
diff --git a/include/game.h b/include/game.h
index 0a843c2..63a076c 100755
--- a/include/game.h
+++ b/include/game.h
@@ -3367,5 +3367,20 @@ bool FreeEffects(int efNum);
bool FreeBreff(int efNum);
bool FreeBreft(int efNum);
+
+namespace nw4r {
+ namespace snd {
+ class SoundHandle {
+ private:
+ void *data;
+ public:
+ SoundHandle() { data = 0; }
+ ~SoundHandle() { DetachSound(); }
+
+ void DetachSound();
+ };
+ }
+}
+
#endif
diff --git a/kamek_pal.x b/kamek_pal.x
index 885f3ad..184eaef 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -4,6 +4,8 @@ SECTIONS {
_8042A788 = 0x8042A788;
somethingAboutSound__FPv = 0x8019CB30;
+ DetachSound__Q34nw4r3snd11SoundHandleFv = 0x8027A340;
+
RESTART_CRSIN_LevelStartStruct = 0x80374060;
DrawTheFuckingHat = 0x800CA664;
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index bb6cc52..9c6eb38 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -4,7 +4,7 @@
#include "koopatlas/player.h"
#include <sfx.h>
-extern "C" void PlaySoundWithFunctionB4(void *spc, void *handle, int id, int unk);
+extern "C" void PlaySoundWithFunctionB4(void *spc, nw4r::snd::SoundHandle *handle, int id, int unk);
static u8 MaybeFinishingLevel[2] = {0xFF,0xFF};
@@ -332,7 +332,7 @@ void dWMPathManager_c::execute() {
if (countdownToFadeIn <= 0) {
unlockingAlpha = 0;
- u32 something = 0;
+ nw4r::snd::SoundHandle something;
PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_OBJ_GEN_LOAD, 1);
} else {
return;
@@ -359,7 +359,7 @@ void dWMPathManager_c::execute() {
if (unlockingAlpha == 255) {
// we've reached the end
unlockingAlpha = -1;
- u32 something = 0;
+ nw4r::snd::SoundHandle something;
PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_OBJ_GEN_NEW_COURSE, 1);
waitAfterUnlock = 15;
@@ -545,11 +545,11 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
if (Animations[id].initialEffect)
SpawnEffect(Animations[id].initialEffect, 0, &player->pos, 0, &player->scale);
if (Animations[id].initialSound != SE_NULL) {
- u32 something = 0;
+ nw4r::snd::SoundHandle something;
PlaySoundWithFunctionB4(SoundRelatedClass, &something, Animations[id].initialSound, 1);
if (Animations[id].initialSound == SE_PLY_JUMP) {
- u32 something2 = 0;
+ nw4r::snd::SoundHandle something2;
PlaySoundWithFunctionB4(SoundRelatedClass, &something2, SE_VOC_MA_CS_JUMP, 1);
}
}
@@ -754,16 +754,16 @@ void dWMPathManager_c::activatePoint() {
SpammyReport("Toad House Flags: %x", conds);
if (conds & 0xFF0) {
-
- u32 something = 0;
+ nw4r::snd::SoundHandle something;
PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_SYS_INVALID, 1);
- return; }
+ return;
+ }
}
- u32 something = 0;
+ nw4r::snd::SoundHandle something;
PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_SYS_GAME_START, 1);
- u32 something2 = 0;
+ nw4r::snd::SoundHandle something2;
PlaySoundWithFunctionB4(SoundRelatedClass, &something2, SE_VOC_MA_CS_COURSE_IN_HARD, 1);
daWMPlayer_c::instance->startAnimation(170, 1.2, 10.0, 0.0);