From dd440b2adad3d75022de4e0b93338a38cdd1be57 Mon Sep 17 00:00:00 2001 From: mcc Date: Sun, 28 Oct 2018 15:31:27 -0400 Subject: [PATCH] Code cleanup after all these changes, fix build --- CMakeLists.txt | 5 ++--- src/api/headset.c | 3 --- src/lib/glfw.h | 2 +- src/util.c | 4 ---- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 997a0270..81611fa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ option(LOVR_ENABLE_JSON "Bundle with lua-cjson" ON) option(LOVR_USE_LUAJIT "Use LuaJIT instead of Lua" ON) option(LOVR_USE_ASSIMP "Enable model loading with Assimp" ON) +option(LOVR_USE_OPENVR "Enable the OpenVR backend for the headset module" ON) option(LOVR_USE_WEBVR "Enable the WebVR backend for the headset module" OFF) option(LOVR_USE_OCULUS "Enable the LibOVR backend for the headset module (be sure to also set LOVR_OCULUS_PATH to point to the Oculus SDK)" OFF) option(LOVR_USE_OCULUS_MOBILE "Enable the Oculus Mobile (Android) backend for the headset module" OFF) @@ -461,8 +462,6 @@ if(LOVR_ENABLE_HEADSET) add_definitions(-DLOVR_USE_OCULUS_MOBILE) add_definitions(-DNO_WINDOW=1) - #add_definitions(-DLOVRAPP_LIBLOVR_INTERNAL_PATH=) # TODO? - # OCULUS_MOBILE assumes it will be built as part of an Android app, and that it is a git submodule of that app. # The "BridgeLovr" files live in the parent (app) repository: include_directories(../include) @@ -565,7 +564,7 @@ if(WIN32) move_dll(${LOVR_GLFW}) move_dll(${LOVR_LUA}) move_dll(${LOVR_ODE}) - if (NOT LOVR_USE_OCULUS) + if (LOVR_USE_OPENVR) move_dll(${LOVR_OPENVR}) endif() move_dll(${LOVR_PHYSFS}) diff --git a/src/api/headset.c b/src/api/headset.c index 9f9389dc..98eebae5 100644 --- a/src/api/headset.c +++ b/src/api/headset.c @@ -70,14 +70,11 @@ typedef struct { static HeadsetRenderData headsetRenderData; -#include - static void renderHelper(void* userdata) { HeadsetRenderData* renderData = userdata; lua_State* L = renderData->L; #ifdef LOVR_HEADSET_HELPER_USES_REGISTRY lua_rawgeti(L, LUA_REGISTRYINDEX, renderData->ref); - __android_log_print(ANDROID_LOG_ERROR, "LOVR", "ON ANDROID PATH AS EXPECTED (%d) (%d,%d)", (int)renderData->ref, (int)lua_type(L, -1), (int)LUA_TFUNCTION); #else lua_pushvalue(L, -1); #endif diff --git a/src/lib/glfw.h b/src/lib/glfw.h index 09222225..40b3bdf4 100644 --- a/src/lib/glfw.h +++ b/src/lib/glfw.h @@ -14,9 +14,9 @@ // These are stubs of necessary GLFW functions for platforms lacking GLFW, such as Oculus Mobile. // All of Lovr will build with just these functions as long as you build with NO_WINDOW and omit fake.c. -// TODO: Move to own header typedef void GLFWwindow; #define GLFWAPI +#define GLFWAPI_IS_FAKE GLFWAPI void glfwPollEvents(); GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); GLFWAPI GLFWwindow* glfwGetCurrentContext(void); diff --git a/src/util.c b/src/util.c index c1b326d0..9e988dd0 100644 --- a/src/util.c +++ b/src/util.c @@ -11,10 +11,6 @@ #include #include #endif -#ifdef LOVR_USE_OCULUS_MOBILE -#include -#include -#endif _Thread_local lovrErrorHandler lovrErrorCallback = NULL; _Thread_local void* lovrErrorUserdata = NULL;