mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 15:48:48 +00:00
AVALANCHE: Move Bubble pos to Dialogs, make them private
This commit is contained in:
parent
5f180a06ba
commit
5f0361c03a
@ -349,8 +349,7 @@ void AnimationType::stopWalk() {
|
||||
* Sets up talk vars.
|
||||
*/
|
||||
void AnimationType::chatter() {
|
||||
_anim->_vm->_talkX = _x + _xLength / 2;
|
||||
_anim->_vm->_talkY = _y;
|
||||
_anim->_vm->_dialogs->setTalkPos(_x + _xLength / 2, _y);
|
||||
_anim->_vm->_graphics->setDialogColor(_bgBubbleCol, _fgBubbleCol);
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,6 @@ public:
|
||||
bool _letMeOut;
|
||||
byte _thinks;
|
||||
bool _thinkThing;
|
||||
int16 _talkX, _talkY;
|
||||
bool _seeScroll; // TODO: maybe this means we're interacting with the toolbar / a scroll?
|
||||
char _objectList[10];
|
||||
// Called .free() for them in ~Gyro().
|
||||
|
@ -519,18 +519,18 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
|
||||
int16 my = yw * 2 - 2;
|
||||
int16 xc = 0;
|
||||
|
||||
if ((_vm->_talkX - xw) < 0)
|
||||
xc = -(_vm->_talkX - xw);
|
||||
if ((_vm->_talkX + xw) > 639)
|
||||
xc = 639 - (_vm->_talkX + xw);
|
||||
if (_talkX - xw < 0)
|
||||
xc = -(_talkX - xw);
|
||||
if (_talkX + xw > 639)
|
||||
xc = 639 - (_talkX + xw);
|
||||
|
||||
// Compute triangle coords for the tail of the bubble
|
||||
points[0].x = _vm->_talkX - 10;
|
||||
points[0].x = _talkX - 10;
|
||||
points[0].y = yw;
|
||||
points[1].x = _vm->_talkX + 10;
|
||||
points[1].x = _talkX + 10;
|
||||
points[1].y = yw;
|
||||
points[2].x = _vm->_talkX;
|
||||
points[2].y = _vm->_talkY;
|
||||
points[2].x = _talkX;
|
||||
points[2].y = _talkY;
|
||||
|
||||
_vm->_graphics->prepareBubble(xc, xw, my, points);
|
||||
|
||||
@ -538,7 +538,7 @@ void Dialogs::drawBubble(DialogFunctionType modeFunc) {
|
||||
// The font is not the same that outtextxy() uses in Pascal. I don't have that, so I used characters instead.
|
||||
// It's almost the same, only notable differences are '?', '!', etc.
|
||||
for (int i = 0; i <= _maxLineNum; i++) {
|
||||
int16 x = xc + _vm->_talkX - _scroll[i].size() / 2 * 8;
|
||||
int16 x = xc + _talkX - _scroll[i].size() / 2 * 8;
|
||||
bool offset = _scroll[i].size() % 2;
|
||||
_vm->_graphics->drawScrollText(_scroll[i], _vm->_font, 8, x - offset * 4, (i * 10) + 12, _vm->_graphics->_talkFontColor);
|
||||
}
|
||||
@ -568,8 +568,8 @@ void Dialogs::reset() {
|
||||
* @remarks Originally called 'natural'
|
||||
*/
|
||||
void Dialogs::setBubbleStateNatural() {
|
||||
_vm->_talkX = 320;
|
||||
_vm->_talkY = 200;
|
||||
_talkX = 320;
|
||||
_talkY = 200;
|
||||
_vm->_graphics->setDialogColor(kColorDarkgray, kColorWhite);
|
||||
}
|
||||
|
||||
@ -699,8 +699,8 @@ void Dialogs::callDialogDriver() {
|
||||
// thing with QPs as triptype.chatter does with the
|
||||
// sprites.)
|
||||
PedType *quasiPed = &_vm->_peds[kQuasipeds[_param - 10]._whichPed];
|
||||
_vm->_talkX = quasiPed->_x;
|
||||
_vm->_talkY = quasiPed->_y; // Position.
|
||||
_talkX = quasiPed->_x;
|
||||
_talkY = quasiPed->_y; // Position.
|
||||
|
||||
_vm->_graphics->setDialogColor(kQuasipeds[_param - 10]._backgroundColor, kQuasipeds[_param - 10]._textColor);
|
||||
} else {
|
||||
@ -803,6 +803,15 @@ void Dialogs::callDialogDriver() {
|
||||
}
|
||||
}
|
||||
|
||||
void Dialogs::setTalkPos(int16 x, int16 y) {
|
||||
_talkX = x;
|
||||
_talkY = y;
|
||||
}
|
||||
|
||||
int16 Dialogs::getTalkPosX() {
|
||||
return _talkX;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display text by calling the dialog driver
|
||||
* @remarks Originally called 'display'
|
||||
|
@ -49,6 +49,8 @@ public:
|
||||
void setReadyLight(byte state);
|
||||
void displayText(Common::String text);
|
||||
bool displayQuestion(Common::String question);
|
||||
void setTalkPos(int16 x, int16 y);
|
||||
int16 getTalkPosX();
|
||||
void setBubbleStateNatural();
|
||||
void displayMusicalScroll();
|
||||
void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
|
||||
@ -61,6 +63,7 @@ public:
|
||||
void saySilly();
|
||||
private:
|
||||
AvalancheEngine *_vm;
|
||||
int16 _talkX, _talkY;
|
||||
|
||||
enum FontStyle {
|
||||
kFontStyleRoman,
|
||||
|
@ -653,15 +653,16 @@ void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[
|
||||
// Backup the screen before drawing the bubble.
|
||||
_scrolls.copyFrom(_surface);
|
||||
|
||||
int16 talkX = _vm->_dialogs->getTalkPosX();
|
||||
// The body of the bubble.
|
||||
_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw + 9, 7, _vm->_talkX + xw - 8 + xc, my + 1), _talkBackgroundColor);
|
||||
_scrolls.fillRect(Common::Rect(xc + _vm->_talkX - xw - 1, 12, _vm->_talkX + xw + xc + 2, my - 4), _talkBackgroundColor);
|
||||
_scrolls.fillRect(Common::Rect(xc + talkX - xw + 9, 7, talkX + xw - 8 + xc, my + 1), _talkBackgroundColor);
|
||||
_scrolls.fillRect(Common::Rect(xc + talkX - xw - 1, 12, talkX + xw + xc + 2, my - 4), _talkBackgroundColor);
|
||||
|
||||
// Top the 4 rounded corners of the bubble.
|
||||
drawPieSlice(xc + _vm->_talkX + xw - 10, 11, 0, 90, 9, _talkBackgroundColor);
|
||||
drawPieSlice(xc + _vm->_talkX + xw - 10, my - 4, 270, 360, 9, _talkBackgroundColor);
|
||||
drawPieSlice(xc + _vm->_talkX - xw + 10, 11, 90, 180, 9, _talkBackgroundColor);
|
||||
drawPieSlice(xc + _vm->_talkX - xw + 10, my - 4, 180, 270, 9, _talkBackgroundColor);
|
||||
drawPieSlice(xc + talkX + xw - 10, 11, 0, 90, 9, _talkBackgroundColor);
|
||||
drawPieSlice(xc + talkX + xw - 10, my - 4, 270, 360, 9, _talkBackgroundColor);
|
||||
drawPieSlice(xc + talkX - xw + 10, 11, 90, 180, 9, _talkBackgroundColor);
|
||||
drawPieSlice(xc + talkX - xw + 10, my - 4, 180, 270, 9, _talkBackgroundColor);
|
||||
|
||||
// "Tail" of the speech bubble.
|
||||
drawTriangle(points, _talkBackgroundColor);
|
||||
|
Loading…
Reference in New Issue
Block a user