[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,1.73,1.74 saveload.cpp,1.24,1.25 script_v1.cpp,1.38,1.39 script_v2.cpp,1.56,1.57 scumm.h,1.70,1.71 scummvm.cpp,1.88,1.89
Max Horn
fingolfin at users.sourceforge.net
Wed Dec 4 14:32:09 CET 2002
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv4154/scumm
Modified Files:
gfx.cpp saveload.cpp script_v1.cpp script_v2.cpp scumm.h
scummvm.cpp
Log Message:
even more cleanup
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- gfx.cpp 4 Dec 2002 21:45:42 -0000 1.73
+++ gfx.cpp 4 Dec 2002 22:31:10 -0000 1.74
@@ -2734,8 +2734,8 @@
void Scumm::setCursorHotspot2(int x, int y)
{
- _cursorHotspotX = x;
- _cursorHotspotY = y;
+ _cursor.hotspotX = x;
+ _cursor.hotspotY = y;
}
byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem)
@@ -2902,9 +2902,9 @@
if (size > sizeof(_grabbedCursor))
error("grabCursor: grabbed cursor too big");
- _cursorWidth = width;
- _cursorHeight = height;
- _cursorAnimate = 0;
+ _cursor.width = width;
+ _cursor.height = height;
+ _cursor.animate = 0;
dst = _grabbedCursor;
for (; height; height--) {
@@ -2938,17 +2938,17 @@
void Scumm::updateCursor()
{
- _system->set_mouse_cursor(_grabbedCursor, _cursorWidth, _cursorHeight,
- _cursorHotspotX, _cursorHotspotY);
+ _system->set_mouse_cursor(_grabbedCursor, _cursor.width, _cursor.height,
+ _cursor.hotspotX, _cursor.hotspotY);
}
void Scumm::animateCursor()
{
- if (_cursorAnimate) {
- if (!(_cursorAnimateIndex & 0x3)) {
- decompressDefaultCursor((_cursorAnimateIndex >> 2) & 3);
+ if (_cursor.animate) {
+ if (!(_cursor.animateIndex & 0x3)) {
+ decompressDefaultCursor((_cursor.animateIndex >> 2) & 3);
}
- _cursorAnimateIndex++;
+ _cursor.animateIndex++;
}
}
@@ -2964,9 +2964,9 @@
if (size > sizeof(_grabbedCursor))
error("useBompCursor: cursor too big");
- _cursorWidth = width;
- _cursorHeight = height;
- _cursorAnimate = 0;
+ _cursor.width = width;
+ _cursor.height = height;
+ _cursor.animate = 0;
decompressBomp(_grabbedCursor, im + 10, width, height);
@@ -3010,10 +3010,10 @@
if (_gameId == GID_LOOM256) {
int w;
- _cursorWidth = 8;
- _cursorHeight = 8;
- _cursorHotspotX = 0;
- _cursorHotspotY = 0;
+ _cursor.width = 8;
+ _cursor.height = 8;
+ _cursor.hotspotX = 0;
+ _cursor.hotspotY = 0;
for (i = 0, w = 0; i < 8; i++) {
w += (i >= 6) ? -2 : 1;
@@ -3021,10 +3021,10 @@
_grabbedCursor[i * 8 + j] = color;
}
} else {
- _cursorWidth = 16;
- _cursorHeight = 16;
- _cursorHotspotX = default_cursor_hotspots[2 * _currentCursor];
- _cursorHotspotY = default_cursor_hotspots[2 * _currentCursor + 1];
+ _cursor.width = 16;
+ _cursor.height = 16;
+ _cursor.hotspotX = default_cursor_hotspots[2 * _currentCursor];
+ _cursor.hotspotY = default_cursor_hotspots[2 * _currentCursor + 1];
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
@@ -3041,7 +3041,7 @@
{
int i, size;
- size = _cursorWidth * _cursorHeight;
+ size = _cursor.width * _cursor.height;
for (i = 0; i < size; i++)
if (_grabbedCursor[i] == (byte)a)
Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- saveload.cpp 4 Dec 2002 13:36:27 -0000 1.24
+++ saveload.cpp 4 Dec 2002 22:31:26 -0000 1.25
@@ -396,7 +396,7 @@
/* nest */
MKLINE(Scumm, _numNestedScripts, sleByte),
MKLINE(Scumm, _userPut, sleByte),
- MKLINE(Scumm, _cursorState, sleByte),
+ MKLINE(Scumm, _cursor.state, sleByte),
MKLINE(Scumm, gdi._cursorActive, sleByte),
MKLINE(Scumm, _currentCursor, sleByte),
@@ -444,10 +444,10 @@
MKLINE(Scumm, _screenB, sleUint16),
MKLINE(Scumm, _screenH, sleUint16),
- MKLINE(Scumm, _cd_track, sleInt16),
- MKLINE(Scumm, _cd_loops, sleInt16),
- MKLINE(Scumm, _cd_frame, sleInt16),
- MKLINE(Scumm, _cd_end, sleInt16),
+ MKLINE(Scumm, _cd_track, sleInt16), // FIXME - remove next time save format changes
+ MKLINE(Scumm, _cd_loops, sleInt16), // FIXME - remove next time save format changes
+ MKLINE(Scumm, _cd_frame, sleInt16), // FIXME - remove next time save format changes
+ MKLINE(Scumm, _cd_end, sleInt16), // FIXME - remove next time save format changes
MKEND()
};
@@ -511,7 +511,7 @@
/* nest */
MKLINE(Scumm, _numNestedScripts, sleByte),
MKLINE(Scumm, _userPut, sleByte),
- MKLINE(Scumm, _cursorState, sleByte),
+ MKLINE(Scumm, _cursor.state, sleByte),
MKLINE(Scumm, gdi._cursorActive, sleByte),
MKLINE(Scumm, _currentCursor, sleByte),
Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v1.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- script_v1.cpp 4 Dec 2002 13:34:28 -0000 1.38
+++ script_v1.cpp 4 Dec 2002 22:31:28 -0000 1.39
@@ -594,11 +594,11 @@
int16 table[16];
switch ((_opcode = fetchScriptByte()) & 0x1F) {
case 1: /* cursor show */
- _cursorState = 1;
+ _cursor.state = 1;
verbMouseOver(0);
break;
case 2: /* cursor hide */
- _cursorState = 0;
+ _cursor.state = 0;
verbMouseOver(0);
break;
case 3: /* userput on */
@@ -608,11 +608,11 @@
_userPut = 0;
break;
case 5: /* cursor soft on */
- _cursorState++;
+ _cursor.state++;
verbMouseOver(0);
break;
case 6: /* cursor soft off */
- _cursorState--;
+ _cursor.state--;
verbMouseOver(0);
break;
case 7: /* userput soft on */
@@ -647,7 +647,7 @@
break;
}
- _vars[VAR_CURSORSTATE] = _cursorState;
+ _vars[VAR_CURSORSTATE] = _cursor.state;
_vars[VAR_USERPUT] = _userPut;
}
Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- script_v2.cpp 1 Dec 2002 14:57:50 -0000 1.56
+++ script_v2.cpp 4 Dec 2002 22:31:30 -0000 1.57
@@ -814,11 +814,11 @@
switch (fetchScriptByte()) {
case 0x90:
- _cursorState = 1;
+ _cursor.state = 1;
verbMouseOver(0);
break;
case 0x91:
- _cursorState = 0;
+ _cursor.state = 0;
verbMouseOver(0);
break;
case 0x92:
@@ -828,13 +828,13 @@
_userPut = 0;
break;
case 0x94:
- _cursorState++;
- if (_cursorState > 1)
+ _cursor.state++;
+ if (_cursor.state > 1)
error("Cursor state greater than 1 in script");
verbMouseOver(0);
break;
case 0x95:
- _cursorState--;
+ _cursor.state--;
verbMouseOver(0);
break;
case 0x96:
@@ -867,7 +867,7 @@
error("o6_cursorCommand: default case");
}
- _vars[VAR_CURSORSTATE] = _cursorState;
+ _vars[VAR_CURSORSTATE] = _cursor.state;
_vars[VAR_USERPUT] = _userPut;
}
Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- scumm.h 4 Dec 2002 21:45:55 -0000 1.70
+++ scumm.h 4 Dec 2002 22:31:32 -0000 1.71
@@ -314,8 +314,6 @@
/* Init functions, etc */
byte _fastMode;
- /* system call object */
-
/* Scumm main loop */
void mainRun();
@@ -404,8 +402,7 @@
byte _leftBtnPressed, _rightBtnPressed;
int16 _virtual_mouse_x, _virtual_mouse_y, _bootParam;
- uint16 _debugMode, _currentDrive, _soundCardType;
- byte _mousePresent;
+ uint16 _debugMode, _soundCardType;
/* Not sure where this stuff goes */
byte isMaskActiveAt(int l, int t, int r, int b, byte *mem);
@@ -702,9 +699,12 @@
bool _fullRedraw, _BgNeedsRedraw, _shakeEnabled, _verbRedraw;
bool _screenEffectFlag, _completeScreenRedraw;
- int _cursorHotspotX, _cursorHotspotY, _cursorWidth, _cursorHeight;
- byte _cursorAnimate, _cursorAnimateIndex, _grabbedCursor[2048];
- int8 _cursorState;
+ struct {
+ int hotspotX, hotspotY, width, height;
+ byte animate, animateIndex;
+ int8 state;
+ } _cursor;
+ byte _grabbedCursor[2048];
byte _currentCursor;
byte _newEffect, _switchRoomEffect2, _switchRoomEffect;
@@ -769,7 +769,7 @@
void grabCursor(int x, int y, int w, int h);
void grabCursor(byte *ptr, int width, int height);
void makeCursorColorTransparent(int a);
- void setupCursor() { _cursorAnimate = 1; }
+ void setupCursor() { _cursor.animate = 1; }
void decompressDefaultCursor(int index);
void useIm01Cursor(byte *im, int w, int h);
void useBompCursor(byte *im, int w, int h);
@@ -855,8 +855,8 @@
int tempMusic;
bool _silentDigitalImuse;
int _saveSound;
- uint16 _soundParam, _soundParam2, _soundParam3;
- int current_cd_sound, _cd_loops, _cd_frame, _cd_track, _cd_end;
+ int current_cd_sound;
+ int _cd_loops, _cd_frame, _cd_track, _cd_end; // FIXME - these are not used anymore
/* Walkbox / Navigation class */
int _maxBoxVertexHeap, _boxPathVertexHeapIndex, _boxMatrixItem;
@@ -922,8 +922,6 @@
void loadLanguageBundle();
void translateText(byte *text, byte *trans_buff);
byte _transText[256];
-
- bool checkFixedDisk();
#if defined(SCUMM_LITTLE_ENDIAN)
uint32 fileReadDword() { return _fileHandle.readUint32LE(); }
Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- scummvm.cpp 4 Dec 2002 13:36:27 -0000 1.88
+++ scummvm.cpp 4 Dec 2002 22:31:36 -0000 1.89
@@ -87,7 +87,6 @@
_game_name = (char*)detector->_gameFileName.c_str();
_gameId = detector->_gameId;
_features = detector->_features;
- _soundCardType = detector->_soundCardType;
_noSubtitles = detector->_noSubtitles;
_defaultTalkDelay = detector->_talkSpeed;
_use_adlib = detector->_use_adlib;
@@ -312,7 +311,7 @@
_keepText = false;
_currentCursor = 0;
- _cursorState = 0;
+ _cursor.state = 0;
_userPut = 0;
_newEffect = 129;
@@ -354,15 +353,15 @@
void Scumm::initScummVars()
{
if (!(_features & GF_AFTER_V7)) {
- _vars[VAR_CURRENTDRIVE] = _currentDrive;
- _vars[VAR_FIXEDDISK] = checkFixedDisk();
- _vars[VAR_SOUNDCARD] = _soundCardType;
+ _vars[VAR_CURRENTDRIVE] = 0;
+ _vars[VAR_FIXEDDISK] = true;
+ _vars[VAR_SOUNDCARD] = 3;
_vars[VAR_VIDEOMODE] = 0x13;
_vars[VAR_HEAPSPACE] = 1400;
- _vars[VAR_MOUSEPRESENT] = _mousePresent;
- _vars[VAR_SOUNDPARAM] = _soundParam;
- _vars[VAR_SOUNDPARAM2] = _soundParam2;
- _vars[VAR_SOUNDPARAM3] = _soundParam3;
+ _vars[VAR_MOUSEPRESENT] = true; // FIXME - used to be 0, but that seems odd?!?
+ _vars[VAR_SOUNDPARAM] = 0;
+ _vars[VAR_SOUNDPARAM2] = 0;
+ _vars[VAR_SOUNDPARAM3] = 0;
if (_features & GF_AFTER_V6)
_vars[VAR_V6_EMSSPACE] = 10000;
} else {
@@ -548,7 +547,7 @@
clearClickedStatus();
}
- if (_cursorState > 0) {
+ if (_cursor.state > 0) {
verbMouseOver(checkMouseOver(mouse.x, mouse.y));
}
@@ -570,7 +569,7 @@
animateCursor();
/* show or hide mouse */
- _system->show_mouse(_cursorState > 0);
+ _system->show_mouse(_cursor.state > 0);
_vars[VAR_TIMER] = 0;
return _vars[VAR_TIMER_NEXT];
@@ -1199,7 +1198,7 @@
void Scumm::convertKeysToClicks()
{
- if (_lastKeyHit && _cursorState > 0) {
+ if (_lastKeyHit && _cursor.state > 0) {
if (_lastKeyHit == 9) {
_mouseButStat = MBS_RIGHT_CLICK;
} else if (_lastKeyHit == 13) {
@@ -1612,8 +1611,4 @@
} else {
return getStringAddress(21)[color];
}
-}
-
-bool Scumm::checkFixedDisk() {
- return true;
}
More information about the Scummvm-git-logs
mailing list