[Scummvm-git-logs] scummvm master -> 137554d72c22ec5f45457c3dc7ebb777e6d4dd7a
neuromancer
noreply at scummvm.org
Sat Dec 3 11:18:22 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:
cdd7ef737d FREESCAPE: add cheat to disable sensors
310768bdf5 FREESCAPE: show xyz in ui of amiga/atari driller
137554d72c FREESCAPE: clear old messages before pushing new ones in driller
Commit: cdd7ef737dd4964feaf426f8e4b562de32b83436
https://github.com/scummvm/scummvm/commit/cdd7ef737dd4964feaf426f8e4b562de32b83436
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-03T12:19:22+01:00
Commit Message:
FREESCAPE: add cheat to disable sensors
Changed paths:
engines/freescape/detection.cpp
engines/freescape/detection.h
engines/freescape/freescape.cpp
engines/freescape/freescape.h
engines/freescape/metaengine.cpp
diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index a210c72ab29..7644de4b346 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -252,7 +252,7 @@ static const DebugChannelDef debugFlagList[] = {
class FreescapeMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
FreescapeMetaEngineDetection() : AdvancedMetaEngineDetection(Freescape::gameDescriptions, sizeof(ADGameDescription), Freescape::freescapeGames) {
- _guiOptions = GUIO4(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_EXTENDED_TIMER, GAMEOPTION_DISABLE_DEMO_MODE);
+ _guiOptions = GUIO5(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_EXTENDED_TIMER, GAMEOPTION_DISABLE_DEMO_MODE, GAMEOPTION_DISABLE_SENSORS);
}
const char *getName() const override {
diff --git a/engines/freescape/detection.h b/engines/freescape/detection.h
index 85c4034d9f0..c65fbd84f13 100644
--- a/engines/freescape/detection.h
+++ b/engines/freescape/detection.h
@@ -26,9 +26,10 @@
#define GAMEOPTION_PRERECORDED_SOUNDS GUIO_GAMEOPTIONS1
#define GAMEOPTION_EXTENDED_TIMER GUIO_GAMEOPTIONS2
#define GAMEOPTION_DISABLE_DEMO_MODE GUIO_GAMEOPTIONS3
+#define GAMEOPTION_DISABLE_SENSORS GUIO_GAMEOPTIONS4
// Driller options
-#define GAMEOPTION_AUTOMATIC_DRILLING GUIO_GAMEOPTIONS4
+#define GAMEOPTION_AUTOMATIC_DRILLING GUIO_GAMEOPTIONS5
#endif
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 208275f5c48..ff69bced520 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -62,6 +62,9 @@ FreescapeEngine::FreescapeEngine(OSystem *syst, const ADGameDescription *gd)
if (!Common::parseBool(ConfMan.get("disable_demo_mode"), _disableDemoMode))
error("Failed to parse bool from disable_demo_mode option");
+ if (!Common::parseBool(ConfMan.get("disable_sensors"), _disableSensors))
+ error("Failed to parse bool from disable_sensors option");
+
_startArea = 0;
_startEntrance = 0;
_currentArea = nullptr;
@@ -233,6 +236,8 @@ void FreescapeEngine::centerCrossair() {
bool FreescapeEngine::checkSensors() {
bool frameRedrawed = false;
+ if (_disableSensors)
+ return frameRedrawed;
for (auto &it : _sensors) {
Sensor *sensor = (Sensor *)it;
if (sensor->isDestroyed() || sensor->isInvisible())
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 7236877ccef..4a31911f665 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -325,6 +325,7 @@ public:
// Cheats
bool _useExtendedTimer;
+ bool _disableSensors;
};
enum DrillerReleaseFlags {
diff --git a/engines/freescape/metaengine.cpp b/engines/freescape/metaengine.cpp
index 4a57fb9ae49..ec9386367da 100644
--- a/engines/freescape/metaengine.cpp
+++ b/engines/freescape/metaengine.cpp
@@ -73,7 +73,17 @@ static const ADExtraGuiOptionsMap optionsList[] = {
0
}
},
-
+ {
+ GAMEOPTION_DISABLE_SENSORS,
+ {
+ _s("Disable sensors"),
+ _s("Sensors will not shoot the player"),
+ "disable_sensors",
+ false,
+ 0,
+ 0
+ }
+ },
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
Commit: 310768bdf5e691700f9f15ecc75f302360463a70
https://github.com/scummvm/scummvm/commit/310768bdf5e691700f9f15ecc75f302360463a70
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-03T12:19:22+01:00
Commit Message:
FREESCAPE: show xyz in ui of amiga/atari driller
Changed paths:
engines/freescape/freescape.cpp
engines/freescape/freescape.h
engines/freescape/games/driller.cpp
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index ff69bced520..70be19346b4 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -621,7 +621,7 @@ bool FreescapeEngine::hasFeature(EngineFeature f) const {
(f == kSupportsArbitraryResolutions && !softRenderer);
}
-void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int y, uint32 fontColor, uint32 backColor, Graphics::Surface *surface) {
+void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int y, uint32 fontColor, uint32 backColor, Graphics::Surface *surface, int offset) {
if (!_fontLoaded)
return;
Common::String ustr = str;
@@ -632,7 +632,7 @@ void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int
assert(ustr[c] >= 32);
for (int j = 0; j < 6; j++) {
for (int i = 0; i < 8; i++) {
- if (_font.get(48 * (ustr[c] - 32) + 1 + j * 8 + i))
+ if (_font.get(48 * (offset + ustr[c] - 32) + 1 + j * 8 + i))
surface->setPixel(x + 8 - i + 8 * c, y + j, fontColor);
else
surface->setPixel(x + 8 - i + 8 * c, y + j, backColor);
@@ -642,7 +642,7 @@ void FreescapeEngine::drawStringInSurface(const Common::String &str, int x, int
} else if (isAmiga() || isAtariST()) {
for (uint32 c = 0; c < ustr.size(); c++) {
assert(ustr[c] >= 32);
- int position = 8 * (33*(ustr[c] - 32) + 1);
+ int position = 8 * (33*(offset + ustr[c] - 32) + 1);
for (int j = 0; j < 8; j++) {
for (int i = 0; i < 8; i++) {
if (_font.get(position + j * 32 + i))
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 4a31911f665..00bd2650ddb 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -293,7 +293,7 @@ public:
Common::StringArray _currentEphymeralMessages;
Common::BitArray _font;
bool _fontLoaded;
- void drawStringInSurface(const Common::String &str, int x, int y, uint32 fontColor, uint32 backColor, Graphics::Surface *surface);
+ void drawStringInSurface(const Common::String &str, int x, int y, uint32 fontColor, uint32 backColor, Graphics::Surface *surface, int offset = 0);
// Game state
virtual void initGameState();
diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index cdbfbe98f5f..fb422500d38 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -473,12 +473,31 @@ void DrillerEngine::drawDOSUI(Graphics::Surface *surface) {
}
void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
+ uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0x55);
uint32 brownish = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x9E, 0x80, 0x20);
uint32 brown = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x7E, 0x60, 0x19);
uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
+ uint32 transparent = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
int score = _gameStateVars[k8bitVariableScore];
+ Common::String coords;
+
+ drawStringInSurface("x", 37, 18, white, transparent, surface, 82);
+ coords = Common::String::format("%04d", 2 * int(_position.x()));
+ for (int i = 0; i < 4; i++)
+ drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 18, white, transparent, surface, 112);
+
+ drawStringInSurface("y", 37, 26, white, transparent, surface, 82);
+ coords = Common::String::format("%04d", 2 * int(_position.z())); // Coords y and z are swapped!
+ for (int i = 0; i < 4; i++)
+ drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 26, white, transparent, surface, 112);
+
+ drawStringInSurface("z", 37, 34, white, transparent, surface, 82);
+ coords = Common::String::format("%04d", 2 * int(_position.y())); // Coords y and z are swapped!
+ for (int i = 0; i < 4; i++)
+ drawStringInSurface(Common::String(coords[i]), 47 + 6*i, 34, white, transparent, surface, 112);
+
drawStringInSurface(_currentArea->_name, 188, 185, yellow, black, surface);
drawStringInSurface(Common::String::format("%07d", score), 240, 129, yellow, black, surface);
Commit: 137554d72c22ec5f45457c3dc7ebb777e6d4dd7a
https://github.com/scummvm/scummvm/commit/137554d72c22ec5f45457c3dc7ebb777e6d4dd7a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-03T12:19:22+01:00
Commit Message:
FREESCAPE: clear old messages before pushing new ones in driller
Changed paths:
engines/freescape/freescape.cpp
engines/freescape/freescape.h
engines/freescape/games/driller.cpp
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 70be19346b4..be9deecd827 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -762,6 +762,11 @@ void FreescapeEngine::getLatestMessages(Common::String &message, int &deadline)
}
}
+void FreescapeEngine::clearTemporalMessages() {
+ _temporaryMessages.clear();
+ _temporaryMessageDeadlines.clear();
+}
+
byte *FreescapeEngine::getPaletteFromNeoImage(Common::SeekableReadStream *stream, int offset) {
stream->seek(offset);
NeoDecoder decoder;
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 00bd2650ddb..41e103c88d3 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -281,6 +281,7 @@ public:
// Text messages and Fonts
void insertTemporaryMessage(const Common::String message, int deadline);
void getLatestMessages(Common::String &message, int &deadline);
+ void clearTemporalMessages();
Common::StringArray _temporaryMessages;
Common::Array<int> _temporaryMessageDeadlines;
Common::StringArray _messagesList;
diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index fb422500d38..ec12a225e32 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -112,6 +112,7 @@ void DrillerEngine::gotoArea(uint16 areaID, int entranceID) {
}
debugC(1, kFreescapeDebugMove, "starting player position: %f, %f, %f", _position.x(), _position.y(), _position.z());
+ clearTemporalMessages();
playSound(5, false);
// Ignore sky/ground fields
_gfx->_keyColor = 0;
@@ -564,10 +565,13 @@ Math::Vector3d getProjectionToPlane(const Math::Vector3d &vect, const Math::Vect
void DrillerEngine::pressedKey(const int keycode) {
if (keycode == Common::KEYCODE_d) {
+ clearTemporalMessages();
Common::Point gasPocket = _currentArea->_gasPocketPosition;
uint32 gasPocketRadius = _currentArea->_gasPocketRadius;
- if (gasPocketRadius == 0)
+ if (gasPocketRadius == 0) {
+ insertTemporaryMessage(_messagesList[2], _countdown - 2);
return;
+ }
if (_flyMode) {
insertTemporaryMessage(_messagesList[8], _countdown - 2);
@@ -618,8 +622,11 @@ void DrillerEngine::pressedKey(const int keycode) {
_drilledAreas[_currentArea->getAreaID()] = kDrillerRigOutOfPlace;
} else if (keycode == Common::KEYCODE_c) {
uint32 gasPocketRadius = _currentArea->_gasPocketRadius;
- if (gasPocketRadius == 0)
+ clearTemporalMessages();
+ if (gasPocketRadius == 0) {
+ insertTemporaryMessage(_messagesList[2], _countdown - 2);
return;
+ }
if (_flyMode) {
insertTemporaryMessage(_messagesList[8], _countdown - 2);
@@ -867,16 +874,28 @@ void DrillerEngine::initGameState() {
bool DrillerEngine::checkIfGameEnded() {
if (_countdown <= 0) {
insertTemporaryMessage(_messagesList[14], _countdown - 2);
+ drawFrame();
+ _gfx->flipBuffer();
+ g_system->updateScreen();
+ g_system->delayMillis(2000);
gotoArea(127, 0);
}
if (_gameStateVars[k8bitVariableShield] == 0) {
insertTemporaryMessage(_messagesList[15], _countdown - 2);
+ drawFrame();
+ _gfx->flipBuffer();
+ g_system->updateScreen();
+ g_system->delayMillis(2000);
gotoArea(127, 0);
}
if (_gameStateVars[k8bitVariableEnergy] == 0) {
insertTemporaryMessage(_messagesList[16], _countdown - 2);
+ drawFrame();
+ _gfx->flipBuffer();
+ g_system->updateScreen();
+ g_system->delayMillis(2000);
gotoArea(127, 0);
}
More information about the Scummvm-git-logs
mailing list