fatal: refactor into sts namespace

This commit is contained in:
Michael Scire 2019-07-18 19:09:35 -07:00 committed by SciresM
parent 442ebff829
commit 39d041466d
38 changed files with 2176 additions and 1926 deletions

View file

@ -19,27 +19,23 @@
#include <switch.h>
#include <stratosphere.hpp>
#define RGB888_TO_RGB565(r, g, b) ((((r >> 3) << 11) & 0xF800) | (((g >> 2) << 5) & 0x7E0) | ((b >> 3) & 0x1F))
#define RGB565_GET_R8(c) ((((c >> 11) & 0x1F) << 3) | ((c >> 13) & 7))
#define RGB565_GET_G8(c) ((((c >> 5) & 0x3F) << 2) | ((c >> 9) & 3))
#define RGB565_GET_B8(c) ((((c >> 0) & 0x1F) << 3) | ((c >> 2) & 7))
namespace sts::fatal::srv::font {
class FontManager {
public:
static Result InitializeSharedFont();
static void ConfigureFontFramebuffer(u16 *fb, u32 (*unswizzle_func)(u32, u32));
Result InitializeSharedFont();
void ConfigureFontFramebuffer(u16 *fb, u32 (*unswizzle_func)(u32, u32));
static void SetFontColor(u16 color);
static void SetPosition(u32 x, u32 y);
static u32 GetX();
static u32 GetY();
static void SetFontSize(float fsz);
static void AddSpacingLines(float num_lines);
static void PrintLine(const char *str);
static void PrintFormatLine(const char *format, ...);
static void Print(const char *str);
static void PrintFormat(const char *format, ...);
static void PrintMonospaceU64(u64 x);
static void PrintMonospaceU32(u32 x);
static void PrintMonospaceBlank(u32 width);
};
void SetFontColor(u16 color);
void SetPosition(u32 x, u32 y);
u32 GetX();
u32 GetY();
void SetFontSize(float fsz);
void AddSpacingLines(float num_lines);
void PrintLine(const char *str);
void PrintFormatLine(const char *format, ...);
void Print(const char *str);
void PrintFormat(const char *format, ...);
void PrintMonospaceU64(u64 x);
void PrintMonospaceU32(u32 x);
void PrintMonospaceBlank(u32 width);
}