forked from LemonUIbyLemon/LemonUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
990f0ee
commit ffe2dfe
Showing
5 changed files
with
6,602 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
scripthookv/ | ||
scripthookv.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
$url = "http://www.dev-c.com/files/ScriptHookV_SDK_1.0.617.1a.zip" | ||
$zip = "sdk\\scripthookv.zip" | ||
$out = "sdk\\scripthookv" | ||
$headers = @{ | ||
"Referer" = "http://www.dev-c.com" | ||
} | ||
|
||
if (!(Test-Path $out)) | ||
{ | ||
# Create the directory | ||
New-Item -Path "sdk" -Name "scripthookv" -ItemType "directory" | ||
|
||
# If the SDK ZIP doesn't exists, download it | ||
if (!(Test-Path $zip)) | ||
{ | ||
Invoke-WebRequest -Uri $url -OutFile $zip -MaximumRedirection 0 -Headers $headers | ||
} | ||
|
||
# Extract the files | ||
Expand-Archive -Path $zip -DestinationPath $out | ||
|
||
# Once everything is done, do some cleanup | ||
Remove-Item $zip -ErrorAction Ignore | ||
Remove-Item "$($out)\\inc\\nativeCaller.h" -ErrorAction Ignore | ||
Remove-Item "$($out)\\inc\\natives.h" -ErrorAction Ignore | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// https://github.com/E66666666/GTAVManualTransmission/blob/master/thirdparty/ScriptHookV_SDK/inc/nativeCaller.h | ||
|
||
#pragma once | ||
|
||
#include "main.h" | ||
#include <utility> | ||
|
||
template <typename T> | ||
static inline void nativePush(T val) | ||
{ | ||
static_assert(sizeof(T) <= sizeof(UINT64), "Type is too large"); | ||
UINT64 val64 = 0; | ||
*reinterpret_cast<T *>(&val64) = val; | ||
nativePush64(val64); | ||
} | ||
|
||
template <typename R> | ||
static inline R invoke(UINT64 hash) | ||
{ | ||
nativeInit(hash); | ||
return *reinterpret_cast<R *>(nativeCall()); | ||
} | ||
|
||
template <typename R, class ... Args> | ||
static inline R invoke(UINT64 hash, Args&& ... args) | ||
{ | ||
nativeInit(hash); | ||
|
||
(nativePush(std::forward<Args>(args)), ...); | ||
|
||
return *reinterpret_cast<R*>(nativeCall()); | ||
} |
Oops, something went wrong.