DIRECTOR: Integer comparison fixes

This commit is contained in:
Roland van Laar 2020-08-16 21:46:36 +02:00
parent c187d1835a
commit 062bf46ee5
4 changed files with 7 additions and 7 deletions

View File

@ -1136,7 +1136,7 @@ void Cast::loadCastInfo(Common::SeekableReadStreamEndian &stream, uint16 id) {
int16 count = entryStream->readUint16();
for (uint i = 0; i < count; i++)
for (int16 i = 0; i < count; i++)
ci->scriptStyle.read(*entryStream);
delete entryStream;
}

View File

@ -1517,7 +1517,7 @@ void LingoArchive::addNamesV4(Common::SeekableReadStreamEndian &stream) {
uint16 offset = stream.readUint16();
uint16 count = stream.readUint16();
if (stream.size() != size) {
if ((uint32)stream.size() != size) {
warning("Lnam content missing");
return;
}
@ -1526,7 +1526,7 @@ void LingoArchive::addNamesV4(Common::SeekableReadStreamEndian &stream) {
names.clear();
for (uint32 i = 0; i < count; i++) {
for (uint16 i = 0; i < count; i++) {
Common::String name = stream.readPascalString();
names.push_back(name);

View File

@ -254,7 +254,7 @@ void Window::inkBlitSurface(DirectorPlotData *pd, Common::Rect &srcRect, const G
for (int j = 0; j < pd->destRect.width(); j++, pd->srcPoint.x++) {
if (!mask || (msk && (pd->ink == kInkTypeMask ? *msk++ : !(*msk++)))) {
(g_director->getInkDrawPixel())(pd->destRect.left + j, pd->destRect.top + i,
preprocessColor(pd, *((uint32 *)pd->srf->getBasePtr(pd->srcPoint.x, pd->srcPoint.y))), pd);
preprocessColor(pd, *((int *)pd->srf->getBasePtr(pd->srcPoint.x, pd->srcPoint.y))), pd);
}
}
}
@ -292,14 +292,14 @@ void Window::inkBlitStretchSurface(DirectorPlotData *pd, Common::Rect &srcRect,
for (int xCtr = 0, scaleXCtr = 0; xCtr < pd->destRect.width(); xCtr++, scaleXCtr += scaleX, pd->srcPoint.x++) {
if (!mask || (msk && (pd->ink == kInkTypeMask ? *msk++ : !(*msk++)))) {
(g_director->getInkDrawPixel())(pd->destRect.left + xCtr, pd->destRect.top + i,
preprocessColor(pd, *((uint32 *)pd->srf->getBasePtr(scaleXCtr / SCALE_THRESHOLD, scaleYCtr / SCALE_THRESHOLD))), pd);
preprocessColor(pd, *((int *)pd->srf->getBasePtr(scaleXCtr / SCALE_THRESHOLD, scaleYCtr / SCALE_THRESHOLD))), pd);
}
}
}
}
}
int Window::preprocessColor(DirectorPlotData *p, uint32 src) {
int Window::preprocessColor(DirectorPlotData *p, int src) {
// HACK: Right now this method is just used for adjusting the colourization on text
// sprites, as it would be costly to colourize the chunks on the fly each
// time a section needs drawing. It's ugly but mostly works.

View File

@ -185,7 +185,7 @@ private:
bool _titleVisible;
private:
int preprocessColor(DirectorPlotData *p, uint32 src);
int preprocessColor(DirectorPlotData *p, int src);
void inkBlitFrom(Channel *channel, Common::Rect destRect, Graphics::ManagedSurface *blitTo = nullptr);
void inkBlitShape(DirectorPlotData *pd, Common::Rect &srcRect);