summaryrefslogtreecommitdiff
path: root/texture.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-09-30 13:39:52 +0000
committerrodri <rgl@antares-labs.eu>2024-09-30 13:39:52 +0000
commit453d100ac7734cd64652aa4d3a0685e3494428f7 (patch)
tree472fcc6b88032e276bbf9ea64dbc4e29ad34d73c /texture.c
parentb82c104fddd692f82baeb370a3b8e6d058fe3d2b (diff)
downloadlibgraphics-453d100ac7734cd64652aa4d3a0685e3494428f7.tar.gz
libgraphics-453d100ac7734cd64652aa4d3a0685e3494428f7.tar.bz2
libgraphics-453d100ac7734cd64652aa4d3a0685e3494428f7.zip
define model(6) prim as P instead. add GREY8 textures. add more documentation.
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;
}