2015-06-06 18:46:10 +02:00
|
|
|
// BlitzSteam - Steam wrapper for Blitz.
|
|
|
|
|
// Copyright (C) 2015 Project Kube (Michael Fabian Dirks)
|
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2015-05-17 12:45:11 +02:00
|
|
|
#include "dllmain.h"
|
2015-06-06 14:33:52 +02:00
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT uint32_t DLL_CALL BlitzSteam_Init() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamAPI_Init();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_Init=_BlitzSteam_Init@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_Shutdown() {
|
2015-06-06 14:33:52 +02:00
|
|
|
SteamAPI_Shutdown();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_Shutdown=_BlitzSteam_Shutdown@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT uint32_t DLL_CALL BlitzSteam_IsSteamRunning() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamAPI_IsSteamRunning();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_IsSteamRunning=_BlitzSteam_IsSteamRunning@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT uint32_t DLL_CALL BlitzSteam_RestartAppIfNecessary(uint32 unOwnAppID) {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamAPI_RestartAppIfNecessary(unOwnAppID);
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_RestartAppIfNecessary=_BlitzSteam_RestartAppIfNecessary@4")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_SetMiniDumpComment(const char* pchMsg) {
|
2015-06-06 14:33:52 +02:00
|
|
|
SteamAPI_SetMiniDumpComment(pchMsg);
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_SetMiniDumpComment=_BlitzSteam_SetMiniDumpComment@4")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_WriteMiniDump(uint32_t uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID) {
|
2015-06-06 14:33:52 +02:00
|
|
|
SteamAPI_WriteMiniDump(uStructuredExceptionCode, pvExceptionInfo, uBuildID);
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_WriteMiniDump=_BlitzSteam_WriteMiniDump@12")
|
|
|
|
|
|
|
|
|
|
// Interface Pointers, configured by SteamAPI_Init().
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamClient* DLL_CALL BlitzSteamClient() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamClient();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamClient=_BlitzSteamClient@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamUser* DLL_CALL BlitzSteamUser() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamUser();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamUser=_BlitzSteamUser@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamFriends* DLL_CALL BlitzSteamFriends() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamFriends();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamFriends=_BlitzSteamFriends@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamUtils* DLL_CALL BlitzSteamUtils() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamUtils();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamUtils=_BlitzSteamUtils@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamMatchmaking* DLL_CALL BlitzSteamMatchmaking() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamMatchmaking();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamMatchmaking=_BlitzSteamMatchmaking@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamUserStats* DLL_CALL BlitzSteamUserStats() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamUserStats();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamUserStats=_BlitzSteamUserStats@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamApps* DLL_CALL BlitzSteamApps() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamApps();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamApps=_BlitzSteamApps@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamNetworking* DLL_CALL BlitzSteamNetworking() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamNetworking();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamNetworking=_BlitzSteamNetworking@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamMatchmakingServers* DLL_CALL BlitzSteamMatchmakingServers() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamMatchmakingServers();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamMatchmakingServers=_BlitzSteamMatchmakingServers@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamRemoteStorage* DLL_CALL BlitzSteamRemoteStorage() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamRemoteStorage();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamRemoteStorage=_BlitzSteamRemoteStorage@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamScreenshots* DLL_CALL BlitzSteamScreenshots() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamScreenshots();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamScreenshots=_BlitzSteamScreenshots@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamHTTP* DLL_CALL BlitzSteamHTTP() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamHTTP();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamHTTP=_BlitzSteamHTTP@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamUnifiedMessages* DLL_CALL BlitzSteamUnifiedMessages() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamUnifiedMessages();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamUnifiedMessages=_BlitzSteamUnifiedMessages@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamController* DLL_CALL BlitzSteamController() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamController();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamController=_BlitzSteamController@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamUGC* DLL_CALL BlitzSteamUGC() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamUGC();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamUGC=_BlitzSteamUGC@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamAppList* DLL_CALL BlitzSteamAppList() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamAppList();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamAppList=_BlitzSteamAppList@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamMusic* DLL_CALL BlitzSteamMusic() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamMusic();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamMusic=_BlitzSteamMusic@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamMusicRemote* DLL_CALL BlitzSteamMusicRemote() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamMusicRemote();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamMusicRemote=_BlitzSteamMusicRemote@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamHTMLSurface* DLL_CALL BlitzSteamHTMLSurface() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamHTMLSurface();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamHTMLSurface=_BlitzSteamHTMLSurface@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamInventory* DLL_CALL BlitzSteamInventory() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamInventory();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamInventory=_BlitzSteamInventory@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT ISteamVideo* DLL_CALL BlitzSteamVideo() {
|
2015-06-06 14:33:52 +02:00
|
|
|
return SteamVideo();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteamVideo=_BlitzSteamVideo@0")
|
2015-06-06 18:46:10 +02:00
|
|
|
|
|
|
|
|
// Callbacks & Hooks
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_RunCallbacks() {
|
2015-06-06 18:46:10 +02:00
|
|
|
SteamAPI_RunCallbacks();
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_RunCallbacks=_BlitzSteam_RunCallbacks@0")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_RegisterCallback(class CCallbackBase *pCallback, int iCallback) {
|
2015-06-06 18:46:10 +02:00
|
|
|
SteamAPI_RegisterCallback(pCallback, iCallback);
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_RegisterCallback=_BlitzSteam_RegisterCallback@8")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_UnregisterCallback(class CCallbackBase *pCallback) {
|
2015-06-06 18:46:10 +02:00
|
|
|
SteamAPI_UnregisterCallback(pCallback);
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_UnregisterCallback=_BlitzSteam_UnregisterCallback@4")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_RegisterCallResult(class CCallbackBase *pCallback, uint32_t hAPICall_L, uint32_t hAPICall_R) {
|
2015-06-06 18:46:10 +02:00
|
|
|
SteamAPI_RegisterCallResult(pCallback, ((uint64_t)hAPICall_L << 32) + (uint64_t)hAPICall_R);
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_RegisterCallResult=_BlitzSteam_RegisterCallResult@12")
|
|
|
|
|
|
2015-06-20 15:53:41 +02:00
|
|
|
DLL_EXPORT void DLL_CALL BlitzSteam_UnregisterCallResult(class CCallbackBase *pCallback, uint32_t hAPICall_L, uint32_t hAPICall_R) {
|
2015-06-06 18:46:10 +02:00
|
|
|
SteamAPI_UnregisterCallResult(pCallback, ((uint64_t)hAPICall_L << 32) + (uint64_t)hAPICall_R);
|
|
|
|
|
}
|
|
|
|
|
#pragma comment(linker, "/EXPORT:BlitzSteam_UnregisterCallResult=_BlitzSteam_UnregisterCallResult@12")
|