From 616d9959f38c1facc2a0362173104dabe1ab1292 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 14 Feb 2014 17:12:00 +0100 Subject: AVALANCHE: Move/rename/implement SEU::titles(). --- engines/avalanche/graphics.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'engines/avalanche/graphics.cpp') 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 @@ -697,6 +697,39 @@ void GraphicManager::helpDrawHighlight(byte which, Color color) { drawRectangle(Common::Rect(466, 38 + which * 27, 555, 63 + which * 27), 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(). */ -- cgit v1.2.3