[Scummvm-git-logs] scummvm master -> 767359b6e31e78bd593fbbc2cbdb79517d630bda
neuromancer
noreply at scummvm.org
Sun Jan 23 11:54:28 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
767359b6e3 HYPNO: refactored arcade code and corrected a color constant in spider
Commit: 767359b6e31e78bd593fbbc2cbdb79517d630bda
https://github.com/scummvm/scummvm/commit/767359b6e31e78bd593fbbc2cbdb79517d630bda
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-23T12:54:28+01:00
Commit Message:
HYPNO: refactored arcade code and corrected a color constant in spider
Changed paths:
engines/hypno/arcade.cpp
engines/hypno/hypno.h
engines/hypno/spider/arcade.cpp
engines/hypno/wet/arcade.cpp
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index da9a2594602..90ea86dae0f 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -118,19 +118,7 @@ void HypnoEngine::loadArcadeLevel(const Common::String &arclevel, const Common::
void HypnoEngine::drawPlayer() { error("Function \"%s\" not implemented", __FUNCTION__); }
void HypnoEngine::drawHealth() { error("Function \"%s\" not implemented", __FUNCTION__); }
void HypnoEngine::drawShoot(const Common::Point &target) { error("Function \"%s\" not implemented", __FUNCTION__); }
-
-void HypnoEngine::hitPlayer() {
- if ( _playerFrameSep < (int)_playerFrames.size()){
- if (_playerFrameIdx < _playerFrameSep)
- _playerFrameIdx = _playerFrameSep;
- } else {
- uint32 c = 251; // red
- _compositeSurface->fillRect(Common::Rect(0, 0, 640, 480), c);
- drawScreen();
- }
- //if (!_hitSound.empty())
- // playSound(_soundPath + _hitSound, 1);
-}
+void HypnoEngine::hitPlayer() { error("Function \"%s\" not implemented", __FUNCTION__); }
void HypnoEngine::runArcade(ArcadeShooting *arc) {
_arcadeMode = arc->mode;
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 2d510addeee..59f18feecdc 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -284,6 +284,7 @@ public:
void drawShoot(const Common::Point &target) override;
void drawPlayer() override;
void drawHealth() override;
+ void hitPlayer() override;
void runCode(Code *code) override;
Common::String findNextLevel(const Common::String &level) override;
Common::String findNextLevel(const Transition *trans) override;
@@ -308,6 +309,7 @@ public:
void drawShoot(const Common::Point &target) override;
void drawPlayer() override;
void drawHealth() override;
+ void hitPlayer() override;
bool checkArcadeLevelCompleted(MVideo &background) override;
void drawBackToMenu(Hotspot *h) override;
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index 7eb05704b05..77003ea002e 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -33,6 +33,20 @@ static const int oIndexYE[9] = {4, 3, 2, 1, 0};
static const int shootOriginIndex[9][2] = {
{41, 3}, {51, 3}, {65, 6}, {68, 9}, {71, 22}, {57, 20}, {37, 14}, {37, 11}, {57, 20}};
+void SpiderEngine::hitPlayer() {
+ if ( _playerFrameSep < (int)_playerFrames.size()){
+ if (_playerFrameIdx < _playerFrameSep)
+ _playerFrameIdx = _playerFrameSep;
+ } else {
+ uint32 c = 250; // red
+ _compositeSurface->fillRect(Common::Rect(0, 0, 640, 480), c);
+ drawScreen();
+ }
+ //if (!_hitSound.empty())
+ // playSound(_soundPath + _hitSound, 1);
+}
+
+
void SpiderEngine::drawShoot(const Common::Point &target) {
uint32 c = 248; // white
uint32 ox = 0;
@@ -175,9 +189,9 @@ void SpiderEngine::drawHealth() {
r = Common::Rect(256, 152 + d, 272, 174);
if (d >= 11)
- c = 250; // green
+ c = 250; // red
else
- c = 251; // red
+ c = 251; // green
_compositeSurface->fillRect(r, c);
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 6dc9c19a148..12a139d845e 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -31,6 +31,12 @@ bool WetEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
return clickedPrimaryShoot(mousePos);
}
+void WetEngine::hitPlayer() {
+ assert( _playerFrameSep < (int)_playerFrames.size());
+ if (_playerFrameIdx < _playerFrameSep)
+ _playerFrameIdx = _playerFrameSep;
+}
+
void WetEngine::drawShoot(const Common::Point &mousePos) {
uint32 c = 253;
_compositeSurface->drawLine(0, _screenH, mousePos.x, mousePos.y, c);
More information about the Scummvm-git-logs
mailing list