[Scummvm-cvs-logs] SF.net SVN: scummvm:[48743] tools/trunk/gui/main.cpp

criezy at users.sourceforge.net criezy at users.sourceforge.net
Tue Apr 20 13:22:57 CEST 2010


Revision: 48743
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48743&view=rev
Author:   criezy
Date:     2010-04-20 11:22:56 +0000 (Tue, 20 Apr 2010)

Log Message:
-----------
Change (again) the way the image files are loaded in the tools GUI. This should improve the chances to find the files.

Modified Paths:
--------------
    tools/trunk/gui/main.cpp

Modified: tools/trunk/gui/main.cpp
===================================================================
--- tools/trunk/gui/main.cpp	2010-04-20 11:13:09 UTC (rev 48742)
+++ tools/trunk/gui/main.cpp	2010-04-20 11:22:56 UTC (rev 48743)
@@ -573,19 +573,19 @@
 	wxBitmap bitmap;
 
 	// Tries the following locations (in that order):
-	// - wxStandardPaths::GetResourcesDir()
-	//   On Windows and Mac only or as a fall back on other platforms if APP_MEDIA_PATH is not defined.
+	// - wxStandardPaths::Get().GetResourcesDir()
+	//   On all platfforms. It should be the default place where the files are located.
 	// - APP_MEDIA_PATH/scummvm-tools
-	//   Linux/Unix (should be the same as GetResourcesDir(), but this GetResourcesDir() is not always correct on Linux/Unix)
-	//   APP_MEDIA_PATH is set by configure and is not correct for MacOS X bundle and probably not set for Windows.
+	//   When APP_MEDIA_PATH is defined (i.e. on platform where configure is used).
+	//   With wxWidgets 2.8 wxStandardPaths::Get().GetResourcesDir() does not always return the expected path.
 	// - CURRENT_DIR/media
 	//   On all platforms. This is a fallback if the above fails.
 	// - CURRENT_DIR/gui/media
 	//   On all platforms. This in last resort and is needed when running from the source tree.
-#if defined(__WXMAC__) || defined(__WXMSW__) || !defined(APP_MEDIA_PATH)
 	bitmap.LoadFile(wxStandardPaths::Get().GetResourcesDir() + wxT("/") + file, type);
-#else
-	bitmap.LoadFile(wxString(wxT(APP_MEDIA_PATH)) + wxT("/scummvm-tools/") + file, type);
+#ifdef APP_MEDIA_PATH
+	if (!bitmap.IsOk())
+		bitmap.LoadFile(wxString(wxT(APP_MEDIA_PATH)) + wxT("/scummvm-tools/") + file, type);
 #endif
 	if (!bitmap.IsOk())
 		bitmap.LoadFile(wxT("media/") + file, type);


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