mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
WINTERMUTE: WME3D: Added game option to allow force 2d renderer for 2d games
This commit is contained in:
parent
79118af9a9
commit
6688e22195
@ -417,6 +417,14 @@ bool BaseGame::initConfManSettings() {
|
||||
_smartCache = true;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WME3D
|
||||
if (ConfMan.hasKey("force_2d_renderer")) {
|
||||
_force2dRenderer = ConfMan.getBool("force_2d_renderer");
|
||||
} else {
|
||||
_force2dRenderer = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!_smartCache) {
|
||||
LOG(0, "Smart cache is DISABLED");
|
||||
}
|
||||
@ -540,19 +548,20 @@ bool BaseGame::initialize2() { // we know whether we are going to be accelerated
|
||||
|
||||
Graphics::RendererType matchingRendererType = Graphics::Renderer::getBestMatchingType(desiredRendererType, availableRendererTypes);
|
||||
|
||||
bool force2dRenderer = _force2dRenderer && !_playing3DGame;
|
||||
#if defined(USE_OPENGL_SHADERS)
|
||||
if (matchingRendererType == Graphics::kRendererTypeOpenGLShaders) {
|
||||
if (!force2dRenderer && matchingRendererType == Graphics::kRendererTypeOpenGLShaders) {
|
||||
initGraphics3d(_settings->getResWidth(), _settings->getResHeight());
|
||||
_renderer3D = makeOpenGL3DShaderRenderer(this);
|
||||
}
|
||||
#endif // defined(USE_OPENGL_SHADERS)
|
||||
#if defined(USE_OPENGL_GAME)
|
||||
if (matchingRendererType == Graphics::kRendererTypeOpenGL) {
|
||||
if (!force2dRenderer && matchingRendererType == Graphics::kRendererTypeOpenGL) {
|
||||
initGraphics3d(_settings->getResWidth(), _settings->getResHeight());
|
||||
_renderer3D = makeOpenGL3DRenderer(this);
|
||||
}
|
||||
#endif // defined(USE_OPENGL)
|
||||
if (matchingRendererType == Graphics::kRendererTypeTinyGL) {
|
||||
if (!force2dRenderer && matchingRendererType == Graphics::kRendererTypeTinyGL) {
|
||||
if (_playing3DGame) {
|
||||
_renderer3D = nullptr;// TODO: makeTinyGL3DRenderer(this);
|
||||
warning("3D software renderer is not supported yet");
|
||||
|
@ -315,6 +315,9 @@ protected:
|
||||
private:
|
||||
bool _debugShowFPS;
|
||||
bool _bilinearFiltering;
|
||||
#ifdef ENABLE_WME3D
|
||||
bool _force2dRenderer;
|
||||
#endif
|
||||
void *_debugLogFile;
|
||||
void DEBUG_DebugDisable();
|
||||
void DEBUG_DebugEnable(const char *filename = nullptr);
|
||||
|
@ -70,6 +70,20 @@ static const ADExtraGuiOptionsMap gameGuiOptions[] = {
|
||||
}
|
||||
},
|
||||
|
||||
#ifdef ENABLE_WME3D
|
||||
{
|
||||
GAMEOPTION_FORCE_2D_RENDERER,
|
||||
{
|
||||
_s("Force to use 2D renderer (2D games only)"),
|
||||
_s("This setting forces ScummVM to use 2D renderer while running 2D games"),
|
||||
"force_2d_renderer",
|
||||
false,
|
||||
0,
|
||||
0
|
||||
}
|
||||
},
|
||||
#endif
|
||||
|
||||
AD_EXTRA_GUI_OPTIONS_TERMINATOR
|
||||
};
|
||||
|
||||
@ -86,7 +100,11 @@ public:
|
||||
// Use kADFlagUseExtraAsHint to distinguish between SD and HD versions
|
||||
// of J.U.L.I.A. when their datafiles sit in the same directory (e.g. in Steam distribution).
|
||||
_flags = kADFlagUseExtraAsHint;
|
||||
#ifdef ENABLE_WME3D
|
||||
_guiOptions = GUIO4(GUIO_NOMIDI, GAMEOPTION_SHOW_FPS, GAMEOPTION_BILINEAR, GAMEOPTION_FORCE_2D_RENDERER);
|
||||
#else
|
||||
_guiOptions = GUIO3(GUIO_NOMIDI, GAMEOPTION_SHOW_FPS, GAMEOPTION_BILINEAR);
|
||||
#endif
|
||||
_maxScanDepth = 2;
|
||||
_directoryGlobs = directoryGlobs;
|
||||
}
|
||||
|
@ -21,8 +21,11 @@
|
||||
|
||||
namespace Wintermute {
|
||||
|
||||
#define GAMEOPTION_SHOW_FPS GUIO_GAMEOPTIONS1
|
||||
#define GAMEOPTION_BILINEAR GUIO_GAMEOPTIONS2
|
||||
#define GAMEOPTION_SHOW_FPS GUIO_GAMEOPTIONS1
|
||||
#define GAMEOPTION_BILINEAR GUIO_GAMEOPTIONS2
|
||||
#ifdef ENABLE_WME3D
|
||||
#define GAMEOPTION_FORCE_2D_RENDERER GUIO_GAMEOPTIONS3
|
||||
#endif
|
||||
|
||||
static const PlainGameDescriptor wintermuteGames[] = {
|
||||
{"5ld", "Five Lethal Demons"},
|
||||
|
@ -61,7 +61,7 @@ WintermuteEngine::WintermuteEngine(OSystem *syst, const WMEGameDescription *desc
|
||||
// Put your engine in a sane state, but do nothing big yet;
|
||||
// in particular, do not load data from files; rather, if you
|
||||
// need to do such things, do them from init().
|
||||
ConfMan.registerDefault("show_fps","false");
|
||||
ConfMan.registerDefault("show_fps", "false");
|
||||
|
||||
// Do not initialize graphics here
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user