Skip to content

Commit

Permalink
PRINCE: Throw a rock mini-game - cursor update
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Aug 10, 2014
1 parent 01b243d commit 70a9490
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
19 changes: 9 additions & 10 deletions engines/prince/prince.cpp
Expand Up @@ -516,10 +516,7 @@ void PrinceEngine::changeCursor(uint16 curId) {

const Graphics::Surface *curSurface = nullptr;

uint16 hotspotX = 0;
uint16 hotspotY = 0;

switch(curId) {
switch (curId) {
case 0:
CursorMan.showMouse(false);
_optionsFlag = 0;
Expand All @@ -533,16 +530,18 @@ void PrinceEngine::changeCursor(uint16 curId) {
break;
case 3:
curSurface = _cursor3->getSurface();
hotspotX = curSurface->w >> 1;
hotspotY = curSurface->h >> 1;
Common::Point mousePos = _system->getEventManager()->getMousePos();
mousePos.x = CLIP(mousePos.x, (int16) 315, (int16) 639);
mousePos.y = CLIP(mousePos.y, (int16) 0, (int16) 170);
_system->warpMouse(mousePos.x, mousePos.y);
break;
}

CursorMan.replaceCursorPalette(_roomBmp->getPalette(), 0, 255);
CursorMan.replaceCursor(
curSurface->getBasePtr(0, 0),
curSurface->w, curSurface->h,
hotspotX, hotspotY,
0, 0,
255, false,
&curSurface->format
);
Expand Down Expand Up @@ -2323,7 +2322,7 @@ void PrinceEngine::rightMouseButton() {
if (_flags->getFlagValue(Flags::POWERENABLED)) {
_flags->setFlagValue(Flags::MBFLAG, 2);
}
if (_mouseFlag) {
if (_mouseFlag && _mouseFlag != 3) {
_mainHero->freeOldMove();
_secondHero->freeOldMove();
_interpreter->storeNewPC(0);
Expand Down Expand Up @@ -2950,9 +2949,9 @@ void PrinceEngine::mouseWeirdo() {
mousePos.y -= kCelStep;
break;
}
mousePos.x = CLIP(mousePos.x, (int16) 0, (int16) 639);
mousePos.x = CLIP(mousePos.x, (int16) 315, (int16) 639);
_flags->setFlagValue(Flags::MXFLAG, mousePos.x);
mousePos.y = CLIP(mousePos.y, (int16) 0, (int16) 479);
mousePos.y = CLIP(mousePos.y, (int16) 0, (int16) 170);
_flags->setFlagValue(Flags::MYFLAG, mousePos.y);
_system->warpMouse(mousePos.x, mousePos.y);
}
Expand Down
1 change: 0 additions & 1 deletion engines/prince/script.cpp
Expand Up @@ -1760,7 +1760,6 @@ void Interpreter::O_TALKHEROSTOP() {
debugInterpreter("O_TALKHEROSTOP %d", heroId);
}

// TODO - check this
void Interpreter::O_HEROCOLOR() {
int32 heroId = readScriptFlagValue();
int32 color = readScriptFlagValue();
Expand Down

0 comments on commit 70a9490

Please sign in to comment.