aboutsummaryrefslogtreecommitdiff
path: root/dc
diff options
context:
space:
mode:
Diffstat (limited to 'dc')
-rw-r--r--dc/icon.cpp20
-rw-r--r--dc/icon.h1
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,
diff --git a/dc/icon.h b/dc/icon.h
index 6ffe4fe16e..a945b152ad 100644
--- a/dc/icon.h
+++ b/dc/icon.h
@@ -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);
};