Another two obj source files

This commit is contained in:
robojumper
2025-06-24 22:15:25 +02:00
parent 21eef4331b
commit b522045f0e
10 changed files with 284 additions and 46 deletions
+1 -1
View File
@@ -209,6 +209,7 @@ public:
protected:
StartResult setupSoundCommon(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg);
void setVolumeFade(f32 volume, u32 fadeFrames);
private:
/**
@@ -255,7 +256,6 @@ private:
dSndSeSound2_c *getHandleType2ForSoundHandle_Dupe(nw4r::snd::SoundHandle *pHandle);
void initVolumeFade();
void setVolumeFade(f32 volume, u32 fadeFrames);
void calcVolumeFade();
// at 0x00: dSoundSourceIf_c vtable
+4
View File
@@ -26,6 +26,10 @@ public:
static s32 getSourceCategoryForSourceType(s32 sourceType, const char *name);
static bool isSwOrEOc(const char *name);
static dSoundSource_c *getPlayerSource() {
return GetInstance()->mpPlayerSource;
}
static dSoundSource_c *getBoomerangSource() {
return GetInstance()->mpBoomerangSource;
}
+35
View File
@@ -0,0 +1,35 @@
#ifndef D_SND_SOURCE_OBJ_H
#define D_SND_SOURCE_OBJ_H
#include "d/snd/d_snd_source.h"
#include "d/snd/d_snd_util.h"
#include "nw4r/math/math_types.h"
class dSndSourceObj_c : public dSoundSource_c {
public:
dSndSourceObj_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSoundSource_c(sourceType, ac, name, pOwnerGroup) {}
/* 0x188 */ virtual void postSetup() override;
/* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override;
/* 0x1E8 */ virtual u32 d_s_vt_0x1E8(u32 soundId) override {
return specializeBgHitSoundId(soundId, mPolyAttr0, mPolyAttr1);
}
private:
bool isName(const char *name) const {
return streq(name, getName());
}
};
class dSndSourceObjLightShaft_c : public dSndSourceObj_c {
public:
dSndSourceObjLightShaft_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceObj_c(sourceType, ac, name, pOwnerGroup) {}
/* 0x1EC */ virtual void setPosition(const nw4r::math::VEC3 &position) override;
};
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef D_SND_SOURCE_OBJ_CLEF_H
#define D_SND_SOURCE_OBJ_CLEF_H
#include "d/snd/d_snd_source_obj.h"
class dSndSourceObjClef_c : public dSndSourceObj_c {
public:
dSndSourceObjClef_c(u8 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup)
: dSndSourceObj_c(sourceType, ac, name, pOwnerGroup) {}
bool startTadtoneSound(u32 groupIdx, u32 noteIdx);
};
#endif
+4
View File
@@ -49,6 +49,10 @@ public:
return field_0x044;
}
s32 getField_0x058() const {
return field_0x058;
}
u32 getField_0x11C() const {
return field_0x11C;
}