Add Quad drawing option

This commit is contained in:
Michal Moskal
2017-07-11 15:52:37 +02:00
parent cb88fd7c2b
commit b60775fa50
4 changed files with 11 additions and 4 deletions

View File

@ -12,6 +12,7 @@ enum class Draw {
Fill = 0x04,
Transparent = 0x08,
Double = 0x10,
Quad = 0x20,
};
inline bool operator&(Draw a, Draw b) {
@ -22,7 +23,6 @@ inline Draw operator|(Draw a, Draw b) {
return (Draw)((int)a | (int)b);
}
#define XX(v) ((uint32_t)(v)&0xffff)
#define YY(v) ((uint32_t)(v) >> 16)
@ -171,8 +171,14 @@ Buffer doubleIcon(Buffer buf) {
void drawIcon(int x, int y, Buffer buf, Draw mode) {
if (!isValidIcon(buf))
return;
if (mode & Draw::Double)
if (mode & (Draw::Double | Draw::Quad)) {
buf = doubleIcon(buf);
if (mode & Draw::Quad) {
auto pbuf = buf;
buf = doubleIcon(buf);
decrRC(pbuf);
}
}
int pixwidth = buf->data[1];
int ptr = 2;