disable spectating (should fix some crashes), option to load island at input location, fix compiler errors, work on container spawn rate.
This commit is contained in:
Milxnor
2023-04-29 18:35:49 -04:00
parent cda077d6f8
commit e04b3a2054
16 changed files with 190 additions and 95 deletions

View File

@@ -55,10 +55,7 @@ void ABuildingActor::OnDamageServerHook(ABuildingActor* BuildingActor, float Dam
// LOG_INFO(LogDev, "Before {}", __int64(CurveTable));
float Out;
FString ContextString;
EEvaluateCurveTableResult result;
UDataTableFunctionLibrary::EvaluateCurveTableRow(CurveTable, BuildingResourceAmountOverride.RowName, 0.f, ContextString, &result, &Out);
float Out = UDataTableFunctionLibrary::EvaluateCurveTableRow(CurveTable, BuildingResourceAmountOverride.RowName, 0.f);
// LOG_INFO(LogDev, "Out: {}", Out);

View File

@@ -2,10 +2,10 @@
#include "reboot.h"
void UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY,
const FString& ContextString, EEvaluateCurveTableResult* OutResult, float* OutXY)
float UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY,
const FString& ContextString, EEvaluateCurveTableResult* OutResult)
{
static auto fn = FindObject<UFunction>("/Script/Engine.DataTableFunctionLibrary.EvaluateCurveTableRow");
static auto fn = FindObject<UFunction>(L"/Script/Engine.DataTableFunctionLibrary.EvaluateCurveTableRow");
float wtf{};
EEvaluateCurveTableResult wtf1{};
@@ -19,12 +19,11 @@ void UDataTableFunctionLibrary::EvaluateCurveTableRow(UCurveTable* CurveTable, F
if (OutResult)
*OutResult = UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutResult;
if (OutXY)
*OutXY = UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutXY;
return UDataTableFunctionLibrary_EvaluateCurveTableRow_Params.OutXY;
}
UClass* UDataTableFunctionLibrary::StaticClass()
{
static auto Class = FindObject<UClass>("/Script/Engine.DataTableFunctionLibrary");
static auto Class = FindObject<UClass>(L"/Script/Engine.DataTableFunctionLibrary");
return Class;
}

View File

@@ -14,8 +14,8 @@ enum class EEvaluateCurveTableResult : uint8_t
class UDataTableFunctionLibrary : public UObject
{
public:
static void EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY,
const FString& ContextString, EEvaluateCurveTableResult* OutResult, float* OutXY);
static float EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY,
const FString& ContextString = FString(), EEvaluateCurveTableResult* OutResult = nullptr);
static UClass* StaticClass();
};

View File

@@ -0,0 +1,45 @@
#pragma once
#include "Actor.h"
#include "GameplayAbilityTypes.h"
class AFortAthenaMapInfo : public AActor
{
public:
UClass*& GetAmmoBoxClass()
{
static auto AmmoBoxClassOffset = GetOffset("AmmoBoxClass");
return Get<UClass*>(AmmoBoxClassOffset);
}
FScalableFloat* GetAmmoBoxMinSpawnPercent()
{
static auto AmmoBoxMinSpawnPercentOffset = GetOffset("AmmoBoxMinSpawnPercent");
return GetPtr<FScalableFloat>(AmmoBoxMinSpawnPercentOffset);
}
FScalableFloat* GetAmmoBoxMaxSpawnPercent()
{
static auto AmmoBoxMaxSpawnPercentOffset = GetOffset("AmmoBoxMaxSpawnPercent");
return GetPtr<FScalableFloat>(AmmoBoxMaxSpawnPercentOffset);
}
UClass*& GetTreasureChestClass()
{
static auto TreasureChestClassOffset = GetOffset("TreasureChestClass");
return Get<UClass*>(TreasureChestClassOffset);
}
FScalableFloat* GetTreasureChestMinSpawnPercent()
{
static auto TreasureChestMinSpawnPercentOffset = GetOffset("TreasureChestMinSpawnPercent");
return GetPtr<FScalableFloat>(TreasureChestMinSpawnPercentOffset);
}
FScalableFloat* GetTreasureChestMaxSpawnPercent()
{
static auto TreasureChestMaxSpawnPercentOffset = GetOffset("TreasureChestMaxSpawnPercent");
return GetPtr<FScalableFloat>(TreasureChestMaxSpawnPercentOffset);
}
};

View File

