Some fixes more log statements, and changed version to v2.1.

This commit is contained in:
2016-12-09 22:07:13 +01:00
parent 765dcd0408
commit c54ee1b4c0
7 changed files with 43 additions and 10 deletions
+11
View File
@@ -0,0 +1,11 @@
* GLOBAL:
FORMAT = "[%level] %datetime{%Y-%M-%d %H:%m:%s}: %msg"
FILENAME = "AdvancedSettings.log"
ENABLED = true
TO_FILE = true
TO_STANDARD_OUTPUT = true
MAX_LOG_FILE_SIZE = 2097152 ## 2MB
* DEBUG:
ENABLED = true
* TRACE:
ENABLED = false
+2
View File
@@ -40,6 +40,7 @@ MyStackViewPage {
steamvrSupersamplingText.text = val.toFixed(1) steamvrSupersamplingText.text = val.toFixed(1)
} }
onValueChanged: { onValueChanged: {
console.debug("Supersampling Slider: valueChanged(", this.value, ")")
SteamVRTabController.setSuperSampling(this.value.toFixed(1), false) SteamVRTabController.setSuperSampling(this.value.toFixed(1), false)
} }
} }
@@ -90,6 +91,7 @@ MyStackViewPage {
steamvrCompositorSupersamplingText.text = val.toFixed(1) steamvrCompositorSupersamplingText.text = val.toFixed(1)
} }
onValueChanged: { onValueChanged: {
console.debug("Compositor Supersampling Slider: valueChanged(", this.value, ")")
SteamVRTabController.setCompositorSuperSampling(this.value.toFixed(1), false) SteamVRTabController.setCompositorSuperSampling(this.value.toFixed(1), false)
} }
} }
+1
View File
@@ -0,0 +1 @@
start AdvancedSettings.exe -desktop -nosound
+10 -5
View File
@@ -19,7 +19,9 @@ const char* logConfigDefault =
" TO_STANDARD_OUTPUT = true\n" " TO_STANDARD_OUTPUT = true\n"
" MAX_LOG_FILE_SIZE = 2097152 ## 2MB\n" " MAX_LOG_FILE_SIZE = 2097152 ## 2MB\n"
"* TRACE:\n" "* TRACE:\n"
" FORMAT = \"[%level] %datetime{%Y-%M-%d %H:%m:%s} %func: %msg\"\n"; " ENABLED = false\n"
"* DEBUG:\n"
" ENABLED = false\n";
INITIALIZE_EASYLOGGINGPP INITIALIZE_EASYLOGGINGPP
@@ -27,6 +29,8 @@ void myQtMessageHandler(QtMsgType type, const QMessageLogContext &context, const
QByteArray localMsg = msg.toLocal8Bit(); QByteArray localMsg = msg.toLocal8Bit();
switch (type) { switch (type) {
case QtDebugMsg: case QtDebugMsg:
LOG(DEBUG) << localMsg.constData() << "(" << context.file << ":" << context.line << ")";
break;
case QtInfoMsg: case QtInfoMsg:
LOG(INFO) << localMsg.constData() << "(" << context.file << ":" << context.line << ")"; LOG(INFO) << localMsg.constData() << "(" << context.file << ":" << context.line << ")";
break; break;
@@ -98,13 +102,14 @@ int main(int argc, char *argv[]) {
controller->SetWidget(qobject_cast<QQuickItem*>(quickObj), advsettings::OverlayController::applicationName, advsettings::OverlayController::applicationKey); controller->SetWidget(qobject_cast<QQuickItem*>(quickObj), advsettings::OverlayController::applicationName, advsettings::OverlayController::applicationKey);
if (!desktopMode && !noManifest) { if (!desktopMode && !noManifest) {
std::string manifestPath = QApplication::applicationDirPath().toStdString() + "\\manifest.vrmanifest"; auto manifestQPath = QDir(QApplication::applicationDirPath()).absoluteFilePath("manifest.vrmanifest");
if (QFile::exists(QString::fromStdString(manifestPath))) { //std::string manifestPath = QDir::toNativeSeparators(QApplication::applicationDirPath()).toStdString() + "\\manifest.vrmanifest";
if (QFile::exists(manifestQPath)) {
bool firstTime = false; bool firstTime = false;
if (!vr::VRApplications()->IsApplicationInstalled(advsettings::OverlayController::applicationKey)) { if (!vr::VRApplications()->IsApplicationInstalled(advsettings::OverlayController::applicationKey)) {
firstTime; firstTime;
} }
auto apperror = vr::VRApplications()->AddApplicationManifest(manifestPath.c_str()); auto apperror = vr::VRApplications()->AddApplicationManifest(QDir::toNativeSeparators(manifestQPath).toStdString().c_str());
if (apperror != vr::VRApplicationError_None) { if (apperror != vr::VRApplicationError_None) {
LOG(ERROR) << "Could not add application manifest: " << vr::VRApplications()->GetApplicationsErrorNameFromEnum(apperror); LOG(ERROR) << "Could not add application manifest: " << vr::VRApplications()->GetApplicationsErrorNameFromEnum(apperror);
} else if (firstTime) { } else if (firstTime) {
@@ -114,7 +119,7 @@ int main(int argc, char *argv[]) {
} }
} }
} else { } else {
LOG(ERROR) << "Could not find application manifest: " << manifestPath; LOG(ERROR) << "Could not find application manifest: " << manifestQPath;
} }
} }
+2
View File
@@ -136,12 +136,14 @@ void OverlayController::Shutdown() {
if (m_pPumpEventsTimer) { if (m_pPumpEventsTimer) {
disconnect(m_pPumpEventsTimer.get(), SIGNAL(timeout()), this, SLOT(OnTimeoutPumpEvents())); disconnect(m_pPumpEventsTimer.get(), SIGNAL(timeout()), this, SLOT(OnTimeoutPumpEvents()));
m_pPumpEventsTimer->stop(); m_pPumpEventsTimer->stop();
m_pPumpEventsTimer.reset();
} }
if (m_pRenderTimer) { if (m_pRenderTimer) {
disconnect(m_pRenderControl.get(), SIGNAL(renderRequested()), this, SLOT(OnRenderRequest())); disconnect(m_pRenderControl.get(), SIGNAL(renderRequested()), this, SLOT(OnRenderRequest()));
disconnect(m_pRenderControl.get(), SIGNAL(sceneChanged()), this, SLOT(OnRenderRequest())); disconnect(m_pRenderControl.get(), SIGNAL(sceneChanged()), this, SLOT(OnRenderRequest()));
disconnect(m_pRenderTimer.get(), SIGNAL(timeout()), this, SLOT(renderOverlay())); disconnect(m_pRenderTimer.get(), SIGNAL(timeout()), this, SLOT(renderOverlay()));
m_pRenderTimer->stop(); m_pRenderTimer->stop();
m_pRenderTimer.reset();
} }
m_pWindow.reset(); m_pWindow.reset();
m_pRenderControl.reset(); m_pRenderControl.reset();
+1 -1
View File
@@ -41,7 +41,7 @@ class OverlayController : public QObject {
public: public:
static constexpr const char* applicationKey = "matzman666.AdvancedSettings"; static constexpr const char* applicationKey = "matzman666.AdvancedSettings";
static constexpr const char* applicationName = "Advanced Settings"; static constexpr const char* applicationName = "Advanced Settings";
static constexpr const char* applicationVersionString = "v2.0"; static constexpr const char* applicationVersionString = "v2.1";
private: private:
vr::VROverlayHandle_t m_ulOverlayHandle = vr::k_ulOverlayHandleInvalid; vr::VROverlayHandle_t m_ulOverlayHandle = vr::k_ulOverlayHandleInvalid;
+16 -4
View File
@@ -23,8 +23,12 @@ void SteamVRTabController::eventLoopTick() {
auto ss = vr::VRSettings()->GetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError); auto ss = vr::VRSettings()->GetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError);
if (vrSettingsError != vr::VRSettingsError_None) { if (vrSettingsError != vr::VRSettingsError_None) {
LOG(WARNING) << "Could not read \"" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError); LOG(WARNING) << "Could not read \"" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
setSuperSampling(1.0); if (m_superSampling != 1.0) {
} else { LOG(DEBUG) << "OpenVR returns an error and we have a custom supersampling value: " << m_superSampling;
setSuperSampling(1.0);
}
} else if (m_superSampling != ss) {
LOG(DEBUG) << "OpenVR reports a changed supersampling value: " << m_superSampling << " => " << ss;
setSuperSampling(ss); setSuperSampling(ss);
} }
auto css = vr::VRSettings()->GetFloat(vrsettings_compositor_category, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError); auto css = vr::VRSettings()->GetFloat(vrsettings_compositor_category, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError);
@@ -32,8 +36,12 @@ void SteamVRTabController::eventLoopTick() {
if (vrSettingsError != vr::VRSettingsError_UnsetSettingHasNoDefault) { // does not appear in the default settings file as of beta 1477423729 if (vrSettingsError != vr::VRSettingsError_UnsetSettingHasNoDefault) { // does not appear in the default settings file as of beta 1477423729
LOG(WARNING) << "Could not read \"compositor::" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError); LOG(WARNING) << "Could not read \"compositor::" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
} }
setCompositorSuperSampling(1.0); if (m_compositorSuperSampling != 1.0) {
} else { LOG(DEBUG) << "OpenVR returns an error and we have a custom compositor supersampling value: " << m_compositorSuperSampling;
setCompositorSuperSampling(1.0);
}
} else if (m_compositorSuperSampling != css) {
LOG(DEBUG) << "OpenVR reports a changed compositor supersampling value: " << m_compositorSuperSampling << " => " << css;
setCompositorSuperSampling(css); setCompositorSuperSampling(css);
} }
auto air = vr::VRSettings()->GetBool(vr::k_pch_SteamVR_Section, vrsettings_steamvr_allowInterleavedReprojection, &vrSettingsError); auto air = vr::VRSettings()->GetBool(vr::k_pch_SteamVR_Section, vrsettings_steamvr_allowInterleavedReprojection, &vrSettingsError);
@@ -60,9 +68,11 @@ void SteamVRTabController::eventLoopTick() {
void SteamVRTabController::setSuperSampling(float value, bool notify) { void SteamVRTabController::setSuperSampling(float value, bool notify) {
if (value <= 0.01f) { if (value <= 0.01f) {
LOG(WARNING) << "Encountered a supersampling value <= 0.01, setting supersampling to 1.0";
value = 1.0f; value = 1.0f;
} }
if (m_superSampling != value) { if (m_superSampling != value) {
LOG(DEBUG) << "Supersampling value changed: " << m_superSampling << " => " << value;
m_superSampling = value; m_superSampling = value;
vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_superSampling); vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_superSampling);
vr::VRSettings()->Sync(); vr::VRSettings()->Sync();
@@ -75,9 +85,11 @@ void SteamVRTabController::setSuperSampling(float value, bool notify) {
void SteamVRTabController::setCompositorSuperSampling(float value, bool notify) { void SteamVRTabController::setCompositorSuperSampling(float value, bool notify) {
if (value <= 0.01f) { if (value <= 0.01f) {
LOG(WARNING) << "Encountered a compositor supersampling value <= 0.01, setting supersampling to 1.0";
value = 1.0f; value = 1.0f;
} }
if (m_compositorSuperSampling != value) { if (m_compositorSuperSampling != value) {
LOG(DEBUG) << "Compositor supersampling value changed: " << m_compositorSuperSampling << " => " << value;
m_compositorSuperSampling = value; m_compositorSuperSampling = value;
vr::VRSettings()->SetFloat(vrsettings_compositor_category, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_compositorSuperSampling); vr::VRSettings()->SetFloat(vrsettings_compositor_category, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_compositorSuperSampling);
vr::VRSettings()->Sync(); vr::VRSettings()->Sync();