WIP
This commit is contained in:
@@ -42,14 +42,18 @@ template <size_t Size> struct FieldBinder {
|
||||
template <typename T> T *operator=(T *src) {
|
||||
union V {
|
||||
T *a;
|
||||
void* b;
|
||||
void *b;
|
||||
};
|
||||
V* trick = reinterpret_cast<V*>(this);
|
||||
V *trick = reinterpret_cast<V *>(this);
|
||||
return trick->a = src;
|
||||
}
|
||||
ExpectedType& operator=(ExpectedType src) {
|
||||
ExpectedType &operator=(ExpectedType src) {
|
||||
return *reinterpret_cast<ExpectedType *>(dst) = src;
|
||||
}
|
||||
ExpectedType &operator=(FieldBinder<Size> &other) {
|
||||
return *reinterpret_cast<ExpectedType *>(dst) =
|
||||
*reinterpret_cast<ExpectedType *>(other.dst);
|
||||
}
|
||||
};
|
||||
|
||||
template <size_t Offset, size_t Size>
|
||||
@@ -83,18 +87,15 @@ inline constexpr cc_type_t CONCAT23(T0 a, T1 b) {
|
||||
return cc_type_t(a) << 24 | cc_type_t(b);
|
||||
}
|
||||
|
||||
template <typename T0>
|
||||
inline constexpr char SUB21(T0 a, size_t b) {
|
||||
template <typename T0> inline constexpr char SUB21(T0 a, size_t b) {
|
||||
return cc_type_t(a) >> (b * 8);
|
||||
}
|
||||
|
||||
template <typename T0>
|
||||
inline constexpr char SUB41(T0 a, size_t b) {
|
||||
template <typename T0> inline constexpr char SUB41(T0 a, size_t b) {
|
||||
return cc_type_t(a) >> (b * 8);
|
||||
}
|
||||
|
||||
template <typename T0>
|
||||
inline constexpr uint16_t SUB42(T0 a, size_t b) {
|
||||
template <typename T0> inline constexpr uint16_t SUB42(T0 a, size_t b) {
|
||||
return cc_type_t(a) >> (b * 8);
|
||||
}
|
||||
|
||||
|
@@ -7,10 +7,11 @@
|
||||
extern "C" int r3_main(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR *cmdline, int showCmd);
|
||||
|
||||
int main() {
|
||||
int main(int argc, char **argv) {
|
||||
try {
|
||||
gh_init_data_segment();
|
||||
r3_main(GetModuleHandle(NULL), NULL, NULL, SW_SHOW);
|
||||
|
||||
r3_main(GetModuleHandle(NULL), NULL, argv, SW_SHOW);
|
||||
} catch (const std::exception &e) {
|
||||
SPDLOG_ERROR("Unhandled exception: {}", e.what());
|
||||
}
|
||||
|
Reference in New Issue
Block a user