mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-06-08 20:30:02 -04:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 762dbe0419 | |||
| 0128377ad9 |
@@ -553,6 +553,7 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/ga
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/game_icon_night.bmp" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/game_icon_night.bmp" ARRAY_NAME "g_game_icon_night")
|
||||
|
||||
## Audio ##
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/music/installer.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/music/installer.ogg" ARRAY_NAME "g_installer_music")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_worldmap_cursor.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_worldmap_cursor.ogg" ARRAY_NAME "g_sys_worldmap_cursor")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_worldmap_finaldecide.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_worldmap_finaldecide.ogg" ARRAY_NAME "g_sys_worldmap_finaldecide")
|
||||
BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausecansel.ogg" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausecansel.ogg" ARRAY_NAME "g_sys_actstg_pausecansel")
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace Hedgehog::Mirage
|
||||
{
|
||||
class CMatrixNodeListener : public Base::CObject
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0x04);
|
||||
};
|
||||
}
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "Hedgehog/Math/Quaternion.h"
|
||||
#include "Hedgehog/Math/Vector.h"
|
||||
#include "Hedgehog/MirageCore/MatrixNode/hhMatrixNode.h"
|
||||
#include "Hedgehog/MirageCore/MatrixNode/hhMatrixNodeListener.h"
|
||||
#include "Hedgehog/MirageCore/Misc/hhTransform.h"
|
||||
#include "Hedgehog/MirageCore/Misc/hhVertexDeclarationPtr.h"
|
||||
#include "Hedgehog/MirageCore/RenderData/hhMaterialData.h"
|
||||
@@ -87,12 +86,11 @@
|
||||
#include "SWA/Inspire/InspireTextureAnimationInfo.h"
|
||||
#include "SWA/Inspire/InspireTextureOverlay.h"
|
||||
#include "SWA/Inspire/InspireTextureOverlayInfo.h"
|
||||
#include "SWA/Message/MsgRequestHelp.h"
|
||||
#include "SWA/Menu/MenuWindowBase.h"
|
||||
#include "SWA/Message/MsgRequestHelp.h"
|
||||
#include "SWA/Movie/MovieDisplayer.h"
|
||||
#include "SWA/Movie/MovieManager.h"
|
||||
#include "SWA/Object/Common/DashPanel/ObjDashPanel.h"
|
||||
#include "SWA/Object/Event/Hint/ObjHintRing.h"
|
||||
#include "SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h"
|
||||
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
||||
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <SWA.inl>
|
||||
|
||||
namespace SWA
|
||||
{
|
||||
class CObjHintRing
|
||||
{
|
||||
public:
|
||||
SWA_INSERT_PADDING(0x160);
|
||||
be<uint32_t> m_AnimationID;
|
||||
bool m_Field164;
|
||||
};
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <apu/embedded_player.h>
|
||||
#include <user/config.h>
|
||||
|
||||
#include <res/music/installer.ogg.h>
|
||||
#include <res/sounds/sys_worldmap_cursor.ogg.h>
|
||||
#include <res/sounds/sys_worldmap_finaldecide.ogg.h>
|
||||
#include <res/sounds/sys_actstg_pausecansel.ogg.h>
|
||||
@@ -87,13 +88,17 @@ static void PlayEmbeddedSound(EmbeddedSound s)
|
||||
data.chunk = Mix_LoadWAV_RW(SDL_RWFromConstMem(soundData, soundDataSize), 1);
|
||||
}
|
||||
|
||||
Mix_VolumeChunk(data.chunk, Config::MasterVolume * Config::EffectsVolume * MIX_MAX_VOLUME);
|
||||
Mix_PlayChannel(g_channelIndex % MIX_CHANNELS, data.chunk, 0);
|
||||
++g_channelIndex;
|
||||
}
|
||||
|
||||
static Mix_Music* g_installerMusic;
|
||||
|
||||
void EmbeddedPlayer::Init()
|
||||
{
|
||||
Mix_OpenAudio(XAUDIO_SAMPLES_HZ, AUDIO_F32SYS, 2, 256);
|
||||
Mix_OpenAudio(XAUDIO_SAMPLES_HZ, AUDIO_F32SYS, 2, 2048);
|
||||
g_installerMusic = Mix_LoadMUS_RW(SDL_RWFromConstMem(g_installer_music, sizeof(g_installer_music)), 1);
|
||||
|
||||
s_isActive = true;
|
||||
}
|
||||
@@ -111,6 +116,21 @@ void EmbeddedPlayer::Play(const char *name)
|
||||
PlayEmbeddedSound(it->second);
|
||||
}
|
||||
|
||||
void EmbeddedPlayer::PlayMusic()
|
||||
{
|
||||
if (!Mix_PlayingMusic())
|
||||
{
|
||||
Mix_PlayMusic(g_installerMusic, INT_MAX);
|
||||
Mix_VolumeMusic(Config::MasterVolume * Config::MusicVolume * MUSIC_VOLUME * MIX_MAX_VOLUME);
|
||||
}
|
||||
}
|
||||
|
||||
void EmbeddedPlayer::FadeOutMusic()
|
||||
{
|
||||
if (Mix_PlayingMusic())
|
||||
Mix_FadeOutMusic(1000);
|
||||
}
|
||||
|
||||
void EmbeddedPlayer::Shutdown()
|
||||
{
|
||||
for (EmbeddedSoundData &data : g_embeddedSoundData)
|
||||
@@ -119,6 +139,9 @@ void EmbeddedPlayer::Shutdown()
|
||||
Mix_FreeChunk(data.chunk);
|
||||
}
|
||||
|
||||
Mix_HaltMusic();
|
||||
Mix_FreeMusic(g_installerMusic);
|
||||
|
||||
Mix_CloseAudio();
|
||||
Mix_Quit();
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@
|
||||
|
||||
struct EmbeddedPlayer
|
||||
{
|
||||
inline static bool s_isActive = false;
|
||||
// Arbitrarily picked volume to match the mixing in the original game.
|
||||
static constexpr float MUSIC_VOLUME = 0.25f;
|
||||
|
||||
static inline bool s_isActive = false;
|
||||
|
||||
static void Init();
|
||||
static void Play(const char *name);
|
||||
static void PlayMusic();
|
||||
static void FadeOutMusic();
|
||||
static void Shutdown();
|
||||
};
|
||||
|
||||
@@ -13,38 +13,6 @@ bool DisableHintsMidAsmHook()
|
||||
return !Config::Hints;
|
||||
}
|
||||
|
||||
// Disable hint ring visuals.
|
||||
PPC_FUNC_IMPL(__imp__sub_82738088);
|
||||
PPC_FUNC(sub_82738088)
|
||||
{
|
||||
auto pObjHintRing = (SWA::CObjHintRing*)(base + ctx.r3.u32);
|
||||
auto pDeltaTime = (be<float>*)(base + ctx.r4.u32);
|
||||
|
||||
if (!Config::Hints)
|
||||
{
|
||||
auto pAnimationControl = PPC_LOAD_U32(ctx.r3.u32 + 0xF0);
|
||||
|
||||
// how does this even work
|
||||
guest_stack_var<be<float>> time = 0.0f;
|
||||
GuestToHostFunction<int>(sub_82BB4A40, pAnimationControl, time.get());
|
||||
GuestToHostFunction<int>(sub_82BBC050, pAnimationControl, *pDeltaTime);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
__imp__sub_82738088(ctx, base);
|
||||
}
|
||||
|
||||
// Disable hint ring hit event.
|
||||
PPC_FUNC_IMPL(__imp__sub_827391E0);
|
||||
PPC_FUNC(sub_827391E0)
|
||||
{
|
||||
if (!Config::Hints)
|
||||
return;
|
||||
|
||||
__imp__sub_827391E0(ctx, base);
|
||||
}
|
||||
|
||||
// Disable Perfect Dark Gaia hints.
|
||||
PPC_FUNC_IMPL(__imp__sub_82AC36E0);
|
||||
PPC_FUNC(sub_82AC36E0)
|
||||
@@ -56,14 +24,9 @@ PPC_FUNC(sub_82AC36E0)
|
||||
__imp__sub_82AC36E0(ctx, base);
|
||||
}
|
||||
|
||||
// Disable navigation volumes.
|
||||
PPC_FUNC_IMPL(__imp__sub_8273C4C8);
|
||||
PPC_FUNC(sub_8273C4C8)
|
||||
bool DisableControlTutorialMidAsmHook()
|
||||
{
|
||||
if (!Config::ControlTutorial)
|
||||
return;
|
||||
|
||||
__imp__sub_8273C4C8(ctx, base);
|
||||
return !Config::ControlTutorial;
|
||||
}
|
||||
|
||||
bool DisableEvilControlTutorialMidAsmHook(PPCRegister& r4, PPCRegister& r5)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_MILESTONE="Release Candidate 2"
|
||||
VERSION_MILESTONE="Release Candidate 3"
|
||||
VERSION_MAJOR=1
|
||||
VERSION_MINOR=0
|
||||
VERSION_REVISION=0
|
||||
|
||||
@@ -1721,6 +1721,24 @@ static void PickerCheckResults()
|
||||
g_currentPickerVisible = false;
|
||||
}
|
||||
|
||||
static bool g_fadingOutMusic;
|
||||
|
||||
static void ProcessMusic()
|
||||
{
|
||||
if (g_isDisappearing)
|
||||
{
|
||||
if (!g_fadingOutMusic)
|
||||
{
|
||||
EmbeddedPlayer::FadeOutMusic();
|
||||
g_fadingOutMusic = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EmbeddedPlayer::PlayMusic();
|
||||
}
|
||||
}
|
||||
|
||||
void InstallerWizard::Init()
|
||||
{
|
||||
auto &io = ImGui::GetIO();
|
||||
@@ -1850,6 +1868,7 @@ bool InstallerWizard::Run(std::filesystem::path installPath, bool skipGame)
|
||||
while (s_isVisible)
|
||||
{
|
||||
Video::WaitOnSwapChain();
|
||||
ProcessMusic();
|
||||
SDL_PumpEvents();
|
||||
SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||
GameWindow::Update();
|
||||
|
||||
@@ -1206,6 +1206,7 @@ static void DrawConfigOptions()
|
||||
|
||||
int32_t rowCount = 0;
|
||||
|
||||
bool isStage = OptionsMenu::s_pauseMenuType == SWA::eMenuType_Stage || OptionsMenu::s_pauseMenuType == SWA::eMenuType_Hub;
|
||||
auto cmnReason = &Localise("Options_Desc_NotAvailable");
|
||||
|
||||
// TODO: Don't use raw numbers here!
|
||||
@@ -1215,8 +1216,8 @@ static void DrawConfigOptions()
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::Language, !OptionsMenu::s_isPause, cmnReason);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::VoiceLanguage, OptionsMenu::s_pauseMenuType == SWA::eMenuType_WorldMap, cmnReason);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::Subtitles, true);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::Hints, true);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::ControlTutorial, true);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::Hints, !isStage, cmnReason);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::ControlTutorial, !isStage, cmnReason);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::AchievementNotifications, true);
|
||||
DrawConfigOption(rowCount++, yOffset, &Config::TimeOfDayTransition, !Config::UseArrowsForTimeOfDayTransition);
|
||||
break;
|
||||
|
||||
@@ -106,6 +106,12 @@ jump_address = 0x82468EE0
|
||||
name = "ResetScoreOnRestartMidAsmHook"
|
||||
address = 0x82304374
|
||||
|
||||
# Disable hint rings
|
||||
[[midasm_hook]]
|
||||
name = "DisableHintsMidAsmHook"
|
||||
address = 0x827A2E34
|
||||
jump_address_on_true = 0x827A2E4C
|
||||
|
||||
# Disable Tornado Defense hints
|
||||
[[midasm_hook]]
|
||||
name = "DisableHintsMidAsmHook"
|
||||
@@ -178,6 +184,12 @@ name = "DisableHintsMidAsmHook"
|
||||
address = 0x82691CB0
|
||||
jump_address_on_true = 0x82691E24
|
||||
|
||||
# Disable navigation volumes
|
||||
[[midasm_hook]]
|
||||
name = "DisableControlTutorialMidAsmHook"
|
||||
address = 0x827AA5EC
|
||||
jump_address_on_true = 0x827AA604
|
||||
|
||||
# Disable Werehog button prompts
|
||||
[[midasm_hook]]
|
||||
name = "DisableEvilControlTutorialMidAsmHook"
|
||||
|
||||
+1
-1
Submodule UnleashedRecompResources updated: 1375ed7184...e5a4adccb3
Reference in New Issue
Block a user