[Scummvm-git-logs] scummvm master -> a445e98f28b23849c27b9c1f5ed7719f77de1731
neuromancer
noreply at scummvm.org
Mon Nov 14 21:57:26 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:
1caddc1c29 FREESCAPE: UI fixes in driller
7d873d698e FREESCAPE: parse all fixed fields of the sensors and introduced group objects
a445e98f28 FREESCAPE: parse conditions in sensors
Commit: 1caddc1c2926c59c019baf4d3951c9e0a7b53008
https://github.com/scummvm/scummvm/commit/1caddc1c2926c59c019baf4d3951c9e0a7b53008
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-14T22:58:28+01:00
Commit Message:
FREESCAPE: UI fixes in driller
Changed paths:
engines/freescape/games/driller.cpp
diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 48a10412e95..bd000ef5666 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -369,7 +369,7 @@ void DrillerEngine::drawDOSUI(Graphics::Surface *surface) {
uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
int score = _gameStateVars[k8bitVariableScore];
- drawStringInSurface(_currentArea->_name, 195, 185, yellow, black, surface);
+ drawStringInSurface(_currentArea->_name, 196, 185, yellow, black, surface);
drawStringInSurface(Common::String::format("%04d", 2 * int(_position.x())), 150, 145, yellow, black, surface);
drawStringInSurface(Common::String::format("%04d", 2 * int(_position.z())), 150, 153, yellow, black, surface);
drawStringInSurface(Common::String::format("%04d", 2 * int(_position.y())), 150, 161, yellow, black, surface);
@@ -379,7 +379,7 @@ void DrillerEngine::drawDOSUI(Graphics::Surface *surface) {
drawStringInSurface(Common::String::format("%s", "J"), 57, 161, yellow, black, surface);
drawStringInSurface(Common::String::format("%3d", _playerSteps[_playerStepIndex]), 46, 153, yellow, black, surface);
- drawStringInSurface(Common::String::format("%07d", score), 240, 129, yellow, black, surface);
+ drawStringInSurface(Common::String::format("%07d", score), 238, 129, yellow, black, surface);
int hours = _countdown / 3600;
drawStringInSurface(Common::String::format("%02d", hours), 208, 8, yellow, black, surface);
@@ -392,7 +392,7 @@ void DrillerEngine::drawDOSUI(Graphics::Surface *surface) {
int deadline;
getLatestMessages(message, deadline);
if (deadline <= _countdown) {
- drawStringInSurface(message, 191, 177, black, yellow, surface);
+ drawStringInSurface(message, 190, 177, black, yellow, surface);
_temporaryMessages.push_back(message);
_temporaryMessageDeadlines.push_back(deadline);
} else {
@@ -484,6 +484,8 @@ void DrillerEngine::pressedKey(const int keycode) {
insertTemporaryMessage(_messagesList[5], _countdown - 4);
Common::String successMessage = _messagesList[6];
successMessage.replace(0, 4, Common::String::format("%d", int(success)));
+ while (successMessage.size() < 14)
+ successMessage += " ";
insertTemporaryMessage(successMessage, _countdown - 6);
if (success >= 50.0) {
_drilledAreas[_currentArea->getAreaID()] = kDrillerRigInPlace;
Commit: 7d873d698ee1f714cfecfeac27c3211bae05c0b4
https://github.com/scummvm/scummvm/commit/7d873d698ee1f714cfecfeac27c3211bae05c0b4
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-14T22:58:28+01:00
Commit Message:
FREESCAPE: parse all fixed fields of the sensors and introduced group objects
Changed paths:
A engines/freescape/objects/group.h
engines/freescape/loaders/8bitBinaryLoader.cpp
engines/freescape/objects/sensor.h
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index cf017203c86..e4f7f24d28a 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -27,6 +27,7 @@
#include "freescape/freescape.h"
#include "freescape/language/8bitDetokeniser.h"
#include "freescape/objects/global.h"
+#include "freescape/objects/group.h"
#include "freescape/objects/sensor.h"
namespace Freescape {
@@ -212,6 +213,23 @@ Object *FreescapeEngine::load8bitObject(Common::SeekableReadStream *file) {
case kSensorType: {
debugC(1, kFreescapeDebugParser, "rotation: %f %f %f", v.x(), v.y(), v.z());
+ if (isCastle()) { // TODO
+ return new Sensor(
+ objectID,
+ 32 * position,
+ 5 * v,
+ 0,
+ 0,
+ 0,
+ 0);
+ }
+
+ assert(byteSizeOfObject >= 5);
+ byte color = readField(file, 8);
+ byte firingInterval = readField(file, 8);
+ uint16 firingRange = readField(file, 16);
+ byte sensorFlags = readField(file, 8);
+ byteSizeOfObject = byteSizeOfObject - 5;
if (byteSizeOfObject > 0) {
// TODO: there is something here
debugC(1, kFreescapeDebugParser, "Warning: extra %d bytes in sensor", byteSizeOfObject);
@@ -225,13 +243,17 @@ Object *FreescapeEngine::load8bitObject(Common::SeekableReadStream *file) {
return new Sensor(
objectID,
32 * position,
- 5 * v); // rotation
+ 5 * v, // rotation?
+ color,
+ firingInterval,
+ firingRange,
+ sensorFlags);
} break;
case kGroupType:
debugC(1, kFreescapeDebugParser, "Object of type 'group'");
file->seek(byteSizeOfObject, SEEK_CUR);
- return new Sensor(
+ return new Group(
objectID,
position,
v);
diff --git a/engines/freescape/objects/group.h b/engines/freescape/objects/group.h
new file mode 100644
index 00000000000..514ca33542d
--- /dev/null
+++ b/engines/freescape/objects/group.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef FREESCAPE_GROUP_H
+#define FREESCAPE_GROUP_H
+
+#include "freescape/objects/object.h"
+
+namespace Freescape {
+
+class Group : public Object {
+public:
+ Group(uint16 objectID_,
+ const Math::Vector3d &origin_,
+ const Math::Vector3d &rotation_) {
+ _objectID = objectID_;
+ _origin = origin_;
+ _rotation = rotation_;
+ }
+
+ ObjectType getType() override { return ObjectType::kGroupType; };
+ void draw(Freescape::Renderer *gfx) override { error("cannot render Group"); };
+ void scale(int factor) override { warning("cannot scale Group"); };
+ Object *duplicate() override { error("cannot duplicate Group"); };
+};
+
+} // End of namespace Freescape
+
+#endif // FREESCAPE_GLOBAL_H
diff --git a/engines/freescape/objects/sensor.h b/engines/freescape/objects/sensor.h
index 75a71c3a762..363e34825b9 100644
--- a/engines/freescape/objects/sensor.h
+++ b/engines/freescape/objects/sensor.h
@@ -34,18 +34,28 @@ public:
Sensor(
uint16 objectID_,
const Math::Vector3d &origin_,
- const Math::Vector3d &rotation_) {
+ const Math::Vector3d &rotation_,
+ byte color_,
+ byte firingInterval_,
+ uint16 firingRange_,
+ uint16 flags_) {
_objectID = objectID_;
_origin = origin_;
_rotation = rotation_;
- _flags = 0;
+ _color = color_;
+ _firingInterval = firingInterval_;
+ _firingRange = firingRange_;
+ _flags = flags_;
}
+ byte _color;
+ byte _firingInterval;
+ uint16 _firingRange;
virtual ~Sensor() {}
bool isDrawable() override { return false; }
bool isPlanar() override { return true; }
void scale(int factor) override { _origin = _origin / factor; };
- Object *duplicate() override { return (new Sensor(_objectID, _origin, _rotation)); };
+ Object *duplicate() override { return (new Sensor(_objectID, _origin, _rotation, _color, _firingInterval, _firingRange, _flags)); };
ObjectType getType() override { return kSensorType; };
Math::Vector3d getRotation() { return _rotation; }
Commit: a445e98f28b23849c27b9c1f5ed7719f77de1731
https://github.com/scummvm/scummvm/commit/a445e98f28b23849c27b9c1f5ed7719f77de1731
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-11-14T22:58:28+01:00
Commit Message:
FREESCAPE: parse conditions in sensors
Changed paths:
engines/freescape/loaders/8bitBinaryLoader.cpp
engines/freescape/objects/sensor.h
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index e4f7f24d28a..c57cdff9ac3 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -213,6 +213,9 @@ Object *FreescapeEngine::load8bitObject(Common::SeekableReadStream *file) {
case kSensorType: {
debugC(1, kFreescapeDebugParser, "rotation: %f %f %f", v.x(), v.y(), v.z());
+ FCLInstructionVector instructions;
+ Common::String conditionSource;
+
if (isCastle()) { // TODO
return new Sensor(
objectID,
@@ -221,7 +224,9 @@ Object *FreescapeEngine::load8bitObject(Common::SeekableReadStream *file) {
0,
0,
0,
- 0);
+ 0,
+ instructions,
+ conditionSource);
}
assert(byteSizeOfObject >= 5);
@@ -230,14 +235,12 @@ Object *FreescapeEngine::load8bitObject(Common::SeekableReadStream *file) {
uint16 firingRange = readField(file, 16);
byte sensorFlags = readField(file, 8);
byteSizeOfObject = byteSizeOfObject - 5;
- if (byteSizeOfObject > 0) {
- // TODO: there is something here
- debugC(1, kFreescapeDebugParser, "Warning: extra %d bytes in sensor", byteSizeOfObject);
- for (int i = 0; i < byteSizeOfObject; i++)
- readField(file, 8);
- byteSizeOfObject = 0;
+ // grab the object condition, if there is one
+ if (byteSizeOfObject) {
+ Common::Array<uint8> conditionArray = readArray(file, byteSizeOfObject);
+ conditionSource = detokenise8bitCondition(conditionArray, instructions);
+ debugC(1, kFreescapeDebugParser, "%s", conditionSource.c_str());
}
- assert(byteSizeOfObject == 0);
debugC(1, kFreescapeDebugParser, "End of object at %lx", file->pos());
// create an entrance
return new Sensor(
@@ -247,7 +250,9 @@ Object *FreescapeEngine::load8bitObject(Common::SeekableReadStream *file) {
color,
firingInterval,
firingRange,
- sensorFlags);
+ sensorFlags,
+ instructions,
+ conditionSource);
} break;
case kGroupType:
diff --git a/engines/freescape/objects/sensor.h b/engines/freescape/objects/sensor.h
index 363e34825b9..8bc2190a771 100644
--- a/engines/freescape/objects/sensor.h
+++ b/engines/freescape/objects/sensor.h
@@ -26,6 +26,7 @@
#define FREESCAPE_SENSOR_H
#include "freescape/objects/object.h"
+#include "freescape/language/instruction.h"
namespace Freescape {
@@ -38,7 +39,9 @@ public:
byte color_,
byte firingInterval_,
uint16 firingRange_,
- uint16 flags_) {
+ uint16 flags_,
+ FCLInstructionVector condition_,
+ Common::String conditionSource_) {
_objectID = objectID_;
_origin = origin_;
_rotation = rotation_;
@@ -46,16 +49,21 @@ public:
_firingInterval = firingInterval_;
_firingRange = firingRange_;
_flags = flags_;
+ _conditionSource = conditionSource_;
+ _condition = condition_;
}
byte _color;
byte _firingInterval;
uint16 _firingRange;
+ Common::String _conditionSource;
+ FCLInstructionVector _condition;
+
virtual ~Sensor() {}
bool isDrawable() override { return false; }
bool isPlanar() override { return true; }
void scale(int factor) override { _origin = _origin / factor; };
- Object *duplicate() override { return (new Sensor(_objectID, _origin, _rotation, _color, _firingInterval, _firingRange, _flags)); };
+ Object *duplicate() override { return (new Sensor(_objectID, _origin, _rotation, _color, _firingInterval, _firingRange, _flags, _condition, _conditionSource)); };
ObjectType getType() override { return kSensorType; };
Math::Vector3d getRotation() { return _rotation; }
More information about the Scummvm-git-logs
mailing list