[Scummvm-cvs-logs] CVS: scummvm/sky skydefs.h,1.3,1.4 text.cpp,1.6,1.7 text.h,1.2,1.3
Joost Peters
joostp at users.sourceforge.net
Mon Apr 14 10:27:10 CEST 2003
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv32653/sky
Modified Files:
skydefs.h text.cpp text.h
Log Message:
fixed misimplementation of fnSetFont()
Index: skydefs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/skydefs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- skydefs.h 7 Mar 2003 14:52:24 -0000 1.3
+++ skydefs.h 14 Apr 2003 17:26:41 -0000 1.4
@@ -49,6 +49,8 @@
//item list defines
#define section_0_item 119
+#define MAIN_CHAR_HEIGHT 12
+
#define c_base_mode 0
#define c_base_mode56 56
#define c_action_mode 4
Index: text.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/text.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- text.cpp 8 Apr 2003 12:19:14 -0000 1.6
+++ text.cpp 14 Apr 2003 17:26:42 -0000 1.7
@@ -28,7 +28,6 @@
#define FIRST_TEXT_SEC 77
#define NO_OF_TEXT_SECTIONS 8 // 8 sections per language
#define CHAR_SET_FILE 60150
-#define SET_FONT_DATA_SIZE 12
#define MAX_SPEECH_SECTION 7
SkyText::SkyText(SkyDisk *skyDisk, uint32 gameVersion) {
@@ -36,11 +35,19 @@
_gameVersion = gameVersion;
_mainCharacterSet.addr = _skyDisk->loadFile(CHAR_SET_FILE, NULL);
+ _mainCharacterSet.charHeight = MAIN_CHAR_HEIGHT;
+ _mainCharacterSet.charSpacing = 0;
+
fnSetFont(0);
if (!SkyState::isDemo(_gameVersion)) {
_controlCharacterSet.addr = _skyDisk->loadFile(60520, NULL);
+ _controlCharacterSet.charHeight = 12;
+ _controlCharacterSet.charSpacing = 1;
+
_linkCharacterSet.addr = _skyDisk->loadFile(60521, NULL);
+ _linkCharacterSet.charHeight = 12;
+ _linkCharacterSet.charSpacing = 0;
}
if (SkyState::isCDVersion(_gameVersion)) {
@@ -49,11 +56,27 @@
}
void SkyText::fnSetFont(uint32 fontNr) {
+
+ struct charSet *newCharSet;
+
+ switch (fontNr) {
+ case 0:
+ newCharSet = &_mainCharacterSet;
+ break;
+ case 1:
+ newCharSet = &_controlCharacterSet;
+ break;
+ case 2:
+ newCharSet = &_linkCharacterSet;
+ break;
+ default:
+ error("Tried to set invalid font (%d)", fontNr);
+ }
+
_curCharSet = fontNr;
- byte *charSetPtr = _mainCharacterSet.addr + (fontNr * SET_FONT_DATA_SIZE);
- _characterSet = READ_LE_UINT32(charSetPtr);
- _charHeight = READ_LE_UINT32(charSetPtr + 4);
- _dtCharSpacing = READ_LE_UINT32(charSetPtr + 8);
+ _characterSet = newCharSet->addr;
+ _charHeight = newCharSet->charHeight;
+ _dtCharSpacing = newCharSet->charSpacing;
}
void SkyText::getText(uint32 textNr, void **itemList, uint16 language) { //load text #"textNr" into textBuffer
Index: text.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/text.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- text.h 8 Apr 2003 12:19:15 -0000 1.2
+++ text.h 14 Apr 2003 17:26:42 -0000 1.3
@@ -43,18 +43,20 @@
struct charSet {
uint8 *addr;
uint32 charHeight;
- uint32 thirdVal;
+ uint32 charSpacing;
} _mainCharacterSet, _linkCharacterSet, _controlCharacterSet;
uint32 _curCharSet;
- uint32 _characterSet;
+ uint8 *_characterSet;
uint32 _charHeight;
uint8 *_preAfterTableArea;
uint8 _textBuffer[1024];
-
+ uint8 _centreTable[40];
+
uint8 *_mouseTextData; //space for the mouse text
- uint32 _dtLineWidth; //width of line in pixels
+ uint8 _dlCol;
+ uint16 _dtLineWidth; //width of line in pixels
uint32 _dtLines; //no of lines to do
uint32 _dtLineSize; //size of one line in bytes
uint8 *_dtData; //address of textdata
@@ -62,7 +64,7 @@
uint8 *_dtText; //pointer to text
uint32 _dtCharSpacing; //character seperation adjustment
uint32 _dtWidth; //width of chars in last line (for editing (?))
- uint32 _dtCentre; //set for centre text
+ bool _dtCentre; //set for centre text
};
class SkyText_v00267 : public SkyText {
More information about the Scummvm-git-logs
mailing list