Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmupen64plus/mupen64plus-video-glide64/src/Config.cpp
2 views
1
/*
2
* Glide64 - Glide video plugin for Nintendo 64 emulators.
3
* Copyright (c) 2010 Jon Ring
4
* Copyright (c) 2002 Dave2001
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
* 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
17
* Licence along with this program; if not, write to the Free
18
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02110-1301, USA
20
*/
21
#include "Config.h"
22
#include "m64p.h"
23
24
static m64p_handle video_general_section;
25
static m64p_handle video_glide64_section;
26
27
28
BOOL Config_Open()
29
{
30
if (ConfigOpenSection("Video-General", &video_general_section) != M64ERR_SUCCESS ||
31
ConfigOpenSection("Video-Glide64", &video_glide64_section) != M64ERR_SUCCESS)
32
{
33
WriteLog(M64MSG_ERROR, "Could not open configuration");
34
return FALSE;
35
}
36
ConfigSetDefaultBool(video_general_section, "Fullscreen", false, "Use fullscreen mode if True, or windowed mode if False");
37
ConfigSetDefaultInt(video_general_section, "ScreenWidth", 640, "Width of output window or fullscreen width");
38
ConfigSetDefaultInt(video_general_section, "ScreenHeight", 480, "Height of output window or fullscreen height");
39
40
return TRUE;
41
}
42
43
PackedScreenResolution Config_ReadScreenSettings()
44
{
45
PackedScreenResolution packedResolution;
46
47
packedResolution.width = ConfigGetParamInt(video_general_section, "ScreenWidth");
48
packedResolution.height = ConfigGetParamInt(video_general_section, "ScreenHeight");
49
packedResolution.fullscreen = ConfigGetParamBool(video_general_section, "Fullscreen");
50
51
return packedResolution;
52
}
53
54
int Config_ReadInt(const char *itemname, const char *desc, int def_value, BOOL create, BOOL isBoolean)
55
{
56
WriteLog(M64MSG_VERBOSE, "Getting value %s", itemname);
57
if (isBoolean)
58
{
59
ConfigSetDefaultBool(video_glide64_section, itemname, def_value, desc);
60
return ConfigGetParamBool(video_glide64_section, itemname);
61
}
62
else
63
{
64
ConfigSetDefaultInt(video_glide64_section, itemname, def_value, desc);
65
return ConfigGetParamInt(video_glide64_section, itemname);
66
}
67
68
}
69
70