[Scummvm-git-logs] scummvm master -> caecdfdf9fb36897a936260b0ceb7f477ac79bb8
criezy
criezy at scummvm.org
Fri Apr 17 21:41:17 UTC 2020
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
10e934ffa7 CREDITS: fix a typo
08b4639cbb ALL: fix a bunch of const warnings
488adf7fe9 ULTIMA4: fix compilation w/o MP3 support
caecdfdf9f SCI: Remove dead data, make table static
Commit: 10e934ffa743258b255ae6b2722a3a40fb6013a5
https://github.com/scummvm/scummvm/commit/10e934ffa743258b255ae6b2722a3a40fb6013a5
Author: Max Horn (max at quendi.de)
Date: 2020-04-17T22:41:11+01:00
Commit Message:
CREDITS: fix a typo
Changed paths:
devtools/credits.pl
diff --git a/devtools/credits.pl b/devtools/credits.pl
index aa401bf811..afa264730b 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -1018,7 +1018,7 @@ begin_credits("Credits");
add_person("Paul Gilbert", "dreammaster", "");
add_person("Matthew Duggan", "stauff", "");
- add_person("Daniel c. Wü:rl", "dwuerl", "(Nuvie)");
+ add_person("Daniel c. Würl", "dwuerl", "(Nuvie)");
add_person("Eric Fry", "yuv422", "(Nuvie)");
add_person("Jeremy Newman", "laxdragon", "(Nuvie)");
add_person("Jonathan E. Wright", "nelno", "(Nuvie)");
Commit: 08b4639cbb62235e02f80267da14d56af2ab08b3
https://github.com/scummvm/scummvm/commit/08b4639cbb62235e02f80267da14d56af2ab08b3
Author: Max Horn (max at quendi.de)
Date: 2020-04-17T22:41:11+01:00
Commit Message:
ALL: fix a bunch of const warnings
Also while add it, constify some code
Changed paths:
backends/platform/sdl/macosx/macosx.cpp
engines/dragons/credits.cpp
engines/dragons/credits.h
engines/dragons/screen.cpp
engines/dragons/screen.h
engines/pink/cel_decoder.cpp
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 1545d9ab61..595d650d4f 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -147,7 +147,7 @@ bool OSystem_MacOSX::setTextInClipboard(const Common::String &text) {
}
bool OSystem_MacOSX::openUrl(const Common::String &url) {
- CFURLRef urlRef = CFURLCreateWithBytes (NULL, (UInt8*)url.c_str(), url.size(), kCFStringEncodingASCII, NULL);
+ CFURLRef urlRef = CFURLCreateWithBytes (NULL, (const UInt8*)url.c_str(), url.size(), kCFStringEncodingASCII, NULL);
OSStatus err = LSOpenCFURLRef(urlRef, NULL);
CFRelease(urlRef);
return err == noErr;
diff --git a/engines/dragons/credits.cpp b/engines/dragons/credits.cpp
index 7e8f7277f2..79048a46ce 100644
--- a/engines/dragons/credits.cpp
+++ b/engines/dragons/credits.cpp
@@ -85,7 +85,7 @@ void Credits::update() {
if (_linesRemaining) {
_linesRemaining--;
}
- convertToWideChar(line, (byte *)" ", 40);
+ convertToWideChar(line, (const byte *)" ", 40);
}
_fontManager->_fonts[0]->renderToSurface(_surface, 0, (_yOffset + 200) % 208, line, 40);
@@ -102,7 +102,7 @@ void Credits::update() {
}
-void Credits::convertToWideChar(uint16 *destBuf, byte *text, uint16 maxLength) {
+void Credits::convertToWideChar(uint16 *destBuf, const byte *text, uint16 maxLength) {
bool finished = false;
for (int i = 0; i < maxLength; i++) {
if (text[i] == 0) {
diff --git a/engines/dragons/credits.h b/engines/dragons/credits.h
index 702940276d..10e18a2735 100644
--- a/engines/dragons/credits.h
+++ b/engines/dragons/credits.h
@@ -55,7 +55,7 @@ public:
void update();
private:
void cleanup();
- void convertToWideChar(uint16 *destBuf, byte *text, uint16 maxLength);
+ void convertToWideChar(uint16 *destBuf, const byte *text, uint16 maxLength);
};
} // End of namespace Dragons
diff --git a/engines/dragons/screen.cpp b/engines/dragons/screen.cpp
index 56c8465070..ac92fad4bd 100644
--- a/engines/dragons/screen.cpp
+++ b/engines/dragons/screen.cpp
@@ -80,9 +80,9 @@ void Screen::copyRectToSurface(const Graphics::Surface &srcSurface, int destX, i
copyRectToSurface(srcSurface.getBasePtr(clipRect.left, clipRect.top), srcSurface.pitch, srcSurface.w, clipRect.left, destX, destY, clipRect.width(), clipRect.height(), flipX, alpha);
}
-void Screen::copyRectToSurface8bpp(const Graphics::Surface &srcSurface, byte *palette, int destX, int destY, const Common::Rect srcRect, bool flipX, AlphaBlendMode alpha, uint16 scale) {
+void Screen::copyRectToSurface8bpp(const Graphics::Surface &srcSurface, const byte *palette, int destX, int destY, const Common::Rect srcRect, bool flipX, AlphaBlendMode alpha, uint16 scale) {
if (scale != DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) {
- drawScaledSprite(_backSurface, (byte *)srcSurface.getBasePtr(0, 0),
+ drawScaledSprite(_backSurface, (const byte *)srcSurface.getBasePtr(0, 0),
srcRect.width(), srcRect.height(),
destX, destY,
srcRect.width() * scale / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE, srcRect.height() * scale / DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE,
@@ -171,7 +171,7 @@ void Screen::copyRectToSurface(const void *buffer, int srcPitch, int srcWidth, i
}
}
-void Screen::copyRectToSurface8bpp(const void *buffer, byte* palette, int srcPitch, int srcWidth, int srcXOffset, int destX, int destY, int width, int height, bool flipX, AlphaBlendMode alpha) {
+void Screen::copyRectToSurface8bpp(const void *buffer, const byte* palette, int srcPitch, int srcWidth, int srcXOffset, int destX, int destY, int width, int height, bool flipX, AlphaBlendMode alpha) {
assert(buffer);
assert(destX >= 0 && destX < _backSurface->w);
@@ -201,8 +201,8 @@ void Screen::copyRectToSurface8bpp(const void *buffer, byte* palette, int srcPit
}
}
-void Screen::drawScaledSprite(Graphics::Surface *destSurface, byte *source, int sourceWidth, int sourceHeight,
- int destX, int destY, int destWidth, int destHeight, byte *palette, bool flipX, uint8 alpha) {
+void Screen::drawScaledSprite(Graphics::Surface *destSurface, const byte *source, int sourceWidth, int sourceHeight,
+ int destX, int destY, int destWidth, int destHeight, const byte *palette, bool flipX, uint8 alpha) {
// Based on the GNAP engine scaling code
if (destWidth == 0 || destHeight == 0) {
return;
@@ -231,11 +231,11 @@ void Screen::drawScaledSprite(Graphics::Surface *destSurface, byte *source, int
return;
byte *dst = (byte *)destSurface->getBasePtr(destX, destY);
int yi = ys * clipY;
- byte *hsrc = source + sourceWidth * ((yi + 0x8000) >> 16);
+ const byte *hsrc = source + sourceWidth * ((yi + 0x8000) >> 16);
for (int yc = 0; yc < destHeight; ++yc) {
byte *wdst = flipX ? dst + (destWidth - 1) * 2 : dst;
int xi = flipX ? xs : xs * clipX;
- byte *wsrc = hsrc + ((xi + 0x8000) >> 16);
+ const byte *wsrc = hsrc + ((xi + 0x8000) >> 16);
for (int xc = 0; xc < destWidth; ++xc) {
byte colorIndex = *wsrc;
uint16 c = READ_LE_UINT16(&palette[colorIndex * 2]);
@@ -328,7 +328,7 @@ void Screen::updatePaletteTransparency(uint16 paletteNum, uint16 startOffset, ui
}
}
-void Screen::loadPalette(uint16 paletteNum, byte *palette) {
+void Screen::loadPalette(uint16 paletteNum, const byte *palette) {
bool isTransPalette = (paletteNum & 0x8000);
paletteNum &= ~0x8000;
assert(paletteNum < DRAGONS_NUM_PALETTES);
@@ -394,7 +394,7 @@ void Screen::setScreenShakeOffset(int16 x, int16 y) {
_screenShakeOffset.y = y;
}
-void Screen::copyRectToSurface8bppWrappedY(const Graphics::Surface &srcSurface, byte *palette, int yOffset) {
+void Screen::copyRectToSurface8bppWrappedY(const Graphics::Surface &srcSurface, const byte *palette, int yOffset) {
byte *dst = (byte *)_backSurface->getBasePtr(0, 0);
for (int i = 0; i < DRAGONS_SCREEN_HEIGHT; i++) {
const byte *src = (const byte *)srcSurface.getPixels() + ((yOffset + i) % srcSurface.h) * srcSurface.pitch;
@@ -408,7 +408,7 @@ void Screen::copyRectToSurface8bppWrappedY(const Graphics::Surface &srcSurface,
}
}
-void Screen::copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, byte *palette, Common::Rect srcRect,
+void Screen::copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, const byte *palette, Common::Rect srcRect,
AlphaBlendMode alpha) {
// Copy buffer data to internal buffer
const byte *src = (const byte *)srcSurface.getBasePtr(0, 0);
diff --git a/engines/dragons/screen.h b/engines/dragons/screen.h
index 45b3654f61..310b8e78ce 100644
--- a/engines/dragons/screen.h
+++ b/engines/dragons/screen.h
@@ -71,10 +71,10 @@ public:
Graphics::PixelFormat getPixelFormat() { return _pixelFormat; }
void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY);
void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, Common::Rect srcRect, bool flipX = false, AlphaBlendMode alpha = NONE);
- void copyRectToSurface8bpp(const Graphics::Surface &srcSurface, byte *palette, int destX, int destY, Common::Rect srcRect, bool flipX = false, AlphaBlendMode alpha = NONE, uint16 scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE);
- void copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, byte *palette, Common::Rect srcRect, AlphaBlendMode alpha = NONE);
+ void copyRectToSurface8bpp(const Graphics::Surface &srcSurface, const byte *palette, int destX, int destY, Common::Rect srcRect, bool flipX = false, AlphaBlendMode alpha = NONE, uint16 scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE);
+ void copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, const byte *palette, Common::Rect srcRect, AlphaBlendMode alpha = NONE);
void updateScreen();
- void loadPalette(uint16 paletteNum, byte *palette);
+ void loadPalette(uint16 paletteNum, const byte *palette);
byte *getPalette(uint16 paletteNum);
void setPaletteRecord(uint16 paletteNum, uint16 offset, uint16 newValue);
void updatePaletteTransparency(uint16 paletteNum, uint16 startOffset, uint16 endOffset, bool isTransparent);
@@ -86,7 +86,7 @@ public:
void setScreenShakeOffset(int16 x, int16 y);
- void copyRectToSurface8bppWrappedY(const Graphics::Surface &srcSurface, byte *palette, int yOffset);
+ void copyRectToSurface8bppWrappedY(const Graphics::Surface &srcSurface, const byte *palette, int yOffset);
int16 addFlatQuad(int16 x0, int16 y0, int16 x1, int16 y1, int16 x3, int16 y3, int16 x2, int16 y2, uint16 colour, int16 priorityLayer, uint16 flags);
void drawFlatQuads(uint16 priorityLayer);
@@ -95,8 +95,8 @@ public:
private:
void copyRectToSurface(const void *buffer, int srcPitch, int srcWidth, int srcXOffset, int destX, int destY, int width, int height, bool flipX, AlphaBlendMode alpha);
- void copyRectToSurface8bpp(const void *buffer, byte* palette, int srcPitch, int srcWidth, int srcXOffset, int destX, int destY, int width, int height, bool flipX, AlphaBlendMode alpha);
- void drawScaledSprite(Graphics::Surface *destSurface, byte *source, int sourceWidth, int sourceHeight, int destX, int destY, int destWidth, int destHeight, byte *palette, bool flipX, uint8 alpha);
+ void copyRectToSurface8bpp(const void *buffer, const byte* palette, int srcPitch, int srcWidth, int srcXOffset, int destX, int destY, int width, int height, bool flipX, AlphaBlendMode alpha);
+ void drawScaledSprite(Graphics::Surface *destSurface, const byte *source, int sourceWidth, int sourceHeight, int destX, int destY, int destWidth, int destHeight, const byte *palette, bool flipX, uint8 alpha);
};
} // End of namespace Dragons
diff --git a/engines/pink/cel_decoder.cpp b/engines/pink/cel_decoder.cpp
index e048e8b5aa..fafd6cc9a1 100644
--- a/engines/pink/cel_decoder.cpp
+++ b/engines/pink/cel_decoder.cpp
@@ -55,21 +55,21 @@ bool CelDecoder::loadStream(Common::SeekableReadStream *stream) {
uint16 CelDecoder::getTransparentColourIndex() const {
- CelVideoTrack *track = (CelVideoTrack *)getTrack(0);
+ const CelVideoTrack *track = (const CelVideoTrack *)getTrack(0);
if (!track)
return 0;
return track->getTransparentColourIndex();
}
const Graphics::Surface *CelDecoder::getCurrentFrame() const {
- CelVideoTrack *track = (CelVideoTrack *)getTrack(0);
+ const CelVideoTrack *track = (const CelVideoTrack *)getTrack(0);
if (!track)
return 0;
return track->getCurrentFrame();
}
Common::Point CelDecoder::getCenter() const {
- CelVideoTrack *track = (CelVideoTrack *)getTrack(0);
+ const CelVideoTrack *track = (const CelVideoTrack *)getTrack(0);
if (!track)
return Common::Point(0, 0);
return track->getCenter();
Commit: 488adf7fe9cf1240d4225a1996c90228d381c000
https://github.com/scummvm/scummvm/commit/488adf7fe9cf1240d4225a1996c90228d381c000
Author: Max Horn (max at quendi.de)
Date: 2020-04-17T22:41:11+01:00
Commit Message:
ULTIMA4: fix compilation w/o MP3 support
Changed paths:
engines/ultima/ultima4/sound/music.cpp
diff --git a/engines/ultima/ultima4/sound/music.cpp b/engines/ultima/ultima4/sound/music.cpp
index 1ad616e0ef..cd3c6a4c88 100644
--- a/engines/ultima/ultima4/sound/music.cpp
+++ b/engines/ultima/ultima4/sound/music.cpp
@@ -234,10 +234,12 @@ bool Music::load_sys(const Common::String &pathName) {
return false;
}
- Common::SeekableReadStream *s = f.readStream(f.size());
- if (pathName.hasSuffixIgnoreCase(".mp3"))
+ if (pathName.hasSuffixIgnoreCase(".mp3")) {
+#ifdef USE_MAD
+ Common::SeekableReadStream *s = f.readStream(f.size());
_playing = Audio::makeMP3Stream(s, DisposeAfterUse::YES);
- else if (pathName.hasSuffixIgnoreCase(".it"))
+#endif
+ } else if (pathName.hasSuffixIgnoreCase(".it"))
_playing = nullptr;
else
error("Unknown sound file");
Commit: caecdfdf9fb36897a936260b0ceb7f477ac79bb8
https://github.com/scummvm/scummvm/commit/caecdfdf9fb36897a936260b0ceb7f477ac79bb8
Author: Max Horn (max at quendi.de)
Date: 2020-04-17T22:41:11+01:00
Commit Message:
SCI: Remove dead data, make table static
Changed paths:
engines/sci/engine/vm_hooks.cpp
diff --git a/engines/sci/engine/vm_hooks.cpp b/engines/sci/engine/vm_hooks.cpp
index 267a581dab..c4e2b46524 100644
--- a/engines/sci/engine/vm_hooks.cpp
+++ b/engines/sci/engine/vm_hooks.cpp
@@ -50,7 +50,7 @@ namespace Sci {
// we solve that by calling the hook before executing the opcode following proc0_36 call
// and check the return value. if the hero should die, we kill him
-const byte qfg1_die_after_running_on_ice[] = {
+static const byte qfg1_die_after_running_on_ice[] = {
// if shouldn't die, jump to end
0x2f, 22, // bt +22
@@ -65,11 +65,7 @@ const byte qfg1_die_after_running_on_ice[] = {
0x38, 32, 3, // push 800
0x39, 1, // pushi 1
0x39, 4, // pushi 4
- 0x47, 0x00, 0x01, 0x10 // calle proc0_1
-};
-
-const byte del_me[] = {
- 38 // illegal opcode
+ 0x47, 0x00, 0x01, 0x10 // calle proc0_1
};
/** Write here all games hooks
@@ -89,7 +85,7 @@ static const GeneralHookEntry allGamesHooks[] = {
VmHooks::VmHooks() {
// build _hooksMap
for (uint i = 0; i < ARRAYSIZE(allGamesHooks); i++) {
- if (allGamesHooks[i].gameId == g_sci->getGameId())
+ if (allGamesHooks[i].gameId == g_sci->getGameId())
_hooksMap.setVal(allGamesHooks[i].key, allGamesHooks[i].entry);
}
More information about the Scummvm-git-logs
mailing list