Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmupen64plus/mupen64plus-video-z64/src/rgl_settings.cpp
2 views
1
/*
2
* z64
3
*
4
* Copyright (C) 2007 ziggy
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
*
20
**/
21
22
#include "rdp.h"
23
#include "rgl.h"
24
25
extern ptr_ConfigOpenSection ConfigOpenSection;
26
extern ptr_ConfigSetParameter ConfigSetParameter;
27
extern ptr_ConfigGetParameter ConfigGetParameter;
28
extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp;
29
extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt;
30
extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat;
31
extern ptr_ConfigSetDefaultBool ConfigSetDefaultBool;
32
extern ptr_ConfigSetDefaultString ConfigSetDefaultString;
33
extern ptr_ConfigGetParamInt ConfigGetParamInt;
34
extern ptr_ConfigGetParamFloat ConfigGetParamFloat;
35
extern ptr_ConfigGetParamBool ConfigGetParamBool;
36
extern ptr_ConfigGetParamString ConfigGetParamString;
37
38
char rgl_cwd[512];
39
40
int rglReadSettings()
41
{
42
43
m64p_handle videoGeneralSection;
44
m64p_handle videoZ64Section;
45
if (ConfigOpenSection("Video-General", &videoGeneralSection) != M64ERR_SUCCESS ||
46
ConfigOpenSection("Video-Z64", &videoZ64Section) != M64ERR_SUCCESS)
47
{
48
rdp_log(M64MSG_ERROR, "Could not open configuration");
49
return false;
50
}
51
52
ConfigSetDefaultBool(videoGeneralSection, "Fullscreen", false, "Use fullscreen mode if True, or windowed mode if False");
53
ConfigSetDefaultBool(videoZ64Section, "HiResFB", true, "High resolution framebuffer");
54
ConfigSetDefaultBool(videoZ64Section, "FBInfo", true, "Use framebuffer info");
55
ConfigSetDefaultBool(videoZ64Section, "Threaded", false, "Run RDP on thread");
56
ConfigSetDefaultBool(videoZ64Section, "Async", false, "Run RDP asynchronously");
57
ConfigSetDefaultBool(videoZ64Section, "NoNpotFbos", false, "Don't use NPOT FBOs (may be needed for older graphics cards)");
58
59
rglSettings.resX = ConfigGetParamInt(videoGeneralSection, "ScreenWidth");
60
rglSettings.resY = ConfigGetParamInt(videoGeneralSection, "ScreenHeight");
61
rglSettings.fsResX = ConfigGetParamInt(videoGeneralSection, "ScreenWidth");
62
rglSettings.fsResY = ConfigGetParamInt(videoGeneralSection, "ScreenHeight");
63
rglSettings.fullscreen = ConfigGetParamBool(videoGeneralSection, "Fullscreen");
64
rglSettings.hiresFb = ConfigGetParamBool(videoZ64Section, "HiResFB");
65
rglSettings.fbInfo = ConfigGetParamBool(videoZ64Section, "FBInfo");
66
rglSettings.threaded = ConfigGetParamBool(videoZ64Section, "Threaded");
67
rglSettings.async = ConfigGetParamBool(videoZ64Section, "Async");
68
rglSettings.noNpotFbos = ConfigGetParamBool(videoZ64Section, "NoNpotFbos");
69
70
return true;
71
}
72
73