[Scummvm-git-logs] scummvm master -> 54e21678a4e4846e4c064069acbcd655ba45bf18
sev-
noreply at scummvm.org
Sat Oct 28 22:59:45 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
54e21678a4 GUI: Remove use of TransparentSurface in animation code
Commit: 54e21678a4e4846e4c064069acbcd655ba45bf18
https://github.com/scummvm/scummvm/commit/54e21678a4e4846e4c064069acbcd655ba45bf18
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-10-29T00:59:42+02:00
Commit Message:
GUI: Remove use of TransparentSurface in animation code
Changed paths:
gui/animation/Drawable.h
diff --git a/gui/animation/Drawable.h b/gui/animation/Drawable.h
index 09013f11119..2db32a7f383 100644
--- a/gui/animation/Drawable.h
+++ b/gui/animation/Drawable.h
@@ -25,7 +25,7 @@
#define GUI_ANIMATION_DRAWABLE_H
#include "common/ptr.h"
-#include "graphics/transparent_surface.h"
+#include "graphics/managed_surface.h"
#include "gui/animation/Animation.h"
@@ -64,8 +64,8 @@ public:
void setAlpha(float alpha) { _alpha = alpha; }
AnimationPtr getAnimation() const { return _animation; }
void setAnimation(AnimationPtr animation) { _animation = animation; }
- Graphics::TransparentSurface *getBitmap() const { return _bitmap; }
- void setBitmap(Graphics::TransparentSurface *bitmap) { _bitmap = bitmap; }
+ Graphics::ManagedSurface *getBitmap() const { return _bitmap; }
+ void setBitmap(Graphics::ManagedSurface *bitmap) { _bitmap = bitmap; }
float getPositionX() const { return _positionX; }
void setPositionX(float positionX) { _positionX = positionX; }
float getPositionY() const { return _positionY; }
@@ -74,8 +74,8 @@ public:
void setWidth(float width) { _width = width; }
virtual float getHeight() const {
- if (_height == 0)
- return getWidth() * _bitmap->getRatio() * _displayRatio;
+ if (_height == 0 && _bitmap && _bitmap->w && _bitmap->h)
+ return getWidth() * _displayRatio * _bitmap->h / _bitmap->w;
return _height;
}
@@ -89,7 +89,7 @@ protected:
bool _usingSnapshot;
private:
- Graphics::TransparentSurface *_bitmap;
+ Graphics::ManagedSurface *_bitmap;
float _positionX;
float _positionY;
float _width;
More information about the Scummvm-git-logs
mailing list