forked from CTCaer/hekate
[GFX] Add position saving and muting
This commit is contained in:
parent
f3149e0be3
commit
bee8004b74
11
ipl/gfx.c
11
ipl/gfx.c
@ -141,9 +141,12 @@ void gfx_con_init(gfx_con_t *con, gfx_ctxt_t *ctxt)
|
||||
con->gfx_ctxt = ctxt;
|
||||
con->x = 0;
|
||||
con->y = 0;
|
||||
con->savedx = 0;
|
||||
con->savedy = 0;
|
||||
con->fgcol = 0xFFCCCCCC;
|
||||
con->fillbg = 0;
|
||||
con->bgcol = 0xFF1B1B1B;
|
||||
con->mute = 0;
|
||||
}
|
||||
|
||||
void gfx_con_setcol(gfx_con_t *con, u32 fgcol, int fillbg, u32 bgcol)
|
||||
@ -198,7 +201,7 @@ void gfx_putc(gfx_con_t *con, char c)
|
||||
|
||||
void gfx_puts(gfx_con_t *con, const char *s)
|
||||
{
|
||||
if (!s)
|
||||
if (!s || con->mute)
|
||||
return;
|
||||
|
||||
for (; *s; s++)
|
||||
@ -238,6 +241,9 @@ static void _gfx_putn(gfx_con_t *con, u32 v, int base, char fill, int fcnt)
|
||||
|
||||
void gfx_printf(gfx_con_t *con, const char *fmt, ...)
|
||||
{
|
||||
if (con->mute)
|
||||
return;
|
||||
|
||||
va_list ap;
|
||||
int fill, fcnt;
|
||||
|
||||
@ -309,6 +315,9 @@ void gfx_printf(gfx_con_t *con, const char *fmt, ...)
|
||||
|
||||
void gfx_hexdump(gfx_con_t *con, u32 base, const u8 *buf, u32 len)
|
||||
{
|
||||
if (con->mute)
|
||||
return;
|
||||
|
||||
for(u32 i = 0; i < len; i++)
|
||||
{
|
||||
if(i % 0x10 == 0)
|
||||
|
@ -33,9 +33,12 @@ typedef struct _gfx_con_t
|
||||
gfx_ctxt_t *gfx_ctxt;
|
||||
u32 x;
|
||||
u32 y;
|
||||
u32 savedx;
|
||||
u32 savedy;
|
||||
u32 fgcol;
|
||||
int fillbg;
|
||||
u32 bgcol;
|
||||
int mute;
|
||||
} gfx_con_t;
|
||||
|
||||
void gfx_init_ctxt(gfx_ctxt_t *ctxt, u32 *fb, u32 width, u32 height, u32 stride);
|
||||
|
Loading…
Reference in New Issue
Block a user