aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1/text.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-04-28 07:27:53 +0000
committerTorbjörn Andersson2007-04-28 07:27:53 +0000
commite005b0f42e491de6090a01b8682bbcfe9fa83d5b (patch)
treec3a22939cbe9dcc9ef4073da188a5e9b4917f63a /engines/sword1/text.cpp
parent806aadbd75c96351905ddd9e171447ad44f97739 (diff)
downloadscummvm-rg350-e005b0f42e491de6090a01b8682bbcfe9fa83d5b.tar.gz
scummvm-rg350-e005b0f42e491de6090a01b8682bbcfe9fa83d5b.tar.bz2
scummvm-rg350-e005b0f42e491de6090a01b8682bbcfe9fa83d5b.zip
This is an updated and slightly cleaned up version of patch #1657061 ("SWORD1:
Cutscene subtitles"). It still has the deficiencies listen in the patch tracker and should therefore be considered work-in-progress, but sev said I should go ahead and commit it anyway. I have no further plans for it right now, so feel free to improve on it. svn-id: r26644
Diffstat (limited to 'engines/sword1/text.cpp')
-rw-r--r--engines/sword1/text.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp
index 3b28ed5691..f55eed52b0 100644
--- a/engines/sword1/text.cpp
+++ b/engines/sword1/text.cpp
@@ -34,9 +34,6 @@ namespace Sword1 {
#define OVERLAP 3
#define SPACE ' '
-#define BORDER_COL 200
-#define LETTER_COL 193
-#define NO_COL 0 // sprite background - 0 for transparency
#define MAX_LINES 30
@@ -49,14 +46,13 @@ Text::Text(ObjectMan *pObjMan, ResMan *pResMan, bool czechVersion) {
_joinWidth = charWidth( SPACE ) - 2 * OVERLAP;
_charHeight = _resMan->getUint16(_resMan->fetchFrame(_font, 0)->height); // all chars have the same height
- _textBlocks[0] = _textBlocks[1] = NULL;
+ for (int i = 0; i < MAX_TEXT_OBS; i++)
+ _textBlocks[i] = NULL;
}
Text::~Text(void) {
- if (_textBlocks[0])
- free(_textBlocks[0]);
- if (_textBlocks[1])
- free(_textBlocks[1]);
+ for (int i = 0; i < MAX_TEXT_OBS; i++)
+ free(_textBlocks[i]);
//_resMan->resClose(_fontId); => wiped automatically by _resMan->flush();
}
@@ -175,14 +171,14 @@ FrameHeader *Text::giveSpriteData(uint32 textTarget) {
// textTarget is the resource ID of the Compact linking the textdata.
// that's 0x950000 for slot 0 and 0x950001 for slot 1. easy, huh? :)
textTarget &= ITM_ID;
- assert(textTarget <= 1);
+ assert(textTarget < MAX_TEXT_OBS);
return _textBlocks[textTarget];
}
void Text::releaseText(uint32 id) {
id &= ITM_ID;
- assert(id <= 1);
+ assert(id < MAX_TEXT_OBS);
if (_textBlocks[id]) {
free(_textBlocks[id]);
_textBlocks[id] = NULL;