aboutsummaryrefslogtreecommitdiff
path: root/source/nds
diff options
context:
space:
mode:
authorNebuleon Fumika2013-03-29 05:24:31 -0400
committerNebuleon Fumika2013-03-29 05:24:31 -0400
commit9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed (patch)
tree81c38c1a18854309622c10be9d1a2a8bced58669 /source/nds
parent900aedbed88dd6d8c4adc7230ebd40101c518a40 (diff)
downloadsnes9x2005-9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed.tar.gz
snes9x2005-9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed.tar.bz2
snes9x2005-9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed.zip
Make rendering a GUI background (256x192) more efficient.
Diffstat (limited to 'source/nds')
-rw-r--r--source/nds/draw.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/nds/draw.c b/source/nds/draw.c
index 8693141..e33d0c6 100644
--- a/source/nds/draw.c
+++ b/source/nds/draw.c
@@ -1101,16 +1101,24 @@ void show_icon(void* screen, struct gui_iconlist* icon, u32 x, u32 y)
dst = (unsigned short*)screen + y*NDS_SCREEN_WIDTH + x;
if(NULL == src) return; //The icon may initialized failure
- for(i= 0; i < icon->y; i++)
- {
- for(k= 0; k < icon->x; k++)
+ if (icon->x == NDS_SCREEN_WIDTH && icon->y == NDS_SCREEN_HEIGHT && x == 0 && y == 0)
+ {
+ // Don't support transparency for a background.
+ memcpy(dst, src, NDS_SCREEN_WIDTH * NDS_SCREEN_HEIGHT * sizeof(u16));
+ }
+ else
+ {
+ for(i= 0; i < icon->y; i++)
{
- if(0x03E0 != *src) dst[k]= *src;
- src++;
- }
+ for(k= 0; k < icon->x; k++)
+ {
+ if(0x03E0 != *src) dst[k]= *src;
+ src++;
+ }
- dst += NDS_SCREEN_WIDTH;
- }
+ dst += NDS_SCREEN_WIDTH;
+ }
+ }
}
/*************************************************************/