aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2014-02-14 17:12:00 +0100
committeruruk2014-02-14 17:12:09 +0100
commit616d9959f38c1facc2a0362173104dabe1ab1292 (patch)
tree56ebf5e7f3788831cc967e8b8b1859efd4cbffd0
parentc5e7aa8e93cbc1bea8442ac88a4e6db9873763e2 (diff)
downloadscummvm-rg350-616d9959f38c1facc2a0362173104dabe1ab1292.tar.gz
scummvm-rg350-616d9959f38c1facc2a0362173104dabe1ab1292.tar.bz2
scummvm-rg350-616d9959f38c1facc2a0362173104dabe1ab1292.zip
AVALANCHE: Move/rename/implement SEU::titles().
-rw-r--r--engines/avalanche/graphics.cpp33
-rw-r--r--engines/avalanche/graphics.h3
-rw-r--r--engines/avalanche/shootemup.cpp6
-rw-r--r--engines/avalanche/shootemup.h1
4 files changed, 37 insertions, 6 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index e1d92230a5..a1087375b2 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -698,6 +698,39 @@ void GraphicManager::helpDrawHighlight(byte which, Color color) {
}
/**
+ * @remarks Originally called 'titles'
+ */
+void GraphicManager::seuDrawTitle() {
+ Common::File file;
+
+ if (!file.open("shoot1.avd"))
+ error("AVALANCHE: ShootEmUp: File not found: shoot1.avd");
+
+ const uint16 width = 320;
+ const uint16 height = 200;
+
+ Graphics::Surface picture = loadPictureRaw(file, width, height);
+
+ Graphics::Surface doubledPicture;
+ doubledPicture.create(width * 2, height, Graphics::PixelFormat::createFormatCLUT8());
+
+ // These cycles are for doubling the picture's width.
+ for (int x = (width * 2) - 2 ; x >= 0; x -= 2) {
+ for (int y = 0; y < height; y++) {
+ *(byte *)doubledPicture.getBasePtr(x, y) = *(byte *)doubledPicture.getBasePtr(x + 1, y) = *(byte *)picture.getBasePtr(x / 2, y);
+ }
+ }
+
+ drawPicture(_surface, doubledPicture, 0, 0);
+ refreshScreen();
+
+ picture.free();
+ doubledPicture.free();
+
+ file.close();
+}
+
+/**
* This function mimics Pascal's getimage().
*/
Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index de7a07f271..536a2c2f1a 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -107,6 +107,9 @@ public:
void helpDrawButton(int y, byte which);
void helpDrawHighlight(byte which, Color color);
+ // Shoot em' up's functions:
+ void seuDrawTitle();
+
void clearAlso();
void clearTextBar();
void setAlsoLine(int x1, int y1, int x2, int y2, Color color);
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index 01c5a1977b..c9d089c23b 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -39,7 +39,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
}
void ShootEmUp::run() {
- titles();
+ _vm->_graphics->seuDrawTitle();
setup();
initRunner(20, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2);
initRunner(600, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2);
@@ -128,10 +128,6 @@ void ShootEmUp::initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8
warning("STUB: ShootEmUp::initRunner()");
}
-void ShootEmUp::titles() {
- warning("STUB: ShootEmUp::titles()");
-}
-
void ShootEmUp::moveAvvy() {
warning("STUB: ShootEmUp::moveAvvy()");
}
diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h
index 6a1f182881..db1f113817 100644
--- a/engines/avalanche/shootemup.h
+++ b/engines/avalanche/shootemup.h
@@ -58,7 +58,6 @@ private:
void instructions();
void setup();
void initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy);
- void titles();
void moveAvvy();
void readKbd();
void animate();