GUI: Added possibility to specify scale mode for AlphaBitmaps

This commit is contained in:
Eugene Sandulenko 2014-05-09 19:00:49 +03:00 committed by Alexander Tkachev
parent 38114eb760
commit 75f9b099dc
8 changed files with 45 additions and 37 deletions

View file

@ -887,12 +887,12 @@ blitKeyBitmap(const Graphics::Surface *source, const Common::Rect &r) {
template<typename PixelType>
void VectorRendererSpec<PixelType>::
blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, Graphics::DrawStep::AutoScaleMode autoscale) {
if (autoscale == Graphics::DrawStep::kAutoScaleStretch) {
blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, GUI::ThemeEngine::AutoScaleMode autoscale) {
if (autoscale == GUI::ThemeEngine::kAutoScaleStretch) {
source->blit(*_activeSurface, r.left, r.top, Graphics::FLIP_NONE,
nullptr, TS_ARGB(255, 255, 255, 255),
r.width(), r.height());
} else if (autoscale == Graphics::DrawStep::kAutoScaleFit) {
r.width(), r.height());
} else if (autoscale == GUI::ThemeEngine::kAutoScaleFit) {
double ratio = (double)r.width() / source->w;
double ratio2 = (double)r.height() / source->h;
@ -903,7 +903,7 @@ blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, Gra
nullptr, TS_ARGB(255, 255, 255, 255),
(int)(source->w * ratio), (int)(source->h * ratio));
} else if (autoscale == Graphics::DrawStep::kAutoScaleNinePatch) {
} else if (autoscale == GUI::ThemeEngine::kAutoScaleNinePatch) {
Graphics::NinePatchBitmap nine(source, false);
nine.blit(*_activeSurface, r.left, r.top, r.width(), r.height());
} else {