[Scummvm-git-logs] scummvm master -> 25ca37c0554a6a694708c3b3d8d0c408ba3e2cbd
neuromancer
noreply at scummvm.org
Sat Apr 29 11:50:10 UTC 2023
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:
28cd362306 FREESCAPE: allow to reset color pairs, useful in castle EGA
e23235bf12 FREESCAPE: improved rendering of rectangles and fixes
25ca37c055 FREESCAPE: disallow zero length conditions
Commit: 28cd3623062d405cdfb32ab1e48b531423ed44aa
https://github.com/scummvm/scummvm/commit/28cd3623062d405cdfb32ab1e48b531423ed44aa
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-04-29T13:51:01+02:00
Commit Message:
FREESCAPE: allow to reset color pairs, useful in castle EGA
Changed paths:
engines/freescape/games/castle.cpp
engines/freescape/gfx.cpp
engines/freescape/gfx.h
diff --git a/engines/freescape/games/castle.cpp b/engines/freescape/games/castle.cpp
index 505c6bfd86a..7943c1a7578 100644
--- a/engines/freescape/games/castle.cpp
+++ b/engines/freescape/games/castle.cpp
@@ -208,6 +208,7 @@ void CastleEngine::gotoArea(uint16 areaID, int entranceID) {
playSound(5, false);
// Ignore sky/ground fields
_gfx->_keyColor = 0;
+ _gfx->clearColorPairArray();
_gfx->_colorPair[_currentArea->_underFireBackgroundColor] = _currentArea->_extraColor[0];
_gfx->_colorPair[_currentArea->_usualBackgroundColor] = _currentArea->_extraColor[1];
diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp
index dd2680a18c6..2bd751230d2 100644
--- a/engines/freescape/gfx.cpp
+++ b/engines/freescape/gfx.cpp
@@ -126,6 +126,11 @@ byte getCGAStipple(byte x, int back, int fore) {
return st;
}
+void Renderer::clearColorPairArray() {
+ for (int i = 0; i < 15; i++)
+ _colorPair[i] = 0;
+}
+
void Renderer::fillColorPairArray() {
for (int i = 4; i < 15; i++) {
byte *entry = (*_colorMap)[i];
diff --git a/engines/freescape/gfx.h b/engines/freescape/gfx.h
index 047cb82589f..7e38d4d7812 100644
--- a/engines/freescape/gfx.h
+++ b/engines/freescape/gfx.h
@@ -119,6 +119,7 @@ public:
void setColorMap(ColorMap *colorMap_);
ColorMap *_colorMap;
ColorReMap *_colorRemaps;
+ void clearColorPairArray();
void fillColorPairArray();
byte _colorPair[16];
int _keyColor;
Commit: e23235bf126df65501f508852f6a1572cc803a8a
https://github.com/scummvm/scummvm/commit/e23235bf126df65501f508852f6a1572cc803a8a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-04-29T13:51:01+02:00
Commit Message:
FREESCAPE: improved rendering of rectangles and fixes
Changed paths:
engines/freescape/gfx.cpp
diff --git a/engines/freescape/gfx.cpp b/engines/freescape/gfx.cpp
index 2bd751230d2..5ce2d991485 100644
--- a/engines/freescape/gfx.cpp
+++ b/engines/freescape/gfx.cpp
@@ -829,15 +829,6 @@ void Renderer::renderRectangle(const Math::Vector3d &origin, const Math::Vector3
vertices.push_back(Math::Vector3d(origin.x() + dx, origin.y() + dy, origin.z() + dz));
vertices.push_back(Math::Vector3d(origin.x() + size.x(), origin.y() + size.y(), origin.z() + size.z()));
- renderFace(vertices);
- if (r1 != r2 || g1 != g2 || b1 != b2) {
- useStipple(true);
- useColor(r2, g2, b2);
- renderFace(vertices);
- useStipple(false);
- }
-
- vertices.clear();
vertices.push_back(Math::Vector3d(origin.x(), origin.y(), origin.z()));
dx = dy = dz = 0.0;
@@ -947,7 +938,7 @@ void Renderer::drawBackground(uint8 color) {
if (!render)
r1 = g1 = b1 = 0;
- assert(stipple == nullptr); // Unclear if this is ever used
+ //assert(stipple == nullptr); // Unclear if this is ever used
clear(r1, g1, b1);
}
Commit: 25ca37c0554a6a694708c3b3d8d0c408ba3e2cbd
https://github.com/scummvm/scummvm/commit/25ca37c0554a6a694708c3b3d8d0c408ba3e2cbd
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-04-29T13:51:01+02:00
Commit Message:
FREESCAPE: disallow zero length conditions
Changed paths:
engines/freescape/loaders/8bitBinaryLoader.cpp
diff --git a/engines/freescape/loaders/8bitBinaryLoader.cpp b/engines/freescape/loaders/8bitBinaryLoader.cpp
index e5265274b59..35f44a3225b 100644
--- a/engines/freescape/loaders/8bitBinaryLoader.cpp
+++ b/engines/freescape/loaders/8bitBinaryLoader.cpp
@@ -534,11 +534,13 @@ Area *FreescapeEngine::load8bitArea(Common::SeekableReadStream *file, uint16 nco
uint32 lengthOfCondition = readField(file, 8);
debugC(1, kFreescapeDebugParser, "length of condition: %d", lengthOfCondition);
// get the condition
- Common::Array<uint8> conditionArray = readArray(file, lengthOfCondition);
- Common::String conditionSource = detokenise8bitCondition(conditionArray, instructions);
- area->_conditions.push_back(instructions);
- area->_conditionSources.push_back(conditionSource);
- debugC(1, kFreescapeDebugParser, "%s", conditionSource.c_str());
+ if (lengthOfCondition > 0) {
+ Common::Array<uint8> conditionArray = readArray(file, lengthOfCondition);
+ Common::String conditionSource = detokenise8bitCondition(conditionArray, instructions);
+ area->_conditions.push_back(instructions);
+ area->_conditionSources.push_back(conditionSource);
+ debugC(1, kFreescapeDebugParser, "%s", conditionSource.c_str());
+ }
}
debugC(1, kFreescapeDebugParser, "End of area at %lx", file->pos());
@@ -625,12 +627,13 @@ void FreescapeEngine::load8bitBinary(Common::SeekableReadStream *file, int offse
uint32 lengthOfCondition = readField(file, 8);
debugC(1, kFreescapeDebugParser, "length of condition: %d at %lx", lengthOfCondition, file->pos());
// get the condition
- Common::Array<uint8> conditionArray = readArray(file, lengthOfCondition);
- // debug("Global condition %d", numConditions + 1);
- Common::String conditionSource = detokenise8bitCondition(conditionArray, instructions);
- _conditions.push_back(instructions);
- _conditionSources.push_back(conditionSource);
- debugC(1, kFreescapeDebugParser, "%s", conditionSource.c_str());
+ if (lengthOfCondition > 0) {
+ Common::Array<uint8> conditionArray = readArray(file, lengthOfCondition);
+ Common::String conditionSource = detokenise8bitCondition(conditionArray, instructions);
+ _conditions.push_back(instructions);
+ _conditionSources.push_back(conditionSource);
+ debugC(1, kFreescapeDebugParser, "%s", conditionSource.c_str());
+ }
}
if (isDriller()) {
More information about the Scummvm-git-logs
mailing list