mirror of
https://github.com/Ed94/HandmadeHero.git
synced 2025-06-15 03:01:48 -07:00
Day 6 Bonus: Dualsense Edge support!
I had to temporarily make my own binaries for the JoyShockLibrary but it works!
This commit is contained in:
@ -338,10 +338,15 @@ $includes = @(
|
||||
$path_deps,
|
||||
$path_platform
|
||||
)
|
||||
|
||||
# Microsoft
|
||||
$lib_gdi32 = 'Gdi32.lib'
|
||||
$lib_xinput = 'Xinput.lib'
|
||||
$lib_user32 = 'User32.lib'
|
||||
|
||||
# Github
|
||||
$lib_jsl = Join-Path $path_deps 'JoyShockLibrary/x64/JoyShockLibrary.lib'
|
||||
|
||||
$unit = Join-Path $path_project 'handmade_win32.cpp'
|
||||
$executable = Join-Path $path_build 'handmade_win32.exe'
|
||||
|
||||
@ -351,6 +356,9 @@ $linker_args = @(
|
||||
$lib_gdi32,
|
||||
# $lib_xinput,
|
||||
$lib_user32,
|
||||
|
||||
$lib_jsl,
|
||||
|
||||
$flag_link_win_subsystem_windows
|
||||
)
|
||||
|
||||
|
Binary file not shown.
@ -1,28 +1,65 @@
|
||||
clear-host
|
||||
$path_root = & git rev-parse --show-toplevel
|
||||
|
||||
$path_data = Join-Path $path_root "data"
|
||||
$path_project = Join-Path $path_root "project"
|
||||
$path_deps = Join-Path $path_project "dependencies"
|
||||
$path_deps_windows = Join-Path $path_deps "windows"
|
||||
$path_temp = Join-Path $path_deps "temp"
|
||||
$path_platform = Join-Path $path_project "platform"
|
||||
|
||||
# Define the URL of the zip file and the destination directory
|
||||
$url = "https://github.com/Ed94/gencpp/releases/download/latest/gencpp_singleheader.zip"
|
||||
$destinationZip = Join-Path $path_temp "gencpp_singleheader.zip"
|
||||
|
||||
# Create directories if they don't exist
|
||||
if (-not (Test-Path $path_deps)) {
|
||||
# Clear out the current content first
|
||||
if (Test-Path $path_deps) {
|
||||
Remove-Item $path_deps -Recurse -Force
|
||||
New-Item -ItemType Directory -Path $path_deps
|
||||
}
|
||||
if (-not (Test-Path $path_temp)) {
|
||||
New-Item -ItemType Directory -Path $path_temp
|
||||
}
|
||||
New-Item -ItemType Directory -Path $path_temp
|
||||
|
||||
$url_gencpp = "https://github.com/Ed94/gencpp/releases/download/latest/gencpp_singleheader.zip"
|
||||
$path_gencpp_zip = Join-Path $path_temp "gencpp_singleheader.zip"
|
||||
|
||||
#region gencpp
|
||||
Invoke-WebRequest -Uri $url -OutFile $destinationZip
|
||||
Expand-Archive -Path $destinationZip -DestinationPath $path_temp
|
||||
Invoke-WebRequest -Uri $url_gencpp -OutFile $path_gencpp_zip
|
||||
Expand-Archive -Path $path_gencpp_zip -DestinationPath $path_temp
|
||||
Move-Item -Path (Join-Path $path_temp "gen.hpp") -Destination $path_deps -Force
|
||||
#endregion gencpp
|
||||
|
||||
#region JoyShockLibrary
|
||||
$url_jsl_repo = "https://github.com/JibbSmart/JoyShockLibrary.git"
|
||||
# $url_jsl_zip = "https://github.com/JibbSmart/JoyShockLibrary/releases/download/v3.0/JSL_3_0.zip"
|
||||
$url_jsl_zip = "https://github.com/Ed94/JoyShockLibrary/releases/download/not_for_public_use/JSL.zip"
|
||||
$path_jsl_repo = Join-Path $path_temp "JoyShockLibraryRepo"
|
||||
$path_jsl_repo_code = Join-Path $path_jsl_repo "JoyShockLibrary"
|
||||
$path_jsl_lib_zip = Join-Path $path_temp "JSL_3_0.zip"
|
||||
$path_jsl = Join-Path $path_deps "JoyShockLibrary"
|
||||
$path_jsl_hidapi = Join-Path $path_jsl "hidapi"
|
||||
$path_jsl_lib = Join-Path $path_jsl "x64"
|
||||
|
||||
# Grab code from repo
|
||||
& git clone $url_jsl_repo $path_jsl_repo
|
||||
Move-Item -Path $path_jsl_repo_code -Destination $path_deps -Force
|
||||
|
||||
# Clean up the junk
|
||||
@( $path_jsl, $path_jsl_hidapi ) | ForEach-Object {
|
||||
Get-ChildItem -Path $path_jsl -Recurse -File | Where-Object {
|
||||
($_.Extension -ne ".h" -and $_.Extension -ne ".cpp")
|
||||
} | Remove-Item -Force
|
||||
}
|
||||
Remove-Item (join-path $path_jsl_hidapi 'objs') -Recurse -Force
|
||||
|
||||
# Get precompiled binaries
|
||||
Invoke-WebRequest -Uri $url_jsl_zip -OutFile $path_jsl_lib_zip
|
||||
Expand-Archive -Path $path_jsl_lib_zip -DestinationPath $path_temp
|
||||
|
||||
if (-not (Test-Path $path_jsl_lib)) {
|
||||
New-Item -ItemType Directory -Path $path_jsl_lib
|
||||
}
|
||||
|
||||
$jsl_lib_files = (Get-ChildItem (Join-Path $path_temp "JSL\x64") -Recurse -Include *.dll, *.lib)
|
||||
Move-Item $jsl_lib_files -Destination $path_jsl_lib -Force
|
||||
|
||||
$path_jsl_dll = Join-Path $path_jsl_lib "JoyShockLibrary.dll"
|
||||
Move-Item $path_jsl_dll $path_data -Force
|
||||
#endregion JoyShockLibrary
|
||||
|
||||
Remove-Item $path_temp -Recurse -Force
|
||||
|
Reference in New Issue
Block a user