From a496467fbe0687edc8f72bfb439fe046d44e4391 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Tue, 29 Mar 2016 11:08:59 +0200 Subject: WINTERMUTE: Add "Sprite bilinear filtering" menu option --- engines/wintermute/detection.cpp | 13 ++++++++++++- engines/wintermute/detection_tables.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/wintermute/detection.cpp b/engines/wintermute/detection.cpp index 4e8eab505f..9ccb75d62f 100644 --- a/engines/wintermute/detection.cpp +++ b/engines/wintermute/detection.cpp @@ -59,8 +59,19 @@ static const ADExtraGuiOptionsMap gameGuiOptions[] = { _s("Show the current number of frames per second in the upper left corner"), "show_fps", false + }, + }, + + { + GAMEOPTION_BILINEAR, + { + _s("Sprite bilinear filtering (SLOW)"), + _s("Apply bilinear filtering to individual sprites"), + "bilinear_filtering", + false } }, + AD_EXTRA_GUI_OPTIONS_TERMINATOR }; @@ -76,7 +87,7 @@ class WintermuteMetaEngine : public AdvancedMetaEngine { public: WintermuteMetaEngine() : AdvancedMetaEngine(Wintermute::gameDescriptions, sizeof(WMEGameDescription), Wintermute::wintermuteGames, gameGuiOptions) { _singleId = "wintermute"; - _guiOptions = GUIO2(GUIO_NOMIDI, GAMEOPTION_SHOW_FPS); + _guiOptions = GUIO3(GUIO_NOMIDI, GAMEOPTION_SHOW_FPS, GAMEOPTION_BILINEAR); _maxScanDepth = 2; _directoryGlobs = directoryGlobs; } diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h index 68985d8d0c..681d4dec42 100644 --- a/engines/wintermute/detection_tables.h +++ b/engines/wintermute/detection_tables.h @@ -23,6 +23,7 @@ namespace Wintermute { #define GAMEOPTION_SHOW_FPS GUIO_GAMEOPTIONS1 +#define GAMEOPTION_BILINEAR GUIO_GAMEOPTIONS2 static const PlainGameDescriptor wintermuteGames[] = { {"5ld", "Five Lethal Demons"}, -- cgit v1.2.3 From 42531fb71a3710e190f933c347110e7a468c28e6 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Tue, 29 Mar 2016 11:09:54 +0200 Subject: WINTERMUTE: Add _bilinearFiltering attribute to BaseGame --- engines/wintermute/base/base_game.cpp | 6 ++++++ engines/wintermute/base/base_game.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index ef3cc2d84f..24779b9793 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -361,6 +361,12 @@ bool BaseGame::initConfManSettings() { _debugShowFPS = false; } + if (ConfMan.hasKey("bilinear_filtering")) { + _bilinearFiltering = ConfMan.getBool("bilinear_filtering"); + } else { + _bilinearFiltering = false; + } + if (ConfMan.hasKey("disable_smartcache")) { _smartCache = ConfMan.getBool("disable_smartcache"); } else { diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h index 6aacc1feab..46484cc5ca 100644 --- a/engines/wintermute/base/base_game.h +++ b/engines/wintermute/base/base_game.h @@ -101,7 +101,7 @@ public: virtual bool displayDebugInfo(); void setShowFPS(bool enabled) { _debugShowFPS = enabled; } - + bool getBilinearFiltering() { return _bilinearFiltering; } bool getSuspendedRendering() const { return _suspendedRendering; } TTextEncoding _textEncoding; @@ -279,6 +279,7 @@ protected: VideoTheoraPlayer *_theoraPlayer; private: bool _debugShowFPS; + bool _bilinearFiltering; void *_debugLogFile; void DEBUG_DebugDisable(); void DEBUG_DebugEnable(const char *filename = nullptr); -- cgit v1.2.3 From b7bd1991933526a6637e4ea0fd3f1305d0f6627a Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Thu, 31 Mar 2016 11:17:16 +0200 Subject: WINTERMUTE: Call BILINEAR/NEAREST rotoscale and scale according to game option --- engines/wintermute/base/gfx/osystem/render_ticket.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/wintermute/base/gfx/osystem/render_ticket.cpp b/engines/wintermute/base/gfx/osystem/render_ticket.cpp index afe884300a..78d445ac8c 100644 --- a/engines/wintermute/base/gfx/osystem/render_ticket.cpp +++ b/engines/wintermute/base/gfx/osystem/render_ticket.cpp @@ -27,6 +27,7 @@ */ +#include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/gfx/osystem/render_ticket.h" #include "engines/wintermute/base/gfx/osystem/base_surface_osystem.h" #include "graphics/transform_tools.h" @@ -59,7 +60,12 @@ RenderTicket::RenderTicket(BaseSurfaceOSystem *owner, const Graphics::Surface *s // TransformTools.) if (_transform._angle != Graphics::kDefaultAngle) { Graphics::TransparentSurface src(*_surface, false); - Graphics::Surface *temp = src.rotoscale(transform); + Graphics::Surface *temp; + if (owner->_gameRef->getBilinearFiltering()) { + temp = src.rotoscale(transform); + } else { + temp = src.rotoscale(transform); + } _surface->free(); delete _surface; _surface = temp; @@ -67,7 +73,12 @@ RenderTicket::RenderTicket(BaseSurfaceOSystem *owner, const Graphics::Surface *s dstRect->height() != srcRect->height()) && _transform._numTimesX * _transform._numTimesY == 1) { Graphics::TransparentSurface src(*_surface, false); - Graphics::Surface *temp = src.scale(dstRect->width(), dstRect->height()); + Graphics::Surface *temp; + if (owner->_gameRef->getBilinearFiltering()) { + temp = src.scale(dstRect->width(), dstRect->height()); + } else { + temp = src.scale(dstRect->width(), dstRect->height()); + } _surface->free(); delete _surface; _surface = temp; -- cgit v1.2.3