even more cleanup

svn-id: r5839
This commit is contained in:
Max Horn 2002-12-04 22:31:36 +00:00
parent 45534e7698
commit df594d41ff
8 changed files with 61 additions and 71 deletions

View file

@ -22,7 +22,6 @@
#include "stdafx.h" #include "stdafx.h"
//#include "scumm/scumm.h"
#include "sound/mididrv.h" #include "sound/mididrv.h"
#include "scumm/imuse.h" #include "scumm/imuse.h"
#include "common/engine.h" #include "common/engine.h"
@ -90,7 +89,6 @@ GameDetector::GameDetector()
_debugMode = 0; _debugMode = 0;
_noSubtitles = false; _noSubtitles = false;
_bootParam = 0; _bootParam = 0;
_soundCardType = 3;
_gameDataPath = 0; _gameDataPath = 0;
_gameTempo = 0; _gameTempo = 0;

View file

@ -121,7 +121,6 @@ public:
uint16 _debugMode; uint16 _debugMode;
bool _noSubtitles; bool _noSubtitles;
uint16 _bootParam; uint16 _bootParam;
uint16 _soundCardType;
char *_gameDataPath; char *_gameDataPath;
int _gameTempo; int _gameTempo;

View file

@ -2734,8 +2734,8 @@ void Scumm::setPalColor(int idx, int r, int g, int b)
void Scumm::setCursorHotspot2(int x, int y) void Scumm::setCursorHotspot2(int x, int y)
{ {
_cursorHotspotX = x; _cursor.hotspotX = x;
_cursorHotspotY = y; _cursor.hotspotY = y;
} }
byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem) byte Scumm::isMaskActiveAt(int l, int t, int r, int b, byte *mem)
@ -2902,9 +2902,9 @@ void Scumm::grabCursor(byte *ptr, int width, int height)
if (size > sizeof(_grabbedCursor)) if (size > sizeof(_grabbedCursor))
error("grabCursor: grabbed cursor too big"); error("grabCursor: grabbed cursor too big");
_cursorWidth = width; _cursor.width = width;
_cursorHeight = height; _cursor.height = height;
_cursorAnimate = 0; _cursor.animate = 0;
dst = _grabbedCursor; dst = _grabbedCursor;
for (; height; height--) { for (; height; height--) {
@ -2938,17 +2938,17 @@ void Scumm::useIm01Cursor(byte *im, int w, int h)
void Scumm::updateCursor() void Scumm::updateCursor()
{ {
_system->set_mouse_cursor(_grabbedCursor, _cursorWidth, _cursorHeight, _system->set_mouse_cursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursorHotspotX, _cursorHotspotY); _cursor.hotspotX, _cursor.hotspotY);
} }
void Scumm::animateCursor() void Scumm::animateCursor()
{ {
if (_cursorAnimate) { if (_cursor.animate) {
if (!(_cursorAnimateIndex & 0x3)) { if (!(_cursor.animateIndex & 0x3)) {
decompressDefaultCursor((_cursorAnimateIndex >> 2) & 3); decompressDefaultCursor((_cursor.animateIndex >> 2) & 3);
} }
_cursorAnimateIndex++; _cursor.animateIndex++;
} }
} }
@ -2964,9 +2964,9 @@ void Scumm::useBompCursor(byte *im, int width, int height)
if (size > sizeof(_grabbedCursor)) if (size > sizeof(_grabbedCursor))
error("useBompCursor: cursor too big"); error("useBompCursor: cursor too big");
_cursorWidth = width; _cursor.width = width;
_cursorHeight = height; _cursor.height = height;
_cursorAnimate = 0; _cursor.animate = 0;
decompressBomp(_grabbedCursor, im + 10, width, height); decompressBomp(_grabbedCursor, im + 10, width, height);
@ -3010,10 +3010,10 @@ void Scumm::decompressDefaultCursor(int idx)
if (_gameId == GID_LOOM256) { if (_gameId == GID_LOOM256) {
int w; int w;
_cursorWidth = 8; _cursor.width = 8;
_cursorHeight = 8; _cursor.height = 8;
_cursorHotspotX = 0; _cursor.hotspotX = 0;
_cursorHotspotY = 0; _cursor.hotspotY = 0;
for (i = 0, w = 0; i < 8; i++) { for (i = 0, w = 0; i < 8; i++) {
w += (i >= 6) ? -2 : 1; w += (i >= 6) ? -2 : 1;
@ -3021,10 +3021,10 @@ void Scumm::decompressDefaultCursor(int idx)
_grabbedCursor[i * 8 + j] = color; _grabbedCursor[i * 8 + j] = color;
} }
} else { } else {
_cursorWidth = 16; _cursor.width = 16;
_cursorHeight = 16; _cursor.height = 16;
_cursorHotspotX = default_cursor_hotspots[2 * _currentCursor]; _cursor.hotspotX = default_cursor_hotspots[2 * _currentCursor];
_cursorHotspotY = default_cursor_hotspots[2 * _currentCursor + 1]; _cursor.hotspotY = default_cursor_hotspots[2 * _currentCursor + 1];
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) { for (j = 0; j < 16; j++) {
@ -3041,7 +3041,7 @@ void Scumm::makeCursorColorTransparent(int a)
{ {
int i, size; int i, size;
size = _cursorWidth * _cursorHeight; size = _cursor.width * _cursor.height;
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
if (_grabbedCursor[i] == (byte)a) if (_grabbedCursor[i] == (byte)a)

View file

@ -396,7 +396,7 @@ void Scumm::saveOrLoad(Serializer *s)
/* nest */ /* nest */
MKLINE(Scumm, _numNestedScripts, sleByte), MKLINE(Scumm, _numNestedScripts, sleByte),
MKLINE(Scumm, _userPut, sleByte), MKLINE(Scumm, _userPut, sleByte),
MKLINE(Scumm, _cursorState, sleByte), MKLINE(Scumm, _cursor.state, sleByte),
MKLINE(Scumm, gdi._cursorActive, sleByte), MKLINE(Scumm, gdi._cursorActive, sleByte),
MKLINE(Scumm, _currentCursor, sleByte), MKLINE(Scumm, _currentCursor, sleByte),
@ -444,10 +444,10 @@ void Scumm::saveOrLoad(Serializer *s)
MKLINE(Scumm, _screenB, sleUint16), MKLINE(Scumm, _screenB, sleUint16),
MKLINE(Scumm, _screenH, sleUint16), MKLINE(Scumm, _screenH, sleUint16),
MKLINE(Scumm, _cd_track, sleInt16), MKLINE(Scumm, _cd_track, sleInt16), // FIXME - remove next time save format changes
MKLINE(Scumm, _cd_loops, sleInt16), MKLINE(Scumm, _cd_loops, sleInt16), // FIXME - remove next time save format changes
MKLINE(Scumm, _cd_frame, sleInt16), MKLINE(Scumm, _cd_frame, sleInt16), // FIXME - remove next time save format changes
MKLINE(Scumm, _cd_end, sleInt16), MKLINE(Scumm, _cd_end, sleInt16), // FIXME - remove next time save format changes
MKEND() MKEND()
}; };
@ -511,7 +511,7 @@ void Scumm::saveOrLoad(Serializer *s)
/* nest */ /* nest */
MKLINE(Scumm, _numNestedScripts, sleByte), MKLINE(Scumm, _numNestedScripts, sleByte),
MKLINE(Scumm, _userPut, sleByte), MKLINE(Scumm, _userPut, sleByte),
MKLINE(Scumm, _cursorState, sleByte), MKLINE(Scumm, _cursor.state, sleByte),
MKLINE(Scumm, gdi._cursorActive, sleByte), MKLINE(Scumm, gdi._cursorActive, sleByte),
MKLINE(Scumm, _currentCursor, sleByte), MKLINE(Scumm, _currentCursor, sleByte),

View file

@ -594,11 +594,11 @@ void Scumm::o5_cursorCommand()
int16 table[16]; int16 table[16];
switch ((_opcode = fetchScriptByte()) & 0x1F) { switch ((_opcode = fetchScriptByte()) & 0x1F) {
case 1: /* cursor show */ case 1: /* cursor show */
_cursorState = 1; _cursor.state = 1;
verbMouseOver(0); verbMouseOver(0);
break; break;
case 2: /* cursor hide */ case 2: /* cursor hide */
_cursorState = 0; _cursor.state = 0;
verbMouseOver(0); verbMouseOver(0);
break; break;
case 3: /* userput on */ case 3: /* userput on */
@ -608,11 +608,11 @@ void Scumm::o5_cursorCommand()
_userPut = 0; _userPut = 0;
break; break;
case 5: /* cursor soft on */ case 5: /* cursor soft on */
_cursorState++; _cursor.state++;
verbMouseOver(0); verbMouseOver(0);
break; break;
case 6: /* cursor soft off */ case 6: /* cursor soft off */
_cursorState--; _cursor.state--;
verbMouseOver(0); verbMouseOver(0);
break; break;
case 7: /* userput soft on */ case 7: /* userput soft on */
@ -647,7 +647,7 @@ void Scumm::o5_cursorCommand()
break; break;
} }
_vars[VAR_CURSORSTATE] = _cursorState; _vars[VAR_CURSORSTATE] = _cursor.state;
_vars[VAR_USERPUT] = _userPut; _vars[VAR_USERPUT] = _userPut;
} }

View file

@ -814,11 +814,11 @@ void Scumm::o6_cursorCommand()
switch (fetchScriptByte()) { switch (fetchScriptByte()) {
case 0x90: case 0x90:
_cursorState = 1; _cursor.state = 1;
verbMouseOver(0); verbMouseOver(0);
break; break;
case 0x91: case 0x91:
_cursorState = 0; _cursor.state = 0;
verbMouseOver(0); verbMouseOver(0);
break; break;
case 0x92: case 0x92:
@ -828,13 +828,13 @@ void Scumm::o6_cursorCommand()
_userPut = 0; _userPut = 0;
break; break;
case 0x94: case 0x94:
_cursorState++; _cursor.state++;
if (_cursorState > 1) if (_cursor.state > 1)
error("Cursor state greater than 1 in script"); error("Cursor state greater than 1 in script");
verbMouseOver(0); verbMouseOver(0);
break; break;
case 0x95: case 0x95:
_cursorState--; _cursor.state--;
verbMouseOver(0); verbMouseOver(0);
break; break;
case 0x96: case 0x96:
@ -867,7 +867,7 @@ void Scumm::o6_cursorCommand()
error("o6_cursorCommand: default case"); error("o6_cursorCommand: default case");
} }
_vars[VAR_CURSORSTATE] = _cursorState; _vars[VAR_CURSORSTATE] = _cursor.state;
_vars[VAR_USERPUT] = _userPut; _vars[VAR_USERPUT] = _userPut;
} }

