aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2016-12-26 16:14:27 +0100
committerGitHub2016-12-26 16:14:27 +0100
commitbdb3808d11ed6658999e383f23007305580b814c (patch)
tree4a9771249084ff0e53da367ce70d1333d712a8d3 /engines
parentf3e0c4d093f52d1728b65c078df88c2f482ec956 (diff)
parentb7bd1991933526a6637e4ea0fd3f1305d0f6627a (diff)
downloadscummvm-rg350-bdb3808d11ed6658999e383f23007305580b814c.tar.gz
scummvm-rg350-bdb3808d11ed6658999e383f23007305580b814c.tar.bz2
scummvm-rg350-bdb3808d11ed6658999e383f23007305580b814c.zip
Merge pull request #734 from tobiatesan/enable_bilinear
WINTERMUTE: Enable bilinear filtering in Wintermute
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/base/base_game.cpp6
-rw-r--r--engines/wintermute/base/base_game.h3
-rw-r--r--engines/wintermute/base/gfx/osystem/render_ticket.cpp15
-rw-r--r--engines/wintermute/detection.cpp13
-rw-r--r--engines/wintermute/detection_tables.h1
5 files changed, 34 insertions, 4 deletions
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);
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<Graphics::FILTER_BILINEAR>(transform);
+ } else {
+ temp = src.rotoscale<Graphics::FILTER_NEAREST>(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<Graphics::FILTER_BILINEAR>(dstRect->width(), dstRect->height());
+ } else {
+ temp = src.scale<Graphics::FILTER_NEAREST>(dstRect->width(), dstRect->height());
+ }
_surface->free();
delete _surface;
_surface = temp;
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"},