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

criezy at users.sourceforge.net criezy at users.sourceforge.net
Sun Apr 18 21:39:09 CEST 2010


Revision: 48701
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48701&view=rev
Author:   criezy
Date:     2010-04-18 19:39:09 +0000 (Sun, 18 Apr 2010)

Log Message:
-----------
Modify (again) the way the images are loaded. It now tries either wxStandardPaths::GetResourcesDir() (on MacOS X and Windows) or APP_MEDIAD_PATH (on Linux/Unix) but not both. This is to avoid picking up the wrong files.

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

Modified: tools/trunk/gui/main.cpp
===================================================================
--- tools/trunk/gui/main.cpp	2010-04-18 18:05:51 UTC (rev 48700)
+++ tools/trunk/gui/main.cpp	2010-04-18 19:39:09 UTC (rev 48701)
@@ -574,13 +574,18 @@
 
 	// Tries the following locations (in that order):
 	// - wxStandardPaths::GetResourcesDir()
-	// - APP_MEDIA_PATH/scummvm-tools (this one is because GetResourcesDir() is not always correct on Linux/Unix)
-	// - CURRENT_DIR/media (mainly for Windows when installed)
-	// - CURRENT_DIR/gui/media (for all platforms when not installed)
+	//   On Windows and Mac only or as a fall back on other platforms if APP_MEDIA_PATH is not defined.
+	// - 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.
+	// - 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);
-#ifdef APP_MEDIA_PATH
-	if (!bitmap.IsOk())
-		bitmap.LoadFile(wxString(wxT(APP_MEDIA_PATH)) + wxT("/scummvm-tools/") + file, type);
+#else
+	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