11 Commits

Author SHA1 Message Date
Kawe Mazidjatari
8f384e424d VScript: constify callback parameters 2024-09-16 13:52:13 +02:00
Kawe Mazidjatari
2afa6d6c64 VScript: log duration of code callbacks 2024-09-16 13:46:36 +02:00
Kawe Mazidjatari
e7fd19cdf3 VScript: fix method order
More logical order of newly added methods.
2024-04-19 13:14:35 +02:00
Kawe Mazidjatari
f70cc90eb9 VScript: move script run code to dedicated method 2024-04-19 13:12:35 +02:00
Kawe Mazidjatari
183a6e9c35 VScript: add CSquirrelVM::ExecuteFunction()
Executes script code by function handle.
2024-04-19 12:56:10 +02:00
Kawe Mazidjatari
bcf994e210 VScript: add code for calling codecallbacks 2024-04-03 14:51:44 +02:00
Kawe Mazidjatari
1836146efe Squirrel: reverse more squirrel types and structures
This patch removes a lot of old code. Context is now exclusively grabbed from the CSquirrelVM instance. This patch also comes with a few new types: SQArray and SQTable!

The implementation also allows pushing Vector3D's on the stack, but these are handled slightly differently.. The largest field in tagSQObjectValue is 8 bytes, Vector3D is 12 bytes unaligned, but the tagSQObjectValue field in the tagSQObject struct is aligned to a 8 byte boundary while the field prior is only 4 bytes, Vector3D starts right after the type field in the tagSQObject (at the padding) to keep the whole structure the same size, therefore a new field has been added in between the padding (_pad) with a simple Vector3D accessor.

Also added a hook to allow registering proper script enums.
2024-03-25 01:41:52 +01:00
Kawe Mazidjatari
1361bfb172 Make singletons use static memory
Avoid heap memory allocation and a level of indirection. This allows the compiler to optimize the program even more. No logic has been changed in this patch.
2024-01-21 21:29:23 +01:00
Kawe Mazidjatari
e825a1e7a8 IDetour: remove extraneous pointer assignments
Originally, we store the search results in a CMemory instance which we then assign to the actual function pointer. CMemory is just a pointer class; we can assign the results directly to the actual function pointer. This commit reduces a lot of code verbosity, and also reduced roughly 2KiB worth of static pointers in the resulting executable. This commit also officially deprecates the support for any GameDLL's below S3 (Season 3), since it makes more sense to port the assets from earlier/later games back to the version this SDK supports.
2024-01-02 15:21:36 +01:00
Kawe Mazidjatari
e541814482 IDetour: code refactor
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
2023-11-26 13:21:20 +01:00
Kawe Mazidjatari
fd3e227a86 Align folder structure with p4 2023-09-19 22:13:22 +02:00