mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 01:07:22 +00:00
GRAPHICS: MACGUI: Wrap more relevant code into #ifdef USE_PNG
This commit is contained in:
parent
9d908e9a0b
commit
2df56f182d
@ -273,8 +273,10 @@ MacText::~MacText() {
|
||||
delete _cursorSurface;
|
||||
delete _cursorSurface2;
|
||||
|
||||
#ifdef USE_PNG
|
||||
for (auto &i : _imageCache)
|
||||
delete i._value;
|
||||
#endif
|
||||
|
||||
delete _imageArchive;
|
||||
}
|
||||
@ -2793,6 +2795,11 @@ void MacText::setImageArchive(Common::String fname) {
|
||||
}
|
||||
|
||||
const Surface *MacText::getImageSurface(Common::String &fname) {
|
||||
#ifndef USE_PNG
|
||||
warning("MacText::getImageSurface(): PNG support not compiled. Cannot load file %s", fname.c_str());
|
||||
|
||||
return nullptr;
|
||||
#else
|
||||
if (_imageCache.contains(fname))
|
||||
return _imageCache[fname]->getSurface();
|
||||
|
||||
@ -2808,12 +2815,6 @@ const Surface *MacText::getImageSurface(Common::String &fname) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef USE_PNG
|
||||
warning("MacText::getImageSurface(): PNG support not compiled. Cannot load file %s", fname.c_str());
|
||||
|
||||
return nullptr;
|
||||
#else
|
||||
|
||||
_imageCache[fname] = new Image::PNGDecoder();
|
||||
|
||||
if (!_imageCache[fname]->loadStream(*stream)) {
|
||||
|
@ -395,7 +395,9 @@ private:
|
||||
|
||||
MacMenu *_menu;
|
||||
|
||||
#ifdef USE_PNG
|
||||
Common::HashMap<Common::String, Image::PNGDecoder *> _imageCache;
|
||||
#endif
|
||||
Common::Archive *_imageArchive = nullptr;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user