Vita: Allow completely skipping pvr init to override apphint from app
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
diff --git a/src/video/vita/SDL_vitagl_pvr.c b/src/video/vita/SDL_vitagl_pvr.c
index 1cc3371..aa69905 100644
--- a/src/video/vita/SDL_vitagl_pvr.c
+++ b/src/video/vita/SDL_vitagl_pvr.c
@@ -39,30 +39,34 @@ VITA_GL_LoadLibrary(_THIS, const char *path)
{
PVRSRV_PSP2_APPHINT hint;
char* override = SDL_getenv("VITA_MODULE_PATH");
+ char* skip_init = SDL_getenv("VITA_PVR_SKIP_INIT");
char* default_path = "app0:module";
char target_path[MAX_PATH];
- if (override != NULL)
+ if (skip_init == NULL) // we don't care about actual value
{
- default_path = override;
- }
+ if (override != NULL)
+ {
+ default_path = override;
+ }
- sceKernelLoadStartModule("vs0:sys/external/libfios2.suprx", 0, NULL, 0, NULL, NULL);
- sceKernelLoadStartModule("vs0:sys/external/libc.suprx", 0, NULL, 0, NULL, NULL);
+ sceKernelLoadStartModule("vs0:sys/external/libfios2.suprx", 0, NULL, 0, NULL, NULL);
+ sceKernelLoadStartModule("vs0:sys/external/libc.suprx", 0, NULL, 0, NULL, NULL);
- SDL_snprintf(target_path, MAX_PATH, "%s/%s", default_path, "libgpu_es4_ext.suprx");
- sceKernelLoadStartModule(target_path, 0, NULL, 0, NULL, NULL);
+ SDL_snprintf(target_path, MAX_PATH, "%s/%s", default_path, "libgpu_es4_ext.suprx");
+ sceKernelLoadStartModule(target_path, 0, NULL, 0, NULL, NULL);
- SDL_snprintf(target_path, MAX_PATH, "%s/%s", default_path, "libIMGEGL.suprx");
- sceKernelLoadStartModule(target_path, 0, NULL, 0, NULL, NULL);
+ SDL_snprintf(target_path, MAX_PATH, "%s/%s", default_path, "libIMGEGL.suprx");
+ sceKernelLoadStartModule(target_path, 0, NULL, 0, NULL, NULL);
- PVRSRVInitializeAppHint(&hint);
+ PVRSRVInitializeAppHint(&hint);
- SDL_snprintf(hint.szGLES1, MAX_PATH, "%s/%s", default_path, "libGLESv1_CM.suprx");
- SDL_snprintf(hint.szGLES2, MAX_PATH, "%s/%s", default_path, "libGLESv2.suprx");
- SDL_snprintf(hint.szWindowSystem, MAX_PATH, "%s/%s", default_path, "libpvrPSP2_WSEGL.suprx");
+ SDL_snprintf(hint.szGLES1, MAX_PATH, "%s/%s", default_path, "libGLESv1_CM.suprx");
+ SDL_snprintf(hint.szGLES2, MAX_PATH, "%s/%s", default_path, "libGLESv2.suprx");
+ SDL_snprintf(hint.szWindowSystem, MAX_PATH, "%s/%s", default_path, "libpvrPSP2_WSEGL.suprx");
- PVRSRVCreateVirtualAppHint(&hint);
+ PVRSRVCreateVirtualAppHint(&hint);
+ }
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) 0, 0);
}