aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMarisa-Chan2013-11-07 16:43:45 +0700
committerMarisa-Chan2013-11-07 16:43:45 +0700
commit5da10e99b25bfd866b1ef73cadee71bf9b825c52 (patch)
tree558e6333e48fe3b812205a827aab70d776ab56d8 /engines
parent6a135c677920184db0d055230c596fc4bd0a5960 (diff)
downloadscummvm-rg350-5da10e99b25bfd866b1ef73cadee71bf9b825c52.tar.gz
scummvm-rg350-5da10e99b25bfd866b1ef73cadee71bf9b825c52.tar.bz2
scummvm-rg350-5da10e99b25bfd866b1ef73cadee71bf9b825c52.zip
ZVISION: Make source surface const type for read-only access.
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/render_manager.cpp22
-rw-r--r--engines/zvision/render_manager.h12
2 files changed, 17 insertions, 17 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index a240e766df..58df5a8d11 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -159,7 +159,7 @@ void RenderManager::clearWorkingWindowTo555Color(uint16 color) {
}
}
-void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &_srcRect, const Common::Rect &_dstRect) {
+void RenderManager::copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &_srcRect, const Common::Rect &_dstRect) {
if (src.format != dst.format)
return;
@@ -183,7 +183,7 @@ void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface
return;
// Copy rendRect from src surface to dst surface
- byte *src_buf = (byte *)src.getBasePtr(rendRect.left, rendRect.top);
+ const byte *src_buf = (const byte *)src.getBasePtr(rendRect.left, rendRect.top);
byte *dst_buf = (byte *)dst.getBasePtr(dstRect.left, dstRect.top);
int32 w = rendRect.width();
@@ -196,7 +196,7 @@ void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface
}
}
-void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &_srcRect, const Common::Rect &_dstRect, uint32 keycolor) {
+void RenderManager::copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &_srcRect, const Common::Rect &_dstRect, uint32 keycolor) {
if (src.format != dst.format)
return;
@@ -222,7 +222,7 @@ void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface
uint32 _keycolor = keycolor & ((1 << (src.format.bytesPerPixel << 3)) - 1);
// Copy rendRect from src surface to dst surface
- byte *src_buf = (byte *)src.getBasePtr(rendRect.left, rendRect.top);
+ const byte *src_buf = (const byte *)src.getBasePtr(rendRect.left, rendRect.top);
byte *dst_buf = (byte *)dst.getBasePtr(dstRect.left, dstRect.top);
int32 w = rendRect.width();
@@ -231,7 +231,7 @@ void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface
for (int32 y = 0; y < h; y++) {
switch (src.format.bytesPerPixel) {
case 1: {
- uint *src_tmp = (uint *)src_buf;
+ const uint *src_tmp = (const uint *)src_buf;
uint *dst_tmp = (uint *)dst_buf;
for (int32 x = 0; x < w; x++) {
if (*src_tmp != _keycolor)
@@ -243,7 +243,7 @@ void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface
break;
case 2: {
- uint16 *src_tmp = (uint16 *)src_buf;
+ const uint16 *src_tmp = (const uint16 *)src_buf;
uint16 *dst_tmp = (uint16 *)dst_buf;
for (int32 x = 0; x < w; x++) {
if (*src_tmp != _keycolor)
@@ -255,7 +255,7 @@ void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface
break;
case 4: {
- uint32 *src_tmp = (uint32 *)src_buf;
+ const uint32 *src_tmp = (const uint32 *)src_buf;
uint32 *dst_tmp = (uint32 *)dst_buf;
for (int32 x = 0; x < w; x++) {
if (*src_tmp != _keycolor)
@@ -274,14 +274,14 @@ void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface
}
}
-void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt) {
+void RenderManager::copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt) {
if (!Common::Rect(dst.w, dst.h).contains(dstPt))
return;
Common::Rect dstRect(dstPt.x, dstPt.y, dst.w, dst.h);
copyRectToSurface(src, dst, srcRect, dstRect);
}
-void RenderManager::copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt, uint32 keycolor) {
+void RenderManager::copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt, uint32 keycolor) {
if (!Common::Rect(dst.w, dst.h).contains(dstPt))
return;
Common::Rect dstRect(dstPt.x, dstPt.y, dst.w, dst.h);
@@ -299,7 +299,7 @@ void RenderManager::renderImageToBackground(const Common::String &fileName, int1
moveBackground(0);
}
-void RenderManager::renderImageToBackground(Graphics::Surface &surface, int16 destX, int16 destY) {
+void RenderManager::renderImageToBackground(const Graphics::Surface &surface, int16 destX, int16 destY) {
Common::Rect srcRect(surface.w, surface.h);
Common::Point dstPt(destX, destY);
@@ -318,7 +318,7 @@ void RenderManager::renderImageToBackground(const Common::String &fileName, int1
moveBackground(0);
}
-void RenderManager::renderImageToBackground(Graphics::Surface &surface, int16 destX, int16 destY, uint32 keycolor) {
+void RenderManager::renderImageToBackground(const Graphics::Surface &surface, int16 destX, int16 destY, uint32 keycolor) {
Common::Rect srcRect(surface.w, surface.h);
Common::Point dstPt(destX, destY);
diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h
index 37bfcfa20d..c302844117 100644
--- a/engines/zvision/render_manager.h
+++ b/engines/zvision/render_manager.h
@@ -225,7 +225,7 @@ public:
* @param srcRect Rect of source surface
* @param dstRect Rect for destenation surface
*/
- void copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Rect &dstRect);
+ void copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Rect &dstRect);
/**
* Copies a rectangla of source surface and copy to destination rect.
@@ -236,7 +236,7 @@ public:
* @param dstRect Rect for destenation surface
* @param colorkey Transparent color
*/
- void copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Rect &dstRect, uint32 colorkey);
+ void copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Rect &dstRect, uint32 colorkey);
/**
* Copies a rectangla of source surface and copy to destination rect.
@@ -246,7 +246,7 @@ public:
* @param srcRect Rect of source surface
* @param dstPt Point for destenation surface
*/
- void copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt);
+ void copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt);
/**
* Copies a rectangla of source surface and copy to destination rect.
@@ -257,7 +257,7 @@ public:
* @param dstPt Point for destenation surface
* @param colorkey Transparent color
*/
- void copyRectToSurface(Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt, uint32 colorkey);
+ void copyRectToSurface(const Graphics::Surface &src, Graphics::Surface &dst, const Common::Rect &srcRect, const Common::Point &dstPt, uint32 colorkey);
/**
* Blits the image or a portion of the image to the background.
@@ -275,7 +275,7 @@ public:
* @param destinationX X position where the image should be put. Coords are in working window space, not screen space!
* @param destinationY Y position where the image should be put. Coords are in working window space, not screen space!
*/
- void renderImageToBackground(Graphics::Surface &surface, int16 destinationX, int16 destinationY);
+ void renderImageToBackground(const Graphics::Surface &surface, int16 destinationX, int16 destinationY);
/**
* Blits the image or a portion of the image to the background.
@@ -295,7 +295,7 @@ public:
* @param destinationY Y position where the image should be put. Coords are in working window space, not screen space!
* @param colorkey Transparent color
*/
- void renderImageToBackground(Graphics::Surface &surface, int16 destX, int16 destY, uint32 colorkey);
+ void renderImageToBackground(const Graphics::Surface &surface, int16 destX, int16 destY, uint32 colorkey);
/**
* Sets the current background image to be used by the RenderManager and immediately