merge: merge changes from upstream master

This commit is contained in:
Wellinator
2023-11-11 12:32:04 -03:00
parent 200a68e219
commit 1e046d9dda
21 changed files with 619 additions and 69 deletions
+23 -14
View File
@@ -20,6 +20,7 @@
#else // IF Debug
#include <stdio.h>
#include <debug.h>
#include <string>
#include <sstream>
#include <fstream>
@@ -48,9 +49,7 @@ class TyraDebug {
(void)expander{0, (void(ss << std::forward<Args>(args)), 0)...};
if (Tyra::Info::writeLogsToFile) {
auto* logFile = getLogFile();
*logFile << ss.str();
logFile->flush();
writeInLogFile(&ss);
} else {
printf("%s", ss.str().c_str());
}
@@ -65,9 +64,7 @@ class TyraDebug {
ss1 << "|\n";
if (Tyra::Info::writeLogsToFile) {
auto* logFile = getLogFile();
*logFile << ss1.str();
logFile->flush();
writeInLogFile(&ss1);
} else {
printf("%s", ss1.str().c_str());
}
@@ -80,20 +77,22 @@ class TyraDebug {
ss2 << "====================================\n\n";
if (Tyra::Info::writeLogsToFile) {
auto* logFile = getLogFile();
*logFile << ss2.str();
logFile->flush();
writeInLogFile(&ss2);
} else {
printf("%s", ss2.str().c_str());
}
init_scr();
for (;;) {
scr_setXY(20, 10);
scr_printf(ss1.str().c_str());
writeAssertLinesInScreen(args...);
scr_printf(ss2.str().c_str());
}
}
private:
static std::unique_ptr<std::ofstream> logFile;
static std::ofstream* getLogFile();
static void writeInLogFile(std::stringstream* ss);
template <typename Arg, typename... Args>
static void writeAssertLines(Arg&& arg, Args&&... args) {
@@ -105,13 +104,23 @@ class TyraDebug {
0, (void(ss << "| " << std::forward<Args>(args) << "\n"), 0)...};
if (Tyra::Info::writeLogsToFile) {
auto* logfile = getLogFile();
*logfile << ss.str();
logFile->flush();
writeInLogFile(&ss);
} else {
printf("%s", ss.str().c_str());
}
}
template <typename Arg, typename... Args>
static void writeAssertLinesInScreen(Arg&& arg, Args&&... args) {
std::stringstream ss;
ss << "| " << std::forward<Arg>(arg) << "\n";
using expander = int[];
(void)expander{
0, (void(ss << "| " << std::forward<Args>(args) << "\n"), 0)...};
scr_printf(ss.str().c_str());
}
};
#endif // NDEBUG
+1 -1
View File
@@ -21,7 +21,7 @@ class Version {
~Version() {}
static const u8 major = 2;
static const u8 minor = 1;
static const u8 minor = 2;
static const u8 patch = 0;
static std::string toString() {
@@ -13,6 +13,7 @@
#include "debug/debug.hpp"
#include "renderer/core/2d/sprite/sprite.hpp"
#include "renderer/core/texture/renderer_core_texture_buffers.hpp"
#include "renderer/3d/pipeline/shared/pipeline_texture_mapping_type.hpp"
#include "renderer/core/texture/models/texture.hpp"
#include "renderer/renderer_settings.hpp"
#include <packet2_utils.h>
@@ -30,6 +31,9 @@ class RendererCore2D {
void render(const Sprite& sprite,
const RendererCoreTextureBuffers& texBuffers, Texture* texture);
void setTextureMappingType(
const PipelineTextureMappingType textureMappingType);
private:
void setPrim();
void setLod();
@@ -24,7 +24,7 @@ class Sprite {
~Sprite();
u32 id;
Vec2 position, size;
Vec2 position, size, offset;
float scale;
Color color;
SpriteMode mode;