Code cleanup after all these changes, fix build

This commit is contained in:
mcc 2018-10-28 15:31:27 -04:00
parent dba6724915
commit dd440b2ada
4 changed files with 3 additions and 11 deletions

View File

@ -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})

View File

@ -70,14 +70,11 @@ typedef struct {
static HeadsetRenderData headsetRenderData;
#include <android/log.h>
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

View File

@ -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);

View File

@ -11,10 +11,6 @@
#include <unistd.h>
#include <dlfcn.h>
#endif
#ifdef LOVR_USE_OCULUS_MOBILE
#include <android/log.h>
#include <assert.h>
#endif
_Thread_local lovrErrorHandler lovrErrorCallback = NULL;
_Thread_local void* lovrErrorUserdata = NULL;