BACKENDS: Constify PaletteManager::grabPalette implementations
This commit is contained in:
parent
f9ba31e465
commit
bda253b1ac
24 changed files with 24 additions and 24 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue