From: Carsten W. <ca...@us...> - 2008-03-02 14:56:27
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fast In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11126/src/jake2/render/fast Modified Files: Draw.java Misc.java Main.java Log Message: use getters and setters of modified viddef_t Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fast/Main.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Main.java 12 Dec 2006 14:46:04 -0000 1.5 --- Main.java 2 Mar 2008 14:56:23 -0000 1.6 *************** *** 668,672 **** gl.glScissor( r_newrefdef.x, ! vid.height - r_newrefdef.height - r_newrefdef.y, r_newrefdef.width, r_newrefdef.height); --- 668,672 ---- gl.glScissor( r_newrefdef.x, ! vid.getHeight() - r_newrefdef.height - r_newrefdef.y, r_newrefdef.width, r_newrefdef.height); *************** *** 706,717 **** // set up viewport // ! //int x = (int) Math.floor(r_newrefdef.x * vid.width / vid.width); int x = r_newrefdef.x; ! //int x2 = (int) Math.ceil((r_newrefdef.x + r_newrefdef.width) * vid.width / vid.width); int x2 = r_newrefdef.x + r_newrefdef.width; ! //int y = (int) Math.floor(vid.height - r_newrefdef.y * vid.height / vid.height); ! int y = vid.height - r_newrefdef.y; ! //int y2 = (int) Math.ceil(vid.height - (r_newrefdef.y + r_newrefdef.height) * vid.height / vid.height); ! int y2 = vid.height - (r_newrefdef.y + r_newrefdef.height); int w = x2 - x; --- 706,717 ---- // set up viewport // ! //int x = (int) Math.floor(r_newrefdef.x * vid.getWidth() / vid.getWidth()); int x = r_newrefdef.x; ! //int x2 = (int) Math.ceil((r_newrefdef.x + r_newrefdef.width) * vid.getWidth() / vid.getWidth()); int x2 = r_newrefdef.x + r_newrefdef.width; ! //int y = (int) Math.floor(vid.getHeight() - r_newrefdef.y * vid.getHeight() / vid.getHeight()); ! int y = vid.getHeight() - r_newrefdef.y; ! //int y2 = (int) Math.ceil(vid.getHeight() - (r_newrefdef.y + r_newrefdef.height) * vid.getHeight() / vid.getHeight()); ! int y2 = vid.getHeight() - (r_newrefdef.y + r_newrefdef.height); int w = x2 - x; *************** *** 862,869 **** void R_SetGL2D() { // set 2D virtual screen size ! gl.glViewport(0, 0, vid.width, vid.height); gl.glMatrixMode(GL_PROJECTION); gl.glLoadIdentity(); ! gl.glOrtho(0, vid.width, vid.height, 0, -99999, 99999); gl.glMatrixMode(GL_MODELVIEW); gl.glLoadIdentity(); --- 862,869 ---- void R_SetGL2D() { // set 2D virtual screen size ! gl.glViewport(0, 0, vid.getWidth(), vid.getHeight()); gl.glMatrixMode(GL_PROJECTION); gl.glLoadIdentity(); ! gl.glOrtho(0, vid.getWidth(), vid.getHeight(), 0, -99999, 99999); gl.glMatrixMode(GL_MODELVIEW); gl.glLoadIdentity(); *************** *** 1016,1020 **** gl_mode.modified = false; ! Dimension dim = new Dimension(vid.width, vid.height); int err; // enum rserr_t --- 1016,1020 ---- gl_mode.modified = false; ! Dimension dim = new Dimension(vid.getWidth(), vid.getHeight()); int err; // enum rserr_t *************** *** 1313,1316 **** --- 1313,1319 ---- */ public void R_BeginFrame(float camera_separation) { + + vid.update(); + gl_state.camera_separation = camera_separation; *************** *** 1365,1372 **** ** go into 2D mode */ ! gl.glViewport(0, 0, vid.width, vid.height); gl.glMatrixMode(GL_PROJECTION); gl.glLoadIdentity(); ! gl.glOrtho(0, vid.width, vid.height, 0, -99999, 99999); gl.glMatrixMode(GL_MODELVIEW); gl.glLoadIdentity(); --- 1368,1375 ---- ** go into 2D mode */ ! gl.glViewport(0, 0, vid.getWidth(), vid.getHeight()); gl.glMatrixMode(GL_PROJECTION); gl.glLoadIdentity(); ! gl.glOrtho(0, vid.getWidth(), vid.getHeight(), 0, -99999, 99999); gl.glMatrixMode(GL_MODELVIEW); gl.glLoadIdentity(); Index: Draw.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fast/Draw.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Draw.java 12 May 2007 23:20:29 -0000 1.3 --- Draw.java 2 Mar 2008 14:56:23 -0000 1.4 *************** *** 286,292 **** gl.glVertex2f(0,0); ! gl.glVertex2f(vid.width, 0); ! gl.glVertex2f(vid.width, vid.height); ! gl.glVertex2f(0, vid.height); gl.glEnd(); --- 286,292 ---- gl.glVertex2f(0,0); ! gl.glVertex2f(vid.getWidth(), 0); ! gl.glVertex2f(vid.getWidth(), vid.getHeight()); ! gl.glVertex2f(0, vid.getHeight()); gl.glEnd(); Index: Misc.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fast/Misc.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Misc.java 11 Jan 2007 23:36:21 -0000 1.4 --- Misc.java 2 Mar 2008 14:56:23 -0000 1.5 *************** *** 137,141 **** RandomAccessFile out = new RandomAccessFile(file, "rw"); FileChannel ch = out.getChannel(); ! int fileLength = TGA_HEADER_SIZE + vid.width * vid.height * 3; out.setLength(fileLength); MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, --- 137,141 ---- RandomAccessFile out = new RandomAccessFile(file, "rw"); FileChannel ch = out.getChannel(); ! int fileLength = TGA_HEADER_SIZE + vid.getWidth() * vid.getHeight() * 3; out.setLength(fileLength); MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, *************** *** 145,152 **** image.put(0, (byte) 0).put(1, (byte) 0); image.put(2, (byte) 2); // uncompressed type ! image.put(12, (byte) (vid.width & 0xFF)); // vid.width ! image.put(13, (byte) (vid.width >> 8)); // vid.width ! image.put(14, (byte) (vid.height & 0xFF)); // vid.height ! image.put(15, (byte) (vid.height >> 8)); // vid.height image.put(16, (byte) 24); // pixel size --- 145,152 ---- image.put(0, (byte) 0).put(1, (byte) 0); image.put(2, (byte) 2); // uncompressed type ! image.put(12, (byte) (vid.getWidth() & 0xFF)); // vid.getWidth() ! image.put(13, (byte) (vid.getWidth() >> 8)); // vid.getWidth() ! image.put(14, (byte) (vid.getHeight() & 0xFF)); // vid.getHeight() ! image.put(15, (byte) (vid.getHeight() >> 8)); // vid.getHeight() image.put(16, (byte) 24); // pixel size *************** *** 156,160 **** // change pixel alignment for reading ! if (vid.width % 4 != 0) { gl.glPixelStorei(GL_PACK_ALIGNMENT, 1); } --- 156,160 ---- // change pixel alignment for reading ! if (vid.getWidth() % 4 != 0) { gl.glPixelStorei(GL_PACK_ALIGNMENT, 1); } *************** *** 165,172 **** if (gl_config.getOpenGLVersion() >= 1.2f) { // read the BGR values into the image buffer ! gl.glReadPixels(0, 0, vid.width, vid.height, GL_BGR, GL_UNSIGNED_BYTE, image); } else { // read the RGB values into the image buffer ! gl.glReadPixels(0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE, image); // flip RGB to BGR byte tmp; --- 165,172 ---- if (gl_config.getOpenGLVersion() >= 1.2f) { // read the BGR values into the image buffer ! gl.glReadPixels(0, 0, vid.getWidth(), vid.getHeight(), GL_BGR, GL_UNSIGNED_BYTE, image); } else { // read the RGB values into the image buffer ! gl.glReadPixels(0, 0, vid.getWidth(), vid.getHeight(), GL_RGB, GL_UNSIGNED_BYTE, image); // flip RGB to BGR byte tmp; |