aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2006-06-01 12:18:12 +0000
committerSven Hesse2006-06-01 12:18:12 +0000
commit96d77f16b73925454c9204176c9e0e62839e9537 (patch)
treed550bdd1d303269cf55215170342916fce8afa97 /engines/gob
parentd64ea1ad87066aae2fae5f06b70d7b0358b78af9 (diff)
downloadscummvm-rg350-96d77f16b73925454c9204176c9e0e62839e9537.tar.gz
scummvm-rg350-96d77f16b73925454c9204176c9e0e62839e9537.tar.bz2
scummvm-rg350-96d77f16b73925454c9204176c9e0e62839e9537.zip
- Fixed drawing of sprite-parts based texts
- Removed misplaced Music::stopPlay() call svn-id: r22816
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/draw_v2.cpp9
-rw-r--r--engines/gob/inter.h5
-rw-r--r--engines/gob/inter_v2.cpp43
3 files changed, 50 insertions, 7 deletions
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index b5459750b2..6f600e127c 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -709,9 +709,12 @@ void Draw_v2::spriteOperation(int16 operation) {
}
} else {
for (i = 0; i < len; i++) {
- ratio = _spritesArray[_fontToSprite[_fontIndex].sprite]->width / _fontToSprite[_fontIndex].width;
- x = ((_textToPrint[i] - _fontToSprite[_fontIndex].base) / ratio) * _fontToSprite[_fontIndex].height;
- y = ((_textToPrint[i] - _fontToSprite[_fontIndex].base) / ratio) * _fontToSprite[_fontIndex].width;
+ ratio = _spritesArray[_fontToSprite[_fontIndex].sprite]->width
+ / _fontToSprite[_fontIndex].width;
+ y = ((_textToPrint[i] - _fontToSprite[_fontIndex].base) / ratio)
+ * _fontToSprite[_fontIndex].height;
+ x = ((_textToPrint[i] - _fontToSprite[_fontIndex].base) % ratio)
+ * _fontToSprite[_fontIndex].width;
_vm->_video->drawSprite(_spritesArray[_fontToSprite[_fontIndex].sprite],
_spritesArray[_destSurface], x, y,
x + _fontToSprite[_fontIndex].width - 1,
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 3377287001..1a4cba9d78 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -317,7 +317,8 @@ protected:
void o2_stub0x80(void);
void o2_stub0x82(void);
void o2_stub0x85(void);
- void o2_renderStatic(void);
+ bool o2_stopSound(char &cmdCount, int16 &counter, int16 &retFlag);
+ bool o2_createSprite(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_animPalInit(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_playSound(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_goblinFunc(char &cmdCount, int16 &counter, int16 &retFlag);
@@ -326,6 +327,8 @@ protected:
bool o2_loadTot(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_freeSprite(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_loadSound(char &cmdCount, int16 &counter, int16 &retFlag);
+ void o2_loadFontToSprite(void);
+ void o2_renderStatic(void);
void o2_loadMapObjects(void);
void o2_freeGoblins(void);
void o2_writeGoblinPos(void);
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index c7f5692b54..77935eaefd 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -185,7 +185,7 @@ void Inter_v2::setupOpcodes(void) {
{NULL, ""},
{NULL, ""},
/* 30 */
- OPCODE(o1_loadFontToSprite),
+ OPCODE(o2_loadFontToSprite),
OPCODE(o1_freeFontToSprite),
{NULL, ""},
{NULL, ""},
@@ -495,7 +495,7 @@ void Inter_v2::setupOpcodes(void) {
/* 24 */
OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc),
- OPCODE(o1_createSprite),
+ OPCODE(o2_createSprite),
OPCODE(o2_freeSprite),
/* 28 */
{NULL, ""},
@@ -519,7 +519,7 @@ void Inter_v2::setupOpcodes(void) {
OPCODE(o1_setBackDelta),
/* 38 */
OPCODE(o2_playSound),
- OPCODE(o1_stopSound),
+ OPCODE(o2_stopSound),
OPCODE(o2_loadSound),
OPCODE(o1_freeSoundSlot),
/* 3C */
@@ -919,6 +919,19 @@ int16 Inter_v2::loadSound(int16 search) {
return slot;
}
+void Inter_v2::o2_loadFontToSprite(void) {
+ int16 i = load16();
+
+ _vm->_draw->_fontToSprite[i].sprite = *_vm->_global->_inter_execPtr;
+ _vm->_global->_inter_execPtr += 2;
+ _vm->_draw->_fontToSprite[i].base = *_vm->_global->_inter_execPtr;
+ _vm->_global->_inter_execPtr += 2;
+ _vm->_draw->_fontToSprite[i].width = *_vm->_global->_inter_execPtr;
+ _vm->_global->_inter_execPtr += 2;
+ _vm->_draw->_fontToSprite[i].height = *_vm->_global->_inter_execPtr;
+ _vm->_global->_inter_execPtr += 2;
+}
+
void Inter_v2::o2_loadMapObjects(void) {
_vm->_map->loadMapObjects(0);
}
@@ -1065,6 +1078,30 @@ void Inter_v2::loadMult(void) {
}
}
+bool Inter_v2::o2_stopSound(char &cmdCount, int16 &counter, int16 &retFlag) {
+ _vm->_snd->stopSound(_vm->_parse->parseValExpr());
+ _soundEndTimeKey = 0;
+ return false;
+}
+
+bool Inter_v2::o2_createSprite(char &cmdCount, int16 &counter, int16 &retFlag) {
+ int16 index;
+ int16 height;
+ int16 width;
+ int16 flag;
+
+ index = load16();
+ width = load16();
+ height = load16();
+
+ _vm->_draw->adjustCoords(0, &width, &height);
+
+ flag = load16();
+
+ _vm->_draw->initBigSprite(index, width, height, flag);
+ return false;
+}
+
bool Inter_v2::o2_animPalInit(char &cmdCount, int16 &counter, int16 &retFlag) {
int16 index;