[Scummvm-cvs-logs] scummvm master -> 14ba851d32bae17d1cdc7ef9dd05c645611c005d

dreammaster dreammaster at scummvm.org
Sun Mar 20 21:37:21 CET 2016


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:
14ba851d32 GRAPHICS: Fix MangaedSurface pixel casting errors


Commit: 14ba851d32bae17d1cdc7ef9dd05c645611c005d
    https://github.com/scummvm/scummvm/commit/14ba851d32bae17d1cdc7ef9dd05c645611c005d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-20T16:37:19-04:00

Commit Message:
GRAPHICS: Fix MangaedSurface pixel casting errors

Changed paths:
    graphics/managed_surface.cpp
    graphics/managed_surface.h



diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index e493ab9..9dcea12 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 bd0632a..8cbd463 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






More information about the Scummvm-git-logs mailing list