// Config.h -- INI file management and global configuration
#ifndef CONFIG_H
#define CONFIG_H

#include "pch.h"

// -------------------------------------------------------
// Global settings (written once at startup, read everywhere)
// -------------------------------------------------------

// General
extern int   g_logging;
extern int   g_wordwrap;
extern int   g_dof;

// Thread scheduling
extern int   g_disableIdealProcessor;
extern int   g_threadPriorityOverride;
extern int   g_parallelWorkers;
extern int   g_minParallelJobs;
extern int   g_workerIdleSleepMs;

// D3D9 optimizations
extern int   g_d3d9StateCache;
extern int   g_d3d9ShaderConstCache;

// Shadow quality
extern float g_shadowSizeMul;

// -------------------------------------------------------
// INI functions
// -------------------------------------------------------
void  EnsureIniExists(const char* exeDir, char* outPath);
float ReadIniSettings(const char* iniPath, float defaultFps,
    int* outLog, int* outDebugging, int* outLightFix,
    int* outWordwrap,
    int* outDisableIdealProcessor, int* outThreadPriorityOverride,
    int* outParallelWorkers, int* outMinParallelJobs,
    int* outWorkerIdleSleepMs,
    int* outD3D9StateCache, int* outD3D9ShaderConstCache,
    int* outDOF,
    float* outShadowSizeMul);

#endif // CONFIG_H
