Update of /cvsroot/jake2/jake2/src/jake2/render
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/render
Modified Files:
Tag: RST
glpoly_t.java LWJGLRenderer.java Renderer.java msurface_t.java
Log Message:
This has vec3-optimize and the OAK bot.
Index: msurface_t.java
===================================================================
RCS file: /cvsroot/jake2/jake2/src/jake2/render/msurface_t.java,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -C2 -d -r1.3 -r1.3.6.1
*** msurface_t.java 9 Jul 2004 06:50:47 -0000 1.3
--- msurface_t.java 16 Jan 2005 21:21:07 -0000 1.3.6.1
***************
*** 69,74 ****
public void clear() {
visframe = 0;
! plane = null;
! plane = new cplane_t();
flags = 0;
--- 69,73 ----
public void clear() {
visframe = 0;
! plane.clear();
flags = 0;
Index: glpoly_t.java
===================================================================
RCS file: /cvsroot/jake2/jake2/src/jake2/render/glpoly_t.java,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -C2 -d -r1.2 -r1.2.6.1
*** glpoly_t.java 9 Jul 2004 06:50:47 -0000 1.2
--- glpoly_t.java 16 Jan 2005 21:21:07 -0000 1.2.6.1
***************
*** 24,46 ****
package jake2.render;
! public class glpoly_t {
! public final static int VERTEXSIZE = 7;
public glpoly_t next;
public glpoly_t chain;
public int numverts;
public int flags; // for SURF_UNDERWATER (not needed anymore?)
- public float verts[][] = null; // variable sized (xyz s1t1 s2t2)
- public glpoly_t(int numverts) {
- this.verts = new float[numverts][VERTEXSIZE];
- }
-
- /*
- * vertex array extension
- */
-
// the array position (glDrawArrays)
public int pos = 0;
! }
--- 24,75 ----
package jake2.render;
! import jake2.util.Lib;
+ public abstract class glpoly_t {
+ public final static int STRIDE = 7;
+ public final static int BYTE_STRIDE = 7 * Lib.SIZEOF_FLOAT;
+ public final static int MAX_VERTICES = 64;
+
public glpoly_t next;
public glpoly_t chain;
public int numverts;
public int flags; // for SURF_UNDERWATER (not needed anymore?)
// the array position (glDrawArrays)
public int pos = 0;
! protected glpoly_t() {
! }
!
! public abstract float x(int index);
!
! public abstract void x(int index, float value);
!
! public abstract float y(int index);
!
! public abstract void y(int index, float value);
!
! public abstract float z(int index);
!
! public abstract void z(int index, float value);
!
! public abstract float s1(int index);
!
! public abstract void s1(int index, float value);
!
! public abstract float t1(int index);
!
! public abstract void t1(int index, float value);
!
! public abstract float s2(int index);
!
! public abstract void s2(int index, float value);
!
! public abstract float t2(int index);
!
! public abstract void t2(int index, float value);
!
! public abstract void beginScrolling(float s1);
!
! public abstract void endScrolling();
! }
\ No newline at end of file
Index: Renderer.java
===================================================================
RCS file: /cvsroot/jake2/jake2/src/jake2/render/Renderer.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** Renderer.java 16 Dec 2004 21:13:06 -0000 1.5
--- Renderer.java 16 Jan 2005 21:21:07 -0000 1.5.2.1
***************
*** 44,48 ****
Class.forName("net.java.games.jogl.GL");
Class.forName("jake2.render.JoglRenderer");
- Class.forName("jake2.render.FastJoglRenderer");
} catch (ClassNotFoundException e) {
// ignore the jogl drivers if runtime not in classpath
--- 44,47 ----
***************
*** 54,57 ****
--- 53,62 ----
// ignore the lwjgl driver if runtime not in classpath
}
+ try {
+ Class.forName("net.java.games.jogl.GL");
+ Class.forName("jake2.render.FastJoglRenderer");
+ } catch (ClassNotFoundException e) {
+ // ignore the fastjogl drivers if runtime not in classpath
+ }
} catch (Throwable e) {
e.printStackTrace();
***************
*** 85,90 ****
--- 90,104 ----
return null;
}
+
+ public static String getDefaultName() {
+ return (drivers.isEmpty()) ? null : ((Ref) drivers.firstElement()).getName();
+ }
+
+ public static String getPreferedName() {
+ return (drivers.isEmpty()) ? null : ((Ref) drivers.lastElement()).getName();
+ }
public static String[] getDriverNames() {
+ if (drivers.isEmpty()) return null;
int count = drivers.size();
String[] names = new String[count];
|