Implement prototype paths in manifest class
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <openvr.h>
|
#include <openvr.h>
|
||||||
#include <easylogging++.h>
|
#include <easylogging++.h>
|
||||||
|
#include "../utils/paths.h"
|
||||||
|
|
||||||
namespace input
|
namespace input
|
||||||
{
|
{
|
||||||
@@ -14,16 +15,23 @@ class Manifest
|
|||||||
public:
|
public:
|
||||||
Manifest()
|
Manifest()
|
||||||
{
|
{
|
||||||
QString actionManifestPath = QStandardPaths::locate(
|
const auto actionManifestPath
|
||||||
QStandardPaths::AppDataLocation,
|
= paths::binaryDirectoryFindFile( "action_manifest.json" );
|
||||||
QStringLiteral( "action_manifest.json" ) );
|
|
||||||
|
|
||||||
auto error = vr::VRInput()->SetActionManifestPath(
|
if ( !actionManifestPath.has_value() )
|
||||||
actionManifestPath.toStdString().c_str() );
|
{
|
||||||
|
LOG( ERROR ) << "Could not find action manifest. Action manifests "
|
||||||
|
"not initialized.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto validManifestPath = actionManifestPath->c_str();
|
||||||
|
|
||||||
|
auto error = vr::VRInput()->SetActionManifestPath( validManifestPath );
|
||||||
if ( error != vr::EVRInputError::VRInputError_None )
|
if ( error != vr::EVRInputError::VRInputError_None )
|
||||||
{
|
{
|
||||||
LOG( ERROR ) << "Error setting action manifest path: "
|
LOG( ERROR ) << "Error setting action manifest path: "
|
||||||
<< actionManifestPath << ". OpenVR Error: " << error;
|
<< validManifestPath << ". OpenVR Error: " << error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ optional<string> binaryDirectoryFindFile( const string fileName )
|
|||||||
|
|
||||||
if ( path == "" )
|
if ( path == "" )
|
||||||
{
|
{
|
||||||
LOG( ERROR ) << "Could not find file '" << fileName
|
LOG( ERROR ) << "Could not find file '" << fileName.c_str()
|
||||||
<< "' in binary directory.";
|
<< "' in binary directory.";
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user