Commits

Didrole  committed 42ee013

Added a way to specify the library search order in CSteamAPILoader.
The default value will prefer local files rather than steam install files.

  • Participants
  • Parent commits 3fbce02

Comments (0)

Files changed (1)

File Open Steamworks/Interface_OSW.h

 class CSteamAPILoader
 {
 public:
-	CSteamAPILoader()
+	enum ESearchOrder
 	{
+		k_ESearchOrderLocalFirst,
+		k_ESearchOrderSteamInstallFirst,
+	};
+
+	CSteamAPILoader(ESearchOrder eSearchOrder = k_ESearchOrderLocalFirst)
+	{
+		m_eSearchOrder = eSearchOrder;
 		m_pSteamclient = NULL;
 		m_pSteam = NULL;
 
 
 	void TryLoadLibraries()
 	{
+		if(m_eSearchOrder == k_ESearchOrderLocalFirst)
+		{
+			m_pSteamclient = new DynamicLibrary(k_cszSteam3LibraryName);
+			m_pSteam = new DynamicLibrary(k_cszSteam2LibraryName);
+
+			if(!m_pSteamclient->IsLoaded() || !m_pSteam->IsLoaded())
+			{
+				delete m_pSteamclient;
+				m_pSteamclient = NULL;
+
+				delete m_pSteam;
+				m_pSteam = NULL;
+			}
+			else
+				return;
+		}
+
 #ifdef _WIN32
 		// steamclient.dll expects to be able to load tier0_s without an absolute
 		// path, so we'll need to add the steam dir to the search path.
 
 	DynamicLibrary* m_pSteamclient;
 	DynamicLibrary* m_pSteam;
+
+	ESearchOrder m_eSearchOrder;
 };
 
 #ifdef _MSC_VER