From 453d100ac7734cd64652aa4d3a0685e3494428f7 Mon Sep 17 00:00:00 2001 From: rodri Date: Mon, 30 Sep 2024 13:39:52 +0000 Subject: define model(6) prim as P instead. add GREY8 textures. add more documentation. --- texture.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'texture.c') 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; } -- cgit v1.2.3