gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz gzz/vob/vobs/ColoredSectorVob.java gfx/demo...


From: Asko Soukka
Subject: [Gzz-commits] gzz gzz/vob/vobs/ColoredSectorVob.java gfx/demo...
Date: Thu, 12 Dec 2002 14:20:58 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/12/12 14:20:58

Modified files:
        gzz/vob/vobs   : ColoredSectorVob.java 
Added files:
        gfx/demo/opengl: pacman.py 

Log message:
        pacmandemobase for mudyc :)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/vobs/ColoredSectorVob.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/opengl/pacman.py?rev=1.1

Patches:
Index: gzz/gzz/vob/vobs/ColoredSectorVob.java
diff -u gzz/gzz/vob/vobs/ColoredSectorVob.java:1.3 
gzz/gzz/vob/vobs/ColoredSectorVob.java:1.4
--- gzz/gzz/vob/vobs/ColoredSectorVob.java:1.3  Thu Dec 12 04:42:20 2002
+++ gzz/gzz/vob/vobs/ColoredSectorVob.java      Thu Dec 12 14:20:57 2002
@@ -41,17 +41,17 @@
  */
 
 public class ColoredSectorVob extends Vob {
-public static final String rcsid = "$Id: ColoredSectorVob.java,v 1.3 
2002/12/12 09:42:20 humppake Exp $";
+public static final String rcsid = "$Id: ColoredSectorVob.java,v 1.4 
2002/12/12 19:20:57 humppake Exp $";
     public static boolean dbg = false;
     static final void p(String s) { if(dbg) System.out.println(s); }
     static final void pa(String s) { System.out.println(s); }
 
     static protected float [][] circleGL = new float[360][2];
     static protected boolean circleGLReady = false;
-    static protected void prepareCircleGL(int start) {
+    static protected void prepareCircleGL() {
        if (!circleGLReady) {
            for (int i=0;i<360;i++) {
-               float a = (float)((Math.PI / 180) * (360-(i+start)));
+               float a = (float)((Math.PI / 180) * (360-i));
                circleGL[i][0] = 0.5f + x(a, 0.5f);
                circleGL[i][1] = 0.5f + y(a, 0.5f);
            }
@@ -80,9 +80,9 @@
      */
     public ColoredSectorVob(int start, int sector, int step) {
        super();
-       this.start = start;
-       this.sector = sector;
-       this.step = step;
+       this.start = Math.abs(start);
+       this.sector = Math.abs(sector);
+       this.step = Math.abs(step);
     }
     /* Default valus for drawing a small circle. */
     public ColoredSectorVob(){
@@ -150,7 +150,7 @@
                                int coordsys2) {
         if(dbg) pa("Addtolistgl coloredsectorvob "+coordsys1);
        if(glList == null) {
-           if (!circleGLReady) prepareCircleGL(start);
+           if (!circleGLReady) prepareCircleGL();
            String bgcall = "";
            if(nsolids > 0) {
                int arc = sector / nsolids;
@@ -161,14 +161,14 @@
                               "Begin POLYGON\n"+
                               "Vertex 0.5 0.5\n");
                    for (int j=i*arc;j<(i+1)*arc;j+=step) {
-                       bgcall += ("Vertex " + circleGL[j][0] +
-                                  " " + circleGL[j][1] + "\n");
+                       bgcall += ("Vertex " + circleGL[(j+start)%360][0] +
+                                  " " + circleGL[(j+start)%360][1] + "\n");
                    }
                    int last = (i+1)*arc-1;
                    if (sector == 360) last++;
                    if (last == 360) last = 0;
-                   bgcall += ("Vertex " + circleGL[last][0] +
-                              " " + circleGL[last][1] + "\n" +
+                   bgcall += ("Vertex " + circleGL[(last+start)%360][0] +
+                              " " + circleGL[(last+start)%360][1] + "\n" +
                               "End\n");
                }
            } else {
@@ -177,11 +177,11 @@
                    "Begin POLYGON\n");
                if (sector < 360) bgcall += ("Vertex 0.5 0.5\n");
                for (int i=0;i<sector;i+=step) {
-                   bgcall += ("Vertex " + circleGL[i][0] +
-                              " " + circleGL[i][1] + "\n");
+                   bgcall += ("Vertex " + circleGL[(i+start)%360][0] +
+                              " " + circleGL[(i+start)%360][1] + "\n");
                }
-               bgcall += ("Vertex " + circleGL[sector-1][0] +
-                          " " + circleGL[sector-1][1] + "\n" +
+               bgcall += ("Vertex " + circleGL[(sector-1+start)%360][0] +
+                          " " + circleGL[(sector-1+start)%360][1] + "\n" +
                           "End\n");
            }
 
@@ -190,11 +190,11 @@
                      "Begin LINE_LOOP\n");
            if (sector < 360) bgcall += ("Vertex 0.5 0.5\n");
            for (int i=0;i<sector;i+=step) {
-               bgcall += ("Vertex " + circleGL[i][0] +
-                              " " + circleGL[i][1] + "\n");
+               bgcall += ("Vertex " + circleGL[(i+start)%360][0] +
+                              " " + circleGL[(i+start)%360][1] + "\n");
            }
-           bgcall += ("Vertex " + circleGL[sector-1][0] +
-                      " " + circleGL[sector-1][1] + "\n" +
+           bgcall += ("Vertex " + circleGL[(sector-1+start)%360][0] +
+                      " " + circleGL[(sector-1+start)%360][1] + "\n" +
                       "End\n");
                    
            glList = GLRen.createCallListBoxCoorded(



reply via email to

[Prev in Thread] Current Thread [Next in Thread]