[Scummvm-git-logs] scummvm master -> 92bfaf0fe333019d97896686c694cb8b4f3da284
neuromancer
noreply at scummvm.org
Tue Mar 29 19:31:33 UTC 2022
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:
3a7ae73fa4 HYPNO: adjusted ui text positions for c20 in wet
92bfaf0fe3 HYPNO: partial implementation of the special cursor for c33 in wet
Commit: 3a7ae73fa42809a2888403e768294fad7f8a5597
https://github.com/scummvm/scummvm/commit/3a7ae73fa42809a2888403e768294fad7f8a5597
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-03-29T21:31:41+02:00
Commit Message:
HYPNO: adjusted ui text positions for c20 in wet
Changed paths:
engines/hypno/wet/wet.cpp
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index d0f456fbe0c..f9c31113b48 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -33,7 +33,7 @@ static const chapterEntry rawChapterTable[] = {
{21, {70, 160}, {180, 160}, {220, 185}}, // c21
{22, {70, 160}, {180, 160}, {220, 185}}, // c22
{23, {70, 160}, {180, 160}, {220, 185}}, // c23
- {20, {44, 172}, {218, 172}, {0, 0}}, // c20
+ {20, {128, 150}, {238, 150},{0, 0}}, // c20
{31, {70, 160}, {180, 160}, {220, 185}}, // c31
{32, {70, 160}, {180, 160}, {220, 185}}, // c32
{33, {70, 160}, {180, 160}, {220, 185}}, // c33
Commit: 92bfaf0fe333019d97896686c694cb8b4f3da284
https://github.com/scummvm/scummvm/commit/92bfaf0fe333019d97896686c694cb8b4f3da284
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-03-29T21:31:41+02:00
Commit Message:
HYPNO: partial implementation of the special cursor for c33 in wet
Changed paths:
engines/hypno/arcade.cpp
engines/hypno/hypno.h
engines/hypno/wet/arcade.cpp
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 4c0e42406d2..537dd41fc60 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -191,14 +191,13 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
_health = arc->health;
_maxHealth = _health;
debugC(1, kHypnoDebugArcade, "Starting segment of type %x", segments[_segmentIdx].type);
- changeCursor("arcade");
_shoots.clear();
_skipLevel = false;
Common::Point offset;
MVideo background = MVideo(arc->backgroundVideo, offset, false, false, false);
- changeCursor("arcade");
+ drawCursorArcade(mousePos);
playVideo(background);
float rate = background.decoder->getFrameRate().toDouble();
if (rate < 10) {
@@ -513,10 +512,13 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
_music.clear();
}
+Common::Point HypnoEngine::computeTargetPosition(const Common::Point &mousePos) {
+ return mousePos;
+}
+
int HypnoEngine::detectTarget(const Common::Point &mousePos) {
int i = -1;
- int x = mousePos.x;
- int y = mousePos.y;
+ Common::Point target = computeTargetPosition(mousePos);
for (Shoots::iterator it = _shoots.begin(); it != _shoots.end(); ++it) {
i++;
if (it->destroyed)
@@ -525,7 +527,7 @@ int HypnoEngine::detectTarget(const Common::Point &mousePos) {
if (it->animation != "NONE" && !it->video->decoder)
continue;
- uint32 c = _compositeSurface->getPixel(x, y);
+ uint32 c = _compositeSurface->getPixel(target.x, target.y);
if (c >= it->paletteOffset && c < it->paletteOffset + it->paletteSize) {
return i;
}
@@ -567,9 +569,10 @@ void HypnoEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVid
_shoots[i].destroyed = true;
if (_shoots[i].animation != "NONE") {
- if (_shoots[i].deathPosition.x != 0 && _shoots[i].deathPosition.y != 0)
- _shoots[i].video->position = Common::Point(mousePos.x, mousePos.y) - _shoots[i].deathPosition;
-
+ if (_shoots[i].deathPosition.x != 0 && _shoots[i].deathPosition.y != 0) {
+ Common::Point position = computeTargetPosition(mousePos);
+ _shoots[i].video->position = Common::Point(position.x, position.y) - _shoots[i].deathPosition;
+ }
int currentFrame = _shoots[i].video->decoder->getCurFrame();
uint32 explosionIdx;
for (explosionIdx = 0; explosionIdx < _shoots[i].bodyFrames.size(); explosionIdx++) {
@@ -586,11 +589,12 @@ void HypnoEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVid
_shoots[i].lastFrame = explosionLastFrame - 2;
} else {
if (!_shoots[i].explosionAnimation.empty()) {
- _shoots[i].video = new MVideo(_shoots[i].explosionAnimation, mousePos, true, false, false);
+ Common::Point position = computeTargetPosition(mousePos);
+ _shoots[i].video = new MVideo(_shoots[i].explosionAnimation, position, true, false, false);
playVideo(*_shoots[i].video);
int w = _shoots[i].video->decoder->getWidth();
int h = _shoots[i].video->decoder->getHeight();
- _shoots[i].video->position = Common::Point(mousePos.x - w / 2, mousePos.y - h / 2);
+ _shoots[i].video->position = Common::Point(position.x - w / 2, position.y - h / 2);
} else if (_objIdx == 0 && !arc->hitBoss1Video.empty()) {
background.decoder->pauseVideo(true);
MVideo video(arc->hitBoss1Video, Common::Point(0, 0), false, true, false);
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 4593bf25af7..2987e9d4cbf 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -218,6 +218,7 @@ public:
Common::String _arcadeMode;
uint32 _currentPlayerPosition;
uint32 _lastPlayerPosition;
+ virtual Common::Point computeTargetPosition(const Common::Point &mousePos);
int detectTarget(const Common::Point &mousePos);
virtual bool clickedPrimaryShoot(const Common::Point &mousePos);
virtual bool clickedSecondaryShoot(const Common::Point &mousePos);
@@ -339,6 +340,8 @@ public:
void drawPlayer() override;
void drawHealth() override;
void hitPlayer() override;
+ void drawCursorArcade(const Common::Point &mousePos) override;
+ Common::Point computeTargetPosition(const Common::Point &mousePos) override;
void missTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) override;
void runCode(Code *code) override;
Common::String findNextLevel(const Common::String &level) override;
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 277f124a728..ac1fdda9c27 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -382,6 +382,19 @@ void WetEngine::runBeforeArcade(ArcadeShooting *arc) {
_playerFrameIdx = -1;
}
+void WetEngine::drawCursorArcade(const Common::Point &mousePos) {
+ int i = detectTarget(mousePos);
+ if (_arcadeMode == "YT") {
+ changeCursor("c33/c33i2.smk", 12);
+ return;
+ }
+
+ if (i >= 0)
+ changeCursor("target");
+ else
+ changeCursor("arcade");
+}
+
bool WetEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
incShotsFired();
return clickedPrimaryShoot(mousePos);
@@ -413,15 +426,30 @@ void WetEngine::hitPlayer() {
}
}
+Common::Point WetEngine::computeTargetPosition(const Common::Point &mousePos) {
+ if (_arcadeMode == "YT") {
+ return Common::Point(mousePos.x, mousePos.y - 20);
+ }
+ return mousePos;
+}
+
void WetEngine::drawShoot(const Common::Point &mousePos) {
uint32 c = 253;
- _compositeSurface->drawLine(0, _screenH, mousePos.x, mousePos.y, c);
- _compositeSurface->drawLine(0, _screenH, mousePos.x - 1, mousePos.y, c);
- _compositeSurface->drawLine(0, _screenH, mousePos.x - 2, mousePos.y, c);
- _compositeSurface->drawLine(_screenW, _screenH, mousePos.x, mousePos.y, c);
- _compositeSurface->drawLine(_screenW, _screenH, mousePos.x - 1, mousePos.y, c);
- _compositeSurface->drawLine(_screenW, _screenH, mousePos.x - 2, mousePos.y, c);
+ if (_arcadeMode == "YT") {
+ _compositeSurface->drawLine(mousePos.x, mousePos.y - 20, mousePos.x, mousePos.y + 1, c);
+ _compositeSurface->drawLine(mousePos.x, mousePos.y - 20, mousePos.x, mousePos.y, c);
+ _compositeSurface->drawLine(mousePos.x, mousePos.y - 20, mousePos.x, mousePos.y - 1, c);
+ } else {
+ _compositeSurface->drawLine(0, _screenH, mousePos.x, mousePos.y, c);
+ _compositeSurface->drawLine(0, _screenH, mousePos.x - 1, mousePos.y, c);
+ _compositeSurface->drawLine(0, _screenH, mousePos.x - 2, mousePos.y, c);
+
+ _compositeSurface->drawLine(_screenW, _screenH, mousePos.x, mousePos.y, c);
+ _compositeSurface->drawLine(_screenW, _screenH, mousePos.x - 1, mousePos.y, c);
+ _compositeSurface->drawLine(_screenW, _screenH, mousePos.x - 2, mousePos.y, c);
+ }
+
playSound(_soundPath + _shootSound, 1);
}
More information about the Scummvm-git-logs
mailing list