Skip to content

Commit

Permalink
ACCESS: MM - Implement up and down arrows in BubbleBox
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jan 15, 2015
1 parent f1aa191 commit 0c14e42
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 13 deletions.
3 changes: 2 additions & 1 deletion engines/access/access.cpp
Expand Up @@ -100,7 +100,8 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_startAboutItem = _startAboutBox = 0;
_byte26CB5 = 0;
BCNT = 0;
BOXDATASTART = BOXDATAEND = 0;
BOXDATASTART = 0;
BOXDATAEND = false;
BOXSELECTY = 0;
BOXSELECTYOLD = -1;
NUMBLINES = 0;
Expand Down
2 changes: 1 addition & 1 deletion engines/access/access.h
Expand Up @@ -217,7 +217,7 @@ class AccessEngine : public Engine {
int _startAboutItem;
int _startAboutBox;
int BOXDATASTART;
int BOXDATAEND;
bool BOXDATAEND;
int BOXSELECTY;
int BOXSELECTYOLD;
int NUMBLINES;
Expand Down
4 changes: 4 additions & 0 deletions engines/access/asurface.cpp
Expand Up @@ -320,6 +320,10 @@ void ASurface::drawLine(int x1, int y1, int x2, int y2, int col) {
Graphics::Surface::drawLine(x1, y1, x2, y2, col);
}

void ASurface::drawLine() {
Graphics::Surface::drawLine(_orgX1, _orgY1, _orgX2, _orgY1, _lColor);
}

void ASurface::drawBox() {
Graphics::Surface::drawLine(_orgX1, _orgY1, _orgX2, _orgY1, _lColor);
Graphics::Surface::drawLine(_orgX1, _orgY2, _orgX2, _orgY2, _lColor);
Expand Down
2 changes: 2 additions & 0 deletions engines/access/asurface.h
Expand Up @@ -97,6 +97,8 @@ class ASurface : public Graphics::Surface {

virtual void drawLine(int x1, int y1, int x2, int y2, int col);

virtual void drawLine();

virtual void drawBox();

virtual void transCopyFrom(ASurface *src, const Common::Point &destPos);
Expand Down
72 changes: 61 additions & 11 deletions engines/access/bubble_box.cpp
Expand Up @@ -287,8 +287,13 @@ void BubbleBox::doBox(int item, int box) {
delete icons;
}

void BubbleBox::SETCURSORPOS(int posX, int posY) {
// _vm->_screen->_printStart = _vm->_screen->_printOrg = Common::Point((posX << 3) + _rowOff, posY << 3);
warning("TODO: CURSORSET");
}

void BubbleBox::displayBoxData() {
_vm->BOXDATAEND = 0;
_vm->BOXDATAEND = false;
_rowOff = 2;
_vm->_fonts._charSet._lo = 7; // 0xF7
_vm->_fonts._charSet._hi = 15;
Expand All @@ -303,7 +308,7 @@ void BubbleBox::displayBoxData() {
_vm->BCNT = 0;

if (_tempListPtr[idx].size() == 0) {
_vm->BOXDATAEND = 1;
_vm->BOXDATAEND = true;
return;
}

Expand All @@ -322,21 +327,20 @@ void BubbleBox::displayBoxData() {
int oldPStartY = BOXPSTARTY;
++BOXPSTARTY;

for (int i = 0; i < _vm->BOXDATASTART; i++, idx++) {
while (_tempListPtr[idx].size() != 0)
++idx;
}
idx += _vm->BOXDATASTART;

while (true) {
warning("TODO: SETCURSOR");
// SETCURSORPOS(BOXPSTARTX, BOXPSTARTY);
// _vm->_fonts._font1.drawString(_vm->_screen, _tempListPtr[idx], Common::Point((BOXPSTARTX << 3) + _rowOff, BOXPSTARTY << 3));

warning("TODO: PRINTSTR");
++idx;
++BOXPSTARTY;
++_vm->BCNT;
if (_tempListPtr[idx].size() == 0) {
BOXPSTARTY = oldPStartY;
_vm->_events->showCursor();
_vm->BOXDATAEND = 1;
_vm->BOXDATAEND = true;
return;
}

Expand Down Expand Up @@ -438,8 +442,54 @@ int BubbleBox::doBox_v1(int item, int box, int &type) {
_vm->_screen->_orgY1 = oldY;
}

if ((_type == TYPE_0) || (_type == TYPE_3))
warning("TODO: Implement more of TYPE_0 or TYPE_3");
if ((_type != TYPE_0) && (_type != TYPE_2)) {
_vm->_screen->_orgY1 += 8;
if (_type == TYPE_3)
_vm->_screen->_orgY2 -= 8;

_vm->_screen->_orgY2 -= 8;
_vm->_word234F7 = _vm->_word234FF = _vm->_screen->_orgX2;
_vm->_word234F3 = _vm->_word234FB = _vm->_screen->_orgX1 = _vm->_screen->_orgX2 - 8;
BOXENDX = _vm->_screen->_orgX1 - 1;
_vm->_screen->drawBox();

_vm->_screen->_orgY1 += 6;
_vm->_screen->_orgY2 -= 6;
_vm->_screen->drawBox();

_vm->_word234F9 = _vm->_screen->_orgY1 + 1;
_vm->_word234F5 = _vm->_word234F9 - 5;
_vm->_word234FD = _vm->_screen->_orgY2 + 1;
_vm->_word23501 = _vm->_word234FD - 6;
_vm->_screen->_orgX1 += 4;
_vm->_screen->_orgX2 = _vm->_screen->_orgX1;
_vm->_screen->_orgY1 -= 4;
_vm->_screen->_orgY2 += 2;
_vm->_screen->drawLine();

++_vm->_screen->_orgY1;
--_vm->_screen->_orgX1;
++_vm->_screen->_orgX2;
_vm->_screen->drawLine();

++_vm->_screen->_orgY1;
--_vm->_screen->_orgX1;
++_vm->_screen->_orgX2;
_vm->_screen->drawLine();

_vm->_screen->_orgY1 = _vm->_screen->_orgY2;
_vm->_screen->drawLine();

++_vm->_screen->_orgX1;
--_vm->_screen->_orgX2;
++_vm->_screen->_orgY1;
_vm->_screen->drawLine();

++_vm->_screen->_orgX1;
--_vm->_screen->_orgX2;
++_vm->_screen->_orgY1;
_vm->_screen->drawLine();
}

int len = _bubbleDisplStr.size();
int ax = _bounds.top >> 3;
Expand Down Expand Up @@ -544,7 +594,7 @@ int BubbleBox::doBox_v1(int item, int box, int &type) {
if (_vm->BCNT != _vm->BOXSELECTY + 1) {
++_vm->BOXSELECTY;
drawSelectBox();
} else if (_vm->BOXDATAEND == 0) {
} else if (!_vm->BOXDATAEND) {
++_vm->BOXDATASTART;
displayBoxData();
drawSelectBox();
Expand Down
1 change: 1 addition & 0 deletions engines/access/bubble_box.h
Expand Up @@ -96,6 +96,7 @@ class BubbleBox : public Manager {

int doBox_v1(int item, int box, int &type);
void getList(const char *data[], int *flags);
void SETCURSORPOS(int posX, int posY);
};

} // End of namespace Access
Expand Down

0 comments on commit 0c14e42

Please sign in to comment.