TOON: fix types + remove unused import

This commit is contained in:
BLooperZ 2019-10-15 23:35:01 +03:00 committed by Eugene Sandulenko
parent a2a4278c0f
commit e87e18052c
4 changed files with 10 additions and 11 deletions

View File

@ -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;
}

View File

@ -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) {

View File

@ -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);

View File

@ -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);