mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-29 16:14:16 +01:00
Cleaned up a bit, included original banner png.
This commit is contained in:
parent
36938f6700
commit
e2af2036d6
BIN
gfx/banner.png
Executable file
BIN
gfx/banner.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 87 KiB |
3
include/gfx.h
Executable file
3
include/gfx.h
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
void gfxDrawSprite(gfxScreen_t screen, gfx3dSide_t side, u8* spriteData, u16 width, u16 height, s16 x, s16 y);
|
@ -6,6 +6,7 @@
|
|||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#endif
|
#endif
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "gfx.h"
|
||||||
|
|
||||||
#ifdef _3DS
|
#ifdef _3DS
|
||||||
#include "sans_8_kerning_bin.h"
|
#include "sans_8_kerning_bin.h"
|
||||||
@ -667,34 +668,6 @@ draw_text(gfxScreen_t screen,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function to draw sprite, from smea/3ds_hb_menu */
|
|
||||||
void gfxDrawSprite(gfxScreen_t screen, gfx3dSide_t side, u8* spriteData, u16 width, u16 height, s16 x, s16 y)
|
|
||||||
{
|
|
||||||
if(!spriteData)return;
|
|
||||||
|
|
||||||
u16 fbWidth, fbHeight;
|
|
||||||
u8* fbAdr=gfxGetFramebuffer(screen, side, &fbWidth, &fbHeight);
|
|
||||||
|
|
||||||
if(x+width<0 || x>=fbWidth)return;
|
|
||||||
if(y+height<0 || y>=fbHeight)return;
|
|
||||||
|
|
||||||
u16 xOffset=0, yOffset=0;
|
|
||||||
u16 widthDrawn=width, heightDrawn=height;
|
|
||||||
|
|
||||||
if(x<0)xOffset=-x;
|
|
||||||
if(y<0)yOffset=-y;
|
|
||||||
if(x+width>=fbWidth)widthDrawn=fbWidth-x;
|
|
||||||
if(y+height>=fbHeight)heightDrawn=fbHeight-y;
|
|
||||||
widthDrawn-=xOffset;
|
|
||||||
heightDrawn-=yOffset;
|
|
||||||
|
|
||||||
int j;
|
|
||||||
for(j=yOffset; j<yOffset+heightDrawn; j++)
|
|
||||||
{
|
|
||||||
memcpy(&fbAdr[((x+xOffset)+(y+j)*fbWidth)*3], &spriteData[((xOffset)+(j)*width)*3], widthDrawn*3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! draw console to screen */
|
/*! draw console to screen */
|
||||||
void
|
void
|
||||||
console_render(void)
|
console_render(void)
|
||||||
|
31
source/gfx.c
Executable file
31
source/gfx.c
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#ifdef _3DS
|
||||||
|
#include <3ds.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Function to draw sprite, from smea/3ds_hb_menu */
|
||||||
|
void gfxDrawSprite(gfxScreen_t screen, gfx3dSide_t side, u8* spriteData, u16 width, u16 height, s16 x, s16 y)
|
||||||
|
{
|
||||||
|
if(!spriteData)return;
|
||||||
|
|
||||||
|
u16 fbWidth, fbHeight;
|
||||||
|
u8* fbAdr=gfxGetFramebuffer(screen, side, &fbWidth, &fbHeight);
|
||||||
|
|
||||||
|
if(x+width<0 || x>=fbWidth)return;
|
||||||
|
if(y+height<0 || y>=fbHeight)return;
|
||||||
|
|
||||||
|
u16 xOffset=0, yOffset=0;
|
||||||
|
u16 widthDrawn=width, heightDrawn=height;
|
||||||
|
|
||||||
|
if(x<0)xOffset=-x;
|
||||||
|
if(y<0)yOffset=-y;
|
||||||
|
if(x+width>=fbWidth)widthDrawn=fbWidth-x;
|
||||||
|
if(y+height>=fbHeight)heightDrawn=fbHeight-y;
|
||||||
|
widthDrawn-=xOffset;
|
||||||
|
heightDrawn-=yOffset;
|
||||||
|
|
||||||
|
int j;
|
||||||
|
for(j=yOffset; j<yOffset+heightDrawn; j++)
|
||||||
|
{
|
||||||
|
memcpy(&fbAdr[((x+xOffset)+(y+j)*fbWidth)*3], &spriteData[((xOffset)+(j)*width)*3], widthDrawn*3);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user