summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-06-09 16:53:41 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-09 16:53:41 (GMT)
commit1effdb052a0b952d1390109bed67b3371046ccb7 (patch)
treefef81cd5f965947ed152caa19f8e7c39463f3b47 /src/graphics.c
parent74f613962e1090e3ad2db186e555a29c12c03941 (diff)
downloadpowder-1effdb052a0b952d1390109bed67b3371046ccb7.zip
powder-1effdb052a0b952d1390109bed67b3371046ccb7.tar.gz
Image for server saving
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c
index b8ef697..aab77ab 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -3624,6 +3624,26 @@ pixel *render_packed_rgb(void *image, int width, int height, int cmp_size)
return res;
}
+void draw_rgba_image(pixel *vid, unsigned char *data, int x, int y, float alpha)
+{
+ unsigned char w, h;
+ int i, j;
+ unsigned char r, g, b, a;
+ w = *(data++)&0xFF;
+ h = *(data++)&0xFF;
+ for (j=0; j<h; j++)
+ {
+ for (i=0; i<w; i++)
+ {
+ r = *(data++)&0xFF;
+ g = *(data++)&0xFF;
+ b = *(data++)&0xFF;
+ a = *(data++)&0xFF;
+ drawpixel(vid, x+i, y+j, r, g, b, a*alpha);
+ }
+ }
+}
+
void draw_image(pixel *vid, pixel *img, int x, int y, int w, int h, int a)
{
int i, j, r, g, b;