aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-20 16:37:19 -0400
committerPaul Gilbert2016-03-20 16:37:19 -0400
commit14ba851d32bae17d1cdc7ef9dd05c645611c005d (patch)
tree507e0a084b81bebfdab0ce7d4409b52f3b073830 /graphics
parent2e5ef7484899df83a403d4b4041f920d932a71c1 (diff)
downloadscummvm-rg350-14ba851d32bae17d1cdc7ef9dd05c645611c005d.tar.gz
scummvm-rg350-14ba851d32bae17d1cdc7ef9dd05c645611c005d.tar.bz2
scummvm-rg350-14ba851d32bae17d1cdc7ef9dd05c645611c005d.zip
GRAPHICS: Fix MangaedSurface pixel casting errors
Diffstat (limited to 'graphics')
-rw-r--r--graphics/managed_surface.cpp8
-rw-r--r--graphics/managed_surface.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index e493ab9f4e..9dcea12836 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -33,7 +33,7 @@ ManagedSurface::ManagedSurface() :
_disposeAfterUse(DisposeAfterUse::NO), _owner(nullptr) {
}
-ManagedSurface::ManagedSurface(const ManagedSurface &surf) :
+ManagedSurface::ManagedSurface(ManagedSurface &surf) :
w(_innerSurface.w), h(_innerSurface.h), pitch(_innerSurface.pitch), format(_innerSurface.format),
_disposeAfterUse(DisposeAfterUse::NO), _owner(nullptr) {
*this = surf;
@@ -61,7 +61,7 @@ ManagedSurface::~ManagedSurface() {
free();
}
-ManagedSurface &ManagedSurface::operator=(const ManagedSurface &surf) {
+ManagedSurface &ManagedSurface::operator=(ManagedSurface &surf) {
// Free any current surface
free();
@@ -74,7 +74,7 @@ ManagedSurface &ManagedSurface::operator=(const ManagedSurface &surf) {
// Source isn't managed, so simply copy its fields
_owner = surf._owner;
_offsetFromOwner = surf._offsetFromOwner;
- void *srcPixels = (void *)surf._innerSurface.getPixels();
+ void *srcPixels = surf._innerSurface.getPixels();
_innerSurface.setPixels(srcPixels);
_innerSurface.w = surf.w;
_innerSurface.h = surf.h;
@@ -198,7 +198,7 @@ void ManagedSurface::transBlitFrom(const Surface &src, const Common::Rect &srcRe
}
template<typename T>
-void transBlit(const Surface &src, const Common::Rect &srcRect, const Surface *dest, const Common::Rect &destRect, uint transColor, bool flipped, uint overrideColor) {
+void transBlit(const Surface &src, const Common::Rect &srcRect, Surface *dest, const Common::Rect &destRect, uint transColor, bool flipped, uint overrideColor) {
int scaleX = SCALE_THRESHOLD * srcRect.width() / destRect.width();
int scaleY = SCALE_THRESHOLD * srcRect.height() / destRect.height();
diff --git a/graphics/managed_surface.h b/graphics/managed_surface.h
index bd0632a493..8cbd463266 100644
--- a/graphics/managed_surface.h
+++ b/graphics/managed_surface.h
@@ -89,7 +89,7 @@ public:
* this surface will create it's own surface of the same size and copy
* the contents from the source surface
*/
- ManagedSurface(const ManagedSurface &surf);
+ ManagedSurface(ManagedSurface &surf);
/**
* Create the managed surface
@@ -124,7 +124,7 @@ public:
* Reassign one managed surface to another one
* Note that if the source has a managed surface, it will be duplicated
*/
- ManagedSurface &operator=(const ManagedSurface &surf);
+ ManagedSurface &operator=(ManagedSurface &surf);
/**
* Returns true if the surface has not yet been allocated