mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-05 17:20:30 +00:00
AGS: Refactor ScummVM GfxFilter from being static global
This commit is contained in:
parent
62840d8cc2
commit
4d15fc94c8
@ -740,14 +740,14 @@ size_t ScummVMRendererGraphicsFactory::GetFilterCount() const {
|
||||
const GfxFilterInfo *ScummVMRendererGraphicsFactory::GetFilterInfo(size_t index) const {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return &ScummVMRendererGfxFilter::FilterInfo;
|
||||
return _G(scummvmGfxFilter);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
String ScummVMRendererGraphicsFactory::GetDefaultFilterID() const {
|
||||
return ScummVMRendererGfxFilter::FilterInfo.Id;
|
||||
return _GP(scummvmGfxFilter).Id;
|
||||
}
|
||||
|
||||
/* static */ ScummVMRendererGraphicsFactory *ScummVMRendererGraphicsFactory::GetFactory() {
|
||||
@ -763,7 +763,7 @@ ScummVMRendererGraphicsDriver *ScummVMRendererGraphicsFactory::EnsureDriverCreat
|
||||
}
|
||||
|
||||
ScummVMRendererGfxFilter *ScummVMRendererGraphicsFactory::CreateFilter(const String &id) {
|
||||
if (ScummVMRendererGfxFilter::FilterInfo.Id.CompareNoCase(id) == 0)
|
||||
if (_GP(scummvmGfxFilter).Id.CompareNoCase(id) == 0)
|
||||
return new ScummVMRendererGfxFilter();
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -20,16 +20,15 @@
|
||||
*/
|
||||
|
||||
#include "ags/engine/gfx/gfxfilter_scummvm_renderer.h"
|
||||
#include "ags/globals.h"
|
||||
|
||||
namespace AGS3 {
|
||||
namespace AGS {
|
||||
namespace Engine {
|
||||
namespace ALSW {
|
||||
|
||||
const GfxFilterInfo ScummVMRendererGfxFilter::FilterInfo = GfxFilterInfo("StdScale", "Nearest-neighbour");
|
||||
|
||||
const GfxFilterInfo &ScummVMRendererGfxFilter::GetInfo() const {
|
||||
return FilterInfo;
|
||||
return _GP(scummvmGfxFilter);
|
||||
}
|
||||
|
||||
} // namespace ALSW
|
||||
|
@ -41,8 +41,6 @@ public:
|
||||
virtual ~ScummVMRendererGfxFilter() {}
|
||||
|
||||
virtual const GfxFilterInfo &GetInfo() const;
|
||||
|
||||
static const GfxFilterInfo FilterInfo;
|
||||
};
|
||||
|
||||
} // namespace ALSW
|
||||
|
@ -253,6 +253,8 @@ Globals::Globals() {
|
||||
_StaticInventoryArray = new StaticArray();
|
||||
_StaticDialogArray = new StaticArray();
|
||||
|
||||
_scummvmGfxFilter = new AGS::Engine::GfxFilterInfo("StdScale", "Nearest-neighbour");
|
||||
|
||||
// gfxfilter_aad3d.cpp globals
|
||||
_aad3dFilterInfo = new AGS::Engine::GfxFilterInfo("Linear", "Linear interpolation");
|
||||
|
||||
@ -511,6 +513,7 @@ Globals::~Globals() {
|
||||
delete _StaticRegionArray;
|
||||
delete _StaticInventoryArray;
|
||||
delete _StaticDialogArray;
|
||||
delete _scummvmGfxFilter;
|
||||
|
||||
// gfxfilter_aad3d.cpp globals
|
||||
delete _aad3dFilterInfo;
|
||||
|
@ -859,6 +859,7 @@ public:
|
||||
*/
|
||||
|
||||
const AGS::Engine::GfxFilterInfo *_allegroFilterInfo;
|
||||
AGS::Engine::GfxFilterInfo *_scummvmGfxFilter;
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user