From: Holger Z. <hz...@us...> - 2004-09-06 19:40:04
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/render/jogl Modified Files: Tag: r_0_9 Main.java Surf.java Misc.java Light.java Warp.java Base.java Model.java Draw.java Image.java Mesh.java Removed Files: Tag: r_0_9 Impl.java Log Message: merge changes for 0.9.3 Index: Image.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Image.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** Image.java 9 Jul 2004 08:38:26 -0000 1.2.2.1 --- Image.java 6 Sep 2004 19:39:17 -0000 1.2.2.2 *************** *** 27,32 **** --- 27,34 ---- import jake2.Defines; + import jake2.client.VID; import jake2.client.particle_t; import jake2.game.cvar_t; + import jake2.qcommon.*; import jake2.qcommon.longjmpException; import jake2.qcommon.qfiles; *************** *** 264,268 **** if (i == NUM_GL_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad filter name: [" + string + "]\n"); return; } --- 266,270 ---- if (i == NUM_GL_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad filter name: [" + string + "]\n"); return; } *************** *** 298,302 **** if (i == NUM_GL_ALPHA_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad alpha texture mode name: [" + string + "]\n"); return; } --- 300,304 ---- if (i == NUM_GL_ALPHA_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad alpha texture mode name: [" + string + "]\n"); return; } *************** *** 318,322 **** if (i == NUM_GL_SOLID_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad solid texture mode name: [" + string + "]\n"); return; } --- 320,324 ---- if (i == NUM_GL_SOLID_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad solid texture mode name: [" + string + "]\n"); return; } *************** *** 336,340 **** final String[] palstrings = { "RGB", "PAL" }; ! ri.Con_Printf(Defines.PRINT_ALL, "------------------\n"); texels = 0; --- 338,342 ---- final String[] palstrings = { "RGB", "PAL" }; ! VID.Printf(Defines.PRINT_ALL, "------------------\n"); texels = 0; *************** *** 347,367 **** switch (image.type) { case it_skin : ! ri.Con_Printf(Defines.PRINT_ALL, "M"); break; case it_sprite : ! ri.Con_Printf(Defines.PRINT_ALL, "S"); break; case it_wall : ! ri.Con_Printf(Defines.PRINT_ALL, "W"); break; case it_pic : ! ri.Con_Printf(Defines.PRINT_ALL, "P"); break; default : ! ri.Con_Printf(Defines.PRINT_ALL, " "); break; } ! ri.Con_Printf( Defines.PRINT_ALL, " %3i %3i %s: %s\n", --- 349,369 ---- switch (image.type) { case it_skin : ! VID.Printf(Defines.PRINT_ALL, "M"); break; case it_sprite : ! VID.Printf(Defines.PRINT_ALL, "S"); break; case it_wall : ! VID.Printf(Defines.PRINT_ALL, "W"); break; case it_pic : ! VID.Printf(Defines.PRINT_ALL, "P"); break; default : ! VID.Printf(Defines.PRINT_ALL, " "); break; } ! VID.Printf( Defines.PRINT_ALL, " %3i %3i %s: %s\n", *************** *** 369,373 **** image.name)); } ! ri.Con_Printf(Defines.PRINT_ALL, "Total texel count (not counting mipmaps): " + texels + '\n'); } --- 371,375 ---- image.name)); } ! VID.Printf(Defines.PRINT_ALL, "Total texel count (not counting mipmaps): " + texels + '\n'); } *************** *** 465,472 **** // load the file // ! byte[] raw = ri.FS_LoadFile(filename); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_DEVELOPER, "Bad pcx file " + filename + '\n'); return null; } --- 467,474 ---- // load the file // ! byte[] raw = FS.LoadFile(filename); if (raw == null) { ! VID.Printf(Defines.PRINT_DEVELOPER, "Bad pcx file " + filename + '\n'); return null; } *************** *** 484,488 **** || pcx.ymax >= 480) { ! ri.Con_Printf(Defines.PRINT_ALL, "Bad pcx file " + filename + '\n'); return null; } --- 486,490 ---- || pcx.ymax >= 480) { ! VID.Printf(Defines.PRINT_ALL, "Bad pcx file " + filename + '\n'); return null; } *************** *** 560,568 **** // load the file // ! raw = ri.FS_LoadFile (name); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_DEVELOPER, "Bad tga file "+ name +'\n'); return null; } --- 562,570 ---- // load the file // ! raw = FS.LoadFile (name); if (raw == null) { ! VID.Printf(Defines.PRINT_DEVELOPER, "Bad tga file "+ name +'\n'); return null; } *************** *** 571,578 **** if (targa_header.image_type != 2 && targa_header.image_type != 10) ! ri.Sys_Error(Defines.ERR_DROP, "LoadTGA: Only type 2 and 10 targa RGB images supported\n"); if (targa_header.colormap_type != 0 || (targa_header.pixel_size != 32 && targa_header.pixel_size != 24)) ! ri.Sys_Error (Defines.ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); columns = targa_header.width; --- 573,580 ---- if (targa_header.image_type != 2 && targa_header.image_type != 10) ! Com.Error(Defines.ERR_DROP, "LoadTGA: Only type 2 and 10 targa RGB images supported\n"); if (targa_header.colormap_type != 0 || (targa_header.pixel_size != 32 && targa_header.pixel_size != 24)) ! Com.Error (Defines.ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); columns = targa_header.width; *************** *** 762,779 **** // else if (pos[off] != 255) fdc = pos[off]; // } ! // TODO check this: R_FloodFillSkin( byte[] skin, int skinwidth, int skinheight) void R_FloodFillSkin(byte[] skin, int skinwidth, int skinheight) { // byte fillcolor = *skin; // assume this is the pixel to fill int fillcolor = skin[0] & 0xff; - floodfill_t[] fifo = new floodfill_t[FLOODFILL_FIFO_SIZE]; int inpt = 0, outpt = 0; int filledcolor = -1; int i; - for (int j = 0; j < fifo.length; j++) { - fifo[j] = new floodfill_t(); - } - if (filledcolor == -1) { filledcolor = 0; --- 764,781 ---- // else if (pos[off] != 255) fdc = pos[off]; // } ! static floodfill_t[] fifo = new floodfill_t[FLOODFILL_FIFO_SIZE]; ! static { ! for (int j = 0; j < fifo.length; j++) { ! fifo[j] = new floodfill_t(); ! } ! } // TODO check this: R_FloodFillSkin( byte[] skin, int skinwidth, int skinheight) void R_FloodFillSkin(byte[] skin, int skinwidth, int skinheight) { // byte fillcolor = *skin; // assume this is the pixel to fill int fillcolor = skin[0] & 0xff; int inpt = 0, outpt = 0; int filledcolor = -1; int i; if (filledcolor == -1) { filledcolor = 0; *************** *** 1102,1106 **** if (scaled_width * scaled_height > 256 * 256) ! ri.Sys_Error(Defines.ERR_DROP, "GL_Upload32: too big"); // scan the texture for any non-255 alpha --- 1104,1108 ---- if (scaled_width * scaled_height > 256 * 256) ! Com.Error(Defines.ERR_DROP, "GL_Upload32: too big"); // scan the texture for any non-255 alpha *************** *** 1120,1124 **** comp = gl_tex_alpha_format; else { ! ri.Con_Printf(Defines.PRINT_ALL, "Unknown number of texture components " + samples + '\n'); comp = samples; } --- 1122,1126 ---- comp = gl_tex_alpha_format; else { ! VID.Printf(Defines.PRINT_ALL, "Unknown number of texture components " + samples + '\n'); comp = samples; } *************** *** 1263,1267 **** if (s > trans.length) ! ri.Sys_Error(Defines.ERR_DROP, "GL_Upload8: too large"); if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { --- 1265,1269 ---- if (s > trans.length) ! Com.Error(Defines.ERR_DROP, "GL_Upload8: too large"); if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { *************** *** 1330,1334 **** { if (numgltextures == MAX_GLTEXTURES) ! ri.Sys_Error (Defines.ERR_DROP, "MAX_GLTEXTURES"); numgltextures++; --- 1332,1336 ---- { if (numgltextures == MAX_GLTEXTURES) ! Com.Error (Defines.ERR_DROP, "MAX_GLTEXTURES"); numgltextures++; *************** *** 1337,1341 **** if (name.length() > Defines.MAX_QPATH) ! ri.Sys_Error(Defines.ERR_DROP, "Draw_LoadPic: \"" + name + "\" is too long"); image.name = name; --- 1339,1343 ---- if (name.length() > Defines.MAX_QPATH) ! Com.Error(Defines.ERR_DROP, "Draw_LoadPic: \"" + name + "\" is too long"); image.name = name; *************** *** 1453,1459 **** image_t image = null; ! byte[] raw = ri.FS_LoadFile(name); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "GL_FindImage: can't load " + name + '\n'); return r_notexture; } --- 1455,1461 ---- image_t image = null; ! byte[] raw = FS.LoadFile(name); if (raw == null) { ! VID.Printf(Defines.PRINT_ALL, "GL_FindImage: can't load " + name + '\n'); return r_notexture; } *************** *** 1487,1492 **** if (name == null || name.length() < 5) ! return null; // ri.Sys_Error (ERR_DROP, "GL_FindImage: NULL name"); ! // ri.Sys_Error (ERR_DROP, "GL_FindImage: bad name: %s", name); // look for it --- 1489,1494 ---- if (name == null || name.length() < 5) ! return null; // Com.Error (ERR_DROP, "GL_FindImage: NULL name"); ! // Com.Error (ERR_DROP, "GL_FindImage: bad name: %s", name); // look for it *************** *** 1596,1600 **** if (palette[0] == null || palette[0].length != 768) ! ri.Sys_Error(Defines.ERR_FATAL, "Couldn't load pics/colormap.pcx"); byte[] pal = palette[0]; --- 1598,1602 ---- if (palette[0] == null || palette[0].length != 768) ! Com.Error(Defines.ERR_FATAL, "Couldn't load pics/colormap.pcx"); byte[] pal = palette[0]; *************** *** 1626,1633 **** // init intensity conversions ! intensity = ri.Cvar_Get("intensity", "2", 0); if (intensity.value <= 1) ! ri.Cvar_Set("intensity", "1"); gl_state.inverse_intensity = 1 / intensity.value; --- 1628,1635 ---- // init intensity conversions ! intensity = Cvar.Get("intensity", "2", 0); if (intensity.value <= 1) ! Cvar.Set("intensity", "1"); gl_state.inverse_intensity = 1 / intensity.value; *************** *** 1636,1642 **** if (qglColorTableEXT) { ! gl_state.d_16to8table = ri.FS_LoadFile("pics/16to8.dat"); if (gl_state.d_16to8table == null) ! ri.Sys_Error(Defines.ERR_FATAL, "Couldn't load pics/16to8.pcx"); } --- 1638,1644 ---- if (qglColorTableEXT) { ! gl_state.d_16to8table = FS.LoadFile("pics/16to8.dat"); if (gl_state.d_16to8table == null) ! Com.Error(Defines.ERR_FATAL, "Couldn't load pics/16to8.pcx"); } Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Surf.java,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** Surf.java 9 Jul 2004 08:38:26 -0000 1.2.2.2 --- Surf.java 6 Sep 2004 19:39:16 -0000 1.2.2.3 *************** *** 29,32 **** --- 29,33 ---- import jake2.client.*; import jake2.game.cplane_t; + import jake2.qcommon.Com; import jake2.render.*; import jake2.util.Lib; *************** *** 425,429 **** if ( !LM_AllocBlock( smax, tmax, lightPos) ) { ! ri.Sys_Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax + "," + tmax + ") failed (dynamic)\n"); } --- 426,430 ---- if ( !LM_AllocBlock( smax, tmax, lightPos) ) { ! Com.Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax + "," + tmax + ") failed (dynamic)\n"); } *************** *** 1205,1209 **** { entity_t ent = new entity_t(); ! if (r_drawworld.value == 0) return; --- 1206,1213 ---- { entity_t ent = new entity_t(); ! // auto cycle the world frame for texture animation ! ent.frame = (int)(r_newrefdef.time*2); ! currententity = ent; ! if (r_drawworld.value == 0) return; *************** *** 1216,1224 **** Math3D.VectorCopy(r_newrefdef.vieworg, modelorg); - // auto cycle the world frame for texture animation - // memset (&ent, 0, sizeof(ent)); - ent.frame = (int)(r_newrefdef.time*2); - currententity = ent; - gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; --- 1220,1223 ---- *************** *** 1408,1412 **** gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) ! ri.Sys_Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); --- 1407,1411 ---- gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) ! Com.Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); *************** *** 1559,1563 **** if ( !LM_AllocBlock( smax, tmax, lightPos ) ) { ! ri.Sys_Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax +"," + tmax +") failed\n"); } } --- 1558,1562 ---- if ( !LM_AllocBlock( smax, tmax, lightPos ) ) { ! Com.Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax +"," + tmax +") failed\n"); } } Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Light.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** Light.java 9 Jul 2004 08:38:26 -0000 1.3.2.1 --- Light.java 6 Sep 2004 19:39:16 -0000 1.3.2.2 *************** *** 32,35 **** --- 32,36 ---- import jake2.game.GameBase; import jake2.game.cplane_t; + import jake2.qcommon.Com; import jake2.qcommon.longjmpException; import jake2.render.*; *************** *** 231,239 **** int RecursiveLightPoint (mnode_t node, float[] start, float[] end) { ! float front, back, frac; ! boolean side; ! int sideIndex; ! cplane_t plane; ! float[] mid = {0, 0, 0}; msurface_t surf; int s, t, ds, dt; --- 232,238 ---- int RecursiveLightPoint (mnode_t node, float[] start, float[] end) { ! if (node.contents != -1) ! return -1; // didn't hit anything ! msurface_t surf; int s, t, ds, dt; *************** *** 242,263 **** ByteBuffer lightmap; int maps; ! int r; ! ! if (node.contents != -1) ! return -1; // didn't hit anything // calculate mid point // FIXME: optimize for axial ! plane = node.plane; ! front = Math3D.DotProduct (start, plane.normal) - plane.dist; ! back = Math3D.DotProduct (end, plane.normal) - plane.dist; ! side = (front < 0); ! sideIndex = (side) ? 1 : 0; if ( (back < 0) == side) return RecursiveLightPoint (node.children[sideIndex], start, end); ! frac = front / (front-back); mid[0] = start[0] + (end[0] - start[0])*frac; mid[1] = start[1] + (end[1] - start[1])*frac; --- 241,259 ---- ByteBuffer lightmap; int maps; ! float[] mid = {0, 0, 0}; // calculate mid point // FIXME: optimize for axial ! cplane_t plane = node.plane; ! float front = Math3D.DotProduct (start, plane.normal) - plane.dist; ! float back = Math3D.DotProduct (end, plane.normal) - plane.dist; ! boolean side = (front < 0); ! int sideIndex = (side) ? 1 : 0; if ( (back < 0) == side) return RecursiveLightPoint (node.children[sideIndex], start, end); ! float frac = front / (front-back); mid[0] = start[0] + (end[0] - start[0])*frac; mid[1] = start[1] + (end[1] - start[1])*frac; *************** *** 265,269 **** // go down front side ! r = RecursiveLightPoint (node.children[sideIndex], start, mid); if (r >= 0) return r; // hit something --- 261,265 ---- // go down front side ! int r = RecursiveLightPoint (node.children[sideIndex], start, mid); if (r >= 0) return r; // hit something *************** *** 277,280 **** --- 273,277 ---- int surfIndex = node.firstsurface; + float[] scale = {0, 0, 0}; for (i=0 ; i<node.numsurfaces ; i++, surfIndex++) { *************** *** 310,320 **** if (lightmap != null) { ! float[] scale = {0, 0, 0}; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255; maps++) { ! for (i=0 ; i<3 ; i++) ! scale[i] = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; pointcolor[0] += (lightmap.get(lightmapIndex + 0) & 0xFF) * scale[0] * (1.0f/255); --- 307,320 ---- if (lightmap != null) { ! //float[] scale = {0, 0, 0}; ! float[] rgb; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255; maps++) { ! rgb = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb; ! scale[0] = gl_modulate.value * rgb[0]; ! scale[1] = gl_modulate.value * rgb[1]; ! scale[2] = gl_modulate.value * rgb[2]; pointcolor[0] += (lightmap.get(lightmapIndex + 0) & 0xFF) * scale[0] * (1.0f/255); *************** *** 326,329 **** --- 326,330 ---- return 1; } + // go down back side return RecursiveLightPoint (node.children[1 - sideIndex], mid, end); *************** *** 341,349 **** float[] end = {0, 0, 0}; - float r; - int lnum; dlight_t dl; - float light; - float[] dist = {0, 0, 0}; float add; --- 342,346 ---- *************** *** 358,362 **** end[2] = p[2] - 2048; ! r = RecursiveLightPoint(r_worldmodel.nodes[0], p, end); if (r == -1) --- 355,359 ---- end[2] = p[2] - 2048; ! float r = RecursiveLightPoint(r_worldmodel.nodes[0], p, end); if (r == -1) *************** *** 372,382 **** // add dynamic lights // ! light = 0; ! for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { dl = r_newrefdef.dlights[lnum]; ! Math3D.VectorSubtract (currententity.origin, dl.origin, dist); ! add = dl.intensity - Math3D.VectorLength(dist); add *= (1.0f/256); if (add > 0) --- 369,378 ---- // add dynamic lights // ! for (int lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { dl = r_newrefdef.dlights[lnum]; ! Math3D.VectorSubtract (currententity.origin, dl.origin, end); ! add = dl.intensity - Math3D.VectorLength(end); add *= (1.0f/256); if (add > 0) *************** *** 389,393 **** } - // =================================================================== --- 385,388 ---- *************** *** 510,514 **** if ( (surf.texinfo.flags & (Defines.SURF_SKY | Defines.SURF_TRANS33 | Defines.SURF_TRANS66 | Defines.SURF_WARP)) != 0 ) ! ri.Sys_Error(Defines.ERR_DROP, "R_BuildLightMap called for non-lit surface"); smax = (surf.extents[0] >> 4) + 1; --- 505,509 ---- if ( (surf.texinfo.flags & (Defines.SURF_SKY | Defines.SURF_TRANS33 | Defines.SURF_TRANS66 | Defines.SURF_WARP)) != 0 ) ! Com.Error(Defines.ERR_DROP, "R_BuildLightMap called for non-lit surface"); smax = (surf.extents[0] >> 4) + 1; *************** *** 516,520 **** size = smax * tmax; if (size > ((s_blocklights.length * Defines.SIZE_OF_FLOAT) >> 4) ) ! ri.Sys_Error(Defines.ERR_DROP, "Bad s_blocklights size"); try { --- 511,515 ---- size = smax * tmax; if (size > ((s_blocklights.length * Defines.SIZE_OF_FLOAT) >> 4) ) ! Com.Error(Defines.ERR_DROP, "Bad s_blocklights size"); try { --- Impl.java DELETED --- Index: Base.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Base.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** Base.java 7 Jul 2004 19:59:36 -0000 1.1.1.1 --- Base.java 6 Sep 2004 19:39:16 -0000 1.1.1.1.2.1 *************** *** 26,29 **** --- 26,30 ---- package jake2.render.jogl; + import jake2.render.JoglBase; import net.java.games.jogl.GL; *************** *** 33,37 **** * @author cwei */ ! public class Base { static final int GL_COLOR_INDEX8_EXT = GL.GL_COLOR_INDEX; --- 34,38 ---- * @author cwei */ ! public abstract class Base extends JoglBase { static final int GL_COLOR_INDEX8_EXT = GL.GL_COLOR_INDEX; *************** *** 76,85 **** // =================================================================== - // enum rserr_t - static final int rserr_ok = 0; - static final int rserr_invalid_fullscreen = 1; - static final int rserr_invalid_mode = 2; - static final int rserr_unknown = 3; - // // #include "gl_model.h" --- 77,80 ---- Index: Draw.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Draw.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** Draw.java 9 Jul 2004 08:38:26 -0000 1.2.2.1 --- Draw.java 6 Sep 2004 19:39:17 -0000 1.2.2.2 *************** *** 27,31 **** import jake2.Defines; ! import jake2.Globals; import jake2.render.image_t; --- 27,32 ---- import jake2.Defines; ! import jake2.client.VID; ! import jake2.qcommon.Com; import jake2.render.image_t; *************** *** 33,37 **** import net.java.games.jogl.GL; - import net.java.games.jogl.util.GLUT; /** --- 34,37 ---- *************** *** 139,143 **** if (image == null) { ! ri.Con_Printf (Defines.PRINT_ALL, "Can't find pic: " + pic +'\n'); return; } --- 139,143 ---- if (image == null) { ! VID.Printf (Defines.PRINT_ALL, "Can't find pic: " + pic +'\n'); return; } *************** *** 178,182 **** if (image == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "Can't find pic: " +pic + '\n'); return; } --- 178,182 ---- if (image == null) { ! VID.Printf(Defines.PRINT_ALL, "Can't find pic: " +pic + '\n'); return; } *************** *** 218,222 **** if (image == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "Can't find pic: " + pic + '\n'); return; } --- 218,222 ---- if (image == null) { ! VID.Printf(Defines.PRINT_ALL, "Can't find pic: " + pic + '\n'); return; } *************** *** 252,256 **** if ( colorIndex > 255) ! ri.Sys_Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); gl.glDisable(GL.GL_TEXTURE_2D); --- 252,256 ---- if ( colorIndex > 255) ! Com.Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); gl.glDisable(GL.GL_TEXTURE_2D); Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Model.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** Model.java 7 Jul 2004 19:59:42 -0000 1.1.1.1 --- Model.java 6 Sep 2004 19:39:16 -0000 1.1.1.1.2.1 *************** *** 26,51 **** package jake2.render.jogl; - import java.nio.ByteBuffer; - import java.nio.ByteOrder; - import java.util.Arrays; - import java.util.Vector; - import jake2.Defines; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.lump_t; ! import jake2.qcommon.qfiles; ! import jake2.qcommon.texinfo_t; ! import jake2.render.medge_t; ! import jake2.render.mleaf_t; ! import jake2.render.mmodel_t; ! import jake2.render.mnode_t; ! import jake2.render.model_t; ! import jake2.render.msurface_t; ! import jake2.render.mtexinfo_t; ! import jake2.render.mvertex_t; import jake2.util.Math3D; import jake2.util.Vargs; /** * Model --- 26,42 ---- package jake2.render.jogl; import jake2.Defines; + import jake2.client.VID; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.*; ! import jake2.render.*; import jake2.util.Math3D; import jake2.util.Vargs; + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.util.Arrays; + /** * Model *************** *** 83,87 **** if (model == null || model.nodes == null) ! ri.Sys_Error (Defines.ERR_DROP, "Mod_PointInLeaf: bad model"); node = model.nodes[0]; // root node --- 74,78 ---- if (model == null || model.nodes == null) ! Com.Error (Defines.ERR_DROP, "Mod_PointInLeaf: bad model"); node = model.nodes[0]; // root node *************** *** 180,184 **** total = 0; ! ri.Con_Printf(Defines.PRINT_ALL,"Loaded models:\n"); for (i=0; i < mod_numknown ; i++) { --- 171,175 ---- total = 0; ! VID.Printf(Defines.PRINT_ALL,"Loaded models:\n"); for (i=0; i < mod_numknown ; i++) { *************** *** 187,194 **** continue; ! ri.Con_Printf (Defines.PRINT_ALL, "%8i : %s\n", new Vargs(2).add(mod.extradatasize).add(mod.name)); total += mod.extradatasize; } ! ri.Con_Printf (Defines.PRINT_ALL, "Total resident: " + total +'\n'); } --- 178,185 ---- continue; ! VID.Printf (Defines.PRINT_ALL, "%8i : %s\n", new Vargs(2).add(mod.extradatasize).add(mod.name)); total += mod.extradatasize; } ! VID.Printf (Defines.PRINT_ALL, "Total resident: " + total +'\n'); } *************** *** 222,226 **** if (name == null || name.length() == 0) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_ForName: NULL name"); // --- 213,217 ---- if (name == null || name.length() == 0) ! Com.Error(Defines.ERR_DROP, "Mod_ForName: NULL name"); // *************** *** 231,235 **** i = Integer.parseInt(name.substring(1)); if (i < 1 || r_worldmodel == null || i >= r_worldmodel.numsubmodels) ! ri.Sys_Error (Defines.ERR_DROP, "bad inline model number"); return mod_inline[i]; } --- 222,226 ---- i = Integer.parseInt(name.substring(1)); if (i < 1 || r_worldmodel == null || i >= r_worldmodel.numsubmodels) ! Com.Error (Defines.ERR_DROP, "bad inline model number"); return mod_inline[i]; } *************** *** 261,265 **** { if (mod_numknown == MAX_MOD_KNOWN) ! ri.Sys_Error (Defines.ERR_DROP, "mod_numknown == MAX_MOD_KNOWN"); mod_numknown++; mod = mod_known[i]; --- 252,256 ---- { if (mod_numknown == MAX_MOD_KNOWN) ! Com.Error (Defines.ERR_DROP, "mod_numknown == MAX_MOD_KNOWN"); mod_numknown++; mod = mod_known[i]; *************** *** 271,280 **** // load the file // ! fileBuffer = ri.FS_LoadFile(name); if (fileBuffer == null) { if (crash) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_NumForName: " + mod.name + " not found"); mod.name = ""; --- 262,271 ---- // load the file // ! fileBuffer = FS.LoadFile(name); if (fileBuffer == null) { if (crash) ! Com.Error(Defines.ERR_DROP, "Mod_NumForName: " + mod.name + " not found"); mod.name = ""; *************** *** 311,315 **** break; default: ! ri.Sys_Error(Defines.ERR_DROP,"Mod_NumForName: unknown fileid for " + mod.name); break; } --- 302,306 ---- break; default: ! Com.Error(Defines.ERR_DROP,"Mod_NumForName: unknown fileid for " + mod.name); break; } *************** *** 393,397 **** if ( (l.filelen % mvertex_t.DISK_SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / mvertex_t.DISK_SIZE; --- 384,388 ---- if ( (l.filelen % mvertex_t.DISK_SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / mvertex_t.DISK_SIZE; *************** *** 440,444 **** if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dmodel_t.SIZE; --- 431,435 ---- if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dmodel_t.SIZE; *************** *** 480,484 **** if ( (l.filelen % medge_t.DISK_SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / medge_t.DISK_SIZE; --- 471,475 ---- if ( (l.filelen % medge_t.DISK_SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / medge_t.DISK_SIZE; *************** *** 513,521 **** if ((l.filelen % texinfo_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / texinfo_t.SIZE; // out = Hunk_Alloc ( count*sizeof(*out)); out = new mtexinfo_t[count]; loadmodel.texinfo = out; --- 504,515 ---- if ((l.filelen % texinfo_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / texinfo_t.SIZE; // out = Hunk_Alloc ( count*sizeof(*out)); out = new mtexinfo_t[count]; + for ( i=0 ; i<count ; i++) { + out[i] = new mtexinfo_t(); + } loadmodel.texinfo = out; *************** *** 525,535 **** bb.order(ByteOrder.LITTLE_ENDIAN); ! for ( i=0 ; i<count ; i++) ! { ! in = new texinfo_t(bb); ! out[i] = new mtexinfo_t(); ! //for (j=0 ; j<8 ; j++) ! out[i].vecs = in.vecs; out[i].flags = in.flags; next = in.nexttexinfo; --- 519,526 ---- bb.order(ByteOrder.LITTLE_ENDIAN); ! for ( i=0 ; i<count ; i++) { + in = new texinfo_t(bb); + out[i].vecs = in.vecs; out[i].flags = in.flags; next = in.nexttexinfo; *************** *** 542,548 **** out[i].image = GL_FindImage(name, it_wall); ! if (out[i].image == null) ! { ! ri.Con_Printf(Defines.PRINT_ALL, "Couldn't load " + name + '\n'); out[i].image = r_notexture; } --- 533,538 ---- out[i].image = GL_FindImage(name, it_wall); ! if (out[i].image == null) { ! VID.Printf(Defines.PRINT_ALL, "Couldn't load " + name + '\n'); out[i].image = r_notexture; } *************** *** 550,556 **** // count animation frames ! for (i=0 ; i<count ; i++) ! { ! // out = &loadmodel.texinfo[i]; out[i].numframes = 1; for (step = out[i].next ; (step != null) && (step != out[i]) ; step=step.next) --- 540,544 ---- // count animation frames ! for (i=0 ; i<count ; i++) { out[i].numframes = 1; for (step = out[i].next ; (step != null) && (step != out[i]) ; step=step.next) *************** *** 572,578 **** float val; ! int i, j, e; mvertex_t v; - mtexinfo_t tex; int[] bmins = {0, 0}; int[] bmaxs = {0, 0}; --- 560,565 ---- float val; ! int j, e; mvertex_t v; int[] bmins = {0, 0}; int[] bmaxs = {0, 0}; *************** *** 581,587 **** maxs[0] = maxs[1] = -99999; ! tex = s.texinfo; ! for (i=0 ; i<s.numedges ; i++) { e = loadmodel.surfedges[s.firstedge+i]; --- 568,574 ---- maxs[0] = maxs[1] = -99999; ! mtexinfo_t tex = s.texinfo; ! for (int i=0 ; i<s.numedges ; i++) { e = loadmodel.surfedges[s.firstedge+i]; *************** *** 604,608 **** } ! for (i=0 ; i<2 ; i++) { bmins[i] = (int)Math.floor(mins[i]/16); --- 591,595 ---- } ! for (int i=0 ; i<2 ; i++) { bmins[i] = (int)Math.floor(mins[i]/16); *************** *** 629,633 **** if ((l.filelen % qfiles.dface_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dface_t.SIZE; --- 616,620 ---- if ((l.filelen % qfiles.dface_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dface_t.SIZE; *************** *** 663,667 **** ti = in.texinfo; if (ti < 0 || ti >= loadmodel.numtexinfo) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: bad texinfo number"); out[surfnum].texinfo = loadmodel.texinfo[ti]; --- 650,654 ---- ti = in.texinfo; if (ti < 0 || ti >= loadmodel.numtexinfo) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: bad texinfo number"); out[surfnum].texinfo = loadmodel.texinfo[ti]; *************** *** 735,739 **** if ((l.filelen % qfiles.dnode_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dnode_t.SIZE; --- 722,726 ---- if ((l.filelen % qfiles.dnode_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dnode_t.SIZE; *************** *** 792,796 **** if ((l.filelen % qfiles.dleaf_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dleaf_t.SIZE; --- 779,783 ---- if ((l.filelen % qfiles.dleaf_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dleaf_t.SIZE; *************** *** 837,841 **** if ((l.filelen % Defines.SIZE_OF_SHORT) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_SHORT; // out = Hunk_Alloc ( count*sizeof(*out)); --- 824,828 ---- if ((l.filelen % Defines.SIZE_OF_SHORT) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_SHORT; // out = Hunk_Alloc ( count*sizeof(*out)); *************** *** 852,856 **** j = bb.getShort(); if (j < 0 || j >= loadmodel.numsurfaces) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_ParseMarksurfaces: bad surface number"); out[i] = loadmodel.surfaces[j]; --- 839,843 ---- j = bb.getShort(); if (j < 0 || j >= loadmodel.numsurfaces) ! Com.Error(Defines.ERR_DROP, "Mod_ParseMarksurfaces: bad surface number"); out[i] = loadmodel.surfaces[j]; *************** *** 870,878 **** if ( (l.filelen % Defines.SIZE_OF_INT) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_INT; if (count < 1 || count >= Defines.MAX_MAP_SURFEDGES) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: bad surfedges count in " + loadmodel.name + ": " + count); offsets = new int[count]; --- 857,865 ---- if ( (l.filelen % Defines.SIZE_OF_INT) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_INT; if (count < 1 || count >= Defines.MAX_MAP_SURFEDGES) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: bad surfedges count in " + loadmodel.name + ": " + count); offsets = new int[count]; *************** *** 902,906 **** if ((l.filelen % qfiles.dplane_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dplane_t.SIZE; --- 889,893 ---- if ((l.filelen % qfiles.dplane_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dplane_t.SIZE; *************** *** 945,949 **** loadmodel.type = mod_brush; if (loadmodel != mod_known[0]) ! ri.Sys_Error(Defines.ERR_DROP, "Loaded a brush model after the world"); header = new qfiles.dheader_t(buffer); --- 932,936 ---- loadmodel.type = mod_brush; if (loadmodel != mod_known[0]) ! Com.Error(Defines.ERR_DROP, "Loaded a brush model after the world"); header = new qfiles.dheader_t(buffer); *************** *** 951,955 **** i = header.version; if (i != Defines.BSPVERSION) ! ri.Sys_Error (Defines.ERR_DROP, "Mod_LoadBrushModel: " + mod.name + " has wrong version number (" + i + " should be " + Defines.BSPVERSION + ")"); mod_base = fileBuffer; //(byte *)header; --- 938,942 ---- i = header.version; if (i != Defines.BSPVERSION) ! Com.Error (Defines.ERR_DROP, "Mod_LoadBrushModel: " + mod.name + " has wrong version number (" + i + " should be " + Defines.BSPVERSION + ")"); mod_base = fileBuffer; //(byte *)header; *************** *** 985,989 **** starmod.firstnode = bm.headnode; if (starmod.firstnode >= loadmodel.numnodes) ! ri.Sys_Error(Defines.ERR_DROP, "Inline model " + i + " has bad firstnode"); Math3D.VectorCopy(bm.maxs, starmod.maxs); --- 972,976 ---- starmod.firstnode = bm.headnode; if (starmod.firstnode >= loadmodel.numnodes) ! Com.Error(Defines.ERR_DROP, "Inline model " + i + " has bad firstnode"); Math3D.VectorCopy(bm.maxs, starmod.maxs); *************** *** 1023,1046 **** if (pheader.version != qfiles.ALIAS_VERSION) ! ri.Sys_Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(pheader.version).add(qfiles.ALIAS_VERSION)); if (pheader.skinheight > MAX_LBM_HEIGHT) ! ri.Sys_Error(Defines.ERR_DROP, "model "+ mod.name +" has a skin taller than " + MAX_LBM_HEIGHT); if (pheader.num_xyz <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no vertices"); if (pheader.num_xyz > qfiles.MAX_VERTS) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name +" has too many vertices"); if (pheader.num_st <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no st vertices"); if (pheader.num_tris <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no triangles"); if (pheader.num_frames <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no frames"); // --- 1010,1033 ---- if (pheader.version != qfiles.ALIAS_VERSION) ! Com.Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(pheader.version).add(qfiles.ALIAS_VERSION)); if (pheader.skinheight > MAX_LBM_HEIGHT) ! Com.Error(Defines.ERR_DROP, "model "+ mod.name +" has a skin taller than " + MAX_LBM_HEIGHT); if (pheader.num_xyz <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no vertices"); if (pheader.num_xyz > qfiles.MAX_VERTS) ! Com.Error(Defines.ERR_DROP, "model " + mod.name +" has too many vertices"); if (pheader.num_st <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no st vertices"); if (pheader.num_tris <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no triangles"); if (pheader.num_frames <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no frames"); // *************** *** 1135,1143 **** if (sprout.version != qfiles.SPRITE_VERSION) ! ri.Sys_Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(sprout.version).add(qfiles.SPRITE_VERSION)); if (sprout.numframes > qfiles.MAX_MD2SKINS) ! ri.Sys_Error(Defines.ERR_DROP, "%s has too many frames (%i > %i)", new Vargs(3).add(mod.name).add(sprout.numframes).add(qfiles.MAX_MD2SKINS)); --- 1122,1130 ---- if (sprout.version != qfiles.SPRITE_VERSION) ! Com.Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(sprout.version).add(qfiles.SPRITE_VERSION)); if (sprout.numframes > qfiles.MAX_MD2SKINS) ! Com.Error(Defines.ERR_DROP, "%s has too many frames (%i > %i)", new Vargs(3).add(mod.name).add(sprout.numframes).add(qfiles.MAX_MD2SKINS)); *************** *** 1171,1175 **** // explicitly free the old map if different // this guarantees that mod_known[0] is the world map ! flushmap = ri.Cvar_Get("flushmap", "0", 0); if ( !mod_known[0].name.equals(fullname) || flushmap.value != 0.0f) Mod_Free(mod_known[0]); --- 1158,1162 ---- // explicitly free the old map if different // this guarantees that mod_known[0] is the world map ! flushmap = Cvar.Get("flushmap", "0", 0); if ( !mod_known[0].name.equals(fullname) || flushmap.value != 0.0f) Mod_Free(mod_known[0]); Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Main.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** Main.java 9 Jul 2004 08:38:26 -0000 1.2.2.1 --- Main.java 6 Sep 2004 19:39:16 -0000 1.2.2.2 *************** *** 26,36 **** package jake2.render.jogl; ! import jake2.*; import jake2.client.*; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.Cvar; ! import jake2.qcommon.qfiles; ! import jake2.qcommon.xcommand_t; import jake2.render.*; import jake2.util.Math3D; --- 26,36 ---- package jake2.render.jogl; ! import jake2.Defines; ! import jake2.Globals; import jake2.client.*; + import jake2.game.*; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.*; import jake2.render.*; import jake2.util.Math3D; *************** *** 42,48 **** import net.java.games.jogl.GL; - import net.java.games.jogl.GLU; - import net.java.games.jogl.util.BufferUtils; - import net.java.games.jogl.util.GLUT; /** --- 42,45 ---- *************** *** 53,60 **** public abstract class Main extends Base { - GL gl; - GLU glu; - GLUT glut = new GLUT(); - public static int[] d_8to24table = new int[256]; --- 50,53 ---- *************** *** 87,99 **** abstract mleaf_t Mod_PointInLeaf(float[] point, model_t model); - abstract boolean QGL_Init(String dll_name); - abstract void QGL_Shutdown(); - abstract boolean GLimp_Init(int xpos, int ypos); - abstract void GLimp_BeginFrame(float camera_separation); - abstract int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen); - abstract void GLimp_Shutdown(); - abstract void GLimp_EnableLogging(boolean enable); - abstract void GLimp_LogNewFrame(); - abstract void GL_SetDefaultState(); --- 80,83 ---- *************** *** 129,140 **** */ - // IMPORTED FUNCTIONS - protected refimport_t ri = null; - int GL_TEXTURE0 = GL.GL_TEXTURE0; int GL_TEXTURE1 = GL.GL_TEXTURE1; - viddef_t vid = new viddef_t(); - model_t r_worldmodel; --- 113,119 ---- *************** *** 239,243 **** cvar_t gl_3dlabs_broken; - cvar_t vid_fullscreen; cvar_t vid_gamma; cvar_t vid_ref; --- 218,221 ---- *************** *** 443,447 **** break; default : ! ri.Sys_Error(Defines.ERR_DROP, "Bad modeltype"); break; } --- 421,425 ---- break; default : ! Com.Error(Defines.ERR_DROP, "Bad modeltype"); break; } *************** *** 477,481 **** break; default : ! ri.Sys_Error(Defines.ERR_DROP, "Bad modeltype"); break; } --- 455,459 ---- break; default : ! Com.Error(Defines.ERR_DROP, "Bad modeltype"); break; } *************** *** 849,857 **** // included by cwei if (r_newrefdef == null) { ! ri.Sys_Error(Defines.ERR_DROP, "R_RenderView: refdef_t fd is null"); } if (r_worldmodel == null && (r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) ! ri.Sys_Error(Defines.ERR_DROP, "R_RenderView: NULL worldmodel"); if (r_speeds.value != 0.0f) { --- 827,835 ---- // included by cwei if (r_newrefdef == null) { ! Com.Error(Defines.ERR_DROP, "R_RenderView: refdef_t fd is null"); } if (r_worldmodel == null && (r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) ! Com.Error(Defines.ERR_DROP, "R_RenderView: NULL worldmodel"); if (r_speeds.value != 0.0f) { *************** *** 886,890 **** if (r_speeds.value != 0.0f) { ! ri.Con_Printf( Defines.PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n", --- 864,868 ---- if (r_speeds.value != 0.0f) { ! VID.Printf( Defines.PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n", *************** *** 953,1024 **** protected void R_Register() { ! r_lefthand = ri.Cvar_Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); ! r_norefresh = ri.Cvar_Get("r_norefresh", "0", 0); ! r_fullbright = ri.Cvar_Get("r_fullbright", "0", 0); ! r_drawentities = ri.Cvar_Get("r_drawentities", "1", 0); ! r_drawworld = ri.Cvar_Get("r_drawworld", "1", 0); ! r_novis = ri.Cvar_Get("r_novis", "0", 0); ! r_nocull = ri.Cvar_Get("r_nocull", "0", 0); ! r_lerpmodels = ri.Cvar_Get("r_lerpmodels", "1", 0); ! r_speeds = ri.Cvar_Get("r_speeds", "0", 0); ! r_lightlevel = ri.Cvar_Get("r_lightlevel", "1", 0); ! gl_nosubimage = ri.Cvar_Get("gl_nosubimage", "0", 0); ! gl_allow_software = ri.Cvar_Get("gl_allow_software", "0", 0); ! gl_particle_min_size = ri.Cvar_Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE); ! gl_particle_max_size = ri.Cvar_Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_size = ri.Cvar_Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_att_a = ri.Cvar_Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE); ! gl_particle_att_b = ri.Cvar_Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE); ! gl_particle_att_c = ri.Cvar_Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = ri.Cvar_Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); ! gl_log = ri.Cvar_Get("gl_log", "0", 0); ! gl_bitdepth = ri.Cvar_Get("gl_bitdepth", "0", 0); ! gl_mode = ri.Cvar_Get("gl_mode", "1", Globals.CVAR_ARCHIVE); ! gl_lightmap = ri.Cvar_Get("gl_lightmap", "0", 0); ! gl_shadows = ri.Cvar_Get("gl_shadows", "0", Globals.CVAR_ARCHIVE); ! gl_dynamic = ri.Cvar_Get("gl_dynamic", "1", 0); ! gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0); ! gl_round_down = ri.Cvar_Get("gl_round_down", "1", 0); ! gl_picmip = ri.Cvar_Get("gl_picmip", "0", 0); ! gl_skymip = ri.Cvar_Get("gl_skymip", "0", 0); ! gl_showtris = ri.Cvar_Get("gl_showtris", "0", 0); ! gl_ztrick = ri.Cvar_Get("gl_ztrick", "0", 0); ! gl_finish = ri.Cvar_Get("gl_finish", "0", Globals.CVAR_ARCHIVE); ! gl_clear = ri.Cvar_Get("gl_clear", "0", 0); ! gl_cull = ri.Cvar_Get("gl_cull", "1", 0); ! gl_polyblend = ri.Cvar_Get("gl_polyblend", "1", 0); ! gl_flashblend = ri.Cvar_Get("gl_flashblend", "0", 0); ! gl_playermip = ri.Cvar_Get("gl_playermip", "0", 0); ! gl_monolightmap = ri.Cvar_Get("gl_monolightmap", "0", 0); ! gl_driver = ri.Cvar_Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE); ! gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE); ! gl_texturealphamode = ri.Cvar_Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE); ! gl_texturesolidmode = ri.Cvar_Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE); ! gl_lockpvs = ri.Cvar_Get("gl_lockpvs", "0", 0); ! gl_vertex_arrays = ri.Cvar_Get("gl_vertex_arrays", "0", Globals.CVAR_ARCHIVE); ! gl_ext_swapinterval = ri.Cvar_Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_ext_palettedtexture = ri.Cvar_Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE); ! gl_ext_multitexture = ri.Cvar_Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE); ! gl_ext_pointparameters = ri.Cvar_Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE); ! gl_ext_compiled_vertex_array = ri.Cvar_Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE); ! gl_drawbuffer = ri.Cvar_Get("gl_drawbuffer", "GL_BACK", 0); ! gl_swapinterval = ri.Cvar_Get("gl_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_saturatelighting = ri.Cvar_Get("gl_saturatelighting", "0", 0); ! gl_3dlabs_broken = ri.Cvar_Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE); ! vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE); ! vid_gamma = ri.Cvar_Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE); ! vid_ref = ri.Cvar_Get("vid_ref", "jogl", Globals.CVAR_ARCHIVE); ! ri.Cmd_AddCommand("imagelist", new xcommand_t() { public void execute() { GL_ImageList_f(); --- 931,1002 ---- protected void R_Register() { ! r_lefthand = Cvar.Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); ! r_norefresh = Cvar.Get("r_norefresh", "0", 0); ! r_fullbright = Cvar.Get("r_fullbright", "0", 0); ! r_drawentities = Cvar.Get("r_drawentities", "1", 0); ! r_drawworld = Cvar.Get("r_drawworld", "1", 0); ! r_novis = Cvar.Get("r_novis", "0", 0); ! r_nocull = Cvar.Get("r_nocull", "0", 0); ! r_lerpmodels = Cvar.Get("r_lerpmodels", "1", 0); ! r_speeds = Cvar.Get("r_speeds", "0", 0); ! r_lightlevel = Cvar.Get("r_lightlevel", "1", 0); ! gl_nosubimage = Cvar.Get("gl_nosubimage", "0", 0); ! gl_allow_software = Cvar.Get("gl_allow_software", "0", 0); ! gl_particle_min_size = Cvar.Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE); ! gl_particle_max_size = Cvar.Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_size = Cvar.Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_att_a = Cvar.Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE); ! gl_particle_att_b = Cvar.Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE); ! gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); ! gl_log = Cvar.Get("gl_log", "0", 0); ! gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); ! gl_mode = Cvar.Get("gl_mode", "1", Globals.CVAR_ARCHIVE); ! gl_lightmap = Cvar.Get("gl_lightmap", "0", 0); ! gl_shadows = Cvar.Get("gl_shadows", "0", Globals.CVAR_ARCHIVE); ! gl_dynamic = Cvar.Get("gl_dynamic", "1", 0); ! gl_nobind = Cvar.Get("gl_nobind", "0", 0); ! gl_round_down = Cvar.Get("gl_round_down", "1", 0); ! gl_picmip = Cvar.Get("gl_picmip", "0", 0); ! gl_skymip = Cvar.Get("gl_skymip", "0", 0); ! gl_showtris = Cvar.Get("gl_showtris", "0", 0); ! gl_ztrick = Cvar.Get("gl_ztrick", "0", 0); ! gl_finish = Cvar.Get("gl_finish", "0", Globals.CVAR_ARCHIVE); ! gl_clear = Cvar.Get("gl_clear", "0", 0); ! gl_cull = Cvar.Get("gl_cull", "1", 0); ! gl_polyblend = Cvar.Get("gl_polyblend", "1", 0); ! gl_flashblend = Cvar.Get("gl_flashblend", "0", 0); ! gl_playermip = Cvar.Get("gl_playermip", "0", 0); ! gl_monolightmap = Cvar.Get("gl_monolightmap", "0", 0); ! gl_driver = Cvar.Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE); ! gl_texturemode = Cvar.Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE); ! gl_texturealphamode = Cvar.Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE); ! gl_texturesolidmode = Cvar.Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE); ! gl_lockpvs = Cvar.Get("gl_lockpvs", "0", 0); ! gl_vertex_arrays = Cvar.Get("gl_vertex_arrays", "0", Globals.CVAR_ARCHIVE); ! gl_ext_swapinterval = Cvar.Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_ext_palettedtexture = Cvar.Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE); ! gl_ext_multitexture = Cvar.Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE); ! gl_ext_pointparameters = Cvar.Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE); ! gl_ext_compiled_vertex_array = Cvar.Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE); ! gl_drawbuffer = Cvar.Get("gl_drawbuffer", "GL_BACK", 0); ! gl_swapinterval = Cvar.Get("gl_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_saturatelighting = Cvar.Get("gl_saturatelighting", "0", 0); ! gl_3dlabs_broken = Cvar.Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE); ! vid_fullscreen = Cvar.Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE); ! vid_gamma = Cvar.Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE); ! vid_ref = Cvar.Get("vid_ref", "jogl", Globals.CVAR_ARCHIVE); ! Cmd.AddCommand("imagelist", new xcommand_t() { public void execute() { GL_ImageList_f(); *************** *** 1026,1040 **** }); ! ri.Cmd_AddCommand("screenshot", new xcommand_t() { public void execute() { GL_ScreenShot_f(); } }); ! ri.Cmd_AddCommand("modellist", new xcommand_t() { public void execute() { Mod_Modellist_f(); } }); ! ri.Cmd_AddCommand("gl_strings", new xcommand_t() { public void execute() { GL_Strings_f(); --- 1004,1018 ---- }); ! Cmd.AddCommand("screenshot", new xcommand_t() { public void execute() { GL_ScreenShot_f(); } }); ! Cmd.AddCommand("modellist", new xcommand_t() { public void execute() { Mod_Modellist_f(); } }); ! Cmd.AddCommand("gl_strings", new xcommand_t() { public void execute() { GL_Strings_f(); *************** *** 1054,1059 **** // if (vid_fullscreen.modified && !gl_config.allow_cds) { ! // ri.Con_Printf(Defines.PRINT_ALL, "R_SetMode() - CDS not allowed with this driver\n"); ! // ri.Cvar_SetValue("vid_fullscreen", (vid_fullscreen.value > 0.0f) ? 0.0f : 1.0f); // vid_fullscreen.modified = false; // } --- 1032,1037 ---- // if (vid_fullscreen.modified && !gl_config.allow_cds) { ! // VID.Printf(Defines.PRINT_ALL, "R_SetMode() - CDS not allowed with this driver\n"); ! // Cvar.SetValue("vid_fullscreen", (vid_fullscreen.value > 0.0f) ? 0.0f : 1.0f); // vid_fullscreen.modified = false; // } *************** *** 1071,1089 **** else { if (err == rserr_invalid_fullscreen) { ! ri.Cvar_SetValue("vid_fullscreen", 0); vid_fullscreen.modified = false; ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - fullscreen unavailable in this mode\n"); if ((err = GLimp_SetMode(dim, (int) gl_mode.value, false)) == rserr_ok) return true; } else if (err == rserr_invalid_mode) { ! ri.Cvar_SetValue("gl_mode", gl_state.prev_mode); gl_mode.modified = false; ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - invalid mode\n"); } // try setting it back to something safe if ((err = GLimp_SetMode(dim, gl_state.prev_mode, false)) != rserr_ok) { ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - could not revert to safe mode\n"); return false; } --- 1049,1067 ---- else { if (err == rserr_invalid_fullscreen) { ! Cvar.SetValue("vid_fullscreen", 0); vid_fullscreen.modified = false; ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - fullscreen unavailable in this mode\n"); if ((err = GLimp_SetMode(dim, (int) gl_mode.value, false)) == rserr_ok) return true; } else if (err == rserr_invalid_mode) { ! Cvar.SetValue("gl_mode", gl_state.prev_mode); gl_mode.modified = false; ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - invalid mode\n"); } // try setting it back to something safe if ((err = GLimp_SetMode(dim, gl_state.prev_mode, false)) != rserr_ok) { ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - could not revert to safe mode\n"); return false; } *************** *** 1108,1112 **** } ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl version: " + REF_VERSION + '\n'); Draw_GetPalette(); --- 1086,1090 ---- } ! VID.Printf(Defines.PRINT_ALL, "ref_gl version: " + REF_VERSION + '\n'); Draw_GetPalette(); *************** *** 1114,1130 **** R_Register(); - // initialize our QGL dynamic bindings - if (!QGL_Init(gl_driver.string)) { - QGL_Shutdown(); - ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_Init() - could not load \"" + gl_driver.string + "\"\n"); - return false; - } - - // initialize OS-specific parts of OpenGL - if (!GLimp_Init(vid_xpos, vid_ypos)) { - QGL_Shutdown(); - return false; - } - // set our "safe" modes gl_state.prev_mode = 3; --- 1092,1095 ---- *************** *** 1132,1137 **** // create the window and set up the context if (!R_SetMode()) { ! QGL_Shutdown(); ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_Init() - could not R_SetMode()\n"); return false; } --- 1097,1101 ---- // create the window and set up the context if (!R_SetMode()) { ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_Init() - could not R_SetMode()\n"); return false; } *************** *** 1139,1144 **** } ! boolean R_Init2() { ! ri.Vid_MenuInit(); /* --- 1103,1108 ---- } ! protected boolean R_Init2() { ! VID.MenuInit(); /* *************** *** 1146,1156 **** */ gl_config.vendor_string = gl.glGetString(GL.GL_VENDOR); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_VENDOR: " + gl_config.vendor_string + '\n'); gl_config.renderer_string = gl.glGetString(GL.GL_RENDERER); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_RENDERER: " + gl_config.renderer_string + '\n'); gl_config.version_string = gl.glGetString(GL.GL_VERSION); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_VERSION: " + gl_config.version_string + '\n'); gl_config.extensions_string = gl.glGetString(GL.GL_EXTENSIONS); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_EXTENSIONS: " + gl_config.extensions_string + '\n'); String renderer_buffer = gl_config.renderer_string.toLowerCase(); --- 1110,1120 ---- */ gl_config.vendor_string = gl.glGetString(GL.GL_VENDOR); ! VID.Printf(Defines.PRINT_ALL, "GL_VENDOR: " + gl_config.vendor_string + '\n'); gl_config.renderer_string = gl.glGetString(GL.GL_RENDERER); ! VID.Printf(Defines.PRINT_ALL, "GL_RENDERER: " + gl_config.renderer_string + '\n'); gl_config.version_string = gl.glGetString(GL.GL_VERSION); ! VID.Printf(Defines.PRINT_ALL, "GL_VERSION: " + gl_config.version_string + '\n'); gl_config.extensions_string = gl.glGetString(GL.GL_EXTENSIONS); ! VID.Printf(Defines.PRINT_ALL, "GL_EXTENSIONS: " + gl_config.extensions_string + '\n'); String renderer_buffer = gl_config.renderer_string.toLowerCase(); *************** *** 1183,1194 **** if (monolightmap.length() < 2 || monolightmap.charAt(1) != 'F') { if (gl_config.renderer == GL_RENDERER_PERMEDIA2) { ! ri.Cvar_Set("gl_monolightmap", "A"); ! ri.Con_Printf(Defines.PRINT_ALL, "...using gl_monolightmap 'a'\n"); } else if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! ri.Cvar_Set("gl_monolightmap", "0"); } else { ! ri.Cvar_Set("gl_monolightmap", "0"); } } --- 1147,1158 ---- if (monolightmap.length() < 2 || monolightmap.charAt(1) != 'F') { if (gl_config.renderer == GL_RENDERER_PERMEDIA2) { ! Cvar.Set("gl_monolightmap", "A"); ! VID.Printf(Defines.PRINT_ALL, "...using gl_monolightmap 'a'\n"); } else if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! Cvar.Set("gl_monolightmap", "0"); } else { ! Cvar.Set("gl_monolightmap", "0"); } } *************** *** 1197,1213 **** // the screen needs to redraw the tiled background every frame if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! ri.Cvar_Set("scr_drawall", "1"); } else { ! ri.Cvar_Set("scr_drawall", "0"); } // #ifdef __linux__ ! ri.Cvar_SetValue("gl_finish", 1); // #endif // MCD has buffering issues if (gl_config.renderer == GL_RENDERER_MCD) { ! ri.Cvar_SetValue("gl_finish", 1); } --- 1161,1177 ---- // the screen needs to redraw the tiled background every frame if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! Cvar.Set("scr_drawall", "1"); } else { ! Cvar.Set("scr_drawall", "0"); } // #ifdef __linux__ ! Cvar.SetValue("gl_finish", 1); // #endif // MCD has buffering issues if (gl_config.renderer == GL_RENDERER_MCD) { ! Cvar.SetValue("gl_finish", 1); } *************** *** 1223,1229 **** if (gl_config.allow_cds) ! ri.Con_Printf(Defines.PRINT_ALL, "...allowing CDS\n"); else ! ri.Con_Printf(Defines.PRINT_ALL, "...disabling CDS\n"); /* --- 1187,1193 ---- if (gl_config.allow_cds) ! VID.Printf(Defines.PRINT_ALL, "...allowing CDS\n"); else ! VID.Printf(Defines.PRINT_ALL, "...disabling CDS\n"); /* *************** *** 1232,1236 **** if (gl_config.extensions_string.indexOf("GL_EXT_compiled_vertex_array") >= 0 || gl_config.extensions_string.indexOf("GL_SGI_compiled_vertex_... [truncated message content] |