aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorEugene Sandulenko2014-05-09 19:00:49 +0300
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit75f9b099dc3e198c7a1750a6e26ac4945719492f (patch)
treea5d3f2f00771456d6bd5402175918debc20a0dc8 /graphics
parent38114eb760f842eb3145c9d1af62366cf2fab8ca (diff)
downloadscummvm-rg350-75f9b099dc3e198c7a1750a6e26ac4945719492f.tar.gz
scummvm-rg350-75f9b099dc3e198c7a1750a6e26ac4945719492f.tar.bz2
scummvm-rg350-75f9b099dc3e198c7a1750a6e26ac4945719492f.zip
GUI: Added possibility to specify scale mode for AlphaBitmaps
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.h11
-rw-r--r--graphics/VectorRendererSpec.cpp10
-rw-r--r--graphics/VectorRendererSpec.h2
3 files changed, 8 insertions, 15 deletions
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 0a83dc5d49..b79172931d 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -68,13 +68,6 @@ struct DrawStep {
kVectorAlignCenter
};
- enum AutoScaleMode {
- kAutoScaleNone = 0,
- kAutoScaleStretch = 1,
- kAutoScaleFit = 2,
- kAutoScaleNinePatch = 3
- };
-
VectorAlignment xAlign;
VectorAlignment yAlign;
@@ -87,7 +80,7 @@ struct DrawStep {
uint32 scale; /**< scale of all the coordinates in FIXED POINT with 16 bits mantissa */
- Graphics::DrawStep::AutoScaleMode autoscale; /**< scale alphaimage if present */
+ GUI::ThemeEngine::AutoScaleMode autoscale; /**< scale alphaimage if present */
DrawingFunctionCallback drawingCall; /**< Pointer to drawing function */
Graphics::Surface *blitSrc;
@@ -502,7 +495,7 @@ public:
virtual void blitKeyBitmap(const Graphics::Surface *source, const Common::Rect &r) = 0;
virtual void blitKeyBitmapClip(const Graphics::Surface *source, const Common::Rect &r, const Common::Rect &clipping) = 0;
- virtual void blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, Graphics::DrawStep::AutoScaleMode autoscale = Graphics::DrawStep::kAutoScaleNone) = 0;
+ virtual void blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, GUI::ThemeEngine::AutoScaleMode autoscale = GUI::ThemeEngine::kAutoScaleNone) = 0;
/**
* Draws a string into the screen. Wrapper for the Graphics::Font string drawing
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index f3e496af70..0b947e4a0f 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -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 {
diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h
index 50ee268d4d..f8c1e73c6c 100644
--- a/graphics/VectorRendererSpec.h
+++ b/graphics/VectorRendererSpec.h
@@ -95,7 +95,7 @@ public:
void blitSubSurfaceClip(const Graphics::Surface *source, const Common::Rect &r, const Common::Rect &clipping);
void blitKeyBitmap(const Graphics::Surface *source, const Common::Rect &r);
void blitKeyBitmapClip(const Graphics::Surface *source, const Common::Rect &r, const Common::Rect &clipping);
- void blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, Graphics::DrawStep::AutoScaleMode autoscale = Graphics::DrawStep::kAutoScaleNone);
+ void blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, GUI::ThemeEngine::AutoScaleMode autoscale = GUI::ThemeEngine::kAutoScaleNone);
void applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle);