[Scummvm-git-logs] scummvm master -> bda253b1acfa8e8ce76436780ba9fa86d712c7a0

csnover csnover at users.noreply.github.com
Sun Oct 15 20:47:37 CEST 2017


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:
bda253b1ac BACKENDS: Constify PaletteManager::grabPalette implementations


Commit: bda253b1acfa8e8ce76436780ba9fa86d712c7a0
    https://github.com/scummvm/scummvm/commit/bda253b1acfa8e8ce76436780ba9fa86d712c7a0
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-10-15T13:47:19-05:00

Commit Message:
BACKENDS: Constify PaletteManager::grabPalette implementations

Changed paths:
    backends/graphics/default-palette.h
    backends/graphics/graphics.h
    backends/platform/3ds/osystem-graphics.cpp
    backends/platform/3ds/osystem.h
    backends/platform/android/android.h
    backends/platform/android/gfx.cpp
    backends/platform/dc/dc.h
    backends/platform/dc/display.cpp
    backends/platform/ds/arm9/source/osystem_ds.cpp
    backends/platform/ds/arm9/source/osystem_ds.h
    backends/platform/ios7/ios7_osys_main.h
    backends/platform/ios7/ios7_osys_video.mm
    backends/platform/iphone/osys_main.h
    backends/platform/iphone/osys_video.mm
    backends/platform/n64/osys_n64.h
    backends/platform/n64/osys_n64_base.cpp
    backends/platform/ps2/Gs2dScreen.cpp
    backends/platform/ps2/Gs2dScreen.h
    backends/platform/ps2/systemps2.cpp
    backends/platform/ps2/systemps2.h
    backends/platform/psp/osys_psp.cpp
    backends/platform/psp/osys_psp.h
    backends/platform/wii/osystem.h
    backends/platform/wii/osystem_gfx.cpp


diff --git a/backends/graphics/default-palette.h b/backends/graphics/default-palette.h
index a66e186..e1b4c5c 100644
--- a/backends/graphics/default-palette.h
+++ b/backends/graphics/default-palette.h
@@ -51,7 +51,7 @@ public:
 		memcpy(_palette + 3 * start, colors, 3 * num);
 		setPaletteIntern(colors, start, num);
 	}
-	void grabPalette(byte *colors, uint start, uint num) {
+	void grabPalette(byte *colors, uint start, uint num) const {
 		assert(start + num <= 256);
 		memcpy(colors, _palette + 3 * start, 3 * num);
 	}
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index cf33803..d5c36c1 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -98,7 +98,7 @@ public:
 
 	// Graphics::PaletteManager interface
 	//virtual void setPalette(const byte *colors, uint start, uint num) = 0;
-	//virtual void grabPalette(byte *colors, uint start, uint num) = 0;
+	//virtual void grabPalette(byte *colors, uint start, uint num) const = 0;
 };
 
 #endif
diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp
index 78b7907..e791dd4 100644
--- a/backends/platform/3ds/osystem-graphics.cpp
+++ b/backends/platform/3ds/osystem-graphics.cpp
@@ -230,7 +230,7 @@ void OSystem_3DS::setPalette(const byte *colors, uint start, uint num) {
 		flushGameScreen();
 	}
 }
-void OSystem_3DS::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_3DS::grabPalette(byte *colors, uint start, uint num) const {
 	assert(start + num <= 256);
 	memcpy(colors, _palette + 3 * start, 3 * num);
 }
diff --git a/backends/platform/3ds/osystem.h b/backends/platform/3ds/osystem.h
index 5df49fe..cad46a1 100644
--- a/backends/platform/3ds/osystem.h
+++ b/backends/platform/3ds/osystem.h
@@ -105,7 +105,7 @@ public:
 	int16 getHeight(){ return _gameHeight; }
 	int16 getWidth(){ return _gameWidth; }
 	void setPalette(const byte *colors, uint start, uint num);
-	void grabPalette(byte *colors, uint start, uint num);
+	void grabPalette(byte *colors, uint start, uint num) const;
 	void copyRectToScreen(const void *buf, int pitch, int x, int y, int w,
 	                      int h);
 	Graphics::Surface *lockScreen();
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 2935d96..c261f85 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -234,7 +234,7 @@ private:
 protected:
 	// PaletteManager API
 	virtual void setPalette(const byte *colors, uint start, uint num);
