Skip to content

Commit

Permalink
Merge pull request #27 from Nightfallstorm/vr
Browse files Browse the repository at this point in the history
Few RE changes
  • Loading branch information
alandtse authored Dec 8, 2023
2 parents 06182ef + 146a125 commit ffbfa96
Show file tree
Hide file tree
Showing 27 changed files with 159 additions and 10 deletions.
1 change: 1 addition & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,7 @@ set(SOURCES
include/RE/T/TargetValueModifierEffect.h
include/RE/T/TaskQueueInterface.h
include/RE/T/TelekinesisEffect.h
include/RE/T/TeleportHandler.h
include/RE/T/TempEffectTraits.h
include/RE/T/TextureAddressModes.h
include/RE/T/TextureFileFormat.h
Expand Down
4 changes: 4 additions & 0 deletions include/RE/A/ActivateHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(ActivateHandler) == 0x20);
#else
static_assert(sizeof(ActivateHandler) == 0x38);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/A/AttackBlockHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(AttackBlockHandler) == 0x48);
#else
static_assert(sizeof(AttackBlockHandler) == 0x60);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/A/AutoMoveHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(AutoMoveHandler) == 0x10);
#else
static_assert(sizeof(AutoMoveHandler) == 0x28);
#endif
}
15 changes: 12 additions & 3 deletions include/RE/B/BGSSaveLoadGame.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ namespace RE
return *singleton;
}

// members
BSTArray<TESFile*> pluginList; // 000
BSTArray<void*> unk18; // 018
// members
#ifndef SKYRIMVR
BSTArray<TESFile*> pluginList; // 000
BSTArray<void*> unk18; // 018
#else
std::uint8_t pluginList[0xFF]; // 000
std::uint8_t unk18[0xFF]; // 0FF
#endif
BGSSaveLoadFormIDMap worldspaceFormIDMap; // 030
BSTHashMap<FormID, ActorHandle> unk98; // 098
BGSSaveLoadReferencesMap unkC8; // 0C8
Expand All @@ -99,5 +104,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(BGSSaveLoadGame) == 0x348);
#else
static_assert(sizeof(BGSSaveLoadGame) == 0x518);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/B/BleedoutCameraState.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(BleedoutCameraState) == 0x138);
#else
static_assert(sizeof(BleedoutCameraState) == 0x150);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/F/FirstPersonState.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(FirstPersonState) == 0x90);
#else
static_assert(sizeof(FirstPersonState) == 0xA8);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/F/FreeCameraState.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(FreeCameraState) == 0x50);
#else
static_assert(sizeof(FreeCameraState) == 0x68);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/H/HeldStateHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(HeldStateHandler) == 0x18);
#else
static_assert(sizeof(HeldStateHandler) == 0x30);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/H/HorseCameraState.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(HorseCameraState) == 0xF8);
#else
static_assert(sizeof(HorseCameraState) == 0x110);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/J/JumpHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(JumpHandler) == 0x10);
#else
static_assert(sizeof(JumpHandler) == 0x28);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/L/LookHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(LookHandler) == 0x10);
#else
static_assert(sizeof(LookHandler) == 0x28);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/M/MovementHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(MovementHandler) == 0x10);
#else
static_assert(sizeof(MovementHandler) == 0x28);
#endif
}
15 changes: 15 additions & 0 deletions include/RE/P/PlayerInputHandler.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include "RE/B/BSFixedString.h"

namespace RE
{
Expand All @@ -20,6 +21,11 @@ namespace RE
virtual void ProcessMouseMove(MouseMoveEvent* a_event, PlayerControlsData* a_data); // 03 - { return; }
virtual void ProcessButton(ButtonEvent* a_event, PlayerControlsData* a_data); // 04 - { return; }

#ifdef SKYRIMVR
virtual void Unk_05(void); // 05
virtual void Unk_06(void); // 05
#endif

[[nodiscard]] bool IsInputEventHandlingEnabled() const;
void SetInputEventHandlingEnabled(bool a_enabled);

Expand All @@ -28,8 +34,17 @@ namespace RE
std::uint8_t pad09; // 09
std::uint16_t pad0A; // 0A
std::uint32_t pad0C; // 0C
#ifdef SKYRIMVR
std::uint64_t unk10; // 10
BSFixedString unk18; // 18
std::uint64_t unk20;
#endif
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(PlayerInputHandler) == 0x10);
#else
static_assert(sizeof(PlayerInputHandler) == 0x28);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/R/ReadyWeaponHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(ReadyWeaponHandler) == 0x10);
#else
static_assert(sizeof(ReadyWeaponHandler) == 0x28);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/R/RunHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(RunHandler) == 0x18);
#else
static_assert(sizeof(RunHandler) == 0x30);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/S/ShoutHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(ShoutHandler) == 0x20);
#else
static_assert(sizeof(ShoutHandler) == 0x38);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/S/SneakHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(SneakHandler) == 0x10);
#else
static_assert(sizeof(SneakHandler) == 0x28);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/S/SprintHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(SprintHandler) == 0x18);
#else
static_assert(sizeof(SprintHandler) == 0x30);
#endif
}
1 change: 1 addition & 0 deletions include/RE/Skyrim.h
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,7 @@
#include "RE/T/TargetValueModifierEffect.h"
#include "RE/T/TaskQueueInterface.h"
#include "RE/T/TelekinesisEffect.h"
#include "RE/T/TeleportHandler.h"
#include "RE/T/TempEffectTraits.h"
#include "RE/T/TextureAddressModes.h"
#include "RE/T/TextureFileFormat.h"
Expand Down
34 changes: 34 additions & 0 deletions include/RE/T/TeleportHandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

