diff options
author | Marcus Comstedt | 2002-02-02 23:34:21 +0000 |
---|---|---|
committer | Marcus Comstedt | 2002-02-02 23:34:21 +0000 |
commit | 66f31a58c4570947268ecef9a03b67b73fdf817c (patch) | |
tree | ec95f6c51d919706266c701e480943e09fcaaaaf /dc | |
parent | 0299ea07c7c45fa9d4afdc09bc0c28931a97dcce (diff) | |
download | scummvm-rg350-66f31a58c4570947268ecef9a03b67b73fdf817c.tar.gz scummvm-rg350-66f31a58c4570947268ecef9a03b67b73fdf817c.tar.bz2 scummvm-rg350-66f31a58c4570947268ecef9a03b67b73fdf817c.zip |
Visual memory icon creation.
svn-id: r3557
Diffstat (limited to 'dc')
-rw-r--r-- | dc/icon.cpp | 20 | ||||
-rw-r--r-- | dc/icon.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/dc/icon.cpp b/dc/icon.cpp index 2827a2c3b7..1ba92dedb7 100644 --- a/dc/icon.cpp +++ b/dc/icon.cpp @@ -25,6 +25,26 @@ #include "icon.h" +void Icon::create_vmicon(void *buffer) +{ + unsigned short *pal = (unsigned short *)buffer; + unsigned char *pix = ((unsigned char *)buffer)+32; + + for(int n = 0; n<16; n++) { + int p = palette[n]; + pal[n] = + ((p>>16)&0xf000)| + ((p>>12)&0x0f00)| + ((p>> 8)&0x00f0)| + ((p>> 4)&0x000f); + } + + for(int line = 0; line < 32; line++) { + memcpy(pix, &bitmap[32/2*(31-line)], 32/2); + pix += 32/2; + } +} + void Icon::create_texture() { static char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21, @@ -16,4 +16,5 @@ class Icon void create_texture(); void set_palette(int pal); void draw(float x1, float y1, float x2, float y2, int pal); + void create_vmicon(void *buffer); }; |