aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/ui/kia_section_load.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/bladerunner/ui/kia_section_load.cpp')
-rw-r--r--engines/bladerunner/ui/kia_section_load.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/bladerunner/ui/kia_section_load.cpp b/engines/bladerunner/ui/kia_section_load.cpp
index 42ace56e0d..41f2e7e18f 100644
--- a/engines/bladerunner/ui/kia_section_load.cpp
+++ b/engines/bladerunner/ui/kia_section_load.cpp
@@ -44,8 +44,8 @@ KIASectionLoad::KIASectionLoad(BladeRunnerEngine *vm) : KIASectionBase(vm) {
_scrollBox = new UIScrollBox(_vm, scrollBoxCallback, this, 1025, 0, true, Common::Rect(155, 158, 461, 346), Common::Rect(506, 160, 506, 350));
_uiContainer->add(_scrollBox);
- _timeLast = 0;
- _timeLeft = 0;
+ _timeLast = 0u;
+ _timeLeft = 0u;
_hoveredLineId = -1;
_displayingLineId = -1;
@@ -86,7 +86,7 @@ void KIASectionLoad::open() {
_hoveredLineId = -1;
_timeLast = _vm->_time->currentSystem();
- _timeLeft = 800;
+ _timeLeft = 800u;
}
void KIASectionLoad::close() {
@@ -105,7 +105,7 @@ void KIASectionLoad::draw(Graphics::Surface &surface) {
if (_hoveredLineId != selectedLineId) {
if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size() && _displayingLineId != selectedLineId) {
- if (_timeLeft == 0) {
+ if (_timeLeft == 0u) {
SaveStateDescriptor desc = SaveFileManager::queryMetaInfos(_vm->getTargetName(), selectedLineId);
const Graphics::Surface *thumbnail = desc.getThumbnail();
if (thumbnail != nullptr) {
@@ -115,7 +115,7 @@ void KIASectionLoad::draw(Graphics::Surface &surface) {
}
} else {
_vm->_kia->playerReset();
- _timeLeft = 800;
+ _timeLeft = 800u;
_displayingLineId = -1;
}
_hoveredLineId = selectedLineId;
@@ -124,7 +124,7 @@ void KIASectionLoad::draw(Graphics::Surface &surface) {
uint32 now = _vm->_time->currentSystem();
if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size() && _displayingLineId != selectedLineId) {
if (_timeLeft) {
- uint32 timeDiff = now - _timeLast;
+ uint32 timeDiff = now - _timeLast; // unsigned difference is intentional
if (timeDiff >= _timeLeft) {
SaveStateDescriptor desc = SaveFileManager::queryMetaInfos(_vm->getTargetName(), _saveList[selectedLineId].getSaveSlot());
const Graphics::Surface *thumbnail = desc.getThumbnail();
@@ -133,7 +133,7 @@ void KIASectionLoad::draw(Graphics::Surface &surface) {
_displayingLineId = selectedLineId;
}
} else {
- _timeLeft -= timeDiff;
+ _timeLeft = (_timeLeft < timeDiff) ? 0u : (_timeLeft - timeDiff);
}
}
}