[Scummvm-cvs-logs] SF.net SVN: scummvm:[55103] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Mon Jan 3 17:19:00 CET 2011


Revision: 55103
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55103&view=rev
Author:   strangerke
Date:     2011-01-03 16:19:00 +0000 (Mon, 03 Jan 2011)

Log Message:
-----------
HUGO: Load bitmaps from hugo.dat

- set menu bitmaps to 'on' buttons by default
- rename menu entries to match a bit better the original

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/hugo.h
    scummvm/trunk/engines/hugo/menu.cpp
    scummvm/trunk/engines/hugo/menu.h

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2011-01-03 16:15:52 UTC (rev 55102)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2011-01-03 16:19:00 UTC (rev 55103)
@@ -755,6 +755,7 @@
 	_object->loadNumObj(in);
 	_scheduler->loadAlNewscrIndex(in);
 	_screen->loadFontArr(in);
+	_topMenu->loadBmpArr(in);
 
 	return true;
 }

Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h	2011-01-03 16:15:52 UTC (rev 55102)
+++ scummvm/trunk/engines/hugo/hugo.h	2011-01-03 16:19:00 UTC (rev 55103)
@@ -36,7 +36,7 @@
 #include "hugo/file.h"
 
 #define HUGO_DAT_VER_MAJ 0                          // 1 byte
-#define HUGO_DAT_VER_MIN 35                         // 1 byte
+#define HUGO_DAT_VER_MIN 36                         // 1 byte
 #define DATAALIGNMENT    4
 #define EDGE             10                         // Closest object can get to edge of screen
 #define EDGE2            (EDGE * 2)                 // Push object further back on edge collision

Modified: scummvm/trunk/engines/hugo/menu.cpp
===================================================================
--- scummvm/trunk/engines/hugo/menu.cpp	2011-01-03 16:15:52 UTC (rev 55102)
+++ scummvm/trunk/engines/hugo/menu.cpp	2011-01-03 16:19:00 UTC (rev 55103)
@@ -25,6 +25,7 @@
 
 #include "hugo/hugo.h"
 #include "graphics/imagedec.h"
+#include "common/substream.h"
 
 namespace Hugo {
 
@@ -42,16 +43,16 @@
 enum {
 	kCmdWhat = 'WHAT',
 	kCmdMusic = 'MUZK',
-	kCmdVolume = 'VOLM',
+	kCmdSoundFX = 'SOUN',
 	kCmdLoad = 'LOAD',
 	kCmdSave = 'SAVE',
-	kCmdUndo = 'UNDO',
-	kCmdText = 'TEXT',
+	kCmdRecall = 'RECL',
+	kCmdTurbo = 'TURB',
 	kCmdLook = 'LOOK',
-	kCmdBomb = 'BOMB'
+	kCmdInvent = 'INVT'
 };
 
-TopMenu::TopMenu(HugoEngine *vm) : Dialog(0, 0, kMenuWidth, kMenuHeight),
+TopMenu::TopMenu(HugoEngine *vm) : Dialog(0, 0, kMenuWidth, kMenuHeight), arrayBmp(0),
 	_vm(vm) {
 	init();
 }
@@ -60,22 +61,13 @@
 	int x = kMenuX;
 	int y = kMenuY;
 
-	Graphics::Surface *surf;
-	Common::File in;
-
-	in.open("btn_1.bmp");
-	
-	surf = Graphics::ImageDecoder::loadFile(in, g_system->getOverlayFormat());
-
 	_whatButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "What is it?", kCmdWhat);
-	_whatButton->setGfx(surf);
-
 	x += kButtonWidth + kButtonPad;
 
 	_musicButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Music", kCmdMusic);
 	x += kButtonWidth + kButtonPad;
 
-	_volumeButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Volume", kCmdVolume);
+	_soundFXButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Sound FX", kCmdSoundFX);
 	x += kButtonWidth + kButtonPad;
 
 	x += kButtonSpace;
@@ -88,20 +80,44 @@
 
 	x += kButtonSpace;
 
