[Scummvm-cvs-logs] scummvm master -> 3c76acf4451bdfcc15a940b32a1e86b517f43f46

Strangerke Strangerke at scummvm.org
Sun Mar 9 15:15:38 CET 2014


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:
3c76acf445 TUCKER: Some renaming in Graphics


Commit: 3c76acf4451bdfcc15a940b32a1e86b517f43f46
    https://github.com/scummvm/scummvm/commit/3c76acf4451bdfcc15a940b32a1e86b517f43f46
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-03-09T15:13:56+01:00

Commit Message:
TUCKER: Some renaming in Graphics

Changed paths:
    engines/tucker/graphics.cpp
    engines/tucker/graphics.h
    engines/tucker/resource.cpp
    engines/tucker/tucker.cpp



diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp
index 5e3d989..b9c184e 100644
--- a/engines/tucker/graphics.cpp
+++ b/engines/tucker/graphics.cpp
@@ -163,13 +163,13 @@ void Graphics::copyRect(uint8 *dst, int dstPitch, uint8 *src, int srcPitch, int
 }
 
 void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 chr, uint8 chrColor, const uint8 *src) {
-	if (chr < 32 || chr - 32 >= _charset.xCount * _charset.yCount) {
+	if (chr < 32 || chr - 32 >= _charset._xCount * _charset._yCount) {
 		return;
 	}
-	const int h = MIN(_charset.charH, 200 - yDst);
-	const int w = MIN(_charset.charW, pitch - xDst);
+	const int h = MIN(_charset._charH, 200 - yDst);
+	const int w = MIN(_charset._charW, pitch - xDst);
 	dst += yDst * pitch + xDst;
-	int offset = (chr - 32) * _charset.charH * _charset.charW;
+	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++];
@@ -189,22 +189,22 @@ void Graphics::setCharset(CharsetType type) {
 	_charsetType = type;
 	switch (type) {
 	case kCharsetTypeDefault:
-		_charset.charW = 10;
-		_charset.charH = 10;
-		_charset.xCount = 32;
-		_charset.yCount = 7;
+		_charset._charW = 10;
+		_charset._charH = 10;
+		_charset._xCount = 32;
+		_charset._yCount = 7;
 		break;
 	case kCharsetTypeEng:
-		_charset.charW = 10;
-		_charset.charH = 8;
-		_charset.xCount = 32;
-		_charset.yCount = 3;
+		_charset._charW = 10;
+		_charset._charH = 8;
+		_charset._xCount = 32;
+		_charset._yCount = 3;
 		break;
 	case kCharsetTypeCredits:
-		_charset.charW = 19;
-		_charset.charH = 10;
-		_charset.xCount = 16;
-		_charset.yCount = 7;
+		_charset._charW = 19;
+		_charset._charH = 10;
+		_charset._xCount = 16;
+		_charset._yCount = 7;
 		break;
 	}
 }
diff --git a/engines/tucker/graphics.h b/engines/tucker/graphics.h
index 3e27451..3e48179 100644
--- a/engines/tucker/graphics.h
+++ b/engines/tucker/graphics.h
@@ -34,16 +34,14 @@ enum CharsetType {
 };
 
 struct Charset {
-	int charW;
-	int charH;
-	int xCount;
-	int yCount;
+	int _charW;
+	int _charH;
+	int _xCount;
+	int _yCount;
 };
 
 class Graphics {
 public:
-
-
 	static int encodeRLE(const uint8 *src, uint8 *dst, int w, int h);
 	static int encodeRAW(const uint8 *src, uint8 *dst, int w, int h);
 
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index b031152..dfb5c9b 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -351,11 +351,11 @@ void TuckerEngine::loadCharset2() {
 }
 
 void TuckerEngine::loadCharsetHelper() {
-	const int charW = Graphics::_charset.charW;
-	const int charH = Graphics::_charset.charH;
+	const int charW = Graphics::_charset._charW;
+	const int charH = Graphics::_charset._charH;
 	int offset = 0;
-	for (int y = 0; y < Graphics::_charset.yCount; ++y) {
-		for (int x = 0; x < Graphics::_charset.xCount; ++x) {
+	for (int y = 0; y < Graphics::_charset._yCount; ++y) {
+		for (int x = 0; x < Graphics::_charset._xCount; ++x) {
 			offset += Graphics::encodeRAW(_loadTempBuf + (y * 320) * charH + x * charW, _charsetGfxBuf + offset, charW, charH);
 		}
 	}
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 0fae8aa..1d38d0f 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -2849,7 +2849,7 @@ void TuckerEngine::drawStringInteger(int num, int x, int y, int digits) {
 		Graphics::drawStringChar(_locationBackgroundGfxBuf, _scrollOffset + x, y, 640, numStr[i], 102, _charsetGfxBuf);
 		x += 8;
 	}
-	addDirtyRect(_scrollOffset + x, y, Graphics::_charset.charW * 3, Graphics::_charset.charH);
+	addDirtyRect(_scrollOffset + x, y, Graphics::_charset._charW * 3, Graphics::_charset._charH);
 }
 
 void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int strLen) {
@@ -2861,7 +2861,7 @@ void TuckerEngine::drawStringAlt(int x, int y, int color, const uint8 *str, int
 		x += _charWidthTable[chr];
 		++pos;
 	}
-	addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH);
+	addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH);
 }
 
 void TuckerEngine::drawItemString(int x, int num, const uint8 *str) {
@@ -3824,7 +3824,7 @@ void TuckerEngine::drawSpeechTextLine(const uint8 *dataPtr, int pos, int count,
 		x += _charWidthTable[dataPtr[pos]];
 		++pos;
 	}
-	addDirtyRect(xStart, y, x - xStart, Graphics::_charset.charH);
+	addDirtyRect(xStart, y, x - xStart, Graphics::_charset._charH);
 }
 
 void TuckerEngine::redrawScreen(int offset) {






More information about the Scummvm-git-logs mailing list