diff options
author | Max Horn | 2003-05-12 22:08:39 +0000 |
---|---|---|
committer | Max Horn | 2003-05-12 22:08:39 +0000 |
commit | 81bfe8cd5116e99f794ddfa105378aa1d9a3f401 (patch) | |
tree | 42b793b32def16436bb43ab8981b1a9dce2ffb36 /scumm | |
parent | 47227fdf77f52dfb392dfd4fa26c3e76d8f6e523 (diff) | |
download | scummvm-rg350-81bfe8cd5116e99f794ddfa105378aa1d9a3f401.tar.gz scummvm-rg350-81bfe8cd5116e99f794ddfa105378aa1d9a3f401.tar.bz2 scummvm-rg350-81bfe8cd5116e99f794ddfa105378aa1d9a3f401.zip |
swapped talkPosX and talkPosY (they were misnamed); factored out some duplicate code in string.cpp; VC warning fix in smush_player.cpp
svn-id: r7481
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/saveload.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 3 | ||||
-rw-r--r-- | scumm/string.cpp | 28 |
5 files changed, 16 insertions, 21 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index c066734edb..6a91510f75 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -318,8 +318,8 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) { MKLINE(Actor, needBgReset, sleByte, VER_V8), MKLINE(Actor, costumeNeedsInit, sleByte, VER_V8), - MKLINE(Actor, talkPosX, sleInt16, VER_V8), MKLINE(Actor, talkPosY, sleInt16, VER_V8), + MKLINE(Actor, talkPosX, sleInt16, VER_V8), MKLINE(Actor, ignoreTurns, sleByte, VER_V8), MKLINE(Actor, layer, sleByte, VER_V8), diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 7b69a6578c..fd44c9617c 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -1698,8 +1698,8 @@ void Scumm_v6::o6_actorOps() { a->shadow_mode = pop(); break; case 99: - a->talkPosX = pop(); a->talkPosY = pop(); + a->talkPosX = pop(); break; case 198: /* set anim variable */ i = pop(); /* value */ diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 58328e0a37..76cee771be 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1121,8 +1121,8 @@ void Scumm_v8::o8_actorOps() { a->shadow_mode = pop(); break; case 0x79: // SO_ACTOR_TEXT_OFFSET Set text offset relative to actor - a->talkPosX = pop(); a->talkPosY = pop(); + a->talkPosX = pop(); break; // case 0x7A: // SO_ACTOR_INIT Set current actor (handled above) case 0x7B: // SO_ACTOR_VARIABLE Set actor variable diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 70ceef6950..ccd09234cf 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -615,8 +615,7 @@ void SmushPlayer::readPalette(byte *out, Chunk &in) { } static byte delta_color(byte org_color, int16 delta_color) { - int16 t; - t = (((int32)(org_color) << 7) + org_color + delta_color) >> 7; + int t = ((org_color << 7) + org_color + delta_color) >> 7; if (t > 255) t = 255; if (t < 0) diff --git a/scumm/string.cpp b/scumm/string.cpp index e6f66f98e6..de82cdd06f 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -108,29 +108,25 @@ void Scumm::CHARSET_1() { } else { _string[0].ypos = (int)VAR(VAR_V5_TALK_STRING_Y); } - if (_string[0].ypos < 1) - _string[0].ypos = 1; - if (_string[0].xpos < 80) - _string[0].xpos = 80; - if (_string[0].xpos > _screenWidth - 80) - _string[0].xpos = _screenWidth - 80; } else { - s = a->scaley * a->talkPosX / 0xFF; - _string[0].ypos = ((a->talkPosX - s) >> 1) + s - a->elevation + a->y; - if (_string[0].ypos < 1) - _string[0].ypos = 1; + s = a->scaley * a->talkPosY / 0xFF; + _string[0].ypos = ((a->talkPosY - s) >> 1) + s - a->elevation + a->y; if (_string[0].ypos < camera._cur.y - (_screenHeight / 2)) _string[0].ypos = camera._cur.y - (_screenHeight / 2); - s = a->scalex * a->talkPosY / 0xFF; - _string[0].xpos = ((a->talkPosY - s) >> 1) + s + a->x - camera._cur.x + (_screenWidth / 2); - if (_string[0].xpos < 80) - _string[0].xpos = 80; - if (_string[0].xpos > _screenWidth - 80) - _string[0].xpos = _screenWidth - 80; + s = a->scalex * a->talkPosX / 0xFF; + _string[0].xpos = ((a->talkPosX - s) >> 1) + s + a->x - camera._cur.x + (_screenWidth / 2); } + + if (_string[0].ypos < 1) + _string[0].ypos = 1; + + if (_string[0].xpos < 80) + _string[0].xpos = 80; + if (_string[0].xpos > _screenWidth - 80) + _string[0].xpos = _screenWidth - 80; } _charset->_top = _string[0].ypos; |