Ticket #4103: gui_bitmap_v1.patch
File gui_bitmap_v1.patch, 1.5 KB (added by , 15 years ago) |
---|
-
ThemeEngine.cpp
397 397 } 398 398 } 399 399 400 _bitmapFormat = _system->getOverlayFormat(); 400 401 // Load the theme 401 402 // We pass the theme file here by default, so the user will 402 403 // have a descriptive error message. The only exception will … … 414 415 } 415 416 416 417 void ThemeEngine::refresh() { 418 Graphics::PixelFormat fmt = _system->getOverlayFormat(); 419 if (fmt != _bitmapFormat) { 420 for (ImagesMap::iterator i = _bitmaps.begin(); i != _bitmaps.end(); ++i) { 421 if (!i->_value) 422 continue; 423 424 i->_value->free(); 425 delete i->_value; 426 Graphics::Surface *surf = Graphics::ImageDecoder::loadFile(i->_key); 427 if (!surf && _themeArchive) { 428 Common::SeekableReadStream *stream = _themeArchive->openFile(i->_key); 429 if (stream) { 430 surf = Graphics::ImageDecoder::loadFile(*stream); 431 delete stream; 432 } 433 } 434 435 i->_value = surf; 436 } 437 438 _bitmapFormat = fmt; 439 } 440 417 441 init(); 442 418 443 if (_enabled) { 419 444 _system->showOverlay(); 420 445 -
ThemeEngine.h
583 583 /** Array of all the text fonts that can be drawn. */ 584 584 TextDrawData *_texts[kTextDataMAX]; 585 585 586 Graphics::PixelFormat _bitmapFormat; 586 587 ImagesMap _bitmaps; 587 588 588 589 /** List of all the dirty screens that must be blitted to the overlay. */