-	_undoButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Undo", kCmdUndo);
+	_recallButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Recall last command", kCmdRecall);
 	x += kButtonWidth + kButtonPad;
 	
-	_textButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Text", kCmdText);
+	_turboButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Turbo", kCmdTurbo);
 	x += kButtonWidth + kButtonPad;
 
 	x += kButtonSpace;
 	
-	_lookButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Look", kCmdLook);
+	_lookButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Description of the scene", kCmdLook);
 	x += kButtonWidth + kButtonPad;
 	
-	_bombButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Bomb", kCmdBomb);
+	_inventButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Inventory", kCmdInvent);
 	x += kButtonWidth + kButtonPad;
 
 }
 
+void TopMenu::loadBmpArr(Common::File &in) {
+	uint16 arraySize = in.readUint16BE();
+
+	arrayBmp = (Graphics::Surface **)malloc(sizeof(Graphics::Surface *) * (arraySize));
+	for (int i = 0; i < arraySize; i++) {
+		uint16 bmpSize = in.readUint16BE();
+		uint32 filPos = in.pos();
+		Common::SeekableSubReadStream stream(&in, filPos, filPos + bmpSize); 
+		arrayBmp[i] = Graphics::ImageDecoder::loadFile(stream, g_system->getOverlayFormat());
+		in.skip(bmpSize);
+	}
+
+	// Set the graphics to the 'on' buttons 
+	_whatButton->setGfx(arrayBmp[2*kMenuWhat]);
+	_musicButton->setGfx(arrayBmp[2*kMenuMusic]);
+	_soundFXButton->setGfx(arrayBmp[2*kMenuSoundFX]);
+	_loadButton->setGfx(arrayBmp[2*kMenuLoad]);
+	_saveButton->setGfx(arrayBmp[2*kMenuSave]);
+	_recallButton->setGfx(arrayBmp[2*kMenuRecall]);
+	_turboButton->setGfx(arrayBmp[2*kMenuTurbo]);
+	_lookButton->setGfx(arrayBmp[2*kMenuLook]);
+	_inventButton->setGfx(arrayBmp[2*kMenuInventory]);
+}
+
 } // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/menu.h
===================================================================
--- scummvm/trunk/engines/hugo/menu.h	2011-01-03 16:15:52 UTC (rev 55102)
+++ scummvm/trunk/engines/hugo/menu.h	2011-01-03 16:19:00 UTC (rev 55103)
@@ -30,6 +30,18 @@
 
 namespace Hugo {
 
+enum MenuOption {
+	kMenuWhat = 0,
+	kMenuMusic,
+	kMenuSoundFX,
+	kMenuLoad,
+	kMenuSave,
+	kMenuRecall,
+	kMenuTurbo,
+	kMenuLook,
+	kMenuInventory
+};
+
 class TopMenu : public GUI::Dialog {
 public:
 	TopMenu(HugoEngine *vm);
@@ -41,6 +53,7 @@
 	void handleKeyDown(Common::KeyState state);
 	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
 	*/
+	void loadBmpArr(Common::File &in);
 
 protected:
 	void init();
@@ -49,13 +62,16 @@
 
 	GUI::PicButtonWidget *_whatButton;
 	GUI::PicButtonWidget *_musicButton;
-	GUI::PicButtonWidget *_volumeButton;
+	GUI::PicButtonWidget *_soundFXButton;
 	GUI::PicButtonWidget *_loadButton;
 	GUI::PicButtonWidget *_saveButton;
-	GUI::PicButtonWidget *_undoButton;
-	GUI::PicButtonWidget *_textButton;
+	GUI::PicButtonWidget *_recallButton;
+	GUI::PicButtonWidget *_turboButton;
 	GUI::PicButtonWidget *_lookButton;
-	GUI::PicButtonWidget *_bombButton;
+	GUI::PicButtonWidget *_inventButton;
+
+	Graphics::Surface **arrayBmp;
+
 };
 
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list