RD7SR Gets Interesting
This commit is contained in:
parent
6123bd3307
commit
cc5579971d
39
renderd7.cpp
39
renderd7.cpp
@ -618,6 +618,10 @@ Result RenderD7::Init::Main(std::string app_name)
|
||||
rd7_superreselution = RenderD7::Convert::FloatToBool(RenderD7::Convert::StringtoFloat(cfgstruct["settings"]["super-reselution"]));
|
||||
|
||||
osSetSpeedupEnable(true);
|
||||
if (rd7_superreselution)
|
||||
{
|
||||
if (consoleModel != 3) gfxSetWide(true);
|
||||
}
|
||||
|
||||
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
|
||||
C2D_Init(size_t(maxobj__));
|
||||
@ -627,14 +631,28 @@ Result RenderD7::Init::Main(std::string app_name)
|
||||
Bottom = C2D_CreateScreenTarget(GFX_BOTTOM, GFX_LEFT);
|
||||
TextBuf = C2D_TextBufNew(4096);
|
||||
Font = C2D_FontLoadSystem(CFG_REGION_USA);
|
||||
if (rd7_superreselution)
|
||||
{
|
||||
if (consoleModel != 3) gfxSetWide(true);
|
||||
}
|
||||
|
||||
//RenderD7::Msg::Display("RenderD7", "RenderD7 init success!\nWaiting for MainLoop!", Top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Result RenderD7::Init::Reload()
|
||||
{
|
||||
C2D_TextBufDelete(TextBuf);
|
||||
C2D_Fini();
|
||||
C3D_Fini();
|
||||
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
|
||||
C2D_Init(size_t(maxobj__));
|
||||
C2D_Prepare();
|
||||
Top = C2D_CreateScreenTarget(GFX_TOP, GFX_LEFT);
|
||||
TopRight = C2D_CreateScreenTarget(GFX_TOP, GFX_RIGHT);
|
||||
Bottom = C2D_CreateScreenTarget(GFX_BOTTOM, GFX_LEFT);
|
||||
TextBuf = C2D_TextBufNew(4096);
|
||||
Font = C2D_FontLoadSystem(CFG_REGION_USA);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RenderD7::ToggleRD7SR()
|
||||
{
|
||||
// Display black screen
|
||||
@ -644,6 +662,7 @@ void RenderD7::ToggleRD7SR()
|
||||
C3D_FrameEnd(0);
|
||||
// Toggle 400px/800px mode
|
||||
gfxSetWide(!gfxIsWide());
|
||||
RenderD7::Init::Reload();
|
||||
}
|
||||
|
||||
bool RenderD7::IsRD7SR()
|
||||
@ -932,7 +951,7 @@ void RenderD7::FrameEnd()
|
||||
{
|
||||
overlays[i].Draw();
|
||||
}*/
|
||||
if (d7_hHeld & KEY_R && d7_hUp & KEY_SELECT)
|
||||
if (d7_hHeld & KEY_R && d7_hDown & KEY_SELECT)
|
||||
{
|
||||
RenderD7::LoadSettings();
|
||||
}
|
||||
@ -952,12 +971,14 @@ RenderD7::RSettings::~RSettings()
|
||||
|
||||
void RenderD7::RSettings::Draw(void) const
|
||||
{
|
||||
std::string metkkkkk = "Metrik: " + metrikd ? "true" : "false";
|
||||
RenderD7::OnScreen(Top);
|
||||
RenderD7::DrawRect(0, 0, 400, 25, RenderD7::Color::Hex("#111111"));
|
||||
RenderD7::DrawRect(0, 25, 400, 220, RenderD7::Color::Hex("#eeeeee"));
|
||||
RenderD7::DrawRect(0, 0, 400, 21, RenderD7::Color::Hex("#111111"));
|
||||
RenderD7::DrawRect(0, 21, 400, 220, RenderD7::Color::Hex("#eeeeee"));
|
||||
RenderD7::DrawText(0, 0, 0.7f, DSEVENWHITE, "RenderD7->Settings");
|
||||
RenderD7::DrawText(50, 26, 0.7f, DSEVENBLACK, metkkkkk);
|
||||
RenderD7::DrawText(0, 26, 0.7f, DSEVENBLACK, "X");
|
||||
RenderD7::OnScreen(Bottom);
|
||||
RenderD7::DrawRect(0, 0, 320, 240, RenderD7::Color::Hex("#eeeeee"));
|
||||
RenderD7::DrawTObjects(buttons, RenderD7::Color::Hex("#111111"), RenderD7::Color::Hex("#eeeeee"));
|
||||
}
|
||||
|
||||
void RenderD7::RSettings::Logic(u32 hDown, u32 hHeld, u32 hUp, touchPosition touch)
|
||||
|
37
renderd7.hpp
37
renderd7.hpp
@ -53,6 +53,17 @@ namespace RenderD7
|
||||
NUMPAD,
|
||||
STANDARD
|
||||
};
|
||||
struct TObject
|
||||
{
|
||||
int x; //Position X
|
||||
int y; //Position Y
|
||||
int w; //Button Width
|
||||
int h; //Button Height
|
||||
std::string text = ""; //Text
|
||||
float correctx = 0; //Correct X Position
|
||||
float correcty = 0; //Correct Y Position
|
||||
float txtsize = 0.7f; //Set Text Size
|
||||
};
|
||||
/// Set current RenderScreen
|
||||
/// \param target The RenderTarget Top, Bottom
|
||||
void OnScreen(C3D_RenderTarget *target);
|
||||
@ -143,7 +154,18 @@ namespace RenderD7
|
||||
class RSettings : public RenderD7::Scene
|
||||
{
|
||||
private:
|
||||
/* data */
|
||||
std::string rd7srstate = "false";
|
||||
std::vector<RenderD7::TObject> buttons =
|
||||
{
|
||||
{20, 35, 120, 35, "RD7SR", -11, 10},
|
||||
{20, 85, 120, 35, "", 0, 9},
|
||||
{20, 135, 120, 35, "", -8, 10},
|
||||
{20, 185, 120, 35, "", 8, 10},
|
||||
{180, 35, 120, 35, "", -15, 10},
|
||||
{180, 85, 120, 35, "", -15, 10},
|
||||
{180, 135, 120, 35, "", -15, 10},
|
||||
{180, 185, 120, 35, "", -15, 10}
|
||||
};
|
||||
public:
|
||||
RSettings();
|
||||
void Draw(void) const override;
|
||||
@ -185,6 +207,7 @@ namespace RenderD7
|
||||
namespace Init
|
||||
{
|
||||
Result Main(std::string app_name = "RD7Game");
|
||||
Result Reload();
|
||||
void NdspFirm(bool useit = false);
|
||||
}
|
||||
namespace Exit
|
||||
@ -247,17 +270,7 @@ namespace RenderD7
|
||||
RenderD7::Sheet *sheet;
|
||||
float time;
|
||||
};
|
||||
struct TObject
|
||||
{
|
||||
int x; //Position X
|
||||
int y; //Position Y
|
||||
int w; //Button Width
|
||||
int h; //Button Height
|
||||
std::string text = ""; //Text
|
||||
float correctx = 0; //Correct X Position
|
||||
float correcty = 0; //Correct Y Position
|
||||
float txtsize = 0.7f; //Set Text Size
|
||||
};
|
||||
|
||||
|
||||
struct TLBtn
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user