Files
bigmak94andClaude Opus 5.5 4b395efe5c Add the Petari decompilation (SMGCommunity/Petari@0a5c660)
The sources of Petari (https://github.com/SMGCommunity/Petari), the
Super Mario Galaxy decompilation by the SMGCommunity, at commit
0a5c6608dc3b4c44a9aa68c2535d1793dc565f02, unchanged but for LF line
endings: LICENSE (as LICENSE-Petari.txt; CC0 1.0), include/, libs/ and
src/.  Left out: the game data Petari keeps from the original
executable, the error message archive (include/Game/System/
ErrorArchive.hpp) and two tables (src/Game/System/GalaxyID.bcsv and
StoryEvent.bcsv); GalaxyQuest's converter takes them from the player's
own disc.  The port's changes follow in the next commit, so
`git diff petari-base -- decomp` shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 01:59:38 +02:00

125 lines
3.7 KiB
C++

#pragma once
#include <revolution/types.h>
class ImageEffectBase;
class ImageEffectDirector;
class ImageEffectState {
public:
/// @brief Creates a new `ImageEffectState`.
/// @param pHost A pointer to the owning `ImageEffectDirector` instance.
ImageEffectState(ImageEffectDirector* pHost) : mHost(pHost) {
}
/// @brief Destroys the `ImageEffectState`.
virtual ~ImageEffectState() {
}
virtual void update();
virtual bool doesEffectExist() const = 0;
virtual ImageEffectBase* getEffect() const = 0;
virtual void onChange() {
}
void forceOff();
private:
/* 0x04 */ ImageEffectDirector* mHost;
};
namespace ImageEffectStateImpl {
class StateNull : public ImageEffectState {
public:
/// @brief Creates a new `StateNull`.
/// @param pHost A pointer to the owning `ImageEffectDirector` instance.
StateNull(ImageEffectDirector* pHost) : ImageEffectState(pHost) {
}
virtual bool doesEffectExist() const {
return true;
}
virtual ImageEffectBase* getEffect() const {
return nullptr;
}
};
class StateBloomNormal : public ImageEffectState {
public:
/// @brief Creates a new `StateBloomNormal`.
/// @param pHost A pointer to the owning `ImageEffectDirector` instance.
StateBloomNormal(ImageEffectDirector* pHost);
virtual void update();
virtual bool doesEffectExist() const;
virtual ImageEffectBase* getEffect() const;
virtual void onChange();
void setBloomIntensity(u8 bloomIntensity);
void setThreshold(u8 threshold);
void setIntensity1(u8 intensity1);
void setIntensity1Default();
void setIntensity2(u8 intensity2);
void setIntensity2Default();
private:
/* 0x08 */ bool _8;
/* 0x0C */ u32 _C;
/* 0x10 */ f32 _10;
/* 0x14 */ u8 mBloomIntensity;
/* 0x18 */ f32 _18;
/* 0x1C */ u8 mThreshold;
/* 0x20 */ f32 _20;
/* 0x24 */ s32 mIntensity1;
/* 0x28 */ f32 _28;
/* 0x2C */ s32 mIntensity2;
};
class StateBloomSimple : public ImageEffectState {
public:
/// @brief Creates a new `StateBloomSimple`.
/// @param pHost A pointer to the owning `ImageEffectDirector` instance.
StateBloomSimple(ImageEffectDirector* pHost) : ImageEffectState(pHost) {
}
virtual bool doesEffectExist() const;
virtual ImageEffectBase* getEffect() const;
void setMaskFilterAll();
void setMaskFilterRed();
void setMaskFilterGreen();
void setMaskFilterBlue();
void setThreshold(u8 threshold);
void setIntensity(f32 intensity);
};
class StateScreenBlur : public ImageEffectState {
public:
/// @brief Creates a new `StateScreenBlur`.
/// @param pHost A pointer to the owning `ImageEffectDirector` instance.
StateScreenBlur(ImageEffectDirector* pHost) : ImageEffectState(pHost) {
}
virtual bool doesEffectExist() const;
virtual ImageEffectBase* getEffect() const;
void setIntensity(f32 intensity);
};
class StateDepthOfField : public ImageEffectState {
public:
/// @brief Creates a new `StateDepthOfField`.
/// @param pHost A pointer to the owning `ImageEffectDirector` instance.
StateDepthOfField(ImageEffectDirector* pHost) : ImageEffectState(pHost) {
}
virtual bool doesEffectExist() const;
virtual ImageEffectBase* getEffect() const;
void setIntensity(f32 intensity);
void setBlurMaxDist(s32 blurMaxDist);
void setBlurMinDist(s32 blurMinDist);
};
}; // namespace ImageEffectStateImpl