Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Virtual Acoustics Plugin
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Plugins
Virtual Acoustics Plugin
Commits
16aebf1d
Commit
16aebf1d
authored
3 weeks ago
by
cos-erm
Browse files
Options
Downloads
Patches
Plain Diff
Raw to unique pointer - allows for newer and older dll versions
parent
8c62fb42
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/VAPlugin/Private/VAPlugin.cpp
+28
-4
28 additions, 4 deletions
Source/VAPlugin/Private/VAPlugin.cpp
Source/VAPlugin/Private/VAPlugin.h
+2
-2
2 additions, 2 deletions
Source/VAPlugin/Private/VAPlugin.h
with
30 additions
and
6 deletions
Source/VAPlugin/Private/VAPlugin.cpp
+
28
−
4
View file @
16aebf1d
...
...
@@ -59,8 +59,8 @@ bool FVAPlugin::bUseVA = true;
bool
FVAPlugin
::
bDebugMode
=
true
;
// Interface Classes to Server
IVANetClient
*
FVAPlugin
::
VANetClient
;
IVAInterface
*
FVAPlugin
::
VAServer
;
std
::
unique_ptr
<
IVANetClient
>
FVAPlugin
::
VANetClient
;
std
::
unique_ptr
<
IVAInterface
>
FVAPlugin
::
VAServer
;
// Link to the current receiver actor
AVAReceiverActor
*
FVAPlugin
::
ReceiverActor
=
nullptr
;
...
...
@@ -293,7 +293,16 @@ bool FVAPlugin::ConnectServer(const FString HostF, const int Port)
FVAUtils
::
LogStuff
(
"[FVAPlugin::ConnectServer()]: Connecting to VAServer. Be sure to have it switched on"
,
false
);
try
{
VANetClient
=
IVANetClient
::
Create
();
VANetClient
=
[]()
{
if
constexpr
(
std
::
is_same_v
<
decltype
(
IVANetClient
::
Create
()),
std
::
unique_ptr
<
IVANetClient
>>
)
{
// New dll (>= 2025) with unique pointer
return
IVANetClient
::
Create
();
}
else
{
// Old dll with raw pointer -> convert to unique pointer
return
std
::
unique_ptr
<
IVANetClient
>
{
IVANetClient
::
Create
()};
}
}();
const
std
::
string
HostS
(
TCHAR_TO_UTF8
(
*
HostF
));
VANetClient
->
Initialize
(
HostS
,
Port
);
...
...
@@ -304,7 +313,22 @@ bool FVAPlugin::ConnectServer(const FString HostF, const int Port)
return
false
;
}
VAServer
=
VANetClient
->
GetCoreInstance
();
VAServer
=
[]()
->
std
::
unique_ptr
<
IVAInterface
>
{
using
IVANetInstance
=
decltype
(
std
::
declval
<
IVANetClient
>
());
if
constexpr
(
std
::
is_same_v
<
decltype
(
std
::
declval
<
IVANetInstance
>
().
GetCoreInstance
()),
std
::
unique_ptr
<
IVAInterface
>
>
)
{
// New dll (>= 2025)
return
std
::
move
(
VANetClient
->
GetCoreInstance
());
}
else
{
// Old dll
return
std
::
unique_ptr
<
IVAInterface
>
{
VANetClient
->
GetCoreInstance
()};
}
}();
VAServer
->
Reset
();
}
catch
(
CVAException
&
e
)
...
...
This diff is collapsed.
Click to expand it.
Source/VAPlugin/Private/VAPlugin.h
+
2
−
2
View file @
16aebf1d
...
...
@@ -179,8 +179,8 @@ protected:
static
bool
bDebugMode
;
// bool if is in Debug Mode
// Interface Classes to Server
static
IVANetClient
*
VANetClient
;
// VA Net Client
static
IVAInterface
*
VAServer
;
// VA Server Interface
static
std
::
unique_ptr
<
IVANetClient
>
VANetClient
;
// VA Net Client
static
std
::
unique_ptr
<
IVAInterface
>
VAServer
;
// VA Server Interface
// Link to the current receiver actor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment