forked from BonneCW/GD3D11
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Fix hashing render states over uninitialized variables -Fix some awful glitches in indoor locations with enabled shadows -Remove unused calculations for some particle effects -Force water to be rendered always when texture is available -Change cache-in to not check for cache-out since dx7 code doesn't check for it too -Allow Steam Overlay to properly acquire/release inputs
- Loading branch information
1 parent
1710bb9
commit 7f81d93
Showing
11 changed files
with
114 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "Engine.h" | ||
#include "GothicAPI.h" | ||
#include "SteamOverlay.h" | ||
|
||
// We can detect whether steam overlay is visible by checking if it request using mouse or keyboard | ||
// easiest way to do it would be by using steamapi callbacks however because the game can be launched | ||
// without steam it doesn't feel right doing it that way | ||
namespace SteamOverlay | ||
{ | ||
static bool IsSteamOverlayEnabled = false; | ||
|
||
typedef bool( WINAPI* PFN_IsOverlayEnabled )(); | ||
typedef bool( WINAPI* PFN_SteamOverlayIsUsingMouse )(); | ||
typedef bool( WINAPI* PFN_SteamOverlayIsUsingKeyboard )(); | ||
static PFN_IsOverlayEnabled IsOverlayEnabled = nullptr; | ||
static PFN_SteamOverlayIsUsingMouse SteamOverlayIsUsingMouse = nullptr; | ||
static PFN_SteamOverlayIsUsingKeyboard SteamOverlayIsUsingKeyboard = nullptr; | ||
|
||
void Init() | ||
{ | ||
HMODULE soModule = GetModuleHandleA( "GameOverlayRenderer.dll" ); | ||
if ( soModule ) { | ||
IsOverlayEnabled = reinterpret_cast<PFN_IsOverlayEnabled>(GetProcAddress( soModule, "IsOverlayEnabled" )); | ||
SteamOverlayIsUsingMouse = reinterpret_cast<PFN_SteamOverlayIsUsingMouse>(GetProcAddress( soModule, "SteamOverlayIsUsingMouse" )); | ||
SteamOverlayIsUsingKeyboard = reinterpret_cast<PFN_SteamOverlayIsUsingKeyboard>(GetProcAddress( soModule, "SteamOverlayIsUsingKeyboard" )); | ||
} | ||
} | ||
|
||
void Update() | ||
{ | ||
if ( IsOverlayEnabled && IsOverlayEnabled() && (SteamOverlayIsUsingMouse || SteamOverlayIsUsingKeyboard) ) { | ||
bool isSOEnabled = (SteamOverlayIsUsingMouse && SteamOverlayIsUsingMouse()) || (SteamOverlayIsUsingKeyboard && SteamOverlayIsUsingKeyboard()); | ||
if ( IsSteamOverlayEnabled != isSOEnabled ) { | ||
Engine::GAPI->SetEnableGothicInput( IsSteamOverlayEnabled ); | ||
IsSteamOverlayEnabled = isSOEnabled; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
namespace SteamOverlay | ||
{ | ||
void Init(); | ||
void Update(); | ||
}; |
Oops, something went wrong.