-	virtual void grabPalette(byte *colors, uint start, uint num);
+	virtual void grabPalette(byte *colors, uint start, uint num) const;
 
 public:
 	virtual void copyRectToScreen(const void *buf, int pitch, int x, int y,
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index f847296..a4f1746 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -408,7 +408,7 @@ void OSystem_Android::setPalette(const byte *colors, uint start, uint num) {
 		WRITE_UINT16(p, pf.RGBToColor(colors[0], colors[1], colors[2]));
 }
 
-void OSystem_Android::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_Android::grabPalette(byte *colors, uint start, uint num) const {
 	ENTER("%p, %u, %u", colors, start, num);
 
 #ifdef USE_RGB_COLOR
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index 6cd938e..34e8014 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -106,7 +106,7 @@ class OSystem_Dreamcast : private DCHardware, public EventsBaseBackend, public P
 protected:
 	// PaletteManager API
   void setPalette(const byte *colors, uint start, uint num);
-  void grabPalette(byte *colors, uint start, uint num);
+  void grabPalette(byte *colors, uint start, uint num) const;
 
 public:
 
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index 1785c3c..2547605 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -171,7 +171,7 @@ void OSystem_Dreamcast::setCursorPalette(const byte *colors, uint start, uint nu
   _enable_cursor_palette = true;
 }
 
-void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num)
+void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num) const
 {
   const unsigned short *src = palette + start;
   if (num>0)
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index f23192c..861ee2e 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -268,7 +268,7 @@ void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) {
 	refreshCursor();
 }
 
