- Fixed drawing of sprite-parts based texts

- Removed misplaced Music::stopPlay() call

svn-id: r22816
This commit is contained in:
Sven Hesse 2006-06-01 12:18:12 +00:00
parent d64ea1ad87
commit 96d77f16b7
3 changed files with 50 additions and 7 deletions

View File

@ -709,9 +709,12 @@ void Draw_v2::spriteOperation(int16 operation) {
} }
} else { } else {
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
ratio = _spritesArray[_fontToSprite[_fontIndex].sprite]->width / _fontToSprite[_fontIndex].width; ratio = _spritesArray[_fontToSprite[_fontIndex].sprite]->width
x = ((_textToPrint[i] - _fontToSprite[_fontIndex].base) / ratio) * _fontToSprite[_fontIndex].height; / _fontToSprite[_fontIndex].width;
y = ((_textToPrint[i] - _fontToSprite[_fontIndex].base) / ratio) * _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], _vm->_video->drawSprite(_spritesArray[_fontToSprite[_fontIndex].sprite],
_spritesArray[_destSurface], x, y, _spritesArray[_destSurface], x, y,
x + _fontToSprite[_fontIndex].width - 1, x + _fontToSprite[_fontIndex].width - 1,

View File

@ -317,7 +317,8 @@ protected:
void o2_stub0x80(void); void o2_stub0x80(void);
void o2_stub0x82(void); void o2_stub0x82(void);
void o2_stub0x85(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_animPalInit(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_playSound(char &cmdCount, int16 &counter, int16 &retFlag); bool o2_playSound(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_goblinFunc(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_loadTot(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_freeSprite(char &cmdCount, int16 &counter, int16 &retFlag); bool o2_freeSprite(char &cmdCount, int16 &counter, int16 &retFlag);
bool o2_loadSound(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_loadMapObjects(void);
void o2_freeGoblins(void); void o2_freeGoblins(void);
void o2_writeGoblinPos(void); void o2_writeGoblinPos(void);

View File

@ -185,7 +185,7 @@ void Inter_v2::setupOpcodes(void) {
{NULL, ""}, {NULL, ""},
{NULL, ""}, {NULL, ""},
/* 30 */ /* 30 */
OPCODE(o1_loadFontToSprite), OPCODE(o2_loadFontToSprite),
OPCODE(o1_freeFontToSprite), OPCODE(o1_freeFontToSprite),
{NULL, ""}, {NULL, ""},
{NULL, ""}, {NULL, ""},
@ -495,7 +495,7 @@ void Inter_v2::setupOpcodes(void) {
/* 24 */ /* 24 */
OPCODE(o1_putPixel), OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc), OPCODE(o2_goblinFunc),
OPCODE(o1_createSprite), OPCODE(o2_createSprite),
OPCODE(o2_freeSprite), OPCODE(o2_freeSprite),
/* 28 */ /* 28 */
{NULL, ""}, {NULL, ""},
@ -519,7 +519,7 @@ void Inter_v2::setupOpcodes(void) {
OPCODE(o1_setBackDelta), OPCODE(o1_setBackDelta),
/* 38 */ /* 38 */
OPCODE(o2_playSound), OPCODE(o2_playSound),
OPCODE(o1_stopSound), OPCODE(o2_stopSound),
OPCODE(o2_loadSound), OPCODE(o2_loadSound),
OPCODE(o1_freeSoundSlot), OPCODE(o1_freeSoundSlot),
/* 3C */ /* 3C */
@ -919,6 +919,19 @@ int16 Inter_v2::loadSound(int16 search) {
return slot; 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) { void Inter_v2::o2_loadMapObjects(void) {
_vm->_map->loadMapObjects(0); _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) { bool Inter_v2::o2_animPalInit(char &cmdCount, int16 &counter, int16 &retFlag) {
int16 index; int16 index;