aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/illusions/actor.cpp3
-rw-r--r--engines/illusions/bbdou/bbdou_credits.cpp246
-rw-r--r--engines/illusions/bbdou/bbdou_credits.h84
-rw-r--r--engines/illusions/bbdou/bbdou_credits_staticdata.cpp299
-rw-r--r--engines/illusions/bbdou/bbdou_specialcode.cpp27
-rw-r--r--engines/illusions/bbdou/bbdou_specialcode.h4
-rw-r--r--engines/illusions/bbdou/scriptopcodes_bbdou.cpp3
-rw-r--r--engines/illusions/module.mk2
-rw-r--r--engines/illusions/screen.cpp24
-rw-r--r--engines/illusions/screen.h2
-rw-r--r--engines/illusions/textdrawer.cpp2
11 files changed, 691 insertions, 5 deletions
diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp
index a273b52373..591ad184dd 100644
--- a/engines/illusions/actor.cpp
+++ b/engines/illusions/actor.cpp
@@ -940,8 +940,7 @@ void Control::drawActorRect(const Common::Rect r, byte color) {
}
void Control::fillActor(byte color) {
- Common::Rect r = Common::Rect(_actor->_surface->w, _actor->_surface->h);
- _actor->_surface->fillRect(r, color);
+ _vm->_screen->fillSurface(_actor->_surface, color);
_actor->_flags |= 0x4000;
}
diff --git a/engines/illusions/bbdou/bbdou_credits.cpp b/engines/illusions/bbdou/bbdou_credits.cpp
new file mode 100644
index 0000000000..3b651292d7
--- /dev/null
+++ b/engines/illusions/bbdou/bbdou_credits.cpp
@@ -0,0 +1,246 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "illusions/bbdou/illusions_bbdou.h"
+#include "illusions/bbdou/bbdou_credits.h"
+#include "illusions/actor.h"
+#include "illusions/dictionary.h"
+#include "illusions/textdrawer.h"
+#include "illusions/time.h"
+#include "illusions/resources/scriptresource.h"
+
+namespace Illusions {
+
+BbdouCredits::BbdouCredits(IllusionsEngine_BBDOU *vm)
+ : _vm(vm) {
+}
+
+BbdouCredits::~BbdouCredits() {
+}
+
+void BbdouCredits::start(uint32 endSignalPropertyId, float speedModifier) {
+ _endSignalPropertyId = endSignalPropertyId;
+ _currFontId = 0x120004;
+ _currLineIndex = 1;
+ _split = false;
+ // convertTextData();
+ initCreditsItems();
+ createCreditsThread(speedModifier);
+}
+
+void BbdouCredits::stop() {
+ freeCreditsItems();
+}
+
+void BbdouCredits::drawNextLine() {
+ uint leftIndex, rightIndex;
+
+ if (!readNextLine(leftIndex, rightIndex)) {
+ _vm->_scriptResource->_properties.set(_endSignalPropertyId, true);
+ return;
+ }
+
+ if (leftIndex) {
+ const char *leftText = getText(leftIndex);
+ if (leftText && strlen(leftText) != 0) {
+ uint32 objectId = getNextFreeObjectId();
+ int alignment = rightIndex ? 1 : 2;
+ drawTextToControl(objectId, leftText, alignment);
+ }
+ }
+
+ if (rightIndex) {
+ const char *rightText = getText(rightIndex);
+ if (rightText && strlen(rightText) != 0) {
+ uint32 objectId = getNextFreeObjectId();
+ drawTextToControl(objectId, rightText, 4);
+ }
+ }
+
+}
+
+void charToWChar(const char *text, uint16 *wtext, uint size) {
+ while (*text != 0 && size > 1) {
+ *wtext++ = (byte)*text++;
+ /*
+ byte c = (byte)*text++;
+ if (c > 127) c = 32;
+ *wtext = c;
+ debug("%04X", *wtext);
+ ++wtext;
+ */
+ --size;
+ }
+ *wtext++ = 0;
+}
+
+void BbdouCredits::drawTextToControl(uint32 objectId, const char *text, uint alignment) {
+ uint16 wtext[128];
+ charToWChar(text, wtext, ARRAYSIZE(wtext));
+
+ // TODO Extract to Actor class
+ Control *control = _vm->getObjectControl(objectId);
+ FontResource *font = _vm->_dict->findFont(_currFontId);
+ TextDrawer textDrawer;
+ WidthHeight dimensions;
+ uint16 *outText;
+ control->getActorFrameDimensions(dimensions);
+ control->fillActor(0);
+ textDrawer.wrapText(font, wtext, &dimensions, Common::Point(0, 0), alignment, outText);
+ textDrawer.drawText(_vm->_screen, control->_actor->_surface, 0, 0);
+ control->_actor->_flags |= 0x4000;
+
+}
+
+bool BbdouCredits::readNextLine(uint &leftIndex, uint &rightIndex) {
+ bool done = false;
+ int textLines = 0;
+ leftIndex = 0;
+ rightIndex = 0;
+
+ do {
+ uint lineIndex = _currLineIndex++;
+ const char *text = getText(lineIndex);
+ if (text[0] == '@') {
+ const char *command = text + 1;
+ if (!strcmp(command, "end"))
+ done = true;
+ if (!strcmp(command, "bold"))
+ _currFontId = 0x120005;
+ else if (!strcmp(command, "normal"))
+ _currFontId = 0x120004;
+ else if (!strcmp(command, "center"))
+ _split = false;
+ else if (!strcmp(command, "split"))
+ _split = true;
+ else
+ done = true;
+ } else {
+ ++textLines;
+ if (!_split) {
+ leftIndex = lineIndex;
+ done = true;
+ } else if (textLines > 1) {
+ rightIndex = lineIndex;
+ done = true;
+ } else {
+ leftIndex = lineIndex;
+ }
+ }
+ } while (!done);
+
+ return textLines > 0;
+}
+
+void BbdouCredits::initCreditsItems() {
+ for (uint i = 0; i < kCreditsItemsCount; ++i) {
+ uint32 objectId = _vm->_controls->newTempObjectId();
+ _vm->_controls->placeActor(0x00050188, Common::Point(320, 480), 0x00060BE1, objectId, 0);
+ Control *control = _vm->_dict->getObjectControl(objectId);
+ control->startSequenceActor(0x60BE2, 2, 0);
+ _items[i].isUsed = false;
+ _items[i].objectId = objectId;
+ }
+}
+
+void BbdouCredits::freeCreditsItems() {
+ for (uint i = 0; i < kCreditsItemsCount; ++i) {
+ Control *control = _vm->_dict->getObjectControl(_items[i].objectId);
+ control->disappearActor();
+ }
+}
+
+uint32 BbdouCredits::getNextFreeObjectId() {
+ for (uint i = 0; i < kCreditsItemsCount; ++i) {
+ if (!_items[i].isUsed) {
+ _items[i].isUsed = true;
+ return _items[i].objectId;
+ }
+ }
+ return 0;
+}
+
+void BbdouCredits::removeText(uint32 objectId) {
+ for (uint i = 0; i < kCreditsItemsCount; ++i) {
+ if (_items[i].objectId == objectId) {
+ _items[i].isUsed = false;
+ resetObjectPos(objectId);
+ }
+ }
+}
+
+void BbdouCredits::resetObjectPos(uint32 objectId) {
+ Control *control = _vm->_dict->getObjectControl(objectId);
+ control->setActorPosition(Common::Point(320, 480));
+}
+
+void BbdouCredits::createCreditsThread(float speedModifier) {
+ uint32 tempThreadId = _vm->newTempThreadId();
+ CreditsThread *creditsThread = new CreditsThread(_vm, this, tempThreadId, speedModifier);
+ _vm->_threads->startThread(creditsThread);
+}
+
+void BbdouCredits::updateTexts(int yIncr) {
+ for (uint i = 0; i < kCreditsItemsCount; ++i) {
+ if (_items[i].isUsed) {
+ Control *control = _vm->_dict->getObjectControl(_items[i].objectId);
+ Common::Point pt = control->getActorPosition();
+ pt.y += yIncr;
+ control->setActorPosition(pt);
+ if (pt.y <= 0)
+ removeText(_items[i].objectId);
+ }
+ }
+}
+
+// CreditsThread
+
+CreditsThread::CreditsThread(IllusionsEngine_BBDOU *vm, BbdouCredits *credits, uint32 threadId, float speedModifier)
+ : Thread(vm, threadId, 0, 0), _speedModifier(speedModifier), _lastFraction(0.0), _credits(credits) {
+ _type = kTTSpecialThread;
+ _lastUpdateTime = getCurrentTime();
+}
+
+int CreditsThread::onUpdate() {
+ uint32 currTime = getCurrentTime();
+ float fltDelta = (currTime - _lastUpdateTime) * _speedModifier + _lastFraction;
+ int delta = (int)fltDelta;
+ _lastFraction = fltDelta - delta;
+ if (delta != 0)
+ _credits->updateTexts(-delta);
+ _lastUpdateTime = currTime;
+ return 2;
+}
+
+void CreditsThread::onNotify() {
+ _lastUpdateTime = getCurrentTime();
+}
+
+void CreditsThread::onResume() {
+ onNotify();
+}
+
+void CreditsThread::onTerminated() {
+ _credits->stop();
+}
+
+} // End of namespace Illusions
diff --git a/engines/illusions/bbdou/bbdou_credits.h b/engines/illusions/bbdou/bbdou_credits.h
new file mode 100644
index 0000000000..ebf4e5fbb2
--- /dev/null
+++ b/engines/illusions/bbdou/bbdou_credits.h
@@ -0,0 +1,84 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ILLUSIONS_BBDOU_BBDOU_CREDITS_H
+#define ILLUSIONS_BBDOU_BBDOU_CREDITS_H
+
+#include "illusions/specialcode.h"
+#include "illusions/thread.h"
+
+namespace Illusions {
+
+class IllusionsEngine_BBDOU;
+class BbdouSpecialCode;
+class Control;
+
+struct CreditsItem {
+ bool isUsed;
+ uint32 objectId;
+};
+
+const uint kCreditsItemsCount = 64;
+
+class BbdouCredits {
+public:
+ BbdouCredits(IllusionsEngine_BBDOU *vm);
+ ~BbdouCredits();
+ void start(uint32 endSignalPropertyId, float speedModifier);
+ void stop();
+ void drawNextLine();
+ void updateTexts(int yIncr);
+protected:
+ IllusionsEngine_BBDOU *_vm;
+ uint32 _endSignalPropertyId;
+ uint32 _currFontId;
+ uint _currLineIndex;
+ bool _split;
+ CreditsItem _items[kCreditsItemsCount];
+ const char *getText(uint index);
+ void drawTextToControl(uint32 objectId, const char *text, uint alignment);
+ bool readNextLine(uint &leftIndex, uint &rightIndex);
+ void initCreditsItems();
+ void freeCreditsItems();
+ uint32 getNextFreeObjectId();
+ void removeText(uint32 objectId);
+ void resetObjectPos(uint32 objectId);
+ void createCreditsThread(float speedModifier);
+};
+
+class CreditsThread : public Thread {
+public:
+ CreditsThread(IllusionsEngine_BBDOU *vm, BbdouCredits *credits, uint32 threadId, float speedModifier);
+ virtual int onUpdate();
+ virtual void onNotify();
+ virtual void onResume();
+ virtual void onTerminated();
+public:
+ BbdouCredits *_credits;
+ float _speedModifier;
+ float _lastFraction;
+ uint32 _lastUpdateTime;
+};
+
+} // End of namespace Illusions
+
+#endif // ILLUSIONS_BBDOU_BBDOU_CREDITS_H
diff --git a/engines/illusions/bbdou/bbdou_credits_staticdata.cpp b/engines/illusions/bbdou/bbdou_credits_staticdata.cpp
new file mode 100644
index 0000000000..a00a86816e
--- /dev/null
+++ b/engines/illusions/bbdou/bbdou_credits_staticdata.cpp
@@ -0,0 +1,299 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "illusions/bbdou/bbdou_credits.h"
+
+namespace Illusions {
+
+const char *kCreditsText[] = {
+ "@center",
+ "@normal",
+ "Directed by",
+ "@bold",
+ "Darren Bartlett",
+ "@normal",
+ "",
+ "Produced by",
+ "@bold",
+ "James C\xF6liz, Jr.",
+ "@normal",
+ "",
+ "Developed by",
+ "@bold",
+ "The Illusions Gaming Company",
+ "@normal",
+ "",
+ "@split",
+ "Creative Director",
+ "Darren Bartlett",
+ "Designer",
+ "Ryan Modjeski",
+ "Associate Designer",
+ "David Sirlin",
+ "",
+ "",
+ "Technical Director",
+ "James C\xF6liz, Jr.",
+ "Lead Programmer",
+ "Bill Fowler",
+ "Programmer",
+ "Chuck Woo",
+ "",
+ "",
+ "3D Artist",
+ "Eric Chyn",
+ "",
+ "Bill Eral",
+ "Production Artist",
+ "Jim Eral",
+ "Asst. Production Artist",
+ "Eli Remus",
+ "@center",
+ "",
+ "2D Animation by",
+ "@bold",
+ "LA West Productions",
+ "@normal",
+ "",
+ "@split",
+ "Director of Animation",
+ "Ivan Tomicic",
+ "Production Manager",
+ "Susan McGirr",
+ "Studio Supervisor",
+ "Danijel Tomicic",
+ "",
+ "",
+ "Lead Animator",
+ "Dario Pustaj",
+ "",
+ "Ivica Horvat",
+ "Animator",
+ "Kristijan Dulic",
+ "",
+ "Elvis Popovic",
+ "In-Between",
+ "Maja Surijak",
+ "",
+ "Zlatko Zlatunic",
+ "",
+ "",
+ "Lead Ink & Paint",
+ "Sasa Zec",
+ "Ink & Paint",
+ "Darko Dukaric",
+ "",
+ "Marcela Kumparic",
+ "",
+ "Vlado Lencur",
+ "",
+ "Jura Milinkovic",
+ "",
+ "Bernard Ojdanic",
+ "",
+ "Peggy Skrlec",
+ "@center",
+ "",
+ "3D Backgrounds by",
+ "@bold",
+ "LA West Productions",
+ "@normal",
+ "",
+ "@split",
+ "3D Artist",
+ "Daniela Tomicic",
+ "",
+ "Diana-Barbara Stepanic",
+ "@center",
+ "",
+ "2D Animation by",
+ "@bold",
+ "Six Foot Two Productions",
+ "@normal",
+ "",
+ "@split",
+ "Director of Animation",
+ "Tom Arndt",
+ "Producer",
+ "Suzanne D. Atherly",
+ "",
+ "",
+ "Character Animator",
+ "Robbin Atherly",
+ "",
+ "Alan Lau",
+ "",
+ "David Ball",
+ "",
+ "Jeff Nevins",
+ "",
+ "",
+ "Ink & Paint",
+ "Steve Bellin",
+ "",
+ "Corrine Wong",
+ "",
+ "Jeff Nevins",
+ "@center",
+ "",
+ "Written by",
+ "@bold",
+ "Bo Weinberg",
+ "@normal",
+ "",
+ "Principal Voice by",
+ "@bold",
+ "Mike Judge",
+ "@normal",
+ "",
+ "Secondary Voice Recorded at",
+ "@bold",
+ "Private Island Trax",
+ "@normal",
+ "",
+ "Secondary Voices by",
+ "Dean Julian",
+ "Mia Altieri",
+ "Nicole Schallig",
+ "Rick Calvert",
+ "John Campana",
+ "Alex Mebane",
+ "Denise Askew",
+ "Michael Jamal",
+ "",
+ "Studio Engineered by",
+ "Mark V",
+ "",
+ "Sound and Music by",
+ "@bold",
+ "Tommy Tallarico Studios",
+ "@normal",
+ "",
+ "@split",
+ "Sound Designer",
+ "Joey Kuras",
+ "Foley",
+ "Scott Barrett",
+ "@center",
+ "",
+ "Illusions is represented by",
+ "@bold",
+ "Interactive Studio Management",
+ "@normal",
+ "",
+ "Published by",
+ "@bold",
+ "GT Interactive Software",
+ "@normal",
+ "",
+ "@split",
+ "Producer",
+ "Nathan Rose",
+ "Assistant Producer",
+ "Jamal Jennings",
+ "Group Product Manager",
+ "Evan Stein",
+ "Product Manager",
+ "Robert J. Ricci",
+ "Senior Communications Manager",
+ "Alan Lewis",
+ "Director, Product Development Services"
+ "Mary Steer",
+ "Director, Creative Services",
+ "Leslie Mills",
+ "Creative Director",
+ "Vic Merritt",
+ "Art/Traffic Manager",
+ "Liz Fierro",
+ "Manual Editor",
+ "Peter Witcher",
+ "",
+ "",
+ "@center",
+ "",
+ "Licensed by",
+ "@bold",
+ "MTV Networks",
+ "@normal",
+ "",
+ "@split",
+ "MTV Executive Producer",
+ "Allie Eberhardt",
+ "MTV Producer",
+ "Tony Calandra",
+ "MTV Creative Consultants",
+ "Kristofor Brown",
+ "",
+ "David Felton",
+ "",
+ "Mike Judge",
+ "",
+ "Nick Litwinko",
+ "MTV Standards and Practices",
+ "Dr. Thomas Shea",
+ "MTV Legal Affairs",
+ "Beth Matthews",
+ "@center",
+ "",
+ "MTV would like to thank",
+ "Mary Frances Budig",
+ "George Eichen",
+ "Matt Farber",
+ "Rick Holzman",
+ "Jessica Jarrett",
+ "Mike Judge",
+ "Judith McGrath",
+ "David Milch",
+ "Abby Terkuhle",
+ "Van Toffler",
+ "Paige Wolfson",
+ "Marcia Zellers",
+ "",
+ "@bold",
+ "Special Thanks",
+ "@normal",
+ "Clyde Grossman",
+ "Hiromi Nobata",
+ "John Durentas",
+ "Jeff Teachworth",
+ "John Lawrence",
+ "Bill Hendrickson",
+ "Fred Schiller",
+ "Sam Fletcher",
+ "Elizabeth, Stephanie & Hannah",
+ "Sheila Mendoza",
+ "Yukari Yamano",
+ "Hang Yim, King Yip & Wayne",
+ "Li-Ming, Der-Lin & Fansy",
+ "Bobbi Eral",
+ "Miss Melissa",
+ "Yasmin, Aparna & Jenny",
+ "Tony the Cat",
+ "Sammy the Cat",
+ "@end"
+};
+
+const char *BbdouCredits::getText(uint index) {
+ return kCreditsText[index - 1];
+}
+
+} // End of namespace Illusions
diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp
index f230a7c5cf..437c9025c1 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.cpp
+++ b/engines/illusions/bbdou/bbdou_specialcode.cpp
@@ -24,6 +24,7 @@
#include "illusions/bbdou/bbdou_specialcode.h"
#include "illusions/bbdou/bbdou_bubble.h"
#include "illusions/bbdou/bbdou_inventory.h"
+#include "illusions/bbdou/bbdou_credits.h"
#include "illusions/bbdou/bbdou_cursor.h"
#include "illusions/actor.h"
#include "illusions/camera.h"
@@ -107,7 +108,7 @@ void RadarMicrophoneThread::initZones() {
// BbdouSpecialCode
BbdouSpecialCode::BbdouSpecialCode(IllusionsEngine_BBDOU *vm)
- : _vm(vm) {
+ : _vm(vm), _credits(0) {
_bubble = new BbdouBubble(_vm, this);
_cursor = new BbdouCursor(_vm, this);
_inventory = new BbdouInventory(_vm, this);
@@ -150,6 +151,7 @@ void BbdouSpecialCode::init() {
SPECIAL(0x00160036, spcInitMenu);
SPECIAL(0x00160037, spcIsCursorHoldingObjectId);
SPECIAL(0x00160038, spcInitRadarMicrophone);
+ SPECIAL(0x00160039, spcCreditsCtl);
SPECIAL(0x0016003A, spcSaladCtl);
SPECIAL(0x0016003B, spcRunCause);
}
@@ -333,6 +335,27 @@ void BbdouSpecialCode::spcInitRadarMicrophone(OpCall &opCall) {
_vm->_threads->startThread(radarMicrophoneThread);
}
+void BbdouSpecialCode::spcCreditsCtl(OpCall &opCall) {
+ ARG_UINT32(cmd);
+ switch (cmd) {
+ case 1:
+ {
+ ARG_UINT32(endSignalPropertyId);
+ _credits = new BbdouCredits(_vm);
+ _credits->start(endSignalPropertyId, 0.5);
+ }
+ break;
+ case 2:
+ _credits->drawNextLine();
+ break;
+ case 3:
+ _credits->stop();
+ delete _credits;
+ default:
+ break;
+ }
+}
+
void BbdouSpecialCode::spcSaladCtl(OpCall &opCall) {
ARG_UINT32(cmd);
ARG_UINT32(sequenceId);
@@ -352,7 +375,7 @@ void BbdouSpecialCode::spcRunCause(OpCall &opCall) {
ARG_UINT32(objectId1);
ARG_UINT32(objectId2);
Control *cursorControl = _vm->getObjectControl(cursorObjectId);
- debug("runCause(%08X, %08X, %08X)", verbId, objectId1, objectId2);
+ debug(0, "runCause(%08X, %08X, %08X)", verbId, objectId1, objectId2);
runCause(cursorControl, _cursor->_data, verbId, objectId1, objectId2, 0);
}
diff --git a/engines/illusions/bbdou/bbdou_specialcode.h b/engines/illusions/bbdou/bbdou_specialcode.h
index d117cd7231..973d4b40f8 100644
--- a/engines/illusions/bbdou/bbdou_specialcode.h
+++ b/engines/illusions/bbdou/bbdou_specialcode.h
@@ -31,6 +31,7 @@ namespace Illusions {
class IllusionsEngine_BBDOU;
class BbdouBubble;
+class BbdouCredits;
class BbdouCursor;
class BbdouInventory;
struct CursorData;
@@ -101,6 +102,8 @@ public:
BbdouCursor *_cursor;
BbdouBubble *_bubble;
BbdouInventory *_inventory;
+
+ BbdouCredits *_credits;
// Salad
uint _saladCount;
@@ -136,6 +139,7 @@ public:
void spcInitMenu(OpCall &opCall);
void spcIsCursorHoldingObjectId(OpCall &opCall);
void spcInitRadarMicrophone(OpCall &opCall);
+ void spcCreditsCtl(OpCall &opCall);
void spcSaladCtl(OpCall &opCall);
void spcRunCause(OpCall &opCall);
diff --git a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
index 6004f44160..1abcb69197 100644
--- a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
+++ b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp
@@ -295,7 +295,8 @@ void ScriptOpcodes_BBDOU::opUnloadActiveScenes(ScriptThread *scriptThread, OpCal
//uint32 dsceneId = 0x0001000C, dthreadId = 0x00020011;//Cafeteria
//uint32 dsceneId = 0x0001000B, dthreadId = 0x00020010;
//uint32 dsceneId = 0x0001001A, dthreadId = 0x0002001F;
-uint32 dsceneId = 0x00010047, dthreadId = 0x0002005F;
+//uint32 dsceneId = 0x00010047, dthreadId = 0x0002005F;
+uint32 dsceneId = 0x0001007D, dthreadId = 0x000203B9;
void ScriptOpcodes_BBDOU::opChangeScene(ScriptThread *scriptThread, OpCall &opCall) {
ARG_SKIP(2);
diff --git a/engines/illusions/module.mk b/engines/illusions/module.mk
index ad61eee5c8..7cbbd7f956 100644
--- a/engines/illusions/module.mk
+++ b/engines/illusions/module.mk
@@ -4,6 +4,8 @@ MODULE_OBJS := \
actor.o \
bbdou/bbdou_bubble.o \
bbdou/bbdou_cursor.o \
+ bbdou/bbdou_credits.o \
+ bbdou/bbdou_credits_staticdata.o \
bbdou/bbdou_inventory.o \
bbdou/bbdou_specialcode.o \
bbdou/bbdou_triggerfunctions.o \
diff --git a/engines/illusions/screen.cpp b/engines/illusions/screen.cpp
index 52627c84ce..d8dd00430f 100644
--- a/engines/illusions/screen.cpp
+++ b/engines/illusions/screen.cpp
@@ -482,6 +482,30 @@ void Screen::drawText(FontResource *font, Graphics::Surface *surface, int16 x, i
}
}
+void Screen::fillSurface(Graphics::Surface *surface, byte color) {
+ Common::Rect r = Common::Rect(surface->w, surface->h);
+ switch (_backSurface->format.bytesPerPixel) {
+ case 1:
+ surface->fillRect(r, color);
+ break;
+ case 2:
+ surface->fillRect(r, convertColor(color));
+ break;
+ default:
+ break;
+ }
+}
+
+uint16 Screen::convertColor(byte color) {
+ if (color == 0)
+ return _colorKey1;
+ if (color == 20)
+ return g_system->getScreenFormat().RGBToColor(255, 255, 255);
+ if (color == 80)
+ return g_system->getScreenFormat().RGBToColor(176, 176, 176);
+ return g_system->getScreenFormat().RGBToColor(16, 16, 16);
+}
+
void Screen::drawText8(FontResource *font, Graphics::Surface *surface, int16 x, int16 y, uint16 *text, uint count) {
for (uint i = 0; i < count; ++i)
x += font->_widthC + drawChar8(font, surface, x, y, *text++);
diff --git a/engines/illusions/screen.h b/engines/illusions/screen.h
index e22e9b16dc..b801458d82 100644
--- a/engines/illusions/screen.h
+++ b/engines/illusions/screen.h
@@ -134,6 +134,8 @@ public:
void updateFaderPalette();
void setFader(int newValue, int firstIndex, int lastIndex);
void drawText(FontResource *font, Graphics::Surface *surface, int16 x, int16 y, uint16 *text, uint count);
+ void fillSurface(Graphics::Surface *surface, byte color);
+ uint16 convertColor(byte color);
uint16 getColorKey1() const { return _colorKey1; }
void setColorKey1(uint16 colorKey) { _colorKey1 = colorKey; }
uint16 getColorKey2() const { return _colorKey2; }
diff --git a/engines/illusions/textdrawer.cpp b/engines/illusions/textdrawer.cpp
index f1c93c7c80..2456fe433c 100644
--- a/engines/illusions/textdrawer.cpp
+++ b/engines/illusions/textdrawer.cpp
@@ -114,6 +114,8 @@ bool TextDrawer::wrapTextIntern(int16 x, int16 y, int16 maxWidth, int16 maxHeigh
if (_textFlags & 2) {
textPosX = (_dimensions->_width - currLineWidth) / 2;
maxLineWidth = _dimensions->_width;
+ } else if (_textFlags & 4) {
+ textPosX = _dimensions->_width - currLineWidth;
} else {
textPosX = x;
}