[Scummvm-cvs-logs] CVS: scummvm/scumm script_v8.cpp,2.43,2.44
Max Horn
fingolfin at users.sourceforge.net
Wed Dec 25 12:17:02 CET 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,1.93,1.94 nut_renderer.cpp,1.4,1.5 nut_renderer.h,1.1,1.2 script.cpp,1.26,1.27 script_v8.cpp,2.42,2.43
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.27,1.28 script_v8.cpp,2.44,2.45 scumm.h,1.104,1.105
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv1666
Modified Files:
script_v8.cpp
Log Message:
text center mode hack
Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.43
retrieving revision 2.44
diff -u -d -r2.43 -r2.44
--- script_v8.cpp 25 Dec 2002 20:07:09 -0000 2.43
+++ script_v8.cpp 25 Dec 2002 20:15:54 -0000 2.44
@@ -527,7 +527,7 @@
break;
case 0xD1: {
- byte buffer[1024];
+ char buffer[1024];
_messagePtr = _scriptPointer;
if (_messagePtr[0] == '/') {
@@ -552,10 +552,10 @@
// _sound->_talkChannel = _sound->playBundleSound(pointer);
_messagePtr = _transText;
- _msgPtrToAdd = buffer;
+ _msgPtrToAdd = (byte *)buffer;
_messagePtr = addMessageToStack(_messagePtr);
} else {
- _msgPtrToAdd = buffer;
+ _msgPtrToAdd = (byte *)buffer;
_scriptPointer = _messagePtr = addMessageToStack(_messagePtr);
}
@@ -563,7 +563,20 @@
loadCharset(_string[m].charset);
if (_fr[_string[m].charset] != NULL) {
- _fr[_string[m].charset]->drawString((char *)buffer, (int)_string[m].xpos, (int)_string[m].ypos, (unsigned char)_string[m].color, 0);
+ int x = _string[m].xpos;
+ // HACK - center mode. I call this a hack because we really should
+ // not duplicate all the string code from string.cpp. Rather, maybe
+ // abstract away the code in string.cpp from using the 'charset'
+ // fonts, and allow it to work both with old and new fonts. To this
+ // end, we should seperate the parts of Charset/_charset which are
+ // for bookkeeping (like x_pos, center mode etc.) and those that are
+ // for rendering. Then let the old (think printCharOld), medium (printChar),
+ // new (NUT) style renderers be subclasses of a common base class (which
+ // defines the API). This will clean up the code, and allow us to reuse
+ // the string logic in string.cpp.
+ if (_string[m].center)
+ x -= _fr[_string[m].charset]->getStringWidth(buffer) / 2;
+ _fr[_string[m].charset]->drawString(buffer, x, _string[m].ypos, _string[m].color, 0);
}
break;
}
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,1.93,1.94 nut_renderer.cpp,1.4,1.5 nut_renderer.h,1.1,1.2 script.cpp,1.26,1.27 script_v8.cpp,2.42,2.43
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.27,1.28 script_v8.cpp,2.44,2.45 scumm.h,1.104,1.105
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list