View file

@ -314,8 +314,6 @@ public:
/* Init functions, etc */ /* Init functions, etc */
byte _fastMode; byte _fastMode;
/* system call object */
/* Scumm main loop */ /* Scumm main loop */
void mainRun(); void mainRun();
@ -404,8 +402,7 @@ public:
byte _leftBtnPressed, _rightBtnPressed; byte _leftBtnPressed, _rightBtnPressed;
int16 _virtual_mouse_x, _virtual_mouse_y, _bootParam; int16 _virtual_mouse_x, _virtual_mouse_y, _bootParam;
uint16 _debugMode, _currentDrive, _soundCardType; uint16 _debugMode, _soundCardType;
byte _mousePresent;
/* Not sure where this stuff goes */ /* Not sure where this stuff goes */
byte isMaskActiveAt(int l, int t, int r, int b, byte *mem); byte isMaskActiveAt(int l, int t, int r, int b, byte *mem);
@ -702,9 +699,12 @@ public:
bool _fullRedraw, _BgNeedsRedraw, _shakeEnabled, _verbRedraw; bool _fullRedraw, _BgNeedsRedraw, _shakeEnabled, _verbRedraw;
bool _screenEffectFlag, _completeScreenRedraw; bool _screenEffectFlag, _completeScreenRedraw;
int _cursorHotspotX, _cursorHotspotY, _cursorWidth, _cursorHeight; struct {
byte _cursorAnimate, _cursorAnimateIndex, _grabbedCursor[2048]; int hotspotX, hotspotY, width, height;
int8 _cursorState; byte animate, animateIndex;
int8 state;
} _cursor;
byte _grabbedCursor[2048];
byte _currentCursor; byte _currentCursor;
byte _newEffect, _switchRoomEffect2, _switchRoomEffect; byte _newEffect, _switchRoomEffect2, _switchRoomEffect;
@ -769,7 +769,7 @@ public:
void grabCursor(int x, int y, int w, int h); void grabCursor(int x, int y, int w, int h);
void grabCursor(byte *ptr, int width, int height); void grabCursor(byte *ptr, int width, int height);
void makeCursorColorTransparent(int a); void makeCursorColorTransparent(int a);
void setupCursor() { _cursorAnimate = 1; } void setupCursor() { _cursor.animate = 1; }
void decompressDefaultCursor(int index); void decompressDefaultCursor(int index);
void useIm01Cursor(byte *im, int w, int h); void useIm01Cursor(byte *im, int w, int h);
void useBompCursor(byte *im, int w, int h); void useBompCursor(byte *im, int w, int h);
@ -855,8 +855,8 @@ public:
int tempMusic; int tempMusic;
bool _silentDigitalImuse; bool _silentDigitalImuse;
int _saveSound; int _saveSound;
uint16 _soundParam, _soundParam2, _soundParam3; int current_cd_sound;
int current_cd_sound, _cd_loops, _cd_frame, _cd_track, _cd_end; int _cd_loops, _cd_frame, _cd_track, _cd_end; // FIXME - these are not used anymore
/* Walkbox / Navigation class */ /* Walkbox / Navigation class */
int _maxBoxVertexHeap, _boxPathVertexHeapIndex, _boxMatrixItem; int _maxBoxVertexHeap, _boxPathVertexHeapIndex, _boxMatrixItem;
@ -923,8 +923,6 @@ public:
void translateText(byte *text, byte *trans_buff); void translateText(byte *text, byte *trans_buff);
byte _transText[256]; byte _transText[256];
bool checkFixedDisk();
#if defined(SCUMM_LITTLE_ENDIAN) #if defined(SCUMM_LITTLE_ENDIAN)
uint32 fileReadDword() { return _fileHandle.readUint32LE(); } uint32 fileReadDword() { return _fileHandle.readUint32LE(); }
#elif defined(SCUMM_BIG_ENDIAN) #elif defined(SCUMM_BIG_ENDIAN)

