diff options
-rw-r--r-- | queen/cutaway.cpp | 108 | ||||
-rw-r--r-- | queen/display.cpp | 4 | ||||
-rw-r--r-- | queen/display.h | 6 | ||||
-rw-r--r-- | queen/logic.cpp | 4 | ||||
-rw-r--r-- | queen/logic.h | 2 |
5 files changed, 113 insertions, 11 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index df7f080246..cfd9656a3d 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -21,6 +21,7 @@ #include "stdafx.h" #include "cutaway.h" +#include "display.h" #include "graphics.h" #include "talk.h" #include "walk.h" @@ -284,11 +285,110 @@ void Cutaway::dumpCutawayObject(int index, CutawayObject &object) void Cutaway::actionSpecialMove(int index) { -// switch (index) { -// default: + switch (index) { + + // cdint.cut + case 36: + break; + + // cdint.cut - flash white + case 37: + // XXX flashspecial(); + break; + + // cdint.cut - pan right + case 38: + { + Display *display = _logic->display(); + + BobSlot *bob_box = _graphics->bob(20); + BobSlot *bob_beam = _graphics->bob(21); + BobSlot *bob_crate = _graphics->bob(22); + BobSlot *bob_clock = _graphics->bob(23); + BobSlot *bob_hands = _graphics->bob(24); + + // XXX _graphics->cameraBob(-1); + // XXX fastmode = 1; + + _graphics->update(); + + bob_box ->x += 280 * 2; + bob_beam ->x += 30; + bob_crate->x += 180 * 3; + + int horizontalScroll = display->horizontalScroll(); + + int i = 1; + while (horizontalScroll < 290) { + + horizontalScroll = horizontalScroll + i; + if (horizontalScroll > 290) + horizontalScroll = 290; + + //debug(0, "horizontalScroll = %i", horizontalScroll); + + display->horizontalScroll(horizontalScroll); + + bob_box ->x -= i * 2; + bob_beam ->x -= i; + bob_crate->x -= i * 3; + bob_clock->x -= i * 2; + bob_hands->x -= i * 2; + + _graphics->update(); + + if (_quit) + return; + + } + + // XXX fastmode = 0; + } + break; + + // cdint.cut - pan left to bomb + case 39: + { + Display *display = _logic->display(); + + BobSlot *bob21 = _graphics->bob(21); + BobSlot *bob22 = _graphics->bob(22); + + // XXX _graphics->cameraBob(-1); + // XXX fastmode = 1; + + int horizontalScroll = display->horizontalScroll(); + + int i = 5; + while (horizontalScroll > 0 || bob21->x < 136) { + + horizontalScroll -= i; + if (horizontalScroll < 0) + horizontalScroll = 0; + + debug(0, "horizontalScroll = %i", horizontalScroll); + display->horizontalScroll(horizontalScroll); + + if (horizontalScroll < 272 && bob21->x < 136) + bob21->x += (i/2); + + bob22->x += i; + + _graphics->update(); + + if (_quit) + return; + + } + + // XXX fastmode = 0; + } + break; + + default: warning("Unhandled special move: %i", index); -// break; -// } + break; + } } byte *Cutaway::turnOnPeople(byte *ptr, CutawayObject &object) { diff --git a/queen/display.cpp b/queen/display.cpp index 4cef4a1c2d..1dfc554e71 100644 --- a/queen/display.cpp +++ b/queen/display.cpp @@ -724,7 +724,7 @@ uint16 Display::textWidth(const char *text) const { } -void Display::horizontalScrollUpdate(uint16 xCamera) { +void Display::horizontalScrollUpdate(int16 xCamera) { debug(9, "Display::horizontalScrollUpdate(%d)", xCamera); _horizontalScroll = 0; @@ -739,7 +739,7 @@ void Display::horizontalScrollUpdate(uint16 xCamera) { } -void Display::horizontalScroll(uint16 scroll) { +void Display::horizontalScroll(int16 scroll) { _horizontalScroll = scroll; } diff --git a/queen/display.h b/queen/display.h index eb0cea71b9..ee707b8d1b 100644 --- a/queen/display.h +++ b/queen/display.h @@ -86,9 +86,9 @@ public: void textDraw(uint16 x, uint16 y, uint8 color, const char *text, bool outlined = true); uint16 textWidth(const char *text) const; - void horizontalScrollUpdate(uint16 xCamera); // calc_screen_scroll - void horizontalScroll(uint16 scroll); - uint16 horizontalScroll() const { return _horizontalScroll; } + void horizontalScrollUpdate(int16 xCamera); // calc_screen_scroll + void horizontalScroll(int16 scroll); + int16 horizontalScroll() const { return _horizontalScroll; } bool fullscreen() const { return _fullscreen; } diff --git a/queen/logic.cpp b/queen/logic.cpp index 87eef05bf9..b465f5ebf2 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -29,8 +29,8 @@ namespace Queen { -Logic::Logic(Resource *resource, Graphics *graphics, Display *display) - : _resource(resource), _graphics(graphics), _display(display), _talkSpeed(DEFAULT_TALK_SPEED) { +Logic::Logic(Resource *resource, Graphics *graphics, Display *theDisplay) + : _resource(resource), _graphics(graphics), _display(theDisplay), _talkSpeed(DEFAULT_TALK_SPEED) { _jas = _resource->loadFile("QUEEN.JAS", 20); _joe.x = _joe.y = 0; _joe.scale = 100; diff --git a/queen/logic.h b/queen/logic.h index d3960f53b3..e69b460177 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -149,6 +149,8 @@ public: //! FACE_JOE() uint16 joeFace(); + Display *display() { return _display; } + protected: bool _textToggle; bool _speechToggle; |