[Scummvm-git-logs] scummvm master -> 590285a89068ae8943ce659f20a3a2fe1612d872
Strangerke
Strangerke at scummvm.org
Sun Sep 8 22:17:52 CEST 2019
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:
feafd2a956 HDB: Remove unused static in setButtons
590285a890 HDB: Reduce the scope of some more variables
Commit: feafd2a9565f51a487216a21ec59273cd9be6eaa
https://github.com/scummvm/scummvm/commit/feafd2a9565f51a487216a21ec59273cd9be6eaa
Author: Strangerke (strangerke at scummvm.org)
Date: 2019-09-08T22:15:15+02:00
Commit Message:
HDB: Remove unused static in setButtons
Changed paths:
engines/hdb/input.cpp
diff --git a/engines/hdb/input.cpp b/engines/hdb/input.cpp
index 3078d69..df6d02e 100644
--- a/engines/hdb/input.cpp
+++ b/engines/hdb/input.cpp
@@ -52,14 +52,12 @@ void Input::init() {
}
void Input::setButtons(uint16 b) {
- static int changeState = 0;
-
_buttons = b;
if (!b)
return;
// Change Game State
- if ((_buttons & kButtonA) && !changeState && (g_hdb->getGameState() != GAME_MENU)) {
+ if ((_buttons & kButtonA) && (g_hdb->getGameState() != GAME_MENU)) {
if (g_hdb->_ai->cinematicsActive() && g_hdb->_ai->cineAbortable()) {
g_hdb->_ai->cineAbort();
g_hdb->_sound->playSound(SND_POP);
Commit: 590285a89068ae8943ce659f20a3a2fe1612d872
https://github.com/scummvm/scummvm/commit/590285a89068ae8943ce659f20a3a2fe1612d872
Author: Strangerke (strangerke at scummvm.org)
Date: 2019-09-08T22:15:50+02:00
Commit Message:
HDB: Reduce the scope of some more variables
Changed paths:
engines/hdb/gfx.cpp
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index 42f6f23..40a64a2 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -410,10 +410,6 @@ void Gfx::setFade(bool fadeIn, bool black, int steps) {
}
void Gfx::updateFade() {
- uint8 r, g, b;
- uint16 value;
- uint16 *ptr;
-
if (!_fadeInfo.active && !_fadeInfo.stayFaded)
return;
@@ -424,10 +420,11 @@ void Gfx::updateFade() {
if (!_fadeInfo.isBlack) {
// Black fade
for (int y = 0; y < g_hdb->_screenHeight; y++) {
- ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
+ uint16 *ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
for (int x = 0; x < g_hdb->_screenWidth; x++) {
- value = *ptr;
+ uint16 value = *ptr;
if (value) {
+ uint8 r, g, b;
g_hdb->_format.colorToRGB(value, r, g, b);
r = (r * _fadeInfo.curStep) >> 8;
g = (g * _fadeInfo.curStep) >> 8;
@@ -441,9 +438,11 @@ void Gfx::updateFade() {
} else {
// White fade
for (int y = 0; y < g_hdb->_screenHeight; y++) {
- ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
+ uint16 *ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
for (int x = 0; x < g_hdb->_screenWidth; x++) {
- value = *ptr;
+ uint16 value = *ptr;
+
+ uint8 r, g, b;
g_hdb->_format.colorToRGB(value, r, g, b);
r += (255 - r) * (256 - _fadeInfo.curStep) / 256;
g += (255 - g) * (256 - _fadeInfo.curStep) / 256;
@@ -488,10 +487,11 @@ void Gfx::updateFade() {
// Black Fade
for (int y = 0; y < g_hdb->_screenHeight; y++) {
- ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
+ uint16 *ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
for (int x = 0; x < g_hdb->_screenWidth; x++) {
- value = *ptr;
+ uint16 value = *ptr;
if (value) {
+ uint8 r, g, b;
g_hdb->_format.colorToRGB(value, r, g, b);
r = (r * _fadeInfo.curStep) >> 8;
g = (g * _fadeInfo.curStep) >> 8;
@@ -505,9 +505,10 @@ void Gfx::updateFade() {
// White Fade
for (int y = 0; y < g_hdb->_screenHeight; y++) {
- ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
+ uint16 *ptr = (uint16 *)_fadeBuffer1.getBasePtr(0, y);
for (int x = 0; x < g_hdb->_screenWidth; x++) {
- value = *ptr;
+ uint16 value = *ptr;
+ uint8 r, g, b;
g_hdb->_format.colorToRGB(value, r, g, b);
r += (255 - r) * (256 - _fadeInfo.curStep) / 256;
g += (255 - g) * (256 - _fadeInfo.curStep) / 256;
More information about the Scummvm-git-logs
mailing list