mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Minor cleanup with GOLD define - only use it in System_GetPropertyInt
This commit is contained in:
parent
3ae13f3c05
commit
cf365bb257
@ -388,28 +388,22 @@ void System_Wake() {
|
||||
}
|
||||
}
|
||||
|
||||
// Ugly!
|
||||
static bool pspIsInited = false;
|
||||
static bool pspIsIniting = false;
|
||||
static bool pspIsQuiting = false;
|
||||
// Ugly!
|
||||
|
||||
bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) {
|
||||
if (pspIsIniting || pspIsQuiting) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef GOLD
|
||||
const char *gold = " Gold";
|
||||
#else
|
||||
const char *gold = "";
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_M_X64)
|
||||
INFO_LOG(BOOT, "PPSSPP%s %s Windows 64 bit", gold, PPSSPP_GIT_VERSION);
|
||||
INFO_LOG(BOOT, "PPSSPP %s Windows 64 bit", PPSSPP_GIT_VERSION);
|
||||
#elif defined(_WIN32) && !defined(_M_X64)
|
||||
INFO_LOG(BOOT, "PPSSPP%s %s Windows 32 bit", gold, PPSSPP_GIT_VERSION);
|
||||
INFO_LOG(BOOT, "PPSSPP %s Windows 32 bit", PPSSPP_GIT_VERSION);
|
||||
#else
|
||||
INFO_LOG(BOOT, "PPSSPP%s %s", gold, PPSSPP_GIT_VERSION);
|
||||
INFO_LOG(BOOT, "PPSSPP %s", PPSSPP_GIT_VERSION);
|
||||
#endif
|
||||
|
||||
GraphicsContext *temp = coreParameter.graphicsContext;
|
||||
|
@ -464,9 +464,9 @@ void SystemInfoScreen::CreateViews() {
|
||||
#ifdef MOBILE_DEVICE
|
||||
buildConfig->Add(new InfoItem("MOBILE_DEVICE", ""));
|
||||
#endif
|
||||
#ifdef GOLD
|
||||
if (System_GetPropertyInt(SYSPROP_APP_GOLD)) {
|
||||
buildConfig->Add(new InfoItem("GOLD", ""));
|
||||
#endif
|
||||
}
|
||||
|
||||
ViewGroup *cpuExtensionsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
cpuExtensionsScroll->SetTag("DevSystemInfoCPUExt");
|
||||
|
@ -837,11 +837,11 @@ void MainScreen::CreateViews() {
|
||||
sprintf(versionString, "%s", PPSSPP_GIT_VERSION);
|
||||
rightColumnItems->SetSpacing(0.0f);
|
||||
LinearLayout *logos = new LinearLayout(ORIENT_HORIZONTAL);
|
||||
#ifdef GOLD
|
||||
if (System_GetPropertyInt(SYSPROP_APP_GOLD)) {
|
||||
logos->Add(new ImageView(I_ICONGOLD, IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false)));
|
||||
#else
|
||||
} else {
|
||||
logos->Add(new ImageView(I_ICON, IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false)));
|
||||
#endif
|
||||
}
|
||||
logos->Add(new ImageView(I_LOGO, IS_DEFAULT, new LinearLayoutParams(Margins(-12, 0, 0, 0))));
|
||||
rightColumnItems->Add(logos);
|
||||
TextView *ver = rightColumnItems->Add(new TextView(versionString, new LinearLayoutParams(Margins(70, -6, 0, 0))));
|
||||
@ -853,11 +853,11 @@ void MainScreen::CreateViews() {
|
||||
rightColumnItems->Add(new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings);
|
||||
rightColumnItems->Add(new Choice(mm->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits);
|
||||
rightColumnItems->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg);
|
||||
#ifndef GOLD
|
||||
if (!System_GetPropertyInt(SYSPROP_APP_GOLD)) {
|
||||
Choice *gold = rightColumnItems->Add(new Choice(mm->T("Support PPSSPP")));
|
||||
gold->OnClick.Handle(this, &MainScreen::OnSupport);
|
||||
gold->SetIcon(I_ICONGOLD);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !PPSSPP_PLATFORM(UWP)
|
||||
// Having an exit button is against UWP guidelines.
|
||||
@ -910,13 +910,13 @@ UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn MainScreen::OnDownloadUpgrade(UI::EventParams &e) {
|
||||
#ifdef __ANDROID__
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
// Go to app store
|
||||
#ifdef GOLD
|
||||
if (System_GetPropertyInt(SYSPROP_APP_GOLD)) {
|
||||
LaunchBrowser("market://details?id=org.ppsspp.ppssppgold");
|
||||
#else
|
||||
} else {
|
||||
LaunchBrowser("market://details?id=org.ppsspp.ppsspp");
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
// Go directly to ppsspp.org and let the user sort it out
|
||||
LaunchBrowser("http://www.ppsspp.org/downloads.html");
|
||||
|
@ -493,13 +493,13 @@ void LogoScreen::render() {
|
||||
|
||||
I18NCategory *cr = GetI18NCategory("PSPCredits");
|
||||
char temp[256];
|
||||
// Manually formatting utf-8 is fun. \xXX doesn't work everywhere.
|
||||
// Manually formatting UTF-8 is fun. \xXX doesn't work everywhere.
|
||||
snprintf(temp, sizeof(temp), "%s Henrik Rydg%c%crd", cr->T("created", "Created by"), 0xC3, 0xA5);
|
||||
#ifdef GOLD
|
||||
if (System_GetPropertyInt(SYSPROP_APP_GOLD)) {
|
||||
dc.Draw()->DrawImage(I_ICONGOLD, bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER);
|
||||
#else
|
||||
} else {
|
||||
dc.Draw()->DrawImage(I_ICON, bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER);
|
||||
#endif
|
||||
}
|
||||
dc.Draw()->DrawImage(I_LOGO, bounds.centerX() + 40, bounds.centerY() - 30, 1.5f, textColor, ALIGN_CENTER);
|
||||
//dc.Draw()->DrawTextShadow(UBUNTU48, "PPSSPP", xres / 2, yres / 2 - 30, textColor, ALIGN_CENTER);
|
||||
dc.SetFontScale(1.0f, 1.0f);
|
||||
@ -538,11 +538,11 @@ void CreditsScreen::CreateViews() {
|
||||
root_->Add(new Button(cr->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnShare);
|
||||
root_->Add(new Button(cr->T("Twitter @PPSSPP_emu"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 154, false)))->OnClick.Handle(this, &CreditsScreen::OnTwitter);
|
||||
#endif
|
||||
#ifdef GOLD
|
||||
if (System_GetPropertyInt(SYSPROP_APP_GOLD)) {
|
||||
root_->Add(new ImageView(I_ICONGOLD, IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false)));
|
||||
#else
|
||||
} else {
|
||||
root_->Add(new ImageView(I_ICON, IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false)));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
UI::EventReturn CreditsScreen::OnSupport(UI::EventParams &e) {
|
||||
@ -701,11 +701,11 @@ void CreditsScreen::render() {
|
||||
|
||||
// TODO: This is kinda ugly, done on every frame...
|
||||
char temp[256];
|
||||
#ifdef GOLD
|
||||
if (System_GetPropertyInt(SYSPROP_APP_GOLD)) {
|
||||
snprintf(temp, sizeof(temp), "PPSSPP Gold %s", PPSSPP_GIT_VERSION);
|
||||
#else
|
||||
} else {
|
||||
snprintf(temp, sizeof(temp), "PPSSPP %s", PPSSPP_GIT_VERSION);
|
||||
#endif
|
||||
}
|
||||
credits[0] = (const char *)temp;
|
||||
|
||||
UIContext &dc = *screenManager()->getUIContext();
|
||||
|
@ -370,6 +370,12 @@ int System_GetPropertyInt(SystemProperty prop) {
|
||||
return 1;
|
||||
case SYSPROP_HAS_FILE_BROWSER:
|
||||
return 1;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
@ -1331,11 +1331,7 @@ namespace MainWindow {
|
||||
{
|
||||
W32Util::CenterWindow(hDlg);
|
||||
HWND versionBox = GetDlgItem(hDlg, IDC_VERSION);
|
||||
#ifdef GOLD
|
||||
std::string windowText = "PPSSPP Gold ";
|
||||
#else
|
||||
std::string windowText = "PPSSPP ";
|
||||
#endif
|
||||
std::string windowText = System_GetPropertyInt(SYSPROP_APP_GOLD) ? "PPSSPP Gold " : "PPSSPP ";
|
||||
windowText.append(PPSSPP_GIT_VERSION);
|
||||
SetWindowText(versionBox, ConvertUTF8ToWString(windowText).c_str());
|
||||
}
|
||||
|
@ -62,7 +62,6 @@ void TouchInputHandler::handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam,
|
||||
POINT point;
|
||||
point.x = (float)(TOUCH_COORD_TO_PIXEL(inputs[i].x));
|
||||
point.y = (float)(TOUCH_COORD_TO_PIXEL(inputs[i].y));
|
||||
|
||||
if (ScreenToClient(hWnd, &point)) {
|
||||
point.x *= g_dpi_scale;
|
||||
point.y *= g_dpi_scale;
|
||||
|
@ -218,6 +218,12 @@ int System_GetPropertyInt(SystemProperty prop) {
|
||||
return 1;
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return 1;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
@ -445,6 +445,12 @@ int System_GetPropertyInt(SystemProperty prop) {
|
||||
return androidVersion >= 23; // 6.0 Marshmallow introduced run time permissions.
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return 1;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
@ -165,6 +165,7 @@ enum SystemProperty {
|
||||
SYSPROP_MOGA_VERSION,
|
||||
|
||||
SYSPROP_DEVICE_TYPE,
|
||||
SYSPROP_APP_GOLD, // To avoid having #ifdef GOLD other than in main.cpp and similar.
|
||||
|
||||
// Exposed on Android. Choosing the optimal sample rate for audio
|
||||
// will result in lower latencies. Buffer size is automatically matched
|
||||
|
@ -341,6 +341,12 @@ int System_GetPropertyInt(SystemProperty prop) {
|
||||
#endif
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return 1;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
@ -79,6 +79,12 @@ int System_GetPropertyInt(SystemProperty prop) {
|
||||
#endif
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return 1;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
@ -66,7 +66,13 @@ void NativeRender(GraphicsContext *graphicsContext) { }
|
||||
void NativeResized() { }
|
||||
|
||||
std::string System_GetProperty(SystemProperty prop) { return ""; }
|
||||
int System_GetPropertyInt(SystemProperty prop) { return -1; }
|
||||
int System_GetPropertyInt(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_APP_GOLD:
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
void System_SendMessage(const char *command, const char *parameter) {}
|
||||
bool System_InputBoxGetWString(const wchar_t *title, const std::wstring &defaultvalue, std::wstring &outvalue) { return false; }
|
||||
void System_AskForPermission(SystemPermission permission) {}
|
||||
|
@ -68,6 +68,12 @@ int System_GetPropertyInt(SystemProperty prop) {
|
||||
return DEVICE_TYPE_MOBILE;
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return 0;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
@ -49,7 +49,13 @@
|
||||
#include "unittest/UnitTest.h"
|
||||
|
||||
std::string System_GetProperty(SystemProperty prop) { return ""; }
|
||||
int System_GetPropertyInt(SystemProperty prop) { return -1; }
|
||||
int System_GetPropertyInt(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_APP_GOLD:
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef M_PI_2
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
|
Loading…
Reference in New Issue
Block a user