aboutsummaryrefslogtreecommitdiff
path: root/sky
diff options
context:
space:
mode:
authorJoost Peters2003-06-01 12:49:39 +0000
committerJoost Peters2003-06-01 12:49:39 +0000
commit063c310917f981f5075c91097c46963d1fa9a94b (patch)
tree9e6468ffa4de5d4f26fa2093e188e1ff2e902574 /sky
parent5c91b160f68947c77fe73314fc3a740a7c9aa660 (diff)
downloadscummvm-rg350-063c310917f981f5075c91097c46963d1fa9a94b.tar.gz
scummvm-rg350-063c310917f981f5075c91097c46963d1fa9a94b.tar.bz2
scummvm-rg350-063c310917f981f5075c91097c46963d1fa9a94b.zip
added some buggy, incomplete mouse code
svn-id: r8233
Diffstat (limited to 'sky')
-rw-r--r--sky/logic.cpp14
-rw-r--r--sky/mouse.cpp19
-rw-r--r--sky/mouse.h6
-rw-r--r--sky/sky.cpp7
4 files changed, 28 insertions, 18 deletions
diff --git a/sky/logic.cpp b/sky/logic.cpp
index 57cd263064..495caca726 100644
--- a/sky/logic.cpp
+++ b/sky/logic.cpp
@@ -1187,8 +1187,7 @@ bool SkyLogic::fnAssignBase(uint32 id, uint32 scr, uint32 c) {
}
bool SkyLogic::fnDiskMouse(uint32 a, uint32 b, uint32 c) {
- warning("Stub: fnDiskMouse");
- return true;
+ return _skyMouse->fnDiskMouse();
}
bool SkyLogic::fnNormalMouse(uint32 a, uint32 b, uint32 c) {
@@ -1196,7 +1195,7 @@ bool SkyLogic::fnNormalMouse(uint32 a, uint32 b, uint32 c) {
}
bool SkyLogic::fnBlankMouse(uint32 a, uint32 b, uint32 c) {
- return (_skyMouse->fnBlankMouse() != 0);
+ return _skyMouse->fnBlankMouse();
}
bool SkyLogic::fnCrossMouse(uint32 a, uint32 b, uint32 c) {
@@ -2060,12 +2059,11 @@ void SkyLogic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32
if (SkyTalkAnims::animTalkTableIsPointer[offset]) //is it a pointer?
animPtr = (uint16 *)SkyTalkAnims::animTalkTablePtr[offset];
- else { //then it must be a value
+ else //then it must be a value
animPtr = (uint16 *)SkyState::fetchCompact(SkyTalkAnims::animTalkTableVal[offset]);
- target->offset = *animPtr++;
- target->getToFlag = *animPtr++;
- }
-
+
+ target->offset = *animPtr++;
+ target->getToFlag = *animPtr++;
target->grafixProg = animPtr;
if (SkyState::isCDVersion(_gameVersion))
diff --git a/sky/mouse.cpp b/sky/mouse.cpp
index 99ebc98eb3..1cea2251d1 100644
--- a/sky/mouse.cpp
+++ b/sky/mouse.cpp
@@ -77,9 +77,10 @@ uint32 _mouseObjectList[] = {
24829
};
-SkyMouse::SkyMouse(SkyDisk *skyDisk) {
+SkyMouse::SkyMouse(OSystem *system, SkyDisk *skyDisk) {
_skyDisk = skyDisk;
+ _system = system;
_mouseWidth = 6;
_mouseHeight = 6;
_maskWidth = 6;
@@ -113,12 +114,19 @@ void SkyMouse::replaceMouseCursors(uint16 fileNo) {
_skyDisk->loadFile(fileNo, _objectMouseData);
}
-uint32 SkyMouse::fnBlankMouse(void) {
+bool SkyMouse::fnBlankMouse(void) {
_mouseXOff = 0; //re-align mouse
spriteMouse(MOUSE_BLANK, 0, 0);
+ return true;
+}
+
+bool SkyMouse::fnDiskMouse(void) {
- return 1;
+ //turn the mouse into a disk mouse
+ spriteMouse(MOUSE_DISK, 11, 11);
+ return true; //don't quit from the interpreter
+
}
void SkyMouse::lockMouse(void) {
@@ -153,7 +161,7 @@ void SkyMouse::spriteMouse(uint16 frameNum, uint16 mouseX, uint16 mouseY) {
_mouseOffsetX = mouseX;
_mouseOffsetY = mouseY;
- restoreMouseData(frameNum);
+ //restoreMouseData(frameNum);
byte *mouseData = _miceData;
uint32 pos = ((struct dataFileHeader *)mouseData)->s_sp_size * ((struct dataFileHeader *)mouseData)->s_sp_size;
pos += sizeof(struct dataFileHeader);
@@ -162,7 +170,8 @@ void SkyMouse::spriteMouse(uint16 frameNum, uint16 mouseX, uint16 mouseY) {
_mouseWidth = ((struct dataFileHeader *)mouseData)->s_width;
_mouseHeight = ((struct dataFileHeader *)mouseData)->s_height;
- drawNewMouse();
+ _system->set_mouse_cursor(_mouseData2, _mouseWidth, _mouseHeight, mouseX, mouseY);
+ //drawNewMouse();
//_mouseFlag ^= (~_mouseFlag | MF_IN_INT);
}
diff --git a/sky/mouse.h b/sky/mouse.h
index 7b2b91cb1b..98750a94fc 100644
--- a/sky/mouse.h
+++ b/sky/mouse.h
@@ -30,11 +30,12 @@ class SkyMouse {
public:
- SkyMouse(SkyDisk *skyDisk);
+ SkyMouse(OSystem *system, SkyDisk *skyDisk);
~SkyMouse(void);
void replaceMouseCursors(uint16 fileNo);
- uint32 fnBlankMouse(void);
+ bool fnBlankMouse(void);
+ bool fnDiskMouse(void);
void lockMouse(void);
void unlockMouse(void);
void restoreMouseData(uint16 frameNum);
@@ -78,6 +79,7 @@ protected:
static uint32 _mouseObjectList[];
+ OSystem *_system;
SkyDisk *_skyDisk;
};
diff --git a/sky/sky.cpp b/sky/sky.cpp
index 746dfbd0df..bf6c5e5b93 100644
--- a/sky/sky.cpp
+++ b/sky/sky.cpp
@@ -113,7 +113,7 @@ SkyState::~SkyState() {
delete _skyGrid;
delete _skySound;
delete _skyMusic;
- showQuitMsg();
+ showQuitMsg();
delete _skyText;
delete _skyMouse;
delete _skyScreen;
@@ -170,7 +170,7 @@ void SkyState::initialise(void) {
}
_skyText = new SkyText(_skyDisk, _gameVersion, _language);
- _skyMouse = new SkyMouse(_skyDisk);
+ _skyMouse = new SkyMouse(_system, _skyDisk);
_skyScreen = new SkyScreen(_system, _skyDisk);
initVirgin();
@@ -269,7 +269,7 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp
uint32 start = _system->get_msecs();
uint32 cur = start;
_key_pressed = 0; //reset
-
+ _mouse_pos_changed = false;
_rnd.getRandomNumber(2);
do {
@@ -287,6 +287,7 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp
_sdl_mouse_x = event.mouse.x;
_sdl_mouse_y = event.mouse.y;
_mouse_pos_changed = true;
+ _system->set_mouse_pos(_sdl_mouse_x, _sdl_mouse_y);
break;
case OSystem::EVENT_LBUTTONDOWN: