From: Carsten W. <ca...@us...> - 2006-11-21 00:51:26
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16436/src/jake2/render Modified Files: Renderer.java glconfig_t.java Ref.java Added Files: JoglRenderer.java LwjglRenderer.java Jsr231Renderer.java RenderAPI.java Base.java Removed Files: JoglBase.java LWJGLRenderer.java FastJoglRenderer.java Log Message: merge render-refactoring branch into the HEAD --- NEW FILE: RenderAPI.java --- package jake2.render; import jake2.client.refdef_t; import jake2.render.opengl.GLDriver; import java.awt.Dimension; public interface RenderAPI { void setGLDriver(GLDriver impl); boolean R_Init(int vid_xpos, int vid_ypos); boolean R_Init2(); void R_Shutdown(); void R_BeginRegistration(String map); model_t R_RegisterModel(String name); image_t R_RegisterSkin(String name); image_t Draw_FindPic(String name); void R_SetSky(String name, float rotate, float[] axis); void R_EndRegistration(); void R_RenderFrame(refdef_t fd); void Draw_GetPicSize(Dimension dim, String name); void Draw_Pic(int x, int y, String name); void Draw_StretchPic(int x, int y, int w, int h, String name); void Draw_Char(int x, int y, int num); void Draw_TileClear(int x, int y, int w, int h, String name); void Draw_Fill(int x, int y, int w, int h, int c); void Draw_FadeScreen(); void Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte[] data); void R_SetPalette(byte[] palette); void R_BeginFrame(float camera_separation); } --- NEW FILE: Jsr231Renderer.java --- /* * Jsr231Renderer.java * Copyright (C) 2004 * * $Id: Jsr231Renderer.java,v 1.2 2006/11/21 00:51:22 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.render; import jake2.Defines; import jake2.client.refdef_t; import jake2.client.refexport_t; import jake2.render.opengl.Jsr231Driver; import jake2.sys.JOGLKBD; import jake2.sys.KBD; import java.awt.Dimension; /** * Jsr231Renderer * * @author dsanders/cwei */ final class Jsr231Renderer extends Jsr231Driver implements refexport_t, Ref { public static final String DRIVER_NAME = "jsr231"; private KBD kbd = new JOGLKBD(); // is set from Renderer factory private RenderAPI impl; static { Renderer.register(new Jsr231Renderer()); }; private Jsr231Renderer() { // singleton } // ============================================================================ // public interface for Renderer implementations // // refexport_t (ref.h) // ============================================================================ /** * @see jake2.client.refexport_t#Init() */ public boolean Init(int vid_xpos, int vid_ypos) { // init the OpenGL drivers impl.setGLDriver(this); // pre init if (!impl.R_Init(vid_xpos, vid_ypos)) return false; // activates the OpenGL context activate(); // post init return impl.R_Init2(); } /** * @see jake2.client.refexport_t#Shutdown() */ public void Shutdown() { impl.R_Shutdown(); } /** * @see jake2.client.refexport_t#BeginRegistration(java.lang.String) */ public final void BeginRegistration(String map) { activate(); impl.R_BeginRegistration(map); } /** * @see jake2.client.refexport_t#RegisterModel(java.lang.String) */ public final model_t RegisterModel(String name) { activate(); return impl.R_RegisterModel(name); } /** * @see jake2.client.refexport_t#RegisterSkin(java.lang.String) */ public final image_t RegisterSkin(String name) { activate(); return impl.R_RegisterSkin(name); } /** * @see jake2.client.refexport_t#RegisterPic(java.lang.String) */ public final image_t RegisterPic(String name) { activate(); return impl.Draw_FindPic(name); } /** * @see jake2.client.refexport_t#SetSky(java.lang.String, float, float[]) */ public final void SetSky(String name, float rotate, float[] axis) { activate(); impl.R_SetSky(name, rotate, axis); } /** * @see jake2.client.refexport_t#EndRegistration() */ public final void EndRegistration() { activate(); impl.R_EndRegistration(); } /** * @see jake2.client.refexport_t#RenderFrame(jake2.client.refdef_t) */ public final void RenderFrame(refdef_t fd) { impl.R_RenderFrame(fd); } /** * @see jake2.client.refexport_t#DrawGetPicSize(java.awt.Dimension, java.lang.String) */ public final void DrawGetPicSize(Dimension dim, String name) { impl.Draw_GetPicSize(dim, name); } /** * @see jake2.client.refexport_t#DrawPic(int, int, java.lang.String) */ public final void DrawPic(int x, int y, String name) { impl.Draw_Pic(x, y, name); } /** * @see jake2.client.refexport_t#DrawStretchPic(int, int, int, int, java.lang.String) */ public final void DrawStretchPic(int x, int y, int w, int h, String name) { impl.Draw_StretchPic(x, y, w, h, name); } /** * @see jake2.client.refexport_t#DrawChar(int, int, int) */ public final void DrawChar(int x, int y, int num) { activate(); impl.Draw_Char(x, y, num); } /** * @see jake2.client.refexport_t#DrawTileClear(int, int, int, int, java.lang.String) */ public final void DrawTileClear(int x, int y, int w, int h, String name) { impl.Draw_TileClear(x, y, w, h, name); } /** * @see jake2.client.refexport_t#DrawFill(int, int, int, int, int) */ public final void DrawFill(int x, int y, int w, int h, int c) { impl.Draw_Fill(x, y, w, h, c); } /** * @see jake2.client.refexport_t#DrawFadeScreen() */ public final void DrawFadeScreen() { impl.Draw_FadeScreen(); } /** * @see jake2.client.refexport_t#DrawStretchRaw(int, int, int, int, int, int, byte[]) */ public final void DrawStretchRaw(int x, int y, int w, int h, int cols, int rows, byte[] data) { impl.Draw_StretchRaw(x, y, w, h, cols, rows, data); } /** * @see jake2.client.refexport_t#CinematicSetPalette(byte[]) */ public final void CinematicSetPalette(byte[] palette) { impl.R_SetPalette(palette); } /** * @see jake2.client.refexport_t#BeginFrame(float) */ public final void BeginFrame(float camera_separation) { impl.R_BeginFrame(camera_separation); } /** * @see jake2.client.refexport_t#EndFrame() */ public final void EndFrame() { endFrame(); } /** * @see jake2.client.refexport_t#AppActivate(boolean) */ public final void AppActivate(boolean activate) { appActivate(activate); } public final int apiVersion() { return Defines.API_VERSION; } public KBD getKeyboardHandler() { return kbd; } // ============================================================================ // Ref interface // ============================================================================ public final String getName() { return DRIVER_NAME; } public final String toString() { return DRIVER_NAME; } public final refexport_t GetRefAPI(RenderAPI renderer) { this.impl = renderer; return this; } } --- FastJoglRenderer.java DELETED --- --- NEW FILE: LwjglRenderer.java --- /* * LwjglRenderer.java * Copyright (C) 2004 * * $Id: LwjglRenderer.java,v 1.2 2006/11/21 00:51:22 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.render; import jake2.Defines; import jake2.client.*; import jake2.qcommon.xcommand_t; import jake2.render.opengl.LwjglDriver; import jake2.sys.*; import java.awt.Dimension; import java.awt.DisplayMode; /** * LwjglRenderer * * @author dsanders/cwei */ final class LwjglRenderer extends LwjglDriver implements refexport_t, Ref { public static final String DRIVER_NAME = "lwjgl"; private KBD kbd = new LWJGLKBD(); // is set from Renderer factory private RenderAPI impl; static { Renderer.register(new LwjglRenderer()); }; private LwjglRenderer() { } // ============================================================================ // public interface for Renderer implementations // // refexport_t (ref.h) // ============================================================================ /** * @see jake2.client.refexport_t#Init() */ public boolean Init(int vid_xpos, int vid_ypos) { // init the OpenGL drivers impl.setGLDriver(this); // pre init if (!impl.R_Init(vid_xpos, vid_ypos)) return false; // post init return impl.R_Init2(); } /** * @see jake2.client.refexport_t#Shutdown() */ public void Shutdown() { impl.R_Shutdown(); } /** * @see jake2.client.refexport_t#BeginRegistration(java.lang.String) */ public final void BeginRegistration(String map) { impl.R_BeginRegistration(map); } /** * @see jake2.client.refexport_t#RegisterModel(java.lang.String) */ public final model_t RegisterModel(String name) { return impl.R_RegisterModel(name); } /** * @see jake2.client.refexport_t#RegisterSkin(java.lang.String) */ public final image_t RegisterSkin(String name) { return impl.R_RegisterSkin(name); } /** * @see jake2.client.refexport_t#RegisterPic(java.lang.String) */ public final image_t RegisterPic(String name) { return impl.Draw_FindPic(name); } /** * @see jake2.client.refexport_t#SetSky(java.lang.String, float, float[]) */ public final void SetSky(String name, float rotate, float[] axis) { impl.R_SetSky(name, rotate, axis); } /** * @see jake2.client.refexport_t#EndRegistration() */ public final void EndRegistration() { impl.R_EndRegistration(); } /** * @see jake2.client.refexport_t#RenderFrame(jake2.client.refdef_t) */ public final void RenderFrame(refdef_t fd) { impl.R_RenderFrame(fd); } /** * @see jake2.client.refexport_t#DrawGetPicSize(java.awt.Dimension, java.lang.String) */ public final void DrawGetPicSize(Dimension dim, String name) { impl.Draw_GetPicSize(dim, name); } /** * @see jake2.client.refexport_t#DrawPic(int, int, java.lang.String) */ public final void DrawPic(int x, int y, String name) { impl.Draw_Pic(x, y, name); } /** * @see jake2.client.refexport_t#DrawStretchPic(int, int, int, int, java.lang.String) */ public final void DrawStretchPic(int x, int y, int w, int h, String name) { impl.Draw_StretchPic(x, y, w, h, name); } /** * @see jake2.client.refexport_t#DrawChar(int, int, int) */ public final void DrawChar(int x, int y, int num) { impl.Draw_Char(x, y, num); } /** * @see jake2.client.refexport_t#DrawTileClear(int, int, int, int, java.lang.String) */ public final void DrawTileClear(int x, int y, int w, int h, String name) { impl.Draw_TileClear(x, y, w, h, name); } /** * @see jake2.client.refexport_t#DrawFill(int, int, int, int, int) */ public final void DrawFill(int x, int y, int w, int h, int c) { impl.Draw_Fill(x, y, w, h, c); } /** * @see jake2.client.refexport_t#DrawFadeScreen() */ public final void DrawFadeScreen() { impl.Draw_FadeScreen(); } /** * @see jake2.client.refexport_t#DrawStretchRaw(int, int, int, int, int, int, byte[]) */ public final void DrawStretchRaw(int x, int y, int w, int h, int cols, int rows, byte[] data) { impl.Draw_StretchRaw(x, y, w, h, cols, rows, data); } /** * @see jake2.client.refexport_t#CinematicSetPalette(byte[]) */ public final void CinematicSetPalette(byte[] palette) { impl.R_SetPalette(palette); } /** * @see jake2.client.refexport_t#BeginFrame(float) */ public final void BeginFrame(float camera_separation) { impl.R_BeginFrame(camera_separation); } /** * @see jake2.client.refexport_t#EndFrame() */ public final void EndFrame() { endFrame(); /* try { Thread.sleep(1); } catch (InterruptedException e) { }*/ } /** * @see jake2.client.refexport_t#AppActivate(boolean) */ public final void AppActivate(boolean activate) { appActivate(activate); } public final int apiVersion() { return Defines.API_VERSION; } public KBD getKeyboardHandler() { return kbd; } // ============================================================================ // Ref interface // ============================================================================ public final String getName() { return DRIVER_NAME; } public final String toString() { return DRIVER_NAME; } public final refexport_t GetRefAPI(RenderAPI renderer) { this.impl = renderer; return this; } } --- LWJGLRenderer.java DELETED --- --- NEW FILE: JoglRenderer.java --- /* * JoglRenderer.java * Copyright (C) 2003 * * $Id: JoglRenderer.java,v 1.8 2006/11/21 00:51:22 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.render; import jake2.Defines; import jake2.client.refdef_t; import jake2.client.refexport_t; import jake2.qcommon.xcommand_t; import jake2.render.opengl.JoglDriver; import jake2.sys.JOGLKBD; import jake2.sys.KBD; import java.awt.Dimension; /** * JoglRenderer * * @author cwei */ final class JoglRenderer extends JoglDriver implements refexport_t, Ref { public static final String DRIVER_NAME = "jogl"; private KBD kbd = new JOGLKBD(); // is set from Renderer factory private RenderAPI impl; static { Renderer.register(new JoglRenderer()); }; private JoglRenderer() { // singleton } // ============================================================================ // public interface for Renderer implementations // // refexport_t (ref.h) // ============================================================================ private boolean post_init = false; /** * @see jake2.client.refexport_t#Init() */ public boolean Init(int vid_xpos, int vid_ypos) { // init the OpenGL drivers impl.setGLDriver(this); // pre init if (!impl.R_Init(vid_xpos, vid_ypos)) return false; // calls the R_Init2() internally updateScreen(new xcommand_t() { public void execute() { JoglRenderer.this.post_init = impl.R_Init2(); } }); // the result from R_Init2() return post_init; } /** * @see jake2.client.refexport_t#Shutdown() */ public void Shutdown() { impl.R_Shutdown(); } /** * @see jake2.client.refexport_t#BeginRegistration(java.lang.String) */ public void BeginRegistration(String map) { if (contextInUse) { impl.R_BeginRegistration(map); return; } this.name = map; updateScreen(new xcommand_t() { public void execute() { impl.R_BeginRegistration(JoglRenderer.this.name); } }); } private model_t model = null; private String name = null; /** * @see jake2.client.refexport_t#RegisterModel(java.lang.String) */ public model_t RegisterModel(String name) { if (contextInUse) return impl.R_RegisterModel(name); model = null; this.name = name; updateScreen(new xcommand_t() { public void execute() { JoglRenderer.this.model = impl.R_RegisterModel(JoglRenderer.this.name); } }); return model; } /** * @see jake2.client.refexport_t#RegisterSkin(java.lang.String) */ public image_t RegisterSkin(String name) { if (contextInUse) return impl.R_RegisterSkin(name); this.image = null; this.name = name; updateScreen(new xcommand_t() { public void execute() { JoglRenderer.this.image = impl.R_RegisterSkin(JoglRenderer.this.name); } }); return image; } private image_t image = null; /** * @see jake2.client.refexport_t#RegisterPic(java.lang.String) */ public image_t RegisterPic(String name) { if (contextInUse) return impl.Draw_FindPic(name); this.image = null; this.name = name; updateScreen(new xcommand_t() { public void execute() { JoglRenderer.this.image = impl.Draw_FindPic(JoglRenderer.this.name); } }); return image; } private float[] axis; private float rotate; /** * @see jake2.client.refexport_t#SetSky(java.lang.String, float, float[]) */ public void SetSky(String name, float rotate, float[] axis) { if (contextInUse) { impl.R_SetSky(name, rotate, axis); return; } this.name = name; this.rotate = rotate; this.axis = axis; updateScreen(new xcommand_t() { public void execute() { impl.R_SetSky(JoglRenderer.this.name, JoglRenderer.this.rotate, JoglRenderer.this.axis); } }); } /** * @see jake2.client.refexport_t#EndRegistration() */ public void EndRegistration() { if (contextInUse) { impl.R_EndRegistration(); return; } updateScreen(new xcommand_t() { public void execute() { impl.R_EndRegistration(); } }); } /** * @see jake2.client.refexport_t#RenderFrame(jake2.client.refdef_t) */ public void RenderFrame(refdef_t fd) { impl.R_RenderFrame(fd); } /** * @see jake2.client.refexport_t#DrawGetPicSize(java.awt.Dimension, java.lang.String) */ public void DrawGetPicSize(Dimension dim, String name) { impl.Draw_GetPicSize(dim, name); } /** * @see jake2.client.refexport_t#DrawPic(int, int, java.lang.String) */ public void DrawPic(int x, int y, String name) { impl.Draw_Pic(x, y, name); } /** * @see jake2.client.refexport_t#DrawStretchPic(int, int, int, int, java.lang.String) */ public void DrawStretchPic(int x, int y, int w, int h, String name) { impl.Draw_StretchPic(x, y, w, h, name); } private int x, y, num; /** * @see jake2.client.refexport_t#DrawChar(int, int, int) */ public void DrawChar(int x, int y, int num) { if (contextInUse) { impl.Draw_Char(x, y, num);; return; } this.x = x; this.y = y; this.num = num; updateScreen(new xcommand_t() { public void execute() { impl.Draw_Char(JoglRenderer.this.x, JoglRenderer.this.y, JoglRenderer.this.num); } }); } /** * @see jake2.client.refexport_t#DrawTileClear(int, int, int, int, java.lang.String) */ public void DrawTileClear(int x, int y, int w, int h, String name) { impl.Draw_TileClear(x, y, w, h, name); } /** * @see jake2.client.refexport_t#DrawFill(int, int, int, int, int) */ public void DrawFill(int x, int y, int w, int h, int c) { impl.Draw_Fill(x, y, w, h, c); } /** * @see jake2.client.refexport_t#DrawFadeScreen() */ public void DrawFadeScreen() { impl.Draw_FadeScreen(); } /** * @see jake2.client.refexport_t#DrawStretchRaw(int, int, int, int, int, int, byte[]) */ public void DrawStretchRaw(int x, int y, int w, int h, int cols, int rows, byte[] data) { impl.Draw_StretchRaw(x, y, w, h, cols, rows, data); } /** * @see jake2.client.refexport_t#CinematicSetPalette(byte[]) */ public void CinematicSetPalette(byte[] palette) { impl.R_SetPalette(palette); } /** * @see jake2.client.refexport_t#BeginFrame(float) */ public void BeginFrame(float camera_separation) { impl.R_BeginFrame(camera_separation); } /** * @see jake2.client.refexport_t#EndFrame() */ public void EndFrame() { endFrame(); } /** * @see jake2.client.refexport_t#AppActivate(boolean) */ public void AppActivate(boolean activate) { appActivate(activate); } public int apiVersion() { return Defines.API_VERSION; } public KBD getKeyboardHandler() { return kbd; } // ============================================================================ // Ref interface // ============================================================================ public String getName() { return DRIVER_NAME; } public String toString() { return DRIVER_NAME; } public refexport_t GetRefAPI(RenderAPI renderer) { this.impl = renderer; return this; } } Index: Ref.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/Ref.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Ref.java 16 Jul 2004 10:11:34 -0000 1.2 --- Ref.java 21 Nov 2006 00:51:22 -0000 1.3 *************** *** 35,42 **** public interface Ref { ! // ============================================================================ ! // extensions (cwei) ! // ============================================================================ ! refexport_t GetRefAPI(); String getName(); } --- 35,39 ---- public interface Ref { ! refexport_t GetRefAPI(RenderAPI renderer); String getName(); } Index: glconfig_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/glconfig_t.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** glconfig_t.java 7 May 2005 18:23:26 -0000 1.2 --- glconfig_t.java 21 Nov 2006 00:51:22 -0000 1.3 *************** *** 37,41 **** public void parseOpenGLVersion() { ! version = Float.parseFloat(version_string.substring(0, 3)); } --- 37,45 ---- public void parseOpenGLVersion() { ! try { ! version = Float.parseFloat(version_string.substring(0, 3)); ! } catch (Exception e) { ! version = 1.1f; ! } } Index: Renderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/Renderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Renderer.java 12 Jan 2005 00:37:13 -0000 1.6 --- Renderer.java 21 Nov 2006 00:51:22 -0000 1.7 *************** *** 26,33 **** package jake2.render; - import java.util.Vector; - import jake2.client.refexport_t; /** * Renderer --- 26,33 ---- package jake2.render; import jake2.client.refexport_t; + import java.util.Vector; + /** * Renderer *************** *** 36,39 **** --- 36,42 ---- */ public class Renderer { + + static RenderAPI fastRenderer = new jake2.render.fast.Misc(); + static RenderAPI basicRenderer = new jake2.render.basic.Misc(); static Vector drivers = new Vector(3); *************** *** 41,62 **** static { try { ! try { ! Class.forName("net.java.games.jogl.GL"); ! Class.forName("jake2.render.JoglRenderer"); ! } catch (ClassNotFoundException e) { ! // ignore the jogl drivers if runtime not in classpath ! } ! try { Class.forName("org.lwjgl.opengl.GL11"); ! Class.forName("jake2.render.LWJGLRenderer"); } catch (ClassNotFoundException e) { // 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(); --- 44,65 ---- static { try { ! try { ! Class.forName("net.java.games.jogl.GL"); ! Class.forName("jake2.render.JoglRenderer"); ! } catch (ClassNotFoundException e) { ! // ignore the fastjogl drivers if runtime not in classpath ! } ! try { Class.forName("org.lwjgl.opengl.GL11"); ! Class.forName("jake2.render.LwjglRenderer"); } catch (ClassNotFoundException e) { // ignore the lwjgl driver if runtime not in classpath } ! try { ! Class.forName("javax.media.opengl.GL"); ! Class.forName("jake2.render.Jsr231Renderer"); ! } catch (ClassNotFoundException e) { ! // ignore the jogl drivers if runtime not in classpath ! } } catch (Throwable e) { e.printStackTrace(); *************** *** 73,81 **** } ! /** * Factory method to get the Renderer implementation. * @return refexport_t (Renderer singleton) */ ! public static refexport_t getDriver(String driverName) { // find a driver Ref driver = null; --- 76,92 ---- } ! /** ! * Factory method to get the Renderer implementation. ! * @return refexport_t (Renderer singleton) ! */ ! public static refexport_t getDriver(String driverName) { ! return getDriver(driverName, true); ! } ! ! /** * Factory method to get the Renderer implementation. * @return refexport_t (Renderer singleton) */ ! public static refexport_t getDriver(String driverName, boolean fast) { // find a driver Ref driver = null; *************** *** 84,88 **** driver = (Ref) drivers.get(i); if (driver.getName().equals(driverName)) { ! return driver.GetRefAPI(); } } --- 95,99 ---- driver = (Ref) drivers.get(i); if (driver.getName().equals(driverName)) { ! return driver.GetRefAPI((fast) ? fastRenderer : basicRenderer); } } *************** *** 108,110 **** --- 119,122 ---- return names; } + } \ No newline at end of file --- NEW FILE: Base.java --- /* * Base.java * Copyright (C) 2003 * * $Id: Base.java,v 1.2 2006/11/21 00:51:22 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.render; import jake2.client.refexport_t; import jake2.client.viddef_t; import jake2.game.cvar_t; import jake2.render.*; import jake2.render.opengl.*; import java.awt.Dimension; /** * Base * * @author dsanders/cwei */ public abstract class Base implements QGLConst, RenderAPI { public static final int GL_COLOR_INDEX8_EXT = GL_COLOR_INDEX; public static final String REF_VERSION = "GL 0.01"; // up / down public static final int PITCH = 0; // left / right public static final int YAW = 1; // fall over public static final int ROLL = 2; /* * skins will be outline flood filled and mip mapped pics and sprites with * alpha will be outline flood filled pic won't be mip mapped * * model skin sprite frame wall texture pic */ // enum imagetype_t public static final int it_skin = 0; public static final int it_sprite = 1; public static final int it_wall = 2; public static final int it_pic = 3; public static final int it_sky = 4; // enum modtype_t public static final int mod_bad = 0; public static final int mod_brush = 1; public static final int mod_sprite = 2; public static final int mod_alias = 3; public static final int TEXNUM_LIGHTMAPS = 1024; public static final int TEXNUM_SCRAPS = 1152; public static final int TEXNUM_IMAGES = 1153; public static final int MAX_GLTEXTURES = 1024; public static final int MAX_LBM_HEIGHT = 480; public static final float BACKFACE_EPSILON = 0.01f; /* * * GL config stuff */ public static final int GL_RENDERER_VOODOO = 0x00000001; public static final int GL_RENDERER_VOODOO2 = 0x00000002; public static final int GL_RENDERER_VOODOO_RUSH = 0x00000004; public static final int GL_RENDERER_BANSHEE = 0x00000008; public static final int GL_RENDERER_3DFX = 0x0000000F; public static final int GL_RENDERER_PCX1 = 0x00000010; public static final int GL_RENDERER_PCX2 = 0x00000020; public static final int GL_RENDERER_PMX = 0x00000040; public static final int GL_RENDERER_POWERVR = 0x00000070; public static final int GL_RENDERER_PERMEDIA2 = 0x00000100; public static final int GL_RENDERER_GLINT_MX = 0x00000200; public static final int GL_RENDERER_GLINT_TX = 0x00000400; public static final int GL_RENDERER_3DLABS_MISC = 0x00000800; public static final int GL_RENDERER_3DLABS = 0x00000F00; public static final int GL_RENDERER_REALIZM = 0x00001000; public static final int GL_RENDERER_REALIZM2 = 0x00002000; public static final int GL_RENDERER_INTERGRAPH = 0x00003000; public static final int GL_RENDERER_3DPRO = 0x00004000; public static final int GL_RENDERER_REAL3D = 0x00008000; public static final int GL_RENDERER_RIVA128 = 0x00010000; public static final int GL_RENDERER_DYPIC = 0x00020000; public static final int GL_RENDERER_V1000 = 0x00040000; public static final int GL_RENDERER_V2100 = 0x00080000; public static final int GL_RENDERER_V2200 = 0x00100000; public static final int GL_RENDERER_RENDITION = 0x001C0000; public static final int GL_RENDERER_O2 = 0x00100000; public static final int GL_RENDERER_IMPACT = 0x00200000; public static final int GL_RENDERER_RE = 0x00400000; public static final int GL_RENDERER_IR = 0x00800000; public static final int GL_RENDERER_SGI = 0x00F00000; public static final int GL_RENDERER_MCD = 0x01000000; public static final int GL_RENDERER_OTHER = 0x80000000; // enum rserr_t public static final int rserr_ok = 0; public static final int rserr_invalid_fullscreen = 1; public static final int rserr_invalid_mode = 2; public static final int rserr_unknown = 3; /* * base members */ protected static viddef_t vid = new viddef_t(); protected cvar_t vid_fullscreen; protected QGL gl; protected GLDriver glImpl; public void setGLDriver(GLDriver driver) { glImpl = driver; gl = (QGL)driver; } public static void setVid(int width, int height) { vid.width = width; vid.height = height; } } --- JoglBase.java DELETED --- |