diff options
author | Max Horn | 2003-05-14 13:30:52 +0000 |
---|---|---|
committer | Max Horn | 2003-05-14 13:30:52 +0000 |
commit | bc99915aa50dd58a4ab37f810e1df2c40acd4086 (patch) | |
tree | 9e2d5b6a7426715ad8c2bfd8d51ee183652b1b93 | |
parent | 50a857a40694daec8c63d4ba480d298d65c71445 (diff) | |
download | scummvm-rg350-bc99915aa50dd58a4ab37f810e1df2c40acd4086.tar.gz scummvm-rg350-bc99915aa50dd58a4ab37f810e1df2c40acd4086.tar.bz2 scummvm-rg350-bc99915aa50dd58a4ab37f810e1df2c40acd4086.zip |
V2 text drawing
svn-id: r7502
-rw-r--r-- | scumm/actor.cpp | 2 | ||||
-rw-r--r-- | scumm/charset.h | 2 | ||||
-rw-r--r-- | scumm/gfx.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 51 | ||||
-rw-r--r-- | scumm/scumm.h | 1 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 1 | ||||
-rw-r--r-- | scumm/string.cpp | 40 | ||||
-rw-r--r-- | scumm/vars.cpp | 1 |
8 files changed, 72 insertions, 28 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index ee9e0f3989..ea8f66d498 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -1162,6 +1162,8 @@ void Scumm::actorTalk() { _talkDelay = 0; _haveMsg = 0xFF; VAR(VAR_HAVE_MSG) = 0xFF; + if (VAR_CHARCOUNT != 0xFF) + VAR(VAR_CHARCOUNT) = 0; CHARSET_1(); } diff --git a/scumm/charset.h b/scumm/charset.h index bd82642f4e..22d99163be 100644 --- a/scumm/charset.h +++ b/scumm/charset.h @@ -110,6 +110,7 @@ public: void printChar(int chr); void setCurID(byte id); void setColor(byte color); + int getFontHeight() { return 8; } }; class CharsetRendererV2 : public CharsetRendererV3 { @@ -120,7 +121,6 @@ public: CharsetRendererV2(Scumm *vm) : CharsetRendererV3(vm) {} void setCurID(byte id); - int getFontHeight() { return 8; } }; class CharsetRendererNut : public CharsetRenderer { diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 763740765f..957483ad95 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -376,7 +376,7 @@ void Scumm::drawDirtyScreenParts() { byte *src; updateDirtyScreen(2); - if (_features & GF_AFTER_V3) + if (_features & GF_AFTER_V2 || _features & GF_AFTER_V3) updateDirtyScreen(1); if (camera._last.x == camera._cur.x && (camera._last.y == camera._cur.y || !(_features & GF_AFTER_V7))) { diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 9d7c8b1ed4..a59a0b3726 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -395,6 +395,48 @@ void Scumm_v2::decodeParseString() { *ptr = 0; printf("TODO: Scumm_v2::decodeParseString(\"%s\") from %d\n", buffer, vm.slot[_currentScript].number); + + int textSlot; + + if (_actorToPrintStrFor < 128) + textSlot = 0; + else + textSlot = 1; + + textSlot = 0; + + _string[textSlot].xpos = 0; + _string[textSlot].ypos = 0; + _string[textSlot].right = 320; + _string[textSlot].center = false; + _string[textSlot].overhead = false; + _string[textSlot].color = 13; // HACK, make it pink, just for fun 8-) + + _messagePtr = buffer; + switch (textSlot) { + case 0: + actorTalk(); + break; + case 1: + drawString(1); + break; + case 2: + unkMessage1(); + break; + case 3: + unkMessage2(); + break; + } + +/* + _string[textSlot].t_xpos = _string[textSlot].xpos; + _string[textSlot].t_ypos = _string[textSlot].ypos; + _string[textSlot].t_center = _string[textSlot].center; + _string[textSlot].t_overhead = _string[textSlot].overhead; + _string[textSlot].t_right = _string[textSlot].right; + _string[textSlot].t_color = _string[textSlot].color; + _string[textSlot].t_charset = _string[textSlot].charset; +*/ } int Scumm_v2::readVar(uint var) { @@ -752,9 +794,11 @@ void Scumm_v2::o2_verbOps() { int x = fetchScriptByte() << 3; int y = fetchScriptByte() << 3; slot = getVarOrDirectByte(0x80) + 1; - // int unk = fetchScriptByte(); // ? - fetchScriptByte(); + /*int unk =*/ fetchScriptByte(); // ? + //printf("o2_verbOps: verb = %d, slot = %d, x = %d, y = %d, unk = %d, name = %s\n", + // verb, slot, x, y, unk, _scriptPointer); + VerbSlot *vs; assert(0 < slot && slot < _maxVerbs); @@ -774,9 +818,6 @@ void Scumm_v2::o2_verbOps() { vs->x = x; vs->y = y; - //printf("o2_verbOps: verb = %d, slot = %d, x = %d, y = %d, unk = %d, name = %s\n", - // verb, slot, x, y, unk, _scriptPointer); - // It follows the verb name loadPtrToResource(rtVerb, slot, NULL); } diff --git a/scumm/scumm.h b/scumm/scumm.h index 37b5a95f17..092dacaca4 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -1091,6 +1091,7 @@ public: byte VAR_CUTSCENE_START_SCRIPT; byte VAR_CUTSCENE_END_SCRIPT; byte VAR_CHARINC; + byte VAR_CHARCOUNT; byte VAR_WALKTO_OBJ; byte VAR_DEBUGMODE; byte VAR_HEAPSPACE; diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 347f346f49..e7cff5e514 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -439,6 +439,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) VAR_CUTSCENE_START_SCRIPT = 0xFF; VAR_CUTSCENE_END_SCRIPT = 0xFF; VAR_CHARINC = 0xFF; + VAR_CHARCOUNT = 0xFF; VAR_WALKTO_OBJ = 0xFF; VAR_DEBUGMODE = 0xFF; VAR_HEAPSPACE = 0xFF; diff --git a/scumm/string.cpp b/scumm/string.cpp index de82cdd06f..fb2dbf58e4 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -141,7 +141,7 @@ void Scumm::CHARSET_1() { _charset->_right = _string[0].right; _charset->setColor(_charsetColor); - if (!(_features & GF_AFTER_V3)) // FIXME + if (!(_features & GF_AFTER_V2 || _features & GF_AFTER_V3)) // FIXME for (i = 0; i < 4; i++) _charsetColorMap[i] = _charsetData[_charset->getCurID()][i]; @@ -184,7 +184,7 @@ void Scumm::CHARSET_1() { _talkDelay = _defaultTalkDelay; if (!_keepText) { - if (_features & GF_AFTER_V3 && _gameId != GID_LOOM) { + if ((_features & GF_AFTER_V2 || _features & GF_AFTER_V3) && _gameId != GID_LOOM) { gdi._mask_left = _string[0].xpos; gdi._mask_top = _string[0].ypos; gdi._mask_bottom = _string[0].ypos + 8; @@ -224,22 +224,16 @@ void Scumm::CHARSET_1() { } if (c == 13) { newLine:; - if (_features & GF_AFTER_V3) { - _charset->_nextTop += 8; - _charset->_nextLeft = _string[0].xpos; - if (_charset->_center) { - _charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1; - } - continue; - } else { - _charset->_nextLeft = _string[0].xpos; - if (_charset->_center) { - _charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1; - } - _charset->_nextTop += _charset->getFontHeight(); + _charset->_nextLeft = _string[0].xpos; + if (_charset->_center) { + _charset->_nextLeft -= _charset->getStringWidth(0, buffer) >> 1; + } + _charset->_nextTop += _charset->getFontHeight(); + if (!(_features & GF_AFTER_V2 || _features & GF_AFTER_V3)) { + // FIXME - is this really needed? _charset->_disableOffsX = true; - continue; } + continue; } if (c == 0xFE) @@ -248,7 +242,7 @@ void Scumm::CHARSET_1() { if (c != 0xFF) { _charset->_left = _charset->_nextLeft; _charset->_top = _charset->_nextTop; - if (_features & GF_AFTER_V3) { + if (_features & GF_AFTER_V2 || _features & GF_AFTER_V3) { _charset->printChar(c); } else if (_features & GF_AFTER_V6) { if (!_noSubtitles || (_haveMsg != 0xFE && _haveMsg != 0xFF)) @@ -260,7 +254,11 @@ void Scumm::CHARSET_1() { _charset->_nextLeft = _charset->_left; _charset->_nextTop = _charset->_top; - _talkDelay += (int)VAR(VAR_CHARINC); + if (_features & GF_AFTER_V2) { + _talkDelay += _defaultTalkDelay / 20; + VAR(VAR_CHARCOUNT)++; + } else + _talkDelay += (int)VAR(VAR_CHARINC); continue; } @@ -410,13 +408,13 @@ void Scumm::drawString(int a) { _charset->_disableOffsX = _charset->_firstChar = true; _charset->setCurID(_string[a].charset); - if (!(_features & GF_AFTER_V3)) { + if (!(_features & GF_AFTER_V2 || _features & GF_AFTER_V3)) { for (i = 0; i < 4; i++) _charsetColorMap[i] = _charsetData[_charset->getCurID()][i]; - - fontHeight = _charset->getFontHeight(); } + fontHeight = _charset->getFontHeight(); + _msgPtrToAdd = buf; // trim from the right diff --git a/scumm/vars.cpp b/scumm/vars.cpp index dfff047b91..f8c57cfc0b 100644 --- a/scumm/vars.cpp +++ b/scumm/vars.cpp @@ -105,6 +105,7 @@ void Scumm_v2::setupScummVars() { VAR_ROOM = 4; VAR_OVERRIDE = 5; VAR_MACHINE_SPEED = 6; + VAR_CHARCOUNT = 7; VAR_NUM_ACTOR = 11; VAR_CURRENT_LIGHTS = 12; VAR_CURRENTDRIVE = 13; |