Commits

Anonymous committed f97b92b

cleanup draw source

Comments (0)

Files changed (1)

 
 
 
-
 /*internal drawing tools*/
 
 static int clip_and_draw_line(SDL_Surface* surf, SDL_Rect* rect, Uint32 color, int* pts)
 }
 
 
-
-#if 0
-/*CODE I PLAN TO IMPLEMENT IN THE FUTURE*/
-/*along with this ellipse stuff, a triangle would be keen,
-from triangle a simple polygons will be easy too, but needed?*/
-
-/*anyone feel free to contribute :] */
-Ok... The circle algorithm:
-
-        x = 0
-        y = radius
-        switch = 3 - 2*radius
-
-    loop:
-
-        plot (x,y): plot (x,-y): plot (-x,y): plot (-x,-y)
-        plot (y,x): plot (y,-x): plot (-y,x): plot (-y,-x)
-
-        if switch < 0 then
-            switch = switch + 4 * x + 6
-        else
-            switch = switch + 4 * (x - y) + 10
-            y = y - 1
-
-        x = x + 1
-
-        if x <= y then goto loop
-
-        end
-
-
-
-void symmetry(x,y)
-int x,y;
-{
- PUT_PIXEL(+x,+y);  // This would obviously be inlined!
- PUT_PIXEL(-x,+y);  // and offset by a constant amount
- PUT_PIXEL(-x,-y);
- PUT_PIXEL(+x,-y);
-}
-
-void bresenham_ellipse(a,b) /*a = xradius, b= yradius*/
-int a,b;
-{
- int x,y,a2,b2, S, T;
-
- a2 = a*a;
- b2 = b*b;
- x = 0;
- y = b;
- S = a2*(1-2*b) + 2*b2;
- T = b2 - 2*a2*(2*b-1);
- symmetry(x,y);
- do
-   {
-    if (S<0)
-       {
-        S += 2*b2*(2*x+3);
-        T += 4*b2*(x+1);
-        x++;
-       }
-      else if (T<0)
-          {
-           S += 2*b2*(2*x+3) - 4*a2*(y-1);
-           T += 4*b2*(x+1) - 2*a2*(2*y-3);
-           x++;
-           y--;
-          }
-         else
-          {
-           S -= 4*a2*(y-1);
-           T -= 2*a2*(2*y-3);
-           y--;
-          }
-    symmetry(x,y);
-   }
- while (y>0);
-}
-#endif
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.