[Scummvm-cvs-logs] SF.net SVN: scummvm:[41309] scummvm/trunk/gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jun 7 01:22:22 CEST 2009


Revision: 41309
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41309&view=rev
Author:   fingolfin
Date:     2009-06-06 23:22:22 +0000 (Sat, 06 Jun 2009)

Log Message:
-----------
GUI: Simplified ThemeEngine::getImageSurface (this way it's easier to add more graphics in the future ;)

Modified Paths:
--------------
    scummvm/trunk/gui/ThemeEngine.cpp
    scummvm/trunk/gui/ThemeEngine.h

Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp	2009-06-06 21:54:12 UTC (rev 41308)
+++ scummvm/trunk/gui/ThemeEngine.cpp	2009-06-06 23:22:22 UTC (rev 41309)
@@ -50,6 +50,10 @@
 
 namespace GUI {
 
+const char * const ThemeEngine::kImageLogo = "logo.bmp";
+const char * const ThemeEngine::kImageLogoSmall = "logo_small.bmp";
+const char * const ThemeEngine::kImageSearch = "search.bmp";
+
 struct TextDrawData {
 	const Graphics::Font *_fontPtr;
 

Modified: scummvm/trunk/gui/ThemeEngine.h
===================================================================
--- scummvm/trunk/gui/ThemeEngine.h	2009-06-06 21:54:12 UTC (rev 41308)
+++ scummvm/trunk/gui/ThemeEngine.h	2009-06-06 23:22:22 UTC (rev 41309)
@@ -182,12 +182,10 @@
 		kShadingLuminance	//!< Converting colors to luminance for unused areas
 	};
 
-	//! Special image ids for images used in the GUI
-	enum kThemeImages {
-		kImageLogo = 0,		//!< ScummVM logo used in the launcher
-		kImageLogoSmall,	//!< ScummVM logo used in the GMM
-		kImageSearch		//!< Search tool image used in the launcher
-	};
+	// Special image ids for images used in the GUI
+	static const char * const kImageLogo;		//!< ScummVM logo used in the launcher
+	static const char * const kImageLogoSmall;	//!< ScummVM logo used in the GMM
+	static const char * const kImageSearch;	//!< Search tool image used in the launcher
 
 	/**
 	 * Graphics mode enumeration.
@@ -422,17 +420,8 @@
 		return _bitmaps.contains(name) ? _bitmaps[name] : 0;
 	}
 
-	const Graphics::Surface *getImageSurface(const kThemeImages n) const {
-		switch (n) {
-		case kImageLogo:
-			return _bitmaps.contains("logo.bmp") ? _bitmaps["logo.bmp"] : 0;
-		case kImageLogoSmall:
-			return _bitmaps.contains("logo_small.bmp") ? _bitmaps["logo_small.bmp"] : 0;
-		case kImageSearch:
-			return _bitmaps.contains("search.bmp") ? _bitmaps["search.bmp"] : 0;
-		default:
-			return 0;
-		}
+	const Graphics::Surface *getImageSurface(const Common::String &name) const {
+		return _bitmaps.contains(name) ? _bitmaps[name] : 0;
 	}
 
 	/**


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