From 108e1a79bab5f6fdad93f56999c337993067beb3 Mon Sep 17 00:00:00 2001 From: tkarrass Date: Sat, 2 Nov 2013 23:39:48 +0100 Subject: [PATCH] tmp --- src/display.c | 18 ++++++++++++++++-- src/image.c | 6 ++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/display.c b/src/display.c index 423971e..52dd522 100644 --- a/src/display.c +++ b/src/display.c @@ -63,6 +63,9 @@ void prntscreen(const struct message *msg, const struct prog_info *pinfo) { static int init = 0; static int rows; static int cols; + static char *img = NULL; + static int w; + static int h; if (!init) { // printf("init start\n"); initscr(); @@ -71,15 +74,26 @@ void prntscreen(const struct message *msg, const struct prog_info *pinfo) { init = 1; // printf("init end\n"); } + if (!img && msg->image) { + img = msg->image; + w = msg->width; + h = msg->height; + } + + if (!img) + return; int frame = msg->timestamp; int right = pinfo->client_offset; int left = right + cols; // printf("loop\n"); - for (int y=0; y<50; y++) { // yheight; y++) { + int rowoffset = (rows-h)/2; + int coloffset = left-frame; + for (int y=0; yheight; y++) { for (int x=left-frame; x*cols?len:*cols;