aboutsummaryrefslogtreecommitdiff
path: root/scumm/string.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-12 22:08:39 +0000
committerMax Horn2003-05-12 22:08:39 +0000
commit81bfe8cd5116e99f794ddfa105378aa1d9a3f401 (patch)
tree42b793b32def16436bb43ab8981b1a9dce2ffb36 /scumm/string.cpp
parent47227fdf77f52dfb392dfd4fa26c3e76d8f6e523 (diff)
downloadscummvm-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/string.cpp')
-rw-r--r--scumm/string.cpp28
1 files changed, 12 insertions, 16 deletions
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;