mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-05-13 11:11:22 +00:00
Add CVar for mangle mipmaps
This commit is contained in:
parent
247f36102b
commit
e8518c0493
@ -33,6 +33,7 @@
|
|||||||
#include <aurora/main.h>
|
#include <aurora/main.h>
|
||||||
#include <dolphin/vi.h>
|
#include <dolphin/vi.h>
|
||||||
#include <SDL3/SDL_messagebox.h>
|
#include <SDL3/SDL_messagebox.h>
|
||||||
|
#include "Runtime/Graphics/CTexture.hpp"
|
||||||
|
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
||||||
@ -510,7 +511,6 @@ int main(int argc, char** argv) {
|
|||||||
metaforce::CVarManager cvarMgr{fileMgr};
|
metaforce::CVarManager cvarMgr{fileMgr};
|
||||||
metaforce::CVarCommons cvarCmns{cvarMgr};
|
metaforce::CVarCommons cvarCmns{cvarMgr};
|
||||||
cvarMgr.parseCommandLine(args);
|
cvarMgr.parseCommandLine(args);
|
||||||
|
|
||||||
if (!restart) {
|
if (!restart) {
|
||||||
// TODO add clear loggers func to logvisor so we can recreate loggers on restart
|
// TODO add clear loggers func to logvisor so we can recreate loggers on restart
|
||||||
bool logging = IsClientLoggingEnabled(argc, argv);
|
bool logging = IsClientLoggingEnabled(argc, argv);
|
||||||
@ -560,6 +560,7 @@ int main(int argc, char** argv) {
|
|||||||
g_app->onImGuiAddTextures();
|
g_app->onImGuiAddTextures();
|
||||||
g_app->onAppLaunched(info);
|
g_app->onAppLaunched(info);
|
||||||
g_app->onAppWindowResized(info.windowSize);
|
g_app->onAppWindowResized(info.windowSize);
|
||||||
|
metaforce::CTexture::SetMangleMips(cvarCmns.getMangleMipmaps());
|
||||||
while (!cvarMgr.restartRequired()) {
|
while (!cvarMgr.restartRequired()) {
|
||||||
const auto* event = aurora_update();
|
const auto* event = aurora_update();
|
||||||
bool exiting = false;
|
bool exiting = false;
|
||||||
|
@ -89,6 +89,9 @@ CVarCommons::CVarCommons(CVarManager& manager) : m_mgr(manager) {
|
|||||||
m_debugToolDrawPlatformCollision =
|
m_debugToolDrawPlatformCollision =
|
||||||
m_mgr.findOrMakeCVar("debugTool.drawPlatformCollision", "Draws the bounding boxes of platforms"sv, false,
|
m_mgr.findOrMakeCVar("debugTool.drawPlatformCollision", "Draws the bounding boxes of platforms"sv, false,
|
||||||
CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly);
|
CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly);
|
||||||
|
m_debugToolMangleMipmaps = m_mgr.findOrMakeCVar(
|
||||||
|
"debugTool.mangleMipmaps", "Sets each mipmap of a texture to a known color based on distance."sv, false,
|
||||||
|
CVar::EFlags::Game | CVar::EFlags::Archive | CVar::EFlags::ReadOnly | CVar::EFlags::ModifyRestart);
|
||||||
m_logFile = m_mgr.findOrMakeCVar("logFile"sv, "Any log prints will be stored to this file upon exit"sv, "app.log"sv,
|
m_logFile = m_mgr.findOrMakeCVar("logFile"sv, "Any log prints will be stored to this file upon exit"sv, "app.log"sv,
|
||||||
CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart);
|
CVar::EFlags::System | CVar::EFlags::Archive | CVar::EFlags::ModifyRestart);
|
||||||
m_lastDiscPath = m_mgr.findOrMakeCVar("lastDiscPath"sv, "Most recently loaded disc image path"sv, ""sv,
|
m_lastDiscPath = m_mgr.findOrMakeCVar("lastDiscPath"sv, "Most recently loaded disc image path"sv, ""sv,
|
||||||
|
@ -52,6 +52,7 @@ struct CVarCommons {
|
|||||||
CVar* m_debugToolDrawCollisionActors = nullptr;
|
CVar* m_debugToolDrawCollisionActors = nullptr;
|
||||||
CVar* m_debugToolDrawMazePath = nullptr;
|
CVar* m_debugToolDrawMazePath = nullptr;
|
||||||
CVar* m_debugToolDrawPlatformCollision = nullptr;
|
CVar* m_debugToolDrawPlatformCollision = nullptr;
|
||||||
|
CVar* m_debugToolMangleMipmaps = nullptr;
|
||||||
CVar* m_logFile = nullptr;
|
CVar* m_logFile = nullptr;
|
||||||
CVar* m_lastDiscPath = nullptr;
|
CVar* m_lastDiscPath = nullptr;
|
||||||
|
|
||||||
@ -88,6 +89,9 @@ struct CVarCommons {
|
|||||||
|
|
||||||
void setLogFile(std::string_view log) { m_logFile->fromLiteral(log); }
|
void setLogFile(std::string_view log) { m_logFile->fromLiteral(log); }
|
||||||
|
|
||||||
|
bool getMangleMipmaps() const { return m_debugToolMangleMipmaps->toBoolean(); }
|
||||||
|
void setMangleMipmaps(bool b) { m_debugToolMangleMipmaps->fromBoolean(b); }
|
||||||
|
|
||||||
void serialize() { m_mgr.serialize(); }
|
void serialize() { m_mgr.serialize(); }
|
||||||
|
|
||||||
static CVarCommons* instance();
|
static CVarCommons* instance();
|
||||||
|
@ -347,7 +347,7 @@ u32 CTexture::TexelFormatBitsPerPixel(ETexelFormat fmt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CTexture::sMangleMips = true;
|
bool CTexture::sMangleMips = false;
|
||||||
u32 CTexture::sCurrentFrameCount = 0;
|
u32 CTexture::sCurrentFrameCount = 0;
|
||||||
u32 CTexture::sTotalAllocatedMemory = 0;
|
u32 CTexture::sTotalAllocatedMemory = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user