~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/draw/paint/kws_draw.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <tina/sys.h>
  5 #include <tina/sysfuncs.h>
  6 #include <tina/math.h>
  7 #include <tina/mathfuncs.h>
  8 #include <tina/vision.h>
  9 #include <tina/visionfuncs.h>
 10 #include <tina/tv.h>
 11 #include <tina/draw.h>
 12 #include <tina/drawfuncs.h>
 13 #include <tina/tvfuncs.h>
 14 
 15 void    kwsnake_draw(Tv * tv, Kwsnake * kwsnake)
 16 {
 17     double *x, *y;
 18     int     i, n;
 19 
 20     if (kwsnake == NULL)
 21         return;
 22 
 23     x = kwsnake->x;
 24     y = kwsnake->y;
 25     n = kwsnake->n;
 26     for (i = 0; i < n - 1; i++)
 27     {
 28         tv_dot2(tv, vec2(x[i], y[i]));
 29         tv_line2(tv, vec2(x[i], y[i]), vec2(x[i + 1], y[i + 1]));
 30     }
 31     if (kwsnake->type == LOOP)
 32     {
 33         tv_dot2(tv, vec2(x[n - 1], y[n - 1]));
 34         tv_line2(tv, vec2(x[n - 1], y[n - 1]), vec2(x[0], y[0]));
 35     } else
 36         tv_dot2(tv, vec2(x[n - 1], y[n - 1]));
 37 }
 38 
 39 void    tv_kwsnake(Tv * tv, Kwsnake * kwsnake)
 40 {
 41     kwsnake_draw(tv, kwsnake);
 42 }
 43 
 44 void    kwsnake_draw3(Tv * tv, Kwsnake * kwsnake, double z)
 45 {
 46     double *x, *y;
 47     int     i, n;
 48 
 49     if (kwsnake == NULL)
 50         return;
 51 
 52     x = kwsnake->x;
 53     y = kwsnake->y;
 54     n = kwsnake->n;
 55     for (i = 0; i < n - 1; i++)
 56         tv_line3(tv, vec3(x[i], y[i], z), vec3(x[i + 1], y[i + 1], z));
 57     if (kwsnake->type == LOOP)
 58         tv_line3(tv, vec3(x[n - 1], y[n - 1], z), vec3(x[0], y[0], z));
 59 }
 60 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.