[Scummvm-git-logs] scummvm master -> 05dcd7ff2316caffe54d97ec3677512678dd8733
peterkohaut
peterkohaut at users.noreply.github.com
Sat Mar 9 22:17:09 CET 2019
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
acb51d0e72 BLADERUNNER: Savagame names fixes
45831a7324 BLADERUNNER: Fixed McCoy anim in spinner at PS01
05dcd7ff23 BLADERUNNER: Fixed zbuffer warning in NR01
Commit: acb51d0e724a256e32959f805f0583d9000351f4
https://github.com/scummvm/scummvm/commit/acb51d0e724a256e32959f805f0583d9000351f4
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-03-09T22:16:38+01:00
Commit Message:
BLADERUNNER: Savagame names fixes
It was not possible to change the name of exisitng savegame
Saves were read too ofter just for over-drawing the thumbnail
Changed paths:
engines/bladerunner/savefile.cpp
engines/bladerunner/ui/kia_section_load.cpp
engines/bladerunner/ui/kia_section_load.h
engines/bladerunner/ui/kia_section_save.cpp
engines/bladerunner/ui/kia_section_save.h
diff --git a/engines/bladerunner/savefile.cpp b/engines/bladerunner/savefile.cpp
index b556b81..bc5227d 100644
--- a/engines/bladerunner/savefile.cpp
+++ b/engines/bladerunner/savefile.cpp
@@ -241,9 +241,10 @@ bool SaveFileReadStream::readBool() {
}
Common::String SaveFileReadStream::readStringSz(uint sz) {
- char *buf = new char[sz];
+ char *buf = new char[sz + 1];
read(buf, sz);
- Common::String result(buf, sz);
+ buf[sz] = 0;
+ Common::String result(buf);
delete[] buf;
return result;
}
diff --git a/engines/bladerunner/ui/kia_section_load.cpp b/engines/bladerunner/ui/kia_section_load.cpp
index 4d91fb5..5f8b635 100644
--- a/engines/bladerunner/ui/kia_section_load.cpp
+++ b/engines/bladerunner/ui/kia_section_load.cpp
@@ -47,6 +47,7 @@ KIASectionLoad::KIASectionLoad(BladeRunnerEngine *vm) : KIASectionBase(vm) {
_timeLeft = 0;
_hoveredLineId = -1;
+ _displayingLineId = -1;
_newGameEasyLineId = -1;
_newGameMediumLineId = -1;
_newGameHardLineId = -1;
@@ -102,23 +103,25 @@ void KIASectionLoad::draw(Graphics::Surface &surface){
int selectedLineId = _scrollBox->getSelectedLineData();
if (_hoveredLineId != selectedLineId) {
- if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size()) {
+ if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size() && _displayingLineId != selectedLineId) {
if (_timeLeft == 0) {
SaveStateDescriptor desc = SaveFileManager::queryMetaInfos(_vm->getTargetName(), selectedLineId);
const Graphics::Surface *thumbnail = desc.getThumbnail();
if (thumbnail != nullptr) {
_vm->_kia->playImage(*thumbnail);
+ _displayingLineId = selectedLineId;
}
}
} else {
_vm->_kia->playerReset();
_timeLeft = 800;
+ _displayingLineId = -1;
}
_hoveredLineId = selectedLineId;
}
uint32 now = _vm->_time->currentSystem();
- if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size()) {
+ if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size() && _displayingLineId != selectedLineId) {
if (_timeLeft) {
uint32 timeDiff = now - _timeLast;
if (timeDiff >= _timeLeft) {
@@ -126,6 +129,7 @@ void KIASectionLoad::draw(Graphics::Surface &surface){
const Graphics::Surface *thumbnail = desc.getThumbnail();
if (thumbnail != nullptr) {
_vm->_kia->playImage(*thumbnail);
+ _displayingLineId = selectedLineId;
}
} else {
_timeLeft -= timeDiff;
diff --git a/engines/bladerunner/ui/kia_section_load.h b/engines/bladerunner/ui/kia_section_load.h
index 820b39f..cd34d99 100644
--- a/engines/bladerunner/ui/kia_section_load.h
+++ b/engines/bladerunner/ui/kia_section_load.h
@@ -49,6 +49,7 @@ class KIASectionLoad : public KIASectionBase {
SaveStateList _saveList;
int _hoveredLineId;
+ int _displayingLineId;
int _newGameEasyLineId;
int _newGameMediumLineId;
int _newGameHardLineId;
diff --git a/engines/bladerunner/ui/kia_section_save.cpp b/engines/bladerunner/ui/kia_section_save.cpp
index f72254b..f24d0e0 100644
--- a/engines/bladerunner/ui/kia_section_save.cpp
+++ b/engines/bladerunner/ui/kia_section_save.cpp
@@ -62,8 +62,9 @@ KIASectionSave::KIASectionSave(BladeRunnerEngine *vm) : KIASectionBase(vm) {
_mouseX = 0;
_mouseY = 0;
- _selectedLineId = -1;
_hoveredLineId = -1;
+ _displayingLineId = -1;
+ _selectedLineId = -1;
_newSaveLineId = -1;
}
@@ -182,23 +183,25 @@ void KIASectionSave::draw(Graphics::Surface &surface){
int selectedLineId = _scrollBox->getSelectedLineData();
if (selectedLineId != _hoveredLineId) {
- if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size()) {
+ if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size() && _displayingLineId != selectedLineId) {
if (_timeLeft == 0) {
SaveStateDescriptor desc = SaveFileManager::queryMetaInfos(_vm->getTargetName(), selectedLineId);
const Graphics::Surface *thumbnail = desc.getThumbnail();
if (thumbnail != nullptr) {
_vm->_kia->playImage(*thumbnail);
+ _displayingLineId = selectedLineId;
}
}
} else {
_vm->_kia->playerReset();
_timeLeft = 800;
+ _displayingLineId = -1;
}
_hoveredLineId = selectedLineId;
}
uint32 now = _vm->_time->currentSystem();
- if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size()) {
+ if (selectedLineId >= 0 && selectedLineId < (int)_saveList.size() && _displayingLineId != selectedLineId) {
if (_timeLeft) {
uint32 timeDiff = now - _timeLast;
if (timeDiff >= _timeLeft) {
@@ -206,6 +209,7 @@ void KIASectionSave::draw(Graphics::Surface &surface){
const Graphics::Surface *thumbnail = desc.getThumbnail();
if (thumbnail != nullptr) {
_vm->_kia->playImage(*thumbnail);
+ _displayingLineId = selectedLineId;
}
} else {
_timeLeft -= timeDiff;
diff --git a/engines/bladerunner/ui/kia_section_save.h b/engines/bladerunner/ui/kia_section_save.h
index d3af652..5287716 100644
--- a/engines/bladerunner/ui/kia_section_save.h
+++ b/engines/bladerunner/ui/kia_section_save.h
@@ -64,6 +64,7 @@ class KIASectionSave : public KIASectionBase {
int _mouseY;
int _hoveredLineId;
+ int _displayingLineId;
int _selectedLineId;
int _newSaveLineId;
Commit: 45831a7324e0b6aad457749c191a96b5e5630c6d
https://github.com/scummvm/scummvm/commit/45831a7324e0b6aad457749c191a96b5e5630c6d
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-03-09T22:16:38+01:00
Commit Message:
BLADERUNNER: Fixed McCoy anim in spinner at PS01
McCoy will not disappear prematurely in PS01 when he enters the spinner.
Changed paths:
engines/bladerunner/actor.cpp
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp
index e1a5f98..2c5b77c 100644
--- a/engines/bladerunner/actor.cpp
+++ b/engines/bladerunner/actor.cpp
@@ -191,11 +191,11 @@ void Actor::changeAnimationMode(int animationMode, bool force) {
void Actor::setFPS(int fps) {
_fps = fps;
- if (fps == 0) {
+ if (fps == 0) { // stop actor's animation
_frameMs = 0;
- } else if (fps == -1) {
+ } else if (fps == -1) { // sync actor's animation with scene animation
_frameMs = -1000;
- } else if (fps == -2) {
+ } else if (fps == -2) { // set FPS to default from the model
_fps = _vm->_sliceAnimations->getFPS(_animationId);
_frameMs = 1000 / _fps;
} else {
@@ -587,6 +587,8 @@ bool Actor::tick(bool forceDraw, Common::Rect *screenRect) {
timerUpdate(5);
timeLeft = timerLeft(5);
needsUpdate = timeLeft <= 0;
+ } else if (_fps == 0) {
+ needsUpdate = false;
} else if (forceDraw) {
needsUpdate = true;
timeLeft = 0;
Commit: 05dcd7ff2316caffe54d97ec3677512678dd8733
https://github.com/scummvm/scummvm/commit/05dcd7ff2316caffe54d97ec3677512678dd8733
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2019-03-09T22:16:38+01:00
Commit Message:
BLADERUNNER: Fixed zbuffer warning in NR01
Game was trying to decode zbuf when there was none.
Changed paths:
engines/bladerunner/vqa_decoder.cpp
diff --git a/engines/bladerunner/vqa_decoder.cpp b/engines/bladerunner/vqa_decoder.cpp
index 96746b6..38d3fd4 100644
--- a/engines/bladerunner/vqa_decoder.cpp
+++ b/engines/bladerunner/vqa_decoder.cpp
@@ -724,7 +724,7 @@ bool VQADecoder::VQAVideoTrack::readZBUF(Common::SeekableReadStream *s, uint32 s
}
void VQADecoder::VQAVideoTrack::decodeZBuffer(ZBuffer *zbuffer) {
- if (_maxZBUFChunkSize == 0) {
+ if (_zbufChunkSize == 0) {
return;
}
More information about the Scummvm-git-logs
mailing list