From 96b198b66dc5eb43ecea3f4790ddb88d94faa05f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 2 Nov 2024 19:51:57 -0400 Subject: [PATCH] Automatically switch the renderer to Dawntrail mode if installed --- README.md | 2 +- renderer/src/gamerenderer.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e47eac..3708c61 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ There are no releases at the moment, but experimental builds are currently avail ### Supported Game Versions -This works for A Realm Reborn (2.x) thru Endwalker content (6.x) while Dawntrail (7.x) support is still WIP. If you're using something Dawntrail-related doesn't load properly, try using the `NOVUS_IS_DAWNTRAIL=1` environment variable. +This works for A Realm Reborn (2.x) thru Endwalker content (6.x) while Dawntrail (7.x) support is still WIP. ## Building diff --git a/renderer/src/gamerenderer.cpp b/renderer/src/gamerenderer.cpp index eb7411d..196e63d 100644 --- a/renderer/src/gamerenderer.cpp +++ b/renderer/src/gamerenderer.cpp @@ -56,7 +56,14 @@ GameRenderer::GameRenderer(Device &device, GameData *data) , m_data(data) , m_shaderManager(device) { - m_dawntrailMode = qgetenv("NOVUS_IS_DAWNTRAIL") == QByteArrayLiteral("1"); + auto repositories = physis_gamedata_get_repositories(data); + for (int i = 0; i < repositories.repositories_count; i++) { + if (strcmp(repositories.repositories[i].name, "ex5") == 0) { + qInfo() << "The renderer is switching to Dawntrail mode. Please file a bug if you think this was a mistake."; + m_dawntrailMode = true; + } + } + physis_gamedata_free_repositories(repositories); m_dummyTex = m_device.createDummyTexture(); m_dummyBuffer = m_device.createDummyBuffer();