Merge branch 'master' into TemporaryHackishBranch

Ignored default server change, localhost is better here because:
- single player games might also need to connect to the server for extra features,
- multiplayer works best on lan where 1 player will host the server while running the game,
- multiply instances on same pc is a thing with this build.
This commit is contained in:
LunaMoo committed 2017-11-28 02:00:01 +01:00
commit 7ca8f09c99
7 files changed
+49 -14

No files matched your search

+8 -3
View File
@@ -42,9 +42,8 @@
#include <stdlib.h>
#endif
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
#include <sys/sysctl.h> // KERN_PROC_PATHNAME
#include <unistd.h> // getpid
#endif
#if defined(__APPLE__)
@@ -767,9 +766,15 @@ const std::string &GetExeDirectory()
#elif defined(KERN_PROC_PATHNAME)
int mib[4] = {
CTL_KERN,
#if defined(__NetBSD__)
KERN_PROC_ARGS,
-1,
KERN_PROC_PATHNAME,
#else
KERN_PROC,
KERN_PROC_PATHNAME,
getpid()
-1,
#endif
};
size_t sz = program_path_size;
+20
View File
@@ -10,6 +10,10 @@
#include "GPU/Common/ShaderCommon.h"
#include "Common/StringUtils.h"
// Change this to 1, 2, and 3 to fake failures in a few places, so that
// we can test our fallback-to-GL code.
#define SIMULATE_VULKAN_FAILURE 0
#ifdef USE_CRT_DBG
#undef new
#endif
@@ -76,6 +80,9 @@ const char *PresentModeString(VkPresentModeKHR presentMode) {
}
VulkanContext::VulkanContext() {
#if SIMULATE_VULKAN_FAILURE == 1
return;
#endif
if (!VulkanLoad()) {
init_error_ = "Failed to load Vulkan driver library";
// No DLL?
@@ -89,6 +96,11 @@ VulkanContext::VulkanContext() {
}
VkResult VulkanContext::CreateInstance(const char *app_name, int app_ver, uint32_t flags) {
if (!vkCreateInstance) {
init_error_ = "Vulkan not loaded - can't create instance";
return VK_ERROR_INITIALIZATION_FAILED;
}
flags_ = flags;
// List extensions to try to enable.
@@ -123,7 +135,11 @@ VkResult VulkanContext::CreateInstance(const char *app_name, int app_ver, uint32
inst_info.enabledExtensionCount = (uint32_t)instance_extensions_enabled_.size();
inst_info.ppEnabledExtensionNames = instance_extensions_enabled_.size() ? instance_extensions_enabled_.data() : nullptr;
#if SIMULATE_VULKAN_FAILURE == 2
VkResult res = VK_ERROR_INCOMPATIBLE_DRIVER;
#else
VkResult res = vkCreateInstance(&inst_info, nullptr, &instance_);
#endif
if (res != VK_SUCCESS) {
if (res == VK_ERROR_LAYER_NOT_PRESENT) {
WLOG("Validation on but layers not available - dropping layers");
@@ -152,7 +168,11 @@ VkResult VulkanContext::CreateInstance(const char *app_name, int app_ver, uint32
}
uint32_t gpu_count = 1;
#if SIMULATE_VULKAN_FAILURE == 3
gpu_count = 0;
#else
res = vkEnumeratePhysicalDevices(instance_, &gpu_count, nullptr);
#endif
if (gpu_count <= 0) {
ELOG("Vulkan driver found but no supported GPU is available");
init_error_ = "No Vulkan physical devices found";
+2
View File
@@ -269,6 +269,8 @@ namespace Reporting
return "DragonFly";
#elif defined(__FreeBSD__)
return "FreeBSD";
#elif defined(__FreeBSD_kernel__) && defined(__GLIBC__)
return "GNU/kFreeBSD";
#elif defined(__NetBSD__)
return "NetBSD";
#elif defined(__OpenBSD__)
+2 -1
View File
@@ -1848,6 +1848,8 @@ void GPUCommon::Execute_ImmVertexAlphaPrim(u32 op, u32 diff) {
// Instead of finding a proper point to flush, we just emit a full rectangle every time one
// is finished.
FlushImm();
// Need to reset immCount_ here. If we do it in FlushImm it could get skipped by gstate_c.skipDrawReason.
immCount_ = 0;
} else {
ERROR_LOG_REPORT_ONCE(imm_draw_prim, G3D, "Immediate draw: Unexpected primitive %d at count %d", prim, immCount_);
}
@@ -1884,7 +1886,6 @@ void GPUCommon::FlushImm() {
drawEngineCommon_->DispatchFlush();
// TOOD: In the future, make a special path for these.
// drawEngineCommon_->DispatchSubmitImm(immBuffer_, immCount_);
immCount_ = 0;
}
void GPUCommon::ExecuteOp(u32 op, u32 diff) {
+4 -5
View File
@@ -507,14 +507,13 @@ void LogoScreen::render() {
dc.SetFontStyle(dc.theme->uiFont);
dc.DrawText(temp, bounds.centerX(), bounds.centerY() + 40, textColor, ALIGN_CENTER);
dc.DrawText(cr->T("license", "Free Software under GPL 2.0+"), bounds.centerX(), bounds.centerY() + 70, textColor, ALIGN_CENTER);
dc.DrawText("www.ppsspp.org", bounds.centerX(), yres / 2 + 130, textColor, ALIGN_CENTER);
if (boot_filename.size()) {
dc.DrawTextShadow(boot_filename.c_str(), bounds.centerX(), bounds.centerY() + 180, textColor, ALIGN_CENTER);
}
int ppsspp_org_y = yres / 2 + 130;
dc.DrawText("www.ppsspp.org", bounds.centerX(), ppsspp_org_y, textColor, ALIGN_CENTER);
#if (defined(_WIN32) && !PPSSPP_PLATFORM(UWP)) || PPSSPP_PLATFORM(ANDROID)
// Draw the graphics API, except on UWP where it's always D3D11
dc.DrawText(screenManager()->getDrawContext()->GetInfoString(InfoField::APINAME).c_str(), bounds.centerX(), bounds.y2() - 100, textColor, ALIGN_CENTER);
dc.DrawText(screenManager()->getDrawContext()->GetInfoString(InfoField::APINAME).c_str(), bounds.centerX(), ppsspp_org_y + 50, textColor, ALIGN_CENTER);
#endif
dc.End();
+2
View File
@@ -301,6 +301,7 @@ bool AndroidVulkanContext::Init(ANativeWindow *wnd, int desiredBackbufferSizeX,
int physicalDevice = g_Vulkan->GetBestPhysicalDevice();
if (physicalDevice < 0) {
ELOG("No usable Vulkan device found.");
g_Vulkan->DestroyInstance();
delete g_Vulkan;
g_Vulkan = nullptr;
return false;
@@ -313,6 +314,7 @@ bool AndroidVulkanContext::Init(ANativeWindow *wnd, int desiredBackbufferSizeX,
if (g_Vulkan->CreateDevice() != VK_SUCCESS) {
ILOG("Failed to create vulkan device: %s", g_Vulkan->InitError().c_str());
System_SendMessage("toast", "No Vulkan driver found. Using OpenGL instead.");
g_Vulkan->DestroyInstance();
delete g_Vulkan;
g_Vulkan = nullptr;
return false;
@@ -288,6 +288,8 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
// All other device types are treated the same.
}
isXperiaPlay = IsXperiaPlay();
String libraryDir = getApplicationLibraryDir(appInfo);
@@ -453,17 +455,21 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
shuttingDown = false;
registerCallbacks();
if (!initialized) {
Initialize();
initialized = true;
}
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
densityDpi = metrics.densityDpi;
refreshRate = display.getRefreshRate();
// Set early to be able to set defaults when loading config for the first time. Like figuring out
// whether to start at 1x or 2x.
NativeApp.setDisplayParameters(metrics.widthPixels, metrics.heightPixels, (int)densityDpi, refreshRate);
if (!initialized) {
Initialize();
initialized = true;
}
// OK, config should be initialized, we can query for screen rotation.
updateScreenRotation("onCreate");
updateSustainedPerformanceMode();