mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2026-10-10 04:53:15 +08:00
@@ -131,3 +131,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: UnityIGCSConnector.dll
|
name: UnityIGCSConnector.dll
|
||||||
path: ./Release/UnityIGCSConnector.dll
|
path: ./Release/UnityIGCSConnector.dll
|
||||||
|
|
||||||
|
- name: Upload Unity IGCS Connector 32bit
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: UnityIGCSConnector.32.dll
|
||||||
|
path: ./Release/UnityIGCSConnector.32.dll
|
||||||
|
|||||||
@@ -76,13 +76,19 @@
|
|||||||
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
|
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<TargetName>UnityIGCSConnector</TargetName>
|
<TargetName>UnityIGCSConnector.32</TargetName>
|
||||||
|
<OutDir>$(SolutionDir)..\$(Configuration)\</OutDir>
|
||||||
|
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<TargetName>UnityIGCSConnector</TargetName>
|
<TargetName>UnityIGCSConnector</TargetName>
|
||||||
|
<OutDir>$(SolutionDir)..\$(Configuration)\</OutDir>
|
||||||
|
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<TargetName>UnityIGCSConnector</TargetName>
|
<TargetName>UnityIGCSConnector.32</TargetName>
|
||||||
|
<OutDir>$(SolutionDir)..\$(Configuration)\</OutDir>
|
||||||
|
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -90,7 +96,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;UNITYIGCSCONNECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;UNITYIGCSCONNECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -107,7 +113,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;UNITYIGCSCONNECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;UNITYIGCSCONNECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ SessionCallback GlobalEndSession = NULL;
|
|||||||
// There are things that only needs to be run once.
|
// There are things that only needs to be run once.
|
||||||
static int first_initialization = 1;
|
static int first_initialization = 1;
|
||||||
|
|
||||||
EXPOSE int IGCS_StartScreenshotSession(uint8_t _ignore) {
|
EXPOSE int __cdecl IGCS_StartScreenshotSession(uint8_t _ignore) {
|
||||||
if (GlobalStartSession) {
|
if (GlobalStartSession) {
|
||||||
GlobalStartSession();
|
GlobalStartSession();
|
||||||
printf("Called StartSession\n");
|
printf("Called StartSession\n");
|
||||||
@@ -27,12 +27,12 @@ EXPOSE int IGCS_StartScreenshotSession(uint8_t _ignore) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPOSE void IGCS_EndScreenshotSession() {
|
EXPOSE void __cdecl IGCS_EndScreenshotSession() {
|
||||||
GlobalEndSession();
|
GlobalEndSession();
|
||||||
printf("Called EndSession\n");
|
printf("Called EndSession\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPOSE uint8_t* U_IGCS_Initialize(MoveCameraCallback cb, SessionCallback start_cb, SessionCallback end_cb) {
|
EXPOSE uint8_t* __cdecl U_IGCS_Initialize(MoveCameraCallback cb, SessionCallback start_cb, SessionCallback end_cb) {
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
printf("Initializing callback\n");
|
printf("Initializing callback\n");
|
||||||
GlobalCallback = cb;
|
GlobalCallback = cb;
|
||||||
@@ -40,7 +40,11 @@ EXPOSE uint8_t* U_IGCS_Initialize(MoveCameraCallback cb, SessionCallback start_c
|
|||||||
GlobalEndSession = end_cb;
|
GlobalEndSession = end_cb;
|
||||||
|
|
||||||
// Load IGCS
|
// Load IGCS
|
||||||
|
#ifdef _M_IX86
|
||||||
|
HMODULE igcs = LoadLibraryA("IgcsConnector.addon32");
|
||||||
|
#else
|
||||||
HMODULE igcs = LoadLibraryA("IgcsConnector.addon64");
|
HMODULE igcs = LoadLibraryA("IgcsConnector.addon64");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!igcs) {
|
if (!igcs) {
|
||||||
MessageBoxA(
|
MessageBoxA(
|
||||||
@@ -69,9 +73,9 @@ EXPOSE uint8_t* U_IGCS_Initialize(MoveCameraCallback cb, SessionCallback start_c
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPOSE void IGCS_MoveCameraPanorama() {}
|
EXPOSE void __cdecl IGCS_MoveCameraPanorama() {}
|
||||||
|
|
||||||
EXPOSE void IGCS_MoveCameraMultishot(float step_left, float step_up, float fov, int from_start) {
|
EXPOSE void __cdecl IGCS_MoveCameraMultishot(float step_left, float step_up, float fov, int from_start) {
|
||||||
GlobalCallback(step_left, step_up, fov, from_start);
|
GlobalCallback(step_left, step_up, fov, from_start);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -1,3 +1,6 @@
|
|||||||
# ----------- Build UnityIGCSConnector ------------
|
# ----------- Build UnityIGCSConnector ------------
|
||||||
msbuild.exe UnityIGCSConnector/UnityIGCSConnector.sln -p:Configuration=Release
|
msbuild.exe UnityIGCSConnector/UnityIGCSConnector.sln -p:Configuration=Release -p:Platform=x64
|
||||||
|
|
||||||
|
msbuild.exe UnityIGCSConnector/UnityIGCSConnector.sln -p:Configuration=Release -p:Platform=x86
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,13 @@ namespace CinematicUnityExplorer.Cinematic
|
|||||||
public class UnityIGCSConnector
|
public class UnityIGCSConnector
|
||||||
{
|
{
|
||||||
// UnityIGCSConnector.dll definitions.
|
// UnityIGCSConnector.dll definitions.
|
||||||
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate void MoveCameraCallback(float step_left, float step_up, float fov, int from_start);
|
private delegate void MoveCameraCallback(float step_left, float step_up, float fov, int from_start);
|
||||||
|
|
||||||
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate void SessionCallback();
|
private delegate void SessionCallback();
|
||||||
|
|
||||||
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate IntPtr U_IGCS_Initialize(MoveCameraCallback callback, SessionCallback start_cb, SessionCallback end_cb);
|
private delegate IntPtr U_IGCS_Initialize(MoveCameraCallback callback, SessionCallback start_cb, SessionCallback end_cb);
|
||||||
|
|
||||||
// Store the initial position when a session start in IGCSDof.
|
// Store the initial position when a session start in IGCSDof.
|
||||||
@@ -118,10 +123,11 @@ namespace CinematicUnityExplorer.Cinematic
|
|||||||
|
|
||||||
public UnityIGCSConnector()
|
public UnityIGCSConnector()
|
||||||
{
|
{
|
||||||
var lib = NativeMethods.LoadLibrary(@"UnityIGCSConnector.dll");
|
var libraryName = IntPtr.Size == 8 ? @"UnityIGCSConnector.dll" : @"UnityIGCSConnector.32.dll";
|
||||||
|
var lib = NativeMethods.LoadLibrary(libraryName);
|
||||||
if (lib == IntPtr.Zero)
|
if (lib == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
ExplorerCore.LogWarning("UnityIGCSConnector.dll was not found so IGCSDof will not be available");
|
ExplorerCore.LogWarning($"{libraryName} was not found so IGCSDof will not be available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user