[Scummvm-git-logs] scummvm master -> 47eda4bcf76252b2c9be2427c897884449073394

bonki bonki at users.noreply.github.com
Wed Feb 7 19:49:21 CET 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
47eda4bcf7 TUCKER: Fix clipping handling when drawing text


Commit: 47eda4bcf76252b2c9be2427c897884449073394
    https://github.com/scummvm/scummvm/commit/47eda4bcf76252b2c9be2427c897884449073394
Author: Adrian Frühwirth (bonki at users.noreply.github.com)
Date: 2018-02-07T19:48:11+01:00

Commit Message:
TUCKER: Fix clipping handling when drawing text

Fixes Trac#10422.

Changed paths:
    engines/tucker/graphics.cpp


diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp
index b9c184e..64ec81c 100644
--- a/engines/tucker/graphics.cpp
+++ b/engines/tucker/graphics.cpp
@@ -170,10 +170,10 @@ void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 c
 	const int w = MIN(_charset._charW, pitch - xDst);
 	dst += yDst * pitch + xDst;
 	int offset = (chr - 32) * _charset._charH * _charset._charW;
-	for (int y = 0; y < h; ++y) {
-		for (int x = 0; x < w; ++x) {
-			const int color = src[offset++];
-			if (color != 0) {
+	for (int y = 0; y < _charset._charH; ++y) {
+		for (int x = 0; x < _charset._charW; ++x, ++offset) {
+			const int color = src[offset];
+			if (y < h && x < w && color != 0) {
 				if (_charsetType == kCharsetTypeCredits) {
 					dst[x] = color;
 				} else {





More information about the Scummvm-git-logs mailing list