Path: blob/master/libmupen64plus/mupen64plus-video-jabo/config.cpp
2 views
#include "Config.h"1#include "m64p.h"23static m64p_handle video_general_section;4static m64p_handle video_jabo_section;567BOOL Config_Open()8{9if (ConfigOpenSection("Video-General", &video_general_section) != M64ERR_SUCCESS ||10ConfigOpenSection("Video-Jabo", &video_jabo_section) != M64ERR_SUCCESS)11{12//ERRLOG("Could not open configuration");13return FALSE;14}15ConfigSetDefaultBool(video_general_section, "Fullscreen", false, "Use fullscreen mode if True, or windowed mode if False");16ConfigSetDefaultInt(video_general_section, "ScreenWidth", 640, "Width of output window or fullscreen width");17ConfigSetDefaultInt(video_general_section, "ScreenHeight", 480, "Height of output window or fullscreen height");1819return TRUE;20}2122int Config_ReadScreenInt(const char *itemname)23{24return ConfigGetParamInt(video_general_section, itemname);25}2627void Config_ReadScreenResolution(int * width, int * height)28{29*width = ConfigGetParamInt(video_general_section, "ScreenWidth");30*height = ConfigGetParamInt(video_general_section, "ScreenHeight");31}3233BOOL Config_ReadInt(const char *itemname, const char *desc, int def_value, int create, int isBoolean)34{35//VLOG("Getting value %s", itemname);36if (isBoolean)37{38ConfigSetDefaultBool(video_jabo_section, itemname, def_value, desc);39return ConfigGetParamBool(video_jabo_section, itemname);40}41else42{43ConfigSetDefaultInt(video_jabo_section, itemname, def_value, desc);44return ConfigGetParamInt(video_jabo_section, itemname);45}4647}4849