-void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
+void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) const {
 //	consolePrintf("Grabpalette");
 
 	for (unsigned int r = start; r < start + num; r++) {
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index 9f73e12..f883bd1 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -93,7 +93,7 @@ public:
 protected:
 	// PaletteManager API
 	virtual void setPalette(const byte *colors, uint start, uint num);
-	virtual void grabPalette(byte *colors, uint start, uint num);
+	virtual void grabPalette(byte *colors, uint start, uint num) const;
 
 public:
 	void restoreHardwarePalette();
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index 0f89cf7..e0ac599 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -153,7 +153,7 @@ public:
 protected:
 	// PaletteManager API
 	virtual void setPalette(const byte *colors, uint start, uint num);
-	virtual void grabPalette(byte *colors, uint start, uint num);
+	virtual void grabPalette(byte *colors, uint start, uint num) const;
 
 public:
 	virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm
index f0af1f9..30f8950 100644
--- a/backends/platform/ios7/ios7_osys_video.mm
+++ b/backends/platform/ios7/ios7_osys_video.mm
@@ -223,7 +223,7 @@ void OSystem_iOS7::setPalette(const byte *colors, uint start, uint num) {
 		_mouseDirty = _mouseNeedTextureUpdate = true;
 }
 
-void OSystem_iOS7::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_iOS7::grabPalette(byte *colors, uint start, uint num) const {
 	//printf("grabPalette(%p, %u, %u)\n", colors, start, num);
 	assert(start + num <= 256);
 	byte *b = colors;
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 3905663..6aa77e2 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -140,7 +140,7 @@ public:
 protected:
 	// PaletteManager API
 	virtual void setPalette(const byte *colors, uint start, uint num);
-	virtual void grabPalette(byte *colors, uint start, uint num);
+	virtual void grabPalette(byte *colors, uint start, uint num) const;
 
 public:
 	virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
diff --git a/backends/platform/iphone/osys_video.mm b/backends/platform/iphone/osys_video.mm
index fa5c729..f07160d 100644
--- a/backends/platform/iphone/osys_video.mm
+++ b/backends/platform/iphone/osys_video.mm
@@ -155,7 +155,7 @@ void OSystem_IPHONE::setPalette(const byte *colors, uint start, uint num) {
 		_mouseDirty = _mouseNeedTextureUpdate = true;
 }
 
-void OSystem_IPHONE::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_IPHONE::grabPalette(byte *colors, uint start, uint num) const {
 	//printf("grabPalette(%p, %u, %u)\n", colors, start, num);
 	assert(start + num <= 256);
 	byte *b = colors;
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index ad49c29..80bedbb 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -157,7 +157,7 @@ public:
 protected:
 	// PaletteManager API
 	virtual void setPalette(const byte *colors, uint start, uint num);
-	virtual void grabPalette(byte *colors, uint start, uint num);
+	virtual void grabPalette(byte *colors, uint start, uint num) const;
 
 public:
 	virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 16eeae5..1282b16 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -408,7 +408,7 @@ void OSystem_N64::rebuildOffscreenMouseBuffer(void) {
 	}
 }
 
-void OSystem_N64::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_N64::grabPalette(byte *colors, uint start, uint num) const {
 #ifdef N64_EXTREME_MEMORY_SAVING  // This way loses precisions
 	uint32 i;
 	uint16 color;
diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp
index a4ec233..823defe 100644
--- a/backends/platform/ps2/Gs2dScreen.cpp
+++ b/backends/platform/ps2/Gs2dScreen.cpp
@@ -556,7 +556,7 @@ void Gs2dScreen::setPalette(const uint8 *pal, uint8 start, uint16 num) {
 	SignalSema(g_DmacSema);
 }
 
-void Gs2dScreen::grabPalette(uint8 *pal, uint8 start, uint16 num) {
+void Gs2dScreen::grabPalette(uint8 *pal, uint8 start, uint16 num) const {
 	assert(start + num <= 256);
 	for (uint16 cnt = 0; cnt < num; cnt++) {
 		uint16 src = start + cnt;
diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h
index ea2b1e5..9ed62da 100644
--- a/backends/platform/ps2/Gs2dScreen.h
+++ b/backends/platform/ps2/Gs2dScreen.h
@@ -61,7 +61,7 @@ public:
 	void copyScreenRect(const uint8 *buf, int pitch, int x, int y, int w, int h);
 	void setPalette(const uint8 *pal, uint8 start, uint16 num);
 	void updateScreen(void);
-	void grabPalette(uint8 *pal, uint8 start, uint16 num);
+	void grabPalette(uint8 *pal, uint8 start, uint16 num) const;
 	//- overlay routines
 	void copyOverlayRect(const byte *buf, uint16 pitch, uint16 x, uint16 y, uint16 w, uint16 h);
 	void grabOverlay(byte *buf, uint16 pitch);
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index e914cdb..f76e26a 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -678,7 +678,7 @@ void OSystem_PS2::setPalette(const byte *colors, uint start, uint num) {
 	_screen->setPalette(colors, (uint8)start, (uint16)num);
 }
 
-void OSystem_PS2::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_PS2::grabPalette(byte *colors, uint start, uint num) const {
 	_screen->grabPalette(colors, (uint8)start, (uint16)num);
 }
 
diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h
index 45b7dfa..019c363 100644
--- a/backends/platform/ps2/systemps2.h
+++ b/backends/platform/ps2/systemps2.h
@@ -61,7 +61,7 @@ public:
 protected:
 	// PaletteManager API
 	virtual void setPalette(const byte *colors, uint start, uint num);
-	virtual void grabPalette(byte *colors, uint start, uint num);
+	virtual void grabPalette(byte *colors, uint start, uint num) const;
 public:
 
 	virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 67cb72d..e31456f 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -280,7 +280,7 @@ int16 OSystem_PSP::getOverlayHeight() {
 	return (int16)_overlay.getHeight();
 }
 
-void OSystem_PSP::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_PSP::grabPalette(byte *colors, uint start, uint num) const {
 	DEBUG_ENTER_FUNC();
 	_screen.getPartialPalette(colors, start, num);
 }
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 6f9238b..304c724 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -94,7 +94,7 @@ public:
 protected:
 	// PaletteManager API
 	void setPalette(const byte *colors, uint start, uint num);
-	void grabPalette(byte *colors, uint start, uint num);
+	void grabPalette(byte *colors, uint start, uint num) const;
 public:
 	void setCursorPalette(const byte *colors, uint start, uint num);
 
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index f159161..5482eb7 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -165,7 +165,7 @@ public:
 	virtual PaletteManager *getPaletteManager() { return this; }
 protected:
 	virtual void setPalette(const byte *colors, uint start, uint num);
-	virtual void grabPalette(byte *colors, uint start, uint num);
+	virtual void grabPalette(byte *colors, uint start, uint num) const;
 public:
 	virtual void setCursorPalette(const byte *colors, uint start, uint num);
 	virtual void copyRectToScreen(const void *buf, int pitch, int x, int y,
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index c7989e9..932ca38 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -352,7 +352,7 @@ void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
 	}
 }
 
-void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) {
+void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) const {
 #ifdef USE_RGB_COLOR
 	assert(_pfGame.bytesPerPixel == 1);
 #endif





More information about the Scummvm-git-logs mailing list