[Scummvm-git-logs] scummvm master -> 2c1e4effb087b09f5ca5a1ef4b418c1f270bb704
neuromancer
noreply at scummvm.org
Sat Jan 22 20:31:02 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:
2b44320ce5 HYPNO: refactored some code and fixed credits in wet demo
37f14f24a6 HYPNO: refactored font handling and fixed some palette issues in wet
2c1e4effb0 HYPNO: correctly draw menus during puzzles in spider
Commit: 2b44320ce578b02fab715a8bbb230dd6cc9b9d26
https://github.com/scummvm/scummvm/commit/2b44320ce578b02fab715a8bbb230dd6cc9b9d26
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-22T21:30:59+01:00
Commit Message:
HYPNO: refactored some code and fixed credits in wet demo
Changed paths:
engines/hypno/actions.cpp
engines/hypno/arcade.cpp
engines/hypno/hypno.h
engines/hypno/spider/spider.cpp
engines/hypno/wet/wet.cpp
diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index 6c87b73a633..5e8daebf211 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -68,29 +68,11 @@ void HypnoEngine::runMenu(Hotspots *hs) {
// runMice(h, (Mice*) action);
}
- Graphics::Surface *menu = nullptr;
- bool transparent = false;
- if (_conversation.empty()) {
- if (h->flags[0] == "HINTS" || h->flags[1] == "HINTS" || h->flags[2] == "HINTS") {
- menu = decodeFrame("int_main/hint1.smk", 0);
- } else if (h->flags[0] == "AUTO_BUTTONS" || h->flags[0] == "SINGLE_RUN") {
- if (isDemo()) {
- if (_currentLevel != "sixdemo/mis/demo.mis" && _currentLevel != "sixdemo/mis/order.mis") {
- menu = decodeFrame("int_main/resume.smk", 0);
- transparent = true;
- }
- } else {
- menu = decodeFrame("int_main/menu.smk", 0);
- }
- }
-
- if (menu) {
- h->rect = Common::Rect(0, 0, menu->w, menu->h);
- drawImage(*menu, 0, 0, transparent);
- }
- }
+ drawBackToMenu(h);
}
+void HypnoEngine::drawBackToMenu(Hotspot *h) {}
+
void HypnoEngine::runBackground(Background *a) {
if (a->condition.size() > 0) {
bool condition = _sceneState[a->condition];
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index f4c70648da8..9a191e3435a 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -142,6 +142,8 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
for (Frames::iterator it =_playerFrames.begin(); it != _playerFrames.end(); ++it) {
if ((*it)->getPixel(0, 0) == 255)
break;
+ if ((*it)->getPixel(0, 0) == 252)
+ break;
_playerFrameSep++;
}
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 3f5adbf0f0b..1324dbb45bd 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -170,6 +170,7 @@ public:
bool runGlobal(Global *a);
void runTalk(Talk *a);
void runChangeLevel(ChangeLevel *a);
+ virtual void drawBackToMenu(Hotspot *h);
// Screen
int _screenW, _screenH;
@@ -306,6 +307,7 @@ public:
void drawHealth() override;
bool checkArcadeLevelCompleted(MVideo &background) override;
+ void drawBackToMenu(Hotspot *h) 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/spider.cpp b/engines/hypno/spider/spider.cpp
index 044ed47b172..91693d95685 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -1077,6 +1077,29 @@ Common::Error SpiderEngine::saveGameStream(Common::WriteStream *stream, bool isA
return Common::kNoError;
}
+void SpiderEngine::drawBackToMenu(Hotspot *h) {
+ Graphics::Surface *menu = nullptr;
+ bool transparent = false;
+ if (_conversation.empty()) {
+ if (h->flags[0] == "HINTS" || h->flags[1] == "HINTS" || h->flags[2] == "HINTS") {
+ menu = decodeFrame("int_main/hint1.smk", 0);
+ } else if (h->flags[0] == "AUTO_BUTTONS" || h->flags[0] == "SINGLE_RUN") {
+ if (isDemo()) {
+ if (_currentLevel != "sixdemo/mis/demo.mis" && _currentLevel != "sixdemo/mis/order.mis") {
+ menu = decodeFrame("int_main/resume.smk", 0);
+ transparent = true;
+ }
+ } else {
+ menu = decodeFrame("int_main/menu.smk", 0);
+ }
+ }
+
+ if (menu) {
+ h->rect = Common::Rect(0, 0, menu->w, menu->h);
+ drawImage(*menu, 0, 0, transparent);
+ }
+ }
+}
Common::String SpiderEngine::findNextLevel(const Common::String &level) {
if (Common::matchString(level.c_str(), "c#") || Common::matchString(level.c_str(), "c##") || Common::matchString(level.c_str(), "c##?"))
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index 2fda4ba8b27..f6043356e55 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -232,8 +232,10 @@ void WetEngine::loadAssetsFullGame() {
}
void WetEngine::showCredits() {
- MVideo video("c_misc/credits.smk", Common::Point(0, 0), false, false, false);
- runIntro(video);
+ if (!isDemo() || _variant == "Demo") {
+ MVideo video("c_misc/credits.smk", Common::Point(0, 0), false, false, false);
+ runIntro(video);
+ }
}
void WetEngine::runCode(Code *code) {
Commit: 37f14f24a66dc3835425675a7f94fd78ac0cc1f2
https://github.com/scummvm/scummvm/commit/37f14f24a66dc3835425675a7f94fd78ac0cc1f2
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-22T21:30:59+01:00
Commit Message:
HYPNO: refactored font handling and fixed some palette issues in wet
Changed paths:
engines/hypno/arcade.cpp
engines/hypno/hypno.cpp
engines/hypno/hypno.h
engines/hypno/spider/arcade.cpp
engines/hypno/wet/arcade.cpp
engines/hypno/wet/wet.cpp
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 9a191e3435a..530436bfd66 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -122,8 +122,6 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
Common::Point mousePos;
Common::List<uint32> shootsToRemove;
ShootSequence shootSequence = arc->shootSequence;
-
- _font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
_levelId = arc->id;
_shootSound = arc->shootSound;
_hitSound = arc->hitSound;
diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index ca5e9340c5c..07609304968 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -61,6 +61,12 @@ HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
g_parsedArc = new ArcadeShooting();
_defaultCursor = "";
_checkpoint = "";
+
+ _language = Common::parseLanguage(ConfMan.get("language"));
+ _platform = Common::parsePlatform(ConfMan.get("platform"));
+ if (!Common::parseBool(ConfMan.get("cheats"), _cheatsEnabled))
+ error("Failed to parse bool from cheats options");
+
// Add quit level
Hotspot q(MakeMenu);
Action *a = new Quit();
@@ -107,11 +113,6 @@ LibFile *HypnoEngine::loadLib(const Filename &prefix, const Filename &filename,
void HypnoEngine::loadAssets() { error("Function \"%s\" not implemented", __FUNCTION__); }
Common::Error HypnoEngine::run() {
- _language = Common::parseLanguage(ConfMan.get("language"));
- _platform = Common::parsePlatform(ConfMan.get("platform"));
- if (!Common::parseBool(ConfMan.get("cheats"), _cheatsEnabled))
- error("Failed to parse bool from cheats options");
-
Graphics::ModeList modes;
modes.push_back(Graphics::Mode(640, 480));
modes.push_back(Graphics::Mode(320, 200));
@@ -123,6 +124,7 @@ Common::Error HypnoEngine::run() {
_compositeSurface = new Graphics::ManagedSurface();
_compositeSurface->create(_screenW, _screenH, _pixelFormat);
+ loadFont(""); // TODO
// Main event loop
loadAssets();
@@ -250,6 +252,21 @@ void HypnoEngine::loadGame(const Common::String &nextLevel, int puzzleDifficulty
error("Function \"%s\" not implemented", __FUNCTION__);
}
+void HypnoEngine::loadFont(const Filename &name) {
+ // TODO: properly load some font
+ if (_font)
+ error("Font already loaded");
+
+ _font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
+}
+
+void HypnoEngine::drawString(const Common::String &str, int x, int y, int w, uint32 c) {
+ if (!_font)
+ error("No font was loaded");
+
+ _font->drawString(_compositeSurface, str, x, y, w, c);
+}
+
void HypnoEngine::loadImage(const Common::String &name, int x, int y, bool transparent, bool palette, int frameNumber) {
debugC(1, kHypnoDebugMedia, "%s(%s, %d, %d, %d)", __FUNCTION__, name.c_str(), x, y, transparent);
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 1324dbb45bd..2d510addeee 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -240,6 +240,9 @@ public:
Frames _playerFrames;
int _playerFrameIdx;
int _playerFrameSep;
+
+ void loadFont(const Filename &name);
+ void drawString(const Common::String &str, int x, int y, int w, uint32 c);
const Graphics::Font *_font;
// Conversation
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index 7eee0119d4d..7eb05704b05 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -185,7 +185,7 @@ void SpiderEngine::drawHealth() {
c = 252; // blue
_compositeSurface->frameRect(r, c);
- _font->drawString(_compositeSurface, "ENERGY", 248, 180, 38, c);
+ drawString("ENERGY", 248, 180, 38, c);
}
bool SpiderEngine::checkArcadeLevelCompleted(MVideo &background) {
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 2e5dda6084a..6dc9c19a148 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -47,7 +47,7 @@ void WetEngine::drawPlayer() {
if (_playerFrameIdx < _playerFrameSep) {
// TARGET ACQUIRED frame
- uint32 c = _pixelFormat.RGBToColor(32, 208, 32);
+ uint32 c = 251;
_compositeSurface->drawLine(113, 1, 119, 1, c);
_compositeSurface->drawLine(200, 1, 206, 1, c);
@@ -61,7 +61,7 @@ void WetEngine::drawPlayer() {
Common::Point mousePos = g_system->getEventManager()->getMousePos();
int i = detectTarget(mousePos);
if (i > 0)
- _font->drawString(_compositeSurface, "TARGET ACQUIRED", 120, 1, 80, c);
+ drawString("TARGET ACQUIRED", 120, 1, 80, c);
_playerFrameIdx++;
_playerFrameIdx = _playerFrameIdx % _playerFrameSep;
@@ -75,16 +75,16 @@ void WetEngine::drawPlayer() {
}
void WetEngine::drawHealth() {
- uint32 c = _pixelFormat.RGBToColor(252, 252, 0);
+ uint32 c = 253; //_pixelFormat.RGBToColor(252, 252, 0);
int p = (100 * _health) / _maxHealth;
int s = _score;
if (_playerFrameIdx < _playerFrameSep) {
const chapterEntry *entry = _chapterTable[_levelId];
//uint32 id = _levelId;
- _font->drawString(_compositeSurface, Common::String::format("ENERGY %d%%", p), entry->energyPos[0], entry->energyPos[1], 65, c);
- _font->drawString(_compositeSurface, Common::String::format("SCORE %04d", s), entry->scorePos[0], entry->scorePos[1], 72, c);
+ drawString(Common::String::format("ENERGY %d%%", p), entry->energyPos[0], entry->energyPos[1], 65, c);
+ drawString(Common::String::format("SCORE %04d", s), entry->scorePos[0], entry->scorePos[1], 72, c);
// Objectives are always in the zero in the demo
- //_font->drawString(_compositeSurface, Common::String::format("M.O. 0/0"), uiPos[id][2][0], uiPos[id][2][1], 60, c);
+ //drawString(Common::String::format("M.O. 0/0"), uiPos[id][2][0], uiPos[id][2][1], 60, c);
}
}
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index f6043356e55..790bdf53bb1 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -220,6 +220,9 @@ void WetEngine::loadAssetsFullGame() {
loadArcadeLevel("c112.mi_", "c20", "");
_levels["c112.mi_"]->intros.push_front("c_misc/intros.smk");
+ loadArcadeLevel("c100.mi_", "", "");
+ assert(0);
+
loadArcadeLevel("c200.mi_", "???", "");
loadArcadeLevel("c201.mi_", "???", "");
loadArcadeLevel("c202.mi_", "???", "");
@@ -248,14 +251,13 @@ void WetEngine::runCode(Code *code) {
void WetEngine::runMainMenu(Code *code) {
Common::Event event;
- _font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
uint32 c = 252; // green
byte *palette;
Graphics::Surface *frame = decodeFrame("c_misc/menus.smk", 16, &palette);
loadPalette(palette, 0, 256);
Common::String _name = "";
drawImage(*frame, 0, 0, true);
- _font->drawString(_compositeSurface, "ENTER NAME :", 48, 50, 100, c);
+ drawString("ENTER NAME :", 48, 50, 100, c);
while (!shouldQuit()) {
while (g_system->getEventManager()->pollEvent(event)) {
@@ -278,8 +280,8 @@ void WetEngine::runMainMenu(Code *code) {
}
drawImage(*frame, 0, 0, false);
- _font->drawString(_compositeSurface, "ENTER NAME :", 48, 50, 100, c);
- _font->drawString(_compositeSurface, _name, 140, 50, 170, c);
+ drawString("ENTER NAME :", 48, 50, 100, c);
+ drawString(_name, 140, 50, 170, c);
break;
Commit: 2c1e4effb087b09f5ca5a1ef4b418c1f270bb704
https://github.com/scummvm/scummvm/commit/2c1e4effb087b09f5ca5a1ef4b418c1f270bb704
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-22T21:30:59+01:00
Commit Message:
HYPNO: correctly draw menus during puzzles in spider
Changed paths:
engines/hypno/spider/hard.cpp
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 2f756712a58..dc1b006457d 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -96,7 +96,7 @@ void SpiderEngine::runMatrix(Code *code) {
menu = decodeFrame("int_main/hint1.smk", 0);
menuArea = Common::Rect(0, 0, menu->w, menu->h);
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
while (!shouldQuit() && _nextLevel.empty()) {
@@ -330,7 +330,7 @@ void SpiderEngine::runNote(Code *code) {
Graphics::Surface *menu = decodeFrame("int_main/hint1.smk", 0);
Common::Rect menuArea(0, 0, menu->w, menu->h);
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
while (!shouldQuit() && _nextLevel.empty()) {
@@ -422,7 +422,7 @@ void SpiderEngine::runNote(Code *code) {
}
o2x = o2x + size.x;
}
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
break;
default:
@@ -646,7 +646,7 @@ void SpiderEngine::runFileCabinet(Code *code) {
_intros[intro] = true;
}
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
while (!shouldQuit() && _nextLevel.empty()) {
@@ -710,7 +710,7 @@ void SpiderEngine::runFileCabinet(Code *code) {
for (int i = 0; i < 6; i++) {
drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
}
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
break;
case Common::EVENT_RBUTTONDOWN:
@@ -776,7 +776,7 @@ void SpiderEngine::runLock(Code *code) {
MVideo *v = nullptr;
Graphics::Surface *menu = decodeFrame("int_main/hint1.smk", 0);
Common::Rect menuArea(0, 0, menu->w, menu->h);
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
while (!shouldQuit() && _nextLevel.empty()) {
@@ -838,7 +838,7 @@ void SpiderEngine::runLock(Code *code) {
for (int i = 0; i < 5; i++) {
drawImage(*nums[comb[i]], sel[i].left, sel[i].top, true);
}
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
break;
default:
@@ -915,7 +915,7 @@ void SpiderEngine::runFuseBox(Code *code) {
Frames fuses = decodeFrames("movie2/onoffuse.smk");
Graphics::Surface *menu = decodeFrame("int_main/hint1.smk", 0);
Common::Rect menuArea(0, 0, menu->w, menu->h);
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
while (!shouldQuit() && _nextLevel.empty()) {
@@ -1008,7 +1008,7 @@ void SpiderEngine::runFuseBox(Code *code) {
}
}
}
- drawImage(*menu, 0, 0, true);
+ drawImage(*menu, 0, 0, false);
break;
default:
More information about the Scummvm-git-logs
mailing list