[Scummvm-cvs-logs] SF.net SVN: scummvm:[43194] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon Aug 10 03:33:18 CEST 2009
Revision: 43194
http://scummvm.svn.sourceforge.net/scummvm/?rev=43194&view=rev
Author: lordhoto
Date: 2009-08-10 01:33:18 +0000 (Mon, 10 Aug 2009)
Log Message:
-----------
Fix text color in character speeches in Kyra1 amiga.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/text.cpp
scummvm/trunk/engines/kyra/text.h
Modified: scummvm/trunk/engines/kyra/text.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text.cpp 2009-08-10 01:32:59 UTC (rev 43193)
+++ scummvm/trunk/engines/kyra/text.cpp 2009-08-10 01:33:18 UTC (rev 43194)
@@ -200,6 +200,10 @@
_screen->copyRegion(_talkCoords.x, _talkMessageY, _talkCoords.x, _talkCoords.y, _talkCoords.w, _talkMessageH, srcPage, dstPage, Screen::CR_NO_P_CHECK);
int curPage = _screen->_curPage;
_screen->_curPage = srcPage;
+
+ if (_vm->gameFlags().platform == Common::kPlatformAmiga)
+ setTextColor(color);
+
for (int i = 0; i < lineCount; ++i) {
top = i * 10 + _talkMessageY;
char *msg = &_talkSubstrings[i * TALK_SUBSTRING_LEN];
@@ -248,7 +252,7 @@
}
void TextDisplayer::printCharacterText(const char *text, int8 charNum, int charX) {
- uint8 colorTable[] = {0x0F, 0x9, 0x0C9, 0x80, 0x5, 0x81, 0x0E, 0xD8, 0x55, 0x3A, 0x3a};
+ uint8 colorTable[] = {0x0F, 0x09, 0xC9, 0x80, 0x5, 0x81, 0x0E, 0xD8, 0x55, 0x3A, 0x3a};
int top, left, x1, x2, w, x;
char *msg;
@@ -259,6 +263,9 @@
x = charX;
calcWidestLineBounds(x1, x2, w, x);
+ if (_vm->gameFlags().platform == Common::kPlatformAmiga)
+ setTextColor(color);
+
for (int i = 0; i < lineCount; ++i) {
top = i * 10 + _talkMessageY;
msg = &_talkSubstrings[i * TALK_SUBSTRING_LEN];
@@ -266,4 +273,91 @@
printText(msg, left, top, color, 0xC, 0);
}
}
+
+void TextDisplayer::setTextColor(uint8 color) {
+ byte r, g, b;
+
+ switch (color) {
+ case 4:
+ // 0x09E
+ r = 0;
+ g = 36;
+ b = 56;
+ break;
+
+ case 5:
+ // 0xFF5
+ r = 60;
+ g = 60;
+ b = 20;
+ break;
+
+ case 27:
+ // 0x5FF
+ r = 20;
+ g = 60;
+ b = 60;
+ break;
+
+ case 34:
+ // 0x8E5
+ r = 32;
+ g = 56;
+ b = 20;
+ break;
+
+ case 58:
+ // 0x9FB
+ r = 36;
+ g = 60;
+ b = 44;
+ break;
+
+ case 85:
+ // 0x7CF
+ r = 28;
+ g = 48;
+ b = 60;
+ break;
+
+ case 114:
+ case 117:
+ // 0xFAF
+ r = 60;
+ g = 40;
+ b = 60;
+ break;
+
+ case 128:
+ case 129:
+ // 0xFCC
+ r = 60;
+ g = 48;
+ b = 48;
+ break;
+
+ case 201:
+ // 0xFD8
+ r = 60;
+ g = 52;
+ b = 32;
+ break;
+
+ case 216:
+ // 0xFC6
+ r = 60;
+ g = 48;
+ b = 24;
+ break;
+
+ default:
+ // 0xEEE
+ r = 56;
+ g = 56;
+ b = 56;
+ }
+
+ _screen->setPaletteIndex(0x10, r, g, b);
+}
+
} // end of namespace Kyra
Modified: scummvm/trunk/engines/kyra/text.h
===================================================================
--- scummvm/trunk/engines/kyra/text.h 2009-08-10 01:32:59 UTC (rev 43193)
+++ scummvm/trunk/engines/kyra/text.h 2009-08-10 01:33:18 UTC (rev 43194)
@@ -66,6 +66,9 @@
uint16 y, x, w;
};
+ // TODO: AMIGA and LoK specific, move to a better location
+ void setTextColor(uint8 color);
+
enum {
TALK_SUBSTRING_LEN = 80,
TALK_SUBSTRING_NUM = 6
@@ -76,6 +79,7 @@
TalkCoords _talkCoords;
bool _talkMessagePrinted;
};
+
} // end of namespace Kyra
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list