[Scummvm-git-logs] scummvm master -> 892e122e1b519338ee74aa52f919cf20f36870a7
mgerhardy
martin.gerhardy at gmail.com
Mon Jan 25 23:00:01 UTC 2021
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
75d69c7741 TWINE: updated holomap text rendering
da8e40a311 TWINE: fixed key binding for holomap
937f3876b7 TWINE: fixed enableKeyMap call for holomap key bindings
1fba497b38 TWINE: fixed duplicated keys in bound keymaps for the holomap
b31b4c0546 TWINE: allow to fade in the holomap text without waiting for input in the text loop
892e122e1b TWINE: fixed clearing the text related rect for the holomap
Commit: 75d69c77411dfe32761396921a330e2658ca5ea6
https://github.com/scummvm/scummvm/commit/75d69c77411dfe32761396921a330e2658ca5ea6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-25T23:07:57+01:00
Commit Message:
TWINE: updated holomap text rendering
Changed paths:
engines/twine/holomap.cpp
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index ef3b9262c0..cba8019f99 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -334,7 +334,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
}
_engine->_screens->fadeToBlack(_engine->_screens->paletteRGBA);
_engine->_screens->fadeIn(_engine->_screens->paletteRGBA);
- _engine->setPalette(_engine->_screens->paletteRGBA);
+ //_engine->setPalette(_engine->_screens->paletteRGBA);
_engine->_gameState->initEngineProjections();
_engine->_interface->loadClip();
@@ -344,23 +344,9 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
}
void Holomap::drawHolomapLocation(int32 location) {
- char title[256] = "";
- _engine->_text->getMenuText(_locations[location].textIndex, title, sizeof(title));
- const int padding = 17;
- Common::Rect rect;
- rect.left = padding - 1;
- rect.top = _engine->height() - 146;
- rect.right = _engine->width() - padding;
- rect.bottom = _engine->height() - padding;
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
- _engine->_menu->drawBox(rect);
- rect.grow(-1);
- _engine->_interface->drawTransparentBox(rect, 3);
- _engine->_interface->blitBox(rect, _engine->frontVideoBuffer, _engine->workVideoBuffer);
- const int32 height = _engine->_text->getCharHeight(title[0]);
- drawHolomapText(rect.left + (rect.right - rect.left) / 2, rect.top + (rect.bottom - rect.top) / 2 - height / 2, title);
- rect.grow(1);
- _engine->copyBlockPhys(rect);
+ _engine->_text->textClipSmall();
+ _engine->_text->setFontCrossColor(COLOR_WHITE);
+ _engine->_text->drawTextFullscreen(_locations[location].textIndex);
}
int32 Holomap::getNextHolomapLocation(int32 currentLocation, int32 dir) const {
Commit: da8e40a3117f122d8a1b48df6a4da7be04a540e4
https://github.com/scummvm/scummvm/commit/da8e40a3117f122d8a1b48df6a4da7be04a540e4
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-25T23:28:27+01:00
Commit Message:
TWINE: fixed key binding for holomap
Changed paths:
engines/twine/holomap.cpp
engines/twine/metaengine.cpp
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index cba8019f99..c9d4adc4bf 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -448,7 +448,7 @@ void Holomap::processHolomap() {
_engine->_text->initTextBank(TextBankId::Inventory_Intro_and_Holomap);
_engine->_text->setFontCrossColor(9);
- drawHolomapText(_engine->width() / 2, 25, "HoloMap"); // TODO: fix the index
+ drawHolomapText(_engine->width() / 2, 25, "HoloMap");
int currentLocation = _engine->_scene->currentSceneIdx;
drawHolomapLocation(currentLocation);
_engine->flip();
diff --git a/engines/twine/metaengine.cpp b/engines/twine/metaengine.cpp
index 89f5f0f0ac..06c48774ec 100644
--- a/engines/twine/metaengine.cpp
+++ b/engines/twine/metaengine.cpp
@@ -464,9 +464,6 @@ Common::KeymapArray TwinEMetaEngine::initKeymaps(const char *target) const {
{
Keymap *holomapKeyMap = new Keymap(Keymap::kKeymapTypeGame, holomapKeyMapId, "Little Big Adventure Holomap");
- // TODO: CTRL + cursor rotates the globe
- // just cursor keys switch the quest locations and print the text for the current selected location.
-
act = new Action("ABORT", _("Abort"));
act->setCustomEngineActionEvent(TwinEActionType::HolomapAbort);
act->addDefaultInputMapping("ESCAPE");
@@ -506,12 +503,12 @@ Common::KeymapArray TwinEMetaEngine::initKeymaps(const char *target) const {
act = new Action("PREV", _("Previous location"));
act->setCustomEngineActionEvent(TwinEActionType::HolomapPrev);
- act->addDefaultInputMapping("RIGHT");
+ act->addDefaultInputMapping("LEFT");
holomapKeyMap->addAction(act);
act = new Action("NEXT", _("Next location"));
act->setCustomEngineActionEvent(TwinEActionType::HolomapNext);
- act->addDefaultInputMapping("LEFT");
+ act->addDefaultInputMapping("RIGHT");
holomapKeyMap->addAction(act);
array[3] = holomapKeyMap;
Commit: 937f3876b7434b928b4c797b9c71b595acb8d6aa
https://github.com/scummvm/scummvm/commit/937f3876b7434b928b4c797b9c71b595acb8d6aa
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-25T23:30:28+01:00
Commit Message:
TWINE: fixed enableKeyMap call for holomap key bindings
Changed paths:
engines/twine/input.cpp
diff --git a/engines/twine/input.cpp b/engines/twine/input.cpp
index 11d38b8c2b..d9dd746765 100644
--- a/engines/twine/input.cpp
+++ b/engines/twine/input.cpp
@@ -108,7 +108,7 @@ void Input::enableKeyMap(const char *id) {
const Common::KeymapArray &keymaps = keymapper->getKeymaps();
for (Common::Keymap *keymap : keymaps) {
const Common::String& keymapId = keymap->getId();
- if (keymapId == mainKeyMapId || keymapId == uiKeyMapId || keymapId == cutsceneKeyMapId) {
+ if (keymapId == mainKeyMapId || keymapId == uiKeyMapId || keymapId == cutsceneKeyMapId || keymapId == holomapKeyMapId) {
keymap->setEnabled(keymapId == id);
}
}
Commit: 1fba497b38f789cd87b0704e7bf1c658f7e44980
https://github.com/scummvm/scummvm/commit/1fba497b38f789cd87b0704e7bf1c658f7e44980
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-25T23:42:14+01:00
Commit Message:
TWINE: fixed duplicated keys in bound keymaps for the holomap
Changed paths:
engines/twine/holomap.cpp
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index c9d4adc4bf..39c0b98506 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -252,7 +252,6 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
const Holomap::TrajectoryData &data = loadTrajectoryData(trajectoryIndex);
ScopedEngineFreeze timeFreeze(_engine);
- ScopedKeyMap holomapKeymap(_engine, holomapKeyMapId);
_engine->_renderer->setCameraPosition(400, 240, 128, 1024, 1024);
renderHolomapSurfacePolygons();
@@ -275,6 +274,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
int32 local18 = 0;
bool fadeInPalette = true;
+ _engine->_input->enableKeyMap(holomapKeyMapId);
for (;;) {
ScopedFPS scopedFps;
_engine->readKeys();
@@ -339,6 +339,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
_engine->_interface->loadClip();
_engine->_text->initSceneTextBank();
+ _engine->_input->enableKeyMap(mainKeyMapId);
free(animPtr);
free(modelPtr);
}
@@ -461,7 +462,7 @@ void Holomap::processHolomap() {
int32 yRot = 0;
bool rotate = false;
bool redraw = true;
- ScopedKeyMap holomapKeymap(_engine, holomapKeyMapId);
+ _engine->_input->enableKeyMap(holomapKeyMapId);
for (;;) {
FrameMarker frame;
ScopedFPS scopedFps;
@@ -553,6 +554,7 @@ void Holomap::processHolomap() {
_engine->_gameState->initEngineProjections();
_engine->_interface->loadClip();
+ _engine->_input->enableKeyMap(mainKeyMapId);
_engine->_text->initSceneTextBank();
}
Commit: b31b4c05468c0114b1639b1cc131ee57e999d855
https://github.com/scummvm/scummvm/commit/b31b4c05468c0114b1639b1cc131ee57e999d855
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-25T23:53:37+01:00
Commit Message:
TWINE: allow to fade in the holomap text without waiting for input in the text loop
Changed paths:
engines/twine/holomap.cpp
engines/twine/text.cpp
engines/twine/text.h
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 39c0b98506..224da9c0bd 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -347,7 +347,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
void Holomap::drawHolomapLocation(int32 location) {
_engine->_text->textClipSmall();
_engine->_text->setFontCrossColor(COLOR_WHITE);
- _engine->_text->drawTextFullscreen(_locations[location].textIndex);
+ _engine->_text->drawTextFullscreen(_locations[location].textIndex, false, false);
}
int32 Holomap::getNextHolomapLocation(int32 currentLocation, int32 dir) const {
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 6facd9ff4c..63f08b8830 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -589,7 +589,7 @@ ProgressiveTextState Text::updateProgressiveText() {
return ProgressiveTextState::ContinueRunning;
}
-bool Text::displayText(int32 index, bool showText, bool playVox) {
+bool Text::displayText(int32 index, bool showText, bool playVox, bool loop) {
if (playVox) {
// get right VOX entry index
initVoxToPlay(index);
@@ -613,6 +613,17 @@ bool Text::displayText(int32 index, bool showText, bool playVox) {
} else {
fadeInRemainingChars();
}
+
+ if (!loop) {
+ if (textState == ProgressiveTextState::End) {
+ fadeInRemainingChars();
+ break;
+ }
+ if (textState == ProgressiveTextState::NextPage) {
+ textState = ProgressiveTextState::ContinueRunning;
+ }
+ }
+
if (_engine->_input->toggleActionIfActive(TwinEActionType::UINextPage)) {
if (textState == ProgressiveTextState::End) {
stopVox(currDialTextEntry);
@@ -649,11 +660,11 @@ bool Text::displayText(int32 index, bool showText, bool playVox) {
return aborted;
}
-bool Text::drawTextFullscreen(int32 index) {
+bool Text::drawTextFullscreen(int32 index, bool playVox, bool loop) {
_engine->_interface->saveClip();
_engine->_interface->resetClip();
_engine->_screens->copyScreen(_engine->frontVideoBuffer, _engine->workVideoBuffer);
- const bool aborted = displayText(index, _engine->cfgfile.FlagDisplayText, true);
+ const bool aborted = displayText(index, _engine->cfgfile.FlagDisplayText, playVox, loop);
_engine->_interface->loadClip();
return aborted;
}
@@ -770,7 +781,7 @@ void Text::textClipSmall() {
}
void Text::drawAskQuestion(int32 index) {
- displayText(index, true, true);
+ displayText(index, true, true, true);
}
} // namespace TwinE
diff --git a/engines/twine/text.h b/engines/twine/text.h
index 4c0974beb0..69cfa1b3cb 100644
--- a/engines/twine/text.h
+++ b/engines/twine/text.h
@@ -232,7 +232,7 @@ private:
int32 _dialTextBoxLines = 0; // dialogueBoxParam1
int32 _dialTextBoxMaxX = 0; // dialogueBoxParam2
- bool displayText(int32 index, bool showText, bool playVox);
+ bool displayText(int32 index, bool showText, bool playVox, bool loop);
public:
Text(TwinEEngine *engine);
~Text();
@@ -266,7 +266,7 @@ public:
*/
void drawText(int32 x, int32 y, const char *dialogue);
- bool drawTextFullscreen(int32 index);
+ bool drawTextFullscreen(int32 index, bool playVox = true, bool loop = true);
/**
* Gets dialogue text width size
Commit: 892e122e1b519338ee74aa52f919cf20f36870a7
https://github.com/scummvm/scummvm/commit/892e122e1b519338ee74aa52f919cf20f36870a7
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-01-25T23:59:25+01:00
Commit Message:
TWINE: fixed clearing the text related rect for the holomap
... before rendering the text of a newly selected location
Changed paths:
engines/twine/holomap.cpp
engines/twine/holomap.h
engines/twine/text.cpp
engines/twine/text.h
diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 224da9c0bd..923a47a6a5 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -304,7 +304,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
_engine->_renderer->setCameraAngle(0, 0, 0, 60, 128, 0, 30000);
_engine->_renderer->setLightVector(0xffffffc4, 128, 0);
const Common::Rect rect(0, 200, 199, 479);
- _engine->_interface->drawSplittedBox(rect, 0);
+ _engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
_engine->_renderer->renderIsoModel(0, 0, 0, 0, newAngle, 0, modelPtr);
_engine->copyBlockPhys(rect);
_engine->_renderer->setCameraPosition(400, 240, 128, 1024, 1024);
@@ -344,12 +344,6 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
free(modelPtr);
}
-void Holomap::drawHolomapLocation(int32 location) {
- _engine->_text->textClipSmall();
- _engine->_text->setFontCrossColor(COLOR_WHITE);
- _engine->_text->drawTextFullscreen(_locations[location].textIndex, false, false);
-}
-
int32 Holomap::getNextHolomapLocation(int32 currentLocation, int32 dir) const {
const uint32 idx = currentLocation;
for (uint32 i = currentLocation + dir; i != idx; i = (i + dir) % NUM_LOCATIONS) {
@@ -451,7 +445,7 @@ void Holomap::processHolomap() {
drawHolomapText(_engine->width() / 2, 25, "HoloMap");
int currentLocation = _engine->_scene->currentSceneIdx;
- drawHolomapLocation(currentLocation);
+ _engine->_text->drawHolomapLocation(_locations[currentLocation].textIndex);
_engine->flip();
// TODO: load RESSHQR_HOLOSURFACE and project the texture to the surface
@@ -475,7 +469,7 @@ void Holomap::processHolomap() {
const int32 nextLocation = getNextHolomapLocation(currentLocation, -1);
if (nextLocation != -1) {
currentLocation = nextLocation;
- drawHolomapLocation(currentLocation);
+ _engine->_text->drawHolomapLocation(_locations[currentLocation].textIndex);
time = _engine->lbaTime;
rotate = true;
}
@@ -483,7 +477,7 @@ void Holomap::processHolomap() {
const int32 nextLocation = getNextHolomapLocation(currentLocation, 1);
if (nextLocation != -1) {
currentLocation = nextLocation;
- drawHolomapLocation(currentLocation);
+ _engine->_text->drawHolomapLocation(_locations[currentLocation].textIndex);
time = _engine->lbaTime;
rotate = true;
}
@@ -519,7 +513,7 @@ void Holomap::processHolomap() {
if (redraw) {
redraw = false;
const Common::Rect rect(170, 0, 470, 330);
- _engine->_interface->drawSplittedBox(rect, 0);
+ _engine->_interface->drawSplittedBox(rect, COLOR_BLACK);
_engine->_renderer->setBaseRotation(xRot, yRot, 0);
_engine->_renderer->setLightVector(xRot, yRot, 0);
// renderLocations(xRot, yRot, 0, false); // TODO: activate me
diff --git a/engines/twine/holomap.h b/engines/twine/holomap.h
index 6224992a22..8f6ec81469 100644
--- a/engines/twine/holomap.h
+++ b/engines/twine/holomap.h
@@ -107,7 +107,6 @@ private:
uint8 paletteHolomap[NUMOFCOLORS * 3]{0};
void drawHolomapText(int32 centerx, int32 top, const char *title);
- void drawHolomapLocation(int32 location);
int32 getNextHolomapLocation(int32 currentLocation, int32 dir) const;
void renderLocations(int xRot, int yRot, int zRot, bool lower);
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 63f08b8830..037f56ca16 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -639,10 +639,10 @@ bool Text::displayText(int32 index, bool showText, bool playVox, bool loop) {
break;
}
- _engine->_text->playVoxSimple(_engine->_text->currDialTextEntry);
+ playVoxSimple(currDialTextEntry);
}
}
- while (_engine->_text->playVoxSimple(_engine->_text->currDialTextEntry)) {
+ while (playVoxSimple(currDialTextEntry)) {
FrameMarker frame;
ScopedFPS scopedFps;
_engine->readKeys();
@@ -784,4 +784,11 @@ void Text::drawAskQuestion(int32 index) {
displayText(index, true, true, true);
}
+void Text::drawHolomapLocation(int32 index) {
+ textClipSmall();
+ setFontCrossColor(COLOR_WHITE);
+ _engine->_interface->drawSplittedBox(_dialTextBox, COLOR_BLACK);
+ drawTextFullscreen(index, false, false);
+}
+
} // namespace TwinE
diff --git a/engines/twine/text.h b/engines/twine/text.h
index 69cfa1b3cb..f6db63b1cb 100644
--- a/engines/twine/text.h
+++ b/engines/twine/text.h
@@ -331,6 +331,7 @@ public:
void textClipSmall();
void drawAskQuestion(int32 index);
+ void drawHolomapLocation(int32 index);
bool playVox(int32 index);
bool playVoxSimple(int32 index);
More information about the Scummvm-git-logs
mailing list