@@ -12,6 +12,7 @@
#include "FortAbilitySet.h"
#include "NetSerialization.h"
#include "GameplayStatics.h"
#include "DataTableFunctionLibrary.h"
#include "KismetStringLibrary.h"
#include "SoftObjectPtr.h"
@@ -27,6 +28,7 @@
#include "FortAthenaMutator.h"
#include "calendar.h"
#include "gui.h"
#include <random>
static UFortPlaylist* GetPlaylistToUse()
{
@@ -121,6 +123,19 @@ UClass* AFortGameModeAthena::GetVehicleClassOverride(UClass* DefaultClass)
return GetVehicleClassOverride_Params.ReturnValue;
}
void AFortGameModeAthena::HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage)
{
TArray<AActor*> AllActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), ActorClass);
int AmmoBoxesToDelete = std::round(AllActors.Num() - ((AllActors.Num()) * (SpawnPercentage / 100)));
while (AmmoBoxesToDelete)
{
AllActors.at(rand() % AllActors.Num())->K2_DestroyActor();
AmmoBoxesToDelete--;
}
}
bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode)
{
Globals::bHitReadyToStartMatch = true;
@@ -467,16 +482,11 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
LastNum9 = Globals::AmountOfListens;
}
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
auto MapInfo = GameState->Get(MapInfoOffset);
auto MapInfo = GameState->GetMapInfo();
if (!MapInfo && Engine_Version >= 421)
return false;
// if (GameState->GetPlayersLeft() < GameMode->Get<int>("WarmupRequiredPlayerCount"))
// if (!bFirstPlayerJoined)
// return false;
static int LastNum = 1;
if (Globals::AmountOfListens != LastNum)
@@ -507,7 +517,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
GameSession->Get<int>(MaxPlayersOffset) = 100;
// if (Engine_Version < 424)
GameState->OnRep_CurrentPlaylistInfo(); // ?
// SetupNavConfig();
@@ -821,6 +830,34 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
SpawnBGAs();
// Handle spawn rate
if (false)
{
auto MapInfo = GameState->GetMapInfo();
if (MapInfo)
{
float AmmoBoxMinSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(
MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().CurveTable, MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().RowName, 0
);
float AmmoBoxMaxSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(
MapInfo->GetAmmoBoxMaxSpawnPercent()->GetCurve().CurveTable, MapInfo->GetAmmoBoxMaxSpawnPercent()->GetCurve().RowName, 0
);
LOG_INFO(LogDev, "AmmoBoxMinSpawnPercent: {} AmmoBoxMaxSpawnPercent: {}", AmmoBoxMinSpawnPercent, AmmoBoxMaxSpawnPercent);
std::random_device AmmoBoxRd;
std::mt19937 AmmoBoxGen(AmmoBoxRd());
std::uniform_int_distribution<> AmmoBoxDis(AmmoBoxMinSpawnPercent * 100, AmmoBoxMaxSpawnPercent * 100 + 1); // + 1 ?
float AmmoBoxSpawnPercent = AmmoBoxDis(AmmoBoxGen);
HandleSpawnRateForActorClass(MapInfo->GetAmmoBoxClass(), AmmoBoxSpawnPercent);
}
}
auto SpawnIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C");
auto BRIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_01.Tiered_Athena_FloorLoot_01_C");
@@ -841,10 +878,6 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
{
ABuildingContainer* CurrentActor = (ABuildingContainer*)SpawnIsland_FloorLoot_Actors.at(i);
// CurrentActor->K2_DestroyActor();
// continue;
// if (Engine_Version != 419)
{
auto Location = CurrentActor->GetActorLocation();
Location.Z += UpZ;

View File

@@ -224,6 +224,10 @@ public:
FName RedirectLootTier(const FName& LootTier);
UClass* GetVehicleClassOverride(UClass* DefaultClass);
// Idk where to put these 3 functions.
static void HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage);
static bool Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode);
static int Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller);
static void Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor);

View File

@@ -6,6 +6,7 @@
#include "BuildingStructuralSupportSystem.h"
#include "ScriptInterface.h"
#include "Interface.h"
#include "FortAthenaMapInfo.h"
enum class EAthenaGamePhaseStep : uint8_t // idk if this changes
{
@@ -79,6 +80,12 @@ public:
return Get<FPlayerBuildableClassContainer*>(PlayerBuildableClassesOffset);
}
AFortAthenaMapInfo*& GetMapInfo()
{
static auto MapInfoOffset = GetOffset("MapInfo");
return Get<AFortAthenaMapInfo*>(MapInfoOffset);
}
UFortPlaylist*& GetCurrentPlaylist();
TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface();

View File

