[Scummvm-git-logs] scummvm branch-2-7 -> 08bb040f2494b5b32cd3cbdd8586e433baa9d026

phcoder noreply at scummvm.org
Thu Feb 2 16:36:00 UTC 2023


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

Summary:
0062f3b421 NEVERHOOD: Fix crash on NHC-only resources
6418fdf647 NEVERHOOD: Remove outdated comment
bfc5e73f12 NEVERHOOD: Add ResourceMan::exists helper function
08bb040f24 NEVERHOOD: Skip creating hotbox for "making of" is it's unavailable.


Commit: 0062f3b421a09c421717fe9f82e73b1d70f56088
    https://github.com/scummvm/scummvm/commit/0062f3b421a09c421717fe9f82e73b1d70f56088
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-02-02T17:35:16+01:00

Commit Message:
NEVERHOOD: Fix crash on NHC-only resources

This happens when attempting to play making of on japanese version when
NHC is loaded.

Changed paths:
    engines/neverhood/resourceman.cpp


diff --git a/engines/neverhood/resourceman.cpp b/engines/neverhood/resourceman.cpp
index 8269a17caa6..6c7c7d883e1 100644
--- a/engines/neverhood/resourceman.cpp
+++ b/engines/neverhood/resourceman.cpp
@@ -134,7 +134,7 @@ bool ResourceMan::nhcExists(uint32 fileHash, uint32 type) {
 void ResourceMan::queryResource(uint32 fileHash, ResourceHandle &resourceHandle) {
 	ResourceFileEntry *firstEntry;
 	resourceHandle._resourceFileEntry = findEntry(fileHash, &firstEntry);
-	resourceHandle._extData = firstEntry ? firstEntry->archiveEntry->extData : nullptr;
+	resourceHandle._extData = firstEntry && firstEntry->archiveEntry ? firstEntry->archiveEntry->extData : nullptr;
 }
 
 struct EntrySizeFix {


Commit: 6418fdf6479be4e8add2bc16d10b3d5ba5b389ed
    https://github.com/scummvm/scummvm/commit/6418fdf6479be4e8add2bc16d10b3d5ba5b389ed
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-02-02T17:35:22+01:00

Commit Message:
NEVERHOOD: Remove outdated comment

Changed paths:
    engines/neverhood/resourceman.cpp


diff --git a/engines/neverhood/resourceman.cpp b/engines/neverhood/resourceman.cpp
index 6c7c7d883e1..e10a5523bf2 100644
--- a/engines/neverhood/resourceman.cpp
+++ b/engines/neverhood/resourceman.cpp
@@ -191,7 +191,6 @@ void ResourceMan::loadResource(ResourceHandle &resourceHandle, bool applyResourc
 			resourceData->dataRefCount++;
 		} else {
 			NhcArchiveEntry *nhcEntry = resourceHandle._resourceFileEntry->nhcArchiveEntry;
-			// TODO: types B (subfont), C (MgsText), D (SubText)
 			if (nhcEntry && nhcEntry->isNormal()) {
 				resourceData->data = new byte[nhcEntry->size];
 				resourceHandle._resourceFileEntry->nhcArchive->load(nhcEntry, resourceData->data, 0);


Commit: bfc5e73f12509d27bf365adab722e502e87b654d
    https://github.com/scummvm/scummvm/commit/bfc5e73f12509d27bf365adab722e502e87b654d
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-02-02T17:35:33+01:00

Commit Message:
NEVERHOOD: Add ResourceMan::exists helper function

This is essentially same ads attempting to open the file in question but
without incurring I/O cost.

Changed paths:
    engines/neverhood/resourceman.cpp
    engines/neverhood/resourceman.h


diff --git a/engines/neverhood/resourceman.cpp b/engines/neverhood/resourceman.cpp
index e10a5523bf2..1e755bada0b 100644
--- a/engines/neverhood/resourceman.cpp
+++ b/engines/neverhood/resourceman.cpp
@@ -131,6 +131,17 @@ bool ResourceMan::nhcExists(uint32 fileHash, uint32 type) {
 	return false;
 }
 
+bool ResourceMan::exists(uint32 fileHash) {
+	ResourceFileEntry *entry = findEntry(fileHash);
+	if (!entry)
+		return false;
+	if (entry->nhcArchiveEntry && entry->nhcArchive && entry->nhcArchiveEntry->isNormal())
+		return true;
+	if (entry->archiveEntry && entry->archive)
+		return true;
+	return false;
+}
+
 void ResourceMan::queryResource(uint32 fileHash, ResourceHandle &resourceHandle) {
 	ResourceFileEntry *firstEntry;
 	resourceHandle._resourceFileEntry = findEntry(fileHash, &firstEntry);
diff --git a/engines/neverhood/resourceman.h b/engines/neverhood/resourceman.h
index aeda82a9621..21f935d3bea 100644
--- a/engines/neverhood/resourceman.h
+++ b/engines/neverhood/resourceman.h
@@ -115,6 +115,7 @@ public:
 	Common::SeekableReadStream *createStream(uint32 fileHash);
 	Common::SeekableReadStream *createNhcStream(uint32 fileHash, uint32 type);
 	bool nhcExists(uint32 fileHash, uint32 type);
+	bool exists(uint32 fileHash);
 	const ResourceFileEntry& getEntry(uint index) { return _entries[index]; }
 	uint getEntryCount() { return _entries.size(); }
 	void queryResource(uint32 fileHash, ResourceHandle &resourceHandle);


Commit: 08bb040f2494b5b32cd3cbdd8586e433baa9d026
    https://github.com/scummvm/scummvm/commit/08bb040f2494b5b32cd3cbdd8586e433baa9d026
Author: Vladimir Serbinenko (phcoder at gmail.com)
Date: 2023-02-02T17:35:43+01:00

Commit Message:
NEVERHOOD: Skip creating hotbox for "making of" is it's unavailable.

Otherwise it  creates an invisible button that can still be clicked and
results in a button press animation followed by a brief read screen.

Reported by: -=CHE at TER=-

Changed paths:
    engines/neverhood/menumodule.cpp
    engines/neverhood/menumodule.h


diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index 5aa187fea81..61884674fd1 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -344,6 +344,13 @@ uint32 MenuButton::handleMessage(int messageNum, const MessageParam &param, Enti
 	return messageResult;
 }
 
+bool MainMenu::hasMakingOf() const {
+	for (uint i = 0; kMakingOfSmackerFileHashList[i]; i++)
+		if (_vm->_res->exists(kMakingOfSmackerFileHashList[i]))
+			return true;
+	return false;
+}
+
 MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
 	: Scene(vm, parentModule) {
 
@@ -382,6 +389,8 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
 		insertStaticSprite(0x0C24C0EE, 100);	// "Music is off" button
 
 	for (uint buttonIndex = 0; buttonIndex < 9; ++buttonIndex) {
+		if (buttonIndex == kMainMenuMakingOf && !hasMakingOf())
+			continue;
 		Sprite *menuButton = insertSprite<MenuButton>(this, buttonIndex,
 			kMenuButtonFileHashes[buttonIndex], kMenuButtonCollisionBounds[buttonIndex]);
 		addCollisionSprite(menuButton);
diff --git a/engines/neverhood/menumodule.h b/engines/neverhood/menumodule.h
index cda2e9b1611..e3715f42617 100644
--- a/engines/neverhood/menumodule.h
+++ b/engines/neverhood/menumodule.h
@@ -78,6 +78,7 @@ protected:
 class MainMenu : public Scene {
 public:
 	MainMenu(NeverhoodEngine *vm, Module *parentModule);
+	bool hasMakingOf() const;
 protected:
 	uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
 };




More information about the Scummvm-git-logs mailing list