[Scummvm-git-logs] scummvm master -> 5dc51e8382f7b2c3493f722067abb9d06d8c5949

dreammaster noreply at scummvm.org
Mon Dec 22 09:41:08 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
5dc51e8382 BAGEL: Add support for Art Parts demo


Commit: 5dc51e8382f7b2c3493f722067abb9d06d8c5949
    https://github.com/scummvm/scummvm/commit/5dc51e8382f7b2c3493f722067abb9d06d8c5949
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-12-22T20:40:58+11:00

Commit Message:
BAGEL: Add support for Art Parts demo

Changed paths:
    engines/bagel/detection_tables.h
    engines/bagel/hodjnpodj/artparts/artparts.cpp
    engines/bagel/hodjnpodj/artparts/artparts.h
    engines/bagel/hodjnpodj/hodjnpodj.cpp
    engines/bagel/hodjnpodj/metagame/frame/app.cpp


diff --git a/engines/bagel/detection_tables.h b/engines/bagel/detection_tables.h
index 6eef54ccc2b..a66ae36fc76 100644
--- a/engines/bagel/detection_tables.h
+++ b/engines/bagel/detection_tables.h
@@ -26,6 +26,7 @@ const PlainGameDescriptor bagelGames[] = {
 	{ "spacebar", "The Space Bar" },
 	{ "hodjnpodj", "Hodj 'n' Podj" },
 	{ "mazeodoom", "Hodj 'n' Podj - Maze O' Doom" },
+	{ "artparts", "Hodj 'n' Podj - Art Parts" },
 	{ 0, 0 }
 };
 
@@ -117,6 +118,16 @@ const ADGameDescription gameDescriptions[] = {
 		GUIO1(GUIO_NONE)
 	},
 
