Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmupen64plus/mupen64plus-video-jabo/config.cpp
2 views
1
#include "Config.h"
2
#include "m64p.h"
3
4
static m64p_handle video_general_section;
5
static m64p_handle video_jabo_section;
6
7
8
BOOL Config_Open()
9
{
10
if (ConfigOpenSection("Video-General", &video_general_section) != M64ERR_SUCCESS ||
11
ConfigOpenSection("Video-Jabo", &video_jabo_section) != M64ERR_SUCCESS)
12
{
13
//ERRLOG("Could not open configuration");
14
return FALSE;
15
}
16
ConfigSetDefaultBool(video_general_section, "Fullscreen", false, "Use fullscreen mode if True, or windowed mode if False");
17
ConfigSetDefaultInt(video_general_section, "ScreenWidth", 640, "Width of output window or fullscreen width");
18
ConfigSetDefaultInt(video_general_section, "ScreenHeight", 480, "Height of output window or fullscreen height");
19
20
return TRUE;
21
}
22
23
int Config_ReadScreenInt(const char *itemname)
24
{
25
return ConfigGetParamInt(video_general_section, itemname);
26
}
27
28
void Config_ReadScreenResolution(int * width, int * height)
29
{
30
*width = ConfigGetParamInt(video_general_section, "ScreenWidth");
31
*height = ConfigGetParamInt(video_general_section, "ScreenHeight");
32
}
33
34
BOOL Config_ReadInt(const char *itemname, const char *desc, int def_value, int create, int isBoolean)
35
{
36
//VLOG("Getting value %s", itemname);
37
if (isBoolean)
38
{
39
ConfigSetDefaultBool(video_jabo_section, itemname, def_value, desc);
40
return ConfigGetParamBool(video_jabo_section, itemname);
41
}
42
else
43
{
44
ConfigSetDefaultInt(video_jabo_section, itemname, def_value, desc);
45
return ConfigGetParamInt(video_jabo_section, itemname);
46
}
47
48
}
49