mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of ssh+git://git.axiodl.com:6431/AxioDL/urde
This commit is contained in:
commit
c85f1a64dd
|
@ -266,16 +266,19 @@ CGameOptions::CGameOptions()
|
|||
InitSoundMode();
|
||||
}
|
||||
|
||||
float CGameOptions::TuneScreenBrightness() { return (0.375f * 1.f) + (float(x48_screenBrightness) * 0.25f); }
|
||||
float CGameOptions::TuneScreenBrightness() const { return (0.375f * 1.f) + (float(x48_screenBrightness) * 0.25f); }
|
||||
|
||||
void CGameOptions::InitSoundMode() { /* If system is mono, force x44 to mono, otherwise honor user preference */
|
||||
}
|
||||
static float BrightnessCopyFilter = 0.f;
|
||||
void CGameOptions::SetScreenBrightness(s32 val, bool apply) {
|
||||
x48_screenBrightness = zeus::clamp(0, val, 8);
|
||||
void CGameOptions::SetScreenBrightness(s32 value, bool apply) {
|
||||
x48_screenBrightness = zeus::clamp(0, value, 8);
|
||||
|
||||
if (apply)
|
||||
BrightnessCopyFilter = TuneScreenBrightness();
|
||||
if (!apply) {
|
||||
return;
|
||||
}
|
||||
|
||||
BrightnessCopyFilter = TuneScreenBrightness();
|
||||
}
|
||||
|
||||
void CGameOptions::ApplyGamma() {
|
||||
|
@ -287,51 +290,60 @@ void CGameOptions::ApplyGamma() {
|
|||
CGraphics::g_BooFactory->setDisplayGamma(gammaT);
|
||||
}
|
||||
|
||||
void CGameOptions::SetGamma(s32 val, bool apply) {
|
||||
m_gamma = zeus::clamp(-100, val, 100);
|
||||
void CGameOptions::SetGamma(s32 value, bool apply) {
|
||||
m_gamma = zeus::clamp(-100, value, 100);
|
||||
|
||||
if (apply)
|
||||
ApplyGamma();
|
||||
if (!apply) {
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyGamma();
|
||||
}
|
||||
|
||||
void CGameOptions::SetScreenPositionX(s32 pos, bool apply) {
|
||||
x4c_screenXOffset = zeus::clamp(-30, pos, 30);
|
||||
void CGameOptions::SetScreenPositionX(s32 position, bool apply) {
|
||||
x4c_screenXOffset = zeus::clamp(-30, position, 30);
|
||||
|
||||
if (apply) {
|
||||
/* TOOD: CGraphics related funcs */
|
||||
}
|
||||
}
|
||||
|
||||
void CGameOptions::SetScreenPositionY(s32 pos, bool apply) {
|
||||
x50_screenYOffset = zeus::clamp(-30, pos, 30);
|
||||
void CGameOptions::SetScreenPositionY(s32 position, bool apply) {
|
||||
x50_screenYOffset = zeus::clamp(-30, position, 30);
|
||||
|
||||
if (apply) {
|
||||
/* TOOD: CGraphics related funcs */
|
||||
}
|
||||
}
|
||||
|
||||
void CGameOptions::SetScreenStretch(s32 st, bool apply) {
|
||||
x54_screenStretch = zeus::clamp(-10, st, 10);
|
||||
void CGameOptions::SetScreenStretch(s32 stretch, bool apply) {
|
||||
x54_screenStretch = zeus::clamp(-10, stretch, 10);
|
||||
|
||||
if (apply) {
|
||||
/* TOOD: CGraphics related funcs */
|
||||
}
|
||||
}
|
||||
|
||||
void CGameOptions::SetSfxVolume(s32 vol, bool apply) {
|
||||
x58_sfxVol = zeus::clamp(0, vol, 0x7f);
|
||||
void CGameOptions::SetSfxVolume(s32 volume, bool apply) {
|
||||
x58_sfxVol = zeus::clamp(0, volume, 0x7f);
|
||||
|
||||
if (apply) {
|
||||
CAudioSys::SysSetSfxVolume(x58_sfxVol, 1, true, true);
|
||||
CStreamAudioManager::SetSfxVolume(x58_sfxVol);
|
||||
CMoviePlayer::SetSfxVolume(x58_sfxVol);
|
||||
if (!apply) {
|
||||
return;
|
||||
}
|
||||
|
||||
CAudioSys::SysSetSfxVolume(x58_sfxVol, 1, true, true);
|
||||
CStreamAudioManager::SetSfxVolume(x58_sfxVol);
|
||||
CMoviePlayer::SetSfxVolume(x58_sfxVol);
|
||||
}
|
||||
|
||||
void CGameOptions::SetMusicVolume(s32 vol, bool apply) {
|
||||
x5c_musicVol = zeus::clamp(0, vol, 0x7f);
|
||||
if (apply)
|
||||
CStreamAudioManager::SetMusicVolume(x5c_musicVol);
|
||||
void CGameOptions::SetMusicVolume(s32 volume, bool apply) {
|
||||
x5c_musicVol = zeus::clamp(0, volume, 0x7f);
|
||||
|
||||
if (!apply) {
|
||||
return;
|
||||
}
|
||||
|
||||
CStreamAudioManager::SetMusicVolume(x5c_musicVol);
|
||||
}
|
||||
|
||||
void CGameOptions::SetHUDAlpha(u32 alpha) { x60_hudAlpha = alpha; }
|
||||
|
|
|
@ -77,21 +77,21 @@ public:
|
|||
bool GetCinematicState(CAssetId mlvlId, TEditorId cineId) const;
|
||||
void SetCinematicState(CAssetId mlvlId, TEditorId cineId, bool state);
|
||||
u32 GetAutoMapperKeyState() const { return xbc_autoMapperKeyState; }
|
||||
void SetAutoMapperKeyState(u32 s) { xbc_autoMapperKeyState = s; }
|
||||
void SetAutoMapperKeyState(u32 state) { xbc_autoMapperKeyState = state; }
|
||||
bool GetPlayerLinkedFusion() const { return xd0_24_fusionLinked; }
|
||||
void SetPlayerLinkedFusion(bool v) { xd0_24_fusionLinked = v; }
|
||||
void SetPlayerLinkedFusion(bool fusionLinked) { xd0_24_fusionLinked = fusionLinked; }
|
||||
bool GetPlayerBeatNormalMode() const { return xd0_25_normalModeBeat; }
|
||||
void SetPlayerBeatNormalMode(bool v) { xd0_25_normalModeBeat = v; }
|
||||
void SetPlayerBeatNormalMode(bool normalModeBeat) { xd0_25_normalModeBeat = normalModeBeat; }
|
||||
bool GetPlayerBeatHardMode() const { return xd0_26_hardModeBeat; }
|
||||
void SetPlayerBeatHardMode(bool v) { xd0_26_hardModeBeat = v; }
|
||||
void SetPlayerBeatHardMode(bool hardModeBeat) { xd0_26_hardModeBeat = hardModeBeat; }
|
||||
bool GetPlayerBeatFusion() const { return xd0_27_fusionBeat; }
|
||||
void SetPlayerBeatFusion(bool v) { xd0_27_fusionBeat = v; }
|
||||
void SetPlayerBeatFusion(bool fusionBeat) { xd0_27_fusionBeat = fusionBeat; }
|
||||
bool GetPlayerFusionSuitActive() const { return xd0_28_fusionSuitActive; }
|
||||
void SetPlayerFusionSuitActive(bool v) { xd0_28_fusionSuitActive = v; }
|
||||
void SetPlayerFusionSuitActive(bool fusionSuitActive) { xd0_28_fusionSuitActive = fusionSuitActive; }
|
||||
bool GetAllItemsCollected() const { return xd0_29_allItemsCollected; }
|
||||
void SetAllItemsCollected(bool v) { xd0_29_allItemsCollected = v; }
|
||||
void SetAllItemsCollected(bool allItemsCollected) { xd0_29_allItemsCollected = allItemsCollected; }
|
||||
u32 GetLogScanPercent() const { return xcc_logScanPercent; }
|
||||
void SetLogScanPercent(u32 v) { xcc_logScanPercent = v; }
|
||||
void SetLogScanPercent(u32 percent) { xcc_logScanPercent = percent; }
|
||||
void IncrementFrozenFpsCount() { xc0_frozenFpsCount = std::min(int(xc0_frozenFpsCount + 1), 3); }
|
||||
bool GetShowFrozenFpsMessage() const { return xc0_frozenFpsCount != 3; }
|
||||
void IncrementFrozenBallCount() { xc4_frozenBallCount = std::min(int(xc4_frozenBallCount + 1), 3); }
|
||||
|
@ -134,37 +134,37 @@ public:
|
|||
void EnsureSettings();
|
||||
void PutTo(CBitStreamWriter& writer) const;
|
||||
|
||||
float TuneScreenBrightness();
|
||||
void SetScreenBrightness(s32, bool);
|
||||
float TuneScreenBrightness() const;
|
||||
void SetScreenBrightness(s32 value, bool apply);
|
||||
s32 GetScreenBrightness() const { return x48_screenBrightness; }
|
||||
void ApplyGamma();
|
||||
void SetGamma(s32, bool);
|
||||
void SetGamma(s32 value, bool apply);
|
||||
s32 GetGamma() const { return m_gamma; }
|
||||
void SetScreenPositionX(s32, bool);
|
||||
void SetScreenPositionX(s32 position, bool apply);
|
||||
s32 GetScreenPositionX() const { return x4c_screenXOffset; }
|
||||
void SetScreenPositionY(s32, bool);
|
||||
void SetScreenPositionY(s32 position, bool apply);
|
||||
s32 GetScreenPositionY() const { return x50_screenYOffset; }
|
||||
void SetScreenStretch(s32, bool);
|
||||
void SetScreenStretch(s32 stretch, bool apply);
|
||||
s32 GetScreenStretch() const { return x54_screenStretch; }
|
||||
void SetSfxVolume(s32, bool);
|
||||
void SetSfxVolume(s32 volume, bool apply);
|
||||
s32 GetSfxVolume() const { return x58_sfxVol; }
|
||||
void SetMusicVolume(s32, bool);
|
||||
void SetMusicVolume(s32 volume, bool apply);
|
||||
s32 GetMusicVolume() const { return x5c_musicVol; }
|
||||
void SetHUDAlpha(u32);
|
||||
void SetHUDAlpha(u32 alpha);
|
||||
u32 GetHUDAlpha() const { return x60_hudAlpha; }
|
||||
void SetHelmetAlpha(u32);
|
||||
void SetHelmetAlpha(u32 alpha);
|
||||
u32 GetHelmetAlpha() const { return x64_helmetAlpha; }
|
||||
void SetHUDLag(bool);
|
||||
void SetHUDLag(bool lag);
|
||||
bool GetHUDLag() const { return x68_24_hudLag; }
|
||||
void SetSurroundMode(int mode, bool apply);
|
||||
CAudioSys::ESurroundModes GetSurroundMode() const;
|
||||
void SetInvertYAxis(bool);
|
||||
void SetInvertYAxis(bool invert);
|
||||
bool GetInvertYAxis() const { return x68_25_invertY; }
|
||||
void SetIsRumbleEnabled(bool);
|
||||
void SetIsRumbleEnabled(bool rumble);
|
||||
bool GetIsRumbleEnabled() const { return x68_26_rumble; }
|
||||
void SetSwapBeamControls(bool);
|
||||
void SetSwapBeamControls(bool swap);
|
||||
bool GetSwapBeamControls() const { return x68_27_swapBeamsControls; }
|
||||
void SetIsHintSystemEnabled(bool);
|
||||
void SetIsHintSystemEnabled(bool hints);
|
||||
bool GetIsHintSystemEnabled() const { return x68_28_hintSystem; }
|
||||
void SetControls(int controls);
|
||||
void ResetControllerAssets(int controls);
|
||||
|
|
|
@ -24,15 +24,16 @@ union BitsToDouble {
|
|||
};
|
||||
|
||||
CWorldLayerState::CWorldLayerState(CBitStreamReader& reader, const CSaveWorld& saveWorld) {
|
||||
u32 bitCount = reader.ReadEncoded(10);
|
||||
const u32 bitCount = reader.ReadEncoded(10);
|
||||
x10_saveLayers.reserve(bitCount);
|
||||
|
||||
for (u32 i = 0; i < bitCount; ++i) {
|
||||
bool bit = reader.ReadEncoded(1);
|
||||
if (bit)
|
||||
const bool bit = reader.ReadEncoded(1) != 0;
|
||||
if (bit) {
|
||||
x10_saveLayers.setBit(i);
|
||||
else
|
||||
} else {
|
||||
x10_saveLayers.unsetBit(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,11 +54,14 @@ void CWorldLayerState::PutTo(CBitStreamWriter& writer) const {
|
|||
}
|
||||
|
||||
void CWorldLayerState::InitializeWorldLayers(const std::vector<CWorldLayers::Area>& layers) {
|
||||
if (x0_areaLayers.size())
|
||||
if (!x0_areaLayers.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
x0_areaLayers = layers;
|
||||
if (x10_saveLayers.getBitCount() == 0)
|
||||
if (x10_saveLayers.getBitCount() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
u32 a = 0;
|
||||
u32 b = 0;
|
||||
|
@ -102,9 +106,9 @@ CGameState::GameFileStateInfo CGameState::LoadGameFileState(const u8* data) {
|
|||
}
|
||||
ret.x14_timestamp = stream.ReadEncoded(32);
|
||||
|
||||
ret.x20_hardMode = stream.ReadEncoded(1);
|
||||
ret.x20_hardMode = stream.ReadEncoded(1) != 0;
|
||||
stream.ReadEncoded(1);
|
||||
CAssetId origMLVL = u32(stream.ReadEncoded(32));
|
||||
const CAssetId origMLVL = u32(stream.ReadEncoded(32));
|
||||
ret.x8_mlvlId = origMLVL;
|
||||
|
||||
BitsToDouble conv;
|
||||
|
@ -139,8 +143,10 @@ CGameState::CGameState() {
|
|||
x9c_transManager = std::make_shared<CWorldTransManager>();
|
||||
x228_24_hardMode = false;
|
||||
x228_25_initPowerupsAtFirstSpawn = true;
|
||||
if (g_MemoryCardSys)
|
||||
|
||||
if (g_MemoryCardSys != nullptr) {
|
||||
InitializeMemoryStates();
|
||||
}
|
||||
}
|
||||
|
||||
CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx(saveIdx) {
|
||||
|
@ -153,8 +159,8 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx
|
|||
}
|
||||
stream.ReadEncoded(32);
|
||||
|
||||
x228_24_hardMode = stream.ReadEncoded(1);
|
||||
x228_25_initPowerupsAtFirstSpawn = stream.ReadEncoded(1);
|
||||
x228_24_hardMode = stream.ReadEncoded(1) != 0;
|
||||
x228_25_initPowerupsAtFirstSpawn = stream.ReadEncoded(1) != 0;
|
||||
x84_mlvlId = u32(stream.ReadEncoded(32));
|
||||
MP1::CMain::EnsureWorldPakReady(x84_mlvlId);
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class CGameState {
|
|||
friend class CStateManager;
|
||||
|
||||
std::array<bool, 128> x0_{};
|
||||
u32 x80_;
|
||||
u32 x80_ = 0;
|
||||
CAssetId x84_mlvlId;
|
||||
std::vector<CWorldState> x88_worldStates;
|
||||
std::shared_ptr<CPlayerState> x98_playerState;
|
||||
|
|
Loading…
Reference in New Issue