From e87e18052c517737c7327ada531fb737fafa5ef4 Mon Sep 17 00:00:00 2001 From: BLooperZ Date: Tue, 15 Oct 2019 23:35:01 +0300 Subject: TOON: fix types + remove unused import --- engines/toon/movie.cpp | 14 +++++++------- engines/toon/subtitles.cpp | 2 +- engines/toon/toon.cpp | 2 +- engines/toon/toon.h | 3 +-- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'engines/toon') diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp index d8c3ed4a9f..a706456c91 100644 --- a/engines/toon/movie.cpp +++ b/engines/toon/movie.cpp @@ -122,17 +122,17 @@ void Movie::playVideo(bool isFirstIntroVideo) { int32 currentFrame = _decoder->getCurFrame(); // find unused color key to replace with subtitles color - int len = frame->w * frame->h; - const byte* pixels = (const byte *)frame->getPixels(); - byte counts[256]; - memset(counts, 0, sizeof(counts)); - for (int i = 0; i < len; i++) { - counts[pixels[i]] = 1; + uint len = frame->w * frame->h; + const byte *pixels = (const byte *)frame->getPixels(); + bool counts[256]; + memset(counts, false, sizeof(counts)); + for (uint i = 0; i < len; i++) { + counts[pixels[i]] = true; } // 0 is already used for the border color and should not be used here, so it can be skipped over. for (int j = 1; j < 256; j++) { - if (counts[j] == 0) { + if (!counts[j]) { unused = j; break; } diff --git a/engines/toon/subtitles.cpp b/engines/toon/subtitles.cpp index 7fb58458a6..51811808df 100644 --- a/engines/toon/subtitles.cpp +++ b/engines/toon/subtitles.cpp @@ -53,7 +53,7 @@ void SubtitleRenderer::render(const Graphics::Surface &frame, uint32 frameNumber if (_index > _last) { return; } - _currentLine = (char*)_fileData + _tw[_index].foffset; + _currentLine = (char *)_fileData + _tw[_index].foffset; } if (frameNumber < _tw[_index].fstart) { diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 40b19c0d37..2407966567 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -3297,7 +3297,7 @@ void ToonEngine::drawConversationLine() { } } -void ToonEngine::drawCustomText(int16 x, int16 y, char *line, Graphics::Surface *frame, char color) { +void ToonEngine::drawCustomText(int16 x, int16 y, char *line, Graphics::Surface *frame, byte color) { if (line) { byte col = color; // 0xce _fontRenderer->setFontColor(0, col, col); diff --git a/engines/toon/toon.h b/engines/toon/toon.h index cfb12a7716..1d693873f6 100644 --- a/engines/toon/toon.h +++ b/engines/toon/toon.h @@ -33,7 +33,6 @@ #include "toon/state.h" #include "toon/picture.h" #include "toon/anim.h" -#include "toon/subtitles.h" #include "toon/movie.h" #include "toon/font.h" #include "toon/text.h" @@ -212,7 +211,7 @@ public: void playRoomMusic(); void waitForScriptStep(); void doMagnifierEffect(); - void drawCustomText(int16 x, int16 y, char *line, Graphics::Surface *frame, char color); + void drawCustomText(int16 x, int16 y, char *line, Graphics::Surface *frame, byte color); bool canSaveGameStateCurrently(); bool canLoadGameStateCurrently(); void pauseEngineIntern(bool pause); -- cgit v1.2.3