aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2006-12-18 20:38:31 +0000
committerSven Hesse2006-12-18 20:38:31 +0000
commit2e6ad11d6d65d4f02e6b8283b47fa31a9abbc4f3 (patch)
tree5486004b62d136e8279e4548342e83b51a0b0db3 /engines
parentfc6f8a47f1123661f92be4350c94d9a967559e62 (diff)
downloadscummvm-rg350-2e6ad11d6d65d4f02e6b8283b47fa31a9abbc4f3.tar.gz
scummvm-rg350-2e6ad11d6d65d4f02e6b8283b47fa31a9abbc4f3.tar.bz2
scummvm-rg350-2e6ad11d6d65d4f02e6b8283b47fa31a9abbc4f3.zip
Fixed the note-pad, font changing and date/time-display
svn-id: r24875
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/game_v2.cpp3
-rw-r--r--engines/gob/gob.cpp5
-rw-r--r--engines/gob/gob.h3
-rw-r--r--engines/gob/inter.h1
-rw-r--r--engines/gob/inter_v2.cpp67
5 files changed, 73 insertions, 6 deletions
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp
index e18f8a9e37..22a4953656 100644
--- a/engines/gob/game_v2.cpp
+++ b/engines/gob/game_v2.cpp
@@ -71,7 +71,8 @@ void Game_v2::playTot(int16 skipPlay) {
if (skipPlay <= 0) {
while (!_vm->_quitRequested) {
- _vm->_draw->animateCursor(4);
+ if (_vm->_global->_inter_variables != 0)
+ _vm->_draw->animateCursor(4);
if (_vm->_features & GF_MAC)
_vm->_music->stopPlay();
else
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 4b3120c3c2..726a10d059 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -575,6 +575,11 @@ void GobEngine::loadGameData(enum SaveFiles sFile, int16 dataVar, int32 size, in
_video->freeSurfDesc(srcDesc);
} else
retSize = in->read(buf, size);
+ if (index == 21) {
+ _video->drawSprite(_draw->_backSurface, _draw->_frontSurface, 0, 0,
+ _draw->_frontSurface->width - 1, _draw->_frontSurface->height - 1, 0, 0, 0);
+ _video->waitRetrace(_global->_videoMode);
+ }
} else
retSize = readDataEndian(*in, buf, _global->_inter_variablesSizes + dataVar, size);
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index c90dde4592..2f65eb7e19 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -109,7 +109,8 @@ enum {
enum SaveFiles {
SAVE_CAT = 0, // Saves
- SAVE_SAV, // Draw::_backSurface (why?)
+ SAVE_SAV, // Draw::_backSurface (as a temporary buffer when using the notepad
+ // and changing the font. TODO: That probably should be worked around
SAVE_BLO // Notes
};
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index e438d8de43..7a49045ac5 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -333,6 +333,7 @@ protected:
bool o2_playSound(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_goblinFunc(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_evaluateStore(char &cmdCount, int16 &counter, int16 &retFlag);
+ bool o2_printText(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_palLoad(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_loadTot(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_freeSprite(char &cmdCount, int16 &counter, int16 &retFlag);
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 0c050e9436..5a03aa7586 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -469,7 +469,7 @@ void Inter_v2::setupOpcodes(void) {
{NULL, ""},
/* 10 */
{NULL, ""},
- OPCODE(o1_printText),
+ OPCODE(o2_printText),
OPCODE(o2_loadTot),
OPCODE(o2_palLoad),
/* 14 */
@@ -1490,7 +1490,7 @@ bool Inter_v2::o2_checkData(char &cmdCount, int16 &counter, int16 &retFlag) {
evalExpr(0);
varOff = _vm->_parse->parseVarIndex();
- handle = 0;
+ handle = 1;
if (!scumm_stricmp(_vm->_global->_inter_resStr, "cat.inf"))
size = _vm->getSaveSize(SAVE_CAT);
else if (!scumm_stricmp(_vm->_global->_inter_resStr, "cat.cat"))
@@ -1682,6 +1682,66 @@ bool Inter_v2::o2_evaluateStore(char &cmdCount, int16 &counter, int16 &retFlag)
return false;
}
+bool Inter_v2::o2_printText(char &cmdCount, int16 &counter, int16 &retFlag) {
+ char buf[60];
+ int16 i;
+
+ _vm->_draw->_destSpriteX = _vm->_parse->parseValExpr();
+ _vm->_draw->_destSpriteY = _vm->_parse->parseValExpr();
+
+ _vm->_draw->_backColor = _vm->_parse->parseValExpr();
+ _vm->_draw->_frontColor = _vm->_parse->parseValExpr();
+ _vm->_draw->_fontIndex = _vm->_parse->parseValExpr();
+ _vm->_draw->_destSurface = 21;
+ _vm->_draw->_textToPrint = buf;
+ _vm->_draw->_transparency = 0;
+
+ if (_vm->_draw->_backColor == 16) {
+ _vm->_draw->_backColor = 0;
+ _vm->_draw->_transparency = 1;
+ }
+
+ do {
+ for (i = 0; *_vm->_global->_inter_execPtr != '.' && (byte)*_vm->_global->_inter_execPtr != 200;
+ i++, _vm->_global->_inter_execPtr++) {
+ buf[i] = *_vm->_global->_inter_execPtr;
+ }
+
+ if ((byte)*_vm->_global->_inter_execPtr != 200) {
+ _vm->_global->_inter_execPtr++;
+ switch (*_vm->_global->_inter_execPtr) {
+ case 16:
+ case 18:
+ sprintf(buf + i, "%d", (int8) READ_VARO_UINT8(_vm->_parse->parseVarIndex()));
+ break;
+
+ case 17:
+ case 24:
+ case 27:
+ sprintf(buf + i, "%d", (int16) READ_VARO_UINT16(_vm->_parse->parseVarIndex()));
+ break;
+
+ case 23:
+ case 26:
+ sprintf(buf + i, "%d", VAR_OFFSET(_vm->_parse->parseVarIndex()));
+ break;
+
+ case 25:
+ case 28:
+ sprintf(buf + i, "%s", GET_VARO_STR(_vm->_parse->parseVarIndex()));
+ break;
+ }
+ _vm->_global->_inter_execPtr++;
+ } else {
+ buf[i] = 0;
+ }
+ _vm->_draw->spriteOperation(DRAW_PRINTTEXT);
+ } while ((byte)*_vm->_global->_inter_execPtr != 200);
+ _vm->_global->_inter_execPtr++;
+
+ return false;
+}
+
bool Inter_v2::o2_palLoad(char &cmdCount, int16 &counter, int16 &retFlag) {
int16 i;
int16 ind1;
@@ -2238,8 +2298,7 @@ void Inter_v2::o2_totSub(void) {
totFile[i] = 0;
}
- _vm->_global->_inter_execPtr++;
- flags = *_vm->_global->_inter_execPtr;
+ flags = (byte) *_vm->_global->_inter_execPtr++;
_vm->_game->totSub(flags, totFile);
}