[Scummvm-git-logs] scummvm master -> f759dbb0b84773cef654d6781c95d66cd954b49c
mduggan
noreply at scummvm.org
Sat Jul 27 09:31:32 UTC 2024
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
07453928ba DGDS: Fix willy beamish menu background
9f6ef63891 DGDS: Render HoC intro text more correctly
162d32f352 DGDS: Fix fade source color (fixes HoC credits)
36e9df922a DGDS: Label more TTM opcodes
f759dbb0b8 DGDS: Implement some small Willy Beamish features
Commit: 07453928ba1c246cf5fe2ec7bda33c11e7bd2632
https://github.com/scummvm/scummvm/commit/07453928ba1c246cf5fe2ec7bda33c11e7bd2632
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-07-27T19:31:11+10:00
Commit Message:
DGDS: Fix willy beamish menu background
Changed paths:
engines/dgds/request.cpp
diff --git a/engines/dgds/request.cpp b/engines/dgds/request.cpp
index e42a201d12a..3e3ac10b262 100644
--- a/engines/dgds/request.cpp
+++ b/engines/dgds/request.cpp
@@ -65,8 +65,7 @@ static const byte ChinaButtonColorsOff[] = {
0x10, 0x14, 0x06, 0x18, 0x10, 0x11, 0x14, 0x13,
};
-// TODO: Work out correct fill color for willy beamish
-static const byte WillyBackgroundColor = 23;
+static const byte WillyBackgroundColor = 16;
static const byte MenuBackgroundColors[] {
0x71, 0x71, 0x71, 0x71, 0x71, 0x7B, 0x71, 0x7B, 0x7B, 0x7B, 0x7B, 0x7B,
Commit: 9f6ef63891fe5ffaf09327868305b10911d57b45
https://github.com/scummvm/scummvm/commit/9f6ef63891fe5ffaf09327868305b10911d57b45
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-07-27T19:31:11+10:00
Commit Message:
DGDS: Render HoC intro text more correctly
Changed paths:
engines/dgds/dialog.cpp
diff --git a/engines/dgds/dialog.cpp b/engines/dgds/dialog.cpp
index d628ee7bb9a..f13791fbca8 100644
--- a/engines/dgds/dialog.cpp
+++ b/engines/dgds/dialog.cpp
@@ -91,6 +91,8 @@ const DgdsFont *Dialog::getDlgTextFont() const {
fontType = FontManager::k8x8Font;
else if (_fontSize == 3)
fontType = FontManager::k4x5Font;
+ else if (_fontSize == 5 && DgdsEngine::getInstance()->getGameId() == GID_HOC)
+ fontType = FontManager::kChinaFont;
return fontman->getFont(fontType);
}
@@ -326,7 +328,7 @@ void Dialog::drawType3(Graphics::ManagedSurface *dst, DialogDrawStage stage) {
}
}
-// ellipse
+// ellipse in Dragon, text with no background in HoC
void Dialog::drawType4(Graphics::ManagedSurface *dst, DialogDrawStage stage) {
if (!_state)
return;
@@ -351,16 +353,23 @@ void Dialog::drawType4(Graphics::ManagedSurface *dst, DialogDrawStage stage) {
//int radius = (midy * 5) / 4;
// This is not exactly the same as the original - might need some work to get pixel-perfect
- Common::Rect drawRect(x, y, x + w, y + h);
- Graphics::drawRoundRect(drawRect, midy, fillbgcolor, true, _drawPixel, dst);
- Graphics::drawRoundRect(drawRect, midy, fillcolor, false, _drawPixel, dst);
+ if (DgdsEngine::getInstance()->getGameId() != GID_HOC) {
+ Common::Rect drawRect(x, y, x + w, y + h);
+ Graphics::drawRoundRect(drawRect, midy, fillbgcolor, true, _drawPixel, dst);
+ Graphics::drawRoundRect(drawRect, midy, fillcolor, false, _drawPixel, dst);
+ }
} else if (stage == kDlgDrawFindSelectionPointXY) {
drawFindSelectionXY();
} else if (stage == kDlgDrawFindSelectionTxtOffset) {
drawFindSelectionTxtOffset();
} else {
assert(_state);
- _state->_loc = DgdsRect(x + midy, y + 1, w - midy, h - 1);
+ if (DgdsEngine::getInstance()->getGameId() != GID_HOC) {
+ _state->_loc = DgdsRect(x + midy, y + 1, w - midy, h - 1);
+ } else {
+ _state->_loc = DgdsRect(x, y, w, h);
+ fillcolor = 25; // ignore the color??
+ }
drawForeground(dst, fillcolor, _str);
}
}
Commit: 162d32f3525445a58611db15b27599d16501118a
https://github.com/scummvm/scummvm/commit/162d32f3525445a58611db15b27599d16501118a
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-07-27T19:31:11+10:00
Commit Message:
DGDS: Fix fade source color (fixes HoC credits)
Changed paths:
engines/dgds/game_palettes.cpp
diff --git a/engines/dgds/game_palettes.cpp b/engines/dgds/game_palettes.cpp
index 355bd1d6f01..ccac5323bc5 100644
--- a/engines/dgds/game_palettes.cpp
+++ b/engines/dgds/game_palettes.cpp
@@ -101,16 +101,16 @@ void GamePalettes::setFade(int col, int ncols, int targetcol, int fade) {
const DgdsPal &pal = _palettes[_curPalNum];
byte r2, b2, g2;
- pal.get(targetcol, r2, b2, g2);
+ pal.get(targetcol, r2, g2, b2);
for (int c = col; c < col + ncols; c++) {
byte r, g, b;
pal.get(c, r, g, b);
_curPal.set(c,
- r2 * fade / 255 + r * (255 - fade) / 255,
- g2 * fade / 255 + g * (255 - fade) / 255,
- b2 * fade / 255 + b * (255 - fade) / 255);
+ (r2 * fade + r * (255 - fade)) / 255,
+ (g2 * fade + g * (255 - fade)) / 255,
+ (b2 * fade + b * (255 - fade)) / 255);
}
g_system->getPaletteManager()->setPalette(_curPal.data(), 0, 256);
}
Commit: 36e9df922a7b06e7926283425e1dae55fe22a4fc
https://github.com/scummvm/scummvm/commit/36e9df922a7b06e7926283425e1dae55fe22a4fc
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-07-27T19:31:11+10:00
Commit Message:
DGDS: Label more TTM opcodes
Changed paths:
engines/dgds/ttm.cpp
diff --git a/engines/dgds/ttm.cpp b/engines/dgds/ttm.cpp
index b2d2e43ba2d..a80ba9ab939 100644
--- a/engines/dgds/ttm.cpp
+++ b/engines/dgds/ttm.cpp
@@ -170,6 +170,7 @@ static const char *ttmOpName(uint16 op) {
case 0x4120: return "FADE IN";
case 0x4200: return "STORE AREA";
case 0x4210: return "SAVE GETPUT REGION";
+
case 0xa000: return "DRAW PIXEL";
case 0xa010: return "WIPE DISSOLVE";
case 0xa020: return "WIPE 20?";
@@ -229,14 +230,25 @@ static const char *ttmOpName(uint16 op) {
case 0x00C0: return "FREE BACKGROUND";
case 0x0230: return "reset current music?";
case 0x1310: return "STOP SFX";
- case 0xc020: return "LOAD_SAMPLE";
- case 0xc030: return "SELECT_SAMPLE";
- case 0xc040: return "DESELECT_SAMPLE";
- case 0xc050: return "PLAY_SAMPLE";
- case 0xc060: return "STOP_SAMPLE";
+
+ case 0xc020: return "LOAD SAMPLE";
+ case 0xc030: return "SELECT SAMPLE";
+ case 0xc040: return "DESELECT SAMPLE";
+ case 0xc050: return "PLAY SAMPLE";
+ case 0xc060: return "STOP SAMPLE";
+ case 0xc070: return "PAUSE SAMPLE";
+ case 0xc080: return "UNPAUSE SAMPLE";
+ case 0xc090: return "MUTE SAMPLE";
+ case 0xc0a0: return "UNMUTE SAMPLE";
+ case 0xc0b0: return "SAMPLE PRIORITY";
+ case 0xc0c0: return "SAMPLE HOLD";
+ case 0xc0d0: return "SAMPLE BEND";
case 0xc0e0: return "FADE SONG";
+ case 0xc0f0: return "SONG CONTROLLER??";
+ case 0xc100: return "SAMPLE VOL";
case 0xc210: return "LOAD RAW SFX";
case 0xc220: return "PLAY RAW SFX ??";
+ case 0xcf10: return "SFX MASTER VOL";
default: return "UNKNOWN!!";
}
@@ -705,7 +717,8 @@ void TTMInterpreter::handleOperation(TTMEnviro &env, TTMSeq &seq, uint16 op, byt
break;
}
case 0xa000: // DRAW PIXEL x,y:int
- _vm->_compositionBuffer.setPixel(ivals[0], ivals[1], seq._drawColFG);
+ if (seq._drawWin.contains(ivals[0], ivals[1]))
+ _vm->_compositionBuffer.setPixel(ivals[0], ivals[1], seq._drawColFG);
break;
case 0xa010:
case 0xa020:
Commit: f759dbb0b84773cef654d6781c95d66cd954b49c
https://github.com/scummvm/scummvm/commit/f759dbb0b84773cef654d6781c95d66cd954b49c
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2024-07-27T19:31:11+10:00
Commit Message:
DGDS: Implement some small Willy Beamish features
Changed paths:
engines/dgds/dgds.cpp
engines/dgds/inventory.cpp
engines/dgds/menu.h
engines/dgds/scene.cpp
engines/dgds/scene.h
diff --git a/engines/dgds/dgds.cpp b/engines/dgds/dgds.cpp
index 51d608cf2b0..b3fcfb15837 100644
--- a/engines/dgds/dgds.cpp
+++ b/engines/dgds/dgds.cpp
@@ -196,7 +196,7 @@ bool DgdsEngine::changeScene(int sceneNum) {
_gdsScene->runChangeSceneOps();
if (!_scene->getDragItem())
- setMouseCursor(0);
+ setMouseCursor(_gdsScene->getDefaultMouseCursor());
_storedAreaBuffer.fillRect(Common::Rect(SCREEN_WIDTH, SCREEN_HEIGHT), 0);
@@ -419,7 +419,7 @@ void DgdsEngine::loadGameFiles() {
_gdsScene->runStartGameOps();
loadIcons();
_gdsScene->initIconSizes();
- setMouseCursor(0);
+ setMouseCursor(_gdsScene->getDefaultMouseCursor());
_inventory->setRequestData(invRequestData);
_menu->setRequestData(vcrRequestData);
@@ -541,7 +541,7 @@ Common::Error DgdsEngine::run() {
_menu->setScreenBuffer();
// force mouse on
CursorMan.showMouse(true);
- setMouseCursor(0);
+ setMouseCursor(_gdsScene->getDefaultMouseCursor());
_menu->drawMenu(_menuToTrigger);
} else {
_menu->hideMenu();
diff --git a/engines/dgds/inventory.cpp b/engines/dgds/inventory.cpp
index 9254c418f15..6cd2ab7f65f 100644
--- a/engines/dgds/inventory.cpp
+++ b/engines/dgds/inventory.cpp
@@ -270,7 +270,7 @@ void Inventory::mouseMoved(const Common::Point &pt) {
close();
}
} else {
- engine->setMouseCursor(0);
+ engine->setMouseCursor(engine->getGDSScene()->getDefaultMouseCursor());
}
}
@@ -349,7 +349,7 @@ void Inventory::mouseLUp(const Common::Point &pt) {
GDSScene *gds = engine->getGDSScene();
- engine->setMouseCursor(0);
+ engine->setMouseCursor(gds->getDefaultMouseCursor());
int itemsPerPage = (_itemArea->_width / _itemArea->_xStep) * (_itemArea->_height / _itemArea->_yStep);
if (_exitButton->containsPoint(pt)) {
diff --git a/engines/dgds/menu.h b/engines/dgds/menu.h
index 25a499de670..b91c8633180 100644
--- a/engines/dgds/menu.h
+++ b/engines/dgds/menu.h
@@ -62,12 +62,11 @@ enum MenuId {
kMenuCalibrateJoystick = 28,
kMenuCalibrateMouse = 32,
kMenuReallyQuit = 35,
- kMenuSkipPlayIntro = 50,
- kMenuSkipArcade = 52,
- kMenuSaveBeforeArcade = 46,
kMenuReplayArcade = 45,
+ kMenuSaveBeforeArcade = 46,
kMenuArcadeFrustrated = 47,
- kMenuBeamishSkipCredits = 50,
+ kMenuSkipPlayIntro = 50,
+ kMenuSkipArcade = 52,
};
class Menu {
diff --git a/engines/dgds/scene.cpp b/engines/dgds/scene.cpp
index 208a4ecf653..da614737cbe 100644
--- a/engines/dgds/scene.cpp
+++ b/engines/dgds/scene.cpp
@@ -97,7 +97,7 @@ Common::String SceneConditions::dump(const Common::String &indent) const {
Common::String HotArea::dump(const Common::String &indent) const {
Common::String str = Common::String::format("%sHotArea<%s num %d cursor %d unk1 %d unk2 %d",
- indent.c_str(), _rect.dump("").c_str(), _num, _cursorNum, _unk1, _unk2);
+ indent.c_str(), _rect.dump("").c_str(), _num, _cursorNum, _otherCursorNum, _objInteractionListFlag);
str += _dumpStructList(indent, "enableConditions", enableConditions);
str += _dumpStructList(indent, "onRClickOps", onRClickOps);
str += _dumpStructList(indent, "onLDownOps", onLDownOps);
@@ -137,19 +137,48 @@ static Common::String _sceneOpCodeName(SceneOpCode code) {
case kSceneOpFreeDDSData: return "sceneOpFreeDDSData";
case kSceneOpFreeTalkData: return "sceneOpFreeTalkData";
- // Dragon-specific
- case kSceneOpPasscode: return "passcode";
- case kSceneOpMeanwhile: return "meanwhile";
- case kSceneOpOpenGameOverMenu: return "openGameOverMenu";
- case kSceneOpTiredDialog: return "openTiredDialog";
- case kSceneOpArcadeTick: return "sceneOpArcadeTick";
- case kSceneOpDrawDragonCountdown1: return "drawDragonCountdown1";
- case kSceneOpDrawDragonCountdown2: return "drawDragonCountdown2";
- case kSceneOpOpenPlaySkipIntroMenu: return "openPlaySkipIntroMovie";
- case kSceneOpOpenBetterSaveGameMenu: return "openBetterSaveGameMenu";
default:
- return Common::String::format("sceneOp%d", (int)code);
+ break;
+ }
+
+ if (DgdsEngine::getInstance()->getGameId() == GID_DRAGON) {
+ switch (code) {
+ case kSceneOpPasscode: return "passcode";
+ case kSceneOpMeanwhile: return "meanwhile";
+ case kSceneOpOpenGameOverMenu: return "openGameOverMenu";
+ case kSceneOpTiredDialog: return "openTiredDialog";
+ case kSceneOpArcadeTick: return "sceneOpArcadeTick";
+ case kSceneOpDrawDragonCountdown1: return "drawDragonCountdown1";
+ case kSceneOpDrawDragonCountdown2: return "drawDragonCountdown2";
+ case kSceneOpOpenPlaySkipIntroMenu: return "openPlaySkipIntroMovie";
+ case kSceneOpOpenBetterSaveGameMenu: return "openBetterSaveGameMenu";
+ default:
+ break;
+ }
+ } else if (DgdsEngine::getInstance()->getGameId() == GID_DRAGON) {
+ switch (code) {
+ case kSceneOpOpenChinaTankMenu: return "openTankMenu";
+ case kSceneOpShellGameEnd: return "shellGameEnd";
+ case kSceneOpShellGameTick: return "shellGameTick";
+ case kSceneOpOpenChinaTrainMenu: return "trainMenu";
+ case kSceneOpOpenChinaOpenGameOverMenu: return "gameOverMenu";
+ case kSceneOpOpenChinaOpenSkipCreditsMenu: return "skipCreditsMenu";
+ case kSceneOpOpenChinaStartIntro: return "startIntro";
+ case kSceneOpChina117: return "hocSceneOp117";
+ case kSceneOpChina118: return "hocSceneOp118";
+ default:
+ break;
+ }
+ } else if (DgdsEngine::getInstance()->getGameId() == GID_WILLY) {
+ switch (code) {
+ case kSceneOpOpenBeamishGameOverMenu: return "openGameOverMenu";
+ case kSceneOpOpenBeamishOpenSkipCreditsMenu: return "skipCreditsMenu";
+ default:
+ break;
+ }
}
+
+ return Common::String::format("sceneOp%d", (int)code);
}
Common::String SceneOp::dump(const Common::String &indent) const {
@@ -264,17 +293,17 @@ bool Scene::readHotArea(Common::SeekableReadStream *s, HotArea &dst) const {
dst._num = s->readUint16LE();
dst._cursorNum = s->readUint16LE();
if (isVersionOver(" 1.217"))
- dst._unk1 = s->readUint16LE();
+ dst._otherCursorNum = s->readUint16LE();
else
- dst._unk1 = 0;
+ dst._otherCursorNum = 0;
if (isVersionOver(" 1.218")) {
- dst._unk2 = s->readUint16LE();
- if (dst._unk2) {
+ dst._objInteractionListFlag = s->readUint16LE();
+ if (dst._objInteractionListFlag) {
dst._rect = DgdsRect();
}
} else {
- dst._unk2 = 0;
+ dst._objInteractionListFlag = 0;
}
readConditionList(s, dst.enableConditions);
readOpList(s, dst.onRClickOps);
@@ -790,8 +819,11 @@ bool Scene::runBeamishOp(const SceneOp &op) {
return true;
}
switch (op._opCode) {
+ case kSceneOpOpenBeamishGameOverMenu:
+ engine->setMenuToTrigger(kMenuGameOver);
+ break;
case kSceneOpOpenBeamishOpenSkipCreditsMenu:
- engine->setMenuToTrigger(kMenuBeamishSkipCredits);
+ engine->setMenuToTrigger(kMenuSkipPlayIntro);
break;
default:
warning("TODO: Implement beamish-specific scene opcode %d", op._opCode);
@@ -1826,7 +1858,7 @@ void SDSScene::onDragFinish(const Common::Point &pt) {
}
}
- engine->setMouseCursor(0);
+ engine->setMouseCursor(gdsScene->getDefaultMouseCursor());
_dragItem = nullptr;
}
@@ -1919,7 +1951,7 @@ void SDSScene::addInvButtonToHotAreaList() {
if (_hotAreaList.size() && _hotAreaList.front()._num == 0)
return;
- int16 invButtonIcon = 2;
+ int16 invButtonIcon = engine->getGDSScene()->getInvIconNum();
if (engine->getGameId() == GID_HOC) {
static const byte HOC_INV_ICONS[] = { 0, 2, 18, 19 };
invButtonIcon = HOC_INV_ICONS[engine->getGDSScene()->getGlobal(0x33)];
@@ -1927,13 +1959,13 @@ void SDSScene::addInvButtonToHotAreaList() {
HotArea area;
area._num = 0;
- area._cursorNum = 0;
+ area._cursorNum = engine->getGDSScene()->getInvIconMouseCursor();
area._rect.width = icons->width(invButtonIcon);
area._rect.height = icons->height(invButtonIcon);
area._rect.x = SCREEN_WIDTH - area._rect.width;
area._rect.y = SCREEN_HEIGHT - area._rect.height;
- area._unk1 = 0;
- area._unk2 = 0;
+ area._otherCursorNum = 0;
+ area._objInteractionListFlag = 0;
// Add swap character button for HoC
if (engine->getGameId() == GID_HOC && engine->getGDSScene()->getGlobal(0x34) != 0) {
@@ -1946,8 +1978,8 @@ void SDSScene::addInvButtonToHotAreaList() {
area2._rect.height = icons->height(iconNum);
area2._rect.x = 5;
area2._rect.y = SCREEN_HEIGHT - area2._rect.height - 5;
- area2._unk1 = 0;
- area2._unk2 = 0;
+ area2._otherCursorNum = 0;
+ area2._objInteractionListFlag = 0;
_hotAreaList.push_front(area2);
}
@@ -2019,7 +2051,7 @@ void SDSScene::activateChoice() {
}
-GDSScene::GDSScene() : _field38(0), _field3a(0), _field3c(0), _field3e(0), _field40(0) {
+GDSScene::GDSScene() : _defaultMouseCursor(0), _field3a(0), _invIconNum(0), _invIconMouseCursor(0), _field40(0) {
}
bool GDSScene::load(const Common::String &filename, ResourceManager *resourceManager, Decompressor *decompressor) {
@@ -2193,16 +2225,16 @@ bool GDSScene::parse(Common::SeekableReadStream *stream) {
readObjInteractionList(stream, _objInteractions2);
if (isVersionOver(" 1.218")) {
- _field38 = stream->readUint16LE();
+ _defaultMouseCursor = stream->readUint16LE();
_field3a = stream->readUint16LE();
- _field3c = stream->readUint16LE();
- _field3e = stream->readUint16LE();
+ _invIconNum = stream->readUint16LE();
+ _invIconMouseCursor = stream->readUint16LE();
_field40 = stream->readUint16LE();
} else {
- _field38 = 0;
+ _defaultMouseCursor = 0;
_field3a = 1;
- _field3c = 2;
- _field3e = 0;
+ _invIconNum = 2;
+ _invIconMouseCursor = 0;
_field40 = 6;
}
diff --git a/engines/dgds/scene.h b/engines/dgds/scene.h
index e1ca4e75a63..07ce4ec0449 100644
--- a/engines/dgds/scene.h
+++ b/engines/dgds/scene.h
@@ -70,8 +70,8 @@ public:
uint16 _cursorNum;
// Used in Willy Beamish
- uint16 _unk1;
- uint16 _unk2;
+ uint16 _otherCursorNum;
+ uint16 _objInteractionListFlag;
Common::Array<SceneConditions> enableConditions;
Common::Array<SceneOp> onRClickOps;
@@ -136,6 +136,7 @@ enum SceneOpCode {
kSceneOpChina118 = 118, // args: none. ??
// Beamish-specific opcodes
+ kSceneOpOpenBeamishGameOverMenu = 100,
kSceneOpOpenBeamishOpenSkipCreditsMenu = 101,
kSceneOpMaxCode = 255, // for checking file load
@@ -381,6 +382,10 @@ public:
void initIconSizes();
GameItem *getActiveItem();
+ uint16 getDefaultMouseCursor() const { return _defaultMouseCursor; }
+ uint16 getInvIconNum() const { return _invIconNum; }
+ uint16 getInvIconMouseCursor() const { return _invIconMouseCursor; }
+
private:
Common::String _iconFile;
Common::Array<GameItem> _gameItems;
@@ -393,10 +398,10 @@ private:
Common::Array<ObjectInteraction> _objInteractions1;
// Additional fields that appear in Willy Beamish (unused in others)
- uint16 _field38;
+ uint16 _defaultMouseCursor;
uint16 _field3a;
- uint16 _field3c;
- uint16 _field3e;
+ uint16 _invIconNum;
+ uint16 _invIconMouseCursor;
uint16 _field40;
};
More information about the Scummvm-git-logs
mailing list