Skip to content

Commit

Permalink
build: fix build errors for flat
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Aug 6, 2024
1 parent 62754c4 commit 90a8ae1
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 42 deletions.
2 changes: 1 addition & 1 deletion include/RE/B/BGSSaveLoadManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace RE
# ifdef SKYRIM_SUPPORT_AE
static_assert(sizeof(BGSSaveLoadManager) == 0x418);
# else
static_assert(sizeof(BGSSaveLoadManager) == 0x3D0);
static_assert(sizeof(BGSSaveLoadManager) == 0x3D8);
# endif
#else
static_assert(sizeof(BGSSaveLoadManager) == 0x3D8);
Expand Down
2 changes: 1 addition & 1 deletion include/RE/B/BSOpenVR.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ namespace RE
KEEP_FOR_RE()
};
static_assert(sizeof(BSOpenVR) == 0x408);
#endif
}
#endif
2 changes: 1 addition & 1 deletion include/RE/B/BSVRInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ namespace RE
KEEP_FOR_RE()
};
static_assert(sizeof(BSVRInterface) == 0x208);
#endif
}
#endif
4 changes: 2 additions & 2 deletions include/RE/C/CalibrationOptionMenu.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#ifdef SKYRIMVR
#include "RE/I/IMenu.h"
#include "RE/M/MenuEventHandler.h"

Expand All @@ -26,5 +26,5 @@ namespace RE
KEEP_FOR_RE()
};
static_assert(sizeof(CalibrationOptionMenu) == 0x58);

}
#endif
2 changes: 1 addition & 1 deletion include/RE/C/ControlMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace RE
};
#ifndef SKYRIMVR
# ifndef SKYRIM_SUPPORT_AE
static_assert(sizeof(ControlMap) == 0x130);
//static_assert(sizeof(ControlMap) == 0x120);
# else
static_assert(sizeof(ControlMap) == 0x128);
# endif
Expand Down
2 changes: 1 addition & 1 deletion include/RE/I/InterfaceStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace RE
};
#ifndef SKYRIMVR
# ifndef SKYRIM_SUPPORT_AE
static_assert(sizeof(InterfaceStrings) == 0x278);
static_assert(sizeof(InterfaceStrings) == 0x260);
# else
static_assert(sizeof(InterfaceStrings) == 0x260);
# endif
Expand Down
2 changes: 1 addition & 1 deletion include/RE/R/Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace RE
REX::W32::HINSTANCE hInstance; // 27B0
};
#ifndef SKYRIMVR
static_assert(offsetof(RendererData, renderWindows) == 0x2780);
static_assert(offsetof(RendererData, renderWindows) == 0x48);
static_assert(offsetof(RendererData, lock) == 0x2780);
#else
static_assert(offsetof(RendererData, renderWindows) == 0x48);
Expand Down
2 changes: 1 addition & 1 deletion include/RE/S/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace RE
# ifdef SKYRIM_SUPPORT_AE
static_assert(sizeof(State) == 0x120);
# else
static_assert(sizeof(State) == 0x118);
static_assert(sizeof(State) == 0x128);
# endif
#endif
}
Expand Down
8 changes: 4 additions & 4 deletions include/SKSE/Impl/PCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@ namespace REL
# define KEEP_FOR_RE()
#endif

#include "RE/B/BSCoreTypes.h"
#include "RE/Offsets_VTABLE.h"
#include "RE/S/SFTypes.h"

#ifndef SKYRIMVR
# include "RE/Offsets.h"
# include "RE/Offsets_NiRTTI.h"
Expand All @@ -723,7 +727,3 @@ namespace REL
# include "RE/Offsets_VR_NiRTTI.h"
# include "RE/Offsets_VR_RTTI.h"
#endif

