From 450b58839d9be31bd79c29e44600351817ecba75 Mon Sep 17 00:00:00 2001 From: mordentral Date: Wed, 24 Feb 2016 09:01:22 -0500 Subject: [PATCH] dsf --- .../AdvancedSessions.Build.cs | 4 ++-- .../Private/AdvancedFriendsLibrary.cpp | 24 +++++++++++++++++-- .../Private/AdvancedVoiceLibrary.cpp | 2 +- .../Private/OnlineSubSystemHeader.h | 14 +++++++---- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Source/AdvancedSessions/AdvancedSessions.Build.cs b/Source/AdvancedSessions/AdvancedSessions.Build.cs index ab364a0..80409ba 100644 --- a/Source/AdvancedSessions/AdvancedSessions.Build.cs +++ b/Source/AdvancedSessions/AdvancedSessions.Build.cs @@ -7,7 +7,7 @@ public class AdvancedSessions : ModuleRules { PrivateIncludePaths.AddRange(new string[] { "AdvancedSessions/Private"/*, "OnlineSubsystemSteam/Private"*/ }); PublicIncludePaths.AddRange(new string[] { "AdvancedSessions/Public" }); - PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem","CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets", "Steamworks"/*, "OnlineSubsystemSteam"*/ }); - PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking"/*, "Steamworks", "OnlineSubsystemSteam"*/ }); + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystem","CoreUObject", "OnlineSubsystemUtils", "Networking", "Sockets", "Steamworks", /*"Voice", "OnlineSubsystemSteam"*/ }); + PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "Sockets", "Networking","OnlineSubsystemUtils", /*"Voice", "Steamworks", "OnlineSubsystemSteam"*/ }); } } \ No newline at end of file diff --git a/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp b/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp index 9fbf50f..e87f43b 100644 --- a/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp +++ b/Source/AdvancedSessions/Private/AdvancedFriendsLibrary.cpp @@ -1,8 +1,29 @@ // Fill out your copyright notice in the Description page of Project Settings. #include "OnlineSubSystemHeader.h" #include "AdvancedFriendsLibrary.h" + + +// This is taken directly from UE4 - OnlineSubsystemSteamPrivatePCH.h as a fix for the array_count macro + +// @todo Steam: Steam headers trigger secure-C-runtime warnings in Visual C++. Rather than mess with _CRT_SECURE_NO_WARNINGS, we'll just +// disable the warnings locally. Remove when this is fixed in the SDK +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4996) +#endif + +#pragma push_macro("ARRAY_COUNT") +#undef ARRAY_COUNT + #include +#pragma pop_macro("ARRAY_COUNT") + +// @todo Steam: See above +#ifdef _MSC_VER +#pragma warning(pop) +#endif + //General Log DEFINE_LOG_CATEGORY(AdvancedFriendsLog); @@ -102,7 +123,7 @@ UTexture2D * UAdvancedFriendsLibrary::GetSteamFriendAvatar(APlayerController *Pl if (Width > 0 && Height > 0) { //Creating the buffer "oAvatarRGBA" and then filling it with the RGBA Stream from the Steam Avatar - BYTE *oAvatarRGBA = new BYTE[Width * Height * 4]; + uint8 *oAvatarRGBA = new uint8[Width * Height * 4]; //Filling the buffer with the RGBA Stream from the Steam Avatar and creating a UTextur2D to parse the RGBA Steam in @@ -121,7 +142,6 @@ UTexture2D * UAdvancedFriendsLibrary::GetSteamFriendAvatar(APlayerController *Pl UTexture2D* Avatar = UTexture2D::CreateTransient(Width, Height, PF_R8G8B8A8); - //MAGIC! uint8* MipData = (uint8*)Avatar->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE); FMemory::Memcpy(MipData, (void*)oAvatarRGBA, Height * Width * 4); Avatar->PlatformData->Mips[0].BulkData.Unlock(); diff --git a/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp b/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp index fc1b7ea..c310cf6 100644 --- a/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp +++ b/Source/AdvancedSessions/Private/AdvancedVoiceLibrary.cpp @@ -8,7 +8,7 @@ DEFINE_LOG_CATEGORY(AdvancedVoiceLog); void UAdvancedVoiceLibrary::IsHeadsetPresent(bool & bHasHeadset, uint8 LocalPlayerNum) { IOnlineVoicePtr VoiceInterface = Online::GetVoiceInterface(); - + if (!VoiceInterface.IsValid()) { bHasHeadset = false; diff --git a/Source/AdvancedSessions/Private/OnlineSubSystemHeader.h b/Source/AdvancedSessions/Private/OnlineSubSystemHeader.h index fd8b29b..8e99714 100644 --- a/Source/AdvancedSessions/Private/OnlineSubSystemHeader.h +++ b/Source/AdvancedSessions/Private/OnlineSubSystemHeader.h @@ -13,9 +13,15 @@ #include "OnlineSubsystemUtilsClasses.h" #include "BlueprintDataDefinitions.h" + +/*#include "VoiceEngineImpl.h" +#include "VoiceInterfaceImpl.h" +#include "Voice.h"" +*/ + // Found this in the steam controller, seems like a nice thought since steam is throwing errors -// Disable crazy warnings that claim that standard C library is "deprecated". -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4996) +// Disable crazy warnings that claim that standard C library is "deprecated". +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4996) #endif