[Scummvm-git-logs] scummvm master -> 02ffcacacf1cb56c5c770c0302c252186a6189ab
dreammaster
dreammaster at scummvm.org
Fri Nov 24 01:20:31 CET 2017
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
07fe6504a3 XEEN: Added constant for character highlighting code
02ffcacacf XEEN: Fix strafing left & right with Control key held
Commit: 07fe6504a3cd3c969b10ec57ac3b0bdc2ba56de8
https://github.com/scummvm/scummvm/commit/07fe6504a3cd3c969b10ec57ac3b0bdc2ba56de8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-11-23T19:07:26-05:00
Commit Message:
XEEN: Added constant for character highlighting code
Changed paths:
engines/xeen/interface.cpp
engines/xeen/interface.h
engines/xeen/town.cpp
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 959252d..d3face1 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -43,7 +43,7 @@ PartyDrawer::PartyDrawer(XeenEngine *vm): _vm(vm) {
_restoreSprites.load("restorex.icn");
_hpSprites.load("hpbars.icn");
_dseFace.load("dse.fac");
- _hiliteChar = -1;
+ _hiliteChar = HILIGHT_CHAR_NONE;
}
void PartyDrawer::drawParty(bool updateFlag) {
@@ -88,7 +88,7 @@ void PartyDrawer::drawParty(bool updateFlag) {
_hpSprites.draw(screen, frame, Common::Point(Res.HP_BARS_X[idx], 182));
}
- if (_hiliteChar != -1)
+ if (_hiliteChar != HILIGHT_CHAR_NONE)
res._globalSprites.draw(screen, 8, Common::Point(Res.CHAR_FACES_X[_hiliteChar] - 1, 149));
if (updateFlag)
@@ -101,7 +101,7 @@ void PartyDrawer::highlightChar(int charId) {
if (charId != _hiliteChar && _hiliteChar != HILIGHT_CHAR_DISABLED) {
// Handle deselecting any previusly selected char
- if (_hiliteChar != -1) {
+ if (_hiliteChar != HILIGHT_CHAR_NONE) {
res._globalSprites.draw(screen, 9 + _hiliteChar,
Common::Point(Res.CHAR_FACES_X[_hiliteChar] - 1, 149));
}
@@ -117,16 +117,16 @@ void PartyDrawer::unhighlightChar() {
Resources &res = *_vm->_resources;
Screen &screen = *_vm->_screen;
- if (_hiliteChar != -1) {
+ if (_hiliteChar != HILIGHT_CHAR_NONE) {
res._globalSprites.draw(screen, _hiliteChar + 9,
Common::Point(Res.CHAR_FACES_X[_hiliteChar] - 1, 149));
- _hiliteChar = -1;
+ _hiliteChar = HILIGHT_CHAR_NONE;
screen._windows[33].update();
}
}
void PartyDrawer::resetHighlight() {
- _hiliteChar = -1;
+ _hiliteChar = HILIGHT_CHAR_NONE;
}
/*------------------------------------------------------------------------*/
diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h
index 074d7fd..ce887d2 100644
--- a/engines/xeen/interface.h
+++ b/engines/xeen/interface.h
@@ -35,6 +35,7 @@ class XeenEngine;
#define MINIMAP_SIZE 7
#define HILIGHT_CHAR_DISABLED -2
+#define HILIGHT_CHAR_NONE -1
/**
* Class responsible for drawing the images of the characters in the party
diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp
index 0f6726c..ac1fc1e 100644
--- a/engines/xeen/town.cpp
+++ b/engines/xeen/town.cpp
@@ -258,14 +258,14 @@ int Town::townAction(TownAction actionId) {
}
break;
- case TAVERN: {
+ case TAVERN:
// Leave Tavern
sound.stopSound();
sound.playSound(isDarkCc ? "gdluck1.voc" : "goodbye.voc", 1);
map.mazeData()._mazeNumber = party._mazeId;
break;
- }
+
default:
break;
}
Commit: 02ffcacacf1cb56c5c770c0302c252186a6189ab
https://github.com/scummvm/scummvm/commit/02ffcacacf1cb56c5c770c0302c252186a6189ab
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-11-23T19:20:22-05:00
Commit Message:
XEEN: Fix strafing left & right with Control key held
Changed paths:
engines/xeen/dialogs.cpp
engines/xeen/events.cpp
engines/xeen/events.h
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index 92082b4..a88efd2 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -94,7 +94,7 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) {
else if (_buttonValue == Common::KEYCODE_KP_ENTER)
_buttonValue = Common::KEYCODE_RETURN;
- _buttonValue |= (keyState.flags << 8);
+ _buttonValue |= keyState.flags << 16;
if (_buttonValue)
return true;
}
diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp
index 55ff244..9299eee 100644
--- a/engines/xeen/events.cpp
+++ b/engines/xeen/events.cpp
@@ -33,9 +33,9 @@ namespace Xeen {
EventsManager::EventsManager(XeenEngine *vm) : _vm(vm),
_frameCounter(0), _priorFrameCounterTime(0), _gameCounter(0),
- _leftButton(false), _rightButton(false), _sprites("mouse.icn"),
- _keyCode(Common::KEYCODE_INVALID) {
+ _leftButton(false), _rightButton(false), _sprites("mouse.icn") {
Common::fill(&_gameCounters[0], &_gameCounters[6], 0);
+ _key.keycode = Common::KEYCODE_INVALID;
}
EventsManager::~EventsManager() {
@@ -81,7 +81,7 @@ void EventsManager::pollEvents() {
_vm->_debugger->attach();
_vm->_debugger->onFrame();
} else {
- _keyCode = event.kbd.keycode;
+ _key = event.kbd;
}
break;
case Common::EVENT_MOUSEMOVE:
@@ -111,7 +111,7 @@ void EventsManager::pollEventsAndWait() {
}
void EventsManager::clearEvents() {
- _keyCode = Common::KEYCODE_INVALID;
+ _key.keycode = Common::KEYCODE_INVALID;
_leftButton = _rightButton = false;
}
@@ -122,17 +122,17 @@ void EventsManager::debounceMouse() {
}
}
bool EventsManager::getKey(Common::KeyState &key) {
- if (_keyCode == Common::KEYCODE_INVALID) {
+ if (_key.keycode == Common::KEYCODE_INVALID) {
return false;
} else {
- key = _keyCode;
- _keyCode = Common::KEYCODE_INVALID;
+ key = _key;
+ _key.keycode = Common::KEYCODE_INVALID;
return true;
}
}
bool EventsManager::isKeyPending() const {
- return _keyCode != Common::KEYCODE_INVALID;
+ return _key.keycode != Common::KEYCODE_INVALID;
}
bool EventsManager::isKeyMousePressed() {
diff --git a/engines/xeen/events.h b/engines/xeen/events.h
index 36ef939..4ebc36d 100644
--- a/engines/xeen/events.h
+++ b/engines/xeen/events.h
@@ -40,7 +40,7 @@ private:
uint32 _priorFrameCounterTime;
uint32 _gameCounter;
uint32 _gameCounters[6];
- Common::KeyCode _keyCode;
+ Common::KeyState _key;
SpriteResource _sprites;
/**
More information about the Scummvm-git-logs
mailing list