#include "RE/H/HeldStateHandler.h"

#ifdef SKYRIMVR
namespace RE
{
struct TeleportHandler : public HeldStateHandler
{
public:
inline static constexpr auto RTTI = RTTI_TeleportHandler;

~TeleportHandler() override; // 00

// override (PlayerInputHandler)
bool CanProcess(InputEvent* a_event) override; // 01
void ProcessButton(ButtonEvent* a_event, PlayerControlsData* a_data) override; // 04

// members
std::uint64_t unk_30; // 30
std::uint64_t unk_38; // 38
std::uint64_t unk_40; // 40
std::uint64_t unk_48; // 48
std::uint64_t unk_50; // 50
std::uint64_t unk_58; // 58
std::uint64_t unk_60; // 60
std::uint64_t unk_68; // 68
private:
KEEP_FOR_RE()
};
static_assert(sizeof(TeleportHandler) == 0x70);

}
#endif
4 changes: 4 additions & 0 deletions include/RE/T/ThirdPersonState.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(ThirdPersonState) == 0xE8);
#else
static_assert(sizeof(ThirdPersonState) == 0x100);
#endif
}
5 changes: 5 additions & 0 deletions include/RE/T/ThumbstickEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ namespace RE
userEvent = a_userEvent;
}

#ifndef SKYRIMVR
[[nodiscard]] bool IsLeft() const;
[[nodiscard]] bool IsRight() const;
#else
[[nodiscard]] bool IsOffHand() const;
[[nodiscard]] bool IsMainHand() const;
#endif

// members
float xValue; // 28
Expand Down
4 changes: 4 additions & 0 deletions include/RE/T/TogglePOVHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(TogglePOVHandler) == 0x20);
#else
static_assert(sizeof(TogglePOVHandler) == 0x38);
#endif
}
4 changes: 4 additions & 0 deletions include/RE/T/ToggleRunHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ namespace RE
private:
KEEP_FOR_RE()
};
#ifndef SKYRIMVR
static_assert(sizeof(ToggleRunHandler) == 0x10);
#else
static_assert(sizeof(ToggleRunHandler) == 0x28);
#endif
}
10 changes: 3 additions & 7 deletions src/RE/M/MagicTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@ namespace RE

void MagicTarget::DispelEffectsWithArchetype(Archetype a_type, bool a_force)
{
const auto effects = GetActiveEffectList();
if (!effects) {
return;
}

std::vector<RE::ActiveEffect*> queued;
for (const auto& effect : *effects) {
VisitActiveEffects([&](ActiveEffect* effect) {
const auto setting = effect ? effect->GetBaseObject() : nullptr;
if (setting && setting->HasArchetype(a_type)) {
queued.push_back(effect);
}
}
return BSContainer::ForEachResult::kContinue;
});

for (const auto& effect : queued) {
effect->Dispel(a_force);
Expand Down
12 changes: 12 additions & 0 deletions src/RE/T/ThumbstickEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace RE
{
#ifndef SKYRIMVR
bool ThumbstickEvent::IsLeft(void) const
{
return idCode == InputType::kLeftThumbstick;
Expand All @@ -11,4 +12,15 @@ namespace RE
{
return idCode == InputType::kRightThumbstick;
}
#else
bool ThumbstickEvent::IsOffHand(void) const
{
return idCode == InputType::kLeftThumbstick;
}

bool ThumbstickEvent::IsMainHand(void) const
{
return idCode == InputType::kRightThumbstick;
}
#endif
}

0 comments on commit ffbfa96

Please sign in to comment.