diff --git a/Common/File/DirListing.cpp b/Common/File/DirListing.cpp index d17a4f2241..b793e85057 100644 --- a/Common/File/DirListing.cpp +++ b/Common/File/DirListing.cpp @@ -317,7 +317,7 @@ std::vector GetWindowsDrives() { if (logicaldrives & (1 << i)) { - CHAR driveName[] = { TEXT('A') + i, TEXT(':'), TEXT('\\'), TEXT('\0') }; + CHAR driveName[] = { (CHAR)(TEXT('A') + i), TEXT(':'), TEXT('\\'), TEXT('\0') }; std::string str(driveName); drives.push_back(driveName); } diff --git a/Common/VR/PPSSPPVR.cpp b/Common/VR/PPSSPPVR.cpp index abbd78cfdf..384be0b031 100644 --- a/Common/VR/PPSSPPVR.cpp +++ b/Common/VR/PPSSPPVR.cpp @@ -1,3 +1,5 @@ +#ifdef OPENXR + #include "Common/GPU/OpenGL/GLRenderManager.h" #include "Common/GPU/Vulkan/VulkanContext.h" @@ -12,8 +14,6 @@ #include "Core/KeyMap.h" #include "Core/System.h" -#ifdef OPENXR - static long vrCompat[VR_COMPAT_MAX]; /* diff --git a/Common/VR/VRBase.cpp b/Common/VR/VRBase.cpp index c30003624b..e0301bb6e6 100644 --- a/Common/VR/VRBase.cpp +++ b/Common/VR/VRBase.cpp @@ -5,7 +5,7 @@ #include #include -#if PPSSPP_PLATFORM(ANDROID) +#if defined(ANDROID) && defined(OPENXR) #include diff --git a/Common/VR/VRBase.h b/Common/VR/VRBase.h index 4caa9417ba..b0d7b09f81 100644 --- a/Common/VR/VRBase.h +++ b/Common/VR/VRBase.h @@ -1,9 +1,7 @@ #pragma once -#include "ppsspp_config.h" - // TODO: Switch to PPSSPP logging -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID #include #define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, "OpenXR", __VA_ARGS__); #define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "OpenXR", __VA_ARGS__); @@ -21,7 +19,7 @@ using namespace PPSSPP_VK; #endif -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID //OpenXR #define XR_USE_PLATFORM_ANDROID 1 #define XR_USE_GRAPHICS_API_OPENGL_ES 1 @@ -29,7 +27,7 @@ using namespace PPSSPP_VK; #include #include #include -#elif PPSSPP_PLATFORM(WINDOWS) +#elif defined(_WIN32) #include "Common/CommonWindows.h" #include #define XR_USE_PLATFORM_WIN32 1 @@ -44,14 +42,14 @@ using namespace PPSSPP_VK; #include #include -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID #include #include #endif -#if defined(_DEBUG) && PPSSPP_PLATFORM(ANDROID) +#if defined(_DEBUG) && defined(ANDROID) static const char* GlErrorString(GLenum error) { switch (error) { case GL_NO_ERROR: @@ -169,7 +167,7 @@ typedef struct { ovrRenderer Renderer; } ovrApp; -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID typedef struct { JavaVM* Vm; jobject ActivityObject; @@ -182,7 +180,7 @@ typedef struct { typedef struct { uint64_t frameIndex; ovrApp appState; -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID ovrJava java; #endif float predictedDisplayTime; @@ -190,7 +188,7 @@ typedef struct { XrGraphicsBindingVulkanKHR graphicsBindingVulkan; } engine_t; -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID void VR_Init( ovrJava java, bool useVulkan ); #endif diff --git a/Common/VR/VRFramebuffer.cpp b/Common/VR/VRFramebuffer.cpp index e917006b51..2d9db6c3fc 100644 --- a/Common/VR/VRFramebuffer.cpp +++ b/Common/VR/VRFramebuffer.cpp @@ -8,7 +8,7 @@ #include #include -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID #include #include #endif @@ -44,7 +44,7 @@ void ovrFramebuffer_Clear(ovrFramebuffer* frameBuffer) { frameBuffer->Acquired = false; } -#if PPSSPP_PLATFORM(ANDROID) +#ifdef OPENXR bool ovrFramebuffer_CreateGL(XrSession session, ovrFramebuffer* frameBuffer, int width, int height, bool multiview) { @@ -138,8 +138,6 @@ bool ovrFramebuffer_CreateGL(XrSession session, ovrFramebuffer* frameBuffer, int return true; } -#endif - bool ovrFramebuffer_CreateVK(XrSession session, ovrFramebuffer* frameBuffer, int width, int height, bool multiview, void* context) { @@ -255,7 +253,7 @@ void ovrFramebuffer_Destroy(ovrFramebuffer* frameBuffer) { delete[] frameBuffer->VKDepthImages; delete[] frameBuffer->VKFrameBuffers; } else { -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID GL(glDeleteFramebuffers(frameBuffer->TextureSwapChainLength, frameBuffer->GLFrameBuffers)); free(frameBuffer->GLFrameBuffers); #endif @@ -272,7 +270,7 @@ void* ovrFramebuffer_SetCurrent(ovrFramebuffer* frameBuffer) { if (frameBuffer->UseVulkan) { return (void *)frameBuffer->VKFrameBuffers[frameBuffer->TextureSwapChainIndex]; } else { -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID GL(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBuffer->GLFrameBuffers[frameBuffer->TextureSwapChainIndex])); #endif return nullptr; @@ -304,7 +302,7 @@ void ovrFramebuffer_Acquire(ovrFramebuffer* frameBuffer) { if (frameBuffer->UseVulkan) { //TODO:implement } else { -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID GL(glEnable( GL_SCISSOR_TEST )); GL(glViewport( 0, 0, frameBuffer->Width, frameBuffer->Height )); GL(glClearColor( 0.0f, 0.0f, 0.0f, 1.0f )); @@ -326,7 +324,7 @@ void ovrFramebuffer_Release(ovrFramebuffer* frameBuffer) { if (frameBuffer->UseVulkan) { //TODO:implement } else { -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID GL(glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE)); GL(glClearColor(0.0f, 0.0f, 0.0f, 1.0f)); GL(glClear(GL_COLOR_BUFFER_BIT)); @@ -357,7 +355,7 @@ void ovrRenderer_Create(XrSession session, ovrRenderer* renderer, int width, int if (vulkanContext) { ovrFramebuffer_CreateVK(session, &renderer->FrameBuffer[i], width, height, multiview, vulkanContext); } else { -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID ovrFramebuffer_CreateGL(session, &renderer->FrameBuffer[i], width, height, multiview); #endif } @@ -375,7 +373,7 @@ void ovrRenderer_MouseCursor(ovrRenderer* renderer, int x, int y, int size) { if (renderer->FrameBuffer[0].UseVulkan) { //TODO:implement } else { -#if PPSSPP_PLATFORM(ANDROID) +#ifdef ANDROID GL(glEnable(GL_SCISSOR_TEST)); GL(glScissor(x, y, size, size)); GL(glViewport(x, y, size, size)); @@ -547,3 +545,5 @@ int ovrApp_HandleXrEvents(ovrApp* app) { } return recenter; } + +#endif diff --git a/Common/VR/VRInput.cpp b/Common/VR/VRInput.cpp index e07c44fcda..313f9f1d9b 100644 --- a/Common/VR/VRInput.cpp +++ b/Common/VR/VRInput.cpp @@ -3,6 +3,8 @@ #include +#ifdef OPENXR + //OpenXR XrPath leftHandPath; XrPath rightHandPath; @@ -432,3 +434,5 @@ XrPosef IN_VRGetPose( int controllerIndex ) { xrLocateSpace(aimSpace[controllerIndex], engine->appState.CurrentSpace, (XrTime)(engine->predictedDisplayTime), &loc); return loc.pose; } + +#endif diff --git a/Common/VR/VRRenderer.cpp b/Common/VR/VRRenderer.cpp index 08f44749e4..60db7063e1 100644 --- a/Common/VR/VRRenderer.cpp +++ b/Common/VR/VRRenderer.cpp @@ -20,6 +20,8 @@ ovrMatrix4f vrMatrix[VR_MATRIX_COUNT]; XrVector3f hmdorientation; XrVector3f hmdposition; +#ifdef OPENXR + void VR_UpdateStageBounds(ovrApp* pappState) { XrExtent2Df stageBounds = {}; @@ -512,3 +514,5 @@ void* VR_BindFramebuffer(engine_t *engine) { ovrMatrix4f VR_GetMatrix( VRMatrix matrix ) { return vrMatrix[matrix]; } + +#endif diff --git a/UWP/CommonUWP/CommonUWP.vcxproj b/UWP/CommonUWP/CommonUWP.vcxproj index 09e9173e41..90a1c1649c 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj +++ b/UWP/CommonUWP/CommonUWP.vcxproj @@ -203,7 +203,7 @@ false false pch.h - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) NotUsing @@ -217,7 +217,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) pch.h NotUsing @@ -232,7 +232,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) pch.h NotUsing @@ -248,7 +248,7 @@ false false pch.h - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) NotUsing @@ -263,7 +263,7 @@ false false pch.h - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) NotUsing @@ -277,7 +277,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) pch.h NotUsing @@ -292,7 +292,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) pch.h NotUsing @@ -307,7 +307,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) pch.h NotUsing @@ -322,7 +322,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions) pch.h NotUsing @@ -338,7 +338,7 @@ false false pch.h - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) NotUsing @@ -352,7 +352,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) pch.h NotUsing @@ -367,7 +367,7 @@ false false - ../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) + ../..;../../ext/openxr;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;../../ext/zstd/lib;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories) NOMINMAX;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions) pch.h NotUsing @@ -502,6 +502,12 @@ + + + + + + @@ -612,6 +618,12 @@ + + + + + + diff --git a/UWP/CommonUWP/CommonUWP.vcxproj.filters b/UWP/CommonUWP/CommonUWP.vcxproj.filters index 23de400ce6..dd2f6d6fda 100644 --- a/UWP/CommonUWP/CommonUWP.vcxproj.filters +++ b/UWP/CommonUWP/CommonUWP.vcxproj.filters @@ -85,6 +85,9 @@ {28139b08-f8d5-41a2-a5ee-bf86cf1469c3} + + {a5bfc343-9c3a-43ff-a033-7b0406e13816} + @@ -375,6 +378,24 @@ Math + + VR + + + VR + + + VR + + + VR + + + VR + + + VR + @@ -694,6 +715,24 @@ Math + + VR + + + VR + + + VR + + + VR + + + VR + + + VR + diff --git a/UWP/Package.appxmanifest b/UWP/Package.appxmanifest index dc955c64bb..68b9c930d7 100644 --- a/UWP/Package.appxmanifest +++ b/UWP/Package.appxmanifest @@ -1,9 +1,11 @@  - - + + + - DUMMY - DUMMY + PPSSPP - PSP emulator + Henrik Rydgård + Assets\StoreLogo.png @@ -11,4 +13,23 @@ + + + + + + + + + + + + + + + + + + +