GRAPHICS/BASE: add maxExtraPixels() to ScalerMan
This commit is contained in:
parent
489d361d18
commit
ca1754c047
2 changed files with 20 additions and 0 deletions
|
@ -960,3 +960,16 @@ DECLARE_SINGLETON(ScalerManager);
|
|||
const ScalerPlugin::List &ScalerManager::getPlugins() const {
|
||||
return (const ScalerPlugin::List &)PluginManager::instance().getPlugins(PLUGIN_TYPE_SCALER);
|
||||
}
|
||||
|
||||
int ScalerManager::getMaxExtraPixels() const {
|
||||
int maxPixels = 0;
|
||||
ScalerPlugin::List plugins = getPlugins();
|
||||
ScalerPlugin::List::iterator i = plugins.begin();
|
||||
for (; i != plugins.end(); ++i) {
|
||||
int n = (**i)->extraPixels();
|
||||
if (n > maxPixels) {
|
||||
maxPixels = n;
|
||||
}
|
||||
}
|
||||
return maxPixels;
|
||||
}
|
||||
|
|
|
@ -96,6 +96,13 @@ private:
|
|||
|
||||
public:
|
||||
const ScalerPlugin::List &getPlugins() const;
|
||||
|
||||
/**
|
||||
* Queries all scaler plugins for the maximum number of pixels they
|
||||
* can access out of bounds. Useful for adding extra rows and columns
|
||||
* to surfaces.
|
||||
*/
|
||||
int getMaxExtraPixels() const;
|
||||
};
|
||||
|
||||
/** Convenience shortcut for accessing singleton */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue