[Scummvm-cvs-logs] CVS: scummvm/queen structs.h,1.15,1.16 defs.h,1.15,1.16 logic.h,1.42,1.43 logic.cpp,1.57,1.58 display.h,1.7,1.8 display.cpp,1.12,1.13 xref.txt,1.18,1.19
Gregory Montoir
cyx at users.sourceforge.net
Fri Oct 24 18:02:17 CEST 2003
Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv28116
Modified Files:
structs.h defs.h logic.h logic.cpp display.h display.cpp
xref.txt
Log Message:
misc fixes/tweaks
Index: structs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/structs.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- structs.h 23 Oct 2003 08:09:49 -0000 1.15
+++ structs.h 24 Oct 2003 08:55:13 -0000 1.16
@@ -311,7 +311,7 @@
struct CmdListData {
//! action to perform
- int16 verb;
+ Verb verb;
//! first object used in the action
int16 nounObj1;
//! second object used in the action
@@ -357,7 +357,7 @@
int16 specialSection;
void readFrom(byte *&ptr) {
- verb = (int16)READ_BE_UINT16(ptr); ptr += 2;
+ verb = (Verb)READ_BE_UINT16(ptr); ptr += 2;
nounObj1 = (int16)READ_BE_UINT16(ptr); ptr += 2;
nounObj2 = (int16)READ_BE_UINT16(ptr); ptr += 2;
song = (int16)READ_BE_UINT16(ptr); ptr += 2;
@@ -368,6 +368,10 @@
image = (int16)READ_BE_UINT16(ptr); ptr += 2;
specialSection = (int16)READ_BE_UINT16(ptr); ptr += 2;
}
+
+ bool match(Verb v, int16 obj1, int16 obj2) const {
+ return verb == verb && nounObj1 == obj1 && nounObj2 == obj2;
+ }
};
@@ -391,7 +395,7 @@
//! identifier of the command
int16 id;
int16 dstObj; // >0: show, <0: hide
- int16 srcObj; // >0: copy from srcObj, -1: delete dstObj
+ int16 srcObj; // >0: copy from srcObj, 0: nothing, -1: delete dstObj
void readFrom(byte *&ptr) {
id = (int16)READ_BE_UINT16(ptr); ptr += 2;
Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/defs.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- defs.h 23 Oct 2003 18:50:47 -0000 1.15
+++ defs.h 24 Oct 2003 08:55:13 -0000 1.16
@@ -120,7 +120,7 @@
VERB_PICK_UP = 7,
VERB_LOOK_AT = 9,
VERB_TALK_TO = 8,
- VERB_PANEL_COMMAND_LAST = 8,
+ VERB_PANEL_COMMAND_LAST = 9,
VERB_WALK_TO = 10,
VERB_SCROLL_UP = 11,
Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- logic.h 23 Oct 2003 18:46:04 -0000 1.42
+++ logic.h 24 Oct 2003 08:55:13 -0000 1.43
@@ -87,14 +87,14 @@
Logic(Resource *resource, Graphics *graphics, Display *display, Input *input, Sound *sound);
~Logic();
- uint16 currentRoom();
- void currentRoom(uint16 room);
+ uint16 currentRoom() const { return _currentRoom; }
+ void currentRoom(uint16 room) { _currentRoom = room; }
- uint16 oldRoom() { return _oldRoom; }
- void oldRoom(uint16 room);
-
- uint16 newRoom() { return _newRoom; }
- void newRoom(uint16 room) { _newRoom = room; }
+ uint16 oldRoom() const { return _oldRoom; }
+ void oldRoom(uint16 room) { _oldRoom = room; }
+
+ uint16 newRoom() const { return _newRoom; }
+ void newRoom(uint16 room) { _newRoom = room; }
ObjectData* objectData(int index);
uint16 roomData(int room);
@@ -200,6 +200,8 @@
void playCutaway(const char* cutFile);
+ const char* objectOrItemName(int16 obj) const;
+
Display *display() { return _display; }
void update();
@@ -282,7 +284,7 @@
uint16 _numFurnitureAnimated;
//! Number of static furniture in current room (FMAX)
- uint16 _numFurnitureStatic; // FMAX
+ uint16 _numFurnitureStatic;
//! Total number of frames for the animated furniture (FMAXLEN)
uint16 _numFurnitureAnimatedLen;
Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- logic.cpp 23 Oct 2003 18:46:04 -0000 1.57
+++ logic.cpp 24 Oct 2003 08:55:13 -0000 1.58
@@ -113,7 +113,7 @@
uint16 val;
switch (v) {
case VERB_OPEN:
- val = 0;
+ val = 1;
break;
case VERB_CLOSE:
val = 3;
@@ -140,7 +140,7 @@
val = 0;
break;
}
- *objState = (*objState & ~0xF0) | (v << 4);
+ *objState = (*objState & ~0xF0) | (val << 4);
}
@@ -418,17 +418,6 @@
_oldRoom = 0;
}
-uint16 Logic::currentRoom() {
- return _currentRoom;
-}
-
-void Logic::currentRoom(uint16 room) {
- _currentRoom = room;
-}
-
-void Logic::oldRoom(uint16 room) {
- _oldRoom = room;
-}
ObjectData* Logic::objectData(int index) {
return &_objectData[index];
@@ -1894,6 +1883,20 @@
char next[20];
Cutaway::run(cutFile, next, _graphics, _input, this, _resource, _sound);
+}
+
+
+const char* Logic::objectOrItemName(int16 obj) const {
+
+ uint16 name;
+ if (obj < 0) {
+ name = _itemData[ABS(obj)].item;
+ }
+ else {
+ name = _objectData[obj].name;
+ }
+ return _objName[name];
+
}
Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- display.h 20 Oct 2003 20:12:59 -0000 1.7
+++ display.h 24 Oct 2003 08:55:13 -0000 1.8
@@ -126,7 +126,6 @@
uint8 *screen;
int dirtyMin, dirtyMax;
bool scrollable;
- uint16 customScrollSeed;
} _pals;
uint8 *_buffers[3];
Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- display.cpp 23 Oct 2003 06:44:35 -0000 1.12
+++ display.cpp 24 Oct 2003 08:55:13 -0000 1.13
@@ -122,7 +122,6 @@
_pals.dirtyMin = 0;
_pals.dirtyMax = 255;
_pals.scrollable = true;
- _pals.customScrollSeed = 0;
_horizontalScroll = 0;
}
@@ -147,15 +146,13 @@
// FIXME: are these tests really needed ?
if (roomNum < 90 || ((roomNum > 94) && (roomNum < 114))) {
char filename[20];
-
- sprintf(filename, "%s.msk", roomName);
- if (resource->exists(filename))
- resource->loadFile(filename, 0, (uint8*)_dynalum.msk);
-
- sprintf(filename, "%s.lum", roomName);
- if (resource->exists(filename))
- resource->loadFile(filename, 0, (uint8*)_dynalum.lum);
- }
+ sprintf(filename, "%s.msk", roomName);
+ if (resource->exists(filename))
+ resource->loadFile(filename, 0, (uint8*)_dynalum.msk);
+ sprintf(filename, "%s.lum", roomName);
+ if (resource->exists(filename))
+ resource->loadFile(filename, 0, (uint8*)_dynalum.lum);
+ }
}
@@ -361,6 +358,7 @@
void Display::palCustomScroll(uint16 roomNum) {
debug(9, "Display::palCustomScroll(%d)", roomNum);
+ static int16 scrollx = 0;
if (!_pals.scrollable) {
return;
@@ -370,7 +368,7 @@
int loPal = 255;
int i;
- ++_pals.customScrollSeed;
+ ++scrollx;
switch (roomNum) {
case 123: {
static int16 j = 0,jdir = 2;
@@ -415,7 +413,7 @@
hiPal = 95;
break;
case 100:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(128, 132);
palScroll(133, 137);
palScroll(138, 143);
@@ -424,14 +422,14 @@
}
break;
case 102:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(112, 127);
loPal = 112;
hiPal = 127;
}
break;
case 62:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(0x6c, 0x77);
loPal = 0x6c;
hiPal = 0x77;
@@ -443,7 +441,7 @@
hiPal = 123;
break;
case 59:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(56, 63);
loPal = 56;
hiPal = 63;
@@ -459,27 +457,27 @@
palScroll(88, 91);
palScroll(92, 95);
palScroll(128, 135);
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(136, 143);
}
loPal = 28;
hiPal = 143;
break;
case 40:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(96, 103);
}
- if(_pals.customScrollSeed & 3) {
+ if(scrollx & 3) {
palScroll(104, 107);
}
loPal = 96;
hiPal = 107;
break;
case 97:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(96, 107);
}
- if(_pals.customScrollSeed & 3) {
+ if(scrollx & 3) {
palScroll(108, 122);
}
loPal = 96;
@@ -492,7 +490,7 @@
break;
case 57:
palScroll(128, 143);
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(96, 103);
}
loPal = 96;
@@ -504,7 +502,7 @@
hiPal = 95;
break;
case 2:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(120, 127);
}
loPal = 120;
@@ -512,7 +510,7 @@
break;
case 3:
case 5:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(128, 135);
palScroll(136, 143);
loPal = 128;
@@ -520,14 +518,14 @@
}
break;
case 7:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(119, 127);
loPal = 119;
hiPal = 127;
}
break;
case 42:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(118, 127);
palScroll(136, 143);
loPal = 118;
@@ -535,7 +533,7 @@
}
break;
case 4:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(32,47);
}
palScroll(64, 70);
@@ -544,7 +542,7 @@
hiPal = 79;
break;
case 8:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(120, 127);
}
loPal = 120;
@@ -552,10 +550,10 @@
break;
case 12:
case 64:
- if(_pals.customScrollSeed & 1) {
+ if(scrollx & 1) {
palScroll(112, 119);
}
- if(_pals.customScrollSeed & 3) {
+ if(scrollx & 3) {
palScroll(120, 127);
}
loPal = 112;
@@ -592,7 +590,7 @@
// set flash palette
palSet(tempPal, 0, 255, true);
// restore original palette
- // palSet(_pals.screen, 0, 255, true);
+ palSet(_pals.screen, 0, 255, true);
}
@@ -796,6 +794,7 @@
_gotTick = false;
while (!_gotTick) {
+ // FIXME: use _input->delay() instead
OSystem::Event event;
_system->delay_msecs(10);
Index: xref.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/xref.txt,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- xref.txt 23 Oct 2003 18:46:04 -0000 1.18
+++ xref.txt 24 Oct 2003 08:55:13 -0000 1.19
@@ -16,7 +16,7 @@
=======
ALTER_DEFAULT()
CLEAR_COMMAND() Command::clear
-EXECUTE_ACTION()
+EXECUTE_ACTION() Command::executeCurrentAction
FIND_DEFAULT() Command::findDefault
OPEN_CLOSE_OTHER() Command::openOrCloseAssociatedObject
P1_SET_CONDITIONS() Command::setConditions
@@ -28,21 +28,14 @@
SELECT_NOUN()
SELECT_VERB()
-
-ACTION,ACTION2
+ACTION,ACTION2 Command::_action*
CLEVEL Command::_commandLevel
-COM *EXECUTE_ACTION local*
COMMANDstr Command::_command
-COMMAX *EXECUTE_ACTION local*
-COND *EXECUTE_ACTION local*
-CURRCOM *EXECUTE_ACTION local*
DEFCOMM
-GSET *P1_SET_CONDITIONS local*
OLDVERB,VERB
OLDNOUN,NOUN,NOUN2
PARSE Command::_parse
SUBJ1,SUBJ2,SUBJECT Command::_subject*
-A2 *EXECUTE_ACTION local*
-TEMPI *P1_SET_CONDITIONS local*
TEMPstr
WORDstr
@@ -134,16 +127,10 @@
stringanim() Graphics::bobAnimString
-
bobs Graphics::_bobs
-BDxres Display::_bdWidth
-BDyres display::_bdHeight
cambob Graphics::_cameraBob
clothespal Display::PAL_JOE_CLOTHES
dresspal Display::PAL_JOE_DRESS
-font TextRenderer::FONT
-font_sizes TextRenderer::charWidth
-OUTLINE *not needed*
sortedbobs Graphics::_sortedBobs
-scrollx Display::_horizontalScroll
INPUT
@@ -183,11 +170,11 @@
USE_UNDERWEAR() Logic::joeUseUnderwear
USE_CLOTHES() Logic::joeUseClothes
USE_DRESS() Logic::joeUseDress
-WALK() Logic::joeWalk
+WALK() Logic::joeWalkTo
-
JOE_RESPstr Logic::_joeResponse
JOEF,JX,JY,JDIR Logic::_joe.*
-JOEWALK Logic::_joe.walk // legal values = 0,1,2,3
+JOEWALK Logic::_joe.walk (legal values = 0,1,2,3)
JOURNAL
@@ -214,7 +201,7 @@
LOOK_ITEM()
LOOK_ROOM()
P3_COPY_FROM() Cutaway::objectCopy
-R_MAP() // handle map 'm1'
+R_MAP() (handle map 'm1')
REDISP_OBJECT() Logic::roomRefreshObject
restart_game()
SETUP_BOBS() Graphics::bobSetupControl
@@ -249,7 +236,6 @@
FMAXA Logic::_numFurnitureAnimated
FMAXLEN Logic::_numFurnitureAnimatedLen
FRAMES Logic::_numFrames
-FTOT *queen.c/SETUP_FURNITURE local var*
FURN_DATA_MAX Logic::_numFurniture
GAMESTATE Logic::_gameState
GRAPHIC_ANIM_MAX Logic::_numGraphicAnim
@@ -266,7 +252,6 @@
OBJECT_DESCRstr Logic::_objDescription
OBJECT_NAMEstr Logic::_objName
OBJMAX Logic::_objMax
-OBJMAXv *== Logic::_objMax[Logic::_currentRoom]*
OBJTOT Logic::_numObjects
OLDROOM,ROOM,NEW_ROOM Logic::_*oom
ROOMTOT Logic::_numRooms
@@ -323,11 +308,16 @@
putcharacter() TextRenderer::drawChar
setpal() Display::palSet
-
+BDxres Display::_bdWidth
+BDyres Display::_bdHeight
COMPANEL
+font TextRenderer::FONT
+font_sizes TextRenderer::charWidth
FULLSCREEN Graphics::_fullscreen
nopalscroll Display::_pals.scrollable
palette Graphics::_paletteRoom
panelflag Graphics::_panelFlag
+scrollx Display::_horizontalScroll
tpal Graphics::_paletteScreen
@@ -351,8 +341,6 @@
ALTER_STATE() State::alterState*
FIND_STATE() State::findState*
-
-Gstr *no needed* // grab state
-Pstr *no needed* // FIND_STATE result
TALK
@@ -413,13 +401,9 @@
-
AREALIST Walk::_areaList
AREASTRIKE Walk::_areaStrike
-MAPC *findFreeArea local var*
movdata Walk::_moveData
-NEWP,OLDP *locals in joeMove && personMove*
-OLDX,X,OLDY,Y *passed as arguments*
WALK_DATA Walk::_walkData
WALKI Walk::_walkDataCount
-X2,X1,XD,YD *incWalkData && findFreeArea locals*
ZONES
@@ -487,3 +471,19 @@
SX,SY,
NEWA // FIND_FREE_AREA local
IX,IY // Cutaway locals
+COM // EXECUTE_ACTION local
+COMMAX // EXECUTE_ACTION local
+COND // EXECUTE_ACTION local
+CURRCOM // EXECUTE_ACTION local
+GSET // P1_SET_CONDITIONS local
+A2 // EXECUTE_ACTION local
+TEMPI // P1_SET_CONDITIONS local
+MAPC // findFreeArea local var
+NEWP,OLDP // locals in joeMove && personMove
+OLDX,X,OLDY,Y // passed as arguments
+X2,X1,XD,YD // incWalkData && findFreeArea locals
+Gstr // not needed, grab state
+Pstr // not needed, FIND_STATE result
+OUTLINE // not needed, textSet() Graphics::parameter
+FTOT // queen.c/SETUP_FURNITURE local var
+OBJMAXv // == Logic::_objMax[Logic::_currentRoom]
More information about the Scummvm-git-logs
mailing list