#include "RE/B/BSCoreTypes.h"
#include "RE/Offsets_VTABLE.h"
#include "RE/S/SFTypes.h"
69 changes: 41 additions & 28 deletions src/RE/M/MagicTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,63 +17,76 @@ namespace RE
void MagicTarget::DispelEffectsWithArchetype(Archetype a_type, bool a_force)
{
std::vector<RE::ActiveEffect*> queued;
#ifndef SKYRIMVR
const auto effects = GetActiveEffectList();
if (!effects) {
return;
}

for (const auto& effect : *effects) {
#else
VisitActiveEffects([&](ActiveEffect* effect) {
#endif
const auto setting = effect ? effect->GetBaseObject() : nullptr;
if (setting && setting->HasArchetype(a_type)) {
queued.push_back(effect);
}
#ifdef SKYRIMVR
return BSContainer::ForEachResult::kContinue;
});

for (const auto& effect : queued) {
effect->Dispel(a_force);
#endif
}
#ifdef SKYRIMVR
);
#endif
for (const auto& effect : queued) {
effect->Dispel(a_force);
}
}

Actor* MagicTarget::GetTargetAsActor()
{
if (MagicTargetIsActor()) {
return static_cast<Actor*>(this);
}
if (MagicTargetIsActor()) {
return static_cast<Actor*>(this);
}

return nullptr;
return nullptr;
}

bool MagicTarget::HasEffectWithArchetype(Archetype a_type)
{
auto effects = GetActiveEffectList();
if (!effects) {
return false;
}
auto effects = GetActiveEffectList();
if (!effects) {
return false;
}

EffectSetting* setting = nullptr;
for (auto& effect : *effects) {
setting = effect ? effect->GetBaseObject() : nullptr;
if (setting && setting->HasArchetype(a_type)) {
return true;
EffectSetting* setting = nullptr;
for (auto& effect : *effects) {
setting = effect ? effect->GetBaseObject() : nullptr;
if (setting && setting->HasArchetype(a_type)) {
return true;
}
}
}
return false;
return false;
}

bool MagicTarget::HasMagicEffect(EffectSetting* a_effect)
{
using func_t = decltype(&MagicTarget::HasMagicEffect);
REL::Relocation<func_t> func{ RELOCATION_ID(33733, 34517) };
return func(this, a_effect);
using func_t = decltype(&MagicTarget::HasMagicEffect);
REL::Relocation<func_t> func{ RELOCATION_ID(33733, 34517) };
return func(this, a_effect);
}

bool MagicTarget::HasMagicEffectWithKeyword(BGSKeyword* a_keyword, std::uint64_t a_arg2)
{
using func_t = decltype(&MagicTarget::HasMagicEffectWithKeyword);
REL::Relocation<func_t> func{ RELOCATION_ID(33734, 34518) };
return func(this, a_keyword, a_arg2);
using func_t = decltype(&MagicTarget::HasMagicEffectWithKeyword);
REL::Relocation<func_t> func{ RELOCATION_ID(33734, 34518) };
return func(this, a_keyword, a_arg2);
}

void MagicTarget::VisitEffects(ForEachActiveEffectVisitor& visitor)
{
using func_t = decltype(&MagicTarget::VisitEffects);
REL::Relocation<func_t> func{ RELOCATION_ID(33756, 34540) };
return func(this, visitor);
using func_t = decltype(&MagicTarget::VisitEffects);
REL::Relocation<func_t> func{ RELOCATION_ID(33756, 34540) };
return func(this, visitor);
}
}
6 changes: 5 additions & 1 deletion src/RE/T/TESDataHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

namespace RE
{
TESDataHandler* TESDataHandler::GetSingleton(bool a_VRESL)
TESDataHandler* TESDataHandler::GetSingleton(bool
#ifdef SKYRIMVR
a_VRESL
#endif
)
{
REL::Relocation<TESDataHandler**> singleton{ RELOCATION_ID(514141, 400269) };
#ifdef SKYRIMVR
Expand Down
2 changes: 2 additions & 0 deletions src/RE/W/WorldSpaceMenu.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ifdef SKYRIMVR
#include "RE/W/WorldSpaceMenu.h"
#include "RE/I/InterfaceStrings.h"
#include "RE/U/UI.h"
Expand Down Expand Up @@ -86,3 +87,4 @@ namespace RE
return isTopMenu || a_message->menu == menuName;
}
}
#endif

0 comments on commit 90a8ae1

Please sign in to comment.