[Scummvm-git-logs] scummvm master -> 10487c49c74f4b68db6db66e1e0cdac666c93435
sluicebox
noreply at scummvm.org
Sat Jan 17 16:10:34 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
d2bc95cc48 HUGO: Improve drawShape() accuracy
bf8854791e HUGO: Implement DOS processMaze()
10487c49c7 HUGO: Allow keyboard input after death
Commit: d2bc95cc4826df69e482d15eb128f29fb335dc87
https://github.com/scummvm/scummvm/commit/d2bc95cc4826df69e482d15eb128f29fb335dc87
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-01-17T11:09:34-05:00
Commit Message:
HUGO: Improve drawShape() accuracy
HUGO1 DOS introduction shapes are now pixel perfect
Changed paths:
engines/hugo/display.cpp
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 6e7c011402b..9270777af10 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -537,17 +537,24 @@ void Screen::displayPromptText() {
_vm->_system->copyRectToScreen(&_frontBuffer[r.top * 320], 320, r.left, r.top, r.width(), r.height());
}
+/**
+ * Display diamond in Hugo1 DOS introduction
+ *
+ * x,y: upper left of diamond.
+ * color1: left color.
+ * color2: right color.
+ */
void Screen::drawShape(const int x, const int y, const int color1, const int color2) {
for (int i = 0; i < kShapeSize; i++) {
- for (int j = 0; j < i; j++) {
- _backBuffer[320 * (y + i) + (x + kShapeSize + j - i)] = color1;
- _frontBuffer[320 * (y + i) + (x + kShapeSize + j - i)] = color1;
- _backBuffer[320 * (y + i) + (x + kShapeSize + j)] = color2;
- _frontBuffer[320 * (y + i) + (x + kShapeSize + j)] = color2;
- _backBuffer[320 * (y + (2 * kShapeSize - 1) - i) + (x + kShapeSize + j - i)] = color1;
- _frontBuffer[320 * (y + (2 * kShapeSize - 1) - i) + (x + kShapeSize + j - i)] = color1;
- _backBuffer[320 * (y + (2 * kShapeSize - 1) - i) + (x + kShapeSize + j)] = color2;
- _frontBuffer[320 * (y + (2 * kShapeSize - 1) - i) + (x + kShapeSize + j)] = color2;
+ const int top = y + i;
+ const int bottom = y + (kShapeSize * 2) - 2 - i;
+ for (int j = 0; j <= i; j++) {
+ const int left = x + kShapeSize - 1 - j;
+ const int right = x + kShapeSize + j;
+ _frontBuffer[320 * top + left] = color1;
+ _frontBuffer[320 * top + right] = color2;
+ _frontBuffer[320 * bottom + left] = color1;
+ _frontBuffer[320 * bottom + right] = color2;
}
}
}
Commit: bf8854791e7d78929a54c57283c156166a5930bd
https://github.com/scummvm/scummvm/commit/bf8854791e7d78929a54c57283c156166a5930bd
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-01-17T11:09:34-05:00
Commit Message:
HUGO: Implement DOS processMaze()
HUGO2 DOS maze boundaries now behave as in the original.
The north and south boundaries were changed in Windows.
Also removed maze-processing code from HUGO1 DOS,
as this was added in HUGO2.
Changed paths:
engines/hugo/object_v1d.cpp
engines/hugo/schedule.cpp
engines/hugo/schedule.h
diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp
index 9850937d29b..f6aeefe6c0d 100644
--- a/engines/hugo/object_v1d.cpp
+++ b/engines/hugo/object_v1d.cpp
@@ -329,18 +329,6 @@ void ObjectHandler_v1d::moveObjects() {
if ((obj->_screenIndex == *_vm->_screenPtr) && (obj->_cycling > kCycleAlmostInvisible) && (obj->_priority == kPriorityFloating))
clearBoundary(obj->_oldx + currImage->_x1, obj->_oldx + currImage->_x2, obj->_oldy + currImage->_y2);
}
-
- // If maze mode is enabled, do special maze processing
- if (_vm->_maze._enabledFl) {
- Seq *currImage = _vm->_hero->_currImagePtr;// Get ptr to current image
- // hero coordinates
- int x1 = _vm->_hero->_x + currImage->_x1; // Left edge of object
- int x2 = _vm->_hero->_x + currImage->_x2; // Right edge
- int y1 = _vm->_hero->_y + currImage->_y1; // Top edge
- int y2 = _vm->_hero->_y + currImage->_y2; // Bottom edge
-
- _vm->_scheduler->processMaze(x1, x2, y1, y2);
- }
}
/**
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index fce35d8e735..aef63ee1ab1 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -669,6 +669,8 @@ void Scheduler::screenActions(const int screenNum) {
/**
* Maze mode is enabled. Check to see whether hero has crossed the maze
* bounding box, if so, go to the next room
+ *
+ * Note that north and south boundaries are different in DOS and Windows.
*/
void Scheduler::processMaze(const int x1, const int x2, const int y1, const int y2) {
debugC(1, kDebugSchedule, "processMaze");
@@ -687,14 +689,14 @@ void Scheduler::processMaze(const int x1, const int x2, const int y1, const int
_actListArr[_alNewscrIndex][0]._a2._y = _vm->_hero->_y;
_vm->_route->resetRoute();
insertActionList(_alNewscrIndex);
- } else if (y1 < _vm->_maze._y1 - kShiftSize) {
+ } else if (y1 < _vm->_maze._y1) {
// Exit north
_actListArr[_alNewscrIndex][3]._a8._screenIndex = *_vm->_screenPtr - _vm->_maze._size;
_actListArr[_alNewscrIndex][0]._a2._x = _vm->_maze._x3;
_actListArr[_alNewscrIndex][0]._a2._y = _vm->_maze._y2 - kShiftSize - (y2 - y1);
_vm->_route->resetRoute();
insertActionList(_alNewscrIndex);
- } else if (y2 > _vm->_maze._y2 - kShiftSize / 2) {
+ } else if (y2 > _vm->_maze._y2) {
// Exit south
_actListArr[_alNewscrIndex][3]._a8._screenIndex = *_vm->_screenPtr + _vm->_maze._size;
_actListArr[_alNewscrIndex][0]._a2._x = _vm->_maze._x4;
@@ -1671,4 +1673,45 @@ void Scheduler_v1w::runScheduler() {
_vm->getGameStatus()._tick++; // Accessed elsewhere via getTicks()
}
+
+/**
+ * Maze mode is enabled. Check to see whether hero has crossed the maze
+ * bounding box, if so, go to the next room
+ *
+ * Note that north and south boundaries are different in DOS and Windows.
+ */
+void Scheduler_v1w::processMaze(const int x1, const int x2, const int y1, const int y2) {
+ debugC(1, kDebugSchedule, "processMaze");
+
+ if (x1 < _vm->_maze._x1) {
+ // Exit west
+ _actListArr[_alNewscrIndex][3]._a8._screenIndex = *_vm->_screenPtr - 1;
+ _actListArr[_alNewscrIndex][0]._a2._x = _vm->_maze._x2 - kShiftSize - (x2 - x1);
+ _actListArr[_alNewscrIndex][0]._a2._y = _vm->_hero->_y;
+ _vm->_route->resetRoute();
+ insertActionList(_alNewscrIndex);
+ } else if (x2 > _vm->_maze._x2) {
+ // Exit east
+ _actListArr[_alNewscrIndex][3]._a8._screenIndex = *_vm->_screenPtr + 1;
+ _actListArr[_alNewscrIndex][0]._a2._x = _vm->_maze._x1 + kShiftSize;
+ _actListArr[_alNewscrIndex][0]._a2._y = _vm->_hero->_y;
+ _vm->_route->resetRoute();
+ insertActionList(_alNewscrIndex);
+ } else if (y1 < _vm->_maze._y1 - kShiftSize) {
+ // Exit north
+ _actListArr[_alNewscrIndex][3]._a8._screenIndex = *_vm->_screenPtr - _vm->_maze._size;
+ _actListArr[_alNewscrIndex][0]._a2._x = _vm->_maze._x3;
+ _actListArr[_alNewscrIndex][0]._a2._y = _vm->_maze._y2 - kShiftSize - (y2 - y1);
+ _vm->_route->resetRoute();
+ insertActionList(_alNewscrIndex);
+ } else if (y2 > _vm->_maze._y2 - kShiftSize / 2) {
+ // Exit south
+ _actListArr[_alNewscrIndex][3]._a8._screenIndex = *_vm->_screenPtr + _vm->_maze._size;
+ _actListArr[_alNewscrIndex][0]._a2._x = _vm->_maze._x4;
+ _actListArr[_alNewscrIndex][0]._a2._y = _vm->_maze._y1 + kShiftSize;
+ _vm->_route->resetRoute();
+ insertActionList(_alNewscrIndex);
+ }
+}
+
} // End of namespace Hugo
diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h
index 52ecbd5a011..fda535c0379 100644
--- a/engines/hugo/schedule.h
+++ b/engines/hugo/schedule.h
@@ -533,7 +533,7 @@ public:
void loadScreenAct(Common::SeekableReadStream &in);
void newScreen(const int screenIndex);
void processBonus(const int bonusIndex);
- void processMaze(const int x1, const int x2, const int y1, const int y2);
+ virtual void processMaze(const int x1, const int x2, const int y1, const int y2);
void restoreSchedulerData(Common::ReadStream *in);
void restoreScreen(const int screenIndex);
void saveSchedulerData(Common::WriteStream *out);
@@ -635,6 +635,7 @@ public:
~Scheduler_v1w() override;
void runScheduler() override;
+ void processMaze(const int x1, const int x2, const int y1, const int y2) override;
protected:
uint32 getTicks() override;
Commit: 10487c49c74f4b68db6db66e1e0cdac666c93435
https://github.com/scummvm/scummvm/commit/10487c49c74f4b68db6db66e1e0cdac666c93435
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-01-17T11:09:35-05:00
Commit Message:
HUGO: Allow keyboard input after death
Fixes:
- 100% CPU usage after death (delayMillis() was skipped)
- Unable to type keyboard commands after death
- End-game prompt when pressing Escape after death
In the DOS games the status bar and parser remained responsive
after death so that "restore" or "quit" could be entered.
Changed paths:
engines/hugo/hugo.cpp
engines/hugo/schedule.cpp
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index e4272a1b9a6..ce3338f5088 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -393,10 +393,6 @@ void HugoEngine::initMachine() {
void HugoEngine::runMachine() {
Status &gameStatus = getGameStatus();
- // Don't process if gameover
- if (gameStatus._gameOverFl)
- return;
-
_curTime = g_system->getMillis();
// Process machine once every tick
while (_curTime - _lastTime < (uint32)(1000 / getTPS())) {
@@ -426,13 +422,19 @@ void HugoEngine::runMachine() {
_screen->showCursor();
}
_parser->charHandler(); // Process user cmd input
- _object->moveObjects(); // Process object movement
- _scheduler->runScheduler(); // Process any actions
- _screen->displayList(kDisplayRestore); // Restore previous background
- _object->updateImages(); // Draw into _frontBuffer, compile display list
- _screen->drawStatusText();
- _screen->drawPromptText();
- _screen->displayList(kDisplayDisplay); // Blit the display list to screen
+ if (!gameStatus._gameOverFl) {
+ _object->moveObjects(); // Process object movement
+ _scheduler->runScheduler(); // Process any actions
+ _screen->displayList(kDisplayRestore); // Restore previous background
+ _object->updateImages(); // Draw into _frontBuffer, compile display list
+ _screen->drawStatusText();
+ _screen->drawPromptText();
+ _screen->displayList(kDisplayDisplay); // Blit the display list to screen
+ } else {
+ // game over: update status and prompt
+ _screen->displayStatusText(); // Draw to _frontBuffer, copy to screen
+ _screen->displayPromptText(); // Draw to _frontBuffer, copy to screen
+ }
_sound->checkMusic();
break;
case kViewInvent: // Accessing inventory
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index aef63ee1ab1..ddd131704cc 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -1160,10 +1160,6 @@ void Scheduler::insertAction(Act *action) {
case AGSCHEDULE:
curEvent->_localActionFl = false; // Lasts over a new screen
break;
- // Workaround: When dying, switch to storyMode in order to block the keyboard.
- case GAMEOVER:
- _vm->getGameStatus()._storyModeFl = true;
- // fall through
default:
curEvent->_localActionFl = true; // Rest are for current screen only
break;
More information about the Scummvm-git-logs
mailing list