summaryrefslogtreecommitdiff
path: root/texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'texture.c')
-rw-r--r--texture.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/texture.c b/texture.c
index 97d2065..acc247b 100644
--- a/texture.c
+++ b/texture.c
@@ -60,6 +60,11 @@ _memreadcolor(Texture *t, Point sp)
memmove(cbuf+1, cbuf, 3);
cbuf[0] = 0xFF;
break;
+ case GREY8:
+ unloadmemimage(t->image, rectaddpt(UR, sp), cbuf+1, 1);
+ memset(cbuf+2, cbuf[1], 2);
+ cbuf[0] = 0xFF;
+ break;
}
c = cbuf2col(cbuf);
@@ -69,9 +74,9 @@ _memreadcolor(Texture *t, Point sp)
c.g /= c.a;
c.b /= c.a;
}
- switch(t->type){
- case sRGBTexture: c = srgb2linear(c); break;
- }
+ if(t->type == sRGBTexture)
+ c = srgb2linear(c);
+
return c;
}