[Scummvm-git-logs] scummvm master -> f6d171b438f20dd0891e3545ebf39e27813a8a79
neuromancer
noreply at scummvm.org
Fri Jan 14 20:11:57 UTC 2022
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:
15470fca8a HYPNO: fixed note puzzle and fixes in spider
014b3c0431 HYPNO: use palette to target enemies
f6d171b438 HYPNO: allowed to finish c6 level in spider
Commit: 15470fca8ac940af06de4cc7deb936630eaca01d
https://github.com/scummvm/scummvm/commit/15470fca8ac940af06de4cc7deb936630eaca01d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-14T20:09:18+01:00
Commit Message:
HYPNO: fixed note puzzle and fixes in spider
Changed paths:
engines/hypno/spider/hard.cpp
engines/hypno/spider/spider.cpp
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index fb648622b78..60cb7c4464f 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -204,13 +204,16 @@ void SpiderEngine::runNote(Code *code) {
const char alphaES[] = "abcdefghijklmnopqrstuvwxyz~";
const char alphaEN[] = "abcdefghijklmnopqrstuvwxyz";
+ Common::Rect letterBoxES(22, 442, 554, 455);
+ Common::Rect letterBoxEN(22, 442, 535, 455);
+
const char solEasyES1[] = "hable cpn el svtp z talwe a";
const char solEasyES2[] = "masz jane";
char placeEasyES[] = "????? ??? ?? ???? ? ????? ?";
- const char solEasyEN1[] = "talk with the russian and save";
+ const char solEasyEN1[] = "speak with russian and save";
const char solEasyEN2[] = "mary jane";
- char placeEasyEN[] = "????? ???? ??????? ????? ??? ????";
+ char placeEasyEN[] = "????? ???? ??????? ??? ????";
char placeEasy2[] = "???? ????";
@@ -235,10 +238,12 @@ void SpiderEngine::runNote(Code *code) {
char *secondSentence;
Common::String firstSolution;
Common::String secondSolution;
+ Common::Rect letterBox;
switch (_language) {
case Common::EN_USA:
alpha = alphaEN;
+ letterBox = letterBoxEN;
if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
firstSentence = (char*) &placeEasyEN;
secondSentence = (char*) &placeEasy2;
@@ -254,6 +259,7 @@ void SpiderEngine::runNote(Code *code) {
case Common::ES_ESP:
alpha = alphaES;
+ letterBox = letterBoxES;
if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
firstSentence = (char*) &placeEasyES;
secondSentence = (char*) &placeEasy2;
@@ -272,22 +278,21 @@ void SpiderEngine::runNote(Code *code) {
}
float firstSentenceLength = strlen(firstSentence);
- float secondSentenceLength = strlen(secondSentence);
- Common::Rect letterBox(22, 442, 554, 455);
+ float secondSentenceLength = strlen(secondSentence);
Common::Rect firstSentenceBox(21, 140, 560, 162);
Common::Rect secondSentenceBox(21, 140, 196, 201);
- Frames letters = decodeFrames("spider/int_ball/letters.smk");
+ Frames letters = decodeFrames("int_ball/letters.smk");
Common::Point size(letters[0]->w, letters[0]->h);
if (_sceneState["GS_PUZZLELEVEL"] == 0) { // easy
- MVideo v("spider/int_ball/ppv007es.smk", Common::Point(0, 0), false, false, false);
+ MVideo v("int_ball/ppv007es.smk", Common::Point(0, 0), false, true, false);
runIntro(v);
- loadImage("spider/int_ball/enote.smk", 0, 0, false, true);
+ loadImage("int_ball/enote.smk", 0, 0, false, true);
} else { // hard
- MVideo v("spider/int_ball/ppv007hs.smk", Common::Point(0, 0), false, false, false);
+ MVideo v("int_ball/ppv007hs.smk", Common::Point(0, 0), false, true, false);
runIntro(v);
- loadImage("spider/int_ball/hnote.smk", 0, 0, false, true);
+ loadImage("int_ball/hnote.smk", 0, 0, false, true);
}
while (!shouldQuit() && _nextLevel.empty()) {
@@ -312,6 +317,7 @@ void SpiderEngine::runNote(Code *code) {
if (letterBox.contains(mousePos)) {
uint32 idx = (mousePos.x - 21) / (letterBox.width() / (alpha.size()-1));
selected = alpha[idx];
+ changeCursor("int_ball/letters.smk", idx);
//debug("%s", selected.c_str());
} else if (firstSentenceBox.contains(mousePos)) {
if (!selected.empty()) {
@@ -362,11 +368,11 @@ void SpiderEngine::runNote(Code *code) {
}
if (firstSentence == firstSolution && secondSentence == secondSolution) {
- if (_sceneState["GS_PUZZLELEVEL"] == 0 && Common::File::exists("spider/int_ball/ppv008es.smk")) {
- MVideo v("spider/int_ball/ppv008es.smk", Common::Point(0, 0), false, false, false);
+ if (_sceneState["GS_PUZZLELEVEL"] == 0) {
+ MVideo v("cine/ppv008es.smk", Common::Point(0, 0), false, false, false);
runIntro(v);
- } else if (_sceneState["GS_PUZZLELEVEL"] == 1 && Common::File::exists("spider/int_ball/ppv008hs.smk")) {
- MVideo v("spider/int_ball/ppv008hs.smk", Common::Point(0, 0), false, false, false);
+ } else if (_sceneState["GS_PUZZLELEVEL"] == 1) {
+ MVideo v("cine/ppv008hs.smk", Common::Point(0, 0), false, false, false);
runIntro(v);
}
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 78109caaf72..f4d3e3d9456 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -572,6 +572,7 @@ void SpiderEngine::loadAssetsFullGame() {
Code *note = new Code();
note->name = "<note>";
note->levelIfWin = "coat.mi_";
+ note->intros.push_back("cine/dia005s.smk");
note->prefix = prefix;
_levels["<note>"] = note;
@@ -612,6 +613,7 @@ void SpiderEngine::loadAssetsFullGame() {
loadSceneLevel("movie2.mi_", "decide5.mi_", prefix);
_levels["movie2.mi_"]->intros.push_back("cine/vrfs003s.smk");
+ _levels["movie2.mi_"]->intros.push_back("cine/imsd017s.smk");
loadSceneLevel("decide5.mi_", "", prefix);
sc = (Scene *) _levels["decide5.mi_"];
Commit: 014b3c0431c375a8da85993f0d193662614871c6
https://github.com/scummvm/scummvm/commit/014b3c0431c375a8da85993f0d193662614871c6
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-14T20:09:18+01:00
Commit Message:
HYPNO: use palette to target enemies
Changed paths:
engines/hypno/arcade.cpp
engines/hypno/grammar.h
engines/hypno/hypno.cpp
engines/hypno/spider/arcade.cpp
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index c16f984488c..81a67a5900c 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -159,7 +159,6 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
changeCursor("arcade");
playVideo(background);
loadPalette(arc->palette);
- background.decoder->setRate(1.5);
bool shootingPrimary = false;
bool shootingSecondary = false;
bool needsUpdate = true;
@@ -268,19 +267,21 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
shootSequence.pop_front();
for (Shoots::iterator it = arc->shoots.begin(); it != arc->shoots.end(); ++it) {
if (it->name == si.name) {
-
+ Shoot s = *it;
if (it->animation == "NONE") {
if ((uint32)(it->name[0]) == _currentPlayerPosition) {
_health = _health - it->attackWeight;
hitPlayer();
}
-
+ byte p[3] = {0xff, 0x00, 0x00}; // Always red?
+ assert(s.paletteSize == 1 || s.paletteSize == 0);
+ loadPalette((byte *) &p, s.paletteOffset, s.paletteSize);
+ _shoots.push_back(s);
} else {
- Shoot s = *it;
s.video = new MVideo(it->animation, it->position, true, false, false);
playVideo(*s.video);
s.video->currentFrame = s.video->decoder->decodeNextFrame(); // Skip the first frame
- loadPalette(s.video->decoder->getPalette(), s.paletteOffset, s.paletteSize);
+ loadPalette(s.video->decoder->getPalette() + 3*s.paletteOffset, s.paletteOffset, s.paletteSize);
_shoots.push_back(s);
playSound(_soundPath + arc->enemySound, 1);
}
@@ -293,7 +294,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
shootsToRemove.clear();
for (Shoots::iterator it = _shoots.begin(); it != _shoots.end(); ++it) {
- if (it->video->decoder) {
+ if (it->video && it->video->decoder) {
int frame = it->video->decoder->getCurFrame();
if (frame > 0 && frame >= (int)(it->attackFrame) && !it->destroyed) {
_health = _health - it->attackWeight;
@@ -341,7 +342,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
// Deallocate shoots
for (Shoots::iterator it = _shoots.begin(); it != _shoots.end(); ++it) {
- if (it->video->decoder)
+ if (it->video && it->video->decoder)
skipVideo(*it->video);
delete it->video;
}
@@ -353,17 +354,19 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
int HypnoEngine::detectTarget(const Common::Point &mousePos) {
int i = -1;
+ int x = mousePos.x;
+ int y = mousePos.y;
for (Shoots::iterator it = _shoots.begin(); it != _shoots.end(); ++it) {
i++;
- if (it->destroyed || !it->video->decoder)
+ if (it->destroyed)
+ continue;
+
+ if (it->animation != "NONE" && !it->video->decoder)
continue;
- int x = mousePos.x - it->position.x;
- int y = mousePos.y - it->position.y;
- int w = it->video->decoder->getWidth();
- int h = it->video->decoder->getHeight();
- if (it->video->decoder && x >= 0 && y >= 0 && x < w && y < h) {
- if (it->video->currentFrame->getPixel(x, y) > 0)
- return i;
+
+ uint32 c = _compositeSurface->getPixel(x, y);
+ if (c >= it->paletteOffset && c < it->paletteOffset + it->paletteSize) {
+ return i;
}
}
return -1;
@@ -386,12 +389,20 @@ void HypnoEngine::shoot(const Common::Point &mousePos) {
if (i >= 0) {
playSound(_soundPath + _shoots[i].hitSound, 1);
playSound(_soundPath + _shoots[i].deathSound, 1);
- int w = _shoots[i].video->decoder->getWidth();
- int h = _shoots[i].video->decoder->getHeight();
_score = _score + _shoots[i].pointsToShoot;
_shoots[i].destroyed = true;
- _shoots[i].video->position = Common::Point(mousePos.x - w / 2, mousePos.y - h / 2);
- _shoots[i].video->decoder->forceSeekToFrame(_shoots[i].explosionFrame + 2);
+
+ if (_shoots[i].animation != "NONE") {
+ 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->decoder->forceSeekToFrame(_shoots[i].explosionFrame + 2);
+ } else {
+ byte p[3] = {}; // Always black?
+ assert(_shoots[i].paletteSize == 1 || _shoots[i].paletteSize == 0);
+ loadPalette((byte *) &p, _shoots[i].paletteOffset, _shoots[i].paletteSize);
+ }
+
}
}
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index def302c7476..96c12b45c4f 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -343,6 +343,13 @@ public:
Shoot() {
destroyed = false;
video = nullptr;
+ timesToShoot = 0;
+ pointsToShoot = 0;
+ attackWeight = 0;
+ paletteOffset = 0;
+ paletteSize = 0;
+ attackFrame = 0;
+ explosionFrame = 0;
}
Common::String name;
Filename animation;
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 420809caf96..128adad416a 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -401,7 +401,7 @@ void HypnoEngine::loadPalette(const Common::String &fname) {
void HypnoEngine::loadPalette(const byte *palette, uint32 offset, uint32 size) {
debugC(1, kHypnoDebugMedia, "Loading palette from byte array with offset %d and size %d", offset, size);
- g_system->getPaletteManager()->setPalette(palette + 3*offset, offset, size);
+ g_system->getPaletteManager()->setPalette(palette, offset, size);
}
void HypnoEngine::updateScreen(MVideo &video) {
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index 6e189e31e57..c679ecb1723 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -144,11 +144,6 @@ void SpiderEngine::drawPlayer() {
_playerFrameIdx = oIndexYE[idx];
ox = _screenW / 2 - _playerFrames[0]->w / 2;
oy = _screenH - _playerFrames[0]->h;
- if (_arcadeMode == "YF") { // Remove me later
- GUI::MessageDialog dialog("The following arcade sequence is not fully implemented yet, so it will be skipped");
- dialog.runModal();
- _skipLevel = true;
- }
} else if (_arcadeMode == "YB") {
ox = 60;
oy = 129;
Commit: f6d171b438f20dd0891e3545ebf39e27813a8a79
https://github.com/scummvm/scummvm/commit/f6d171b438f20dd0891e3545ebf39e27813a8a79
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-14T21:05:47+01:00
Commit Message:
HYPNO: allowed to finish c6 level in spider
Changed paths:
engines/hypno/arcade.cpp
engines/hypno/hypno.h
engines/hypno/spider/arcade.cpp
engines/hypno/spider/spider.cpp
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 81a67a5900c..f4c70648da8 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -246,7 +246,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
skipVideo(background);
}
- if (!background.decoder || background.decoder->endOfVideo() || _skipLevel) {
+ if (checkArcadeLevelCompleted(background)) {
skipVideo(background);
if (!arc->nextLevelVideo.empty()) {
MVideo video(arc->nextLevelVideo, Common::Point(0, 0), false, false, false);
@@ -406,6 +406,10 @@ void HypnoEngine::shoot(const Common::Point &mousePos) {
}
}
+bool HypnoEngine::checkArcadeLevelCompleted(MVideo &background) {
+ return !background.decoder || background.decoder->endOfVideo() || _skipLevel;
+}
+
bool HypnoEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
return false;
}
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 29ed00286db..b1511180fa3 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -221,6 +221,7 @@ public:
virtual void drawShoot(const Common::Point &mousePos);
virtual void shoot(const Common::Point &mousePos);
virtual void hitPlayer();
+ virtual bool checkArcadeLevelCompleted(MVideo &background);
Common::String _difficulty;
bool _skipLevel;
@@ -301,6 +302,8 @@ public:
void drawShoot(const Common::Point &target) override;
void drawPlayer() override;
void drawHealth() override;
+ bool checkArcadeLevelCompleted(MVideo &background) override;
+
void runCode(Code *code) override;
Common::String findNextLevel(const Common::String &level) override;
Common::String findNextLevel(const Transition *trans) override;
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index c679ecb1723..7eee0119d4d 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -188,4 +188,24 @@ void SpiderEngine::drawHealth() {
_font->drawString(_compositeSurface, "ENERGY", 248, 180, 38, c);
}
+bool SpiderEngine::checkArcadeLevelCompleted(MVideo &background) {
+ if (_skipLevel)
+ return true;
+
+ if (_arcadeMode == "YF") {
+ if (!background.decoder || background.decoder->endOfVideo())
+ _health = 0;
+
+ if (_shoots.size() == 0)
+ return false;
+
+ for (Shoots::iterator it = _shoots.begin(); it != _shoots.end(); ++it)
+ if (!it->destroyed)
+ return false;
+
+ return true;
+ }
+ return !background.decoder || background.decoder->endOfVideo();
+}
+
} // End of namespace Hypno
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index f4d3e3d9456..3a4d834726a 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -1015,6 +1015,7 @@ Common::Error SpiderEngine::loadGameStream(Common::SeekableReadStream *stream) {
_sceneState["GS_PUZZLELEVEL"] = stream->readUint32LE();
_sceneState["GS_COMBATLEVEL"] = stream->readUint32LE();
_nextLevel = stream->readString();
+ _checkpoint = _nextLevel;
// Reset state variables from puzzles
for (int i = 0; i < 2; i++)
More information about the Scummvm-git-logs
mailing list