[Scummvm-git-logs] scummvm master -> f97540e800bfa0e92ed95e7c61ba004ebb0db5ca
mgerhardy
noreply at scummvm.org
Sat Oct 5 19:51:20 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
383c22d6be TWINE: renamed methods to match original sources (drawFilledRect => box
f97540e800 TWINE: LBA: Magic Bar in Twinsen stats never fills completely
Commit: 383c22d6bedd774beddbad60dd0555405831f43b
https://github.com/scummvm/scummvm/commit/383c22d6bedd774beddbad60dd0555405831f43b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-05T21:51:14+02:00
Commit Message:
TWINE: renamed methods to match original sources (drawFilledRect => box
Changed paths:
engines/twine/debugger/debug.cpp
engines/twine/debugger/debug_scene.cpp
engines/twine/holomap_v1.cpp
engines/twine/menu/interface.cpp
engines/twine/menu/interface.h
engines/twine/menu/menu.cpp
engines/twine/menu/menuoptions.cpp
engines/twine/movies.cpp
engines/twine/renderer/redraw.cpp
engines/twine/script/script_life.cpp
engines/twine/text.cpp
diff --git a/engines/twine/debugger/debug.cpp b/engines/twine/debugger/debug.cpp
index b8effbc262c..06269387c44 100644
--- a/engines/twine/debugger/debug.cpp
+++ b/engines/twine/debugger/debug.cpp
@@ -37,7 +37,7 @@ namespace TwinE {
void Debug::debugFillButton(int32 x, int32 y, int32 width, int32 height, int8 color) {
const Common::Rect rect(x, y, x + width, y + height);
- _engine->_interface->drawFilledRect(rect, color);
+ _engine->_interface->box(rect, color);
}
void Debug::debugDrawButton(const Common::Rect &rect, const char *text, int32 textLeft, int32 textTop, int32 isActive, int8 color) {
diff --git a/engines/twine/debugger/debug_scene.cpp b/engines/twine/debugger/debug_scene.cpp
index f0fe439e566..92957245f26 100644
--- a/engines/twine/debugger/debug_scene.cpp
+++ b/engines/twine/debugger/debug_scene.cpp
@@ -154,7 +154,7 @@ bool DebugScene::displayActors() {
const int lineHeight = 14;
const int boxheight = 2 * lineHeight;
const Common::Rect filledRect(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, positions.frontTopRightPoint2D.x + boxwidth, positions.frontTopRightPoint2D.y + boxheight);
- _engine->_interface->drawFilledRect(filledRect, COLOR_WHITE);
+ _engine->_interface->box(filledRect, COLOR_WHITE);
_engine->_menu->drawRectBorders(filledRect);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, Common::String::format("Actor: %i", a), true, true, boxwidth);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y + lineHeight, Common::String::format("pos: %i:%i:%i", pos.x, pos.y, pos.z), true, true, boxwidth);
@@ -200,7 +200,7 @@ bool DebugScene::displayZones() {
const int lineHeight = 14;
const int boxheight = 2 * lineHeight;
const Common::Rect filledRect(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, positions.frontTopRightPoint2D.x + boxwidth, positions.frontTopRightPoint2D.y + boxheight);
- _engine->_interface->drawFilledRect(filledRect, COLOR_WHITE);
+ _engine->_interface->box(filledRect, COLOR_WHITE);
_engine->_menu->drawRectBorders(filledRect);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y, Common::String::format("Type: %i (%i)", (int)zonePtr->type, i), true, false, boxwidth);
_engine->drawText(positions.frontTopRightPoint2D.x, positions.frontTopRightPoint2D.y + lineHeight, Common::String::format("pos: %i:%i:%i", positions.frontTopRightPoint.x, positions.frontTopRightPoint.y, positions.frontTopRightPoint.z), true, false, boxwidth);
diff --git a/engines/twine/holomap_v1.cpp b/engines/twine/holomap_v1.cpp
index a4907c04c1d..b6aae1eb5d8 100644
--- a/engines/twine/holomap_v1.cpp
+++ b/engines/twine/holomap_v1.cpp
@@ -316,7 +316,7 @@ void HolomapV1::renderHolomapVehicle(uint &frameNumber, ActorMoveStruct &move, A
_engine->_renderer->setFollowCamera(0, 0, 0, 60, 128, 0, distance(30000));
_engine->_renderer->setLightVector(-60, 128, 0);
// background of the vehicle
- _engine->_interface->drawFilledRect(rect, COLOR_BLACK);
+ _engine->_interface->box(rect, COLOR_BLACK);
Common::Rect dummy;
_engine->_renderer->affObjetIso(0, 0, 0, LBAAngles::ANGLE_0, newAngle, LBAAngles::ANGLE_0, bodyData, dummy);
_engine->copyBlockPhys(rect);
@@ -645,7 +645,7 @@ void HolomapV1::holoMap() {
// but it's not part of the original code
_engine->_interface->memoClip();
_engine->_interface->setClip(rect);
- _engine->_interface->drawFilledRect(rect, COLOR_BLACK);
+ _engine->_interface->box(rect, COLOR_BLACK);
_engine->_renderer->setInverseAngleCamera(calpha, cbeta, cgamma);
_engine->_renderer->setLightVector(calpha, cbeta, 0);
drawListPos(calpha, cbeta, cgamma, false);
diff --git a/engines/twine/menu/interface.cpp b/engines/twine/menu/interface.cpp
index 9e8346d821a..37157954325 100644
--- a/engines/twine/menu/interface.cpp
+++ b/engines/twine/menu/interface.cpp
@@ -179,7 +179,7 @@ void Interface::shadeBox(const Common::Rect &rect, int32 colorAdj) {
_engine->_frontVideoBuffer.addDirtyRect(r);
}
-void Interface::drawFilledRect(const Common::Rect &rect, uint8 colorIndex) { // Box
+void Interface::box(const Common::Rect &rect, uint8 colorIndex) { // Box
if (!rect.isValidRect()) {
return;
}
diff --git a/engines/twine/menu/interface.h b/engines/twine/menu/interface.h
index f02124f7d20..a2b60fd8be2 100644
--- a/engines/twine/menu/interface.h
+++ b/engines/twine/menu/interface.h
@@ -65,7 +65,7 @@ public:
*/
void shadeBox(const Common::Rect &rect, int32 colorAdj);
- void drawFilledRect(const Common::Rect &rect, uint8 colorIndex);
+ void box(const Common::Rect &rect, uint8 colorIndex);
bool setClip(const Common::Rect &rect);
void memoClip(); // saveTextWindow
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index ba8a84ed011..de1e4352c33 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -280,14 +280,14 @@ void Menu::processPlasmaEffect(const Common::Rect &rect, int32 color) {
_engine->_frontVideoBuffer.blitFrom(_engine->_imageBuffer, prect, rect);
}
-void Menu::drawRectBorders(const Common::Rect &rect, int32 colorLeftTop, int32 colorRightBottom) {
+void Menu::drawRectBorders(const Common::Rect &rect, int32 colorLeftTop, int32 colorRightBottom) { // DrawCadre
_engine->_interface->drawLine(rect.left, rect.top, rect.right, rect.top, colorLeftTop); // top line
_engine->_interface->drawLine(rect.left, rect.top + 1, rect.left, rect.bottom, colorLeftTop); // left line
_engine->_interface->drawLine(rect.right, rect.top + 1, rect.right, rect.bottom, colorRightBottom); // right line
_engine->_interface->drawLine(rect.left + 1, rect.bottom, rect.right - 1, rect.bottom, colorRightBottom); // bottom line
}
-void Menu::drawRectBorders(int32 left, int32 top, int32 right, int32 bottom, int32 colorLeftTop, int32 colorRightBottom) {
+void Menu::drawRectBorders(int32 left, int32 top, int32 right, int32 bottom, int32 colorLeftTop, int32 colorRightBottom) { // DrawCadre
drawRectBorders(Common::Rect(left, top, right, bottom), colorLeftTop, colorLeftTop);
}
@@ -322,7 +322,7 @@ void Menu::drawButtonGfx(const MenuSettings *menuSettings, const Common::Rect &r
if (!(_engine->getRandomNumber() % 5)) {
_plasmaEffectPtr[(_engine->getRandomNumber() % PLASMA_WIDTH * 10) + 20 * PLASMA_WIDTH] = 255;
}
- _engine->_interface->drawFilledRect(Common::Rect(newWidth, rect.top, rect.right, rect.bottom), COLOR_SELECT_MENU);
+ _engine->_interface->box(Common::Rect(newWidth, rect.top, rect.right, rect.bottom), COLOR_SELECT_MENU);
} else {
processPlasmaEffect(rect, COLOR_64);
if (!(_engine->getRandomNumber() % 5)) {
@@ -1008,7 +1008,7 @@ void Menu::drawHealthBar(int32 left, int32 right, int32 top, int32 barLeftPaddin
const int32 barLeft = left + barLeftPadding;
const int32 healthBarRight = _engine->_screens->lerp(barLeft, right, 50, _engine->_scene->_sceneHero->_lifePoint);
const int32 barBottom = top + barHeight;
- _engine->_interface->drawFilledRect(Common::Rect(barLeft, top, healthBarRight, barBottom), COLOR_91);
+ _engine->_interface->box(Common::Rect(barLeft, top, healthBarRight, barBottom), COLOR_91);
drawRectBorders(Common::Rect(barLeft, top, right, barBottom));
}
@@ -1039,9 +1039,11 @@ void Menu::drawMagicPointsBar(int32 left, int32 right, int32 top, int32 barLeftP
}
const int32 barLeft = left + barLeftPadding;
const int32 barBottom = top + barHeight;
- const int32 barRight = _engine->_screens->lerp(barLeft, right, 80, _engine->_gameState->_magicPoint);
+ // max magic level is 4
+ const int32 maxMagicPoints = 4 * 20;
+ const int32 barRight = _engine->_screens->lerp(barLeft, right, maxMagicPoints, _engine->_gameState->_magicPoint);
const Common::Rect pointsRect(barLeft, top, barRight, barBottom);
- _engine->_interface->drawFilledRect(pointsRect, COLOR_75);
+ _engine->_interface->box(pointsRect, COLOR_75);
drawRectBorders(barLeft, top, barLeft + _engine->_gameState->_magicLevelIdx * 80, barBottom);
}
@@ -1068,7 +1070,7 @@ void Menu::drawInfoMenu(int16 left, int16 top, int16 width) {
drawRectBorders(rect);
Common::Rect filledRect(rect);
filledRect.grow(-1);
- _engine->_interface->drawFilledRect(filledRect, COLOR_BLACK);
+ _engine->_interface->box(filledRect, COLOR_BLACK);
const int32 boxLeft = left + 9;
const int32 boxRight = left + 325;
@@ -1142,11 +1144,11 @@ void Menu::drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int
const int32 titleBoxTop = boxRect.bottom + titleOffset;
const int32 titleBoxBottom = titleBoxTop + titleHeight;
- _engine->_interface->drawFilledRect(boxRect, COLOR_BRIGHT_BLUE2);
+ _engine->_interface->box(boxRect, COLOR_BRIGHT_BLUE2);
// behaviour menu title
const Common::Rect titleRect(titleBoxLeft, titleBoxTop, titleBoxRight, titleBoxBottom);
- _engine->_interface->drawFilledRect(titleRect, COLOR_BLACK);
+ _engine->_interface->box(titleRect, COLOR_BLACK);
drawRectBorders(titleRect);
_engine->_text->setFontColor(COLOR_WHITE);
@@ -1156,7 +1158,7 @@ void Menu::drawBehaviour(int32 left, int32 top, HeroBehaviourType behaviour, int
_engine->_text->drawText(titleBoxCenter - _engine->_text->sizeFont(dialText) / 2, titleBoxTop + 1, dialText);
} else {
- _engine->_interface->drawFilledRect(boxRect, COLOR_BLACK);
+ _engine->_interface->box(boxRect, COLOR_BLACK);
}
_engine->_renderer->drawObj3D(boxRect, -600, angle, *_behaviourEntity, _moveMenu);
@@ -1314,7 +1316,7 @@ void Menu::drawOneInventory(int32 left, int32 top, int32 item) {
const Common::Rect rect = calcItemRect(left, top, item, &itemX, &itemY);
const int32 color = _inventorySelectedItem == item ? _inventorySelectedColor : COLOR_BLACK;
- _engine->_interface->drawFilledRect(rect, color);
+ _engine->_interface->box(rect, color);
if (item < NUM_INVENTORY_ITEMS && _engine->_gameState->hasItem((InventoryItems)item) && (!_engine->_gameState->inventoryDisabled() || item == InventoryItems::kiCloverLeaf)) {
_itemAngle[item] += LBAAngles::ANGLE_2;
diff --git a/engines/twine/menu/menuoptions.cpp b/engines/twine/menu/menuoptions.cpp
index 57f95398812..b629c87c9d0 100644
--- a/engines/twine/menu/menuoptions.cpp
+++ b/engines/twine/menu/menuoptions.cpp
@@ -150,7 +150,7 @@ void MenuOptions::drawSelectableCharacter(int32 x, int32 y) {
const bool selected = _onScreenKeyboardX == x && _onScreenKeyboardY == y;
if (selected) {
- _engine->_interface->drawFilledRect(rect, COLOR_91);
+ _engine->_interface->box(rect, COLOR_91);
} else {
_engine->blitWorkToFront(rect);
_engine->_interface->shadeBox(rect, 4);
diff --git a/engines/twine/movies.cpp b/engines/twine/movies.cpp
index c24bda3d57b..387a7941374 100644
--- a/engines/twine/movies.cpp
+++ b/engines/twine/movies.cpp
@@ -248,7 +248,7 @@ void Movies::processFrame() {
}
case kBlackFrame: {
const Common::Rect rect(0, 0, FLASCREEN_WIDTH - 1, FLASCREEN_HEIGHT - 1);
- _engine->_interface->drawFilledRect(rect, 0);
+ _engine->_interface->box(rect, 0);
break;
}
case kCopy:
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index c929a431fd1..2f6fd7e44bd 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -795,7 +795,7 @@ void Redraw::renderOverlays() {
const int32 item = overlay->num;
const Common::Rect rect(10, 10, 79, 79);
- _engine->_interface->drawFilledRect(rect, COLOR_BLACK);
+ _engine->_interface->box(rect, COLOR_BLACK);
_engine->_interface->setClip(rect);
const BodyData &bodyPtr = _engine->_resources->_inventoryTable[item];
diff --git a/engines/twine/script/script_life.cpp b/engines/twine/script/script_life.cpp
index 6a9fef534f3..d9016a08f20 100644
--- a/engines/twine/script/script_life.cpp
+++ b/engines/twine/script/script_life.cpp
@@ -2057,7 +2057,7 @@ int32 ScriptLife::lCLEAR_TEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScripts, "LIFE::CLEAR_TEXT()");
lTextYPos = 0;
const Common::Rect rect(0, 0, engine->width() - 1, engine->height() / 2);
- engine->_interface->drawFilledRect(rect, COLOR_BLACK);
+ engine->_interface->box(rect, COLOR_BLACK);
return 0;
}
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 4e5df5c9bdc..1dae436e300 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -868,7 +868,7 @@ void Text::drawAskQuestion(TextId index) {
void Text::drawHolomapLocation(TextId index) {
normalWinDial();
setFontCrossColor(COLOR_WHITE);
- _engine->_interface->drawFilledRect(_dialTextBox, COLOR_BLACK);
+ _engine->_interface->box(_dialTextBox, COLOR_BLACK);
const bool displayText = _engine->_cfgfile.FlagDisplayText;
_engine->_cfgfile.FlagDisplayText = true;
drawTextProgressive(index, false, false);
Commit: f97540e800bfa0e92ed95e7c61ba004ebb0db5ca
https://github.com/scummvm/scummvm/commit/f97540e800bfa0e92ed95e7c61ba004ebb0db5ca
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-05T21:51:14+02:00
Commit Message:
TWINE: LBA: Magic Bar in Twinsen stats never fills completely
see issue https://bugs.scummvm.org/ticket/15385
Changed paths:
engines/twine/menu/menu.cpp
engines/twine/scene/extra.h
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index de1e4352c33..32dd1ea42a7 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1009,6 +1009,7 @@ void Menu::drawHealthBar(int32 left, int32 right, int32 top, int32 barLeftPaddin
const int32 healthBarRight = _engine->_screens->lerp(barLeft, right, 50, _engine->_scene->_sceneHero->_lifePoint);
const int32 barBottom = top + barHeight;
_engine->_interface->box(Common::Rect(barLeft, top, healthBarRight, barBottom), COLOR_91);
+ _engine->_interface->box(Common::Rect(healthBarRight, top, left + 325, barBottom), COLOR_BLACK);
drawRectBorders(Common::Rect(barLeft, top, right, barBottom));
}
@@ -1044,7 +1045,14 @@ void Menu::drawMagicPointsBar(int32 left, int32 right, int32 top, int32 barLeftP
const int32 barRight = _engine->_screens->lerp(barLeft, right, maxMagicPoints, _engine->_gameState->_magicPoint);
const Common::Rect pointsRect(barLeft, top, barRight, barBottom);
_engine->_interface->box(pointsRect, COLOR_75);
- drawRectBorders(barLeft, top, barLeft + _engine->_gameState->_magicLevelIdx * 80, barBottom);
+
+ for (int32 l = 0; l < _engine->_gameState->_magicLevelIdx; l++) {
+ const int32 x1 = _engine->_screens->lerp(barLeft, right, 40, _engine->_gameState->_magicLevelIdx * 10);
+ _engine->_interface->drawLine(x1, top + barHeight, x1, top + 35 + 15 - 1, 0);
+ }
+
+ const int32 rectRight = _engine->_screens->lerp(barLeft, right, 40, _engine->_gameState->_magicLevelIdx * 10);
+ drawRectBorders(barLeft, top, rectRight, barBottom);
}
void Menu::drawSpriteAndString(int32 left, int32 top, const SpriteData &spriteData, const Common::String &str, int32 color) {
diff --git a/engines/twine/scene/extra.h b/engines/twine/scene/extra.h
index 6068307b2ec..3a114e94ec3 100644
--- a/engines/twine/scene/extra.h
+++ b/engines/twine/scene/extra.h
@@ -55,8 +55,8 @@ enum ExtraType {
MAGIC_BALL_KEY = 1 << 9, // 0x0200
TIME_IN = 1 << 10, // 0x0400
ONE_FRAME = 1 << 11, // 0x0800
- EXPLOSION = 1 << 12, // 0x1000
- WAIT_NO_COL = 1 << 13, // 0x2000
+ EXPLOSION = 1 << 12, // 0x1000 EXTRA_EXPLO
+ WAIT_NO_COL = 1 << 13, // 0x2000 EXTRA_WAIT_NO_COL
WAIT_SOME_TIME = 1 << 14, // 0x4000
COMPUTE_TRAJ = 1 << 15 // 0x8000 used in dotemu enhanced to render the magic ball trajectories
};
More information about the Scummvm-git-logs
mailing list