diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-30 13:39:52 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-30 13:39:52 +0000 |
commit | 453d100ac7734cd64652aa4d3a0685e3494428f7 (patch) | |
tree | 472fcc6b88032e276bbf9ea64dbc4e29ad34d73c /texture.c | |
parent | b82c104fddd692f82baeb370a3b8e6d058fe3d2b (diff) | |
download | libgraphics-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.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; } |