[Scummvm-git-logs] scummvm master -> 8c2b09d919671c99be96d42bc3aeecec9222b46a

bluegr bluegr at gmail.com
Wed May 1 22:52:59 CEST 2019


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

Summary:
8c2b09d919 COMMON: Replace NEResourceType and PEResourceType with a shared enum


Commit: 8c2b09d919671c99be96d42bc3aeecec9222b46a
    https://github.com/scummvm/scummvm/commit/8c2b09d919671c99be96d42bc3aeecec9222b46a
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2019-05-01T23:52:56+03:00

Commit Message:
COMMON: Replace NEResourceType and PEResourceType with a shared enum

Changed paths:
    common/winexe.h
    common/winexe_ne.h
    common/winexe_pe.h
    devtools/create_titanic/winexe.h
    devtools/create_titanic/winexe_pe.h
    engines/gnap/gnap.cpp
    engines/mohawk/cursors.cpp
    engines/scumm/he/moonbase/moonbase_fow.cpp
    graphics/fonts/winfont.cpp
    graphics/macgui/macmenu.cpp
    graphics/wincursor.cpp


diff --git a/common/winexe.h b/common/winexe.h
index cfadbf8..9aeea37 100644
--- a/common/winexe.h
+++ b/common/winexe.h
@@ -28,6 +28,31 @@
 
 namespace Common {
 
+/** The default Windows resources. */
+enum WinResourceType {
+	kWinCursor       = 0x01,
+	kWinBitmap       = 0x02,
+	kWinIcon         = 0x03,
+	kWinMenu         = 0x04,
+	kWinDialog       = 0x05,
+	kWinString       = 0x06,
+	kWinFontDir      = 0x07,
+	kWinFont         = 0x08,
+	kWinAccelerator  = 0x09,
+	kWinRCData       = 0x0A,
+	kWinMessageTable = 0x0B,
+	kWinGroupCursor  = 0x0C,
+	kWinGroupIcon    = 0x0E,
+	kWinVersion      = 0x10,
+	kWinDlgInclude   = 0x11,
+	kWinPlugPlay     = 0x13,
+	kWinVXD          = 0x14,
+	kWinAniCursor    = 0x15,
+	kWinAniIcon      = 0x16,
+	kWinHTML         = 0x17,
+	kWinManifest     = 0x18
+};
+
 class WinResourceID {
 public:
 	WinResourceID() { _idType = kIDTypeNull; }
diff --git a/common/winexe_ne.h b/common/winexe_ne.h
index d6698e6..1a84586 100644
--- a/common/winexe_ne.h
+++ b/common/winexe_ne.h
@@ -32,31 +32,6 @@ namespace Common {
 template<class T> class Array;
 class SeekableReadStream;
 
-/** The default Windows resources. */
-enum NEResourceType {
-	kNECursor       = 0x01,
-	kNEBitmap       = 0x02,
-	kNEIcon         = 0x03,
-	kNEMenu         = 0x04,
-	kNEDialog       = 0x05,
-	kNEString       = 0x06,
-	kNEFontDir      = 0x07,
-	kNEFont         = 0x08,
-	kNEAccelerator  = 0x09,
-	kNERCData       = 0x0A,
-	kNEMessageTable = 0x0B,
-	kNEGroupCursor  = 0x0C,
-	kNEGroupIcon    = 0x0E,
-	kNEVersion      = 0x10,
-	kNEDlgInclude   = 0x11,
-	kNEPlugPlay     = 0x13,
-	kNEVXD          = 0x14,
-	kNEAniCursor    = 0x15,
-	kNEAniIcon      = 0x16,
-	kNEHTML         = 0x17,
-	kNEManifest     = 0x18
-};
-
 /**
  * A class able to load resources from a Windows New Executable, such
  * as cursors, bitmaps, and sounds.
diff --git a/common/winexe_pe.h b/common/winexe_pe.h
index b163bd1..6f92cde 100644
--- a/common/winexe_pe.h
+++ b/common/winexe_pe.h
@@ -33,29 +33,6 @@ namespace Common {
 template<class T> class Array;
 class SeekableReadStream;
 
-/** The default Windows PE resources. */
-enum PEResourceType {
-	kPECursor =       0x01,
-	kPEBitmap =       0x02,
-	kPEIcon =         0x03,
-	kPEMenu =         0x04,
-	kPEDialog =       0x05,
-	kPEString =       0x06,
-	kPEFontDir =      0x07,
-	kPEFont =         0x08,
-	kPEAccelerator =  0x09,
-	kPERCData =       0x0A,
-	kPEMessageTable = 0x0B,
-	kPEGroupCursor =  0x0C,
-	kPEGroupIcon =    0x0E,
-	kPEVersion =      0x10,
-	kPEDlgInclude =   0x11,
-	kPEPlugPlay =     0x13,
-	kPEVXD =          0x14,
-	kPEAniCursor =    0x15,
-	kPEAniIcon =      0x16
-};
-
 /**
  * A class able to load resources from a Windows Portable Executable, such
  * as cursors, bitmaps, and sounds.
diff --git a/devtools/create_titanic/winexe.h b/devtools/create_titanic/winexe.h
index da99c76..102f149 100644
--- a/devtools/create_titanic/winexe.h
+++ b/devtools/create_titanic/winexe.h
@@ -28,6 +28,31 @@
 
 namespace Common {
 
+/** The default Windows resources. */
+enum WinResourceType {
+	kWinCursor       = 0x01,
+	kWinBitmap       = 0x02,
+	kWinIcon         = 0x03,
+	kWinMenu         = 0x04,
+	kWinDialog       = 0x05,
+	kWinString       = 0x06,
+	kWinFontDir      = 0x07,
+	kWinFont         = 0x08,
+	kWinAccelerator  = 0x09,
+	kWinRCData       = 0x0A,
+	kWinMessageTable = 0x0B,
+	kWinGroupCursor  = 0x0C,
+	kWinGroupIcon    = 0x0E,
+	kWinVersion      = 0x10,
+	kWinDlgInclude   = 0x11,
+	kWinPlugPlay     = 0x13,
+	kWinVXD          = 0x14,
+	kWinAniCursor    = 0x15,
+	kWinAniIcon      = 0x16,
+	kWinHTML         = 0x17,
+	kWinManifest     = 0x18
+};
+
 class WinResourceID {
 public:
 	WinResourceID() { _idType = kIDTypeNull; }
diff --git a/devtools/create_titanic/winexe_pe.h b/devtools/create_titanic/winexe_pe.h
index 3a065c9..3c96005 100644
--- a/devtools/create_titanic/winexe_pe.h
+++ b/devtools/create_titanic/winexe_pe.h
@@ -34,29 +34,6 @@ namespace Common {
 template<class T> class Array;
 class SeekableReadStream;
 
-/** The default Windows PE resources. */
-enum PEResourceType {
-	kPECursor =       0x01,
-	kPEBitmap =       0x02,
-	kPEIcon =         0x03,
-	kPEMenu =         0x04,
-	kPEDialog =       0x05,
-	kPEString =       0x06,
-	kPEFontDir =      0x07,
-	kPEFont =         0x08,
-	kPEAccelerator =  0x09,
-	kPERCData =       0x0A,
-	kPEMessageTable = 0x0B,
-	kPEGroupCursor =  0x0C,
-	kPEGroupIcon =    0x0E,
-	kPEVersion =      0x10,
-	kPEDlgInclude =   0x11,
-	kPEPlugPlay =     0x13,
-	kPEVXD =          0x14,
-	kPEAniCursor =    0x15,
-	kPEAniIcon =      0x16
-};
-
 /**
  * A class able to load resources from a Windows Portable Executable, such
  * as cursors, bitmaps, and sounds.
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index 9b0015e..aece4da 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -233,7 +233,7 @@ Common::Error GnapEngine::run() {
 		error("Could not load ufos.exe");
 
 #ifdef USE_FREETYPE2
-	Common::SeekableReadStream *stream = _exe->getResource(Common::kPEFont, 2000);
+	Common::SeekableReadStream *stream = _exe->getResource(Common::kWinFont, 2000);
 	_font = Graphics::loadTTFFont(*stream, 24);
 	if (!_font)
 		warning("Unable to load font");
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index 84b1c73..8adcbf6 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -253,7 +253,7 @@ PECursorManager::PECursorManager(const Common::String &appName) {
 		return;
 	}
 
-	const Common::Array<Common::WinResourceID> cursorGroups = exe.getNameList(Common::kPEGroupCursor);
+	const Common::Array<Common::WinResourceID> cursorGroups = exe.getNameList(Common::kWinGroupCursor);
 
 	_cursors.resize(cursorGroups.size());
 	for (uint i = 0; i < cursorGroups.size(); i++) {
diff --git a/engines/scumm/he/moonbase/moonbase_fow.cpp b/engines/scumm/he/moonbase/moonbase_fow.cpp
index 0837d9e..2e1265a 100644
--- a/engines/scumm/he/moonbase/moonbase_fow.cpp
+++ b/engines/scumm/he/moonbase/moonbase_fow.cpp
@@ -103,7 +103,7 @@ bool Moonbase::setFOWImage(int image) {
 					error("Cannot open file %s", _fileName.c_str());
 			}
 
-			Common::SeekableReadStream *stream = _exe.getResource(Common::kPERCData, resId);
+			Common::SeekableReadStream *stream = _exe.getResource(Common::kWinRCData, resId);
 
 			if (stream->size()) {
 				_fowImage = (uint8 *)malloc(stream->size());
diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp
index 141fc24..ec6ce6f 100644
--- a/graphics/fonts/winfont.cpp
+++ b/graphics/fonts/winfont.cpp
@@ -92,7 +92,7 @@ bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry &
 		return false;
 
 	// Let's pull out the font directory
-	Common::SeekableReadStream *fontDirectory = exe.getResource(Common::kNEFontDir, Common::String("FONTDIR"));
+	Common::SeekableReadStream *fontDirectory = exe.getResource(Common::kWinFontDir, Common::String("FONTDIR"));
 	if (!fontDirectory) {
 		warning("No font directory in '%s'", fileName.c_str());
 		return false;
@@ -109,7 +109,7 @@ bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry &
 	}
 
 	// Actually go get our font now...
-	Common::SeekableReadStream *fontStream = exe.getResource(Common::kNEFont, fontId);
+	Common::SeekableReadStream *fontStream = exe.getResource(Common::kWinFont, fontId);
 	if (!fontStream) {
 		warning("Could not find font %d in %s", fontId, fileName.c_str());
 		return false;
@@ -129,7 +129,7 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &
 	}
 
 	// Let's pull out the font directory
-	Common::SeekableReadStream *fontDirectory = exe->getResource(Common::kPEFontDir, Common::String("FONTDIR"));
+	Common::SeekableReadStream *fontDirectory = exe->getResource(Common::kWinFontDir, Common::String("FONTDIR"));
 	if (!fontDirectory) {
 		warning("No font directory in '%s'", fileName.c_str());
 		delete exe;
@@ -148,7 +148,7 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &
 	}
 
 	// Actually go get our font now...
-	Common::SeekableReadStream *fontStream = exe->getResource(Common::kPEFont, fontId);
+	Common::SeekableReadStream *fontStream = exe->getResource(Common::kWinFont, fontId);
 	if (!fontStream) {
 		warning("Could not find font %d in %s", fontId, fileName.c_str());
 		delete exe;
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index 45e05c5..131ee6f 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -183,7 +183,7 @@ static Common::U32String readUnicodeString(Common::SeekableReadStream *stream) {
 
 
 MacMenu *MacMenu::createMenuFromPEexe(Common::PEResources &exe, MacWindowManager *wm) {
-	Common::SeekableReadStream *menuData = exe.getResource(Common::kPEMenu, 128);
+	Common::SeekableReadStream *menuData = exe.getResource(Common::kWinMenu, 128);
 	if (!menuData)
 		return nullptr;
 
diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp
index 897886c..2e083e3 100644
--- a/graphics/wincursor.cpp
+++ b/graphics/wincursor.cpp
@@ -243,7 +243,7 @@ WinCursorGroup::~WinCursorGroup() {
 }
 
 WinCursorGroup *WinCursorGroup::createCursorGroup(Common::NEResources &exe, const Common::WinResourceID &id) {
-	Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kNEGroupCursor, id));
+	Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kWinGroupCursor, id));
 
 	if (!stream || stream->size() <= 6)
 		return 0;
@@ -276,7 +276,7 @@ WinCursorGroup *WinCursorGroup::createCursorGroup(Common::NEResources &exe, cons
 		stream->readUint32LE(); // data size
 		uint32 cursorId = stream->readUint32LE();
 
-		Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kNECursor, cursorId));
+		Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kWinCursor, cursorId));
 		if (!cursorStream) {
 			delete group;
 			return 0;
@@ -299,7 +299,7 @@ WinCursorGroup *WinCursorGroup::createCursorGroup(Common::NEResources &exe, cons
 }
 
 WinCursorGroup *WinCursorGroup::createCursorGroup(Common::PEResources &exe, const Common::WinResourceID &id) {
-	Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kPEGroupCursor, id));
+	Common::ScopedPtr<Common::SeekableReadStream> stream(exe.getResource(Common::kWinGroupCursor, id));
 
 	if (!stream || stream->size() <= 6)
 		return 0;
@@ -325,7 +325,7 @@ WinCursorGroup *WinCursorGroup::createCursorGroup(Common::PEResources &exe, cons
 		stream->readUint32LE(); // data size
 		uint32 cursorId = stream->readUint16LE();
 
-		Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kPECursor, cursorId));
+		Common::ScopedPtr<Common::SeekableReadStream> cursorStream(exe.getResource(Common::kWinCursor, cursorId));
 		if (!cursorStream) {
 			delete group;
 			return 0;





More information about the Scummvm-git-logs mailing list