Add Overlays Engine
This commit is contained in:
parent
d0e4d2296c
commit
edb634b79d
22
renderd7.cpp
22
renderd7.cpp
@ -10,6 +10,7 @@ float animtime;
|
|||||||
bool isndspinit = false;
|
bool isndspinit = false;
|
||||||
bool running = true;
|
bool running = true;
|
||||||
std::stack<std::unique_ptr<RenderD7::Scene>> RenderD7::Scene::scenes;
|
std::stack<std::unique_ptr<RenderD7::Scene>> RenderD7::Scene::scenes;
|
||||||
|
std::vevtor<RenderD7::Ovl> overlays;
|
||||||
bool usedbgmsg = false;
|
bool usedbgmsg = false;
|
||||||
std::string dspststus = "Not Initialisized!";
|
std::string dspststus = "Not Initialisized!";
|
||||||
|
|
||||||
@ -577,11 +578,7 @@ Result RenderD7::Init::Main(std::string app_name)
|
|||||||
mt_screen = RenderD7::Convert::StringtoInt(cfgstruct["metrik-settings"]["Screen"]);
|
mt_screen = RenderD7::Convert::StringtoInt(cfgstruct["metrik-settings"]["Screen"]);
|
||||||
|
|
||||||
osSetSpeedupEnable(true);
|
osSetSpeedupEnable(true);
|
||||||
/*if(metrikd)
|
|
||||||
{
|
|
||||||
RenderD7::Thread tr(MetrikThread);
|
|
||||||
tr.start();
|
|
||||||
}*/
|
|
||||||
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
|
C3D_Init(C3D_DEFAULT_CMDBUF_SIZE);
|
||||||
C2D_Init(size_t(maxobj__));
|
C2D_Init(size_t(maxobj__));
|
||||||
C2D_Prepare();
|
C2D_Prepare();
|
||||||
@ -838,14 +835,17 @@ void RenderD7::DrawMetrikOvl()
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
RenderD7::OnScreen(Top);
|
RenderD7::OnScreen(Top);
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
RenderD7::OnScreen(Bottom);
|
RenderD7::OnScreen(Bottom);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
RenderD7::OnScreen(Bottom);
|
RenderD7::OnScreen(Bottom);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
RenderD7::DrawText(0, 0, mt_txtSize, mt_txtcolor, "FPS: " + RenderD7::GetFramerate());
|
RenderD7::DrawText(0, 0, mt_txtSize, mt_txtcolor, "FPS: " + RenderD7::GetFramerate());
|
||||||
//RenderD7::DrawText(0, 50, mt_txtSize, mt_txtcolor, "CPU: " + std::to_string(C3D_GetProcessingTime()*6.0f) + "/" + std::to_string(C3D_GetProcessingTime()));
|
RenderD7::DrawText(0, 50, mt_txtSize, mt_txtcolor, "CPU: " + std::to_string(C3D_GetProcessingTime()*6.0f) + "/" + std::to_string(C3D_GetProcessingTime()));
|
||||||
//RenderD7::DrawText(0, 70, mt_txtSize, mt_txtcolor, "GPU: " + std::to_string(C3D_GetDrawingTime()*6.0f) + "/" + std::to_string(C3D_GetDrawingTime()));
|
RenderD7::DrawText(0, 70, mt_txtSize, mt_txtcolor, "GPU: " + std::to_string(C3D_GetDrawingTime()*6.0f) + "/" + std::to_string(C3D_GetDrawingTime()));
|
||||||
for (int z = 0; z < 320; z++)
|
for (int z = 0; z < 320; z++)
|
||||||
{
|
{
|
||||||
C2D_DrawLine(z, 239 - mt_fpsgraph[z], mt_txtcolor, z + 1, 239 - mt_fpsgraph[z + 1], mt_txtcolor, 1, 1);
|
C2D_DrawLine(z, 239 - mt_fpsgraph[z], mt_txtcolor, z + 1, 239 - mt_fpsgraph[z + 1], mt_txtcolor, 1, 1);
|
||||||
@ -864,9 +864,17 @@ bool RenderD7::DrawNFRect(float p1x, float p1y, float w, float h, u32 color, flo
|
|||||||
void RenderD7::FrameEnd()
|
void RenderD7::FrameEnd()
|
||||||
{
|
{
|
||||||
if (metrikd)RenderD7::DrawMetrikOvl();
|
if (metrikd)RenderD7::DrawMetrikOvl();
|
||||||
|
for (int i = 0; i < (int))overlays.size(); i++)
|
||||||
|
{
|
||||||
|
overlays[i].Draw();
|
||||||
|
}
|
||||||
C3D_FrameEnd(0);
|
C3D_FrameEnd(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddOvl(Ovl overlay)
|
||||||
|
{
|
||||||
|
overlays.push_back(overlay);
|
||||||
|
}
|
||||||
/*RenderD7::Console::Console()
|
/*RenderD7::Console::Console()
|
||||||
{
|
{
|
||||||
this->x = 0;
|
this->x = 0;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <stack>
|
#include <stack>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -133,6 +134,12 @@ namespace RenderD7
|
|||||||
//static void HandleOvl();
|
//static void HandleOvl();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Ovl {
|
||||||
|
public:
|
||||||
|
virtual ~Ovl(){}
|
||||||
|
virtual void Draw() const = 0;
|
||||||
|
};
|
||||||
|
void AddOvl(Ovl overlay);
|
||||||
namespace Color
|
namespace Color
|
||||||
{
|
{
|
||||||
struct rgba
|
struct rgba
|
||||||
|
Loading…
Reference in New Issue
Block a user