aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/kyra_v2.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2007-10-12 00:58:59 +0000
committerJohannes Schickel2007-10-12 00:58:59 +0000
commit1764f165a72f05cae4690d956c83a75e07fe8b82 (patch)
treed2c6a3297d5e9a15cb7c68f609c709321ffceb3a /engines/kyra/kyra_v2.cpp
parentdd661390baf9d6ef80de8cded941b3d8606c717b (diff)
downloadscummvm-rg350-1764f165a72f05cae4690d956c83a75e07fe8b82.tar.gz
scummvm-rg350-1764f165a72f05cae4690d956c83a75e07fe8b82.tar.bz2
scummvm-rg350-1764f165a72f05cae4690d956c83a75e07fe8b82.zip
HoF:
- Subclassed TextDisplayer for use with Kyra2 - Implemented opcodes: -> o2_zanthiaChat 169 -> o2_customChat 152 -> o2_customChatFinish 153 svn-id: r29187
Diffstat (limited to 'engines/kyra/kyra_v2.cpp')
-rw-r--r--engines/kyra/kyra_v2.cpp55
1 files changed, 42 insertions, 13 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 55cf843085..4df02963aa 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -30,7 +30,7 @@
#include "kyra/wsamovie.h"
#include "kyra/sound.h"
#include "kyra/script.h"
-#include "kyra/text.h"
+#include "kyra/text_v2.h"
#include "kyra/timer.h"
#include "kyra/debugger.h"
@@ -43,6 +43,7 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi
_mouseSHPBuf = 0;
_debugger = 0;
_screen = 0;
+ _text = 0;
_gamePlayBuffer = 0;
_cCodeBuffer = _optionsBuffer = _chapterBuffer = 0;
@@ -72,6 +73,8 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi
KyraEngine_v2::~KyraEngine_v2() {
delete [] _mouseSHPBuf;
delete _screen;
+ delete _text;
+ _text = 0;
delete _debugger;
}
@@ -89,6 +92,8 @@ int KyraEngine_v2::init() {
_debugger = new Debugger_v2(this);
assert(_debugger);
+ _text = new TextDisplayer_v2(this, _screen);
+ assert(_text);
setupTimers();
@@ -462,6 +467,30 @@ int KyraEngine_v2::update() {
return 0;
}
+void KyraEngine_v2::updateWithText() {
+ updateInput();
+
+ updateMouse();
+ //sub_157C();
+ updateSpecialSceneScripts();
+ _timer->update();
+ //sub_274C0();
+ //updateInvWsa();
+ //XXX
+ restorePage3();
+ drawAnimObjects();
+
+ if (1/*textEnabled()*/ && _chatText) {
+ int pageBackUp = _screen->_curPage;
+ _screen->_curPage = 2;
+ objectChatPrintText(_chatText, _chatObject);
+ _screen->_curPage = pageBackUp;
+ }
+
+ refreshAnimObjects(0);
+ _screen->updateScreen();
+}
+
void KyraEngine_v2::updateMouse() {
int shapeIndex = 0;
int type = 0;
@@ -1304,9 +1333,9 @@ void KyraEngine_v2::processNewShapes(int unk1, int unk2) {
_mainCharacter.animFrame = _newShapeAnimFrame + 33;
updateCharacterAnim(0);
- //if (dword_30BB2)
- // sub_159D6();
- //else
+ if (_chatText)
+ updateWithText();
+ else
update();
uint32 delayEnd = _system->getMillis() + _newShapeDelay * _tickLength;
@@ -1314,9 +1343,9 @@ void KyraEngine_v2::processNewShapes(int unk1, int unk2) {
while (!_skipFlag && _system->getMillis() < delayEnd) {
// XXX skipFlag handling, unk1 seems to make a scene not skipable
- //if (dword_30BB2)
- // sub_159D6();
- //else
+ if (_chatText)
+ updateWithText();
+ else
update();
delay(10);
@@ -1327,9 +1356,9 @@ void KyraEngine_v2::processNewShapes(int unk1, int unk2) {
if (_newShapeFlag >= 0) {
_mainCharacter.animFrame = _newShapeFlag + 33;
updateCharacterAnim(0);
- //if (dword_30BB2)
- // sub_159D6();
- //else
+ if (_chatText)
+ updateWithText();
+ else
update();
}
@@ -1567,8 +1596,8 @@ void KyraEngine_v2::setupOpcodeTable() {
Opcode(o2_wsaClose),
OpcodeUnImpl(),
// 0x98
- OpcodeUnImpl(),
- OpcodeUnImpl(),
+ Opcode(o2_customChat),
+ Opcode(o2_customChatFinish),
OpcodeUnImpl(),
OpcodeUnImpl(),
// 0x9c
@@ -1588,7 +1617,7 @@ void KyraEngine_v2::setupOpcodeTable() {
OpcodeUnImpl(),
// 0xa8
OpcodeUnImpl(),
- OpcodeUnImpl(),
+ Opcode(o2_zanthiaChat),
OpcodeUnImpl(),
OpcodeUnImpl(),
// 0xac