Skip to content

Commit

Permalink
move RawJson to LUS (HarbourMasters#4063)
Browse files Browse the repository at this point in the history
  • Loading branch information
briaguya-ai authored Apr 22, 2024
1 parent 33aef87 commit 49f891f
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 74 deletions.
12 changes: 6 additions & 6 deletions soh/soh/Enhancements/tts/tts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <cassert>
#include <File.h>
#include <Json.h>
#include <libultraship/classes.h>
#include <nlohmann/json.hpp>
#include <spdlog/fmt/fmt.h>
Expand All @@ -12,7 +13,6 @@
#include "overlays/gamestates/ovl_file_choose/file_choose.h"
#include "soh/Enhancements/boss-rush/BossRush.h"
#include "soh/resource/type/SohResourceType.h"
#include "soh/resource/type/RawJson.h"

extern "C" {
extern MapData* gMapData;
Expand Down Expand Up @@ -1041,19 +1041,19 @@ void InitTTSBank() {

auto initData = std::make_shared<LUS::ResourceInitData>();
initData->Format = RESOURCE_FORMAT_BINARY;
initData->Type = static_cast<uint32_t>(SOH::ResourceType::SOH_RawJson);
initData->Type = static_cast<uint32_t>(LUS::ResourceType::Json);
initData->ResourceVersion = 0;

sceneMap = std::static_pointer_cast<SOH::RawJson>(
sceneMap = std::static_pointer_cast<LUS::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, true, initData))->Data;

miscMap = std::static_pointer_cast<SOH::RawJson>(
miscMap = std::static_pointer_cast<LUS::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/misc" + languageSuffix, true, initData))->Data;

kaleidoMap = std::static_pointer_cast<SOH::RawJson>(
kaleidoMap = std::static_pointer_cast<LUS::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/kaleidoscope" + languageSuffix, true, initData))->Data;

fileChooseMap = std::static_pointer_cast<SOH::RawJson>(
fileChooseMap = std::static_pointer_cast<LUS::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/filechoose" + languageSuffix, true, initData))->Data;
}

Expand Down
2 changes: 0 additions & 2 deletions soh/soh/OTRGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ GameInteractorSail* GameInteractorSail::Instance;
#include "soh/resource/importer/SkeletonLimbFactory.h"
#include "soh/resource/importer/TextFactory.h"
#include "soh/resource/importer/BackgroundFactory.h"
#include "soh/resource/importer/RawJsonFactory.h"

#include "soh/config/ConfigUpdaters.h"

Expand Down Expand Up @@ -343,7 +342,6 @@ OTRGlobals::OTRGlobals() {
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinaryAudioSoundFontV2>(), RESOURCE_FORMAT_BINARY, "AudioSoundFont", static_cast<uint32_t>(SOH::ResourceType::SOH_AudioSoundFont), 2);
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinaryAudioSequenceV2>(), RESOURCE_FORMAT_BINARY, "AudioSequence", static_cast<uint32_t>(SOH::ResourceType::SOH_AudioSequence), 2);
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinaryBackgroundV0>(), RESOURCE_FORMAT_BINARY, "Background", static_cast<uint32_t>(SOH::ResourceType::SOH_Background), 0);
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinaryRawJsonV0>(), RESOURCE_FORMAT_BINARY, "RawJson", static_cast<uint32_t>(SOH::ResourceType::SOH_RawJson), 0);

gSaveStateMgr = std::make_shared<SaveStateMgr>();
gRandomizer = std::make_shared<Randomizer>();
Expand Down
19 changes: 0 additions & 19 deletions soh/soh/resource/importer/RawJsonFactory.cpp

This file was deleted.

11 changes: 0 additions & 11 deletions soh/soh/resource/importer/RawJsonFactory.h

This file was deleted.

14 changes: 0 additions & 14 deletions soh/soh/resource/type/RawJson.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions soh/soh/resource/type/RawJson.h

This file was deleted.

1 change: 0 additions & 1 deletion soh/soh/resource/type/SohResourceType.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ enum class ResourceType {
SOH_AudioSequence = 0x4F534551, // OSEQ
SOH_Background = 0x4F424749, // OBGI
SOH_SceneCommand = 0x4F52434D, // ORCM
SOH_RawJson = 0x4A534F4E, // JSON
};
} // namespace SOH

0 comments on commit 49f891f

Please sign in to comment.