[Scummvm-cvs-logs] SF.net SVN: scummvm:[53475] scummvm/trunk/engines/sword25/gfx/graphicengine .cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Oct 15 14:16:57 CEST 2010


Revision: 53475
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53475&view=rev
Author:   fingolfin
Date:     2010-10-15 12:16:57 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
SWORD25: Fix a few global constructor warnings

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/gfx/graphicengine.cpp

Modified: scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/graphicengine.cpp	2010-10-15 10:52:23 UTC (rev 53474)
+++ scummvm/trunk/engines/sword25/gfx/graphicengine.cpp	2010-10-15 12:16:57 UTC (rev 53475)
@@ -60,16 +60,10 @@
 }
 }
 
-namespace {
-const int BIT_DEPTH = 32;
-const int BACKBUFFER_COUNT = 1;
-const Common::String PNG_EXTENSION(".png");
-const Common::String PNG_S_EXTENSION("_s.png");
-const Common::String ANI_EXTENSION("_ani.xml");
-const Common::String FNT_EXTENSION("_fnt.xml");
-const Common::String SWF_EXTENSION(".swf");
-const Common::String B25S_EXTENSION(".b25s");
-}
+enum {
+	BIT_DEPTH = 32,
+	BACKBUFFER_COUNT = 1
+};
 
 
 namespace Sword25 {
@@ -261,7 +255,7 @@
 	BS_ASSERT(canLoadResource(FileName));
 
 	// Bild f\xFCr den Softwarebuffer laden
-	if (FileName.hasSuffix(PNG_S_EXTENSION)) {
+	if (FileName.hasSuffix("_s.png")) {
 		bool Result = false;
 		SWImage *pImage = new SWImage(FileName, Result);
 		if (!Result) {
@@ -279,7 +273,7 @@
 	}
 
 	// Sprite-Bild laden
-	if (FileName.hasSuffix(PNG_EXTENSION) || FileName.hasSuffix(B25S_EXTENSION)) {
+	if (FileName.hasSuffix(".png") || FileName.hasSuffix(".b25s")) {
 		bool Result = false;
 		RenderedImage *pImage = new RenderedImage(FileName, Result);
 		if (!Result) {
@@ -298,7 +292,7 @@
 
 
 	// Vectorgraphik laden
-	if (FileName.hasSuffix(SWF_EXTENSION)) {
+	if (FileName.hasSuffix(".swf")) {
 		debug(2, "VectorImage: %s", FileName.c_str());
 
 		// Pointer auf Package-Manager holen
@@ -333,7 +327,7 @@
 	}
 
 	// Animation laden
-	if (FileName.hasSuffix(ANI_EXTENSION)) {
+	if (FileName.hasSuffix("_ani.xml")) {
 		AnimationResource *pResource = new AnimationResource(FileName);
 		if (pResource->isValid())
 			return pResource;
@@ -344,7 +338,7 @@
 	}
 
 	// Font laden
-	if (FileName.hasSuffix(FNT_EXTENSION)) {
+	if (FileName.hasSuffix("_fnt.xml")) {
 		FontResource *pResource = new FontResource(Kernel::GetInstance(), FileName);
 		if (pResource->IsValid())
 			return pResource;
@@ -361,11 +355,11 @@
 // -----------------------------------------------------------------------------
 
 bool GraphicEngine::canLoadResource(const Common::String &FileName) {
-	return FileName.hasSuffix(PNG_EXTENSION) ||
-		FileName.hasSuffix(ANI_EXTENSION) ||
-		FileName.hasSuffix(FNT_EXTENSION) ||
-		FileName.hasSuffix(SWF_EXTENSION) ||
-		FileName.hasSuffix(B25S_EXTENSION);
+	return FileName.hasSuffix(".png") ||
+		FileName.hasSuffix("_ani.xml") ||
+		FileName.hasSuffix("_fnt.xml") ||
+		FileName.hasSuffix(".swf") ||
+		FileName.hasSuffix(".b25s");
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list