[Scummvm-cvs-logs] SF.net SVN: scummvm:[41239] scummvm/trunk/engines/agi
sev at users.sourceforge.net
sev at users.sourceforge.net
Sat Jun 6 19:39:14 CEST 2009
Revision: 41239
http://scummvm.svn.sourceforge.net/scummvm/?rev=41239&view=rev
Author: sev
Date: 2009-06-06 17:39:13 +0000 (Sat, 06 Jun 2009)
Log Message:
-----------
Whitespace fixes and C++ comments
Modified Paths:
--------------
scummvm/trunk/engines/agi/agi.cpp
scummvm/trunk/engines/agi/agi.h
scummvm/trunk/engines/agi/checks.cpp
scummvm/trunk/engines/agi/console.cpp
scummvm/trunk/engines/agi/cycle.cpp
scummvm/trunk/engines/agi/font.h
scummvm/trunk/engines/agi/global.cpp
scummvm/trunk/engines/agi/graphics.cpp
scummvm/trunk/engines/agi/id.cpp
scummvm/trunk/engines/agi/inv.cpp
scummvm/trunk/engines/agi/keyboard.cpp
scummvm/trunk/engines/agi/keyboard.h
scummvm/trunk/engines/agi/loader_v2.cpp
scummvm/trunk/engines/agi/loader_v3.cpp
scummvm/trunk/engines/agi/logic.cpp
scummvm/trunk/engines/agi/lzw.cpp
scummvm/trunk/engines/agi/menu.cpp
scummvm/trunk/engines/agi/menu.h
scummvm/trunk/engines/agi/motion.cpp
scummvm/trunk/engines/agi/objects.cpp
scummvm/trunk/engines/agi/op_cmd.cpp
scummvm/trunk/engines/agi/op_dbg.cpp
scummvm/trunk/engines/agi/op_test.cpp
scummvm/trunk/engines/agi/picture.cpp
scummvm/trunk/engines/agi/preagi.cpp
scummvm/trunk/engines/agi/preagi_mickey.cpp
scummvm/trunk/engines/agi/preagi_troll.cpp
scummvm/trunk/engines/agi/preagi_winnie.cpp
scummvm/trunk/engines/agi/predictive.cpp
scummvm/trunk/engines/agi/saveload.cpp
scummvm/trunk/engines/agi/sound.cpp
scummvm/trunk/engines/agi/sprite.cpp
scummvm/trunk/engines/agi/sprite.h
scummvm/trunk/engines/agi/text.cpp
scummvm/trunk/engines/agi/view.cpp
scummvm/trunk/engines/agi/view.h
scummvm/trunk/engines/agi/words.cpp
Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/agi.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,7 +23,6 @@
*
*/
-
#include "common/md5.h"
#include "common/events.h"
#include "common/file.h"
@@ -291,7 +290,7 @@
int AgiEngine::agiGetKeypressLow() {
int k;
- while (_keyQueueStart == _keyQueueEnd) /* block */
+ while (_keyQueueStart == _keyQueueEnd) // block
agiTimerLow();
keyDequeue(k);
@@ -358,16 +357,16 @@
debug(2, "initializing");
debug(2, "game.ver = 0x%x", _game.ver);
- /* initialize with adj.ego.move.to.x.y(0, 0) so to speak */
+ // initialize with adj.ego.move.to.x.y(0, 0) so to speak
_game.adjMouseX = _game.adjMouseY = 0;
- /* reset all flags to false and all variables to 0 */
+ // reset all flags to false and all variables to 0
for (i = 0; i < MAX_FLAGS; i++)
_game.flags[i] = 0;
for (i = 0; i < MAX_VARS; i++)
_game.vars[i] = 0;
- /* clear all resources and events */
+ // clear all resources and events
for (i = 0; i < MAX_DIRS; i++) {
memset(&_game.views[i], 0, sizeof(struct AgiView));
memset(&_game.pictures[i], 0, sizeof(struct AgiPicture));
@@ -379,7 +378,7 @@
memset(&_game.dirSound[i], 0, sizeof(struct AgiDir));
}
- /* clear view table */
+ // clear view table
for (i = 0; i < MAX_VIEWTABLE; i++)
memset(&_game.viewTable[i], 0, sizeof(VtEntry));
@@ -392,11 +391,11 @@
initPriTable();
- /* clear string buffer */
+ // clear string buffer
for (i = 0; i < MAX_STRINGS; i++)
_game.strings[i][0] = 0;
- /* setup emulation */
+ // setup emulation
switch (_loader->getIntVersion() >> 12) {
case 2:
@@ -427,19 +426,19 @@
if (_game.gameFlags & ID_AGDS)
report("AGDS mode enabled.\n");
- ec = _loader->init(); /* load vol files, etc */
+ ec = _loader->init(); // load vol files, etc
if (ec == errOK)
ec = _loader->loadObjects(OBJECTS);
- /* note: demogs has no words.tok */
+ // note: demogs has no words.tok
if (ec == errOK)
ec = _loader->loadWords(WORDS);
- /* FIXME: load IIgs instruments and samples */
- /* load_instruments("kq.sys16"); */
+ // FIXME: load IIgs instruments and samples
+ // load_instruments("kq.sys16");
- /* Load logic 0 into memory */
+ // Load logic 0 into memory
if (ec == errOK)
ec = _loader->loadResource(rLOGIC, 0);
@@ -459,7 +458,7 @@
void AgiEngine::agiUnloadResources() {
int i;
- /* Make sure logic 0 is always loaded */
+ // Make sure logic 0 is always loaded
for (i = 1; i < MAX_DIRS; i++) {
_loader->unloadResource(rLOGIC, i);
}
@@ -473,8 +472,8 @@
int AgiEngine::agiDeinit() {
int ec;
- cleanInput(); /* remove all words from memory */
- agiUnloadResources(); /* unload resources in memory */
+ cleanInput(); // remove all words from memory
+ agiUnloadResources(); // unload resources in memory
_loader->unloadResource(rLOGIC, 0);
ec = _loader->deinit();
unloadObjects();
@@ -744,7 +743,7 @@
_timer->installTimerProc(agiTimerFunctionLow, 10 * 1000, NULL);
- _game.ver = -1; /* Don't display the conf file warning */
+ _game.ver = -1; // Don't display the conf file warning
debugC(2, kDebugLevelMain, "Detect game");
@@ -805,7 +804,7 @@
mainCycle();
} while (_game.state < STATE_RUNNING);
if (_game.ver < 0)
- _game.ver = 0; /* Enable conf file warning */
+ _game.ver = 0; // Enable conf file warning
}
runGame();
Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/agi.h 2009-06-06 17:39:13 UTC (rev 41239)
@@ -42,9 +42,9 @@
typedef signed int Err;
-/*
- * Version and other definitions
- */
+//
+// Version and other definitions
+//
#define TITLE "AGI engine"
@@ -59,9 +59,9 @@
#define MAX_DIRS 256
#define MAX_VARS 256
#define MAX_FLAGS (256 >> 3)
-#define MAX_VIEWTABLE 255 /* KQ3 uses o255! */
+#define MAX_VIEWTABLE 255 // KQ3 uses o255!
#define MAX_WORDS 20
-#define MAX_STRINGS 24 /* MAX_STRINGS + 1 used for get.num */
+#define MAX_STRINGS 24 // MAX_STRINGS + 1 used for get.num
#define MAX_STRINGLEN 40
#ifndef MAX_PATH
#define MAX_PATH 260
@@ -77,12 +77,12 @@
#define INLINE
#endif
-#define MSG_BOX_COLOUR 0x0f /* White */
-#define MSG_BOX_TEXT 0x00 /* Black */
-#define MSG_BOX_LINE 0x04 /* Red */
-#define BUTTON_BORDER 0x00 /* Black */
-#define STATUS_FG 0x00 /* Black */
-#define STATUS_BG 0x0f /* White */
+#define MSG_BOX_COLOUR 0x0f // White
+#define MSG_BOX_TEXT 0x00 // Black
+#define MSG_BOX_LINE 0x04 // Red
+#define BUTTON_BORDER 0x00 // Black
+#define STATUS_FG 0x00 // Black
+#define STATUS_BG 0x0f // White
#define ADD_PIC 1
#define ADD_VIEW 2
@@ -113,7 +113,7 @@
} // End of namespace Agi
-/* AGI resources */
+// AGI resources
#include "agi/console.h"
#include "agi/view.h"
#include "agi/picture.h"
@@ -128,13 +128,13 @@
GType_V3 = 2
};
-/*
- * GF_OLDAMIGAV20 means that the interpreter is an old Amiga AGI interpreter that
- * uses value 20 for the computer type (v20 i.e. vComputer) rather than the usual value 5.
- *
- * GF_CLIPCOORDS means that views' coordinates must be clipped at least in commands
- * position and position.v.
- */
+//
+// GF_OLDAMIGAV20 means that the interpreter is an old Amiga AGI interpreter that
+// uses value 20 for the computer type (v20 i.e. vComputer) rather than the usual value 5.
+//
+// GF_CLIPCOORDS means that views' coordinates must be clipped at least in commands
+// position and position.v.
+//
enum AgiGameFeatures {
GF_AGIMOUSE = (1 << 0),
GF_AGDS = (1 << 1),
@@ -241,32 +241,32 @@
* AGI variables.
*/
enum {
- vCurRoom = 0, /* 0 */
+ vCurRoom = 0, // 0
vPrevRoom,
vBorderTouchEgo,
vScore,
vBorderCode,
- vBorderTouchObj, /* 5 */
+ vBorderTouchObj, // 5
vEgoDir,
vMaxScore,
vFreePages,
vWordNotFound,
- vTimeDelay, /* 10 */
+ vTimeDelay, // 10
vSeconds,
vMinutes,
vHours,
vDays,
- vJoystickSensitivity, /* 15 */
+ vJoystickSensitivity, // 15
vEgoViewResource,
vAgiErrCode,
vAgiErrCodeInfo,
vKey,
- vComputer, /* 20 */
+ vComputer, // 20
vWindowReset,
vSoundgen,
vVolume,
vMaxInputChars,
- vSelItem, /* 25 */
+ vSelItem, // 25
vMonitor
};
@@ -315,22 +315,22 @@
* AGI flags
*/
enum {
- fEgoWater = 0, /* 0 */
+ fEgoWater = 0, // 0
fEgoInvisible,
fEnteredCli,
fEgoTouchedP2,
fSaidAcceptedInput,
- fNewRoomExec, /* 5 */
+ fNewRoomExec, // 5
fRestartGame,
fScriptBlocked,
fJoySensitivity,
fSoundOn,
- fDebuggerOn, /* 10 */
+ fDebuggerOn, // 10
fLogicZeroFirsttime,
fRestoreJustRan,
fStatusSelectsItems,
fMenusWork,
- fOutputMode, /* 15 */
+ fOutputMode, // 15
fAutoRestart,
fNoSaveLoadAllowed
};
@@ -355,20 +355,20 @@
uint32 offset;
uint32 len;
uint32 clen;
+
+ // 0 = not in mem, can be freed
+ // 1 = in mem, can be released
+ // 2 = not in mem, cant be released
+ // 3 = in mem, cant be released
+ // 0x40 = was compressed
uint8 flags;
- /* 0 = not in mem, can be freed
- * 1 = in mem, can be released
- * 2 = not in mem, cant be released
- * 3 = in mem, cant be released
- * 0x40 = was compressed
- */
};
struct AgiBlock {
int active;
int x1, y1;
int x2, y2;
- uint8 *buffer; /* used for window background */
+ uint8 *buffer; // used for window background
};
/** AGI text color (Background and foreground color). */
@@ -508,11 +508,11 @@
char id[8]; /**< game id */
uint32 crc; /**< game CRC */
- /* game flags and variables */
+ // game flags and variables
uint8 flags[MAX_FLAGS]; /**< 256 1-bit flags */
uint8 vars[MAX_VARS]; /**< 256 variables */
- /* internal variables */
+ // internal variables
int horizon; /**< horizon y coordinate */
int lineStatus; /**< line number to put status on */
int lineUserInput; /**< line to put user input on */
@@ -529,7 +529,7 @@
int inputEnabled; /**< keyboard input enabled */
int lognum; /**< current logic number */
- /* internal flags */
+ // internal flags
int playerControl; /**< player is in control */
int statusLine; /**< status line on/off */
int clockEnabled; /**< clock is on/off */
@@ -542,13 +542,13 @@
uint8 priTable[_HEIGHT];/**< priority table */
- /* windows */
+ // windows
uint32 msgBoxTicks; /**< timed message box tick counter */
AgiBlock block;
AgiBlock window;
int hasWindow;
- /* graphics & text */
+ // graphics & text
int gfxMode;
char cursorChar;
unsigned int colorFg;
@@ -562,7 +562,7 @@
uint8 *sbuf256c; /**< 160x168 256 color AGI screen buffer (For AGI256 and AGI256-2 support). Points at sbufOrig + SBUF256_OFFSET. */
uint8 *sbuf; /**< Currently chosen AGI screen buffer (sbuf256c if AGI256 or AGI256-2 is used, otherwise sbuf16c). */
- /* player command line */
+ // player command line
AgiWord egoWords[MAX_WORDS];
int numEgoWords;
@@ -571,19 +571,19 @@
AgiEvent evKeyp[MAX_DIRS]; /**< keyboard keypress events */
char strings[MAX_STRINGS + 1][MAX_STRINGLEN]; /**< strings */
- /* directory entries for resources */
+ // directory entries for resources
AgiDir dirLogic[MAX_DIRS];
AgiDir dirPic[MAX_DIRS];
AgiDir dirView[MAX_DIRS];
AgiDir dirSound[MAX_DIRS];
- /* resources */
+ // resources
AgiPicture pictures[MAX_DIRS]; /**< AGI picture resources */
AgiLogic logics[MAX_DIRS]; /**< AGI logic resources */
AgiView views[MAX_DIRS]; /**< AGI view resources */
AgiSound *sounds[MAX_DIRS]; /**< Pointers to AGI sound resources */
- /* view table */
+ // view table
VtEntry viewTable[MAX_VIEWTABLE];
int32 ver; /**< detected game version */
@@ -670,7 +670,7 @@
extern struct Mouse g_mouse;
-/* Image stack support */
+// Image stack support
struct ImageStackElement {
uint8 type;
uint8 pad;
@@ -792,7 +792,7 @@
int _firstSlot;
public:
- AgiObject *_objects; /* objects in the game */
+ AgiObject *_objects; // objects in the game
StringData _stringdata;
@@ -817,7 +817,7 @@
SpritesMgr *_sprites;
SoundMgr *_sound;
PictureMgr *_picture;
- AgiLoader *_loader; /* loader */
+ AgiLoader *_loader; // loader
Common::Stack<ImageStackElement> _imageStack;
Modified: scummvm/trunk/engines/agi/checks.cpp
===================================================================
--- scummvm/trunk/engines/agi/checks.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/checks.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,7 +23,6 @@
*
*/
-
#include "agi/agi.h"
namespace Agi {
@@ -41,7 +40,7 @@
return 0;
}
- /* MH1 needs this, but it breaks LSL1 */
+ // MH1 needs this, but it breaks LSL1
if (agiGetRelease() >= 0x3000) {
if (v->yPos < v->ySize)
return 0;
@@ -66,21 +65,21 @@
if (u->flags & IGNORE_OBJECTS)
continue;
- /* Same object, check next */
+ // Same object, check next
if (v->entry == u->entry)
continue;
- /* No horizontal overlap, check next */
+ // No horizontal overlap, check next
if (v->xPos + v->xSize < u->xPos || v->xPos > u->xPos + u->xSize)
continue;
- /* Same y, return error! */
+ // Same y, return error!
if (v->yPos == u->yPos) {
debugC(4, kDebugLevelSprites, "check returns 1 (object %d)", v->entry);
return 1;
}
- /* Crossed the baseline, return error! */
+ // Crossed the baseline, return error!
if ((v->yPos > u->yPos && v->yPos2 < u->yPos2) ||
(v->yPos < u->yPos && v->yPos2 > u->yPos2)) {
debugC(4, kDebugLevelSprites, "check returns 1 (object %d)", v->entry);
@@ -97,7 +96,7 @@
uint8 *p0;
if (~v->flags & FIXED_PRIORITY) {
- /* Priority bands */
+ // Priority bands
v->priority = _game.priTable[v->yPos];
}
@@ -122,17 +121,17 @@
for (i = 0; i < v->xSize; i++, p0++) {
pri = *p0 >> 4;
- if (pri == 0) { /* unconditional black. no go at all! */
+ if (pri == 0) { // unconditional black. no go at all!
pass = 0;
break;
}
- if (pri == 3) /* water surface */
+ if (pri == 3) // water surface
continue;
water = 0;
- if (pri == 1) { /* conditional blue */
+ if (pri == 1) { // conditional blue
if (v->flags & IGNORE_BLOCKS)
continue;
@@ -141,7 +140,7 @@
break;
}
- if (pri == 2) { /* trigger */
+ if (pri == 2) { // trigger
debugC(4, kDebugLevelSprites, "stepped on trigger");
if (!_debug.ignoretriggers)
trigger = 1;
@@ -198,7 +197,7 @@
x = oldX = v->xPos;
y = oldY = v->yPos;
- /* If object has moved, update its position */
+ // If object has moved, update its position
if (~v->flags & UPDATE_POS) {
int dx[9] = { 0, 0, 1, 1, 1, 0, -1, -1, -1 };
int dy[9] = { 0, -1, -1, 0, 1, 1, 1, 0, -1 };
@@ -206,18 +205,18 @@
y += v->stepSize * dy[v->direction];
}
- /* Now check if it touched the borders */
+ // Now check if it touched the borders
border = 0;
- /* Check left/right borders */
+ // Check left/right borders
if (x < 0) {
x = 0;
border = 4;
- } else if (x <= 0 && agiGetRelease() == 0x3086) { /* KQ4 */
- x = 0; /* See Sarien bug #590462 */
+ } else if (x <= 0 && agiGetRelease() == 0x3086) { // KQ4
+ x = 0; // See Sarien bug #590462
border = 4;
} else if (v->entry == 0 && x == 0 && v->flags & ADJ_EGO_XY) {
- /* Extra test to walk west clicking the mouse */
+ // Extra test to walk west clicking the mouse
x = 0;
border = 4;
} else if (x + v->xSize > _WIDTH) {
@@ -225,7 +224,7 @@
border = 2;
}
- /* Check top/bottom borders. */
+ // Check top/bottom borders.
if (y - v->ySize + 1 < 0) {
y = v->ySize - 1;
border = 1;
@@ -238,7 +237,7 @@
border = 1;
}
- /* Test new position. rollback if test fails */
+ // Test new position. rollback if test fails
v->xPos = x;
v->yPos = y;
if (checkCollision(v) || !checkPriority(v)) {
@@ -279,7 +278,7 @@
debugC(4, kDebugLevelSprites, "adjusting view table entry #%d (%d,%d)", n, v->xPos, v->yPos);
- /* test horizon */
+ // test horizon
if ((~v->flags & IGNORE_HORIZON) && v->yPos <= _game.horizon)
v->yPos = _game.horizon + 1;
@@ -288,26 +287,26 @@
while (!checkPosition(v) || checkCollision(v) || !checkPriority(v)) {
switch (dir) {
- case 0: /* west */
+ case 0: // west
v->xPos--;
if (--count)
continue;
dir = 1;
break;
- case 1: /* south */
+ case 1: // south
v->yPos++;
if (--count)
continue;
dir = 2;
size++;
break;
- case 2: /* east */
+ case 2: // east
v->xPos++;
if (--count)
continue;
dir = 3;
break;
- case 3: /* north */
+ case 3: // north
v->yPos--;
if (--count)
continue;
Modified: scummvm/trunk/engines/agi/console.cpp
===================================================================
--- scummvm/trunk/engines/agi/console.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/console.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -288,7 +288,7 @@
Winnie_Console::Winnie_Console(PreAgiEngine *vm, Winnie *winnie) : PreAGI_Console(vm) {
_winnie = winnie;
- DCmd_Register("curRoom", WRAP_METHOD(Winnie_Console, Cmd_CurRoom));
+ DCmd_Register("curRoom", WRAP_METHOD(Winnie_Console, Cmd_CurRoom));
}
bool Winnie_Console::Cmd_CurRoom(int argc, const char **argv) {
Modified: scummvm/trunk/engines/agi/cycle.cpp
===================================================================
--- scummvm/trunk/engines/agi/cycle.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/cycle.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,7 +23,6 @@
*
*/
-
#include "agi/agi.h"
#include "agi/sprite.h"
#include "agi/graphics.h"
@@ -68,7 +67,7 @@
agiLoadResource(rLOGIC, n);
- /* Reposition ego in the new room */
+ // Reposition ego in the new room
switch (_game.vars[vBorderTouchEgo]) {
case 1:
_game.viewTable[0].yPos = _HEIGHT - 1;
@@ -183,12 +182,12 @@
_game.inputMode = _oldMode;
}
-/* If main_cycle returns false, don't process more events! */
+// If main_cycle returns false, don't process more events!
int AgiEngine::mainCycle() {
unsigned int key, kascii;
VtEntry *v = &_game.viewTable[0];
- _gfx->pollTimer(); /* msdos driver -> does nothing */
+ _gfx->pollTimer(); // msdos driver -> does nothing
updateTimer();
if (_game.ver == 0) {
@@ -198,9 +197,8 @@
key = doPollKeyboard();
- /* In AGI Mouse emulation mode we must update the mouse-related
- * vars in every interpreter cycle.
- */
+ // In AGI Mouse emulation mode we must update the mouse-related
+ // vars in every interpreter cycle.
if (getFeatures() & GF_AGIMOUSE) {
_game.vars[28] = g_mouse.x / 2;
_game.vars[29] = g_mouse.y;
@@ -220,7 +218,7 @@
key = 0;
}
- /* Click-to-walk mouse interface */
+ // Click-to-walk mouse interface
if (_game.playerControl && v->flags & ADJ_EGO_XY) {
int toX = v->parm1;
int toY = v->parm2;
@@ -257,25 +255,25 @@
break;
handleKeys(key);
- /* if ESC pressed, activate menu before
- * accept.input from the interpreter cycle
- * sets the input mode to normal again
- * (closes: #540856)
- */
+ // if ESC pressed, activate menu before
+ // accept.input from the interpreter cycle
+ // sets the input mode to normal again
+ // (closes: #540856)
if (key == KEY_ESCAPE) {
key = 0;
goto process_key;
}
- /* commented out to close Sarien bug #438872
- * if (key) game.keypress = key;
- */
+ // commented out to close Sarien bug #438872
+ // if (key)
+ // game.keypress = key;
+
}
break;
case INPUT_GETSTRING:
handleController(key);
handleGetstring(key);
- setvar(vKey, 0); /* clear ENTER key */
+ setvar(vKey, 0); // clear ENTER key
break;
case INPUT_MENU:
_menu->keyhandler(key);
@@ -307,10 +305,10 @@
_game.horizon = HORIZON;
_game.playerControl = false;
- setflag(fLogicZeroFirsttime, true); /* not in 2.917 */
- setflag(fNewRoomExec, true); /* needed for MUMG and SQ2! */
- setflag(fSoundOn, true); /* enable sound */
- setvar(vTimeDelay, 2); /* "normal" speed */
+ setflag(fLogicZeroFirsttime, true); // not in 2.917
+ setflag(fNewRoomExec, true); // needed for MUMG and SQ2!
+ setflag(fSoundOn, true); // enable sound
+ setvar(vTimeDelay, 2); // "normal" speed
_game.gfxMode = true;
_game.clockEnabled = true;
@@ -378,7 +376,7 @@
for (i = 0; i < MAX_DIRS; i++)
memset(&_game.evKeyp[i], 0, sizeof(struct AgiEvent));
- /* Execute the game */
+ // Execute the game
do {
debugC(2, kDebugLevelMain, "game loop");
debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver);
@@ -411,7 +409,7 @@
break;
}
- setvar(vSoundgen, 1); /* IBM PC SOUND */
+ setvar(vSoundgen, 1); // IBM PC SOUND
// Set monitor type (v26 i.e. vMonitor)
switch (_renderMode) {
Modified: scummvm/trunk/engines/agi/font.h
===================================================================
--- scummvm/trunk/engines/agi/font.h 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/font.h 2009-06-06 17:39:13 UTC (rev 41239)
@@ -26,25 +26,23 @@
#ifndef AGI_FONT_H
#define AGI_FONT_H
-
-
#include "agi/agi.h"
namespace Agi {
-/* 8x8 font patterns */
+// 8x8 font patterns
static const uint8 curFont[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x7E, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7E, /* cursor hollow */
- 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, /* cursor solid */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* cursor empty */
+ 0x7E, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7E, // cursor hollow
+ 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, // cursor solid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // cursor empty
0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x3C, 0x3C, 0x18, 0xFF, 0xE7, 0x18, 0x3C, 0x00,
0x10, 0x38, 0x7C, 0xFE, 0xEE, 0x10, 0x38, 0x00,
0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00,
0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF,
0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* \n */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // \n
0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78,
0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18,
0x08, 0x0C, 0x0A, 0x0A, 0x08, 0x78, 0xF0, 0x00,
@@ -161,8 +159,8 @@
0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00,
0xE0, 0x30, 0x30, 0x18, 0x30, 0x30, 0xE0, 0x00,
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /*0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00, */
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /*replacement 0x7F */
+ //0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, //replacement 0x7F
0x1E, 0x36, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x00,
0x7C, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x00,
Modified: scummvm/trunk/engines/agi/global.cpp
===================================================================
--- scummvm/trunk/engines/agi/global.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/global.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,8 +23,6 @@
*
*/
-
-
#include "agi/agi.h"
namespace Agi {
@@ -41,16 +39,16 @@
set += n >> 3;
if (v)
- *set |= 1 << (n & 0x07); /* set bit */
+ *set |= 1 << (n & 0x07); // set bit
else
- *set &= ~(1 << (n & 0x07)); /* clear bit */
+ *set &= ~(1 << (n & 0x07)); // clear bit
}
void AgiBase::flipflag(int n) {
uint8 *set = (uint8 *)&_game.flags;
set += n >> 3;
- *set ^= 1 << (n & 0x07); /* flip bit */
+ *set ^= 1 << (n & 0x07); // flip bit
}
void AgiEngine::setvar(int var, int val) {
Modified: scummvm/trunk/engines/agi/graphics.cpp
===================================================================
--- scummvm/trunk/engines/agi/graphics.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/graphics.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -505,22 +505,22 @@
};
static const uint16 cgaMap[16] = {
- 0x0000, /* 0 - black */
- 0x0d00, /* 1 - blue */
- 0x0b00, /* 2 - green */
- 0x0f00, /* 3 - cyan */
- 0x000b, /* 4 - red */
- 0x0b0d, /* 5 - magenta */
- 0x000d, /* 6 - brown */
- 0x0b0b, /* 7 - gray */
- 0x0d0d, /* 8 - dark gray */
- 0x0b0f, /* 9 - light blue */
- 0x0b0d, /* 10 - light green */
- 0x0f0d, /* 11 - light cyan */
- 0x0f0d, /* 12 - light red */
- 0x0f00, /* 13 - light magenta */
- 0x0f0b, /* 14 - yellow */
- 0x0f0f /* 15 - white */
+ 0x0000, // 0 - black
+ 0x0d00, // 1 - blue
+ 0x0b00, // 2 - green
+ 0x0f00, // 3 - cyan
+ 0x000b, // 4 - red
+ 0x0b0d, // 5 - magenta
+ 0x000d, // 6 - brown
+ 0x0b0b, // 7 - gray
+ 0x0d0d, // 8 - dark gray
+ 0x0b0f, // 9 - light blue
+ 0x0b0d, // 10 - light green
+ 0x0f0d, // 11 - light cyan
+ 0x0f0d, // 12 - light red
+ 0x0f00, // 13 - light magenta
+ 0x0f0b, // 14 - yellow
+ 0x0f0f // 15 - white
};
struct UpdateBlock {
@@ -540,22 +540,22 @@
}
-/*
- * Layer 4: 640x480? ================== User display
- * ^
- * | do_update(), put_block()
- * |
- * Layer 3: 640x480? ================== Framebuffer
- * ^
- * | flush_block(), put_pixels()
- * |
- * Layer 2: 320x200 ================== AGI engine screen (console), put_pixel()
- * |
- * Layer 1: 160x336 ================== AGI screen
- *
- * Upper half (160x168) of Layer 1 is for the normal 16 color & control line/priority info.
- * Lower half (160x168) of Layer 1 is for the 256 color information (Used with AGI256 & AGI256-2).
- */
+//
+// Layer 4: 640x480? ================== User display
+// ^
+// | do_update(), put_block()
+// |
+// Layer 3: 640x480? ================== Framebuffer
+// ^
+// | flush_block(), put_pixels()
+// |
+// Layer 2: 320x200 ================== AGI engine screen (console), put_pixel()
+// |
+// Layer 1: 160x336 ================== AGI screen
+//
+// Upper half (160x168) of Layer 1 is for the normal 16 color & control line/priority info.
+// Lower half (160x168) of Layer 1 is for the 256 color information (Used with AGI256 & AGI256-2).
+//
#define SHAKE_MAG 3
@@ -638,9 +638,8 @@
_agiScreen[xx + yy * GFX_WIDTH] = 15;
}
- /* FIXME: we don't want this when we're writing on the
- * console!
- */
+ // FIXME: we don't want this when we're writing on the
+ // console!
flushBlock(x, y, x + CHAR_COLS - 1, y + CHAR_LINES - 1);
}
@@ -670,16 +669,16 @@
int y, w;
uint8 *p0;
- /* top line */
+ // top line
w = x2 - x1 + 1;
p0 = &_agiScreen[x1 + y1 * GFX_WIDTH];
memset(p0, c1, w);
- /* bottom line */
+ // bottom line
p0 = &_agiScreen[x1 + y2 * GFX_WIDTH];
memset(p0, c2, w);
- /* side lines */
+ // side lines
for (y = y1; y <= y2; y++) {
_agiScreen[x1 + y * GFX_WIDTH] = c1;
_agiScreen[x2 + y * GFX_WIDTH] = c2;
@@ -890,7 +889,7 @@
return _agipalFileNum;
}
-/* put a block onto the screen */
+// put a block onto the screen
void GfxMgr::gfxPutBlock(int x1, int y1, int x2, int y2) {
if (x1 >= GFX_WIDTH)
x1 = GFX_WIDTH - 1;
@@ -1151,7 +1150,7 @@
gfxPutBlock(update.x1, update.y1, update.x2, update.y2);
}
- /* reset update block variables */
+ // reset update block variables
update.x1 = MAX_INT;
update.y1 = MAX_INT;
update.x2 = 0;
Modified: scummvm/trunk/engines/agi/id.cpp
===================================================================
--- scummvm/trunk/engines/agi/id.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/id.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -41,13 +41,13 @@
return setupV2Game(ver, 0);
}
-/*
- * Currently, there is no known difference between v3.002.098 -> v3.002.149
- * So version emulated;
- *
- * 0x0086,
- * 0x0149
- */
+//
+// Currently, there is no known difference between v3.002.098 -> v3.002.149
+// So version emulated;
+//
+// 0x0086,
+// 0x0149
+//
int AgiEngine::v3IdGame() {
int ver;
@@ -74,7 +74,7 @@
// Should this go above the previous lines, so we can force emulation versions
// even for AGDS games? -- dsymonds
if (getFeatures() & GF_AGDS)
- agiSetRelease(ver = 0x2440); /* ALL AGDS games built for 2.440 */
+ agiSetRelease(ver = 0x2440); // ALL AGDS games built for 2.440
report("Setting up for version 0x%04X\n", ver);
Modified: scummvm/trunk/engines/agi/inv.cpp
===================================================================
--- scummvm/trunk/engines/agi/inv.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/inv.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,8 +23,6 @@
*
*/
-
-
#include "agi/agi.h"
#include "agi/sprite.h"
#include "agi/graphics.h"
@@ -32,9 +30,9 @@
namespace Agi {
-/*
- * Messages and coordinates
- */
+//
+// Messages and coordinates
+//
#define NOTHING_X 16
#define NOTHING_Y 3
@@ -92,7 +90,7 @@
for (x = i = 0; x < _game.numObjects; x++) {
if (objectGetLocation(x) == EGO_OWNED) {
- /* add object to our list! */
+ // add object to our list!
_intobj[i] = x;
printItem(i, STATUS_FG, STATUS_BG);
i++;
@@ -182,7 +180,7 @@
int oldFg, oldBg;
int n;
- /* screen is white with black text */
+ // screen is white with black text
oldFg = _game.colorFg;
oldBg = _game.colorBg;
_game.colorFg = 0;
@@ -198,7 +196,7 @@
break;
}
- /* FIXME: doesn't check if objects overflow off screen... */
+ // FIXME: doesn't check if objects overflow off screen...
_intobj = (uint8 *)malloc(4 + _game.numObjects);
memset(_intobj, 0, (4 + _game.numObjects));
@@ -224,10 +222,9 @@
_gfx->flushScreen();
- /* If flag 13 is set, we want to highlight & select an item.
- * opon selection, put objnum in var 25. Then on esc put in
- * var 25 = 0xff.
- */
+ // If flag 13 is set, we want to highlight & select an item.
+ // opon selection, put objnum in var 25. Then on esc put in
+ // var 25 = 0xff.
if (getflag(fStatusSelectsItems))
selectItems(n);
Modified: scummvm/trunk/engines/agi/keyboard.cpp
===================================================================
--- scummvm/trunk/engines/agi/keyboard.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/keyboard.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -35,36 +35,36 @@
namespace Agi {
-/*
- * IBM-PC keyboard scancodes
- */
+//
+// IBM-PC keyboard scancodes
+//
uint8 scancodeTable[26] = {
- 30, /* A */
- 48, /* B */
- 46, /* C */
- 32, /* D */
- 18, /* E */
- 33, /* F */
- 34, /* G */
- 35, /* H */
- 23, /* I */
- 36, /* J */
- 37, /* K */
- 38, /* L */
- 50, /* M */
- 49, /* N */
- 24, /* O */
- 25, /* P */
- 16, /* Q */
- 19, /* R */
- 31, /* S */
- 20, /* T */
- 22, /* U */
- 47, /* V */
- 17, /* W */
- 45, /* X */
- 21, /* Y */
- 44 /* Z */
+ 30, // A
+ 48, // B
+ 46, // C
+ 32, // D
+ 18, // E
+ 33, // F
+ 34, // G
+ 35, // H
+ 23, // I
+ 36, // J
+ 37, // K
+ 38, // L
+ 50, // M
+ 49, // N
+ 24, // O
+ 25, // P
+ 16, // Q
+ 19, // R
+ 31, // S
+ 20, // T
+ 22, // U
+ 47, // V
+ 17, // W
+ 45, // X
+ 21, // Y
+ 44 // Z
};
void AgiEngine::initWords() {
@@ -93,7 +93,7 @@
int AgiEngine::doPollKeyboard() {
int key = 0;
- /* If a key is ready, rip it */
+ // If a key is ready, rip it
if (_gfx->keypress()) {
key = _gfx->getKey();
@@ -114,8 +114,9 @@
return false;
if ((getGameID() == GID_MH1 || getGameID() == GID_MH2) && (key == KEY_ENTER) &&
- (_game.inputMode == INPUT_NONE))
+ (_game.inputMode == INPUT_NONE)) {
key = 0x20; // Set Enter key to Space in Manhunter when there's no text input
+ }
debugC(3, kDebugLevelInput, "key = %04x", key);
@@ -184,7 +185,7 @@
}
if (!(getFeatures() & GF_AGIMOUSE)) {
- /* Handle mouse button events */
+ // Handle mouse button events
if (key == BUTTON_LEFT) {
v->flags |= ADJ_EGO_XY;
v->parm1 = WIN_TO_PIC_X(g_mouse.x);
@@ -205,7 +206,7 @@
}
void AgiEngine::handleGetstring(int key) {
- static int pos = 0; /* Cursor position */
+ static int pos = 0; // Cursor position
static char buf[40];
if (KEY_ASCII(key) == 0)
@@ -230,9 +231,11 @@
debugC(3, kDebugLevelInput, "KEY_ENTER");
_game.hasPrompt = 0;
buf[pos] = 0;
+
strcpy(_game.strings[_stringdata.str], buf);
debugC(3, kDebugLevelInput, "buffer=[%s]", buf);
buf[pos = 0] = 0;
+
newInputMode(INPUT_NORMAL);
_gfx->printCharacter(_stringdata.x + strlen(_game.strings[_stringdata.str]) + 1,
_stringdata.y, ' ', _game.colorFg, _game.colorBg);
@@ -241,11 +244,13 @@
debugC(3, kDebugLevelInput, "KEY_ESCAPE");
_game.hasPrompt = 0;
buf[pos = 0] = 0;
+
strcpy(_game.strings[_stringdata.str], buf);
newInputMode(INPUT_NORMAL);
- /* newInputMode(INPUT_MENU); */
+
+ // newInputMode(INPUT_MENU);
break;
- case KEY_BACKSPACE: /*0x08: */
+ case KEY_BACKSPACE: // 0x08
if (!pos)
break;
@@ -264,14 +269,14 @@
buf[pos++] = key;
buf[pos] = 0;
- /* Echo */
+ // Echo
_gfx->printCharacter(_stringdata.x + pos, _stringdata.y, buf[pos - 1],
_game.colorFg, _game.colorBg);
break;
}
- /* print cursor */
+ // print cursor
_gfx->printCharacter(_stringdata.x + pos + 1, _stringdata.y,
(char)_game.cursorChar, _game.colorFg, _game.colorBg);
}
@@ -293,13 +298,13 @@
debugC(3, kDebugLevelInput, "KEY_ENTER");
_game.keypress = 0;
- /* Remove all leading spaces */
+ // Remove all leading spaces
for (p = _game.inputBuffer; *p && *p == 0x20; p++)
;
- /* Copy to internal buffer */
+ // Copy to internal buffer
for (; *p; p++) {
- /* Squash spaces */
+ // Squash spaces
if (*p == 0x20 && *(p + 1) == 0x20) {
p++;
continue;
@@ -308,14 +313,14 @@
}
formattedEntry[c++] = 0;
- /* Handle string only if it's not empty */
+ // Handle string only if it's not empty
if (formattedEntry[0]) {
strcpy((char *)_game.echoBuffer, (const char *)_game.inputBuffer);
strcpy(_lastSentence, (const char *)formattedEntry);
dictionaryWords(_lastSentence);
}
- /* Clear to start a new line */
+ // Clear to start a new line
_game.hasPrompt = 0;
_game.inputBuffer[_game.cursorPos = 0] = 0;
debugC(3, kDebugLevelInput, "clear lines");
@@ -331,14 +336,15 @@
newInputMode(INPUT_MENU);
break;
case KEY_BACKSPACE:
- /* Ignore backspace at start of line */
+ // Ignore backspace at start of line
if (_game.cursorPos == 0)
break;
- /* erase cursor */
+ // erase cursor
_gfx->printCharacter(_game.cursorPos + promptLength, l, ' ', fg, bg);
_game.inputBuffer[--_game.cursorPos] = 0;
- /* Print cursor */
+
+ // Print cursor
_gfx->printCharacter(_game.cursorPos + promptLength, l, _game.cursorChar, fg, bg);
#ifdef __DS__
@@ -346,11 +352,11 @@
#endif
break;
default:
- /* Ignore invalid keystrokes */
+ // Ignore invalid keystrokes
if (key < 0x20 || key > 0x7f)
break;
- /* Maximum input size reached */
+ // Maximum input size reached
if (_game.cursorPos >= getvar(vMaxInputChars))
break;
@@ -361,10 +367,10 @@
DS::findWordCompletions((char *) _game.inputBuffer);
#endif
- /* echo */
+ // echo
_gfx->printCharacter(_game.cursorPos + promptLength - 1, l, _game.inputBuffer[_game.cursorPos - 1], fg, bg);
- /* Print cursor */
+ // Print cursor
_gfx->printCharacter(_game.cursorPos + promptLength, l, _game.cursorChar, fg, bg);
break;
}
@@ -373,14 +379,14 @@
int AgiEngine::waitKey() {
int key = 0;
- /* clear key queue */
+ // clear key queue
while (_gfx->keypress()) {
_gfx->getKey();
}
debugC(3, kDebugLevelInput, "waiting...");
while (!(shouldQuit() || restartGame || getflag(fRestoreJustRan))) {
- _gfx->pollTimer(); /* msdos driver -> does nothing */
+ _gfx->pollTimer(); // msdos driver -> does nothing
key = doPollKeyboard();
if (key == KEY_ENTER || key == KEY_ESCAPE || key == BUTTON_LEFT)
break;
@@ -396,14 +402,14 @@
int AgiEngine::waitAnyKey() {
int key = 0;
- /* clear key queue */
+ // clear key queue
while (_gfx->keypress()) {
_gfx->getKey();
}
debugC(3, kDebugLevelInput, "waiting... (any key)");
while (!(shouldQuit() || restartGame)) {
- _gfx->pollTimer(); /* msdos driver -> does nothing */
+ _gfx->pollTimer(); // msdos driver -> does nothing
key = doPollKeyboard();
if (key)
break;
Modified: scummvm/trunk/engines/agi/keyboard.h
===================================================================
--- scummvm/trunk/engines/agi/keyboard.h 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/keyboard.h 2009-06-06 17:39:13 UTC (rev 41239)
@@ -26,8 +26,6 @@
#ifndef AGI_KEYBOARD_H
#define AGI_KEYBOARD_H
-
-
namespace Agi {
#define keyEnqueue(k) do { _keyQueue[_keyQueueEnd++] = (k); \
@@ -51,10 +49,10 @@
}
};
-/* QNX4 has a KEY_DOWN defined which we don't need to care about */
+// QNX4 has a KEY_DOWN defined which we don't need to care about
#undef KEY_DOWN
-/* Allegro defines these */
+// Allegro defines these
#undef KEY_BACKSPACE
#undef KEY_ENTER
#undef KEY_LEFT
@@ -79,24 +77,24 @@
#define KEY_UP_LEFT 0x4700
#define KEY_UP_RIGHT 0x4900
-#define KEY_STATUSLN 0xd900 /* F11 */
-#define KEY_PRIORITY 0xda00 /* F12 */
+#define KEY_STATUSLN 0xd900 // F11
+#define KEY_PRIORITY 0xda00 // F12
-#define KEY_PGUP 0x4900 /* Page Up (fixed by Ziv Barber) */
-#define KEY_PGDN 0x5100 /* Page Down */
-#define KEY_HOME 0x4700 /* Home */
-#define KEY_END 0x4f00 /* End * */
+#define KEY_PGUP 0x4900 // Page Up (fixed by Ziv Barber)
+#define KEY_PGDN 0x5100 // Page Down
+#define KEY_HOME 0x4700 // Home
+#define KEY_END 0x4f00 // End *
-#define BUTTON_LEFT 0xF101 /* Left mouse button */
-#define BUTTON_RIGHT 0xF202 /* Right mouse button */
-#define WHEEL_UP 0xF203 /* Mouse wheel up */
-#define WHEEL_DOWN 0xF204 /* Mouse wheel down */
+#define BUTTON_LEFT 0xF101 // Left mouse button
+#define BUTTON_RIGHT 0xF202 // Right mouse button
+#define WHEEL_UP 0xF203 // Mouse wheel up
+#define WHEEL_DOWN 0xF204 // Mouse wheel down
#define KEY_SCAN(k) (k >> 8)
#define KEY_ASCII(k) (k & 0xff)
extern uint8 scancodeTable[];
-} // End of namespace Agi
+} // End of namespace Agi
#endif /* AGI_KEYBOARD_H */
Modified: scummvm/trunk/engines/agi/loader_v2.cpp
===================================================================
--- scummvm/trunk/engines/agi/loader_v2.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/loader_v2.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -48,7 +48,7 @@
!Common::File::exists(VIEWDIR))
return errInvalidAGIFile;
- _intVersion = 0x2917; /* setup for 2.917 */
+ _intVersion = 0x2917; // setup for 2.917
return _vm->v2IdGame();
}
@@ -75,13 +75,13 @@
fp.read(mem, flen);
- /* set all directory resources to gone */
+ // set all directory resources to gone
for (i = 0; i < MAX_DIRS; i++) {
agid[i].volume = 0xff;
agid[i].offset = _EMPTY;
}
- /* build directory entries */
+ // build directory entries
for (i = 0; i < flen; i += 3) {
agid[i / 3].volume = *(mem + i) >> 4;
agid[i / 3].offset = READ_BE_UINT24(mem + i) & (uint32) _EMPTY;
@@ -97,7 +97,7 @@
int AgiLoader_v2::init() {
int ec = errOK;
- /* load directory files */
+ // load directory files
ec = loadDir(_vm->_game.dirLogic, LOGDIR);
if (ec == errOK)
ec = loadDir(_vm->_game.dirPic, PICDIR);
@@ -113,10 +113,10 @@
int ec = errOK;
#if 0
- /* unload words */
+ // unload words
agiV2UnloadWords();
- /* unload objects */
+ // unload objects
agiV2UnloadObjects();
#endif
@@ -144,7 +144,7 @@
return errOK;
}
-/*
+/**
* This function does noting but load a raw resource into memory,
* if further decoding is required, it must be done by another
* routine. NULL is returned if unsucsessfull.
@@ -178,15 +178,15 @@
}
fp.close();
} else {
- /* we have a bad volume resource */
- /* set that resource to NA */
+ // we have a bad volume resource
+ // set that resource to NA
agid->offset = _EMPTY;
}
return data;
}
-/*
+/**
* Loads a resource into memory, a raw resource is loaded in
* with above routine, then further decoded here.
*/
@@ -204,7 +204,7 @@
debugC(3, kDebugLevelResources, "loading logic resource %d", n);
unloadResource(rLOGIC, n);
- /* load raw resource into data */
+ // load raw resource into data
data = loadVolRes(&_vm->_game.dirLogic[n]);
_vm->_game.logics[n].data = data;
@@ -213,22 +213,21 @@
_vm->_game.logics[n].sIP = 2;
}
- /* if logic was cached, we get here */
- /* reset code pointers incase it was cached */
+ // if logic was cached, we get here
+ // reset code pointers incase it was cached
_vm->_game.logics[n].cIP = _vm->_game.logics[n].sIP;
break;
case rPICTURE:
- /* if picture is currently NOT loaded *OR* cacheing is off,
- * unload the resource (caching == off) and reload it
- */
+ // if picture is currently NOT loaded *OR* cacheing is off,
+ // unload the resource (caching == off) and reload it
debugC(3, kDebugLevelResources, "loading picture resource %d", n);
if (_vm->_game.dirPic[n].flags & RES_LOADED)
break;
- /* if loaded but not cached, unload it */
- /* if cached but not loaded, etc */
+ // if loaded but not cached, unload it
+ // if cached but not loaded, etc
unloadResource(rPICTURE, n);
data = loadVolRes(&_vm->_game.dirPic[n]);
@@ -255,11 +254,10 @@
}
break;
case rVIEW:
- /* Load a VIEW resource into memory...
- * Since VIEWS alter the view table ALL the time
- * can we cache the view? or must we reload it all
- * the time?
- */
+ // Load a VIEW resource into memory...
+ // Since VIEWS alter the view table ALL the time
+ // can we cache the view? or must we reload it all
+ // the time?
if (_vm->_game.dirView[n].flags & RES_LOADED)
break;
Modified: scummvm/trunk/engines/agi/loader_v3.cpp
===================================================================
--- scummvm/trunk/engines/agi/loader_v3.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/loader_v3.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -89,13 +89,13 @@
if ((mem = (uint8 *)malloc(len + 32)) != NULL) {
fp->read(mem, len);
- /* set all directory resources to gone */
+ // set all directory resources to gone
for (i = 0; i < MAX_DIRS; i++) {
agid[i].volume = 0xff;
agid[i].offset = _EMPTY;
}
- /* build directory entries */
+ // build directory entries
for (i = 0; i < len; i += 3) {
agid[i / 3].volume = *(mem + i) >> 4;
agid[i / 3].offset = READ_BE_UINT24(mem + i) & (uint32) _EMPTY;
@@ -136,7 +136,7 @@
printf("Failed to open \"%s\"\n", path.c_str());
return errBadFileOpen;
}
- /* build offset table for v3 directory format */
+ // build offset table for v3 directory format
fp.read(&xd, 8);
fp.seek(0, SEEK_END);
@@ -153,7 +153,7 @@
fp.seek(0, SEEK_SET);
- /* read in directory files */
+ // read in directory files
ec = loadDir(_vm->_game.dirLogic, &fp, agiVol3[0].sddr, agiVol3[0].len);
if (ec == errOK) {
@@ -175,10 +175,10 @@
int ec = errOK;
#if 0
- /* unload words */
+ // unload words
agiV3UnloadWords();
- /* unload objects */
+ // unload objects
agiV3UnloadObjects();
#endif
@@ -204,7 +204,7 @@
return errOK;
}
-/*
+/**
* This function does noting but load a raw resource into memory.
* If further decoding is required, it must be done by another
* routine.
@@ -234,28 +234,27 @@
_vm->quitGame();
}
- agid->len = READ_LE_UINT16((uint8 *) x + 3); /* uncompressed size */
- agid->clen = READ_LE_UINT16((uint8 *) x + 5); /* compressed len */
+ agid->len = READ_LE_UINT16((uint8 *) x + 3); // uncompressed size
+ agid->clen = READ_LE_UINT16((uint8 *) x + 5); // compressed len
compBuffer = (uint8 *)calloc(1, agid->clen + 32);
fp.read(compBuffer, agid->clen);
if (x[2] & 0x80 || agid->len == agid->clen) {
- /* do not decompress */
+ // do not decompress
data = compBuffer;
#if 0
- /* CM: added to avoid problems in
- * convert_v2_v3_pic() when clen > len
- * e.g. Sierra demo 4, first picture
- * (Tue Mar 16 13:13:43 EST 1999)
- */
+ // CM: added to avoid problems in
+ // convert_v2_v3_pic() when clen > len
+ // e.g. Sierra demo 4, first picture
+ // (Tue Mar 16 13:13:43 EST 1999)
agid->len = agid->clen;
- /* Now removed to fix Gold Rush! in demo4 */
+ // Now removed to fix Gold Rush! in demo4
#endif
} else {
- /* it is compressed */
+ // it is compressed
data = (uint8 *)calloc(1, agid->len + 32);
lzwExpand(compBuffer, data, agid->len);
free(compBuffer);
@@ -264,15 +263,15 @@
fp.close();
} else {
- /* we have a bad volume resource */
- /* set that resource to NA */
+ // we have a bad volume resource
+ // set that resource to NA
agid->offset = _EMPTY;
}
return data;
}
-/*
+/**
* Loads a resource into memory, a raw resource is loaded in
* with above routine, then further decoded here.
*/
@@ -285,42 +284,40 @@
switch (t) {
case rLOGIC:
- /* load resource into memory, decrypt messages at the end
- * and build the message list (if logic is in memory)
- */
+ // load resource into memory, decrypt messages at the end
+ // and build the message list (if logic is in memory)
if (~_vm->_game.dirLogic[n].flags & RES_LOADED) {
- /* if logic is already in memory, unload it */
+ // if logic is already in memory, unload it
unloadResource(rLOGIC, n);
- /* load raw resource into data */
+ // load raw resource into data
data = loadVolRes(&_vm->_game.dirLogic[n]);
_vm->_game.logics[n].data = data;
- /* uncompressed logic files need to be decrypted */
+ // uncompressed logic files need to be decrypted
if (data != NULL) {
- /* resloaded flag gets set by decode logic */
- /* needed to build string table */
+ // resloaded flag gets set by decode logic
+ // needed to build string table
ec = _vm->decodeLogic(n);
_vm->_game.logics[n].sIP = 2;
} else {
ec = errBadResource;
}
- /*logics[n].sIP=2; *//* saved IP = 2 */
- /*logics[n].cIP=2; *//* current IP = 2 */
+ // logics[n].sIP=2; // saved IP = 2
+ // logics[n].cIP=2; // current IP = 2
_vm->_game.logics[n].cIP = _vm->_game.logics[n].sIP;
}
- /* if logic was cached, we get here */
- /* reset code pointers incase it was cached */
+ // if logic was cached, we get here
+ // reset code pointers incase it was cached
_vm->_game.logics[n].cIP = _vm->_game.logics[n].sIP;
break;
case rPICTURE:
- /* if picture is currently NOT loaded *OR* cacheing is off,
- * unload the resource (caching==off) and reload it
- */
+ // if picture is currently NOT loaded *OR* cacheing is off,
+ // unload the resource (caching==off) and reload it
if (~_vm->_game.dirPic[n].flags & RES_LOADED) {
unloadResource(rPICTURE, n);
data = loadVolRes(&_vm->_game.dirPic[n]);
@@ -347,11 +344,11 @@
}
break;
case rVIEW:
- /* Load a VIEW resource into memory...
- * Since VIEWS alter the view table ALL the time can we
- * cache the view? or must we reload it all the time?
- */
- /* load a raw view from a VOL file into data */
+ // Load a VIEW resource into memory...
+ // Since VIEWS alter the view table ALL the time can we
+ // cache the view? or must we reload it all the time?
+ //
+ // load a raw view from a VOL file into data
if (_vm->_game.dirView[n].flags & RES_LOADED)
break;
Modified: scummvm/trunk/engines/agi/logic.cpp
===================================================================
--- scummvm/trunk/engines/agi/logic.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/logic.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,8 +23,6 @@
*
*/
-
-
#include "agi/agi.h"
namespace Agi {
@@ -40,52 +38,50 @@
int mstart, mend, mc;
uint8 *m0;
- /* decrypt messages at end of logic + build message list */
+ // decrypt messages at end of logic + build message list
- /* report ("decoding logic #%d\n", n); */
+ // report ("decoding logic #%d\n", n);
m0 = _game.logics[n].data;
mstart = READ_LE_UINT16(m0) + 2;
mc = *(m0 + mstart);
mend = READ_LE_UINT16(m0 + mstart + 1);
- m0 += mstart + 3; /* cover header info */
+ m0 += mstart + 3; // cover header info
mstart = mc << 1;
- /* if the logic was not compressed, decrypt the text messages
- * only if there are more than 0 messages
- */
+ // if the logic was not compressed, decrypt the text messages
+ // only if there are more than 0 messages
if ((~_game.dirLogic[n].flags & RES_COMPRESSED) && mc > 0)
- decrypt(m0 + mstart, mend - mstart); /* decrypt messages */
+ decrypt(m0 + mstart, mend - mstart); // decrypt messages
- /* build message list */
+ // build message list
m0 = _game.logics[n].data;
- mstart = READ_LE_UINT16(m0) + 2; /* +2 covers pointer */
+ mstart = READ_LE_UINT16(m0) + 2; // +2 covers pointer
_game.logics[n].numTexts = *(m0 + mstart);
- /* resetp logic pointers */
+ // resetp logic pointers
_game.logics[n].sIP = 2;
_game.logics[n].cIP = 2;
- _game.logics[n].size = READ_LE_UINT16(m0) + 2; /* logic end pointer */
+ _game.logics[n].size = READ_LE_UINT16(m0) + 2; // logic end pointer
- /* allocate list of pointers to point into our data */
+ // allocate list of pointers to point into our data
_game.logics[n].texts = (const char **)calloc(1 + _game.logics[n].numTexts, sizeof(char *));
- /* cover header info */
+ // cover header info
m0 += mstart + 3;
if (_game.logics[n].texts != NULL) {
- /* move list of strings into list to make real pointers */
+ // move list of strings into list to make real pointers
for (mc = 0; mc < _game.logics[n].numTexts; mc++) {
mend = READ_LE_UINT16(m0 + mc * 2);
_game.logics[n].texts[mc] = mend ? (const char *)m0 + mend - 2 : (const char *)"";
}
- /* set loaded flag now its all completly loaded */
+ // set loaded flag now its all completly loaded
_game.dirLogic[n].flags |= RES_LOADED;
} else {
- /* unload data
- * Note that not every logic has text
- */
+ // unload data
+ // Note that not every logic has text
free(_game.logics[n].data);
ec = errNotEnoughMemory;
}
@@ -108,7 +104,7 @@
_game.dirLogic[n].flags &= ~RES_LOADED;
}
- /* if cached, we end up here */
+ // if cached, we end up here
_game.logics[n].sIP = 2;
_game.logics[n].cIP = 2;
}
Modified: scummvm/trunk/engines/agi/lzw.cpp
===================================================================
--- scummvm/trunk/engines/agi/lzw.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/lzw.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -41,21 +41,21 @@
namespace Agi {
#define MAXBITS 12
-#define TABLE_SIZE 18041 /* strange number */
+#define TABLE_SIZE 18041 // strange number
#define START_BITS 9
static int32 BITS, MAX_VALUE, MAX_CODE;
static uint32 *prefixCode;
static uint8 *appendCharacter;
static uint8 *decodeStack;
-static int32 inputBitCount = 0; /* Number of bits in input bit buffer */
+static int32 inputBitCount = 0; // Number of bits in input bit buffer
static uint32 inputBitBuffer = 0L;
static void initLZW() {
decodeStack = (uint8 *)calloc(1, 8192);
prefixCode = (uint32 *)malloc(TABLE_SIZE * sizeof(uint32));
appendCharacter = (uint8 *)malloc(TABLE_SIZE * sizeof(uint8));
- inputBitCount = 0; /* Number of bits in input bit buffer */
+ inputBitCount = 0; // Number of bits in input bit buffer
inputBitBuffer = 0L;
}
@@ -141,18 +141,18 @@
initLZW();
- setBits(START_BITS); /* Starts at 9-bits */
- lzwnext = 257; /* Next available code to define */
+ setBits(START_BITS); // Starts at 9-bits
+ lzwnext = 257; // Next available code to define
end = (uint8 *)(out + (uint32)len);
- lzwold = inputCode(&in); /* Read in the first code */
+ lzwold = inputCode(&in); // Read in the first code
c = lzwold;
lzwnew = inputCode(&in);
while ((out < end) && (lzwnew != 0x101)) {
if (lzwnew == 0x100) {
- /* Code to "start over" */
+ // Code to "start over"
lzwnext = 258;
setBits(START_BITS);
lzwold = inputCode(&in);
@@ -161,15 +161,14 @@
lzwnew = inputCode(&in);
} else {
if (lzwnew >= lzwnext) {
- /* Handles special LZW scenario */
+ // Handles special LZW scenario
*decodeStack = c;
s = decodeString(decodeStack + 1, lzwold);
} else
s = decodeString(decodeStack, lzwnew);
- /* Reverse order of decoded string and
- * store in out buffer
- */
+ // Reverse order of decoded string and
+ // store in out buffer
c = *s;
while (s >= decodeStack)
*out++ = *s--;
Modified: scummvm/trunk/engines/agi/menu.cpp
===================================================================
--- scummvm/trunk/engines/agi/menu.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/menu.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,8 +23,6 @@
*
*/
-
-
#include "agi/agi.h"
#include "agi/sprite.h"
#include "agi/graphics.h"
@@ -66,6 +64,7 @@
AgiMenuOption *Menu::getMenuOption(int i, int j) {
AgiMenu *m = getMenu(i);
MenuOptionList::iterator iter;
+
for (iter = m->down.begin(); iter != m->down.end(); ++iter) {
AgiMenuOption* d = *iter;
if (d->index == j)
@@ -82,6 +81,7 @@
MenuList::iterator iter;
for (iter = _menubar.begin(); iter != _menubar.end(); ++iter) {
AgiMenu *m = *iter;
+
_vm->printText(m->text, 0, m->col, 0, 40, MENU_FG, MENU_BG);
}
@@ -89,22 +89,26 @@
void Menu::drawMenuHilite(int curMenu) {
AgiMenu *m = getMenu(curMenu);
+
debugC(6, kDebugLevelMenu, "[%s]", m->text);
+
_vm->printText(m->text, 0, m->col, 0, 40, MENU_BG, MENU_FG);
_vm->flushLines(0, 0);
}
-/* draw box and pulldowns. */
+// draw box and pulldowns.
void Menu::drawMenuOption(int hMenu) {
- /* find which vertical menu it is */
+ // find which vertical menu it is
AgiMenu *m = getMenu(hMenu);
_gfx->drawBox(m->wincol * CHAR_COLS, 1 * CHAR_LINES, (m->wincol + m->width + 2) * CHAR_COLS,
(1 + m->height + 2) * CHAR_LINES, MENU_BG, MENU_LINE, 0);
MenuOptionList::iterator iter;
+
for (iter = m->down.begin(); iter != m->down.end(); ++iter) {
AgiMenuOption* d = *iter;
+
_vm->printText(d->text, 0, m->wincol + 1, d->index + 2, m->width + 2,
MENU_FG, MENU_BG, !d->enabled);
}
@@ -180,17 +184,24 @@
MenuList::iterator iterh;
for (iterh = _menubar.reverse_begin(); iterh != _menubar.end(); ) {
AgiMenu *m = *iterh;
+
debugC(3, kDebugLevelMenu, "deiniting hmenu %s", m->text);
+
MenuOptionList::iterator iterv;
+
for (iterv = m->down.reverse_begin(); iterv != m->down.end(); ) {
AgiMenuOption *d = *iterv;
+
debugC(3, kDebugLevelMenu, " deiniting vmenu %s", d->text);
+
free(d->text);
delete d;
+
iterv = m->down.reverse_erase(iterv);
}
free(m->text);
delete m;
+
iterh = _menubar.reverse_erase(iterh);
}
}
@@ -198,8 +209,10 @@
void Menu::add(const char *s) {
AgiMenu *m = new AgiMenu;
m->text = strdup(s);
+
while (m->text[strlen(m->text) - 1] == ' ')
m->text[strlen(m->text) - 1] = 0;
+
m->width = 0;
m->height = 0;
m->index = _hIndex++;
@@ -218,6 +231,7 @@
int l;
AgiMenuOption* d = new AgiMenuOption;
+
d->text = strdup(s);
d->enabled = true;
d->event = code;
@@ -239,22 +253,26 @@
m->width = l;
debugC(3, kDebugLevelMenu, "Adding menu item: %s (size = %d)", s, m->height);
+
m->down.push_back(d);
}
void Menu::submit() {
debugC(3, kDebugLevelMenu, "Submitting menu");
- /* add_about_option (); */
+ // add_about_option ();
- /* If a menu has no options, delete it */
+ // If a menu has no options, delete it
MenuList::iterator iter;
for (iter = _menubar.reverse_begin(); iter != _menubar.end(); ) {
AgiMenu *m = *iter;
+
if (m->down.empty()) {
free(m->text);
delete m;
+
_hMaxMenu--;
+
iter = _menubar.reverse_erase(iter);
} else {
--iter;
@@ -275,20 +293,23 @@
_vm->_game.clockEnabled = false;
drawMenuBar();
}
- /*
- * Mouse handling
- */
+ //
+ // Mouse handling
+ //
if (g_mouse.button) {
int hmenu, vmenu;
- buttonUsed = 1; /* Button has been used at least once */
+ buttonUsed = 1; // Button has been used at least once
+
if (g_mouse.y <= CHAR_LINES) {
- /* on the menubar */
+ // on the menubar
hmenu = 0;
MenuList::iterator iterh;
+
for (iterh = _menubar.begin(); iterh != _menubar.end(); ++iterh) {
AgiMenu *m = *iterh;
+
if (mouseOverText(0, m->col, m->text)) {
break;
} else {
@@ -304,13 +325,16 @@
_hCurMenu = hmenu;
}
} else {
- /* not in menubar */
+ // not in menubar
vmenu = 0;
AgiMenu *m = getMenu(_hCurMenu);
+
MenuOptionList::iterator iterv;
+
for (iterv = m->down.begin(); iterv != m->down.end(); ++iterv) {
AgiMenuOption *do1 = *iterv;
+
if (mouseOverText(2 + do1->index, m->wincol + 1, do1->text)) {
break;
} else {
@@ -327,7 +351,7 @@
}
}
} else if (buttonUsed) {
- /* Button released */
+ // Button released
buttonUsed = 0;
debugC(6, kDebugLevelMenu | kDebugLevelInput, "button released!");
@@ -338,15 +362,17 @@
drawMenuOptionHilite(_hCurMenu, _vCurMenu);
if (g_mouse.y <= CHAR_LINES) {
- /* on the menubar */
+ // on the menubar
} else {
- /* see which option we selected */
+ // see which option we selected
AgiMenu *m = getMenu(_hCurMenu);
MenuOptionList::iterator iterv;
+
for (iterv = m->down.begin(); iterv != m->down.end(); ++iterv) {
AgiMenuOption *d = *iterv;
+
if (mouseOverText(2 + d->index, m->wincol + 1, d->text)) {
- /* activate that option */
+ // activate that option
if (d->enabled) {
debugC(6, kDebugLevelMenu | kDebugLevelInput, "event %d registered", d->event);
_vm->_game.evKeyp[d->event].occured = true;
@@ -383,6 +409,7 @@
{
debugC(6, kDebugLevelMenu | kDebugLevelInput, "KEY_ENTER");
AgiMenuOption* d = getMenuOption(_hCurMenu, _vCurMenu);
+
if (d->enabled) {
debugC(6, kDebugLevelMenu | kDebugLevelInput, "event %d registered", d->event);
_vm->_game.evKeyp[d->event].occured = true;
@@ -428,6 +455,7 @@
_vm->_game.keypress = 0;
_vm->_game.clockEnabled = clockVal;
_vm->oldInputMode();
+
debugC(3, kDebugLevelMenu, "exit_menu: input mode reset to %d", _vm->_game.inputMode);
menuActive = false;
@@ -435,15 +463,18 @@
}
void Menu::setItem(int event, int state) {
- /* scan all menus for event number # */
+ // scan all menus for event number #
debugC(6, kDebugLevelMenu, "event = %d, state = %d", event, state);
MenuList::iterator iterh;
+
for (iterh = _menubar.begin(); iterh != _menubar.end(); ++iterh) {
AgiMenu *m = *iterh;
MenuOptionList::iterator iterv;
+
for (iterv = m->down.begin(); iterv != m->down.end(); ++iterv) {
AgiMenuOption *d = *iterv;
+
if (d->event == event) {
d->enabled = state;
// keep going; we need to set the state of every menu item
@@ -458,8 +489,10 @@
for (iterh = _menubar.begin(); iterh != _menubar.end(); ++iterh) {
AgiMenu *m = *iterh;
MenuOptionList::iterator iterv;
+
for (iterv = m->down.begin(); iterv != m->down.end(); ++iterv) {
AgiMenuOption *d = *iterv;
+
d->enabled = true;
}
}
Modified: scummvm/trunk/engines/agi/menu.h
===================================================================
--- scummvm/trunk/engines/agi/menu.h 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/menu.h 2009-06-06 17:39:13 UTC (rev 41239)
@@ -30,11 +30,11 @@
namespace Agi {
-#define MENU_BG 0x0f /* White */
-#define MENU_DISABLED 0x07 /* Grey */
+#define MENU_BG 0x0f // White
+#define MENU_DISABLED 0x07 // Grey
-#define MENU_FG 0x00 /* Black */
-#define MENU_LINE 0x00 /* Black */
+#define MENU_FG 0x00 // Black
+#define MENU_LINE 0x00 // Black
struct AgiMenu;
struct AgiMenuOption;
Modified: scummvm/trunk/engines/agi/motion.cpp
===================================================================
--- scummvm/trunk/engines/agi/motion.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/motion.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,8 +23,6 @@
*
*/
-
-
#include "agi/agi.h"
namespace Agi {
@@ -76,7 +74,7 @@
if (isEgoView(v)) {
_game.vars[vEgoDir] = v->direction;
while (v->parm1 < 6) {
- v->parm1 = _rnd->getRandomNumber(50); /* huh? */
+ v->parm1 = _rnd->getRandomNumber(50); // huh?
}
}
}
@@ -92,10 +90,10 @@
objX = v->xPos + v->xSize / 2;
objY = v->yPos;
- /* Get direction to reach ego */
+ // Get direction to reach ego
dir = getDirection(objX, objY, egoX, egoY, v->parm1);
- /* Already at ego coordinates */
+ // Already at ego coordinates
if (dir == 0) {
v->direction = 0;
v->motion = MOTION_NORMAL;
@@ -126,12 +124,12 @@
if (v->parm3 != 0) {
int k;
- /* DF: this is ugly and I dont know why this works, but
- * other line does not! (watcom complained about lvalue)
- *
- * if (((int8)v->parm3 -= v->step_size) < 0)
- * v->parm3 = 0;
- */
+ // DF: this is ugly and I dont know why this works, but
+ // other line does not! (watcom complained about lvalue)
+ //
+ // if (((int8)v->parm3 -= v->step_size) < 0)
+ // v->parm3 = 0;
+
k = v->parm3;
k -= v->stepSize;
v->parm3 = k;
@@ -146,7 +144,7 @@
void AgiEngine::motionMoveObj(VtEntry *v) {
v->direction = getDirection(v->xPos, v->yPos, v->parm1, v->parm2, v->stepSize);
- /* Update V6 if ego */
+ // Update V6 if ego
if (isEgoView(v))
_game.vars[vEgoDir] = v->direction;
Modified: scummvm/trunk/engines/agi/objects.cpp
===================================================================
--- scummvm/trunk/engines/agi/objects.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/objects.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -44,9 +44,8 @@
_game.numObjects = 0;
_objects = NULL;
- /* check if first pointer exceeds file size
- * if so, its encrypted, else it is not
- */
+ // check if first pointer exceeds file size
+ // if so, its encrypted, else it is not
if (READ_LE_UINT16(mem) > flen) {
report("Decrypting objects... ");
@@ -54,11 +53,10 @@
report("done.\n");
}
- /* alloc memory for object list
- * byte 3 = number of animated objects. this is ignored.. ??
- */
+ // alloc memory for object list
+ // byte 3 = number of animated objects. this is ignored.. ??
if (READ_LE_UINT16(mem) / padsize >= 256) {
- /* die with no error! AGDS game needs not to die to work!! :( */
+ // die with no error! AGDS game needs not to die to work!! :(
return errOK;
}
@@ -68,7 +66,7 @@
if (allocObjects(_game.numObjects) != errOK)
return errNotEnoughMemory;
- /* build the object list */
+ // build the object list
for (i = 0, so = padsize; i < _game.numObjects; i++, so += padsize) {
int offset;
Modified: scummvm/trunk/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_cmd.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/op_cmd.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -57,7 +57,7 @@
static struct AgiLogic *curLogic;
static AgiEngine *g_agi;
-int timerHack; /* Workaround for timer loop in MH1 */
+int timerHack; // Workaround for timer loop in MH1
#define _v game.vars
#define cmd(x) static void cmd_##x (uint8 *p)
@@ -291,7 +291,7 @@
vt.flags &= ~FIXED_PRIORITY;
}
-cmd(set_upper_left) { /* do nothing (AGI 2.917) */
+cmd(set_upper_left) { // do nothing (AGI 2.917)
}
cmd(start_update) {
@@ -497,23 +497,23 @@
game.simpleSave ? g_agi->loadGameSimple() : g_agi->loadGameDialog();
}
-cmd(init_disk) { /* do nothing */
+cmd(init_disk) { // do nothing
}
-cmd(log) { /* do nothing */
+cmd(log) { // do nothing
}
-cmd(trace_on) { /* do nothing */
+cmd(trace_on) { // do nothing
}
-cmd(trace_info) { /* do nothing */
+cmd(trace_info) { // do nothing
}
cmd(show_mem) {
g_agi->messageBox("Enough memory");
}
-cmd(init_joy) { /* do nothing */ ;
+cmd(init_joy) { // do nothing
}
cmd(script_size) {
@@ -600,15 +600,14 @@
g_agi->messageBox(msg);
}
-/* unknown commands:
- * unk_170: Force savegame name -- j5
- * unk_171: script save -- j5
- * unk_172: script restore -- j5
- * unk_173: Activate keypressed control (ego only moves while key is pressed)
- * unk_174: Change priority table (used in KQ4) -- j5
- * unk_177: Disable menus completely -- j5
- * unk_181: Deactivate keypressed control (default control of ego)
- */
+// unknown commands:
+// unk_170: Force savegame name -- j5
+// unk_171: script save -- j5
+// unk_172: script restore -- j5
+// unk_173: Activate keypressed control (ego only moves while key is pressed)
+// unk_174: Change priority table (used in KQ4) -- j5
+// unk_177: Disable menus completely -- j5
+// unk_181: Deactivate keypressed control (default control of ego)
cmd(set_simple) {
if (!(g_agi->getFeatures() & (GF_AGI256 | GF_AGI256_2))) {
game.simpleSave = true;
@@ -723,9 +722,8 @@
int oldCIP;
int oldLognum;
- /* CM: we don't save sIP because set.scan.start can be
- * used in a called script (fixes xmas demo)
- */
+ // CM: we don't save sIP because set.scan.start can be
+ // used in a called script (fixes xmas demo)
oldCIP = curLogic->cIP;
oldLognum = game.lognum;
@@ -766,10 +764,12 @@
cmd(show_pic) {
debugC(6, kDebugLevelScripts, "=== show pic ===");
+
g_agi->setflag(fOutputMode, false);
cmd_close_window(NULL);
g_picture->showPic();
game.pictureShown = 1;
+
debugC(6, kDebugLevelScripts, "--- end of show pic ---");
}
@@ -781,11 +781,12 @@
cmd(discard_pic) {
debugC(6, kDebugLevelScripts, "--- discard pic ---");
- /* do nothing */
+ // do nothing
}
cmd(overlay_pic) {
debugC(6, kDebugLevelScripts, "--- overlay pic ---");
+
g_sprites->eraseBoth();
g_picture->decodePicture(_v[p0], false);
g_sprites->blitBoth();
@@ -798,7 +799,9 @@
g_sprites->eraseBoth();
g_picture->showPic();
g_sprites->blitBoth();
+
g_agi->waitKey();
+
g_agi->_debug.priority = 0;
g_sprites->eraseBoth();
g_picture->showPic();
@@ -818,6 +821,7 @@
cmd(unanimate_all) {
int i;
+
for (i = 0; i < MAX_VIEWTABLE; i++)
game.viewTable[i].flags &= ~(ANIMATED | DRAWN);
}
@@ -836,6 +840,7 @@
g_agi->setLoop(&vt, vt.currentLoop);
g_agi->setCel(&vt, vt.currentCel);
}
+
g_agi->fixPosition(p0);
vt.xPos2 = vt.xPos;
vt.yPos2 = vt.yPos;
@@ -854,7 +859,7 @@
// TODO: Investigate this further and check if any other fanmade AGI
// games are affected. If yes, then it'd be best to set this for Space
// Trek only
- if (g_agi->getFeatures() & GF_FANMADE) /* See Sarien bug #546562 */
+ if (g_agi->getFeatures() & GF_FANMADE) // See Sarien bug #546562
vt.flags |= ANIMATED;
g_sprites->blitUpdSprites();
@@ -870,6 +875,7 @@
return;
g_sprites->eraseUpdSprites();
+
if (vt.flags & UPDATE) {
vt.flags &= ~DRAWN;
} else {
@@ -1002,7 +1008,7 @@
cmd(stop_motion) {
vt.direction = 0;
vt.motion = MOTION_NORMAL;
- if (p0 == 0) { /* ego only */
+ if (p0 == 0) { // ego only
_v[vEgoDir] = 0;
game.playerControl = false;
}
@@ -1010,7 +1016,7 @@
cmd(start_motion) {
vt.motion = MOTION_NORMAL;
- if (p0 == 0) { /* ego only */
+ if (p0 == 0) { // ego only
_v[vEgoDir] = 0;
game.playerControl = true;
}
@@ -1035,7 +1041,7 @@
}
cmd(move_obj) {
- /* _D (_D_WARN "o=%d, x=%d, y=%d, s=%d, f=%d", p0, p1, p2, p3, p4); */
+ // _D (_D_WARN "o=%d, x=%d, y=%d, s=%d, f=%d", p0, p1, p2, p3, p4);
vt.motion = MOTION_MOVE_OBJ;
vt.parm1 = p1;
@@ -1052,7 +1058,7 @@
if (p0 == 0)
game.playerControl = false;
- /* AGI 2.272 (ddp, xmas) doesn't call move_obj! */
+ // AGI 2.272 (ddp, xmas) doesn't call move_obj!
if (g_agi->agiGetRelease() > 0x2272)
g_agi->moveObj(&vt);
}
@@ -1073,7 +1079,7 @@
if (p0 == 0)
game.playerControl = false;
- /* AGI 2.272 (ddp, xmas) doesn't call move_obj! */
+ // AGI 2.272 (ddp, xmas) doesn't call move_obj!
if (g_agi->agiGetRelease() > 0x2272)
g_agi->moveObj(&vt);
}
@@ -1081,6 +1087,7 @@
cmd(wander) {
if (p0 == 0)
game.playerControl = false;
+
vt.motion = MOTION_WANDER;
vt.flags |= UPDATE;
}
@@ -1114,12 +1121,14 @@
cmd(set_menu) {
debugC(4, kDebugLevelScripts, "text %02x of %02x", p0, curLogic->numTexts);
+
if (curLogic->texts != NULL && p0 <= curLogic->numTexts)
g_agi->_menu->add(curLogic->texts[p0 - 1]);
}
cmd(set_menu_item) {
debugC(4, kDebugLevelScripts, "text %02x of %02x", p0, curLogic->numTexts);
+
if (curLogic->texts != NULL && p0 <= curLogic->numTexts)
g_agi->_menu->addItem(curLogic->texts[p0 - 1], p1);
}
@@ -1134,7 +1143,7 @@
"\n"
" \n\n"
" Emulating AGI v%x.002.%03x\n";
- /* no Sierra as it wraps textbox */
+ // no Sierra as it wraps textbox
char *r, *q;
int ver, maj, min;
char msg[256];
@@ -1150,9 +1159,10 @@
q = maj == 2 ? ver2Msg : ver3Msg;
r = strchr(q + 1, '\n');
- /* insert our version into the other version */
+ // insert our version into the other version
len = strlen(verMsg);
gap = r - q;
+
if (gap < 0)
gap = 0;
else
@@ -1172,17 +1182,18 @@
cmd(text_screen) {
debugC(4, kDebugLevelScripts, "switching to text mode");
game.gfxMode = false;
- /*
- * Simulates the "bright background bit" of the PC video
- * controller.
- */
+
+ // Simulates the "bright background bit" of the PC video
+ // controller.
if (game.colorBg)
game.colorBg |= 0x08;
+
g_gfx->clearScreen(game.colorBg);
}
cmd(graphics) {
debugC(4, kDebugLevelScripts, "switching to graphics mode");
+
if (!game.gfxMode) {
game.gfxMode = true;
g_gfx->clearScreen(0);
@@ -1290,6 +1301,7 @@
cmd(accept_input) {
debugC(4, kDebugLevelScripts | kDebugLevelInput, "input normal");
+
g_agi->newInputMode(INPUT_NORMAL);
game.inputEnabled = true;
g_agi->writePrompt();
@@ -1297,6 +1309,7 @@
cmd(prevent_input) {
debugC(4, kDebugLevelScripts | kDebugLevelInput, "no input");
+
g_agi->newInputMode(INPUT_NONE);
game.inputEnabled = false;
}
@@ -1310,9 +1323,8 @@
row = p2;
col = p3;
- /* Workaround for SQLC bug.
- * See Sarien bug #792125 for details
- */
+ // Workaround for SQLC bug.
+ // See Sarien bug #792125 for details
if (row > 24)
row = 24;
if (col > 39)
@@ -1322,10 +1334,11 @@
if (curLogic->texts != NULL && curLogic->numTexts >= tex) {
int len = strlen(curLogic->texts[tex]);
+
g_agi->printText(curLogic->texts[tex], 0, col, row, len, game.colorFg, game.colorBg);
g_agi->getString(col + len - 1, row, p4, p0);
- /* SGEO: display input char */
+ // SGEO: display input char
g_gfx->printCharacter((col + len), row, game.cursorChar, game.colorFg, game.colorBg);
}
@@ -1336,14 +1349,16 @@
cmd(get_num) {
debugC(4, kDebugLevelScripts, "%d %d", p0, p1);
+
g_agi->newInputMode(INPUT_GETSTRING);
if (curLogic->texts != NULL && curLogic->numTexts >= (p0 - 1)) {
int len = strlen(curLogic->texts[p0 - 1]);
+
g_agi->printText(curLogic->texts[p0 - 1], 0, 0, 22, len, game.colorFg, game.colorBg);
g_agi->getString(len - 1, 22, 3, MAX_STRINGS);
- /* CM: display input char */
+ // CM: display input char
g_gfx->printCharacter((p3 + len), 22, game.cursorChar, game.colorFg, game.colorBg);
}
@@ -1352,7 +1367,9 @@
} while (game.inputMode == INPUT_GETSTRING && !(g_agi->shouldQuit() || g_agi->restartGame));
_v[p1] = atoi(game.strings[MAX_STRINGS]);
+
debugC(4, kDebugLevelScripts, "[%s] -> %d", game.strings[MAX_STRINGS], _v[p1]);
+
g_agi->clearLines(22, 22, game.colorBg);
g_agi->flushLines(22, 22);
}
@@ -1361,7 +1378,7 @@
if (curLogic->texts != NULL && (p0 - 1) <= curLogic->numTexts) {
game.cursorChar = *curLogic->texts[p0 - 1];
} else {
- /* default */
+ // default
game.cursorChar = '_';
}
}
@@ -1371,7 +1388,7 @@
debugC(4, kDebugLevelScripts, "%d %d %d", p0, p1, p2);
- if (game.evKeyp[p2].data != 0) /* TBC sets c23 (ESC) twice! */
+ if (game.evKeyp[p2].data != 0) // TBC sets c23 (ESC) twice!
return;
key = 256 * p1 + p0;
@@ -1380,7 +1397,7 @@
}
cmd(set_string) {
- /* CM: to avoid crash in Groza (str = 150) */
+ // CM: to avoid crash in Groza (str = 150)
if (p0 > MAX_STRINGS)
return;
strcpy(game.strings[p0], curLogic->texts[p1 - 1]);
@@ -1406,12 +1423,13 @@
if ((c = p4) != 0)
c = 15;
+
x1 = p1 * CHAR_COLS;
y1 = p0 * CHAR_LINES;
x2 = (p3 + 1) * CHAR_COLS - 1;
y2 = (p2 + 1) * CHAR_LINES - 1;
- /* Added to prevent crash with x2 = 40 in the iigs demo */
+ // Added to prevent crash with x2 = 40 in the iigs demo
if (x1 > GFX_WIDTH)
x1 = GFX_WIDTH - 1;
if (x2 > GFX_WIDTH)
@@ -1438,7 +1456,7 @@
cmd(clear_lines) {
uint8 l;
- /* Residence 44 calls clear.lines(24,0,0), see Sarien bug #558423 */
+ // Residence 44 calls clear.lines(24,0,0), see Sarien bug #558423
l = p1 ? p1 : p0;
// Agent06 incorrectly calls clear.lines(1,150,0), see ScummVM bugs
@@ -1451,22 +1469,27 @@
cmd(print) {
int n = p0 < 1 ? 1 : p0;
+
g_agi->print(curLogic->texts[n - 1], 0, 0, 0);
}
cmd(print_f) {
int n = _v[p0] < 1 ? 1 : _v[p0];
+
g_agi->print(curLogic->texts[n - 1], 0, 0, 0);
}
cmd(print_at) {
int n = p0 < 1 ? 1 : p0;
+
debugC(4, kDebugLevelScripts, "%d %d %d %d", p0, p1, p2, p3);
+
g_agi->print(curLogic->texts[n - 1], p1, p2, p3);
}
cmd(print_at_v) {
int n = _v[p0] < 1 ? 1 : _v[p0];
+
g_agi->print(curLogic->texts[n - 1], p1, p2, p3);
}
@@ -1484,7 +1507,7 @@
report("Priority base set to %d\n", p0);
- /* game.alt_pri = true; */
+ // game.alt_pri = true;
x = (_HEIGHT - p0) * _HEIGHT / 10;
for (i = 0; i < _HEIGHT; i++) {
@@ -1521,7 +1544,7 @@
g_gfx->shakeStart();
- g_sprites->commitBoth(); /* Fixes SQ1 demo */
+ g_sprites->commitBoth(); // Fixes SQ1 demo
for (i = 4 * p0; i; i--) {
g_gfx->shakeScreen(i & 1);
g_gfx->flushBlock(0, 0, GFX_WIDTH - 1, GFX_HEIGHT - 1);
@@ -1529,12 +1552,12 @@
}
g_gfx->shakeEnd();
- //Sets input back to what it was
+ // Sets input back to what it was
game.inputEnabled = originalValue;
}
static void (*agiCommand[183])(uint8 *) = {
- NULL, /* 0x00 */
+ NULL, // 0x00
cmd_increment,
cmd_decrement,
cmd_assignn,
@@ -1542,7 +1565,7 @@
cmd_addn,
cmd_addv,
cmd_subn,
- cmd_subv, /* 0x08 */
+ cmd_subv, // 0x08
cmd_lindirectv,
cmd_rindirect,
cmd_lindirectn,
@@ -1550,7 +1573,7 @@
cmd_reset,
cmd_toggle,
cmd_set_v,
- cmd_reset_v, /* 0x10 */
+ cmd_reset_v, // 0x10
cmd_toggle_v,
cmd_new_room,
cmd_new_room_f,
@@ -1558,7 +1581,7 @@
cmd_load_logic_f,
cmd_call,
cmd_call_f,
- cmd_load_pic, /* 0x18 */
+ cmd_load_pic, // 0x18
cmd_draw_pic,
cmd_show_pic,
cmd_discard_pic,
@@ -1566,7 +1589,7 @@
cmd_show_pri_screen,
cmd_load_view,
cmd_load_view_f,
- cmd_discard_view, /* 0x20 */
+ cmd_discard_view, // 0x20
cmd_animate_obj,
cmd_unanimate_all,
cmd_draw,
@@ -1574,7 +1597,7 @@
cmd_position,
cmd_position_f,
cmd_get_posn,
- cmd_reposition, /* 0x28 */
+ cmd_reposition, // 0x28
cmd_set_view,
cmd_set_view_f,
cmd_set_loop,
@@ -1582,7 +1605,7 @@
cmd_fix_loop,
cmd_release_loop,
cmd_set_cel,
- cmd_set_cel_f, /* 0x30 */
+ cmd_set_cel_f, // 0x30
cmd_last_cel,
cmd_current_cel,
cmd_current_loop,
@@ -1590,7 +1613,7 @@
cmd_number_of_loops,
cmd_set_priority,
cmd_set_priority_f,
- cmd_release_priority, /* 0x38 */
+ cmd_release_priority, // 0x38
cmd_get_priority,
cmd_stop_update,
cmd_start_update,
@@ -1598,7 +1621,7 @@
cmd_ignore_horizon,
cmd_observe_horizon,
cmd_set_horizon,
- cmd_object_on_water, /* 0x40 */
+ cmd_object_on_water, // 0x40
cmd_object_on_land,
cmd_object_on_anything,
cmd_ignore_objs,
@@ -1606,7 +1629,7 @@
cmd_distance,
cmd_stop_cycling,
cmd_start_cycling,
- cmd_normal_cycle, /* 0x48 */
+ cmd_normal_cycle, // 0x48
cmd_end_of_loop,
cmd_reverse_cycle,
cmd_reverse_loop,
@@ -1614,7 +1637,7 @@
cmd_stop_motion,
cmd_start_motion,
cmd_step_size,
- cmd_step_time, /* 0x50 */
+ cmd_step_time, // 0x50
cmd_move_obj,
cmd_move_obj_f,
cmd_follow_ego,
@@ -1622,7 +1645,7 @@
cmd_normal_motion,
cmd_set_dir,
cmd_get_dir,
- cmd_ignore_blocks, /* 0x58 */
+ cmd_ignore_blocks, // 0x58
cmd_observe_blocks,
cmd_block,
cmd_unblock,
@@ -1630,7 +1653,7 @@
cmd_get_f,
cmd_drop,
cmd_put,
- cmd_put_f, /* 0x60 */
+ cmd_put_f, // 0x60
cmd_get_room_f,
cmd_load_sound,
cmd_sound,
@@ -1638,7 +1661,7 @@
cmd_print,
cmd_print_f,
cmd_display,
- cmd_display_f, /* 0x68 */
+ cmd_display_f, // 0x68
cmd_clear_lines,
cmd_text_screen,
cmd_graphics,
@@ -1646,7 +1669,7 @@
cmd_set_text_attribute,
cmd_shake_screen,
cmd_configure_screen,
- cmd_status_line_on, /* 0x70 */
+ cmd_status_line_on, // 0x70
cmd_status_line_off,
cmd_set_string,
cmd_get_string,
@@ -1654,7 +1677,7 @@
cmd_parse,
cmd_get_num,
cmd_prevent_input,
- cmd_accept_input, /* 0x78 */
+ cmd_accept_input, // 0x78
cmd_set_key,
cmd_add_to_pic,
cmd_add_to_pic_f,
@@ -1662,7 +1685,7 @@
cmd_save_game,
cmd_load_game,
cmd_init_disk,
- cmd_restart_game, /* 0x80 */
+ cmd_restart_game, // 0x80
cmd_show_obj,
cmd_random,
cmd_program_control,
@@ -1670,7 +1693,7 @@
cmd_obj_status_f,
cmd_quit,
cmd_show_mem,
- cmd_pause, /* 0x88 */
+ cmd_pause, // 0x88
cmd_echo_line,
cmd_cancel_line,
cmd_init_joy,
@@ -1678,7 +1701,7 @@
cmd_version,
cmd_script_size,
cmd_set_game_id,
- cmd_log, /* 0x90 */
+ cmd_log, // 0x90
cmd_set_scan_start,
cmd_reset_scan_start,
cmd_reposition_to,
@@ -1686,7 +1709,7 @@
cmd_trace_on,
cmd_trace_info,
cmd_print_at,
- cmd_print_at_v, /* 0x98 */
+ cmd_print_at_v, // 0x98
cmd_discard_view,
cmd_clear_text_rect,
cmd_set_upper_left,
@@ -1694,7 +1717,7 @@
cmd_set_menu_item,
cmd_submit_menu,
cmd_enable_item,
- cmd_disable_item, /* 0xa0 */
+ cmd_disable_item, // 0xa0
cmd_menu_input,
cmd_show_obj_v,
cmd_open_dialogue,
@@ -1702,7 +1725,7 @@
cmd_mul_n,
cmd_mul_v,
cmd_div_n,
- cmd_div_v, /* 0xa8 */
+ cmd_div_v, // 0xa8
cmd_close_window,
cmd_set_simple,
cmd_push_script,
@@ -1710,7 +1733,7 @@
cmd_hold_key,
cmd_set_pri_base,
cmd_discard_sound,
- cmd_hide_mouse, /* 0xb0 */
+ cmd_hide_mouse, // 0xb0
cmd_allow_menu,
cmd_show_mouse,
cmd_fence_mouse,
@@ -1732,7 +1755,7 @@
g_agi = this;
int num = 0;
- /* If logic not loaded, load it */
+ // If logic not loaded, load it
if (~_game.dirLogic[n].flags & RES_LOADED) {
debugC(4, kDebugLevelScripts, "logic %d not loaded!", n);
agiLoadResource(rLOGIC, n);
@@ -1762,22 +1785,22 @@
}
switch (op = *(code + ip++)) {
- case 0xff: /* if (open/close) */
+ case 0xff: // if (open/close)
testIfCode(n);
break;
- case 0xfe: /* goto */
- /* +2 covers goto size */
+ case 0xfe: // goto
+ // +2 covers goto size
ip += 2 + ((int16)READ_LE_UINT16(code + ip));
- /* timer must keep running even in goto loops,
- * but AGI engine can't do that :(
- */
+
+ // timer must keep running even in goto loops,
+ // but AGI engine can't do that :(
if (timerHack > 20) {
g_gfx->pollTimer();
updateTimer();
timerHack = 0;
}
break;
- case 0x00: /* return */
+ case 0x00: // return
return 1;
default:
num = logicNamesCmd[op].numArgs;
@@ -1793,7 +1816,7 @@
break;
}
- return 0; /* after executing new.room() */
+ return 0; // after executing new.room()
}
void AgiEngine::executeAgiCommand(uint8 op, uint8 *p) {
Modified: scummvm/trunk/engines/agi/op_dbg.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_dbg.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/op_dbg.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -23,8 +23,6 @@
*
*/
-
-
#include "agi/agi.h"
#include "agi/opcodes.h"
@@ -58,7 +56,7 @@
_L("controller", 1, 0x00),
_L("have.key", 0, 0x00),
- /* Not 0 args. Has variable number. */
+ // Not 0 args. Has variable number.
_L("said", 0, 0x00),
_L("compare.strings", 2, 0x00),
@@ -66,7 +64,7 @@
_L("center.posn", 5, 0x00),
_L("right.posn", 5, 0x00),
- /* Haven't seen an official name for this command so tried to name it descriptively. */
+ // Haven't seen an official name for this command so tried to name it descriptively.
_L("in.motion.using.mouse", 0, 0x00)
};
@@ -78,200 +76,200 @@
};
struct AgiLogicnames logicNamesCmd[] = {
- _L("return", 0, 0x00), /* 00 */
- _L("increment", 1, 0x80), /* 01 */
- _L("decrement", 1, 0x80), /* 02 */
- _L("assignn", 2, 0x80), /* 03 */
- _L("assignv", 2, 0xC0), /* 04 */
- _L("addn", 2, 0x80), /* 05 */
- _L("addv", 2, 0xC0), /* 06 */
- _L("subn", 2, 0x80), /* 07 */
- _L("subv", 2, 0xC0), /* 08 */
- _L("lindirectv", 2, 0xC0), /* 09 */
- _L("rindirect", 2, 0xC0), /* 0A */
- _L("lindirectn", 2, 0x80), /* 0B */
- _L("set", 1, 0x00), /* 0C */
- _L("reset", 1, 0x00), /* 0D */
- _L("toggle", 1, 0x00), /* 0E */
- _L("set.v", 1, 0x80), /* 0F */
- _L("reset.v", 1, 0x80), /* 10 */
- _L("toggle.v", 1, 0x80), /* 11 */
- _L("new.room", 1, 0x00), /* 12 */
- _L("new.room.v", 1, 0x80), /* 13 */
- _L("load.logics", 1, 0x00), /* 14 */
- _L("load.logics.v", 1, 0x80), /* 15 */
- _L("call", 1, 0x00), /* 16 */
- _L("call.v", 1, 0x80), /* 17 */
- _L("load.pic", 1, 0x80), /* 18 */
- _L("draw.pic", 1, 0x80), /* 19 */
- _L("show.pic", 0, 0x00), /* 1A */
- _L("discard.pic", 1, 0x80), /* 1B */
- _L("overlay.pic", 1, 0x80), /* 1C */
- _L("show.pri.screen", 0, 0x00), /* 1D */
- _L("load.view", 1, 0x00), /* 1E */
- _L("load.view.v", 1, 0x80), /* 1F */
- _L("discard.view", 1, 0x00), /* 20 */
- _L("animate.obj", 1, 0x00), /* 21 */
- _L("unanimate.all", 0, 0x00), /* 22 */
- _L("draw", 1, 0x00), /* 23 */
- _L("erase", 1, 0x00), /* 24 */
- _L("position", 3, 0x00), /* 25 */
- _L("position.v", 3, 0x60), /* 26 */
- _L("get.posn", 3, 0x60), /* 27 */
- _L("reposition", 3, 0x60), /* 28 */
- _L("set.view", 2, 0x00), /* 29 */
- _L("set.view.v", 2, 0x40), /* 2A */
- _L("set.loop", 2, 0x00), /* 2B */
- _L("set.loop.v", 2, 0x40), /* 2C */
- _L("fix.loop", 1, 0x00), /* 2D */
- _L("release.loop", 1, 0x00), /* 2E */
- _L("set.cel", 2, 0x00), /* 2F */
- _L("set.cel.v", 2, 0x40), /* 30 */
- _L("last.cel", 2, 0x40), /* 31 */
- _L("current.cel", 2, 0x40), /* 32 */
- _L("current.loop", 2, 0x40), /* 33 */
- _L("current.view", 2, 0x40), /* 34 */
- _L("number.of.loops", 2, 0x40), /* 35 */
- _L("set.priority", 2, 0x00), /* 36 */
- _L("set.priority.v", 2, 0x40), /* 37 */
- _L("release.priority", 1, 0x00), /* 38 */
- _L("get.priority", 2, 0x40), /* 39 */
- _L("stop.update", 1, 0x00), /* 3A */
- _L("start.update", 1, 0x00), /* 3B */
- _L("force.update", 1, 0x00), /* 3C */
- _L("ignore.horizon", 1, 0x00), /* 3D */
- _L("observe.horizon", 1, 0x00), /* 3E */
- _L("set.horizon", 1, 0x00), /* 3F */
- _L("object.on.water", 1, 0x00), /* 40 */
- _L("object.on.land", 1, 0x00), /* 41 */
- _L("object.on.anything", 1, 0x00), /* 42 */
- _L("ignore.objs", 1, 0x00), /* 43 */
- _L("observe.objs", 1, 0x00), /* 44 */
- _L("distance", 3, 0x20), /* 45 */
- _L("stop.cycling", 1, 0x00), /* 46 */
- _L("start.cycling", 1, 0x00), /* 47 */
- _L("normal.cycle", 1, 0x00), /* 48 */
- _L("end.of.loop", 2, 0x00), /* 49 */
- _L("reverse.cycle", 1, 0x00), /* 4A */
- _L("reverse.loop", 2, 0x00), /* 4B */
- _L("cycle.time", 2, 0x40), /* 4C */
- _L("stop.motion", 1, 0x00), /* 4D */
- _L("start.motion", 1, 0x00), /* 4E */
- _L("step.size", 2, 0x40), /* 4F */
- _L("step.time", 2, 0x40), /* 50 */
- _L("move.obj", 5, 0x00), /* 51 */
- _L("move.obj.v", 5, 0x70), /* 52 */
- _L("follow.ego", 3, 0x00), /* 53 */
- _L("wander", 1, 0x00), /* 54 */
- _L("normal.motion", 1, 0x00), /* 55 */
- _L("set.dir", 2, 0x40), /* 56 */
- _L("get.dir", 2, 0x40), /* 57 */
- _L("ignore.blocks", 1, 0x00), /* 58 */
- _L("observe.blocks", 1, 0x00), /* 59 */
- _L("block", 4, 0x00), /* 5A */
- _L("unblock", 0, 0x00), /* 5B */
- _L("get", 1, 0x00), /* 5C */
- _L("get.v", 1, 0x80), /* 5D */
- _L("drop", 1, 0x00), /* 5E */
- _L("put", 2, 0x00), /* 5F */
- _L("put.v", 2, 0x40), /* 60 */
- _L("get.room.v", 2, 0xC0), /* 61 */
- _L("load.sound", 1, 0x00), /* 62 */
- _L("sound", 2, 0x00), /* 63 */
- _L("stop.sound", 0, 0x00), /* 64 */
- _L("print", 1, 0x00), /* 65 */
- _L("print.v", 1, 0x80), /* 66 */
- _L("display", 3, 0x00), /* 67 */
- _L("display.v", 3, 0xE0), /* 68 */
- _L("clear.lines", 3, 0x00), /* 69 */
- _L("text.screen", 0, 0x00), /* 6A */
- _L("graphics", 0, 0x00), /* 6B */
- _L("set.cursor.char", 1, 0x00), /* 6C */
- _L("set.text.attribute", 2, 0x00), /* 6D */
- _L("shake.screen", 1, 0x00), /* 6E */
- _L("configure.screen", 3, 0x00), /* 6F */
- _L("status.line.on", 0, 0x00), /* 70 */
- _L("status.line.off", 0, 0x00), /* 71 */
- _L("set.string", 2, 0x00), /* 72 */
- _L("get.string", 5, 0x00), /* 73 */
- _L("word.to.string", 2, 0x00), /* 74 */
- _L("parse", 1, 0x00), /* 75 */
- _L("get.num", 2, 0x40), /* 76 */
- _L("prevent.input", 0, 0x00), /* 77 */
- _L("accept.input", 0, 0x00), /* 78 */
- _L("set.key", 3, 0x00), /* 79 */
- _L("add.to.pic", 7, 0x00), /* 7A */
- _L("add.to.pic.v", 7, 0xFE), /* 7B */
- _L("status", 0, 0x00), /* 7C */
- _L("save.game", 0, 0x00), /* 7D */
- _L("restore.game", 0, 0x00), /* 7E */
- _L("init.disk", 0, 0x00), /* 7F */
- _L("restart.game", 0, 0x00), /* 80 */
- _L("show.obj", 1, 0x00), /* 81 */
- _L("random", 3, 0x20), /* 82 */
- _L("program.control", 0, 0x00), /* 83 */
- _L("player.control", 0, 0x00), /* 84 */
- _L("obj.status.v", 1, 0x80), /* 85 */
- /* 0 args for AGI version 2.089 */
- _L("quit", 1, 0x00), /* 86 */
+ _L("return", 0, 0x00), // 00
+ _L("increment", 1, 0x80), // 01
+ _L("decrement", 1, 0x80), // 02
+ _L("assignn", 2, 0x80), // 03
+ _L("assignv", 2, 0xC0), // 04
+ _L("addn", 2, 0x80), // 05
+ _L("addv", 2, 0xC0), // 06
+ _L("subn", 2, 0x80), // 07
+ _L("subv", 2, 0xC0), // 08
+ _L("lindirectv", 2, 0xC0), // 09
+ _L("rindirect", 2, 0xC0), // 0A
+ _L("lindirectn", 2, 0x80), // 0B
+ _L("set", 1, 0x00), // 0C
+ _L("reset", 1, 0x00), // 0D
+ _L("toggle", 1, 0x00), // 0E
+ _L("set.v", 1, 0x80), // 0F
+ _L("reset.v", 1, 0x80), // 10
+ _L("toggle.v", 1, 0x80), // 11
+ _L("new.room", 1, 0x00), // 12
+ _L("new.room.v", 1, 0x80), // 13
+ _L("load.logics", 1, 0x00), // 14
+ _L("load.logics.v", 1, 0x80), // 15
+ _L("call", 1, 0x00), // 16
+ _L("call.v", 1, 0x80), // 17
+ _L("load.pic", 1, 0x80), // 18
+ _L("draw.pic", 1, 0x80), // 19
+ _L("show.pic", 0, 0x00), // 1A
+ _L("discard.pic", 1, 0x80), // 1B
+ _L("overlay.pic", 1, 0x80), // 1C
+ _L("show.pri.screen", 0, 0x00), // 1D
+ _L("load.view", 1, 0x00), // 1E
+ _L("load.view.v", 1, 0x80), // 1F
+ _L("discard.view", 1, 0x00), // 20
+ _L("animate.obj", 1, 0x00), // 21
+ _L("unanimate.all", 0, 0x00), // 22
+ _L("draw", 1, 0x00), // 23
+ _L("erase", 1, 0x00), // 24
+ _L("position", 3, 0x00), // 25
+ _L("position.v", 3, 0x60), // 26
+ _L("get.posn", 3, 0x60), // 27
+ _L("reposition", 3, 0x60), // 28
+ _L("set.view", 2, 0x00), // 29
+ _L("set.view.v", 2, 0x40), // 2A
+ _L("set.loop", 2, 0x00), // 2B
+ _L("set.loop.v", 2, 0x40), // 2C
+ _L("fix.loop", 1, 0x00), // 2D
+ _L("release.loop", 1, 0x00), // 2E
+ _L("set.cel", 2, 0x00), // 2F
+ _L("set.cel.v", 2, 0x40), // 30
+ _L("last.cel", 2, 0x40), // 31
+ _L("current.cel", 2, 0x40), // 32
+ _L("current.loop", 2, 0x40), // 33
+ _L("current.view", 2, 0x40), // 34
+ _L("number.of.loops", 2, 0x40), // 35
+ _L("set.priority", 2, 0x00), // 36
+ _L("set.priority.v", 2, 0x40), // 37
+ _L("release.priority", 1, 0x00), // 38
+ _L("get.priority", 2, 0x40), // 39
+ _L("stop.update", 1, 0x00), // 3A
+ _L("start.update", 1, 0x00), // 3B
+ _L("force.update", 1, 0x00), // 3C
+ _L("ignore.horizon", 1, 0x00), // 3D
+ _L("observe.horizon", 1, 0x00), // 3E
+ _L("set.horizon", 1, 0x00), // 3F
+ _L("object.on.water", 1, 0x00), // 40
+ _L("object.on.land", 1, 0x00), // 41
+ _L("object.on.anything", 1, 0x00), // 42
+ _L("ignore.objs", 1, 0x00), // 43
+ _L("observe.objs", 1, 0x00), // 44
+ _L("distance", 3, 0x20), // 45
+ _L("stop.cycling", 1, 0x00), // 46
+ _L("start.cycling", 1, 0x00), // 47
+ _L("normal.cycle", 1, 0x00), // 48
+ _L("end.of.loop", 2, 0x00), // 49
+ _L("reverse.cycle", 1, 0x00), // 4A
+ _L("reverse.loop", 2, 0x00), // 4B
+ _L("cycle.time", 2, 0x40), // 4C
+ _L("stop.motion", 1, 0x00), // 4D
+ _L("start.motion", 1, 0x00), // 4E
+ _L("step.size", 2, 0x40), // 4F
+ _L("step.time", 2, 0x40), // 50
+ _L("move.obj", 5, 0x00), // 51
+ _L("move.obj.v", 5, 0x70), // 52
+ _L("follow.ego", 3, 0x00), // 53
+ _L("wander", 1, 0x00), // 54
+ _L("normal.motion", 1, 0x00), // 55
+ _L("set.dir", 2, 0x40), // 56
+ _L("get.dir", 2, 0x40), // 57
+ _L("ignore.blocks", 1, 0x00), // 58
+ _L("observe.blocks", 1, 0x00), // 59
+ _L("block", 4, 0x00), // 5A
+ _L("unblock", 0, 0x00), // 5B
+ _L("get", 1, 0x00), // 5C
+ _L("get.v", 1, 0x80), // 5D
+ _L("drop", 1, 0x00), // 5E
+ _L("put", 2, 0x00), // 5F
+ _L("put.v", 2, 0x40), // 60
+ _L("get.room.v", 2, 0xC0), // 61
+ _L("load.sound", 1, 0x00), // 62
+ _L("sound", 2, 0x00), // 63
+ _L("stop.sound", 0, 0x00), // 64
+ _L("print", 1, 0x00), // 65
+ _L("print.v", 1, 0x80), // 66
+ _L("display", 3, 0x00), // 67
+ _L("display.v", 3, 0xE0), // 68
+ _L("clear.lines", 3, 0x00), // 69
+ _L("text.screen", 0, 0x00), // 6A
+ _L("graphics", 0, 0x00), // 6B
+ _L("set.cursor.char", 1, 0x00), // 6C
+ _L("set.text.attribute", 2, 0x00), // 6D
+ _L("shake.screen", 1, 0x00), // 6E
+ _L("configure.screen", 3, 0x00), // 6F
+ _L("status.line.on", 0, 0x00), // 70
+ _L("status.line.off", 0, 0x00), // 71
+ _L("set.string", 2, 0x00), // 72
+ _L("get.string", 5, 0x00), // 73
+ _L("word.to.string", 2, 0x00), // 74
+ _L("parse", 1, 0x00), // 75
+ _L("get.num", 2, 0x40), // 76
+ _L("prevent.input", 0, 0x00), // 77
+ _L("accept.input", 0, 0x00), // 78
+ _L("set.key", 3, 0x00), // 79
+ _L("add.to.pic", 7, 0x00), // 7A
+ _L("add.to.pic.v", 7, 0xFE), // 7B
+ _L("status", 0, 0x00), // 7C
+ _L("save.game", 0, 0x00), // 7D
+ _L("restore.game", 0, 0x00), // 7E
+ _L("init.disk", 0, 0x00), // 7F
+ _L("restart.game", 0, 0x00), // 80
+ _L("show.obj", 1, 0x00), // 81
+ _L("random", 3, 0x20), // 82
+ _L("program.control", 0, 0x00), // 83
+ _L("player.control", 0, 0x00), // 84
+ _L("obj.status.v", 1, 0x80), // 85
+ // 0 args for AGI version 2.089
+ _L("quit", 1, 0x00), // 86
- _L("show.mem", 0, 0x00), /* 87 */
- _L("pause", 0, 0x00), /* 88 */
- _L("echo.line", 0, 0x00), /* 89 */
- _L("cancel.line", 0, 0x00), /* 8A */
- _L("init.joy", 0, 0x00), /* 8B */
- _L("toggle.monitor", 0, 0x00), /* 8C */
- _L("version", 0, 0x00), /* 8D */
- _L("script.size", 1, 0x00), /* 8E */
- _L("set.game.id", 1, 0x00), /* 8F */
- _L("log", 1, 0x00), /* 90 */
- _L("set.scan.start", 0, 0x00), /* 91 */
- _L("reset.scan.start", 0, 0x00), /* 92 */
- _L("reposition.to", 3, 0x00), /* 93 */
- _L("reposition.to.v", 3, 0x60), /* 94 */
- _L("trace.on", 0, 0x00), /* 95 */
- _L("trace.info", 3, 0x00), /* 96 */
+ _L("show.mem", 0, 0x00), // 87
+ _L("pause", 0, 0x00), // 88
+ _L("echo.line", 0, 0x00), // 89
+ _L("cancel.line", 0, 0x00), // 8A
+ _L("init.joy", 0, 0x00), // 8B
+ _L("toggle.monitor", 0, 0x00), // 8C
+ _L("version", 0, 0x00), // 8D
+ _L("script.size", 1, 0x00), // 8E
+ _L("set.game.id", 1, 0x00), // 8F
+ _L("log", 1, 0x00), // 90
+ _L("set.scan.start", 0, 0x00), // 91
+ _L("reset.scan.start", 0, 0x00), // 92
+ _L("reposition.to", 3, 0x00), // 93
+ _L("reposition.to.v", 3, 0x60), // 94
+ _L("trace.on", 0, 0x00), // 95
+ _L("trace.info", 3, 0x00), // 96
- /* 3 args for AGI versions before 2.440 */
- _L("print.at", 4, 0x00), /* 97 */
- _L("print.at.v", 4, 0x80), /* 98 */
+ // 3 args for AGI versions before 2.440
+ _L("print.at", 4, 0x00), // 97
+ _L("print.at.v", 4, 0x80), // 98
- _L("discard.view.v", 1, 0x80), /* 99 */
- _L("clear.text.rect", 5, 0x00), /* 9A */
- _L("set.upper.left", 2, 0x00), /* 9B */
- _L("set.menu", 1, 0x00), /* 9C */
- _L("set.menu.item", 2, 0x00), /* 9D */
- _L("submit.menu", 0, 0x00), /* 9E */
- _L("enable.item", 1, 0x00), /* 9F */
- _L("disable.item", 1, 0x00), /* A0 */
- _L("menu.input", 0, 0x00), /* A1 */
- _L("show.obj.v", 1, 0x01), /* A2 */
- _L("open.dialogue", 0, 0x00), /* A3 */
- _L("close.dialogue", 0, 0x00), /* A4 */
- _L("mul.n", 2, 0x80), /* A5 */
- _L("mul.v", 2, 0xC0), /* A6 */
- _L("div.n", 2, 0x80), /* A7 */
- _L("div.v", 2, 0xC0), /* A8 */
- _L("close.window", 0, 0x00), /* A9 */
+ _L("discard.view.v", 1, 0x80), // 99
+ _L("clear.text.rect", 5, 0x00), // 9A
+ _L("set.upper.left", 2, 0x00), // 9B
+ _L("set.menu", 1, 0x00), // 9C
+ _L("set.menu.item", 2, 0x00), // 9D
+ _L("submit.menu", 0, 0x00), // 9E
+ _L("enable.item", 1, 0x00), // 9F
+ _L("disable.item", 1, 0x00), // A0
+ _L("menu.input", 0, 0x00), // A1
+ _L("show.obj.v", 1, 0x01), // A2
+ _L("open.dialogue", 0, 0x00), // A3
+ _L("close.dialogue", 0, 0x00), // A4
+ _L("mul.n", 2, 0x80), // A5
+ _L("mul.v", 2, 0xC0), // A6
+ _L("div.n", 2, 0x80), // A7
+ _L("div.v", 2, 0xC0), // A8
+ _L("close.window", 0, 0x00), // A9
- _L("set.simple", 1, 0x00), /* AA */
- _L("push.script", 0, 0x00), /* AB */
- _L("pop.script", 0, 0x00), /* AC */
- _L("hold.key", 0, 0x00), /* AD */
- _L("set.pri.base", 1, 0x00), /* AE */
- _L("discard.sound", 1, 0x00), /* AF */
+ _L("set.simple", 1, 0x00), // AA
+ _L("push.script", 0, 0x00), // AB
+ _L("pop.script", 0, 0x00), // AC
+ _L("hold.key", 0, 0x00), // AD
+ _L("set.pri.base", 1, 0x00), // AE
+ _L("discard.sound", 1, 0x00), // AF
- /* 1 arg for AGI version 3.002.086 */
- _L("hide.mouse", 0, 0x00), /* B0 */
+ // 1 arg for AGI version 3.002.086
+ _L("hide.mouse", 0, 0x00), // B0
- _L("allow.menu", 1, 0x00), /* B1 */
- _L("show.mouse", 0, 0x00), /* B2 */
- _L("fence.mouse", 4, 0x00), /* B3 */
- _L("mouse.posn", 2, 0x00), /* B4 */
- _L("release.key", 0, 0x00), /* B5 */
+ _L("allow.menu", 1, 0x00), // B1
+ _L("show.mouse", 0, 0x00), // B2
+ _L("fence.mouse", 4, 0x00), // B3
+ _L("mouse.posn", 2, 0x00), // B4
+ _L("release.key", 0, 0x00), // B5
- /* 2 args for at least the Amiga Gold Rush! (v2.05 1989-03-09) using Amiga AGI 2.316. */
- _L("adj.ego.move.to.xy", 0, 0x00), /* B6 */
+ // 2 args for at least the Amiga Gold Rush! (v2.05 1989-03-09) using Amiga AGI 2.316.
+ _L("adj.ego.move.to.xy", 0, 0x00), // B6
_L(NULL, 0, 0x00)
};
@@ -297,15 +295,15 @@
if (_debug.opcodes) {
report("%02X %02X %02X %02X %02X %02X %02X %02X %02X\n"
" ",
- (uint8) * (code + (0 + ip)) & 0xFF,
- (uint8) * (code + (1 + ip)) & 0xFF,
- (uint8) * (code + (2 + ip)) & 0xFF,
- (uint8) * (code + (3 + ip)) & 0xFF,
- (uint8) * (code + (4 + ip)) & 0xFF,
- (uint8) * (code + (5 + ip)) & 0xFF,
- (uint8) * (code + (6 + ip)) & 0xFF,
- (uint8) * (code + (7 + ip)) & 0xFF,
- (uint8) * (code + (8 + ip)) & 0xFF);
+ (uint8)*(code + (0 + ip)) & 0xFF,
+ (uint8)*(code + (1 + ip)) & 0xFF,
+ (uint8)*(code + (2 + ip)) & 0xFF,
+ (uint8)*(code + (3 + ip)) & 0xFF,
+ (uint8)*(code + (4 + ip)) & 0xFF,
+ (uint8)*(code + (5 + ip)) & 0xFF,
+ (uint8)*(code + (6 + ip)) & 0xFF,
+ (uint8)*(code + (7 + ip)) & 0xFF,
+ (uint8)*(code + (8 + ip)) & 0xFF);
}
report("%s ", (x + *(code + ip) - 0xFC)->name);
break;
Modified: scummvm/trunk/engines/agi/op_test.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_test.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/op_test.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -52,7 +52,7 @@
#define testHas(obj) (g_agi->objectGetLocation(obj) == EGO_OWNED)
#define testObjInRoom(obj, v) (g_agi->objectGetLocation(obj) == g_agi->getvar(v))
-extern int timerHack; /* For the timer loop in MH1 logic 153 */
+extern int timerHack; // For the timer loop in MH1 logic 153
static uint8 testCompareStrings(uint8 s1, uint8 s2) {
char ms1[MAX_STRINGLEN];
@@ -113,6 +113,7 @@
game.keypress = 0;
if (!x) {
int mode = game.inputMode;
+
game.inputMode = INPUT_NONE;
g_agi->mainCycle();
game.inputMode = mode;
@@ -146,7 +147,7 @@
v->yPos >= y1 && v->xPos + v->xSize - 1 <= x2 && v->yPos <= y2;
}
-/* if n is in centre of box */
+// if n is in centre of box
static uint8 testObjCentre(uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2) {
VtEntry *v = &game.viewTable[n];
@@ -154,7 +155,7 @@
v->xPos + v->xSize / 2 <= x2 && v->yPos >= y1 && v->yPos <= y2;
}
-/* if nect N is in right corner */
+// if nect N is in right corner
static uint8 testObjRight(uint8 n, uint8 x1, uint8 y1, uint8 x2, uint8 y2) {
VtEntry *v = &game.viewTable[n];
@@ -162,7 +163,7 @@
v->xPos + v->xSize - 1 <= x2 && v->yPos >= y1 && v->yPos <= y2;
}
-/* When player has entered something, it is parsed elsewhere */
+// When player has entered something, it is parsed elsewhere
static uint8 testSaid(uint8 nwords, uint8 *cc) {
int c, n = game.numEgoWords;
int z = 0;
@@ -170,33 +171,32 @@
if (g_agi->getflag(fSaidAcceptedInput) || !g_agi->getflag(fEnteredCli))
return false;
- /* FR:
- * I think the reason for the code below is to add some speed....
- *
- * if (nwords != num_ego_words)
- * return false;
- *
- * In the disco scene in Larry 1 when you type "examine blonde",
- * inside the logic is expected ( said("examine", "blonde", "rol") )
- * where word("rol") = 9999
- *
- * According to the interpreter code 9999 means that whatever the
- * user typed should be correct, but it looks like code 9999 means that
- * if the string is empty at this point, the entry is also correct...
- *
- * With the removal of this code, the behaviour of the scene was
- * corrected
- */
+ // FR:
+ // I think the reason for the code below is to add some speed....
+ //
+ // if (nwords != num_ego_words)
+ // return false;
+ //
+ // In the disco scene in Larry 1 when you type "examine blonde",
+ // inside the logic is expected ( said("examine", "blonde", "rol") )
+ // where word("rol") = 9999
+ //
+ // According to the interpreter code 9999 means that whatever the
+ // user typed should be correct, but it looks like code 9999 means that
+ // if the string is empty at this point, the entry is also correct...
+ //
+ // With the removal of this code, the behaviour of the scene was
+ // corrected
for (c = 0; nwords && n; c++, nwords--, n--) {
z = READ_LE_UINT16(cc);
cc += 2;
switch (z) {
- case 9999: /* rest of line (empty string counts to...) */
+ case 9999: // rest of line (empty string counts to...)
nwords = 1;
break;
- case 1: /* any word */
+ case 1: // any word
break;
default:
if (game.egoWords[c].id != z)
@@ -205,13 +205,12 @@
}
}
- /* The entry string should be entirely parsed, or last word = 9999 */
+ // The entry string should be entirely parsed, or last word = 9999
if (n && z != 9999)
return false;
- /* The interpreter string shouldn't be entirely parsed, but next
- * word must be 9999.
- */
+ // The interpreter string shouldn't be entirely parsed, but next
+ // word must be 9999.
if (nwords != 0 && READ_LE_UINT16(cc) != 9999)
return false;
@@ -240,16 +239,15 @@
memmove(p, (code + ip), 16);
switch (op) {
- case 0xFF: /* END IF, TEST true */
+ case 0xFF: // END IF, TEST true
end_test = true;
break;
case 0xFD:
notTest = !notTest;
continue;
- case 0xFC: /* OR */
- /* if or_test is ON and we hit 0xFC, end of OR, then
- * or is STILL false so break.
- */
+ case 0xFC: // OR
+ // if or_test is ON and we hit 0xFC, end of OR, then
+ // or is STILL false so break.
if (orTest) {
ec = false;
retval = false;
@@ -260,7 +258,7 @@
continue;
case 0x00:
- /* return true? */
+ // return true?
end_test = true;
break;
case 0x01:
@@ -317,9 +315,9 @@
case 0x0E:
ec = testSaid(p[0], (uint8 *) code + (ip + 1));
ip = lastIp;
- ip++; /* skip opcode */
- ip += p[0] * 2; /* skip num_words * 2 */
- ip++; /* skip num_words opcode */
+ ip++; // skip opcode
+ ip += p[0] * 2; // skip num_words * 2
+ ip++; // skip num_words opcode
break;
case 0x0F:
debugC(7, kDebugLevelScripts, "comparing [%s], [%s]", game.strings[p[0]], game.strings[p[1]]);
@@ -353,39 +351,38 @@
if (op <= 0x12)
ip += logicNamesTest[op].numArgs;
- /* exchange ec value */
+ // exchange ec value
if (notTest)
ec = !ec;
- /* not is only enabled for 1 test command */
+ // not is only enabled for 1 test command
notTest = false;
if (orTest && ec) {
- /* a true inside an OR statement passes
- * ENTIRE statement scan for end of OR
- */
+ // a true inside an OR statement passes
+ // ENTIRE statement scan for end of OR
- /* CM: test for opcode < 0xfc changed from 'op' to
- * '*(code+ip)', to avoid problem with the 0xfd (NOT)
- * opcode byte. Changed a bad ip += ... ip++ construct.
- * This should fix the crash with Larry's logic.0 code:
- *
- * if ((isset(4) ||
- * !isset(2) ||
- * v30 == 2 ||
- * v30 == 1)) {
- * goto Label1;
- * }
- *
- * The bytecode is:
- * ff fc 07 04 fd 07 02 01 1e 02 01 1e 01 fc ff
- */
+ // CM: test for opcode < 0xfc changed from 'op' to
+ // '*(code+ip)', to avoid problem with the 0xfd (NOT)
+ // opcode byte. Changed a bad ip += ... ip++ construct.
+ // This should fix the crash with Larry's logic.0 code:
+ //
+ // if ((isset(4) ||
+ // !isset(2) ||
+ // v30 == 2 ||
+ // v30 == 1)) {
+ // goto Label1;
+ // }
+ //
+ // The bytecode is:
+ // ff fc 07 04 fd 07 02 01 1e 02 01 1e 01 fc ff
- /* find end of OR */
+ // find end of OR
while (*(code + ip) != 0xFC) {
- if (*(code + ip) == 0x0E) { /* said */
+ if (*(code + ip) == 0x0E) { // said
ip++;
- /* cover count + ^words */
+
+ // cover count + ^words
ip += 1 + ((*(code + ip)) * 2);
continue;
}
@@ -404,7 +401,7 @@
}
}
- /* if false, scan for end of IP? */
+ // if false, scan for end of IP?
if (retval)
ip += 2;
else {
@@ -420,7 +417,7 @@
ip++;
}
}
- ip++; /* skip over 0xFF */
+ ip++; // skip over 0xFF
ip += READ_LE_UINT16(code + ip) + 2;
}
@@ -430,4 +427,4 @@
return retval;
}
-} // End of namespace Agi
+} // End of namespace Agi
Modified: scummvm/trunk/engines/agi/picture.cpp
===================================================================
--- scummvm/trunk/engines/agi/picture.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/picture.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -90,7 +90,7 @@
#else
int i, x, y, deltaX, deltaY, stepX, stepY, errorX, errorY, detdelta;
- /* Vertical line */
+ // Vertical line
if (x1 == x2) {
if (y1 > y2) {
@@ -103,7 +103,7 @@
return;
}
- /* Horizontal line */
+ // Horizontal line
if (y1 == y2) {
if (x1 > x2) {
@@ -274,7 +274,7 @@
if (!isOkFillHere(p.x, p.y))
continue;
- /* Scan for left border */
+ // Scan for left border
for (c = p.x - 1; isOkFillHere(c, p.y); c--)
;
@@ -592,7 +592,7 @@
break;
case 0xe4: // fill (C64)
_scrColor = nextByte();
- _scrColor &= 0xF; /* for v3 drawing diff */
+ _scrColor &= 0xF; // for v3 drawing diff
fill();
break;
case 0xe5: // enable screen drawing (C64)
@@ -883,7 +883,7 @@
* @param n AGI picture resource number
*/
int PictureMgr::unloadPicture(int n) {
- /* remove visual buffer & priority buffer if they exist */
+ // remove visual buffer & priority buffer if they exist
if (_vm->_game.dirPic[n].flags & RES_LOADED) {
free(_vm->_game.pictures[n].rdata);
_vm->_game.dirPic[n].flags &= ~RES_LOADED;
Modified: scummvm/trunk/engines/agi/preagi.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi.cpp 2009-06-06 17:37:51 UTC (rev 41238)
+++ scummvm/trunk/engines/agi/preagi.cpp 2009-06-06 17:39:13 UTC (rev 41239)
@@ -54,15 +54,6 @@
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
- /*
- const GameSettings *g;
-
- const char *gameid = ConfMan.get("gameid").c_str();
- for (g = agiSettings; g->gameid; ++g)
- if (!scumm_stricmp(g->gameid, gameid))
- _gameId = g->id;
- */
-
_rnd = new Common::RandomSource();
Common::addDebugChannel(kDebugLevelMain, "Main", "Generic debug level");
@@ -79,29 +70,6 @@
memset(&_game, 0, sizeof(struct AgiGame));
memset(&_debug, 0, sizeof(struct AgiDebug));
memset(&g_mouse, 0, sizeof(struct Mouse));
-
-/*
- _game.clockEnabled = false;
- _game.state = STATE_INIT;
-
- _keyQueueStart = 0;
- _keyQueueEnd = 0;
-
- _allowSynthetic = false;
-
- g_tickTimer = 0;
-
- _intobj = NULL;
-
- _lastSentence[0] = 0;
- memset(&_stringdata, 0, sizeof(struct StringData));
-
- _objects = NULL;
-
- _oldMode = -1;
-
- _firstSlot = 0;
-*/
}
void PreAgiEngine::initialize() {
@@ -170,7 +138,7 @@
debugC(2, kDebugLevelMain, "Detect game");
- /* clear all resources and events */
+ // clear all resources and events
for (int i = 0; i < MAX_DIRS; i++) {
memset(&_game.pictures[i], 0, sizeof(struct AgiPicture));
memset(&_game.sounds[i], 0, sizeof(class AgiSound *)); // _game.sounds contains pointers now
@@ -190,10 +158,10 @@
Common::Error PreAgiEngine::go() {
@@ Diff output truncated at 100000 characters. @@
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