Make Timer SmartCtor
ClangFormat
Reactivate Graphical Error Screen
Fix Logger
Fix Image Rendering
This commit is contained in:
2024-06-15 15:12:06 +02:00
parent f7c0c83ac2
commit ec8743417d
17 changed files with 287 additions and 234 deletions

View File

@ -29,7 +29,7 @@
namespace RenderD7 {
class Image {
public:
Image();
Image() = default;
~Image() = default;
RD7_SMART_CTOR(Image)
void Load(const std::string& path);

View File

@ -64,6 +64,7 @@ class R2Base {
// Text Specific
RD7TextFlags flags; // Text Flags
std::string text; // Text
RD7_SMART_CTOR(R2Cmd)
};
R2Base();
~R2Base() = default;
@ -83,7 +84,7 @@ class R2Base {
// Processing
void Process();
R7Vec2 GetTextDimensions(const std::string& text);
std::string WrapText(const std ::string& in, int maxlen);
// Draw Functions
void AddRect(R7Vec2 pos, R7Vec2 size, RD7Color clr);
void AddRect(R7Vec2 pos, R7Vec2 size, unsigned int clr);
@ -103,7 +104,7 @@ class R2Base {
std::map<std::string, float> ts;
std::map<std::string, int> mln;
bool next_lined = false;
std::vector<R2Cmd> commands;
std::vector<R2Cmd::Ref> commands;
R2Screen current_screen = R2Screen_Bottom;
};
} // namespace RenderD7

View File

@ -21,8 +21,8 @@
#include <citro2d.h>
#include <citro3d.h>
#include <renderd7/smart_ctor.hpp>
#include <renderd7/Image.hpp>
#include <renderd7/smart_ctor.hpp>
#include <string>
namespace RenderD7 {
@ -44,7 +44,8 @@ class Sheet {
void Free();
Image::Ref GetImage(int idx);
C2D_SpriteSheet Get() { return this->spritesheet; }
private:
private:
/// \param spritesheet The Sheet
C2D_SpriteSheet spritesheet;
};

View File

@ -20,18 +20,21 @@
#include <3ds.h>
#include <renderd7/smart_ctor.hpp>
namespace RenderD7 {
class Timer {
public:
Timer(bool autostart = true);
~Timer() {}
void reset();
void tick();
void pause();
void resume();
float get();
float get_live();
bool running();
RD7_SMART_CTOR(Timer)
void Reset();
void Tick();
void Pause();
void Resume();
float Get();
float GetLive();
bool Running();
private:
uint64_t last = 0;

View File

@ -102,6 +102,12 @@ void SetCursorPos(R7Vec2 cp);
void RestoreCursor();
void SameLine();
float GetScrollingOffset();
namespace Menu {
// All of them return the Main BG DrawList if Menu is null
UI7DrawList::Ref GetBackgroundList();
UI7DrawList::Ref GetList();
UI7DrawList::Ref GetForegroundList();
}
// DrawLists
UI7DrawList::Ref GetForegroundList();
UI7DrawList::Ref GetBackgroundList();

View File

@ -1,20 +1,20 @@
/**
* This file is part of RenderD7
* Copyright (C) 2021-2024 NPI-D7, tobid7
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* This file is part of RenderD7
* Copyright (C) 2021-2024 NPI-D7, tobid7
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// THIS FILE WAS GENERATED BY generate_assets.py!!!