View file

@ -87,7 +87,6 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
_game_name = (char*)detector->_gameFileName.c_str(); _game_name = (char*)detector->_gameFileName.c_str();
_gameId = detector->_gameId; _gameId = detector->_gameId;
_features = detector->_features; _features = detector->_features;
_soundCardType = detector->_soundCardType;
_noSubtitles = detector->_noSubtitles; _noSubtitles = detector->_noSubtitles;
_defaultTalkDelay = detector->_talkSpeed; _defaultTalkDelay = detector->_talkSpeed;
_use_adlib = detector->_use_adlib; _use_adlib = detector->_use_adlib;
@ -312,7 +311,7 @@ void Scumm::scummInit()
_keepText = false; _keepText = false;
_currentCursor = 0; _currentCursor = 0;
_cursorState = 0; _cursor.state = 0;
_userPut = 0; _userPut = 0;
_newEffect = 129; _newEffect = 129;
@ -354,15 +353,15 @@ void Scumm::scummInit()
void Scumm::initScummVars() void Scumm::initScummVars()
{ {
if (!(_features & GF_AFTER_V7)) { if (!(_features & GF_AFTER_V7)) {
_vars[VAR_CURRENTDRIVE] = _currentDrive; _vars[VAR_CURRENTDRIVE] = 0;
_vars[VAR_FIXEDDISK] = checkFixedDisk(); _vars[VAR_FIXEDDISK] = true;
_vars[VAR_SOUNDCARD] = _soundCardType; _vars[VAR_SOUNDCARD] = 3;
_vars[VAR_VIDEOMODE] = 0x13; _vars[VAR_VIDEOMODE] = 0x13;
_vars[VAR_HEAPSPACE] = 1400; _vars[VAR_HEAPSPACE] = 1400;
_vars[VAR_MOUSEPRESENT] = _mousePresent; _vars[VAR_MOUSEPRESENT] = true; // FIXME - used to be 0, but that seems odd?!?
_vars[VAR_SOUNDPARAM] = _soundParam; _vars[VAR_SOUNDPARAM] = 0;
_vars[VAR_SOUNDPARAM2] = _soundParam2; _vars[VAR_SOUNDPARAM2] = 0;
_vars[VAR_SOUNDPARAM3] = _soundParam3; _vars[VAR_SOUNDPARAM3] = 0;
if (_features & GF_AFTER_V6) if (_features & GF_AFTER_V6)
_vars[VAR_V6_EMSSPACE] = 10000; _vars[VAR_V6_EMSSPACE] = 10000;
} else { } else {
@ -548,7 +547,7 @@ int Scumm::scummLoop(int delta)
clearClickedStatus(); clearClickedStatus();
} }
if (_cursorState > 0) { if (_cursor.state > 0) {
verbMouseOver(checkMouseOver(mouse.x, mouse.y)); verbMouseOver(checkMouseOver(mouse.x, mouse.y));
} }
@ -570,7 +569,7 @@ int Scumm::scummLoop(int delta)
animateCursor(); animateCursor();
/* show or hide mouse */ /* show or hide mouse */
_system->show_mouse(_cursorState > 0); _system->show_mouse(_cursor.state > 0);
_vars[VAR_TIMER] = 0; _vars[VAR_TIMER] = 0;
return _vars[VAR_TIMER_NEXT]; return _vars[VAR_TIMER_NEXT];
@ -1199,7 +1198,7 @@ int Scumm::getKeyInput(int a)
void Scumm::convertKeysToClicks() void Scumm::convertKeysToClicks()
{ {
if (_lastKeyHit && _cursorState > 0) { if (_lastKeyHit && _cursor.state > 0) {
if (_lastKeyHit == 9) { if (_lastKeyHit == 9) {
_mouseButStat = MBS_RIGHT_CLICK; _mouseButStat = MBS_RIGHT_CLICK;
} else if (_lastKeyHit == 13) { } else if (_lastKeyHit == 13) {
@ -1613,7 +1612,3 @@ byte Scumm::getDefaultGUIColor(int color)
return getStringAddress(21)[color]; return getStringAddress(21)[color];
} }
} }
bool Scumm::checkFixedDisk() {
return true;
}