GUI: Implemented alphabitmap autoscale
This commit is contained in:
parent
f0c52096f3
commit
4474ccf814
6 changed files with 23 additions and 10 deletions
|
@ -80,6 +80,8 @@ struct DrawStep {
|
|||
|
||||
uint32 scale; /**< scale of all the coordinates in FIXED POINT with 16 bits mantissa */
|
||||
|
||||
bool autoscale; /**< scale alphaimage if present */
|
||||
|
||||
DrawingFunctionCallback drawingCall; /**< Pointer to drawing function */
|
||||
Graphics::Surface *blitSrc;
|
||||
Graphics::TransparentSurface *blitAlphaSrc;
|
||||
|
@ -428,7 +430,7 @@ public:
|
|||
void drawCallback_ALPHABITMAP(const Common::Rect &area, const DrawStep &step, const Common::Rect &clip) {
|
||||
uint16 x, y, w, h;
|
||||
stepGetPositions(step, area, x, y, w, h);
|
||||
blitAlphaBitmap(step.blitAlphaSrc, Common::Rect(x, y, x + w, y + h)); //TODO
|
||||
blitAlphaBitmap(step.blitAlphaSrc, Common::Rect(x, y, x + w, y + h), step.autoscale); //TODO
|
||||
}
|
||||
|
||||
void drawCallback_CROSS(const Common::Rect &area, const DrawStep &step, const Common::Rect &clip) {
|
||||
|
@ -493,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) = 0;
|
||||
virtual void blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, bool autoscale) = 0;
|
||||
|
||||
/**
|
||||
* Draws a string into the screen. Wrapper for the Graphics::Font string drawing
|
||||
|
|
|
@ -884,6 +884,17 @@ blitKeyBitmap(const Graphics::Surface *source, const Common::Rect &r) {
|
|||
}
|
||||
}
|
||||
|
||||
template<typename PixelType>
|
||||
void VectorRendererSpec<PixelType>::
|
||||
blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, bool autoscale) {
|
||||
if (autoscale)
|
||||
source->blit(*_activeSurface, r.left, r.top, Graphics::FLIP_NONE,
|
||||
nullptr, TS_ARGB(255, 255, 255, 255),
|
||||
r.width(), r.height());
|
||||
else
|
||||
source->blit(*_activeSurface, r.left, r.top);
|
||||
}
|
||||
|
||||
template<typename PixelType>
|
||||
void VectorRendererSpec<PixelType>::
|
||||
blitKeyBitmapClip(const Graphics::Surface *source, const Common::Rect &r, const Common::Rect &clipping) {
|
||||
|
@ -943,12 +954,6 @@ blitKeyBitmapClip(const Graphics::Surface *source, const Common::Rect &r, const
|
|||
}
|
||||
}
|
||||
|
||||
template<typename PixelType>
|
||||
void VectorRendererSpec<PixelType>::
|
||||
blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r) {
|
||||
source->blit(*_activeSurface, r.left, r.top);
|
||||
}
|
||||
|
||||
template<typename PixelType>
|
||||
void VectorRendererSpec<PixelType>::
|
||||
applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle) {
|
||||
|
|
|
@ -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);
|
||||
void blitAlphaBitmap(Graphics::TransparentSurface *source, const Common::Rect &r, bool autoscale);
|
||||
|
||||
void applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue