diff options
author | Nebuleon Fumika | 2013-03-29 05:24:31 -0400 |
---|---|---|
committer | Nebuleon Fumika | 2013-03-29 05:24:31 -0400 |
commit | 9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed (patch) | |
tree | 81c38c1a18854309622c10be9d1a2a8bced58669 /source | |
parent | 900aedbed88dd6d8c4adc7230ebd40101c518a40 (diff) | |
download | snesemu-9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed.tar.gz snesemu-9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed.tar.bz2 snesemu-9a08a7ea4a2b4e36b753367717ddf96f9aaa15ed.zip |
Make rendering a GUI background (256x192) more efficient.
Diffstat (limited to 'source')
-rw-r--r-- | source/nds/draw.c | 24 |
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; + } + } } /*************************************************************/ |