mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Add a way to get the "System name" (will be mostly useful for android). Tweaks.
This commit is contained in:
parent
2175499217
commit
0a857fe4a1
@ -31,6 +31,8 @@ static JNIEnv *jniEnvUI;
|
||||
std::string frameCommand;
|
||||
std::string frameCommandParam;
|
||||
|
||||
std::string systemName;
|
||||
|
||||
const bool extraLog = true;
|
||||
|
||||
static float left_joystick_x_async;
|
||||
@ -84,6 +86,10 @@ void System_InputBox(const char *title, const char *defaultValue) {
|
||||
frameCommandParam = title;
|
||||
}
|
||||
|
||||
std::string System_GetName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
// Remember that all of these need initialization on init! The process
|
||||
// may be reused when restarting the game. Globals are DANGEROUS.
|
||||
|
||||
@ -152,7 +158,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
ILOG("NativeApp::Init: APK path: %s", apkPath.c_str());
|
||||
VFSRegister("", new ZipAssetReader(apkPath.c_str(), "assets/"));
|
||||
|
||||
std::string deviceType = GetJavaString(env, jdevicetype);
|
||||
systemName = GetJavaString(env, jdevicetype);
|
||||
|
||||
std::string externalDir = GetJavaString(env, jexternalDir);
|
||||
std::string user_data_path = GetJavaString(env, jdataDir) + "/";
|
||||
|
@ -97,3 +97,4 @@ void LaunchBrowser(const char *url);
|
||||
void LaunchMarket(const char *url);
|
||||
void LaunchEmail(const char *email_address);
|
||||
void System_InputBox(const char *title, const char *defaultValue);
|
||||
std::string System_GetName();
|
@ -248,6 +248,11 @@ void LaunchEmail(const char *email_address)
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string System_GetName() {
|
||||
// TODO
|
||||
return "SDL";
|
||||
}
|
||||
|
||||
|
||||
|
||||
InputState input_state;
|
||||
|
@ -82,10 +82,12 @@ void CheckGLExtensions() {
|
||||
memset(&gl_extensions, 0, sizeof(gl_extensions));
|
||||
|
||||
const char *extString = (const char *)glGetString(GL_EXTENSIONS);
|
||||
gl_extensions.all_gl_extensions = extString;
|
||||
|
||||
#ifdef WIN32
|
||||
const char *wglString = wglGetExtensionsStringEXT();
|
||||
gl_extensions.EXT_swap_control_tear = strstr(wglString, "WGL_EXT_swap_control_tear") != 0;
|
||||
gl_extensions.all_egl_extensions = wglString;
|
||||
#elif !defined(USING_GLES2)
|
||||
// const char *glXString = glXQueryExtensionString();
|
||||
// gl_extensions.EXT_swap_control_tear = strstr(glXString, "GLX_EXT_swap_control_tear") != 0;
|
||||
@ -132,6 +134,7 @@ void CheckGLExtensions() {
|
||||
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
|
||||
const char *eglString = eglQueryString(display, EGL_EXTENSIONS);
|
||||
gl_extensions.all_egl_extensions = eglString;
|
||||
|
||||
gl_extensions.EGL_NV_system_time = strstr(eglString, "EGL_NV_system_time") != 0;
|
||||
gl_extensions.EGL_NV_coverage_sample = strstr(eglString, "EGL_NV_coverage_sample") != 0;
|
||||
|
@ -270,6 +270,9 @@ struct GLExtensions {
|
||||
|
||||
bool EGL_NV_system_time;
|
||||
bool EGL_NV_coverage_sample;
|
||||
|
||||
std::string all_gl_extensions;
|
||||
std::string all_egl_extensions;
|
||||
};
|
||||
|
||||
extern GLExtensions gl_extensions;
|
||||
|
@ -304,7 +304,7 @@ void InfoItem::Draw(UIContext &dc) {
|
||||
Item::Draw(dc);
|
||||
int paddingX = 12;
|
||||
dc.Draw()->DrawText(dc.theme->uiFont, text_.c_str(), bounds_.x + paddingX, bounds_.centerY(), 0xFFFFFFFF, ALIGN_VCENTER);
|
||||
dc.Draw()->DrawText(dc.theme->uiFont, text_.c_str(), bounds_.x2() - paddingX, bounds_.centerY(), 0xFFFFFFFF, ALIGN_VCENTER | ALIGN_RIGHT);
|
||||
dc.Draw()->DrawText(dc.theme->uiFont, rightText_.c_str(), bounds_.x2() - paddingX, bounds_.centerY(), 0xFFFFFFFF, ALIGN_VCENTER | ALIGN_RIGHT);
|
||||
// dc.Draw()->DrawImageStretch(dc.theme->whiteImage, bounds_.x, bounds_.y, bounds_.x2(), bounds_.y + 2, dc.theme->itemDownStyle.bgColor);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user