From a41b07e2a80253498a1ff921622426664544cf9b Mon Sep 17 00:00:00 2001 From: raven02 Date: Sat, 27 Apr 2013 23:57:15 +0800 Subject: [PATCH 1/2] Add Display Raw FrameBuffer for Android --- UI/MenuScreens.cpp | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index 465ecc3566..3160baa034 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012- PPSSPP Project. +// Copyright (c) 2012- PPSSPP Project. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -530,6 +530,13 @@ void GraphicsScreen::update(InputState &input) { } } +void GraphicsScreenP1::update(InputState &input) { + if (input.pad_buttons_down & PAD_BUTTON_BACK) { + g_Config.Save(); + screenManager()->finishDialog(this, DR_OK); + } +} + void SystemScreen::update(InputState &input) { if (input.pad_buttons_down & PAD_BUTTON_BACK) { g_Config.Save(); @@ -633,10 +640,14 @@ void GraphicsScreen::render() { ui_draw2d.DrawText(UBUNTU24, gs->T("Graphics Settings"), dp_xres / 2, 20, 0xFFFFFFFF, ALIGN_HCENTER); ui_draw2d.SetFontScale(1.0f, 1.0f); - if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres-10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) { + if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) { screenManager()->finishDialog(this, DR_OK); } + if (UIButton(GEN_ID, Pos( 220 , dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Next Page"), ALIGN_RIGHT | ALIGN_BOTTOM)) { + screenManager()->push(new GraphicsScreenP1()); + } + int x = 30; int y = 30; int stride = 40; @@ -665,7 +676,33 @@ void GraphicsScreen::render() { } g_Config.iWindowZoom = doubleRes ? 2 : 1; } + //UICheckBox(GEN_ID, x, y += stride, gs->T("Draw Wireframe"), ALIGN_TOPLEFT, &g_Config.bDrawWireframe); + UIEnd(); +} + +void GraphicsScreenP1::render() { + UIShader_Prepare(); + UIBegin(UIShader_Get()); + DrawBackground(1.0f); + + I18NCategory *g = GetI18NCategory("General"); + I18NCategory *gs = GetI18NCategory("Graphics"); + + ui_draw2d.SetFontScale(1.5f, 1.5f); + ui_draw2d.DrawText(UBUNTU24, gs->T("Graphics Settings"), dp_xres / 2, 20, 0xFFFFFFFF, ALIGN_HCENTER); + ui_draw2d.SetFontScale(1.0f, 1.0f); + + if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) { + screenManager()->finishDialog(this, DR_OK); + } + + int x = 30; + int y = 30; + int stride = 40; + int columnw = 400; + UICheckBox(GEN_ID, x, y += stride, gs->T("Draw Wireframe"), ALIGN_TOPLEFT, &g_Config.bDrawWireframe); + UICheckBox(GEN_ID, x, y += stride, gs->T("Display Raw Framebuffer"), ALIGN_TOPLEFT, &g_Config.bDisplayFramebuffer); UIEnd(); } From 7512a923c50562ace9e58de78dc2136dbd2723fa Mon Sep 17 00:00:00 2001 From: raven02 Date: Sat, 27 Apr 2013 23:58:10 +0800 Subject: [PATCH 2/2] Add next page for Graphics Setting --- UI/MenuScreens.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UI/MenuScreens.h b/UI/MenuScreens.h index 3c2b0c367a..279b9c6a8d 100644 --- a/UI/MenuScreens.h +++ b/UI/MenuScreens.h @@ -91,6 +91,13 @@ public: void render(); }; +class GraphicsScreenP1 : public Screen +{ +public: + void update(InputState &input); + void render(); +}; + class SystemScreen : public Screen { public: