mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
Add Max LOD and Max Allowed Extras configs (#273)
* Add new config options * Fix defaults * Use global for `m_maxAllowedExtras` * Revert
This commit is contained in:
parent
e2b39f9144
commit
9ebeda5c0e
@ -126,6 +126,8 @@ IsleApp::IsleApp()
|
||||
LegoOmni::CreateInstance();
|
||||
|
||||
m_iniPath = NULL;
|
||||
m_maxLod = RealtimeView::GetUserMaxLOD();
|
||||
m_maxAllowedExtras = m_islandQuality <= 1 ? 10 : 20;
|
||||
}
|
||||
|
||||
// FUNCTION: ISLE 0x4011a0
|
||||
@ -574,7 +576,8 @@ MxResult IsleApp::SetupWindow()
|
||||
LegoWorldPresenter::configureLegoWorldPresenter(m_islandQuality);
|
||||
LegoBuildingManager::configureLegoBuildingManager(m_islandQuality);
|
||||
LegoROI::configureLegoROI(iVar10);
|
||||
LegoAnimationManager::configureLegoAnimationManager(m_islandQuality);
|
||||
LegoAnimationManager::configureLegoAnimationManager(m_maxAllowedExtras);
|
||||
RealtimeView::SetUserMaxLOD(m_maxLod);
|
||||
if (LegoOmni::GetInstance()) {
|
||||
if (LegoOmni::GetInstance()->GetInputManager()) {
|
||||
LegoOmni::GetInstance()->GetInputManager()->SetUseJoystick(m_useJoystick);
|
||||
@ -662,8 +665,12 @@ bool IsleApp::LoadConfig()
|
||||
|
||||
iniparser_set(dict, "isle:Back Buffers in Video RAM", "-1");
|
||||
|
||||
iniparser_set(dict, "isle:Island Quality", "1");
|
||||
iniparser_set(dict, "isle:Island Texture", "1");
|
||||
char buf[32];
|
||||
iniparser_set(dict, "isle:Island Quality", SDL_itoa(m_islandQuality, buf, 10));
|
||||
iniparser_set(dict, "isle:Island Texture", SDL_itoa(m_islandTexture, buf, 10));
|
||||
SDL_snprintf(buf, sizeof(buf), "%f", m_maxLod);
|
||||
iniparser_set(dict, "isle:Max LOD", buf);
|
||||
iniparser_set(dict, "isle:Max Allowed Extras", SDL_itoa(m_maxAllowedExtras, buf, 10));
|
||||
|
||||
iniparser_dump_ini(dict, iniFP);
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "New config written at '%s'", iniConfig);
|
||||
@ -708,8 +715,10 @@ bool IsleApp::LoadConfig()
|
||||
}
|
||||
}
|
||||
|
||||
m_islandQuality = iniparser_getint(dict, "isle:Island Quality", 1);
|
||||
m_islandTexture = iniparser_getint(dict, "isle:Island Texture", 1);
|
||||
m_islandQuality = iniparser_getint(dict, "isle:Island Quality", m_islandQuality);
|
||||
m_islandTexture = iniparser_getint(dict, "isle:Island Texture", m_islandTexture);
|
||||
m_maxLod = iniparser_getdouble(dict, "isle:Max LOD", m_maxLod);
|
||||
m_maxAllowedExtras = iniparser_getint(dict, "isle:Max Allowed Extras", m_maxAllowedExtras);
|
||||
|
||||
const char* deviceId = iniparser_getstring(dict, "isle:3D Device ID", NULL);
|
||||
if (deviceId != NULL) {
|
||||
|
||||
@ -85,6 +85,8 @@ class IsleApp {
|
||||
char* m_mediaPath;
|
||||
|
||||
char* m_iniPath;
|
||||
MxFloat m_maxLod;
|
||||
MxU32 m_maxAllowedExtras;
|
||||
};
|
||||
|
||||
extern IsleApp* g_isle;
|
||||
|
||||
@ -503,7 +503,7 @@ void LegoAnimationManager::Init()
|
||||
m_unk0x1a = FALSE;
|
||||
m_tranInfoList = NULL;
|
||||
m_tranInfoList2 = NULL;
|
||||
m_maxAllowedExtras = g_legoAnimationManagerConfig <= 1 ? 10 : 20;
|
||||
m_maxAllowedExtras = g_legoAnimationManagerConfig;
|
||||
|
||||
MxS32 i;
|
||||
for (i = 0; i < (MxS32) sizeOfArray(m_unk0x28); i++) {
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#ifndef REALTIMEVIEW_H
|
||||
#define REALTIMEVIEW_H
|
||||
|
||||
#include "lego1_export.h"
|
||||
|
||||
extern float g_userMaxLodPower;
|
||||
|
||||
class RealtimeView {
|
||||
@ -9,10 +11,10 @@ class RealtimeView {
|
||||
~RealtimeView();
|
||||
|
||||
static float GetPartsThreshold();
|
||||
static float GetUserMaxLOD();
|
||||
LEGO1_EXPORT static float GetUserMaxLOD();
|
||||
static void SetPartsThreshold(float);
|
||||
static void UpdateMaxLOD();
|
||||
static void SetUserMaxLOD(float);
|
||||
LEGO1_EXPORT static void SetUserMaxLOD(float);
|
||||
|
||||
static float GetUserMaxLodPower() { return g_userMaxLodPower; }
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user