diff options
author | BLooperZ | 2019-10-15 23:35:01 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-18 02:02:14 +0100 |
commit | e87e18052c517737c7327ada531fb737fafa5ef4 (patch) | |
tree | 5fe5fba95e6d15ccee17fbb4676a00c025b431aa | |
parent | a2a4278c0f31f6a0134227c102fc90c0bb7bf7e4 (diff) | |
download | scummvm-rg350-e87e18052c517737c7327ada531fb737fafa5ef4.tar.gz scummvm-rg350-e87e18052c517737c7327ada531fb737fafa5ef4.tar.bz2 scummvm-rg350-e87e18052c517737c7327ada531fb737fafa5ef4.zip |
TOON: fix types + remove unused import
-rw-r--r-- | engines/toon/movie.cpp | 14 | ||||
-rw-r--r-- | engines/toon/subtitles.cpp | 2 | ||||
-rw-r--r-- | engines/toon/toon.cpp | 2 | ||||
-rw-r--r-- | engines/toon/toon.h | 3 |
4 files changed, 10 insertions, 11 deletions
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); |