Initial commit.
* Beginning reconstruction of Source SDK. Signed-off-by: aixxe <me@aixxe.net>
This commit is contained in:
13
include/cstrike/Utilities/Virtuals.h
Normal file
13
include/cstrike/Utilities/Virtuals.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
inline void**& GetVirtualTable(void* baseclass) {
|
||||
return *reinterpret_cast<void***>(baseclass);
|
||||
}
|
||||
|
||||
inline void* GetVirtualFunction(void* vftable, size_t index) {
|
||||
return reinterpret_cast<void*>(GetVirtualTable(vftable)[index]);
|
||||
}
|
||||
|
||||
template <typename Fn> inline Fn GetVirtualFunction(void* vftable, size_t index) {
|
||||
return reinterpret_cast<Fn>(GetVirtualTable(vftable)[index]);
|
||||
}
|
||||
Reference in New Issue
Block a user