mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 00:19:22 +02:00
Changed the RGBA8 define to RGBA8_MAXALPHA and adjusted it + moved it into gfx.h. Added RGBA8 define to gfx.h which is the same as the original except it now uses an input alpha param. Added a comment to gfx.c regarding width/height.
This commit is contained in:
parent
945615ece3
commit
0e1a90a7a9
@ -1,3 +1,9 @@
|
||||
/// Converts red, green, blue, and alpha components to packed RGBA8.
|
||||
#define RGBA8(r,g,b,a) (((r)&0xff)|(((g)&0xff)<<8)|(((b)&0xff)<<16)|(((a)&0xff)<<24))
|
||||
|
||||
/// Same as RGBA8 except with alpha=0xff.
|
||||
#define RGBA8_MAXALPHA(r,g,b) RGBA8(r,g,b,0xff)
|
||||
|
||||
/// Do not use viInitialize/viExit when using these.
|
||||
void gfxInitDefault(void);
|
||||
void gfxExit(void);
|
||||
|
@ -5,37 +5,34 @@
|
||||
|
||||
#include "default_font_bin.h"
|
||||
|
||||
/// Converts red, green, and blue components to packed RGBA8, with alpha=0xff.
|
||||
#define RGBA8(r,g,b) (((r)&0xff)|(((g)&0xff)<<8)|(((b)&0xff)<<16)|(0xff<<24))
|
||||
|
||||
//set up the palette for color printing
|
||||
static u32 colorTable[] = {
|
||||
RGBA8( 0, 0, 0), // black
|
||||
RGBA8(128, 0, 0), // red
|
||||
RGBA8( 0,128, 0), // green
|
||||
RGBA8(128,128, 0), // yellow
|
||||
RGBA8( 0, 0,128), // blue
|
||||
RGBA8(128, 0,128), // magenta
|
||||
RGBA8( 0,128,128), // cyan
|
||||
RGBA8(192,192,192), // white
|
||||
RGBA8_MAXALPHA( 0, 0, 0), // black
|
||||
RGBA8_MAXALPHA(128, 0, 0), // red
|
||||
RGBA8_MAXALPHA( 0,128, 0), // green
|
||||
RGBA8_MAXALPHA(128,128, 0), // yellow
|
||||
RGBA8_MAXALPHA( 0, 0,128), // blue
|
||||
RGBA8_MAXALPHA(128, 0,128), // magenta
|
||||
RGBA8_MAXALPHA( 0,128,128), // cyan
|
||||
RGBA8_MAXALPHA(192,192,192), // white
|
||||
|
||||
RGBA8(128,128,128), // bright black
|
||||
RGBA8(255, 0, 0), // bright red
|
||||
RGBA8( 0,255, 0), // bright green
|
||||
RGBA8(255,255, 0), // bright yellow
|
||||
RGBA8( 0, 0,255), // bright blue
|
||||
RGBA8(255, 0,255), // bright magenta
|
||||
RGBA8( 0,255,255), // bright cyan
|
||||
RGBA8(255,255,255), // bright white
|
||||
RGBA8_MAXALPHA(128,128,128), // bright black
|
||||
RGBA8_MAXALPHA(255, 0, 0), // bright red
|
||||
RGBA8_MAXALPHA( 0,255, 0), // bright green
|
||||
RGBA8_MAXALPHA(255,255, 0), // bright yellow
|
||||
RGBA8_MAXALPHA( 0, 0,255), // bright blue
|
||||
RGBA8_MAXALPHA(255, 0,255), // bright magenta
|
||||
RGBA8_MAXALPHA( 0,255,255), // bright cyan
|
||||
RGBA8_MAXALPHA(255,255,255), // bright white
|
||||
|
||||
RGBA8( 0, 0, 0), // faint black
|
||||
RGBA8( 64, 0, 0), // faint red
|
||||
RGBA8( 0, 64, 0), // faint green
|
||||
RGBA8( 64, 64, 0), // faint yellow
|
||||
RGBA8( 0, 0, 64), // faint blue
|
||||
RGBA8( 64, 0, 64), // faint magenta
|
||||
RGBA8( 0, 64, 64), // faint cyan
|
||||
RGBA8( 96, 96, 96), // faint white
|
||||
RGBA8_MAXALPHA( 0, 0, 0), // faint black
|
||||
RGBA8_MAXALPHA( 64, 0, 0), // faint red
|
||||
RGBA8_MAXALPHA( 0, 64, 0), // faint green
|
||||
RGBA8_MAXALPHA( 64, 64, 0), // faint yellow
|
||||
RGBA8_MAXALPHA( 0, 0, 64), // faint blue
|
||||
RGBA8_MAXALPHA( 64, 0, 64), // faint magenta
|
||||
RGBA8_MAXALPHA( 0, 64, 64), // faint cyan
|
||||
RGBA8_MAXALPHA( 96, 96, 96), // faint white
|
||||
};
|
||||
|
||||
//The below width/height is for 720p.
|
||||
|
@ -30,6 +30,8 @@ extern size_t g_nvgfx_singleframebuf_size;
|
||||
|
||||
//static Result _gfxGetDisplayResolution(u64 *width, u64 *height);
|
||||
|
||||
//TODO: Figure out what all is required to use non-720p width/height.
|
||||
|
||||
//TODO: Let the user configure some of this?
|
||||
static bufferProducerQueueBufferInput g_gfxQueueBufferData = {
|
||||
.timestamp = 0x0,
|
||||
|
Loading…
Reference in New Issue
Block a user