SDL: Begin refactoring the API for selecting scalers

This commit is contained in:
Cameron Cawley 2021-01-05 22:54:53 +00:00 committed by Eugene Sandulenko
parent 626206de7f
commit 0e6b9c2bb6
9 changed files with 154 additions and 158 deletions

View file

@ -23,6 +23,7 @@
#include "backends/base-backend.h"
#include "graphics/pixelbuffer.h"
#include "graphics/scalerplugin.h"
#ifndef DISABLE_DEFAULT_EVENT_MANAGER
#include "backends/events/default/default-events.h"
@ -35,6 +36,21 @@
#include "gui/message.h"
bool BaseBackend::setScaler(const char *name, int factor) {
if (!name)
return false;
const PluginList &scalerPlugins = ScalerMan.getPlugins();
for (uint scalerIndex = 0; scalerIndex < scalerPlugins.size(); scalerIndex++) {
if (!scumm_stricmp(scalerPlugins[scalerIndex]->get<ScalerPluginObject>().getName(), name)) {
return setScaler(scalerIndex, factor);
}
}
return false;
}
void BaseBackend::displayMessageOnOSD(const Common::U32String &msg) {
// Display the message for 1.5 seconds
GUI::TimedMessageDialog dialog(msg, 1500);