X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fopengl.c;h=51a1564e65ab923817ccc53104f7b62900b7e3b7;hb=702caa0d675462ebe9295d30cb1100e3a54e7b42;hp=aee8be84268789ce3c9fd7c4bc3080b0d3de84fa;hpb=fa963f15b145ef15e631b3a61df3abcbfc4d7aef;p=swftools.git diff --git a/lib/devices/opengl.c b/lib/devices/opengl.c index aee8be8..51a1564 100644 --- a/lib/devices/opengl.c +++ b/lib/devices/opengl.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "../gfxdevice.h" #include "../gfxtools.h" @@ -177,7 +178,7 @@ void opengl_fill(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color) len = 0; while(l) { if(l->type == gfx_splineTo) { - double c = sqrt(abs(l->x-2*l->sx+lastx) + abs(l->x-2*l->sy+lasty))/2; + double c = sqrt(abs(l->x-2*l->sx+lastx) + abs(l->y-2*l->sy+lasty))/2; int steps = (int)c; if(steps<1) steps = 1; len += steps; @@ -205,7 +206,7 @@ void opengl_fill(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color) if(l->type == gfx_splineTo) { int j; - double c = sqrt(abs(l->x-2*l->sx+lastx) + abs(l->x-2*l->sy+lasty))/2; + double c = sqrt(abs(l->x-2*l->sx+lastx) + abs(l->y-2*l->sy+lasty))/2; int steps = (int)c; if(steps<1) steps = 1; //printf("c=%f d1=%f (%f/%f) d2=%f (%f/%f)\n", c,d1,l->x-l->sx,l->y-l->sy,d2,lastx-l->sx,lasty-l->sy); @@ -448,6 +449,8 @@ void gfxdevice_opengl_init(gfxdevice_t*dev) dbg("init"); internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); memset(dev, 0, sizeof(gfxdevice_t)); + + dev->name = "opengl"; dev->internal = i;