[Scummvm-cvs-logs] SF.net SVN: scummvm:[52920] scummvm/trunk/engines/hugo
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Mon Sep 27 22:24:37 CEST 2010
Revision: 52920
http://scummvm.svn.sourceforge.net/scummvm/?rev=52920&view=rev
Author: strangerke
Date: 2010-09-27 20:24:36 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
HUGO: Add F3 behavior (recall), little cleanup
- Add F3 behavior
- Move drawStatusText() to Screen
Modified Paths:
--------------
scummvm/trunk/engines/hugo/display.cpp
scummvm/trunk/engines/hugo/display.h
scummvm/trunk/engines/hugo/hugo.cpp
scummvm/trunk/engines/hugo/hugo.h
scummvm/trunk/engines/hugo/parser.cpp
scummvm/trunk/engines/hugo/parser.h
Modified: scummvm/trunk/engines/hugo/display.cpp
===================================================================
--- scummvm/trunk/engines/hugo/display.cpp 2010-09-26 21:07:38 UTC (rev 52919)
+++ scummvm/trunk/engines/hugo/display.cpp 2010-09-27 20:24:36 UTC (rev 52920)
@@ -410,6 +410,25 @@
"ESC - Return to game");
}
+void Screen::drawStatusText() {
+ debugC(4, kDebugDisplay, "drawStatusText");
+
+ loadFont(U_FONT8);
+ uint16 sdx = stringLength(_vm._statusLine);
+ uint16 sdy = fontHeight() + 1; // + 1 for shadow
+ uint16 posX = 0;
+ uint16 posY = YPIX - sdy;
+
+ // Display the string and add rect to display list
+ writeStr(posX, posY, _vm._statusLine, _TLIGHTYELLOW);
+ displayList(D_ADD, posX, posY, sdx, sdy);
+
+ sdx = stringLength(_vm._scoreLine);
+ posY = 0;
+ writeStr(posX, posY, _vm._scoreLine, _TCYAN);
+ displayList(D_ADD, posX, posY, sdx, sdy);
+}
+
void Screen::drawShape(int x, int y, int color1, int color2) {
#define shapeSize 24
Modified: scummvm/trunk/engines/hugo/display.h
===================================================================
--- scummvm/trunk/engines/hugo/display.h 2010-09-26 21:07:38 UTC (rev 52919)
+++ scummvm/trunk/engines/hugo/display.h 2010-09-27 20:24:36 UTC (rev 52920)
@@ -51,6 +51,7 @@
void displayRect(int16 x, int16 y, int16 dx, int16 dy);
void drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int color);
void drawShape(int x, int y, int color1, int color2);
+ void drawStatusText();
void initDisplay();
virtual void loadFont(int16 fontId) = 0;
void moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2);
Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp 2010-09-26 21:07:38 UTC (rev 52919)
+++ scummvm/trunk/engines/hugo/hugo.cpp 2010-09-27 20:24:36 UTC (rev 52920)
@@ -310,7 +310,7 @@
screen().displayList(D_RESTORE); // Restore previous background
updateImages(); // Draw into _frontBuffer, compile display list
mouse().mouseHandler(); // Mouse activity - adds to display list
- parser().drawStatusText();
+ screen().drawStatusText();
screen().displayList(D_DISPLAY); // Blit the display list to screen
break;
case V_INVENT: // Accessing inventory
@@ -629,7 +629,6 @@
in.readUint16BE();
}
}
-
}
// TODO: For Hugo3, if not in story mode, set _objects[2].state to 3
Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h 2010-09-26 21:07:38 UTC (rev 52919)
+++ scummvm/trunk/engines/hugo/hugo.h 2010-09-27 20:24:36 UTC (rev 52920)
@@ -145,6 +145,9 @@
char _initFilename[20];
char _saveFilename[20];
+ command_t _statusLine;
+ command_t _scoreLine;
+
const HugoGameDescription *_gameDescription;
uint32 getFeatures() const;
Modified: scummvm/trunk/engines/hugo/parser.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser.cpp 2010-09-26 21:07:38 UTC (rev 52919)
+++ scummvm/trunk/engines/hugo/parser.cpp 2010-09-27 20:24:36 UTC (rev 52920)
@@ -98,10 +98,12 @@
_vm.sound().toggleMusic();
break;
case Common::KEYCODE_F3: // Repeat last line
+ gameStatus.recallFl = true;
+ break;
case Common::KEYCODE_F4: // Save game
case Common::KEYCODE_F5: // Restore game
case Common::KEYCODE_F9: // Boss button
- warning("STUB: KeyHandler() - F3-F9 (DOS)");
+ warning("STUB: KeyHandler() - F4-F5-F9 (DOS)");
break;
default: // Any other key
if (!gameStatus.storyModeFl) { // Keyboard disabled
@@ -184,8 +186,8 @@
lineIndex = strlen(cmdLine);
}
- sprintf(_statusLine, ">%s%c", cmdLine, cursor);
- sprintf(_scoreLine, "F1-Help %s Score: %d of %d Sound %s", (_config.turboFl) ? "T" : " ", _vm.getScore(), _vm.getMaxScore(), (_config.soundFl) ? "On" : "Off");
+ sprintf(_vm._statusLine, ">%s%c", cmdLine, cursor);
+ sprintf(_vm._scoreLine, "F1-Help %s Score: %d of %d Sound %s", (_config.turboFl) ? "T" : " ", _vm.getScore(), _vm.getMaxScore(), (_config.soundFl) ? "On" : "Off");
// See if "look" button pressed
if (gameStatus.lookFl) {
@@ -194,24 +196,6 @@
}
}
-void Parser::drawStatusText() {
- debugC(4, kDebugParser, "drawStatusText");
-
- _vm.screen().loadFont(U_FONT8);
- uint16 sdx = _vm.screen().stringLength(_statusLine);
- uint16 sdy = _vm.screen().fontHeight() + 1; // + 1 for shadow
- uint16 posX = 0;
- uint16 posY = YPIX - sdy;
- // Display the string and add rect to display list
- _vm.screen().writeStr(posX, posY, _statusLine, _TLIGHTYELLOW);
- _vm.screen().displayList(D_ADD, posX, posY, sdx, sdy);
-
- sdx = _vm.screen().stringLength(_scoreLine);
- posY = 0;
- _vm.screen().writeStr(posX, posY, _scoreLine, _TCYAN);
- _vm.screen().displayList(D_ADD, posX, posY, sdx, sdy);
-}
-
// Perform an immediate command. Takes parameters a la sprintf
// Assumes final string will not overrun line[] length
void Parser::command(const char *format, ...) {
Modified: scummvm/trunk/engines/hugo/parser.h
===================================================================
--- scummvm/trunk/engines/hugo/parser.h 2010-09-26 21:07:38 UTC (rev 52919)
+++ scummvm/trunk/engines/hugo/parser.h 2010-09-27 20:24:36 UTC (rev 52920)
@@ -49,7 +49,6 @@
void charHandler();
void command(const char *format, ...);
- void drawStatusText();
void keyHandler(uint16 nChar, uint16 nFlags);
void lineHandler();
@@ -61,9 +60,6 @@
uint16 _getIndex; // Index into ring buffer
bool _checkDoubleF1Fl; // Flag used to display user help or instructions
- command_t _statusLine;
- command_t _scoreLine;
-
bool isBackgroundWord(objectList_t obj, char *line);
bool isCarrying(uint16 wordIndex);
bool isCatchallVerb(objectList_t obj, char *line);
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