@@ -1291,7 +1291,7 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
{
static auto bAllowSpectateAfterDeathOffset = GameMode->GetOffset("bAllowSpectateAfterDeath");
bool bAllowSpectate = GameMode->Get<bool>(bAllowSpectateAfterDeathOffset);
bool bAllowSpectate = false; // GameMode->Get<bool>(bAllowSpectateAfterDeathOffset);
LOG_INFO(LogDev, "bAllowSpectate: {}", bAllowSpectate);

View File

@@ -159,18 +159,14 @@ void AFortPlayerControllerAthena::EnterAircraftHook(UObject* PC, AActor* Aircraf
if (!ItemToGive->GetItemToDrop())
continue;
float Out = 1;
FString ContextString;
EEvaluateCurveTableResult result;
float Out2 = 0;
if (!IsBadReadPtr(ItemToGive->GetNumberToGive().GetCurve().CurveTable, 8) && ItemToGive->GetNumberToGive().GetCurve().RowName.IsValid())
{
UDataTableFunctionLibrary::EvaluateCurveTableRow(ItemToGive->GetNumberToGive().GetCurve().CurveTable, ItemToGive->GetNumberToGive().GetCurve().RowName,
0.f, ContextString, &result, &Out2);
Out2 = UDataTableFunctionLibrary::EvaluateCurveTableRow(ItemToGive->GetNumberToGive().GetCurve().CurveTable, ItemToGive->GetNumberToGive().GetCurve().RowName, 0.f);
}
LOG_INFO(LogDev, "[{}] [{}] Out: {} Out2: {} ItemToGive.ItemToDrop: {}", i, j, Out, Out2, ItemToGive->GetItemToDrop()->IsValidLowLevel() ? ItemToGive->GetItemToDrop()->GetFullName() : "BadRead");
LOG_INFO(LogDev, "[{}] [{}] Out2: {} ItemToGive.ItemToDrop: {}", i, j, Out2, ItemToGive->GetItemToDrop()->IsValidLowLevel() ? ItemToGive->GetItemToDrop()->GetFullName() : "BadRead");
if (!Out2)
continue;

View File

@@ -284,7 +284,7 @@
<ClInclude Include="commands.h" />
<ClInclude Include="ContainerAllocationPolicies.h" />
<ClInclude Include="Controller.h" />
<ClInclude Include="creative.h" />
<ClInclude Include="builder.h" />
<ClInclude Include="CurveTable.h" />
<ClInclude Include="DataTable.h" />
<ClInclude Include="DataTableFunctionLibrary.h" />
@@ -301,6 +301,7 @@
<ClInclude Include="finder.h" />
<ClInclude Include="FortAbilitySet.h" />
<ClInclude Include="FortAthenaCreativePortal.h" />
<ClInclude Include="FortAthenaMapInfo.h" />
<ClInclude Include="FortAthenaMutator.h" />
<ClInclude Include="FortAthenaMutator_Barrier.h" />
<ClInclude Include="FortAthenaMutator_Disco.h" />

View File

@@ -814,9 +814,12 @@
<ClInclude Include="moderation.h">
<Filter>Reboot\Public</Filter>
</ClInclude>
<ClInclude Include="creative.h">
<ClInclude Include="builder.h">
<Filter>Reboot\Public</Filter>
</ClInclude>
<ClInclude Include="FortAthenaMapInfo.h">
<Filter>FortniteGame\Source\FortniteGame\Public</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Engine">

View File

@@ -10,9 +10,9 @@
namespace fs = std::filesystem;
namespace Creative
namespace Builder
{
static inline bool LoadIsland(const std::string& SaveFileName, AFortVolume* LoadIntoVolume, bool* bCouldBeOutdatedPtr = nullptr)
static inline bool LoadSave(const std::string& SaveFileName, const FVector& Location, const FRotator& Rotation)
{
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
@@ -24,20 +24,9 @@ namespace Creative
return false;
}
/* auto AllBuildingActors = LoadIntoVolume->GetActorsWithinVolumeByClass(ABuildingActor::StaticClass());
for (int i = 0; i < AllBuildingActors.Num(); i++)
{
auto CurrentBuildingActor = (ABuildingActor*)AllBuildingActors[i];
CurrentBuildingActor->SilentDie();
} */
nlohmann::json j;
fileStream >> j;
auto VolumeLocation = LoadIntoVolume->GetActorLocation();
auto VolumeRotation = LoadIntoVolume->GetActorRotation();
for (const auto& obj : j) {
for (auto it = obj.begin(); it != obj.end(); ++it) {
auto& ClassName = it.key();
@@ -82,9 +71,9 @@ namespace Creative
if (stuff.size() >= 8)
{
FRotator rot{};
rot.Pitch = stuff[3] + VolumeRotation.Pitch;
rot.Roll = stuff[4] + VolumeRotation.Roll;
rot.Yaw = stuff[5] + VolumeRotation.Yaw;
rot.Pitch = stuff[3] + Rotation.Pitch;
rot.Roll = stuff[4] + Rotation.Roll;
rot.Yaw = stuff[5] + Rotation.Yaw;
FVector Scale3D = { 1, 1, 1 };
@@ -95,7 +84,7 @@ namespace Creative
Scale3D.Z = stuff[10];
}
auto NewActor = GetWorld()->SpawnActor<ABuildingActor>(Class, FVector{ stuff[0] + VolumeLocation.X , stuff[1] + VolumeLocation.Y, stuff[2] + VolumeLocation.Z },
auto NewActor = GetWorld()->SpawnActor<ABuildingActor>(Class, FVector{ stuff[0] + Location.X , stuff[1] + Location.Y, stuff[2] + Location.Z },
rot.Quaternion(), Scale3D);
if (!NewActor)
@@ -107,7 +96,7 @@ namespace Creative
// NewActor->SetHealth(stuff[7]);
static auto FortActorOptionsComponentClass = FindObject<UClass>("/Script/FortniteGame.FortActorOptionsComponent");
auto ActorOptionsComponent = NewActor->GetComponentByClass(FortActorOptionsComponentClass);
auto ActorOptionsComponent = FortActorOptionsComponentClass ? NewActor->GetComponentByClass(FortActorOptionsComponentClass) : nullptr;
// continue;
@@ -144,4 +133,17 @@ namespace Creative
return true;
}
static inline bool LoadSave(const std::string& SaveFileName, AFortVolume* LoadIntoVolume)
{
/* auto AllBuildingActors = LoadIntoVolume->GetActorsWithinVolumeByClass(ABuildingActor::StaticClass());
for (int i = 0; i < AllBuildingActors.Num(); i++)
{
auto CurrentBuildingActor = (ABuildingActor*)AllBuildingActors[i];
CurrentBuildingActor->SilentDie();
} */
return LoadSave(SaveFileName, LoadIntoVolume->GetActorLocation(), LoadIntoVolume->GetActorRotation());
}
}

View File

@@ -6,7 +6,7 @@
#include "AthenaBarrierObjective.h"
#include "FortAthenaMutator_Barrier.h"
#include "FortWeaponMeleeItemDefinition.h"
#include "creative.h"
#include "builder.h"
bool IsOperator(APlayerState* PlayerState, AFortPlayerController* PlayerController)
{
@@ -262,13 +262,8 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
return;
}
auto Volume = ReceivingController->GetCreativePlotLinkedVolume();
if (!Volume)
{
SendMessageToConsole(PlayerController, L"They do not have an island!");
return;
}
static auto CreativePlotLinkedVolumeOffset = ReceivingController->GetOffset("CreativePlotLinkedVolume", false);
auto Volume = CreativePlotLinkedVolumeOffset == -1 ? nullptr : ReceivingController->GetCreativePlotLinkedVolume();
if (Arguments.size() <= 1)
{
@@ -281,7 +276,31 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
try { FileName = Arguments[1]; }
catch (...) {}
Creative::LoadIsland(FileName, Volume);
float X{ -1 }, Y{ -1 }, Z{ -1 };
if (Arguments.size() >= 4)
{
try { X = std::stof(Arguments[2]); }
catch (...) {}
try { Y = std::stof(Arguments[3]); }
catch (...) {}
try { Z = std::stof(Arguments[4]); }
catch (...) {}
}
else
{
if (!Volume)
{
SendMessageToConsole(PlayerController, L"They do not have an island!");
return;
}
}
if (X != -1 && Y != -1 && Z != -1) // omg what if they want to spawn it at -1 -1 -1!!!
Builder::LoadSave(FileName, FVector(X, Y, Z), FRotator());
else
Builder::LoadSave(FileName, Volume);
SendMessageToConsole(PlayerController, L"Loaded!");
}
else if (Command == "spawnpickup")

View File

@@ -62,19 +62,19 @@ static inline bool bIsInAutoRestart = false;
// THE BASE CODE IS FROM IMGUI GITHUB
static LPDIRECT3D9 g_pD3D = NULL;
static LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
static D3DPRESENT_PARAMETERS g_d3dpp = {};
static inline LPDIRECT3D9 g_pD3D = NULL;
static inline LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
static inline D3DPRESENT_PARAMETERS g_d3dpp = {};
// Forward declarations of helper functions
bool CreateDeviceD3D(HWND hWnd);
void CleanupDeviceD3D();
void ResetDevice();
LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static inline bool CreateDeviceD3D(HWND hWnd);
static inline void CleanupDeviceD3D();
static inline void ResetDevice();
static inline LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static inline bool bStartedBus = false;
void Restart() // todo move?
static inline void Restart() // todo move?
{
FString LevelA = Engine_Version < 424
? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501
@@ -124,7 +124,7 @@ void Restart() // todo move?
// UGameplayStatics::OpenLevel(GetWorld(), UKismetStringLibrary::Conv_StringToName(LevelA), true, FString());
}
std::string wstring_to_utf8(const std::wstring& str)
static inline std::string wstring_to_utf8(const std::wstring& str)
{
if (str.empty()) return {};
const auto size_needed = WideCharToMultiByte(CP_UTF8, 0, &str[0], static_cast<int>(str.size()), nullptr, 0, nullptr, nullptr);
@@ -133,7 +133,7 @@ std::string wstring_to_utf8(const std::wstring& str)
return str_to;
}
void InitStyle()
static inline void InitStyle()
{
ImFontConfig FontConfig;
FontConfig.FontDataOwnedByAtlas = false;
@@ -194,18 +194,7 @@ void InitStyle()
style.Colors[ImGuiCol_PopupBg] = ImVec4(0.20f, 0.22f, 0.27f, 0.9f);
}
class Playera
{
public:
std::string Name;
int Kills = 0;
Playera(const std::string& _Name, int _Kills) : Name(_Name), Kills(_Kills) {}
Playera() {}
};
void TextCentered(std::string text, bool bNewLine = true) {
static inline void TextCentered(std::string text, bool bNewLine = true) {
if (bNewLine)
ImGui::NewLine();
@@ -229,7 +218,7 @@ void TextCentered(std::string text, bool bNewLine = true) {
ImGui::PopTextWrapPos();
}
bool ButtonCentered(std::string text, bool bNewLine = true) {
static inline bool ButtonCentered(std::string text, bool bNewLine = true) {
if (bNewLine)
ImGui::NewLine();
@@ -254,7 +243,7 @@ bool ButtonCentered(std::string text, bool bNewLine = true) {
return res;
}
void InputVector(const std::string& baseText, FVector* vec)
static inline void InputVector(const std::string& baseText, FVector* vec)
{
ImGui::InputFloat((baseText + " X").c_str(), &vec->X);
ImGui::InputFloat((baseText + " Y").c_str(), &vec->Y);
@@ -270,7 +259,7 @@ static bool bIsEditingInventory = false;
static bool bInformationTab = false;
static int playerTabTab = MAIN_PLAYERTAB;
void StaticUI()
static inline void StaticUI()
{
ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart);
@@ -289,7 +278,7 @@ void StaticUI()
}
}
void MainTabs()
static inline void MainTabs()
{
// std::ofstream bannedStream(Moderation::Banning::GetFilePath());
@@ -390,7 +379,7 @@ void MainTabs()
}
}
void PlayerTabs()
static inline void PlayerTabs()
{
if (ImGui::BeginTabBar(""))
{
@@ -422,7 +411,7 @@ void PlayerTabs()
}
}
void MainUI()
static inline void MainUI()
{
bool bLoaded = true;
@@ -915,7 +904,7 @@ void MainUI()
}
}
void PregameUI()
static inline void PregameUI()
{
StaticUI();
@@ -939,7 +928,7 @@ void PregameUI()
ImGui::InputText("Playlist", &PlaylistName);
}
DWORD WINAPI GuiThread(LPVOID)
static inline DWORD WINAPI GuiThread(LPVOID)
{
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"RebootClass", NULL };
::RegisterClassEx(&wc);
@@ -1116,7 +1105,7 @@ DWORD WINAPI GuiThread(LPVOID)
// Helper functions
bool CreateDeviceD3D(HWND hWnd)
static inline bool CreateDeviceD3D(HWND hWnd)
{
if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL)
return false;
@@ -1136,13 +1125,13 @@ bool CreateDeviceD3D(HWND hWnd)
return true;
}
void CleanupDeviceD3D()
static inline void CleanupDeviceD3D()
{
if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; }
if (g_pD3D) { g_pD3D->Release(); g_pD3D = NULL; }
}
void ResetDevice()
static inline void ResetDevice()
{
ImGui_ImplDX9_InvalidateDeviceObjects();
HRESULT hr = g_pd3dDevice->Reset(&g_d3dpp);
@@ -1153,7 +1142,7 @@ void ResetDevice()
extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static inline LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// my implementation of window dragging..
/* {