From 8eec984eb7aecf0afeff116e82acaefcdd377d3b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 26 May 2003 13:14:57 +0000 Subject: more const qualifiers svn-id: r8002 --- scumm/gfx.cpp | 56 +++++++++++++++++++++++++++--------------------------- scumm/gfx.h | 40 +++++++++++++++++++------------------- scumm/resource.cpp | 2 +- scumm/scumm.h | 18 +++++++++--------- scumm/scummvm.cpp | 2 +- scumm/string.cpp | 2 +- 6 files changed, 60 insertions(+), 60 deletions(-) diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 3be2a74c8a..9131d50cf3 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -510,7 +510,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) { } } -void Scumm::blit(byte *dst, byte *src, int w, int h) { +void Scumm::blit(byte *dst, const byte *src, int w, int h) { assert(h > 0); assert(src != NULL); assert(dst != NULL); @@ -1276,7 +1276,7 @@ next_iter: } } -void Gdi::decodeStripEGA(byte *dst, byte *src, int height) { +void Gdi::decodeStripEGA(byte *dst, const byte *src, int height) { byte color = 0; int run = 0, x = 0, y = 0, z; @@ -1438,7 +1438,7 @@ bool Gdi::decompressBitmap(byte *bgbak_ptr, byte *smap_ptr, int numLinesToProces return useOrDecompress; } -void Gdi::draw8ColWithMasking(byte *dst, byte *src, int height, byte *mask) { +void Gdi::draw8ColWithMasking(byte *dst, const byte *src, int height, byte *mask) { byte maskbits; do { @@ -1464,8 +1464,8 @@ void Gdi::draw8ColWithMasking(byte *dst, byte *src, int height, byte *mask) { #if defined(SCUMM_NEED_ALIGNMENT) memcpy(dst, src, 8); #else - ((uint32 *)dst)[0] = ((uint32 *)src)[0]; - ((uint32 *)dst)[1] = ((uint32 *)src)[1]; + ((uint32 *)dst)[0] = ((const uint32 *)src)[0]; + ((uint32 *)dst)[1] = ((const uint32 *)src)[1]; #endif } src += _vm->_screenWidth; @@ -1509,13 +1509,13 @@ void Gdi::clear8ColWithMasking(byte *dst, int height, byte *mask) { } while (--height); } -void Gdi::draw8Col(byte *dst, byte *src, int height) { +void Gdi::draw8Col(byte *dst, const byte *src, int height) { do { #if defined(SCUMM_NEED_ALIGNMENT) memcpy(dst, src, 8); #else - ((uint32 *)dst)[0] = ((uint32 *)src)[0]; - ((uint32 *)dst)[1] = ((uint32 *)src)[1]; + ((uint32 *)dst)[0] = ((const uint32 *)src)[0]; + ((uint32 *)dst)[1] = ((const uint32 *)src)[1]; #endif dst += _vm->_screenWidth; src += _vm->_screenWidth; @@ -1534,7 +1534,7 @@ void Gdi::clear8Col(byte *dst, int height) } while (--height); } -void Gdi::decompressMaskImg(byte *dst, byte *src, int height) { +void Gdi::decompressMaskImg(byte *dst, const byte *src, int height) { byte b, c; while (height) { @@ -1559,7 +1559,7 @@ void Gdi::decompressMaskImg(byte *dst, byte *src, int height) { } } -void Gdi::decompressMaskImgOr(byte *dst, byte *src, int height) { +void Gdi::decompressMaskImgOr(byte *dst, const byte *src, int height) { byte b, c; while (height) { @@ -1592,7 +1592,7 @@ void Gdi::decompressMaskImgOr(byte *dst, byte *src, int height) { } \ } while (0) -void Gdi::unkDecodeA(byte *dst, byte *src, int height) { +void Gdi::unkDecodeA(byte *dst, const byte *src, int height) { byte color = *src++; uint bits = *src++; byte cl = 8; @@ -1640,7 +1640,7 @@ void Gdi::unkDecodeA(byte *dst, byte *src, int height) { } while (--height); } -void Gdi::unkDecodeA_trans(byte *dst, byte *src, int height) { +void Gdi::unkDecodeA_trans(byte *dst, const byte *src, int height) { byte color = *src++; uint bits = *src++; byte cl = 8; @@ -1692,7 +1692,7 @@ void Gdi::unkDecodeA_trans(byte *dst, byte *src, int height) { } while (--height); } -void Gdi::unkDecodeB(byte *dst, byte *src, int height) { +void Gdi::unkDecodeB(byte *dst, const byte *src, int height) { byte color = *src++; uint bits = *src++; byte cl = 8; @@ -1722,7 +1722,7 @@ void Gdi::unkDecodeB(byte *dst, byte *src, int height) { } while (--height); } -void Gdi::unkDecodeB_trans(byte *dst, byte *src, int height) { +void Gdi::unkDecodeB_trans(byte *dst, const byte *src, int height) { byte color = *src++; uint bits = *src++; byte cl = 8; @@ -1754,7 +1754,7 @@ void Gdi::unkDecodeB_trans(byte *dst, byte *src, int height) { } while (--height); } -void Gdi::unkDecodeC(byte *dst, byte *src, int height) { +void Gdi::unkDecodeC(byte *dst, const byte *src, int height) { byte color = *src++; uint bits = *src++; byte cl = 8; @@ -1786,7 +1786,7 @@ void Gdi::unkDecodeC(byte *dst, byte *src, int height) { } while (--x); } -void Gdi::unkDecodeC_trans(byte *dst, byte *src, int height) { +void Gdi::unkDecodeC_trans(byte *dst, const byte *src, int height) { byte color = *src++; uint bits = *src++; byte cl = 8; @@ -1839,7 +1839,7 @@ void Gdi::unkDecodeC_trans(byte *dst, byte *src, int height) { h = height; \ } -void Gdi::unkDecode7(byte *dst, byte *src, int height) { +void Gdi::unkDecode7(byte *dst, const byte *src, int height) { uint h = height; if (_vm->_features & GF_OLD256) { @@ -1855,15 +1855,15 @@ void Gdi::unkDecode7(byte *dst, byte *src, int height) { #if defined(SCUMM_NEED_ALIGNMENT) memcpy(dst, src, 8); #else - ((uint32 *)dst)[0] = ((uint32 *)src)[0]; - ((uint32 *)dst)[1] = ((uint32 *)src)[1]; + ((uint32 *)dst)[0] = ((const uint32 *)src)[0]; + ((uint32 *)dst)[1] = ((const uint32 *)src)[1]; #endif dst += _vm->_screenWidth; src += 8; } while (--height); } -void Gdi::unkDecode8(byte *dst, byte *src, int height) { +void Gdi::unkDecode8(byte *dst, const byte *src, int height) { uint h = height; int x = 8; @@ -1878,7 +1878,7 @@ void Gdi::unkDecode8(byte *dst, byte *src, int height) { } } -void Gdi::unkDecode9(byte *dst, byte *src, int height) { +void Gdi::unkDecode9(byte *dst, const byte *src, int height) { unsigned char c, bits, color, run; int i, j; uint buffer = 0, mask = 128; @@ -1929,7 +1929,7 @@ void Gdi::unkDecode9(byte *dst, byte *src, int height) { } } -void Gdi::unkDecode10(byte *dst, byte *src, int height) { +void Gdi::unkDecode10(byte *dst, const byte *src, int height) { int i; unsigned char local_palette[256], numcolors = *src++; uint h = height; @@ -1956,7 +1956,7 @@ void Gdi::unkDecode10(byte *dst, byte *src, int height) { } -void Gdi::unkDecode11(byte *dst, byte *src, int height) { +void Gdi::unkDecode11(byte *dst, const byte *src, int height) { int bits, i; uint buffer = 0, mask = 128; unsigned char inc = 1, color = *src++; @@ -2733,7 +2733,7 @@ void Scumm::setupEGAPalette() { setPalColor(15, 252, 252, 252); } -void Scumm::setPaletteFromPtr(byte *ptr) { +void Scumm::setPaletteFromPtr(const byte *ptr) { int i; byte *dest, r, g, b; int numcolor; @@ -3607,7 +3607,7 @@ void Scumm::makeCursorColorTransparent(int a) { #pragma mark --- Bomp --- #pragma mark - -int32 Scumm::bompDecodeLineMode0(byte *src, byte *line_buffer, int32 size) { +int32 Scumm::bompDecodeLineMode0(const byte *src, byte *line_buffer, int32 size) { if (size <= 0) return size; @@ -3617,7 +3617,7 @@ int32 Scumm::bompDecodeLineMode0(byte *src, byte *line_buffer, int32 size) { return size; } -int32 Scumm::bompDecodeLineMode1(byte *src, byte *line_buffer, int32 size) { +int32 Scumm::bompDecodeLineMode1(const byte *src, byte *line_buffer, int32 size) { int32 t_size = READ_LE_UINT16(src) + 2; if (size <= 0) return t_size; @@ -3644,7 +3644,7 @@ int32 Scumm::bompDecodeLineMode1(byte *src, byte *line_buffer, int32 size) { return t_size; } -int32 Scumm::bompDecodeLineMode3(byte *src, byte *line_buffer, int32 size) { +int32 Scumm::bompDecodeLineMode3(const byte *src, byte *line_buffer, int32 size) { int32 t_size = READ_LE_UINT16(src) + 2; line_buffer += size; if (size <= 0) @@ -3761,7 +3761,7 @@ void Scumm::bompScaleFuncX(byte *line_buffer, byte *scalling_x_ptr, byte skip, i } } -void Scumm::decompressBomp(byte *dst, byte *src, int w, int h) { +void Scumm::decompressBomp(byte *dst, const byte *src, int w, int h) { int len, num; byte code, color; diff --git a/scumm/gfx.h b/scumm/gfx.h index 1f6e93ff16..ad0142b9a6 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -134,28 +134,28 @@ protected: /* Bitmap decompressors */ bool decompressBitmap(byte *bgbak_ptr, byte *smap_ptr, int numLinesToProcess); - void decodeStripEGA(byte *dst, byte *src, int height); - void decodeStripOldEGA(byte *dst, byte *src, int height, int stripnr); - void decompressMaskImgOld(byte *dst, byte *src, int stripnr); - void unkDecodeA(byte *dst, byte *src, int height); - void unkDecodeA_trans(byte *dst, byte *src, int height); - void unkDecodeB(byte *dst, byte *src, int height); - void unkDecodeB_trans(byte *dst, byte *src, int height); - void unkDecodeC(byte *dst, byte *src, int height); - void unkDecodeC_trans(byte *dst, byte *src, int height); - - void unkDecode7(byte *dst, byte *src, int height); - void unkDecode8(byte *dst, byte *src, int height); - void unkDecode9(byte *dst, byte *src, int height); - void unkDecode10(byte *dst, byte *src, int height); - void unkDecode11(byte *dst, byte *src, int height); - - void draw8ColWithMasking(byte *dst, byte *src, int height, byte *mask); - void draw8Col(byte *dst, byte *src, int height); + void decodeStripEGA(byte *dst, const byte *src, int height); + void decodeStripOldEGA(byte *dst, const byte *src, int height, int stripnr); + void decompressMaskImgOld(byte *dst, const byte *src, int stripnr); + void unkDecodeA(byte *dst, const byte *src, int height); + void unkDecodeA_trans(byte *dst, const byte *src, int height); + void unkDecodeB(byte *dst, const byte *src, int height); + void unkDecodeB_trans(byte *dst, const byte *src, int height); + void unkDecodeC(byte *dst, const byte *src, int height); + void unkDecodeC_trans(byte *dst, const byte *src, int height); + + void unkDecode7(byte *dst, const byte *src, int height); + void unkDecode8(byte *dst, const byte *src, int height); + void unkDecode9(byte *dst, const byte *src, int height); + void unkDecode10(byte *dst, const byte *src, int height); + void unkDecode11(byte *dst, const byte *src, int height); + + void draw8ColWithMasking(byte *dst, const byte *src, int height, byte *mask); + void draw8Col(byte *dst, const byte *src, int height); void clear8ColWithMasking(byte *dst, int height, byte *mask); void clear8Col(byte *dst, int height); - void decompressMaskImgOr(byte *dst, byte *src, int height); - void decompressMaskImg(byte *dst, byte *src, int height); + void decompressMaskImgOr(byte *dst, const byte *src, int height); + void decompressMaskImg(byte *dst, const byte *src, int height); void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b); void updateDirtyScreen(VirtScreen *vs); diff --git a/scumm/resource.cpp b/scumm/resource.cpp index 3fb09eaba7..ca0c100cfa 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -1354,7 +1354,7 @@ byte *Scumm::findResourceData(uint32 tag, byte *ptr) { return ptr + _resourceHeaderSize; } -int Scumm::getResourceDataSize(byte *ptr) { +int Scumm::getResourceDataSize(const byte *ptr) const { if (ptr == NULL) return 0; diff --git a/scumm/scumm.h b/scumm/scumm.h index ded3889288..ead2ad830f 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -621,8 +621,8 @@ protected: int _lastLoadedRoom; public: byte *findResourceData(uint32 tag, byte *ptr); - int getResourceDataSize(byte *ptr); - void dumpResource(char *tag, int index, byte *ptr, int length = -1); + int getResourceDataSize(const byte *ptr) const; + void dumpResource(const char *tag, int index, byte *ptr, int length = -1); protected: int getArrayId(); @@ -826,7 +826,7 @@ protected: byte *getPalettePtr(); void setupEGAPalette(); void setPalette(int pal); - void setPaletteFromPtr(byte *ptr); + void setPaletteFromPtr(const byte *ptr); void setPaletteFromRes(); void setPalColor(int index, int r, int g, int b); void setDirtyColors(int min, int max); @@ -885,7 +885,7 @@ protected: void dissolveEffect(int width, int height); void scrollEffect(int dir); - void blit(byte *dst, byte *src, int w, int h); + void blit(byte *dst, const byte *src, int w, int h); // bomp protected: @@ -897,12 +897,12 @@ public: void drawBomp(BompDrawData *bd, int decode_mode, int mask); protected: - void decompressBomp(byte *dst, byte *src, int w, int h); + void decompressBomp(byte *dst, const byte *src, int w, int h); int32 setupBompScale(byte *scalling, int32 size, byte scale); void bompScaleFuncX(byte *line_buffer, byte *scalling_x_ptr, byte skip, int32 size); - int32 bompDecodeLineMode0(byte *src, byte *line_buffer, int32 size); - int32 bompDecodeLineMode1(byte *src, byte *line_buffer, int32 size); - int32 bompDecodeLineMode3(byte *src, byte *line_buffer, int32 size); + int32 bompDecodeLineMode0(const byte *src, byte *line_buffer, int32 size); + int32 bompDecodeLineMode1(const byte *src, byte *line_buffer, int32 size); + int32 bompDecodeLineMode3(const byte *src, byte *line_buffer, int32 size); void bompApplyMask(byte *line_buffer, byte *mask_out, byte bits, int32 size); void bompApplyShadow0(byte *line_buffer, byte *dst, int32 size); void bompApplyShadow1(byte *line_buffer, byte *dst, int32 size); @@ -1051,7 +1051,7 @@ public: protected: void CHARSET_1(); void drawString(int a); - void drawDescString(byte *msg); + void drawDescString(const byte *msg); const byte *addMessageToStack(const byte *msg); void addIntToStack(int var); void addVerbToStack(int var); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index f85984352a..33f0624562 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -1600,7 +1600,7 @@ void Scumm::setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, i _scaleSlots[slot-1].scale1 = scale1; } -void Scumm::dumpResource(char *tag, int idx, byte *ptr, int length) { +void Scumm::dumpResource(const char *tag, int idx, byte *ptr, int length) { char buf[256]; File out; diff --git a/scumm/string.cpp b/scumm/string.cpp index 49ce1f98d6..4300d8e42f 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -334,7 +334,7 @@ void Scumm::CHARSET_1() { gdi._mask = _charset->_str; } -void Scumm::drawDescString(byte *msg) { +void Scumm::drawDescString(const byte *msg) { byte c, *buf, buffer[256]; buf = _msgPtrToAdd = buffer; -- cgit v1.2.3