mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 12:48:16 +00:00
NEVERHOOD: Slight cleanup to the navigation scene code
This commit is contained in:
parent
04dc01109f
commit
507e8ec8f3
@ -25,6 +25,11 @@
|
||||
|
||||
namespace Neverhood {
|
||||
|
||||
enum AreaType {
|
||||
kAreaCanMoveForward = 0,
|
||||
kAreaCannotMoveForward = 1
|
||||
};
|
||||
|
||||
NavigationScene::NavigationScene(NeverhoodEngine *vm, Module *parentModule, uint32 navigationListId, int navigationIndex, const byte *itemsTypes)
|
||||
: Scene(vm, parentModule), _itemsTypes(itemsTypes), _navigationIndex(navigationIndex), _smackerDone(false),
|
||||
_isWalkingForward(false), _isTurning(false), _smackerFileHash(0), _interactive(true), _leaveSceneAfter(false) {
|
||||
@ -49,7 +54,6 @@ NavigationScene::NavigationScene(NeverhoodEngine *vm, Module *parentModule, uint
|
||||
_vm->_screen->setSmackerDecoder(_smackerPlayer->getSmackerDecoder());
|
||||
|
||||
sendMessage(_parentModule, 0x100A, _navigationIndex);
|
||||
|
||||
}
|
||||
|
||||
NavigationScene::~NavigationScene() {
|
||||
@ -121,34 +125,29 @@ uint32 NavigationScene::handleMessage(int messageNum, const MessageParam ¶m,
|
||||
}
|
||||
|
||||
void NavigationScene::createMouseCursor() {
|
||||
|
||||
const NavigationItem &navigationItem = (*_navigationList)[_navigationIndex];
|
||||
uint32 mouseCursorFileHash;
|
||||
int areaType;
|
||||
|
||||
if (_mouseCursor) {
|
||||
if (_mouseCursor)
|
||||
deleteSprite((Sprite**)&_mouseCursor);
|
||||
}
|
||||
|
||||
mouseCursorFileHash = navigationItem.mouseCursorFileHash;
|
||||
if (mouseCursorFileHash == 0)
|
||||
mouseCursorFileHash = 0x63A40028;
|
||||
|
||||
if (_itemsTypes) {
|
||||
if (_itemsTypes)
|
||||
areaType = _itemsTypes[_navigationIndex];
|
||||
} else if (navigationItem.middleSmackerFileHash != 0 || navigationItem.middleFlag) {
|
||||
areaType = 0;
|
||||
} else {
|
||||
areaType = 1;
|
||||
}
|
||||
else if (navigationItem.middleSmackerFileHash != 0 || navigationItem.middleFlag)
|
||||
areaType = kAreaCanMoveForward;
|
||||
else
|
||||
areaType = kAreaCannotMoveForward;
|
||||
|
||||
insertNavigationMouse(mouseCursorFileHash, areaType);
|
||||
sendPointMessage(_mouseCursor, 0x4002, _vm->getMousePos());
|
||||
|
||||
}
|
||||
|
||||
void NavigationScene::handleNavigation(const NPoint &mousePos) {
|
||||
|
||||
const NavigationItem &navigationItem = (*_navigationList)[_navigationIndex];
|
||||
bool oldIsWalkingForward = _isWalkingForward;
|
||||
bool oldIsTurning = _isTurning;
|
||||
@ -210,7 +209,6 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) {
|
||||
|
||||
if (oldIsWalkingForward != _isWalkingForward)
|
||||
_vm->_soundMan->setTwoSoundsPlayFlag(_isWalkingForward);
|
||||
|
||||
}
|
||||
|
||||
} // End of namespace Neverhood
|
||||
|
Loading…
x
Reference in New Issue
Block a user