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