[Scummvm-git-logs] scummvm master -> 7e3de05c408e37d5e0a26015ef8f867b6dfe6f42
fracturehill
noreply at scummvm.org
Sat Oct 28 13:22:22 UTC 2023
This automated email contains information about 26 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b9cd9b7169 NANCY: Implement kDefaultAR dependency
ab9114bf9a NANCY: Ensure deferred loader will run at least once
1bc3940e6b NANCY: Cursor fixes
ab784bdd8b COMMON: Allow extraction of empty files from InstallShield cabs
6f2edd92aa NANCY: Fix Overlay with hotspot triggering
649e0ebf8b NANCY: Fix hasItem() for nancy2 and earlier
5eeba15395 TWINE: Fix out of bounds write
de20f4b395 AGS: Remove unused function
a88fc1ce28 AGS: Fix compiler warning
a9dac765fe AGS: Fix uninitialized variable compiler warning
bc7613e1fb CGE2: Fix write overflow compiler warning
e8f2f52197 COMPOSER: Silence uninitialized variable warnings
93fb2058af CRYO: Silence uninitialized variable warnings
c3ae25281b GLK: HUGO: Fix compiler warnings
fde77a362f GLK: HUGO: Fix overflow in Common::fill() call
443043c6ba GLK: MAGNETIC: Fix compiler warning
113bb4d7e2 TSAGE: R2R: Silence compiler warning
7907c7f012 ULTIMA: NUVIE: Fix uninitialized variable warnings
738c5035b5 WATCHMAKER: Fix incorrect error message
bef3adce70 WINTERMUTE: Fix uninitialized variable warning
1188e91b2a TRECISION: Fix uninitialized variable warnings
b9fb4e22ec SCI: Fix uninitialized variable warnings
60467473f4 SAGA: Silence uninitialized variable warnings
6433d7c073 NANCY: Silence uninitialized variable warnings
85ff162e1f NANCY: Remove unused variable
7e3de05c40 AGS: Fix triple delete of bitmap buffer
Commit: b9cd9b7169b5729083a725eb61645ea63bb1829f
https://github.com/scummvm/scummvm/commit/b9cd9b7169b5729083a725eb61645ea63bb1829f
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:33+03:00
Commit Message:
NANCY: Implement kDefaultAR dependency
This dependency will be satisfied only if no action records
have been executed yet. Introduced in nancy7
Changed paths:
engines/nancy/action/actionmanager.cpp
engines/nancy/action/actionmanager.h
engines/nancy/action/actionrecord.h
diff --git a/engines/nancy/action/actionmanager.cpp b/engines/nancy/action/actionmanager.cpp
index 2d7f5e0765e..e5bb8f2d253 100644
--- a/engines/nancy/action/actionmanager.cpp
+++ b/engines/nancy/action/actionmanager.cpp
@@ -254,6 +254,7 @@ void ActionManager::processActionRecords() {
}
record->execute();
+ _recordsWereExecuted = true;
}
if (g_nancy->getGameType() >= kGameTypeNancy4 && NancySceneState._state == State::Scene::kLoad) {
@@ -569,6 +570,15 @@ void ActionManager::processDependency(DependencyRecord &dep, ActionRecord &recor
dep.stopEvaluating = true;
}
+ break;
+ case DependencyType::kDefaultAR:
+ // Only execute if no other AR has executed yet
+ if (_recordsWereExecuted) {
+ dep.satisfied = false;
+ } else {
+ dep.satisfied = true;
+ }
+
break;
default:
warning("Unimplemented Dependency type %i", (int)dep.type);
@@ -582,6 +592,7 @@ void ActionManager::clearActionRecords() {
delete r;
}
_records.clear();
+ _recordsWereExecuted = false;
}
void ActionManager::onPause(bool pause) {
diff --git a/engines/nancy/action/actionmanager.h b/engines/nancy/action/actionmanager.h
index 534e7665fb8..7224fe1ce99 100644
--- a/engines/nancy/action/actionmanager.h
+++ b/engines/nancy/action/actionmanager.h
@@ -80,6 +80,7 @@ protected:
void debugDrawHotspots();
Common::Array<ActionRecord *> _records;
+ bool _recordsWereExecuted = false; // Used for kDefaultAR dependency
Common::Array<ActionRecord *> _activatedRecordsThisFrame;
};
diff --git a/engines/nancy/action/actionrecord.h b/engines/nancy/action/actionrecord.h
index 5e79c5cbbb8..076befa7247 100644
--- a/engines/nancy/action/actionrecord.h
+++ b/engines/nancy/action/actionrecord.h
@@ -60,7 +60,8 @@ enum struct DependencyType : int16 {
kSound = 17,
kOpenParenthesis = 18,
kCloseParenthesis = 19,
- kRandom = 20
+ kRandom = 20,
+ kDefaultAR = 21
};
// Describes a condition that needs to be fulfilled before the
Commit: ab9114bf9a5f1116766f01a385ed4e52188bf2fa
https://github.com/scummvm/scummvm/commit/ab9114bf9a5f1116766f01a385ed4e52188bf2fa
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:33+03:00
Commit Message:
NANCY: Ensure deferred loader will run at least once
Changed paths:
engines/nancy/util.cpp
diff --git a/engines/nancy/util.cpp b/engines/nancy/util.cpp
index 87db1fa9711..500a48e25f2 100644
--- a/engines/nancy/util.cpp
+++ b/engines/nancy/util.cpp
@@ -257,7 +257,7 @@ bool DeferredLoader::load(uint32 endTime) {
uint32 loopStartTime = g_system->getMillis();
uint32 loopTime = 0; // Stores the loop that took the longest time to complete
- while (loopTime + loopStartTime < endTime) {
+ do {
if (loadInner()) {
return true;
}
@@ -272,7 +272,7 @@ bool DeferredLoader::load(uint32 endTime) {
if (g_system->getMillis() < endTime) {
break;
}
- }
+ } while (loopTime + loopStartTime < endTime);
return false;
}
Commit: 1bc3940e6ba80eb6a61a9a05834e02b8821dbea8
https://github.com/scummvm/scummvm/commit/1bc3940e6ba80eb6a61a9a05834e02b8821dbea8
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
NANCY: Cursor fixes
With the adjustments made to the regular cursor, the
inactive zone during conversations was rendered a few
pixels shorter than it should be; now the cursor can be moved
up right up to the edge of the viewport.
Also, when entering a conversation, the mouse cursor would previously warp immediately, but its graphic would only change
a frame later; this has also been fixed
Changed paths:
engines/nancy/action/conversation.cpp
engines/nancy/cursor.cpp
engines/nancy/cursor.h
engines/nancy/state/map.cpp
engines/nancy/state/scene.cpp
engines/nancy/ui/viewport.cpp
diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index e66f2d2c386..0ac72c4162d 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -19,7 +19,6 @@
*
*/
-#include "common/system.h"
#include "common/random.h"
#include "common/config-manager.h"
#include "common/serializer.h"
@@ -148,7 +147,7 @@ void ConversationSound::execute() {
adjustedMousePos.x -= cursorHotspot.x;
adjustedMousePos.y -= cursorHotspot.y - 1;
if (g_nancy->_cursorManager->getPrimaryVideoInactiveZone().bottom > adjustedMousePos.y) {
- g_system->warpMouse(initialMousePos.x + cursorHotspot.x, initialMousePos.y + cursorHotspot.y);
+ g_nancy->_cursorManager->warpCursor(Common::Point(initialMousePos.x + cursorHotspot.x, initialMousePos.y + cursorHotspot.y));
g_nancy->_cursorManager->setCursorType(CursorManager::kNormalArrow);
}
diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index 29a1c323d59..c9999200b03 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "common/system.h"
#include "graphics/cursorman.h"
#include "engines/nancy/nancy.h"
@@ -36,7 +37,8 @@ CursorManager::CursorManager() :
_curCursorID(0),
_hasItem(false),
_numCursorTypes(0),
- _puzzleExitCursor((g_nancy->getGameType() >= kGameTypeNancy4) ? kMoveBackward : kExit) {}
+ _puzzleExitCursor((g_nancy->getGameType() >= kGameTypeNancy4) ? kMoveBackward : kExit),
+ _warpedMousePos(-500, -500) {}
void CursorManager::init(Common::SeekableReadStream *chunkStream) {
assert(chunkStream);
@@ -268,6 +270,10 @@ void CursorManager::setCursorItemID(int16 itemID) {
setCursor(_curCursorType, itemID);
}
+void CursorManager::warpCursor(const Common::Point &pos) {
+ _warpedMousePos = pos;
+}
+
void CursorManager::applyCursor() {
Graphics::ManagedSurface *surf;
Common::Rect bounds = _cursors[_curCursorID].bounds;
@@ -288,6 +294,12 @@ void CursorManager::applyCursor() {
surf->grabPalette(palette, 0, 256);
CursorMan.replaceCursorPalette(palette, 0, 256);
}
+
+ if (_warpedMousePos.x != -500 && _warpedMousePos.y != -500) {
+ g_system->warpMouse(_warpedMousePos.x, _warpedMousePos.y);
+ _warpedMousePos.x = -500;
+ _warpedMousePos.y = -500;
+ }
}
void CursorManager::showCursor(bool shouldShow) {
diff --git a/engines/nancy/cursor.h b/engines/nancy/cursor.h
index fad6b885ceb..41d31b8c552 100644
--- a/engines/nancy/cursor.h
+++ b/engines/nancy/cursor.h
@@ -64,6 +64,8 @@ public:
void setCursorType(CursorType type);
void setCursorItemID(int16 itemID);
+ void warpCursor(const Common::Point &pos);
+
// Change the cursor graphic. Should be called right before drawing to screen
void applyCursor();
@@ -91,6 +93,7 @@ private:
Graphics::ManagedSurface _invCursorsSurface;
+ Common::Point _warpedMousePos;
CursorType _curCursorType;
int16 _curItemID;
uint _curCursorID;
diff --git a/engines/nancy/state/map.cpp b/engines/nancy/state/map.cpp
index 6ae39f44abc..ac38295dbff 100644
--- a/engines/nancy/state/map.cpp
+++ b/engines/nancy/state/map.cpp
@@ -343,7 +343,7 @@ void TVDMap::MapGlobe::onTrigger() {
_gargoyleEyes.setVisible(true);
_owner->_viewport.setVisible(true);
_owner->_viewport.playVideo();
- g_system->warpMouse(_owner->_mapData->cursorPosition.x, _owner->_mapData->cursorPosition.y);
+ g_nancy->_cursorManager->warpCursor(_owner->_mapData->cursorPosition);
g_nancy->setMouseEnabled(true);
} else {
_owner->_state = kExit;
@@ -406,7 +406,7 @@ void Nancy1Map::load() {
setLabel(-1);
g_nancy->_cursorManager->setCursorItemID(-1);
- g_system->warpMouse(_mapData->cursorPosition.x, _mapData->cursorPosition.y);
+ g_nancy->_cursorManager->warpCursor(_mapData->cursorPosition);
if (!g_nancy->_sound->isSoundPlaying(getSound())) {
g_nancy->_sound->loadSound(getSound());
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 6a25dd4dcc8..f13ebd886ec 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -1001,13 +1001,10 @@ void Scene::handleInput() {
// Warp the mouse below the inactive zone during dialogue scenes
if (_activeConversation != nullptr) {
const Common::Rect &inactiveZone = g_nancy->_cursorManager->getPrimaryVideoInactiveZone();
- const Common::Point cursorHotspot = g_nancy->_cursorManager->getCurrentCursorHotspot();
- Common::Point adjustedMousePos = input.mousePos;
- adjustedMousePos.y -= cursorHotspot.y;
- if (inactiveZone.bottom > adjustedMousePos.y) {
- input.mousePos.y = inactiveZone.bottom + cursorHotspot.y;
- g_system->warpMouse(input.mousePos.x, input.mousePos.y);
+ if (inactiveZone.bottom > input.mousePos.y) {
+ input.mousePos.y = inactiveZone.bottom;
+ g_nancy->_cursorManager->warpCursor(input.mousePos);
}
} else {
// Check if player has pressed esc
diff --git a/engines/nancy/ui/viewport.cpp b/engines/nancy/ui/viewport.cpp
index 6eb004a4232..3842b0bf58c 100644
--- a/engines/nancy/ui/viewport.cpp
+++ b/engines/nancy/ui/viewport.cpp
@@ -70,7 +70,7 @@ void Viewport::handleInput(NancyInput &input) {
if ( g_nancy->getGameType() != kGameTypeVampire &&
input.input & (NancyInput::kLeftMouseButton | NancyInput::kRightMouseButton)
&& _stickyCursorPos.x > -1) {
- g_system->warpMouse(_stickyCursorPos.x, _stickyCursorPos.y);
+ g_nancy->_cursorManager->warpCursor(_stickyCursorPos);
input.mousePos = _stickyCursorPos;
}
Commit: ab784bdd8bd1b32516e9aa93e13a14b37d3d1fc1
https://github.com/scummvm/scummvm/commit/ab784bdd8bd1b32516e9aa93e13a14b37d3d1fc1
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
COMMON: Allow extraction of empty files from InstallShield cabs
It is not uncommon for an InstallShield cab to have file
entries with a size of 0; this commit makes sure that trying to
extract such a file won't result in a warning, and won't
cause a crash when calling dumpArchive() on the containing
cabinet file.
Changed paths:
common/compression/installshield_cab.cpp
diff --git a/common/compression/installshield_cab.cpp b/common/compression/installshield_cab.cpp
index 4ff50d54749..e9be8e430fc 100644
--- a/common/compression/installshield_cab.cpp
+++ b/common/compression/installshield_cab.cpp
@@ -371,15 +371,18 @@ SeekableReadStream *InstallShieldCabinet::createReadStreamForMember(const Path &
stream->read(src, entry.compressedSize);
}
- bool result = inflateZlibInstallShield(dst, entry.uncompressedSize, src, entry.compressedSize);
- free(src);
-
- if (!result) {
- warning("failed to inflate CAB file '%s'", name.c_str());
- free(dst);
- return nullptr;
+ // Entries with size 0 are valid, and do not need to be inflated
+ if (entry.compressedSize != 0) {
+ if (!inflateZlibInstallShield(dst, entry.uncompressedSize, src, entry.compressedSize)) {
+ warning("failed to inflate CAB file '%s'", name.c_str());
+ free(dst);
+ free(src);
+ return nullptr;
+ }
}
+ free(src);
+
return new MemoryReadStream(dst, entry.uncompressedSize, DisposeAfterUse::YES);
}
Commit: 6f2edd92aa7a6c869236ad3f953e29472779d51d
https://github.com/scummvm/scummvm/commit/6f2edd92aa7a6c869236ad3f953e29472779d51d
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
NANCY: Fix Overlay with hotspot triggering
Fixed an issue where an Overlay with a hotspot would
actually never have it activated. Also, added a check for game
type to make sure other action records _do_ get activated
alongside an Overlay in nancy2 and lower. Both of these
fixes target nancy2 scene 2541.
Changed paths:
engines/nancy/action/overlay.cpp
diff --git a/engines/nancy/action/overlay.cpp b/engines/nancy/action/overlay.cpp
index 73bef84bde2..5b184c274da 100644
--- a/engines/nancy/action/overlay.cpp
+++ b/engines/nancy/action/overlay.cpp
@@ -62,7 +62,11 @@ void Overlay::handleInput(NancyInput &input) {
if (input.input & NancyInput::kLeftMouseButtonUp) {
_state = kActionTrigger;
- input.eatMouseInput(); // Make sure nothing else gets triggered
+ if (g_nancy->getGameType() >= kGameTypeNancy3) {
+ // Make sure nothing else gets triggered
+ // This is nancy3 and up, since we actually want to trigger other records in nancy2 (e.g. scene 2541)
+ input.eatMouseInput();
+ }
}
}
}
@@ -178,6 +182,7 @@ void Overlay::execute() {
if (_enableHotspot == kPlayOverlayWithHotspot) {
_hotspot = _screenPosition;
+ _hasHotspot = true;
}
break;
Commit: 649e0ebf8b19505a9f3d5cab753dad701d17dccc
https://github.com/scummvm/scummvm/commit/649e0ebf8b19505a9f3d5cab753dad701d17dccc
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
NANCY: Fix hasItem() for nancy2 and earlier
Fixed an error in Scene::hasItem() caused by earlier games'
usage of 1 as false and 2 as true.
Changed paths:
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index f13ebd886ec..668a89c9593 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -346,6 +346,14 @@ void Scene::setNoHeldItem() {
}
}
+byte Scene::hasItem(int16 id) const {
+ if (getHeldItem() == id) {
+ return g_nancy->_true;
+ } else {
+ return _flags.items[id];
+ }
+}
+
void Scene::installInventorySoundOverride(byte command, const SoundDescription &sound, const Common::String &caption, uint16 itemID) {
InventorySoundOverride newOverride;
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index c3a2365b162..15abcbe550a 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -130,7 +130,7 @@ public:
int16 getHeldItem() const { return _flags.heldItem; }
void setHeldItem(int16 id);
void setNoHeldItem();
- byte hasItem(int16 id) const { return _flags.items[id] || getHeldItem() == id; }
+ byte hasItem(int16 id) const;
byte getItemDisabledState(int16 id) const { return _flags.disabledItems[id]; }
void setItemDisabledState(int16 id, byte state) { _flags.disabledItems[id] = state; }
Commit: 5eeba15395aea7b3af104e779081014b855e7c67
https://github.com/scummvm/scummvm/commit/5eeba15395aea7b3af104e779081014b855e7c67
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
TWINE: Fix out of bounds write
Fixed an incorrect usage of sizeof() which results in writing
way past the end of a statically-allocated array.
Changed paths:
engines/twine/text.cpp
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 4a6483cf741..8d7a151fe48 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -397,8 +397,8 @@ void Text::initProgressiveTextBuffer() {
// the end of the buffer defines how fast the next page is shown - as the
// whitespaces are handled in the fade in process, too. But we need at least 32 chars,
// to completly fade in the last characters of a full page (see TEXT_MAX_FADE_IN_CHR)
- _progressiveTextBuffer[sizeof(_progressiveTextBuffer) - 1].chr = '\0';
- _progressiveTextBuffer[sizeof(_progressiveTextBuffer) - 1].x = 0;
+ _progressiveTextBuffer[ARRAYSIZE(_progressiveTextBuffer) - 1].chr = '\0';
+ _progressiveTextBuffer[ARRAYSIZE(_progressiveTextBuffer) - 1].x = 0;
_progressiveTextBufferPtr = _progressiveTextBuffer;
_dialTextBoxCurrentLine = 0;
}
Commit: de20f4b39583cee0036416fcaca4a0391b63eab1
https://github.com/scummvm/scummvm/commit/de20f4b39583cee0036416fcaca4a0391b63eab1
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
AGS: Remove unused function
Removed ExtractScriptTextReader() from room_file.cpp,
since it was just a leftover forgotten after a refactoring.
Changed paths:
engines/ags/shared/game/room_file.cpp
diff --git a/engines/ags/shared/game/room_file.cpp b/engines/ags/shared/game/room_file.cpp
index df6efd03b7a..7ded7723de3 100644
--- a/engines/ags/shared/game/room_file.cpp
+++ b/engines/ags/shared/game/room_file.cpp
@@ -618,26 +618,6 @@ HRoomFileError UpdateRoomData(RoomStruct *room, RoomFileVersion data_ver, bool g
return HRoomFileError::None();
}
-// Reader for ExtractScripText
-static String *reader_script;
-RoomFileVersion reader_ver;
-
-HError ExtractScriptTextReader(Stream *in, int block_id,
- const String &ext_id, soff_t block_len, bool &read_next) {
- if (block_id == kRoomFblk_Script) {
- read_next = false;
- char *buf = nullptr;
- HError err = ReadScriptBlock(buf, in, reader_ver);
- if (err) {
- *reader_script = buf;
- delete[] buf;
- }
- return err;
- }
- in->Seek(block_len); // skip block
- return HError::None();
-}
-
HRoomFileError ExtractScriptText(String &script, Stream *in, RoomFileVersion data_ver) {
RoomBlockReader reader(nullptr, data_ver, in);
HError err = reader.ReadRoomScript(script);
Commit: a88fc1ce281daa406fa97daedb9d5167a2de113d
https://github.com/scummvm/scummvm/commit/a88fc1ce281daa406fa97daedb9d5167a2de113d
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
AGS: Fix compiler warning
Fixed an out-of-bounds read warning caused by subscripting
a 2d array
Changed paths:
engines/ags/engine/ac/game_state.cpp
diff --git a/engines/ags/engine/ac/game_state.cpp b/engines/ags/engine/ac/game_state.cpp
index 9ac84747603..cdade1effd2 100644
--- a/engines/ags/engine/ac/game_state.cpp
+++ b/engines/ags/engine/ac/game_state.cpp
@@ -57,7 +57,7 @@ GameState::GameState() {
Common::fill(&music_queue[0], &music_queue[MAX_QUEUED_MUSIC], 0);
Common::fill(&takeover_from[0], &takeover_from[50], 0);
Common::fill(&playmp3file_name[0], &playmp3file_name[PLAYMP3FILE_MAX_FILENAME_LEN], 0);
- Common::fill(&globalstrings[0][0], &globalstrings[MAXGLOBALSTRINGS][0], 0);
+ Common::fill(&globalstrings[0][0], &globalstrings[MAXGLOBALSTRINGS - 1][MAX_MAXSTRLEN], 0);
Common::fill(&lastParserEntry[0], &lastParserEntry[MAX_MAXSTRLEN], 0);
Common::fill(&game_name[0], &game_name[100], 0);
Common::fill(&default_audio_type_volumes[0], &default_audio_type_volumes[MAX_AUDIO_TYPES], 0);
Commit: a9dac765feb691bfaadb1e966398b690ad470235
https://github.com/scummvm/scummvm/commit/a9dac765feb691bfaadb1e966398b690ad470235
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
AGS: Fix uninitialized variable compiler warning
Changed paths:
engines/ags/plugins/ags_pal_render/raycast.cpp
diff --git a/engines/ags/plugins/ags_pal_render/raycast.cpp b/engines/ags/plugins/ags_pal_render/raycast.cpp
index 0dbadb77397..0653f3a67e8 100644
--- a/engines/ags/plugins/ags_pal_render/raycast.cpp
+++ b/engines/ags/plugins/ags_pal_render/raycast.cpp
@@ -174,9 +174,9 @@ void AGSPalRender::Ray_GetAmbientLight(ScriptMethodParams ¶ms) {
}
double fsqrt(double y) {
double x, z, tempf;
+ tempf = y;
unsigned long *tfptr = ((unsigned long *)&tempf) + 1;
- tempf = y;
*tfptr = (0xbfcdd90a - *tfptr) >> 1; /* estimate of 1/sqrt(y) */
x = tempf;
z = y * 0.5; /* hoist out the �/2� */
Commit: bc7613e1fb90d7aabc9f64cb1e3bd95392e3d7fb
https://github.com/scummvm/scummvm/commit/bc7613e1fb90d7aabc9f64cb1e3bd95392e3d7fb
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
CGE2: Fix write overflow compiler warning
Changed paths:
engines/cge2/vmenu.cpp
diff --git a/engines/cge2/vmenu.cpp b/engines/cge2/vmenu.cpp
index a557cde63b1..4a19268e3c4 100644
--- a/engines/cge2/vmenu.cpp
+++ b/engines/cge2/vmenu.cpp
@@ -112,12 +112,15 @@ char *VMenu::vmGather(Common::Array<Choice *> list) {
}
len += h;
_vmgt = new char[len];
- *_vmgt = '\0';
- for (uint i = 0; i < list.size(); i++) {
- if (*_vmgt)
- Common::strcat_s(_vmgt, len, "|");
- Common::strcat_s(_vmgt, len, list[i]->_text);
- ++h;
+
+ if (len) {
+ *_vmgt = '\0';
+ for (uint i = 0; i < list.size(); i++) {
+ if (*_vmgt)
+ Common::strcat_s(_vmgt, len, "|");
+ Common::strcat_s(_vmgt, len, list[i]->_text);
+ ++h;
+ }
}
return _vmgt;
Commit: e8f2f521976a1f6d74f477b9374c4bf1cd72955f
https://github.com/scummvm/scummvm/commit/e8f2f521976a1f6d74f477b9374c4bf1cd72955f
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
COMPOSER: Silence uninitialized variable warnings
Fixed most of the bogus warnings in saveload.cpp caused
by usage of the Serializer class.
Changed paths:
engines/composer/saveload.cpp
diff --git a/engines/composer/saveload.cpp b/engines/composer/saveload.cpp
index 2f4adb9a2e1..83f59bf9398 100644
--- a/engines/composer/saveload.cpp
+++ b/engines/composer/saveload.cpp
@@ -43,7 +43,7 @@ void ComposerEngine::syncArray(Common::Serializer &ser, Common::Array<T> &data,
sync<T>(ser, *i, minVersion, maxVersion);
}
} else {
- uint32 size;
+ uint32 size = 0;
data.clear();
ser.syncAsUint32LE(size, minVersion, maxVersion);
for (uint32 i = 0; i < size; i++) {
@@ -62,7 +62,7 @@ void ComposerEngine::syncList(Common::Serializer &ser, Common::List<T> &data, Co
sync<T>(ser, *i, minVersion, maxVersion);
}
} else {
- uint32 size;
+ uint32 size = 0;
data.clear();
ser.syncAsUint32LE(size, minVersion, maxVersion);
for (uint32 i = 0; i < size; i++) {
@@ -81,7 +81,7 @@ void ComposerEngine::syncListReverse(Common::Serializer &ser, Common::List<T> &d
sync<T>(ser, *i, minVersion, maxVersion);
}
} else {
- uint32 size;
+ uint32 size = 0;
data.clear();
ser.syncAsUint32LE(size, minVersion, maxVersion);
for (uint32 i = 0; i < size; i++) {
@@ -105,7 +105,7 @@ void ComposerEngine::sync<Library>(Common::Serializer &ser, Library &data, Commo
ser.syncAsUint16LE(data._id, minVersion, maxVersion);
ser.syncString(data._group, minVersion, maxVersion);
} else {
- uint16 id;
+ uint16 id = 0;
ser.syncAsUint16LE(id, minVersion, maxVersion);
ser.syncString(_bookGroup, minVersion, maxVersion);
loadLibrary(id);
@@ -120,7 +120,7 @@ void ComposerEngine::syncListReverse<Library>(Common::Serializer &ser, Common::L
sync<Library>(ser, *i, minVersion, maxVersion);
}
} else {
- uint32 size;
+ uint32 size = 0;
ser.syncAsUint32LE(size, minVersion, maxVersion);
for (uint32 i = 0; i < size; i++) {
Library item;
@@ -135,8 +135,8 @@ void ComposerEngine::sync<PendingPageChange>(Common::Serializer &ser, PendingPag
}
template<>
void ComposerEngine::sync<OldScript *>(Common::Serializer &ser, OldScript *&data, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) {
- uint16 id;
- uint32 pos, delay;
+ uint16 id = 0;
+ uint32 pos = 0, delay = 0;
if (ser.isSaving()) {
pos = data->_stream->pos();
id = data->_id;
@@ -161,8 +161,8 @@ void ComposerEngine::sync<QueuedScript>(Common::Serializer &ser, QueuedScript &d
}
template<>
void ComposerEngine::sync<Pipe *>(Common::Serializer &ser, Pipe *&data, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) {
- uint16 id;
- uint32 offset, tmp;
+ uint16 id = 0;
+ uint32 offset = 0, tmp = 0;
if (ser.isSaving()) {
id = data->getPipeId();
offset = data->getOffset();
@@ -185,7 +185,7 @@ void ComposerEngine::sync<Pipe *>(Common::Serializer &ser, Pipe *&data, Common::
data->setOffset(offset);
ser.syncAsUint32LE(tmp);
for (uint32 j = tmp; j > 0; j--) {
- uint32 tag;
+ uint32 tag = 0;
ser.syncAsUint32LE(tag);
ser.syncAsUint32LE(tmp);
for (uint32 k = tmp; k > 0; k--) {
@@ -211,9 +211,9 @@ void ComposerEngine::sync<AnimationEntry>(Common::Serializer &ser, AnimationEntr
}
template<>
void ComposerEngine::sync<Animation *>(Common::Serializer &ser, Animation *&data, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) {
- uint16 animId, x, y;
- uint32 offset, state, param;
- int32 size;
+ uint16 animId = 0, x = 0, y = 0;
+ uint32 offset = 0, state = 0, param = 0;
+ int32 size = 0;
if (ser.isSaving()) {
animId = data->_id;
offset = data->_offset;
@@ -235,7 +235,7 @@ void ComposerEngine::sync<Animation *>(Common::Serializer &ser, Animation *&data
loadAnimation(data, animId, x, y, param, size);
data->_offset = offset;
data->_state = state;
- uint32 tmp;
+ uint32 tmp = 0;
ser.syncAsUint32LE(tmp);
for (uint32 i = 0; i < tmp; i++) {
sync<AnimationEntry>(ser, data->_entries[i], minVersion, maxVersion);
@@ -356,7 +356,7 @@ Common::Error ComposerEngine::loadGameState(int slot) {
// Restore the buffered audio
ser.syncAsSint16LE(_currSoundPriority);
- int32 numSamples;
+ int32 numSamples = 0;
ser.syncAsSint32LE(numSamples);
int16 *audioBuffer = (int16 *)malloc(numSamples * 2);
for (int32 i = 0; i < numSamples; i++)
Commit: 93fb2058afe22ca8d45a6ad1e4027827c1d7afda
https://github.com/scummvm/scummvm/commit/93fb2058afe22ca8d45a6ad1e4027827c1d7afda
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
CRYO: Silence uninitialized variable warnings
Fixed the bogus warnings in eden.cpp caused by usage
of the Serializer class.
Changed paths:
engines/cryo/eden.cpp
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index 3c704cd8605..9eb50394d18 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -6591,8 +6591,8 @@ void EdenGame::loadgame(char *name) {
#define OFSIN(val, base, typ) do { if ((void*)(val) != NULLPTR) (val) = (typ*)((char*)(val) + (size_t)(base)); else (val) = 0; } while (false)
void EdenGame::syncGlobalPointers(Common::Serializer s) {
- uint32 dialogIdx, nextDialogIdx, narratorDialogIdx, lastDialogIdx, tapeIdx, nextRoomIconIdx, roomIdx;
- uint32 citaAreaFirstRoomIdx, areaIdx, lastAreaIdx, curAreaIdx, characterIdx, roomCharacterIdx;
+ uint32 dialogIdx = 0, nextDialogIdx = 0, narratorDialogIdx = 0, lastDialogIdx = 0, tapeIdx = 0, nextRoomIconIdx = 0, roomIdx = 0;
+ uint32 citaAreaFirstRoomIdx = 0, areaIdx = 0, lastAreaIdx = 0, curAreaIdx = 0, characterIdx = 0, roomCharacterIdx = 0;
if (s.isSaving()) {
IDXOUT(_globals->_dialogPtr, _gameDialogs, Dialog, dialogIdx);
@@ -6687,7 +6687,7 @@ void EdenGame::syncGlobalValues(Common::Serializer s) {
s.syncAsByte(_globals->_endGameFlag);
s.syncAsByte(_globals->_lastInfo);
- byte autoDialog;
+ byte autoDialog = 0;
if (s.isSaving())
autoDialog = _globals->_autoDialog ? 1 : 0;
s.syncAsByte(autoDialog);
@@ -6806,7 +6806,7 @@ void EdenGame::syncGlobalValues(Common::Serializer s) {
}
void EdenGame::syncCitadelRoomPointers(Common::Serializer s) {
- uint32 citadelRoomIdx;
+ uint32 citadelRoomIdx = 0;
for (int i = 0; i < 12; i++) {
if (s.isSaving()) {
IDXOUT(_areasTable[i]._citadelRoomPtr, _gameRooms, Room, citadelRoomIdx);
@@ -6818,10 +6818,10 @@ void EdenGame::syncCitadelRoomPointers(Common::Serializer s) {
}
void EdenGame::syncTapePointers(Common::Serializer s) {
- int persoIdx;
+ int persoIdx = 0;
for (int i = 0; i < 16; i++) {
- int index, subIndex;
+ int index = 0, subIndex = 0;
if (s.isSaving()) {
index = NULLPTR;
char *closerPtr = nullptr;
Commit: c3ae25281b58dbc98b682212ebad3da8321d5897
https://github.com/scummvm/scummvm/commit/c3ae25281b58dbc98b682212ebad3da8321d5897
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:34+03:00
Commit Message:
GLK: HUGO: Fix compiler warnings
Fixed a couple of compiler warnings caused by incorrect
subscripting of 2d arrays.
Changed paths:
engines/glk/hugo/hugo.cpp
diff --git a/engines/glk/hugo/hugo.cpp b/engines/glk/hugo/hugo.cpp
index 8d3fd34579a..5a10ca43f2a 100644
--- a/engines/glk/hugo/hugo.cpp
+++ b/engines/glk/hugo/hugo.cpp
@@ -90,15 +90,15 @@ Hugo::Hugo(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gam
Common::fill(&var[0], &var[MAXLOCALS + MAXGLOBALS], 0);
// hemedia
- Common::fill(&resids[0][0], &resids[2][0], 0);
+ Common::fill(&resids[0][0], &resids[1][MAXRES], 0);
numres[0] = numres[1] = 0;
// hemisc
- Common::fill(&context_command[0][0], &context_command[MAX_CONTEXT_COMMANDS][0], 0);
+ Common::fill(&context_command[0][0], &context_command[MAX_CONTEXT_COMMANDS - 1][64], 0);
Common::fill(&id[0], &id[3], '\0');
Common::fill(&serial[0], &serial[9], '\0');
Common::fill(&pbuffer[0], &pbuffer[MAXBUFFER * 2 + 1], 0);
- Common::fill(&undostack[0][0], &undostack[MAXUNDO][0], 0);
+ Common::fill(&undostack[0][0], &undostack[MAXUNDO - 1][5], 0);
// heparse
Common::fill(&buffer[0], &buffer[MAXBUFFER + MAXWORDS], '\0');
Commit: fde77a362f07f4aaa5c54b0b980bb0aa24b996df
https://github.com/scummvm/scummvm/commit/fde77a362f07f4aaa5c54b0b980bb0aa24b996df
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
GLK: HUGO: Fix overflow in Common::fill() call
Changed paths:
engines/glk/hugo/stringfn.h
diff --git a/engines/glk/hugo/stringfn.h b/engines/glk/hugo/stringfn.h
index e83fe3a63a8..ed4567c1dba 100644
--- a/engines/glk/hugo/stringfn.h
+++ b/engines/glk/hugo/stringfn.h
@@ -42,7 +42,7 @@ private:
char *GetTempString();
public:
StringFunctions() : _tempstringCount(0) {
- Common::fill(&_tempString[0][0], &_tempString[NUM_TEMPSTRINGS][1025], '\0');
+ Common::fill(&_tempString[0][0], &_tempString[NUM_TEMPSTRINGS - 1][1025], '\0');
}
char *Left(char a[], int l);
Commit: 443043c6ba12045aac51361f5bf399a05710a062
https://github.com/scummvm/scummvm/commit/443043c6ba12045aac51361f5bf399a05710a062
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
GLK: MAGNETIC: Fix compiler warning
Fixed a compiler warning caused by incorrect subscripting of
a 2d array.
Changed paths:
engines/glk/magnetic/magnetic.cpp
diff --git a/engines/glk/magnetic/magnetic.cpp b/engines/glk/magnetic/magnetic.cpp
index 2bd0915b747..6f8bcf4f8c8 100644
--- a/engines/glk/magnetic/magnetic.cpp
+++ b/engines/glk/magnetic/magnetic.cpp
@@ -73,7 +73,7 @@ Magnetic::Magnetic(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(s
Common::fill(&dreg[0], &dreg[8], 0);
Common::fill(&areg[0], &areg[8], 0);
Common::fill(&tmparg[0], &tmparg[4], 0);
- Common::fill(&undo_regs[0][0], &undo_regs[2][0], 0);
+ Common::fill(&undo_regs[0][0], &undo_regs[1][18], 0);
undo[0] = undo[1] = nullptr;
undo_stat[0] = undo_stat[1] = 0;
Common::fill(&buffer[0], &buffer[80], 0);
Commit: 113bb4d7e25565f16fe5f76f80294782e67e8dc6
https://github.com/scummvm/scummvm/commit/113bb4d7e25565f16fe5f76f80294782e67e8dc6
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
TSAGE: R2R: Silence compiler warning
Changed paths:
engines/tsage/ringworld2/ringworld2_scenes0.cpp
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index f368385a71c..6a9da378336 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -7101,7 +7101,7 @@ void Scene825::Button::setText(int textId) {
_lookLineNum = textId;
_sceneText.remove();
- if (_buttonId != 0) {
+ if (textId != 0) {
Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene;
_sceneText.setup(scene->_autodocItems[textId - 1]);
}
Commit: 7907c7f012605b300de61b09627fbc7c652a0c1e
https://github.com/scummvm/scummvm/commit/7907c7f012605b300de61b09627fbc7c652a0c1e
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
ULTIMA: NUVIE: Fix uninitialized variable warnings
Changed paths:
engines/ultima/nuvie/files/u6_shape.cpp
diff --git a/engines/ultima/nuvie/files/u6_shape.cpp b/engines/ultima/nuvie/files/u6_shape.cpp
index 8802f24aa6e..6b7f9db5bad 100644
--- a/engines/ultima/nuvie/files/u6_shape.cpp
+++ b/engines/ultima/nuvie/files/u6_shape.cpp
@@ -393,7 +393,7 @@ bool U6Shape::blit(U6Shape *shp, uint16 x, uint16 y) {
return false;
unsigned char *src_data = shp->get_data();
- uint16 src_w, src_h;
+ uint16 src_w = 0, src_h = 0;
shp->get_size(&src_w, &src_h);
Commit: 738c5035b517cb37809dde3208f50bb4f5f93621
https://github.com/scummvm/scummvm/commit/738c5035b517cb37809dde3208f50bb4f5f93621
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
WATCHMAKER: Fix incorrect error message
Changed paths:
engines/watchmaker/init/nl_init.cpp
diff --git a/engines/watchmaker/init/nl_init.cpp b/engines/watchmaker/init/nl_init.cpp
index ebbd7b838de..37b8d9aff01 100644
--- a/engines/watchmaker/init/nl_init.cpp
+++ b/engines/watchmaker/init/nl_init.cpp
@@ -59,7 +59,7 @@ int LoadExternalText(Init *init, char *et) {
if ((line[0] == '/') && (line[1] == '/')) continue;
if ((len = strlen(line)) > 260)
- return ParseError("ExternalText: line too long! curlen %d (MAX 250)\n%s", line - 10, line);
+ return ParseError("ExternalText: line too long! curlen %d (MAX 250)\n%s", len - 10, line);
if (len < 2) continue;
Commit: bef3adce70cccb6cf3d9db23fdde34a157d01d05
https://github.com/scummvm/scummvm/commit/bef3adce70cccb6cf3d9db23fdde34a157d01d05
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
WINTERMUTE: Fix uninitialized variable warning
Changed paths:
engines/wintermute/base/gfx/xframe_node.cpp
diff --git a/engines/wintermute/base/gfx/xframe_node.cpp b/engines/wintermute/base/gfx/xframe_node.cpp
index c14b7640c64..90fc3c6813b 100644
--- a/engines/wintermute/base/gfx/xframe_node.cpp
+++ b/engines/wintermute/base/gfx/xframe_node.cpp
@@ -104,7 +104,7 @@ bool FrameNode::loadFromXData(const Common::String &filename, XModel *model, XFi
bool res = true;
// get the type of the object
- XClassType objectType;
+ XClassType objectType = kXClassUnknown;
res = xobj->getType(objectType);
if (objectType == kXClassMesh) { // load a child mesh
Commit: 1188e91b2a162b4db78c1aa12c620b24eed5d8a6
https://github.com/scummvm/scummvm/commit/1188e91b2a162b4db78c1aa12c620b24eed5d8a6
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
TRECISION: Fix uninitialized variable warnings
Changed paths:
engines/trecision/text.h
diff --git a/engines/trecision/text.h b/engines/trecision/text.h
index eb2871533f5..f0d48dc5f9e 100644
--- a/engines/trecision/text.h
+++ b/engines/trecision/text.h
@@ -33,11 +33,11 @@ namespace Trecision {
class TrecisionEngine;
struct StackText {
- uint16 _x;
- uint16 _y;
- uint16 _textColor;
+ uint16 _x = 0;
+ uint16 _y = 0;
+ uint16 _textColor = 0;
Common::String _text;
- bool _clear;
+ bool _clear = false;
};
class TextManager {
Commit: b9fb4e22ec6f25be693341f9d3f5e0a3213aadaf
https://github.com/scummvm/scummvm/commit/b9fb4e22ec6f25be693341f9d3f5e0a3213aadaf
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
SCI: Fix uninitialized variable warnings
Changed paths:
engines/sci/engine/savegame.cpp
engines/sci/engine/vm_types.h
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 8dd3a859093..553d8691ec0 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -778,7 +778,7 @@ void ArrayTable::saveLoadWithSerializer(Common::Serializer &ser) {
}
void SciArray::saveLoadWithSerializer(Common::Serializer &s) {
- uint16 savedSize;
+ uint16 savedSize = 0;
if (s.isSaving()) {
savedSize = _size;
@@ -1078,7 +1078,7 @@ void Video32::saveLoadWithSerializer(Common::Serializer &s) {
bool robotExists = _robotPlayer.getStatus() != RobotDecoder::kRobotStatusUninitialized;
s.syncAsByte(robotExists);
if (robotExists) {
- GuiResourceId robotId;
+ GuiResourceId robotId = 0;
reg_t planeId;
Common::Point position;
int16 priority, scale;
diff --git a/engines/sci/engine/vm_types.h b/engines/sci/engine/vm_types.h
index 6c222f77dc1..51457b17c57 100644
--- a/engines/sci/engine/vm_types.h
+++ b/engines/sci/engine/vm_types.h
@@ -38,8 +38,8 @@ enum {
struct reg_t {
// Segment and offset. These should never be accessed directly
- SegmentId _segment;
- uint16 _offset;
+ SegmentId _segment = 0;
+ uint16 _offset = 0;
SegmentId getSegment() const;
void setSegment(SegmentId segment);
Commit: 60467473f4eb2c8ec15976da9a7e5b17e0a3265d
https://github.com/scummvm/scummvm/commit/60467473f4eb2c8ec15976da9a7e5b17e0a3265d
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
SAGA: Silence uninitialized variable warnings
Changed paths:
engines/saga/script.h
diff --git a/engines/saga/script.h b/engines/saga/script.h
index 64852987491..5f1982f4db9 100644
--- a/engines/saga/script.h
+++ b/engines/saga/script.h
@@ -157,29 +157,29 @@ class ScriptThread {
public:
Common::Array<int16> _stackBuf;
- uint16 _stackTopIndex;
- uint16 _frameIndex;
+ uint16 _stackTopIndex = 0;
+ uint16 _frameIndex = 0;
uint16 _threadVars[kThreadVarMax];
- byte *_moduleBase; //
- uint16 _moduleBaseSize;
+ byte *_moduleBase = 0; //
+ uint16 _moduleBaseSize = 0;
- byte *_commonBase; //
- byte *_staticBase; //
- VoiceLUT *_voiceLUT; //
- StringsTable *_strings; //
+ byte *_commonBase = nullptr; //
+ byte *_staticBase = nullptr; //
+ VoiceLUT *_voiceLUT = nullptr; //
+ StringsTable *_strings = nullptr; //
- int _flags; // ThreadFlags
- int _waitType; // ThreadWaitTypes
- uint _sleepTime;
- void *_threadObj; // which object we're handling
+ int _flags = 0; // ThreadFlags
+ int _waitType = 0; // ThreadWaitTypes
+ uint _sleepTime = 0;
+ void *_threadObj = nullptr; // which object we're handling
- int16 _returnValue;
+ int16 _returnValue = 0;
- uint16 _instructionOffset; // Instruction offset
+ uint16 _instructionOffset = 0; // Instruction offset
- int32 _frameWait;
+ int32 _frameWait = 0;
enum {
THREAD_STACK_SIZE = 256
Commit: 6433d7c073229fa67dfe6c40e097ae180a89b051
https://github.com/scummvm/scummvm/commit/6433d7c073229fa67dfe6c40e097ae180a89b051
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
NANCY: Silence uninitialized variable warnings
Changed paths:
engines/nancy/util.cpp
diff --git a/engines/nancy/util.cpp b/engines/nancy/util.cpp
index 500a48e25f2..83149b92d2c 100644
--- a/engines/nancy/util.cpp
+++ b/engines/nancy/util.cpp
@@ -167,7 +167,7 @@ void readRectArray16(Common::Serializer &stream, Common::Array<Common::Rect> &in
}
void readFilename(Common::SeekableReadStream &stream, Common::String &inString) {
- char buf[33];
+ char buf[33] = "";
if (g_nancy->getGameType() <= kGameTypeNancy2) {
// Older games only support 8-character filenames, and stored them in a 10 char buffer
@@ -185,7 +185,7 @@ void readFilename(Common::SeekableReadStream &stream, Common::String &inString)
void readFilename(Common::Serializer &stream, Common::String &inString, Common::Serializer::Version minVersion, Common::Serializer::Version maxVersion) {
Common::Serializer::Version version = stream.getVersion();
if (version >= minVersion && version <= maxVersion) {
- char buf[33];
+ char buf[33] = "";
if (version <= kGameTypeNancy2) {
// Older games only support 8-character filenames, and stored them in a 10 char buffer
@@ -212,7 +212,7 @@ void readFilenameArray(Common::Serializer &stream, Common::Array<Common::String>
Common::Serializer::Version version = stream.getVersion();
if (version >= minVersion && version <= maxVersion) {
inArray.resize(num);
- char buf[33];
+ char buf[33] = "";
for (Common::String &str : inArray) {
if (version <= kGameTypeNancy2) {
Commit: 85ff162e1fe2c713c6b5af0ef9aadc886885ebb8
https://github.com/scummvm/scummvm/commit/85ff162e1fe2c713c6b5af0ef9aadc886885ebb8
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
NANCY: Remove unused variable
Changed paths:
engines/nancy/video.h
diff --git a/engines/nancy/video.h b/engines/nancy/video.h
index 358706586a7..93db53aa6c4 100644
--- a/engines/nancy/video.h
+++ b/engines/nancy/video.h
@@ -88,8 +88,6 @@ private:
bool decode(byte *outBuf, uint32 frameSize, Common::ReadStream &inBuf) const;
- const AVFDecoder *_owner;
-
Common::SeekableReadStream *_fileStream;
Graphics::PixelFormat _pixelFormat;
uint _width, _height, _depth, _frameSize;
Commit: 7e3de05c408e37d5e0a26015ef8f867b6dfe6f42
https://github.com/scummvm/scummvm/commit/7e3de05c408e37d5e0a26015ef8f867b6dfe6f42
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-10-28T16:19:35+03:00
Commit Message:
AGS: Fix triple delete of bitmap buffer
Changed paths:
engines/ags/plugins/ags_blend/ags_blend.cpp
diff --git a/engines/ags/plugins/ags_blend/ags_blend.cpp b/engines/ags/plugins/ags_blend/ags_blend.cpp
index 0220a33ee75..311c4ccdd34 100644
--- a/engines/ags/plugins/ags_blend/ags_blend.cpp
+++ b/engines/ags/plugins/ags_blend/ags_blend.cpp
@@ -351,8 +351,6 @@ void AGSBlend::Blur(ScriptMethodParams ¶ms) {
delete[] Dest;
delete[] Temp;
_engine->ReleaseBitmapSurface(src);
- delete srclongbuffer;
- delete srccharbuffer;
params._result = 0;
}
More information about the Scummvm-git-logs
mailing list