aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorGregory Montoir2003-11-07 16:44:13 +0000
committerGregory Montoir2003-11-07 16:44:13 +0000
commitf4dc97783984d2008443a3b8292bbde059b9564a (patch)
treeba2c6f69fc988b20793e5e38043f0a8d32e38fc7 /queen
parenta93c9f49ba970fc9abaecbee99dc5ea96ec5a345 (diff)
downloadscummvm-rg350-f4dc97783984d2008443a3b8292bbde059b9564a.tar.gz
scummvm-rg350-f4dc97783984d2008443a3b8292bbde059b9564a.tar.bz2
scummvm-rg350-f4dc97783984d2008443a3b8292bbde059b9564a.zip
add bob parallax stuff for room 74 (carbam)
svn-id: r11197
Diffstat (limited to 'queen')
-rw-r--r--queen/cutaway.cpp15
-rw-r--r--queen/graphics.cpp134
-rw-r--r--queen/graphics.h32
-rw-r--r--queen/logic.h1
-rw-r--r--queen/xref.txt4
5 files changed, 170 insertions, 16 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp
index ae6e5eadfd..1e9f0b60d9 100644
--- a/queen/cutaway.cpp
+++ b/queen/cutaway.cpp
@@ -317,22 +317,11 @@ void Cutaway::actionSpecialMove(int index) {
// c73e.cut - carbam background animation
case 7:
- _graphics->bobClear(5); // Car
- _graphics->bobClear(6); // FX
- _graphics->bobClear(7); // Rico
- _graphics->bob(5)->active = true;
- _graphics->bob(6)->active = true;
- _graphics->bob(7)->active = true;
+ _graphics->initCarBamScene();
break;
- // c74a.cut - Turn off big oil splat and gun shots!
case 8:
- {
- // XXX bamflag=0;
- uint16 oilBobIndex = _logic->findBob(594);
- _graphics->bob(oilBobIndex)->active = false;
- _graphics->bob(7)->active = false;
- }
+ _graphics->cleanupCarBamScene(_logic->findBob(594)); // Oil object
break;
// cdint.cut - put camera on Joe
diff --git a/queen/graphics.cpp b/queen/graphics.cpp
index cd991c8016..e1a8c78e3d 100644
--- a/queen/graphics.cpp
+++ b/queen/graphics.cpp
@@ -627,7 +627,7 @@ void Graphics::bobCustomParallax(uint16 roomNum) {
}
break;
case 74 : // Carbam
- warning("Graphics::bobCustomParallax() - room 74 not handled");
+ updateCarBamScene();
break;
case 69 : // Fight1
warning("Graphics::bobCustomParallax() - room 69 not handled");
@@ -824,6 +824,58 @@ void Graphics::journalBobPreDraw(GameConfig *cfg) {
}
+void Graphics::initCarBamScene() {
+
+ bobClear(5);
+ bobClear(6);
+ bobClear(7);
+ _bam.enable = true;
+ _bam.index = 0;
+}
+
+
+void Graphics::updateCarBamScene() {
+
+ if (_bam.enable) {
+ const CarBamData *cb = &CARBAM_DATA[_bam.index];
+ BobSlot *pbob;
+
+ // Truck
+ pbob = &_bobs[5];
+ pbob->curPos(cb->truck.x, cb->truck.y);
+ pbob->frameNum = 40 + cb->truck.frame;
+
+ // Rico
+ pbob = &_bobs[6];
+ pbob->curPos(cb->rico.x, cb->rico.y);
+ pbob->frameNum = 30 + cb->rico.frame;
+
+ // FX
+ pbob = &_bobs[7];
+ pbob->curPos(cb->fx.x, cb->fx.y);
+ pbob->frameNum = 41 + cb->fx.frame;
+
+ _bam.sfx = cb->sfx;
+ if (_bam.sfx == 99) {
+ _bam.index = 0;
+ }
+ else {
+ ++_bam.index;
+ }
+ // XXX if(bamsfx==2) // Play BKG SFX if(SFXTOGGLE) sfxplay(NULLstr);
+ }
+}
+
+
+void Graphics::cleanupCarBamScene(uint16 oilBobNum) {
+
+ _bam.enable = false;
+ //CR 2 - Turn off big oil splat and gun shots!
+ _bobs[oilBobNum].active = false;
+ _bobs[7].active = false;
+}
+
+
void Graphics::update(uint16 room) {
bobSortAll();
@@ -956,5 +1008,85 @@ int Graphics::textCenterX(const char *text) const {
return 160 - textWidth(text) / 2;
}
+
+
+const CarBamData Graphics::CARBAM_DATA[] = {
+ { { 310, 105, 1 }, { 314, 106, 17 }, { 366, 101, 1 }, 0 },
+ { { 303, 105, 1 }, { 307, 106, 17 }, { 214, 0, 10 }, 0 },
+ { { 297, 104, 1 }, { 301, 105, 17 }, { 214, 0, 10 }, 0 },
+ { { 294, 103, 1 }, { 298, 104, 17 }, { 214, 0, 10 }, 0 },
+ { { 291, 102, 1 }, { 295, 103, 18 }, { 214, 0, 10 }, 0 },
+ { { 287, 101, 1 }, { 291, 102, 18 }, { 266, 51, 10 }, 2 },
+ { { 283, 100, 1 }, { 287, 101, 19 }, { 279, 47, 11 }, 0 },
+ { { 279, 99, 1 }, { 283, 100, 20 }, { 294, 46, 12 }, 0 },
+ { { 274, 98, 1 }, { 278, 99, 20 }, { 305, 44, 13 }, 0 },
+ { { 269, 98, 1 }, { 273, 99, 20 }, { 320, 42, 14 }, 0 },
+ { { 264, 98, 1 }, { 268, 99, 17 }, { 214, 0, 10 }, 0 },
+ { { 261, 98, 1 }, { 265, 99, 17 }, { 214, 0, 10 }, 0 },
+ { { 259, 98, 1 }, { 263, 99, 17 }, { 214, 0, 10 }, 0 },
+ { { 258, 98, 1 }, { 262, 99, 17 }, { 214, 0, 10 }, 0 },
+ { { 257, 98, 2 }, { 260, 99, 17 }, { 214, 0, 10 }, 0 },
+ { { 255, 99, 3 }, { 258, 100, 17 }, { 214, 0, 10 }, 0 },
+ { { 258, 99, 4 }, { 257, 100, 17 }, { 214, 0, 10 }, 0 },
+ { { 264, 102, 4 }, { 263, 103, 17 }, { 214, 0, 10 }, 0 },
+ { { 272, 105, 5 }, { 274, 106, 17 }, { 214, 0, 10 }, 0 },
+ { { 276, 107, 5 }, { 277, 108, 17 }, { 214, 0, 10 }, 0 },
+ { { 283, 108, 5 }, { 284, 109, 17 }, { 214, 0, 10 }, 0 },
+ { { 288, 109, 5 }, { 288, 110, 17 }, { 214, 0, 10 }, 0 },
+ { { 293, 110, 5 }, { 293, 111, 18 }, { 266, 59, 10 }, 2 },
+ { { 298, 110, 5 }, { 299, 111, 18 }, { 277, 56, 11 }, 0 },
+ { { 303, 110, 5 }, { 304, 111, 19 }, { 285, 55, 12 }, 0 },
+ { { 308, 110, 4 }, { 307, 111, 20 }, { 296, 54, 13 }, 0 },
+ { { 309, 110, 3 }, { 312, 111, 20 }, { 304, 53, 14 }, 0 },
+ { { 310, 110, 3 }, { 313, 111, 20 }, { 214, 0, 10 }, 0 },
+ { { 311, 110, 3 }, { 314, 111, 17 }, { 214, 0, 10 }, 0 },
+ { { 309, 110, 2 }, { 312, 111, 17 }, { 214, 0, 10 }, 0 },
+ { { 304, 111, 2 }, { 307, 112, 17 }, { 214, 0, 10 }, 0 },
+ { { 300, 110, 2 }, { 303, 111, 17 }, { 214, 0, 10 }, 0 },
+ { { 296, 109, 2 }, { 299, 110, 17 }, { 214, 0, 10 }, 0 },
+ { { 292, 108, 1 }, { 296, 109, 17 }, { 214, 0, 10 }, 0 },
+ { { 285, 107, 2 }, { 289, 108, 17 }, { 214, 0, 10 }, 0 },
+ { { 282, 107, 3 }, { 285, 108, 17 }, { 214, 0, 10 }, 0 },
+ { { 278, 107, 4 }, { 277, 108, 18 }, { 214, 0, 10 }, 0 },
+ { { 279, 108, 4 }, { 278, 109, 18 }, { 252, 57, 10 }, 2 },
+ { { 281, 108, 5 }, { 283, 109, 18 }, { 265, 55, 11 }, 0 },
+ { { 284, 109, 5 }, { 285, 110, 19 }, { 277, 55, 12 }, 0 },
+ { { 287, 110, 5 }, { 288, 111, 20 }, { 288, 54, 13 }, 0 },
+ { { 289, 111, 5 }, { 290, 112, 20 }, { 299, 54, 14 }, 0 },
+ { { 291, 112, 4 }, { 290, 113, 20 }, { 214, 0, 10 }, 0 },
+ { { 293, 113, 3 }, { 295, 114, 17 }, { 214, 0, 10 }, 0 },
+ { { 296, 114, 2 }, { 299, 115, 17 }, { 214, 0, 10 }, 0 },
+ { { 295, 115, 2 }, { 298, 116, 17 }, { 214, 0, 10 }, 0 },
+ { { 293, 116, 1 }, { 297, 117, 17 }, { 214, 0, 10 }, 0 },
+ { { 289, 116, 1 }, { 292, 117, 17 }, { 214, 0, 10 }, 0 },
+ { { 285, 115, 1 }, { 289, 116, 17 }, { 214, 0, 10 }, 0 },
+ { { 281, 114, 1 }, { 284, 115, 17 }, { 214, 0, 10 }, 0 },
+ { { 277, 113, 1 }, { 280, 114, 17 }, { 214, 0, 10 }, 0 },
+ { { 274, 112, 1 }, { 277, 113, 17 }, { 214, 0, 10 }, 0 },
+ { { 271, 111, 1 }, { 274, 112, 17 }, { 214, 0, 10 }, 0 },
+ { { 267, 110, 1 }, { 270, 111, 17 }, { 214, 0, 10 }, 0 },
+ { { 263, 109, 1 }, { 266, 110, 17 }, { 214, 0, 10 }, 0 },
+ { { 260, 108, 1 }, { 263, 109, 17 }, { 214, 0, 10 }, 0 },
+ { { 254, 108, 2 }, { 256, 109, 17 }, { 214, 0, 10 }, 0 },
+ { { 252, 107, 3 }, { 254, 108, 17 }, { 214, 0, 10 }, 0 },
+ { { 253, 108, 3 }, { 255, 109, 17 }, { 214, 0, 10 }, 0 },
+ { { 255, 109, 3 }, { 257, 110, 18 }, { 231, 59, 10 }, 2 },
+ { { 258, 111, 3 }, { 260, 112, 18 }, { 242, 57, 11 }, 0 },
+ { { 263, 112, 4 }, { 262, 113, 19 }, { 256, 57, 12 }, 0 },
+ { { 270, 111, 4 }, { 269, 112, 20 }, { 267, 57, 13 }, 0 },
+ { { 274, 112, 5 }, { 276, 113, 20 }, { 281, 56, 14 }, 0 },
+ { { 280, 111, 6 }, { 282, 112, 19 }, { 214, 0, 10 }, 0 },
+ { { 284, 109, 6 }, { 285, 110, 17 }, { 214, 0, 10 }, 0 },
+ { { 289, 108, 6 }, { 291, 109, 17 }, { 214, 0, 10 }, 0 },
+ { { 294, 107, 6 }, { 296, 108, 17 }, { 214, 0, 10 }, 0 },
+ { { 294, 107, 5 }, { 296, 108, 18 }, { 272, 57, 10 }, 2 },
+ { { 295, 107, 5 }, { 297, 108, 18 }, { 282, 57, 11 }, 0 },
+ { { 296, 108, 5 }, { 298, 109, 19 }, { 295, 57, 12 }, 0 },
+ { { 300, 108, 4 }, { 299, 109, 20 }, { 303, 57, 13 }, 0 },
+ { { 303, 108, 3 }, { 306, 109, 20 }, { 313, 57, 14 }, 0 },
+ { { 307, 109, 2 }, { 311, 110, 17 }, { 214, 0, 10 }, 0 },
+ { { 310, 110, 1 }, { 314, 111, 17 }, { 214, 0, 10 }, 99 }
+};
+
} // End of namespace Queen
diff --git a/queen/graphics.h b/queen/graphics.h
index d6b36418e2..09762e2e6d 100644
--- a/queen/graphics.h
+++ b/queen/graphics.h
@@ -108,6 +108,29 @@ struct TextSlot {
};
+struct CarBamData {
+ struct Obj {
+ int16 x, y;
+ uint16 frame;
+ };
+ Obj truck;
+ Obj rico;
+ Obj fx;
+ int16 sfx;
+};
+
+
+struct BamData {
+ bool enable;
+ int16 index;
+ int16 sfx;
+
+ BamData()
+ : enable(false), index(0), sfx(0) {
+ }
+};
+
+
class Display;
class Input;
@@ -167,6 +190,11 @@ public:
void cameraBob(int bobNum) { _cameraBob = bobNum; }
int cameraBob() const { return _cameraBob; }
+ BamData *bamData() { return &_bam; }
+ void initCarBamScene();
+ void updateCarBamScene();
+ void cleanupCarBamScene(uint16 i);
+
void update(uint16 room);
@@ -205,10 +233,14 @@ private:
int _cameraBob; // cambob
+ BamData _bam;
+
Display *_display;
Input *_input;
Resource *_resource;
+ static const CarBamData CARBAM_DATA[];
+
};
} // End of namespace Queen
diff --git a/queen/logic.h b/queen/logic.h
index 40bf8d38c1..8fa5c22cec 100644
--- a/queen/logic.h
+++ b/queen/logic.h
@@ -279,6 +279,7 @@ public:
void inventoryDeleteItem(uint16 itemNum, bool refresh = true);
void inventoryScroll(uint16 count, bool up);
+
//! Copy data from dummy object to object
void objectCopy(int dummyObjectIndex, int objectIndex);
diff --git a/queen/xref.txt b/queen/xref.txt
index f9cdb4d417..9002a01263 100644
--- a/queen/xref.txt
+++ b/queen/xref.txt
@@ -232,6 +232,8 @@ A_FILE_MAX Logic::_numAFile
ACTOR_DATA_MAX Logic::_numActors
AREA Logic::_area
AREAMAX Logic::_areaMax
+bamflag Graphics::_bam.enable
+bamindex Graphics::_bam.index
DESCTOT Logic::_numDescriptions
ENTRY_OBJ Logic::_entryObj
FMAX Logic::_numFurnitureStatic
@@ -331,8 +333,6 @@ playsong()
sfxbusy()
sfxplay()
-
-bamflag
-bamindex
CURRSONG
SFXNAME Logic::_sfxName
tmpbamflag