+	{
+		"artparts",
+		nullptr,
+		AD_ENTRY1s("arttemp.bmp", "ec4897660a14cb73f4fe7d714acaab7a", 308278),
+		Common::EN_ANY,
+		Common::kPlatformWindows,
+		ADGF_DEMO,
+		GUIO1(GUIO_NONE)
+	},
+
 	{
 		"hodjnpodj",
 		"Demo",
diff --git a/engines/bagel/hodjnpodj/artparts/artparts.cpp b/engines/bagel/hodjnpodj/artparts/artparts.cpp
index 72e5109e8c4..c97d0e0e3b3 100644
--- a/engines/bagel/hodjnpodj/artparts/artparts.cpp
+++ b/engines/bagel/hodjnpodj/artparts/artparts.cpp
@@ -60,6 +60,50 @@ int CMainWindow::tempRows;
 int CMainWindow::tempColumns;
 bool CMainWindow::tempFramed;
 
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Dummy class for the Art Parts demo to map art/ and sound/ subfolders to current folder
+ */
+class ArtSoundArchive : public Common::Archive {
+public:
+	bool hasFile(const Common::Path &path) const {
+		Common::String pathStr = path.toString();
+		if (pathStr.hasPrefixIgnoreCase("art/")) {
+			pathStr = pathStr.c_str() + 4;
+		} else if (pathStr.hasPrefixIgnoreCase("sound/")) {
+			pathStr = pathStr.c_str() + 6;
+		} else {
+			return false;
+		}
+		return Common::File::exists(pathStr.c_str());
+	}
+
+	int listMembers(Common::ArchiveMemberList &list) const override {
+		return 0;
+	}
+
+	const Common::ArchiveMemberPtr getMember(const Common::Path &path) const override {
+		return Common::ArchiveMemberPtr();
+	}
+
+	Common::SeekableReadStream *createReadStreamForMember(const Common::Path &path) const {
+		Common::String pathStr = path.toString();
+		if (pathStr.hasPrefixIgnoreCase("art/")) {
+			pathStr = pathStr.c_str() + 4;
+		} else if (pathStr.hasPrefixIgnoreCase("sound/")) {
+			pathStr = pathStr.c_str() + 6;
+		} else {
+			return nullptr;
+		}
+
+		Common::File f;
+		if (f.open(pathStr.c_str()))
+			return f.readStream(f.size());
+		return nullptr;
+	}
+};
+
 /////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////
 // CMainWindow constructor:
@@ -75,6 +119,9 @@ CMainWindow::CMainWindow() {
 	initStatics();
 	BeginWaitCursor();
 
+	if (g_engine->isDemo())
+		SearchMan.add("artparts_demo", new ArtSoundArchive());
+
 	// Define a special window class which traps double-clicks, is byte aligned
 	// to maximize BITBLT performance, and creates "owned" DCs rather than sharing
 	// the five system defined DCs which are not guaranteed to be available;
@@ -176,6 +223,10 @@ CMainWindow::CMainWindow() {
 
 } //End of CMainWindow
 
+CMainWindow::~CMainWindow() {
+	SearchMan.remove("artparts_demo");
+}
+
 void CMainWindow::initStatics() {
 	pGamePalette = nullptr;
 	nSeconds = MIN_TIME;
diff --git a/engines/bagel/hodjnpodj/artparts/artparts.h b/engines/bagel/hodjnpodj/artparts/artparts.h
index f29e1daf77a..9860233bb51 100644
--- a/engines/bagel/hodjnpodj/artparts/artparts.h
+++ b/engines/bagel/hodjnpodj/artparts/artparts.h
@@ -104,6 +104,8 @@ namespace ArtParts {
 class CMainWindow : public CFrameWnd {
 public:
 	CMainWindow();
+	~CMainWindow();
+
 	bool LoadArtWork();
 	void DrawPart(const CPoint &Src, const CPoint &Dst, int nWidth, int nHeight);
 	void SwitchAreas(const CRect &Src, const CRect &Dst);
diff --git a/engines/bagel/hodjnpodj/hodjnpodj.cpp b/engines/bagel/hodjnpodj/hodjnpodj.cpp
index bba91cc9fbc..b74c0458edd 100644
--- a/engines/bagel/hodjnpodj/hodjnpodj.cpp
+++ b/engines/bagel/hodjnpodj/hodjnpodj.cpp
@@ -74,6 +74,8 @@ Common::Error HodjNPodjEngine::run() {
 
 		if (getGameId() == "mazeodoom") {
 			app.setStartupMinigame("mazedoom_demo");
+		} else if (getGameId() == "artparts") {
+			app.setStartupMinigame("artparts_demo");
 		} else if (ConfMan.getBool("metagame")) {
 			Metagame::Frame::InitBFCInfo(&_bfcMgr);
 			Metagame::Gtl::RunMeta(nullptr, &_bfcMgr, false);
diff --git a/engines/bagel/hodjnpodj/metagame/frame/app.cpp b/engines/bagel/hodjnpodj/metagame/frame/app.cpp
index f653c4b6f4c..423e468669f 100644
--- a/engines/bagel/hodjnpodj/metagame/frame/app.cpp
+++ b/engines/bagel/hodjnpodj/metagame/frame/app.cpp
@@ -51,6 +51,8 @@ bool CTheApp::InitApplication() {
 		setDirectory("meta");
 	} else if (_startupMinigame == "mazedoom_demo") {
 		addResources("mod.exe");
+	} else if (_startupMinigame == "artparts_demo") {
+		addResources("artparts.exe");
 	}
 
 	addFontResource("msserif.fon");
@@ -96,15 +98,15 @@ int CTheApp::ExitInstance() {
 }
 
 void CTheApp::selectMinigame() {
-	bool isMODDemo = false;
+	bool isMODDemo = false, isAPDemo = false;;
 	const auto *game = Metagame::CMgStatic::cGameTable;
 
 	for (; game->m_iGameCode; ++game) {
 		if (game->_path && _startupMinigame == game->_path)
 			break;
-		isMODDemo = _startupMinigame == "mazedoom_demo" &&
-			game->m_iGameCode == MG_GAME_MAZEODOOM;
-		if (isMODDemo)
+		isMODDemo = _startupMinigame == "mazedoom_demo" && game->m_iGameCode == MG_GAME_MAZEODOOM;
+		isAPDemo = _startupMinigame == "artparts_demo" && game->m_iGameCode == MG_GAME_ARTPARTS;
+		if (isMODDemo || isAPDemo)
 			break;
 	}
 
@@ -123,6 +125,8 @@ void CTheApp::selectMinigame() {
 	// Don't change folder for Maze O Doom demo
 	if (isMODDemo) {
 		addResources("mod.exe");
+	} else if (isAPDemo) {
+		addResources("artparts.exe");
 	} else {
 		setDirectory(game->_path);
 		addResources(game->_dllName);




More information about the Scummvm-git-logs mailing list