aboutsummaryrefslogtreecommitdiff
path: root/engines/toon
diff options
context:
space:
mode:
Diffstat (limited to 'engines/toon')
-rw-r--r--engines/toon/audio.cpp2
-rw-r--r--engines/toon/character.cpp2
-rw-r--r--engines/toon/detection.cpp9
-rw-r--r--engines/toon/path.cpp9
-rw-r--r--engines/toon/script_func.h2
-rw-r--r--engines/toon/toon.cpp16
6 files changed, 21 insertions, 19 deletions
diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp
index b9adfa7eeb..77822ab078 100644
--- a/engines/toon/audio.cpp
+++ b/engines/toon/audio.cpp
@@ -514,7 +514,7 @@ Common::SeekableReadStream *AudioStreamPackage::getStream(int32 id, bool ownMemo
int32 size = 0;
getInfo(id, &offset, &size);
if (ownMemory) {
- byte *memory = (byte*)malloc(size);
+ byte *memory = (byte *)malloc(size);
_file->seek(offset);
_file->read(memory, size);
return new Common::MemoryReadStream(memory, size, DisposeAfterUse::YES);
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index 715bd33433..0e5189957b 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -997,7 +997,7 @@ bool Character::loadShadowAnimation(const Common::String &animName) {
void Character::plotPath(Graphics::Surface& surface) {
for (int i = 0; i < _currentPathNodeCount; i++) {
- *(byte*)surface.getBasePtr(_currentPathX[i], _currentPathY[i]) = ( i < _currentPathNode);
+ *(byte *)surface.getBasePtr(_currentPathX[i], _currentPathY[i]) = ( i < _currentPathNode);
}
}
diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp
index 6a76ade90a..8234934972 100644
--- a/engines/toon/detection.cpp
+++ b/engines/toon/detection.cpp
@@ -79,6 +79,15 @@ static const ADGameDescription gameDescriptions[] = {
{
"toon", "",
{
+ {"local.pak", 0, "48ec60709bebbdeff791d55ee18ec910", 3417846},
+ {"arcaddbl.svl", 0, "1d1b96e317e03ffd3874a8ebe59556f3", 6246232},
+ {"study.svl", 0, "d4aff126ee27be3c3d25e2996369d7cb", 2324368},
+ },
+ Common::RU_RUS, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO0()
+ },
+ {
+ "toon", "",
+ {
{"local.pak", 0, "bf5da4c03f78ffbd643f12122319366e", 3250841},
{"wacexdbl.emc", 0, "cfbc2156a31b294b038204888407ebc8", 6974},
{"generic.svl", 0, "5eb99850ada22f0b8cf6392262d4dd07", 9404599},
diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp
index 60ca007930..2dd5fc45e2 100644
--- a/engines/toon/path.cpp
+++ b/engines/toon/path.cpp
@@ -322,9 +322,10 @@ int32 PathFinding::findPath(int32 x, int32 y, int32 destx, int32 desty) {
int32 endY = MIN<int32>(curY + 1, _height - 1);
int32 startX = MAX<int32>(curX - 1, 0);
int32 startY = MAX<int32>(curY - 1, 0);
+ bool next = false;
- for (int32 px = startX; px <= endX; px++) {
- for (int py = startY; py <= endY; py++) {
+ for (int32 px = startX; px <= endX && !next; px++) {
+ for (int py = startY; py <= endY && !next; py++) {
if (px != curX || py != curY) {
wei = ((abs(px - curX) + abs(py - curY)));
@@ -336,7 +337,7 @@ int32 PathFinding::findPath(int32 x, int32 y, int32 destx, int32 desty) {
sq[curPNode] = sum;
_heap->push(px, py, sq[curPNode] + newWeight);
if (!newWeight)
- goto next; // we found it !
+ next = true; // we found it !
}
}
}
@@ -344,8 +345,6 @@ int32 PathFinding::findPath(int32 x, int32 y, int32 destx, int32 desty) {
}
}
-next:
-
// let's see if we found a result !
if (!_gridTemp[destx + desty * _width]) {
// didn't find anything
diff --git a/engines/toon/script_func.h b/engines/toon/script_func.h
index ef1cb59f47..e22c4b34fa 100644
--- a/engines/toon/script_func.h
+++ b/engines/toon/script_func.h
@@ -39,7 +39,7 @@ public:
Common::Array<const OpcodeV2 *> _opcodes;
ToonEngine *_vm;
-#define SYSFUNC(x) int32 x(EMCState*)
+#define SYSFUNC(x) int32 x(EMCState *)
SYSFUNC(sys_Cmd_Dummy);
SYSFUNC(sys_Cmd_Change_Actor_X_And_Y);
SYSFUNC(sys_Cmd_Init_Talking_Character);
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 13f702e3dd..657e18635f 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -2297,8 +2297,7 @@ void ToonEngine::processConversationClick(Conversation *conv, int32 status) {
if (v8 == -1) {
_gameState->_mouseHidden = false;
} else {
-retry:
- while (1) {
+ while (v8 != -1) {
v7 += 1;
int16 *v14 = (int16 *)((char *)_conversationData + v8);
@@ -2315,15 +2314,10 @@ retry:
v8 = READ_LE_INT16(v7);
if (v8 == -1)
return;
-
- goto retry;
+ else
+ break; // restarts while loop;
}
}
-
- if (v8 != -1)
- continue;
-
- break;
}
}
}
@@ -4672,11 +4666,11 @@ void ToonEngine::addDirtyRect( int32 left, int32 top, int32 right, int32 bottom
top = MIN<int32>(MAX<int32>(top, 0), TOON_BACKBUFFER_HEIGHT);
bottom = MIN<int32>(MAX<int32>(bottom, 0), TOON_BACKBUFFER_HEIGHT);
- Common::Rect rect(left, top, right, bottom);
-
if (bottom - top <= 0 || right - left <= 0)
return;
+ Common::Rect rect(left, top, right, bottom);
+
for (uint32 i = 0; i < _dirtyRects.size(); i++) {
if (_dirtyRects[i].contains(rect))
return;