Skip to content

Commit

Permalink
Remove BSInputDevice constructor related code
Browse files Browse the repository at this point in the history
ref Ryan-rsm-McKenzie#68
The added constructor (w/ new DeviceFactory) causes linker error attempting to call `BSInputDevice::IsPressed()` virtual function, this forces compiler to instantiate the class.
  • Loading branch information
gottyduke committed May 28, 2023
1 parent bcff682 commit 9b85d8e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
7 changes: 1 addition & 6 deletions include/RE/B/BSIInputDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace RE
inline static constexpr auto RTTI = RTTI_BSIInputDevice;
inline static constexpr auto VTABLE = VTABLE_BSIInputDevice;

virtual ~BSIInputDevice() = default; // 00
virtual ~BSIInputDevice(); // 00

// add
virtual void Initialize() = 0; // 01
Expand All @@ -22,11 +22,6 @@ namespace RE
virtual bool GetMappedKeycode(std::uint32_t a_key, std::uint32_t& outKeyCode) = 0; // 06
[[nodiscard]] virtual bool IsEnabled() const = 0; // 07
virtual void Reset() = 0; // 08

protected:
friend class BSInputDeviceFactory;
TES_HEAP_REDEFINE_NEW();
BSIInputDevice() = default;
};
static_assert(sizeof(BSIInputDevice) == 0x8);
}
3 changes: 0 additions & 3 deletions include/RE/B/BSInputDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ namespace RE
std::uint32_t pad0C; // 0C
BSTHashMap<std::uint32_t, InputButton*> deviceButtons; // 10
BSTHashMap<BSFixedString, std::uint32_t> buttonNameIDMap; // 40

protected:
BSInputDevice();
};
static_assert(sizeof(BSInputDevice) == 0x70);
}
9 changes: 0 additions & 9 deletions src/RE/B/BSInputDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ namespace RE
return (it != deviceButtons.end()) && (it->second->heldDownSecs > 0.0f);
}

BSInputDevice::BSInputDevice() :
BSIInputDevice(),
pad0C(0),
deviceButtons(),
buttonNameIDMap()
{
device = INPUT_DEVICE::kNone;
}

bool BSInputDevice::LoadControlsDefinitionFile(const char* a_fileName)
{
using func_t = decltype(&BSInputDevice::LoadControlsDefinitionFile);
Expand Down

0 comments on commit 9b85d8e

Please sign in to comment.