瀏覽代碼

* Factorized some code and added temporary debug stuff

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2787 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
jylam 16 年之前
父節點
當前提交
d0e6525dd1
共有 1 個文件被更改,包括 13 次插入6 次删除
  1. +13
    -6
      pipi/paint/line.c

+ 13
- 6
pipi/paint/line.c 查看文件

@@ -280,12 +280,19 @@ static void draw_antialiased_line_float(pipi_image_t *img, struct line* s)
/* Is that an horrible mess ? Yes, it is. */
#undef PLOT
#define PLOT(x, y, c) \
s->buf_f[(((int)(x)*4))+((int)(y))*(img->w*4)] = \
(c*s->colorf[0]) + (1-c) * s->buf_f[(((int)(x)*4))+((int)(y))*(img->w*4)]; \
s->buf_f[(1+((int)(x)*4))+((int)(y))*(img->w*4)] = \
(c*s->colorf[1]) + (1-c) * s->buf_f[(1+((int)(x)*4))+((int)(y))*(img->w*4)]; \
s->buf_f[(2+((int)(x)*4))+((int)(y))*(img->w*4)] = \
(c*s->colorf[2]) + (1-c) * s->buf_f[(2+((int)(x)*4))+((int)(y))*(img->w*4)];
{ int qwer = (((int)(x)*4))+((int)(y))*(img->w*4);\
int qweg = (1+((int)(x)*4))+((int)(y))*(img->w*4); \
int qweb = (2+((int)(x)*4))+((int)(y))*(img->w*4); \
s->buf_f[qwer] = (c*s->colorf[0]) + (1-c) * s->buf_f[qwer]; \
s->buf_f[qweg] = (c*s->colorf[1]) + (1-c) * s->buf_f[qweg]; \
s->buf_f[qweb] = (c*s->colorf[2]) + (1-c) * s->buf_f[qweb]; \
if(s->buf_f[qwer] > 0.8f) s->buf_f[qwer] = 0.8f; /* DEBUG LOL !*/ \
if(s->buf_f[qwer] < 0.2f) s->buf_f[qwer] = 0.2f; \
if(s->buf_f[qweg] > 0.8f) s->buf_f[qweg] = 0.8f; \
if(s->buf_f[qweg] < 0.2f) s->buf_f[qweg] = 0.2f; \
if(s->buf_f[qweb] > 0.8f) s->buf_f[qweb] = 0.8f; \
if(s->buf_f[qweb] < 0.2f) s->buf_f[qweb] = 0.2f; \
}
#include "aline_template.h"
}



Loading…
取消
儲存