ILLUSIONS: Fix clang warnings. Work on menu keyboard control

Fix some warnings while compiling with clang.
Add up/down key support in game menus.
This commit is contained in:
Eric Fry 2018-04-30 20:17:10 +10:00 committed by Eugene Sandulenko
parent 39798c63d1
commit a7d78df98c
7 changed files with 24 additions and 18 deletions

View File

@ -32,7 +32,7 @@ namespace Illusions {
class IllusionsEngine_BBDOU;
class BbdouSpecialCode;
class Control;
class TriggerFunction;
struct TriggerFunction;
struct InventoryItem {
uint32 _objectId;

View File

@ -27,11 +27,11 @@
namespace Illusions {
class ActorType;
struct ActorType;
class Control;
class FontResource;
class Sequence;
class TalkEntry;
struct Sequence;
struct TalkEntry;
template<class T>
class DictionaryHashMap {

View File

@ -61,7 +61,7 @@ void GameState::deleteReadStream() {
}
Common::WriteStream *GameState::newWriteStream() {
if (!_writeBufferSize == 0 || !_writeBuffer) {
if (_writeBufferSize == 0 || !_writeBuffer) {
_writeBufferSize = calcWriteBufferSize();
_writeBuffer = (byte*)malloc(_writeBufferSize);
}

View File

@ -53,10 +53,8 @@ class BaseResourceReader;
struct SurfInfo;
class ActorItem;
class ActorInstanceList;
class ActorType;
class BackgroundItem;
struct ActorType;
class BackgroundInstanceList;
class BackgroundResource;
class Camera;
@ -72,7 +70,7 @@ class ScreenText;
class ScriptOpcodes;
class ScriptResource;
class ScriptStack;
class Sequence;
struct Sequence;
class SoundMan;
class SpecialCode;
class TalkInstanceList;

View File

@ -465,15 +465,22 @@ void BaseMenuSystem::update(Control *cursorControl) {
handleClick(_activeMenu->_defaultMenuItemIndex, mousePos);
} else if (_vm->_input->pollEvent(kEventUp)) {
// TODO handleUpKey();
if (_hoveredMenuItemIndex > 0) {
setMouseCursorToMenuItem(--_hoveredMenuItemIndex);
if (_hoveredMenuItemIndex == 1) {
_hoveredMenuItemIndex = _activeMenu->getMenuItemsCount();
} else {
_hoveredMenuItemIndex--;
}
setMouseCursorToMenuItem(_hoveredMenuItemIndex);
_hoveredMenuItemIndex2 = _hoveredMenuItemIndex;
updateActorHoverBackground();
}
} else if (_vm->_input->pollEvent(kEventDown)) {
// TODO handleDownKey();
setMouseCursorToMenuItem(++_hoveredMenuItemIndex);
if (_hoveredMenuItemIndex == _activeMenu->getMenuItemsCount()) {
_hoveredMenuItemIndex = 1;
} else {
_hoveredMenuItemIndex++;
}
setMouseCursorToMenuItem(_hoveredMenuItemIndex);
_hoveredMenuItemIndex2 = _hoveredMenuItemIndex;
updateActorHoverBackground();
}

View File

@ -315,7 +315,8 @@ int PathFinder::calcLineStatus(PathLine &sourceLine, PathLine &destRect, Common:
return 2;
int v15 = sourceDeltaX * delta1, v18 = sourceDeltaY * delta1;
int v16, v17;
int v16 = 0;
int v17 = 0;
if ((v15 >= 0 && delta2 >= 0) || (v15 < 0 && delta2 < 0)) {
v16 = delta2 / 2;

View File

@ -284,7 +284,7 @@ void ScriptResource::load(Resource *resource) {
Common::MemoryReadStream stream(_data, _dataSize, DisposeAfterUse::NO);
uint32 objectMapOffs, sceneInfosOffs;
uint32 objectMapOffs = 0, sceneInfosOffs = 0;
_objectMapCount = 0;
if (resource->_gameId == kGameIdBBDOU) {
@ -311,7 +311,7 @@ void ScriptResource::load(Resource *resource) {
uint32 propertiesOffs = stream.readUint32LE();
uint32 blockCountersOffs = stream.readUint32LE();
if (resource->_gameId == kGameIdDuckman)
objectMapOffs = stream.readUint32LE();
objectMapOffs = stream.readUint32LE(); //TODO Is this needed for BBDOU?
uint32 codeTblOffs = stream.readUint32LE();
debug(2, "ScriptResource::load() propertiesCount: %d; blockCountersCount: %d; _codeCount: %d; _sceneInfosCount: %d; _objectMapCount: %d",