mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-23 09:39:54 -04:00
Wii U: Several fixes and improvements (#1608)
* WiiU: fix more scaling issues * Wii U: batch depth reads * Wii U: remove file buffering Doesn't seem to to do much anymore * Remove "missing_gcc_functions.c" to avoid conflicts * Wii U: Fix random_device usage random_device will always be seeded with a constant seed and will return the same number sequence every time * Wii U: Improve software keyboard * Wii U: Fix console input text width
This commit is contained in:
+2
-28
@@ -196,11 +196,6 @@ void SaveManager::Init() {
|
||||
if (std::filesystem::exists(sGlobalPath)) {
|
||||
std::ifstream input(sGlobalPath);
|
||||
|
||||
#ifdef __WIIU__
|
||||
alignas(0x40) char buffer[8192];
|
||||
input.rdbuf()->pubsetbuf(buffer, sizeof(buffer));
|
||||
#endif
|
||||
|
||||
nlohmann::json globalBlock;
|
||||
input >> globalBlock;
|
||||
|
||||
@@ -522,19 +517,13 @@ void SaveManager::SaveFile(int fileNum) {
|
||||
section.second.second();
|
||||
}
|
||||
|
||||
#ifdef __SWITCH__
|
||||
#if defined(__SWITCH__) || defined(__WIIU__)
|
||||
FILE* w = fopen(GetFileName(fileNum).c_str(), "w");
|
||||
std::string json_string = baseBlock.dump(4);
|
||||
fwrite(json_string.c_str(), sizeof(char), json_string.length(), w);
|
||||
fclose(w);
|
||||
#else
|
||||
|
||||
std::ofstream output(GetFileName(fileNum));
|
||||
|
||||
#ifdef __WIIU__
|
||||
alignas(0x40) char buffer[8192];
|
||||
output.rdbuf()->pubsetbuf(buffer, sizeof(buffer));
|
||||
#endif
|
||||
output << std::setw(4) << baseBlock << std::endl;
|
||||
#endif
|
||||
|
||||
@@ -547,13 +536,8 @@ void SaveManager::SaveGlobal() {
|
||||
globalBlock["audioSetting"] = gSaveContext.audioSetting;
|
||||
globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting;
|
||||
globalBlock["language"] = gSaveContext.language;
|
||||
|
||||
std::ofstream output("Save/global.sav");
|
||||
|
||||
#ifdef __WIIU__
|
||||
alignas(0x40) char buffer[8192];
|
||||
output.rdbuf()->pubsetbuf(buffer, sizeof(buffer));
|
||||
#endif
|
||||
|
||||
output << std::setw(4) << globalBlock << std::endl;
|
||||
}
|
||||
|
||||
@@ -563,11 +547,6 @@ void SaveManager::LoadFile(int fileNum) {
|
||||
|
||||
std::ifstream input(GetFileName(fileNum));
|
||||
|
||||
#ifdef __WIIU__
|
||||
alignas(0x40) char buffer[8192];
|
||||
input.rdbuf()->pubsetbuf(buffer, sizeof(buffer));
|
||||
#endif
|
||||
|
||||
nlohmann::json saveBlock;
|
||||
input >> saveBlock;
|
||||
if (!saveBlock.contains("version")) {
|
||||
@@ -1558,11 +1537,6 @@ void SaveManager::ConvertFromUnversioned() {
|
||||
|
||||
std::ifstream input("oot_save.sav", std::ios::binary);
|
||||
|
||||
#ifdef __WIIU__
|
||||
alignas(0x40) char buffer[8192];
|
||||
input.rdbuf()->pubsetbuf(buffer, sizeof(buffer));
|
||||
#endif
|
||||
|
||||
std::vector<char> data(std::istreambuf_iterator<char>(input), {});
|
||||
input.close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user