Switch fixes (rest of cherry pick) (#4504)

* InputManager: support split joycons, fix mappings

* CFileSystem: getAbsoluteFilename() - replace double slashes

* CFileSystem: typo in macro

* debug: use touch handler for debug (strange behaviour on switch SDL)

* InputManager: don't need SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS

* CFileSystem: getAbsoluteFilename() - replace double slashes

* MaterialManager: hack to make material properties apply properly
This commit is contained in:
Mary 2021-03-09 20:59:48 -05:00 committed by GitHub
parent cc125c5f68
commit 8daf149895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 14 deletions

View File

@ -543,7 +543,18 @@ const io::path& CFileSystem::getWorkingDirectory()
} }
if (tmpPath) if (tmpPath)
{ {
#ifdef __SWITCH__
io::path full = tmpPath;
auto sdmc = "sdmc:";
auto romfs = "romfs:";
if (full.find(sdmc, 0) == 0)
full = full.subString(5, full.size() - 5);
else if (full.find(romfs, 0) == 0)
full = full.subString(6, full.size() - 6);
WorkingDirectory[FILESYSTEM_NATIVE] = full.c_str();
#else
WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath; WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;
#endif
delete [] tmpPath; delete [] tmpPath;
} }
#endif #endif

View File

@ -125,19 +125,6 @@ void CMountPointReader::buildDirectory()
for (u32 i=0; i < size; ++i) for (u32 i=0; i < size; ++i)
{ {
io::path full = list->getFullFileName(i); io::path full = list->getFullFileName(i);
#ifdef __SWITCH__
// Real hardware gets sdmc: into the path somehow
auto sdmc = "sdmc:";
auto romfs = "romfs:";
if (full.find(sdmc, 0) == 0)
{
full = full.subString(5, full.size() - 5);
}
else if (full.find(romfs, 0) == 0)
{
full = full.subString(6, full.size() - 6);
}
#endif
full = full.subString(Path.size(), full.size() - Path.size()); full = full.subString(Path.size(), full.size() - Path.size());
if (full == "") if (full == "")

View File

@ -167,6 +167,9 @@ IrrDriver::IrrDriver()
p.DriverType = video::EDT_OPENGL; p.DriverType = video::EDT_OPENGL;
p.Bits = 24U; p.Bits = 24U;
p.WindowSize = core::dimension2d<u32>(1280,720); p.WindowSize = core::dimension2d<u32>(1280,720);
#ifdef FORCE_LEGACY
p.ForceLegacyDevice = true;
#endif
#else #else
p.DriverType = video::EDT_NULL; p.DriverType = video::EDT_NULL;
p.Bits = 16U; p.Bits = 16U;
@ -588,7 +591,8 @@ void IrrDriver::initDevice()
} }
#endif #endif
#ifndef SERVER_ONLY // Don't recreate on switch!
#if !defined(SERVER_ONLY) && !defined(__SWITCH__)
if (!GUIEngine::isNoGraphics() && recreate_device) if (!GUIEngine::isNoGraphics() && recreate_device)
{ {
m_device->closeDevice(); m_device->closeDevice();

View File

@ -142,6 +142,7 @@ Material* MaterialManager::getMaterialSPM(std::string lay_one_tex_lc,
} }
} // for i } // for i
} }
Log::debug("MaterialManager", "Couldn't find cached SP material! Opening default %s!", original_layer_one.c_str());
return getDefaultSPMaterial(def_shader_name, return getDefaultSPMaterial(def_shader_name,
is_full_path ? is_full_path ?
original_layer_one : StringUtils::getBasename(original_layer_one), original_layer_one : StringUtils::getBasename(original_layer_one),