From: Carsten W. <ca...@us...> - 2008-03-02 14:56:27
|
Update of /cvsroot/jake2/jake2/src/jake2/render/basic In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11126/src/jake2/render/basic Modified Files: Main.java Draw.java Misc.java Log Message: use getters and setters of modified viddef_t Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/basic/Main.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Main.java 27 Feb 2007 14:00:35 -0000 1.4 --- Main.java 2 Mar 2008 14:56:23 -0000 1.5 *************** *** 680,684 **** gl.glScissor( r_newrefdef.x, ! vid.height - r_newrefdef.height - r_newrefdef.y, r_newrefdef.width, r_newrefdef.height); --- 680,684 ---- gl.glScissor( r_newrefdef.x, ! vid.getHeight() - r_newrefdef.height - r_newrefdef.y, r_newrefdef.width, r_newrefdef.height); *************** *** 716,723 **** // set up viewport // ! x = (int) Math.floor(r_newrefdef.x * vid.width / vid.width); ! x2 = (int) Math.ceil((r_newrefdef.x + r_newrefdef.width) * vid.width / vid.width); ! y = (int) Math.floor(vid.height - r_newrefdef.y * vid.height / vid.height); ! y2 = (int) Math.ceil(vid.height - (r_newrefdef.y + r_newrefdef.height) * vid.height / vid.height); w = x2 - x; --- 716,723 ---- // set up viewport // ! x = (int) Math.floor(r_newrefdef.x * vid.getWidth() / vid.getWidth()); ! x2 = (int) Math.ceil((r_newrefdef.x + r_newrefdef.width) * vid.getWidth() / vid.getWidth()); ! y = (int) Math.floor(vid.getHeight() - r_newrefdef.y * vid.getHeight() / vid.getHeight()); ! y2 = (int) Math.ceil(vid.getHeight() - (r_newrefdef.y + r_newrefdef.height) * vid.getHeight() / vid.getHeight()); w = x2 - x; *************** *** 867,874 **** 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(); --- 867,874 ---- 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(); *************** *** 1036,1040 **** gl_mode.modified = false; ! Dimension dim = new Dimension(vid.width, vid.height); if ((err = glImpl.setMode(dim, (int) gl_mode.value, fullscreen)) == rserr_ok) { --- 1036,1040 ---- gl_mode.modified = false; ! Dimension dim = new Dimension(vid.getWidth(), vid.getHeight()); if ((err = glImpl.setMode(dim, (int) gl_mode.value, fullscreen)) == rserr_ok) { *************** *** 1359,1363 **** */ public void R_BeginFrame(float camera_separation) { ! gl_state.camera_separation = camera_separation; --- 1359,1365 ---- */ public void R_BeginFrame(float camera_separation) { ! ! vid.update(); ! gl_state.camera_separation = camera_separation; *************** *** 1411,1418 **** ** 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(); --- 1413,1420 ---- ** 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/basic/Draw.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Draw.java 21 Nov 2006 00:50:46 -0000 1.2 --- Draw.java 2 Mar 2008 14:56:23 -0000 1.3 *************** *** 291,297 **** gl.glVertex2f(0,0); ! gl.glVertex2f(vid.width, 0); ! gl.glVertex2f(vid.width, vid.height); ! gl.glVertex2f(0, vid.height); gl.glEnd(); --- 291,297 ---- 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/basic/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:15 -0000 1.4 --- Misc.java 2 Mar 2008 14:56:23 -0000 1.5 *************** *** 144,148 **** 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, --- 144,148 ---- 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, *************** *** 152,159 **** 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 --- 152,159 ---- 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 *************** *** 164,168 **** // change pixel alignment for reading ! if (vid.width % 4 != 0) { gl.glPixelStorei(GL_PACK_ALIGNMENT, 1); } --- 164,168 ---- // change pixel alignment for reading ! if (vid.getWidth() % 4 != 0) { gl.glPixelStorei(GL_PACK_ALIGNMENT, 1); } *************** *** 173,180 **** 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, rgb); } else { // read the RGB values into the image buffer ! gl.glReadPixels(0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE, rgb); // flip RGB to BGR byte tmp; --- 173,180 ---- 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, rgb); } else { // read the RGB values into the image buffer ! gl.glReadPixels(0, 0, vid.getWidth(), vid.getHeight(), GL_RGB, GL_UNSIGNED_BYTE, rgb); // flip RGB to BGR byte tmp; |