You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(34) |
Sep
(99) |
Oct
(110) |
Nov
(21) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(117) |
Feb
(90) |
Mar
(1) |
Apr
(22) |
May
(96) |
Jun
(25) |
Jul
(22) |
Aug
|
Sep
|
Oct
(18) |
Nov
(43) |
Dec
(71) |
2006 |
Jan
(20) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(60) |
Nov
(63) |
Dec
(35) |
2007 |
Jan
(18) |
Feb
(40) |
Mar
(14) |
Apr
(18) |
May
(33) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(25) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Holger Z. <hz...@us...> - 2005-01-07 14:21:28
|
Update of /cvsroot/jake2/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14622 Modified Files: build.xml Log Message: add lwjgl OS X libs to webstart config Index: build.xml =================================================================== RCS file: /cvsroot/jake2/jake2/build.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** build.xml 20 Dec 2004 12:39:10 -0000 1.18 --- build.xml 7 Jan 2005 14:21:20 -0000 1.19 *************** *** 103,107 **** <fileset dir="lib/joal/osx"> <include name="*"/> ! </fileset> </copy> <copy todir="${dist}"> --- 103,110 ---- <fileset dir="lib/joal/osx"> <include name="*"/> ! </fileset> ! <fileset dir="lib/lwjgl/osx"> ! <include name="*"/> ! </fileset> </copy> <copy todir="${dist}"> *************** *** 247,251 **** <jar destfile="webstart/lib/osx/joal-native.jar" basedir="${dist}/lib/osx"> <include name="libjoal.jnilib"/> ! </jar> <jar destfile="webstart/lib/windows/jogl-native.jar" basedir="${dist}/lib/windows"> <include name="jogl*.dll"/> --- 250,258 ---- <jar destfile="webstart/lib/osx/joal-native.jar" basedir="${dist}/lib/osx"> <include name="libjoal.jnilib"/> ! </jar> ! <jar destfile="webstart/lib/osx/lwjgl-native.jar" basedir="${dist}/lib/osx"> ! <include name="liblwjgl.jnilib"/> ! <include name="openal.dylib"/> ! </jar> <jar destfile="webstart/lib/windows/jogl-native.jar" basedir="${dist}/lib/windows"> <include name="jogl*.dll"/> |
From: Holger Z. <hz...@us...> - 2005-01-07 14:02:01
|
Update of /cvsroot/jake2/jake2/lib/lwjgl/osx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9000/lib/lwjgl/osx Added Files: openal.dylib liblwjgl.jnilib Log Message: jwjgl 0.94 native libs for OS X --- NEW FILE: liblwjgl.jnilib --- (This appears to be a binary file; contents omitted.) --- NEW FILE: openal.dylib --- (This appears to be a binary file; contents omitted.) |
From: Holger Z. <hz...@us...> - 2005-01-07 14:01:43
|
Update of /cvsroot/jake2/jake2/lib/lwjgl/osx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8982/lib/lwjgl/osx Log Message: Directory /cvsroot/jake2/jake2/lib/lwjgl/osx added to the repository |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:21
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/sound/joal Modified Files: Tag: RST PlaySound.java Log Message: Index: PlaySound.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/PlaySound.java,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** PlaySound.java 27 Oct 2004 16:51:32 -0000 1.1 --- PlaySound.java 31 Dec 2004 14:08:37 -0000 1.1.4.1 *************** *** 2,21 **** * Created on Oct 26, 2004 * ! * TODO To change the template for this generated file go to ! * Window - Preferences - Java - Code Style - Code Templates */ ! package jake2.sound.joal; ! import java.util.Vector; import jake2.Globals; - import jake2.sound.sfx_t; import jake2.util.Math3D; /** * @author cwei - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates */ public class PlaySound { --- 2,37 ---- * Created on Oct 26, 2004 * ! * Copyright (C) 2003 ! * ! * $Id$ */ ! /* ! 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.sound.joal; import jake2.Globals; import jake2.util.Math3D; /** + * PlaySound + * * @author cwei */ public class PlaySound { |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:20
|
Update of /cvsroot/jake2/jake2/lib/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/lib/jogl Modified Files: Tag: RST jogl.jar Log Message: Index: jogl.jar =================================================================== RCS file: /cvsroot/jake2/jake2/lib/jogl/jogl.jar,v retrieving revision 1.1 retrieving revision 1.1.10.1 diff -C2 -d -r1.1 -r1.1.10.1 Binary files /tmp/cvs0BiXzL and /tmp/cvsuYloaa differ |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:19
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/client Modified Files: Tag: RST Menu.java Log Message: Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.12 retrieving revision 1.12.6.1 diff -C2 -d -r1.12 -r1.12.6.1 *** Menu.java 7 Oct 2004 14:13:00 -0000 1.12 --- Menu.java 31 Dec 2004 14:08:34 -0000 1.12.6.1 *************** *** 199,207 **** Com.Error(ERR_FATAL, "PushMenu: MAX_MENU_DEPTH"); ! m_layers[m_menudepth].draw = m_drawfunc; ! m_layers[m_menudepth].key = m_keyfunc; ! m_menudepth++; } ! m_drawfunc = draw; m_keyfunc = key; --- 199,206 ---- Com.Error(ERR_FATAL, "PushMenu: MAX_MENU_DEPTH"); ! m_layers[m_menudepth].draw = draw;//m_drawfunc; ! m_layers[m_menudepth].key = key;//m_keyfunc; } ! m_menudepth++; m_drawfunc = draw; m_keyfunc = key; *************** *** 223,235 **** static void PopMenu() { S.StartLocalSound(menu_out_sound); - if (m_menudepth < 1) - Com.Error(ERR_FATAL, "PopMenu: depth < 1"); m_menudepth--; ! m_drawfunc = m_layers[m_menudepth].draw; ! m_keyfunc = m_layers[m_menudepth].key; if (0 == m_menudepth) ForceMenuOff(); } --- 222,238 ---- static void PopMenu() { S.StartLocalSound(menu_out_sound); m_menudepth--; + if (m_menudepth < 0) + Com.Error(ERR_FATAL, "PopMenu: depth < 1"); ! if (0 < m_menudepth){ ! m_drawfunc = m_layers[m_menudepth-1].draw; ! m_keyfunc = m_layers[m_menudepth-1].key; ! } if (0 == m_menudepth) ForceMenuOff(); + + } *************** *** 2906,2920 **** }; static void Menu_StartServer_f() { StartServer_MenuInit(); ! PushMenu(new xcommand_t() { ! public void execute() { ! StartServer_MenuDraw(); ! } ! }, new keyfunc_t() { ! public String execute(int key) { ! return StartServer_MenuKey(key); ! } ! }); } --- 2909,2925 ---- }; + static xcommand_t startServer_MenuDraw = new xcommand_t() { + public void execute() { + StartServer_MenuDraw(); + } + }; + static keyfunc_t startServer_MenuKey = new keyfunc_t() { + public String execute(int key) { + return StartServer_MenuKey(key); + } + }; static void Menu_StartServer_f() { StartServer_MenuInit(); ! PushMenu(startServer_MenuDraw, startServer_MenuKey); } |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:17
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/sound/lwjgl Modified Files: Tag: RST LWJGLSoundImpl.java Channel.java Added Files: Tag: RST PlaySound.java Log Message: --- NEW FILE: PlaySound.java --- /* * Created on Dec 22, 2004 * * Copyright (C) 2003 * * $Id: PlaySound.java,v 1.1.2.1 2004/12/31 14:08:34 salomo 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.sound.lwjgl; import jake2.Globals; import jake2.util.Math3D; /** * PlaySound * * @author cwei */ public class PlaySound { final static int MAX_PLAYSOUNDS = 128; // list with sentinel private static PlaySound freeList; private static PlaySound playableList; private static PlaySound[] backbuffer = new PlaySound[MAX_PLAYSOUNDS]; static { for (int i = 0; i < backbuffer.length; i++) { backbuffer[i] = new PlaySound(); } // init the sentinels freeList = new PlaySound(); playableList = new PlaySound(); // reset the lists reset(); } // sound attributes int type; int entnum; int entchannel; int bufferId; // float volume; float attenuation; float[] origin = {0,0,0}; // begin time in ms private long beginTime; // for linked list private PlaySound prev, next; private PlaySound() { prev = next = null; this.clear(); } private void clear() { type = bufferId = entnum = entchannel = -1; // volume = attenuation = beginTime = 0; attenuation = beginTime = 0; // Math3D.VectorClear(origin); } static void reset() { // init the sentinels freeList.next = freeList.prev = freeList; playableList.next = playableList.prev = playableList; // concat the the freeList PlaySound ps; for (int i = 0; i < backbuffer.length; i++) { ps = backbuffer[i]; ps.clear(); ps.prev = freeList; ps.next = freeList.next; ps.prev.next = ps; ps.next.prev = ps; } } static PlaySound nextPlayableSound() { PlaySound ps = null; while (true) { ps = playableList.next; if (ps == playableList || ps.beginTime > Globals.cl.time) return null; PlaySound.release(ps); return ps; } } private static PlaySound get() { PlaySound ps = freeList.next; if (ps == freeList) return null; ps.prev.next = ps.next; ps.next.prev = ps.prev; return ps; } private static void add(PlaySound ps) { PlaySound sort = playableList.next; for (; sort != playableList && sort.beginTime < ps.beginTime; sort = sort.next); ps.next = sort; ps.prev = sort.prev; ps.next.prev = ps; ps.prev.next = ps; } private static void release(PlaySound ps) { ps.prev.next = ps.next; ps.next.prev = ps.prev; // add to free list ps.next = freeList.next; freeList.next.prev = ps; ps.prev = freeList; freeList.next = ps; } static void allocate(float[] origin, int entnum, int entchannel, int bufferId, float volume, float attenuation, float timeoffset) { PlaySound ps = PlaySound.get(); if (ps != null) { // find the right sound type if (entnum == Globals.cl.playernum + 1) { ps.type = Channel.LISTENER; } else if (origin != null) { ps.type = Channel.FIXED; Math3D.VectorCopy(origin, ps.origin); } else { ps.type = Channel.DYNAMIC; } ps.entnum = entnum; ps.entchannel = entchannel; ps.bufferId = bufferId; // ps.volume = volume; ps.attenuation = attenuation; ps.beginTime = Globals.cl.time + (long)(timeoffset * 1000); PlaySound.add(ps); } else { System.err.println("PlaySounds out of Limit"); } } } Index: LWJGLSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/LWJGLSoundImpl.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** LWJGLSoundImpl.java 16 Dec 2004 20:33:08 -0000 1.2 --- LWJGLSoundImpl.java 31 Dec 2004 14:08:34 -0000 1.2.2.1 *************** *** 9,32 **** import jake2.Defines; import jake2.Globals; - import jake2.client.CL; - import jake2.client.CL_ents; import jake2.game.*; import jake2.qcommon.*; import jake2.sound.*; ! import jake2.util.*; - import java.io.IOException; - import java.io.RandomAccessFile; import java.nio.*; - import java.util.*; - import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.openal.*; ! import org.lwjgl.openal.eax.EAX20; ! import org.lwjgl.openal.eax.EAXListenerProperties; /** * LWJGLSoundImpl */ public final class LWJGLSoundImpl implements Sound { --- 9,28 ---- import jake2.Defines; import jake2.Globals; import jake2.game.*; import jake2.qcommon.*; import jake2.sound.*; ! import jake2.util.Lib; ! import jake2.util.Vargs; import java.nio.*; import org.lwjgl.LWJGLException; import org.lwjgl.openal.*; ! import org.lwjgl.openal.eax.*; /** * LWJGLSoundImpl + * + * @author dsanders/cwei */ public final class LWJGLSoundImpl implements Sound { *************** *** 41,50 **** private static final int MAX_SFX = Defines.MAX_SOUNDS * 2; - private static final int MAX_CHANNELS = 32; ! private IntBuffer buffers = BufferUtils.createIntBuffer(MAX_SFX); ! private IntBuffer sources = BufferUtils.createIntBuffer(MAX_CHANNELS); ! private Channel[] channels = null; ! private int num_channels = 0; // singleton --- 37,42 ---- private static final int MAX_SFX = Defines.MAX_SOUNDS * 2; ! private IntBuffer buffers = Lib.newIntBuffer(MAX_SFX); // singleton *************** *** 71,75 **** AL10.alGenBuffers(buffers); s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); ! initChannels(); AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED); Cmd.AddCommand("play", new xcommand_t() { --- 63,68 ---- AL10.alGenBuffers(buffers); s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); ! int count = Channel.init(buffers, s_volume.value); ! Com.Printf("... using " + count + " channels\n"); AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED); Cmd.AddCommand("play", new xcommand_t() { *************** *** 96,100 **** num_sfx = 0; - Com.Printf("sound sampling rate: 44100Hz\n"); --- 89,92 ---- *************** *** 131,136 **** if (AL10.alIsExtensionPresent("EAX2.0")) { ! Com.Printf("... using EAX2.0\n"); ! hasEAX=true; } else --- 123,134 ---- if (AL10.alIsExtensionPresent("EAX2.0")) { ! try { ! EAX.create(); ! Com.Printf("... using EAX2.0\n"); ! hasEAX=true; ! } catch (LWJGLException e) { ! Com.Printf("... can't create EAX2.0\n"); ! hasEAX=false; ! } } else *************** *** 144,185 **** void exitOpenAL() { // Release the context and the device. AL.destroy(); } ! private void initChannels() { ! ! // create channels ! channels = new Channel[MAX_CHANNELS]; ! ! int sourceId; ! IntBuffer tmp = BufferUtils.createIntBuffer(1); ! int error; ! for (int i = 0; i < MAX_CHANNELS; i++) { ! ! AL10.alGenSources(tmp); ! sourceId = tmp.get(0); ! ! //if ((error = al.alGetError()) != AL.AL_NO_ERROR) break; ! if (sourceId <= 0) break; ! ! sources.put(i, sourceId); ! ! channels[i] = new Channel(sourceId); ! num_channels++; ! ! // set default values for AL sources ! AL10.alSourcef (sourceId, AL10.AL_GAIN, s_volume.value); ! AL10.alSourcef (sourceId, AL10.AL_PITCH, 1.0f); ! AL10.alSourcei (sourceId, AL10.AL_SOURCE_ABSOLUTE, AL10.AL_TRUE); ! AL10.nalSourcefv(sourceId, AL10.AL_VELOCITY, NULLVECTOR_BUFFER,0); ! AL10.alSourcei (sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! AL10.alSourcef (sourceId, AL10.AL_REFERENCE_DISTANCE, 300.0f); ! AL10.alSourcef (sourceId, AL10.AL_MIN_GAIN, 0.0005f); ! AL10.alSourcef (sourceId, AL10.AL_MAX_GAIN, 1.0f); ! } ! Com.Printf("... using " + num_channels + " channels\n"); ! } ! /* (non-Javadoc) --- 142,156 ---- void exitOpenAL() { + // Release the EAX context. + if (hasEAX){ + EAX.destroy(); + } // Release the context and the device. AL.destroy(); } ! // TODO check the sfx direct buffer size ! // 2MB sfx buffer ! ByteBuffer sfxDataBuffer = Lib.newByteBuffer(2 * 1024 * 1024); /* (non-Javadoc) *************** *** 193,199 **** int format = AL10.AL_FORMAT_MONO16; ! ByteBuffer data = BufferUtils.createByteBuffer(sfx.cache.data.length); ! data.put(sfx.cache.data); data.rewind(); int freq = sfx.cache.speed; --- 164,171 ---- int format = AL10.AL_FORMAT_MONO16; ! ByteBuffer data = sfxDataBuffer.slice(); ! data.put(sfx.cache.data, 0, sfx.cache.data.length); data.rewind(); + data.limit(sfx.cache.data.length); int freq = sfx.cache.speed; *************** *** 225,230 **** public void Shutdown() { StopAllSounds(); ! ! AL10.alDeleteSources(sources); AL10.alDeleteBuffers(buffers); exitOpenAL(); --- 197,201 ---- public void Shutdown() { StopAllSounds(); ! Channel.shutdown(); AL10.alDeleteBuffers(buffers); exitOpenAL(); *************** *** 242,253 **** } num_sfx = 0; - num_channels = 0; } - //private final static float[] NULLVECTOR = {0, 0, 0}; - private final static FloatBuffer NULLVECTOR_BUFFER=Lib.newFloatBuffer(3); - private float[] entityOrigin = {0, 0, 0}; - private float[] sourceOrigin = {0, 0, 0}; - /* (non-Javadoc) * @see jake2.sound.SoundImpl#StartSound(float[], int, int, jake2.sound.sfx_t, float, float, float) --- 213,218 ---- *************** *** 267,338 **** attenuation *= 0.5f; ! Channel ch = pickChannel(entnum, entchannel, buffers.get(sfx.bufferId), attenuation); ! ! if (ch == null) return; ! ! if (entnum == Globals.cl.playernum + 1) { ! ch.addListener(); ! } else if (origin != null) { ! ch.addFixed(origin); ! } else { ! ch.addDynamic(entnum); ! } ! } ! ! Channel pickChannel(int entnum, int entchannel, int bufferId, float rolloff) { ! ! Channel ch = null; ! int state; ! int i; ! ! for (i = 0; i < num_channels; i++) { ! ch = channels[i]; ! ! if (entchannel != 0 && ch.entnum == entnum && ch.entchannel == entchannel) { ! // always override sound from same entity ! break; ! } ! ! // don't let monster sounds override player sounds ! if ((ch.entnum == Globals.cl.playernum+1) && (entnum != Globals.cl.playernum+1) && ch.bufferId != -1) ! continue; ! ! // looking for a free AL source ! if (!ch.active) { ! break; ! } ! } ! ! if (i == num_channels) ! return null; ! ! ch.entnum = entnum; ! ch.entchannel = entchannel; ! if (ch.bufferId != bufferId) { ! ch.bufferId = bufferId; ! ch.bufferChanged = true; ! } ! ch.rolloff = rolloff * 2; ! ch.active = true; ! ch.modified = true; ! ! return ch; } ! private float[] listenerOrigin = {0, 0, 0}; ! private FloatBuffer listenerOriginBuffer=FloatBuffer.wrap(listenerOrigin); ! ! private float[] listenerOrientation = {0, 0, 0, 0, 0, 0}; ! private FloatBuffer listenerOrientationBuffer=FloatBuffer.wrap(listenerOrientation); ! ! private IntBuffer eaxEnv = Lib.newIntBuffer(1); ! private int currentEnv = -1; ! private boolean changeEnv = true; ! ! // TODO workaround for JOAL-bug ! // should be EAX.LISTENER ! private final static int EAX_LISTENER = 0; ! // should be EAX.SOURCE ! private final static int EAX_SOURCE = 1; /* (non-Javadoc) --- 232,240 ---- attenuation *= 0.5f; ! PlaySound.allocate(origin, entnum, entchannel, buffers.get(sfx.bufferId), fvol, attenuation, timeofs); } ! private FloatBuffer listenerOrigin = Lib.newFloatBuffer(3); ! private FloatBuffer listenerOrientation = Lib.newFloatBuffer(6); /* (non-Javadoc) *************** *** 341,516 **** public void Update(float[] origin, float[] forward, float[] right, float[] up) { ! convertVector(origin, listenerOrigin); ! AL10.nalListenerfv(AL10.AL_POSITION, listenerOriginBuffer,0); ! convertOrientation(forward, up, listenerOrientation); ! AL10.nalListenerfv(AL10.AL_ORIENTATION, listenerOrientationBuffer,0); ! if (hasEAX) ! { ! // workaround for environment initialisation ! if (currentEnv == -1) ! { ! eaxEnv.put(0, EAX20.EAX_ENVIRONMENT_UNDERWATER); ! EAX20.eaxSet(EAX_LISTENER, EAXListenerProperties.EAXLISTENER_ENVIRONMENT | EAXListenerProperties.EAXLISTENER_DEFERRED, 0, eaxEnv, 4); ! changeEnv = true; ! } ! if ((GameBase.gi.pointcontents.pointcontents(origin)& Defines.MASK_WATER)!= 0) { ! changeEnv = currentEnv != EAX20.EAX_ENVIRONMENT_UNDERWATER; ! currentEnv = EAX20.EAX_ENVIRONMENT_UNDERWATER; } else { ! changeEnv = currentEnv != EAX20.EAX_ENVIRONMENT_GENERIC; ! currentEnv = EAX20.EAX_ENVIRONMENT_GENERIC; ! } ! if (changeEnv) { ! eaxEnv.put(0, currentEnv); ! EAX20.eaxSet(EAX_LISTENER, EAXListenerProperties.EAXLISTENER_ENVIRONMENT | EAXListenerProperties.EAXLISTENER_DEFERRED, 0, eaxEnv, 4); } } ! AddLoopSounds(origin); ! playChannels(listenerOrigin); } ! Map looptable = new Hashtable(MAX_CHANNELS); ! ! /* ! ================== ! S_AddLoopSounds ! ! Entities with a ->sound field will generated looped sounds ! that are automatically started, stopped, and merged together ! as the entities are sent to the client ! ================== ! */ ! void AddLoopSounds(float[] listener) { ! ! if (Globals.cl_paused.value != 0.0f) { ! removeUnusedLoopSounds(); ! return; ! } ! ! if (Globals.cls.state != Globals.ca_active) { ! removeUnusedLoopSounds(); ! return; ! } ! ! if (!Globals.cl.sound_prepped) { ! removeUnusedLoopSounds(); ! return; ! } ! ! Channel ch; ! sfx_t sfx; ! sfxcache_t sc; ! int num; ! entity_state_t ent; ! Object key; ! int sound = 0; ! ! for (int i=0 ; i<Globals.cl.frame.num_entities ; i++) { ! num = (Globals.cl.frame.parse_entities + i)&(Defines.MAX_PARSE_ENTITIES-1); ! ent = Globals.cl_parse_entities[num]; ! sound = ent.sound; ! ! if (sound == 0) continue; ! ! key = new Integer(ent.number); ! ch = (Channel)looptable.get(key); ! ! if (ch != null) { ! // keep on looping ! ch.autosound = true; ! ch.origin = ent.origin; ! continue; ! } ! ! sfx = Globals.cl.sound_precache[sound]; ! if (sfx == null) ! continue; // bad sound effect ! ! sc = sfx.cache; ! if (sc == null) ! continue; ! ! // allocate a channel ! ch = pickChannel(0, 0, buffers.get(sfx.bufferId), 6); ! if (ch == null) ! break; ! ! ch.addFixed(ent.origin); ! ch.autosound = true; ! ! looptable.put(key, ch); ! AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_TRUE); ! } ! ! removeUnusedLoopSounds(); ! ! } ! void removeUnusedLoopSounds() { ! Channel ch; ! // stop unused loopsounds ! for (Iterator iter = looptable.values().iterator(); iter.hasNext();) { ! ch = (Channel)iter.next(); ! if (!ch.autosound) { ! AL10.alSourceStop(ch.sourceId); ! AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! iter.remove(); ! ch.clear(); ! } ! } ! } ! ! void playChannels(float[] listenerOrigin) ! { ! float[] sourceOrigin = {0, 0, 0}; ! FloatBuffer sourceOriginBuffer=FloatBuffer.wrap(sourceOrigin); ! ! float[] entityOrigin = {0, 0, 0}; ! Channel ch; ! int sourceId; ! int state; ! ! for (int i = 0; i < num_channels; i++) { ! ch = channels[i]; ! if (ch.active) { ! sourceId = ch.sourceId; ! ! switch (ch.type) { ! case Channel.LISTENER: ! Math3D.VectorCopy(listenerOrigin, sourceOrigin); ! break; ! case Channel.DYNAMIC: ! CL_ents.GetEntitySoundOrigin(ch.entity, entityOrigin); ! convertVector(entityOrigin, sourceOrigin); ! break; ! case Channel.FIXED: ! convertVector(ch.origin, sourceOrigin); ! break; ! } ! ! if (ch.modified) { ! if (ch.bufferChanged) ! AL10.alSourcei (sourceId, AL10.AL_BUFFER, ch.bufferId); ! ! AL10.alSourcef (sourceId, AL10.AL_GAIN, s_volume.value); ! AL10.alSourcef (sourceId, AL10.AL_ROLLOFF_FACTOR, ch.rolloff); ! AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOriginBuffer,0); ! AL10.alSourcePlay(sourceId); ! ch.modified = false; ! } else { ! state = AL10.alGetSourcei(ch.sourceId, AL10.AL_SOURCE_STATE); ! if (state == AL10.AL_PLAYING) { ! AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOriginBuffer,0); ! } else { ! ch.clear(); ! } ! } ! ch.autosound = false; ! } ! } } --- 243,273 ---- public void Update(float[] origin, float[] forward, float[] right, float[] up) { ! Channel.convertVector(origin, listenerOrigin); ! AL10.nalListenerfv(AL10.AL_POSITION, listenerOrigin, 0); ! Channel.convertOrientation(forward, up, listenerOrientation); ! AL10.nalListenerfv(AL10.AL_ORIENTATION, listenerOrientation, 0); ! if (hasEAX){ if ((GameBase.gi.pointcontents.pointcontents(origin)& Defines.MASK_WATER)!= 0) { ! changeEnvironment(EAX20.EAX_ENVIRONMENT_UNDERWATER); } else { ! changeEnvironment(EAX20.EAX_ENVIRONMENT_GENERIC); } } ! Channel.addLoopSounds(); ! Channel.addPlaySounds(); ! Channel.playAllSounds(listenerOrigin, s_volume.value); } ! private IntBuffer eaxEnv = Lib.newIntBuffer(1); ! private int currentEnv = EAX20.EAX_ENVIRONMENT_UNDERWATER; ! private void changeEnvironment(int env) { ! if (env == currentEnv) return; ! currentEnv = env; ! eaxEnv.put(0, currentEnv); ! EAX20.eaxSet(EAX20.LISTENER_GUID, EAXListenerProperties.EAXLISTENER_ENVIRONMENT | EAXListenerProperties.EAXLISTENER_DEFERRED, 0, eaxEnv, 4); } *************** *** 519,542 **** */ public void StopAllSounds() { ! for (int i = 0; i < num_channels; i++) { ! AL10.alSourceStop(sources.get(i)); ! AL10.alSourcei(sources.get(i), AL10.AL_BUFFER, 0); ! channels[i].clear(); ! } ! } ! ! static void convertVector(float[] from, float[] to) { ! to[0] = from[0]; ! to[1] = from[2]; ! to[2] = -from[1]; ! } ! ! static void convertOrientation(float[] forward, float[] up, float[] orientation) { ! orientation[0] = forward[0]; ! orientation[1] = forward[2]; ! orientation[2] = -forward[1]; ! orientation[3] = up[0]; ! orientation[4] = up[2]; ! orientation[5] = -up[1]; } --- 276,281 ---- */ public void StopAllSounds() { ! PlaySound.reset(); ! Channel.reset(); } *************** *** 548,552 **** } - int s_registration_sequence; boolean s_registering; --- 287,290 ---- *************** *** 608,613 **** // determine what model the client is using ! // TODO configstrings for player male and female are wrong ! String model = "male"; int n = Globals.CS_PLAYERSKINS + ent.number - 1; if (Globals.cl.configstrings[n] != null) { --- 346,350 ---- // determine what model the client is using ! String model = null; int n = Globals.CS_PLAYERSKINS + ent.number - 1; if (Globals.cl.configstrings[n] != null) { *************** *** 631,653 **** sfx = FindName(sexedFilename, false); ! if (sfx == null) { ! // no, so see if it exists ! RandomAccessFile f = null; ! try { ! f = FS.FOpenFile(sexedFilename.substring(1)); ! } catch (IOException e) {} ! if (f != null) { ! // yes, close the file and register it ! try { ! FS.FCloseFile(f); ! } catch (IOException e1) {} ! sfx = RegisterSound(sexedFilename); ! } else { ! // no, revert to the male sound in the pak0.pak ! String maleFilename = "player/male/" + base.substring(1); ! sfx = AliasName(sexedFilename, maleFilename); ! } } ! return sfx; } --- 368,390 ---- sfx = FindName(sexedFilename, false); ! if (sfx != null) return sfx; ! ! // ! // fall back strategies ! // ! // not found , so see if it exists ! if (FS.FileLength(sexedFilename.substring(1)) > 0) { ! // yes, register it ! return RegisterSound(sexedFilename); } ! // try it with the female sound in the pak0.pak ! if (model.equalsIgnoreCase("female")) { ! String femaleFilename = "player/female/" + base.substring(1); ! if (FS.FileLength("sound/" + femaleFilename) > 0) ! return AliasName(sexedFilename, femaleFilename); ! } ! // no chance, revert to the male sound in the pak0.pak ! String maleFilename = "player/male/" + base.substring(1); ! return AliasName(sexedFilename, maleFilename); } Index: Channel.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/Channel.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** Channel.java 16 Dec 2004 20:17:55 -0000 1.1 --- Channel.java 31 Dec 2004 14:08:34 -0000 1.1.2.1 *************** *** 27,34 **** package jake2.sound.lwjgl; /** * Channel * ! * @author cwei */ public class Channel { --- 27,49 ---- package jake2.sound.lwjgl; + import jake2.Defines; + import jake2.Globals; + import jake2.client.CL_ents; + import jake2.game.entity_state_t; + import jake2.sound.sfx_t; + import jake2.sound.sfxcache_t; + import jake2.util.Lib; + import jake2.util.Math3D; + + import java.nio.FloatBuffer; + import java.nio.IntBuffer; + import java.util.*; + + import org.lwjgl.openal.AL10; + /** * Channel * ! * @author dsanders/cwei */ public class Channel { *************** *** 37,84 **** final static int FIXED = 1; final static int DYNAMIC = 2; ! ! int entnum; ! int entchannel; ! int bufferId; ! float rolloff; ! boolean autosound = false; ! int sourceId; ! boolean active = false; ! boolean modified = false; ! boolean bufferChanged = false; // sound attributes ! int type; ! int entity; ! float[] origin = {0, 0, 0}; ! ! Channel(int sourceId) { this.sourceId = sourceId; clear(); } ! void addListener() { ! type = LISTENER; } ! void addFixed(float[] origin) { ! type = FIXED; ! this.origin = origin; } - void addDynamic(int entity) { - type = DYNAMIC; - this.entity = entity; } ! void clear() { ! entnum = -1; ! entchannel = -1; ! bufferId = -1; ! bufferChanged = false; ! rolloff = 0; ! autosound = false; ! active = false; ! modified = false; } } --- 52,350 ---- final static int FIXED = 1; final static int DYNAMIC = 2; ! final static int MAX_CHANNELS = 32; ! private final static FloatBuffer NULLVECTOR = Lib.newFloatBuffer(3); + private static Channel[] channels = new Channel[MAX_CHANNELS]; + private static IntBuffer sources = Lib.newIntBuffer(MAX_CHANNELS); + // a reference of L:WJGLSoundImpl.buffers + private static IntBuffer buffers; + private static Map looptable = new Hashtable(MAX_CHANNELS); + + private static boolean isInitialized = false; + private static int numChannels; + // sound attributes ! private int type; ! private int entnum; ! private int entchannel; ! private int bufferId; ! private int sourceId; ! // private float volume; ! private float rolloff; ! private float[] origin = {0, 0, 0}; ! ! // update flags ! private boolean autosound = false; ! private boolean active = false; ! private boolean modified = false; ! private boolean bufferChanged = false; ! ! private Channel(int sourceId) { this.sourceId = sourceId; clear(); } ! private void clear() { ! entnum = entchannel = bufferId = -1; ! bufferChanged = false; ! // volume = 1.0f; ! rolloff = 0; ! autosound = false; ! active = false; ! modified = false; ! } ! ! private static IntBuffer tmp = Lib.newIntBuffer(1); ! ! static int init(IntBuffer buffers, float masterVolume) { ! Channel.buffers = buffers; ! // create channels ! int sourceId; ! int error; ! for (int i = 0; i < MAX_CHANNELS; i++) { ! ! AL10.alGenSources(tmp); ! sourceId = tmp.get(0); ! ! if (sourceId <= 0) break; ! ! sources.put(i, sourceId); ! ! channels[i] = new Channel(sourceId); ! numChannels++; ! ! // set default values for AL sources ! AL10.alSourcef (sourceId, AL10.AL_GAIN, masterVolume); ! AL10.alSourcef (sourceId, AL10.AL_PITCH, 1.0f); ! AL10.alSourcei (sourceId, AL10.AL_SOURCE_ABSOLUTE, AL10.AL_TRUE); ! AL10.nalSourcefv(sourceId, AL10.AL_VELOCITY, NULLVECTOR, 0); ! AL10.alSourcei (sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! AL10.alSourcef (sourceId, AL10.AL_REFERENCE_DISTANCE, 300.0f); ! AL10.alSourcef (sourceId, AL10.AL_MIN_GAIN, 0.0005f); ! AL10.alSourcef (sourceId, AL10.AL_MAX_GAIN, 1.0f); ! } ! isInitialized = true; ! return numChannels; ! } ! ! static void reset() { ! for (int i = 0; i < numChannels; i++) { ! AL10.alSourceStop(sources.get(i)); ! AL10.alSourcei(sources.get(i), AL10.AL_BUFFER, 0); ! channels[i].clear(); ! } } + + static void shutdown() { + AL10.alDeleteSources(sources); + numChannels = 0; + isInitialized = false; + } + + static void addPlaySounds() { + while (Channel.assign(PlaySound.nextPlayableSound())); + } + + private static boolean assign(PlaySound ps) { + if (ps == null) return false; + Channel ch = null; + int i; + for (i = 0; i < numChannels; i++) { + ch = channels[i]; + + if (ps.entchannel != 0 && ch.entnum == ps.entnum && ch.entchannel == ps.entchannel) { + // always override sound from same entity + if (ch.bufferId != ps.bufferId) { + AL10.alSourceStop(ch.sourceId); + } + break; + } + + // don't let monster sounds override player sounds + if ((ch.entnum == Globals.cl.playernum+1) && (ps.entnum != Globals.cl.playernum+1) && ch.bufferId != -1) + continue; + + // looking for a free AL source + if (!ch.active) { + break; + } + } ! if (i == numChannels) ! return false; ! ! ch.type = ps.type; ! if (ps.type == Channel.FIXED) ! Math3D.VectorCopy(ps.origin, ch.origin); ! ch.entnum = ps.entnum; ! ch.entchannel = ps.entchannel; ! ch.bufferChanged = (ch.bufferId != ps.bufferId); ! ch.bufferId = ps.bufferId; ! ch.rolloff = ps.attenuation * 2; ! //ch.volume = ps.volume; ! ch.active = true; ! ch.modified = true; ! return true; ! } ! ! private static Channel pickForLoop(int bufferId, float attenuation) { ! Channel ch; ! for (int i = 0; i < numChannels; i++) { ! ch = channels[i]; ! // looking for a free AL source ! if (!ch.active) { ! ch.entnum = 0; ! ch.entchannel = 0; ! ch.bufferChanged = (ch.bufferId != bufferId); ! ch.bufferId = bufferId; ! ch.rolloff = attenuation * 2; ! ch.active = true; ! ch.modified = true; ! return ch; ! } ! } ! return null; ! } ! ! private static FloatBuffer sourceOriginBuffer = Lib.newFloatBuffer(3); ! ! static void playAllSounds(FloatBuffer listenerOrigin, float masterVolume) { ! float[] entityOrigin = {0, 0, 0}; ! FloatBuffer sourceOrigin = sourceOriginBuffer; ! Channel ch; ! int sourceId; ! int state; ! ! for (int i = 0; i < numChannels; i++) { ! ch = channels[i]; ! if (ch.active) { ! sourceId = ch.sourceId; ! switch (ch.type) { ! case Channel.LISTENER: ! sourceOrigin = listenerOrigin; ! break; ! case Channel.DYNAMIC: ! CL_ents.GetEntitySoundOrigin(ch.entnum, entityOrigin); ! convertVector(entityOrigin, sourceOrigin); ! break; ! case Channel.FIXED: ! convertVector(ch.origin, sourceOrigin); ! break; ! } ! ! if (ch.modified) { ! if (ch.bufferChanged) { ! AL10.alSourcei(sourceId, AL10.AL_BUFFER, ch.bufferId); ! } ! // AL10.alSourcef (sourceId, AL10.AL_GAIN, masterVolume * ch.volume); ! AL10.alSourcef (sourceId, AL10.AL_GAIN, masterVolume); ! AL10.alSourcef (sourceId, AL10.AL_ROLLOFF_FACTOR, ch.rolloff); ! AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOrigin, 0); ! AL10.alSourcePlay(sourceId); ! ch.modified = false; ! } else { ! state = AL10.alGetSourcei(sourceId, AL10.AL_SOURCE_STATE); ! if (state == AL10.AL_PLAYING) { ! AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOrigin, 0); ! } else { ! ch.clear(); ! } ! } ! ch.autosound = false; ! } ! } } + + /* + * adddLoopSounds + * Entities with a ->sound field will generated looped sounds + * that are automatically started, stopped, and merged together + * as the entities are sent to the client + */ + static void addLoopSounds() { + + if ((Globals.cl_paused.value != 0.0f) || (Globals.cls.state != Globals.ca_active) || !Globals.cl.sound_prepped) { + removeUnusedLoopSounds(); + return; + } + + Channel ch; + sfx_t sfx; + sfxcache_t sc; + int num; + entity_state_t ent; + Object key; + int sound = 0; + + for (int i=0 ; i<Globals.cl.frame.num_entities ; i++) { + num = (Globals.cl.frame.parse_entities + i)&(Defines.MAX_PARSE_ENTITIES-1); + ent = Globals.cl_parse_entities[num]; + sound = ent.sound; + + if (sound == 0) continue; + + key = new Integer(ent.number); + ch = (Channel)looptable.get(key); + + if (ch != null) { + // keep on looping + ch.autosound = true; + Math3D.VectorCopy(ent.origin, ch.origin); + continue; + } + + sfx = Globals.cl.sound_precache[sound]; + if (sfx == null) + continue; // bad sound effect + + sc = sfx.cache; + if (sc == null) + continue; + + // allocate a channel + ch = Channel.pickForLoop(buffers.get(sfx.bufferId), 6); + if (ch == null) + break; + + ch.type = FIXED; + Math3D.VectorCopy(ent.origin, ch.origin); + ch.autosound = true; + + looptable.put(key, ch); + AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_TRUE); + } + + removeUnusedLoopSounds(); } ! private static void removeUnusedLoopSounds() { ! Channel ch; ! // stop unused loopsounds ! for (Iterator iter = looptable.values().iterator(); iter.hasNext();) { ! ch = (Channel)iter.next(); ! if (!ch.autosound) { ! AL10.alSourceStop(ch.sourceId); ! AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! iter.remove(); ! ch.clear(); ! } ! } ! } ! ! static void convertVector(float[] from, FloatBuffer to) { ! to.put(0, from[0]); ! to.put(1, from[2]); ! to.put(2, -from[1]); } + + static void convertOrientation(float[] forward, float[] up, FloatBuffer orientation) { + orientation.put(0, forward[0]); + orientation.put(1, forward[2]); + orientation.put(2, -forward[1]); + orientation.put(3, up[0]); + orientation.put(4, up[2]); + orientation.put(5, -up[1]); + } + } |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:16
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/game Modified Files: Tag: RST M_Soldier.java GameUtil.java Log Message: Index: M_Soldier.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/M_Soldier.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** M_Soldier.java 22 Sep 2004 19:22:04 -0000 1.3 --- M_Soldier.java 31 Dec 2004 14:08:33 -0000 1.3.6.1 *************** *** 24,27 **** --- 24,28 ---- import jake2.Defines; + import jake2.qcommon.Com; import jake2.util.Lib; import jake2.util.Math3D; *************** *** 1460,1463 **** --- 1461,1469 ---- static EntThinkAdapter SP_monster_soldier = new EntThinkAdapter() { public boolean think(edict_t self) { + Com.Printf("Sapwning a soldier at " + self.s.origin[0] + " " + + self.s.origin[1] + " " + + self.s.origin[2] + " " + + "\n"); + if (GameBase.deathmatch.value != 0) { GameUtil.G_FreeEdict(self); Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** GameUtil.java 22 Sep 2004 19:22:05 -0000 1.7 --- GameUtil.java 31 Dec 2004 14:08:33 -0000 1.7.6.1 *************** *** 606,609 **** --- 606,610 ---- public static void Killed(edict_t targ, edict_t inflictor, edict_t attacker, int damage, float[] point) { + Com.Printf("Killing a " + targ.classname + "\n"); if (targ.health < -999) targ.health = -999; |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:12
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/qcommon Modified Files: Tag: RST Qcommon.java Log Message: Index: Qcommon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Qcommon.java,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** Qcommon.java 3 Nov 2004 08:53:27 -0000 1.12 --- Qcommon.java 31 Dec 2004 14:08:32 -0000 1.12.2.1 *************** *** 78,87 **** Jake2.Q2Dialog.setStatus("loading config..."); ! reconfigure(); FS.setCDDir(); // use cddir from config.cfg FS.markBaseSearchPaths(); // mark the default search paths Jake2.Q2Dialog.testQ2Data(); // test for valid baseq2 ! reconfigure(); // reload default.cfg and config.cfg // --- 78,87 ---- Jake2.Q2Dialog.setStatus("loading config..."); ! reconfigure(false); FS.setCDDir(); // use cddir from config.cfg FS.markBaseSearchPaths(); // mark the default search paths Jake2.Q2Dialog.testQ2Data(); // test for valid baseq2 ! reconfigure(true); // reload default.cfg and config.cfg // *************** *** 234,238 **** } ! static void reconfigure() { Cbuf.AddText("exec default.cfg\n"); Cbuf.AddText("bind MWHEELUP weapnext\n"); --- 234,238 ---- } ! static void reconfigure(boolean clear) { Cbuf.AddText("exec default.cfg\n"); Cbuf.AddText("bind MWHEELUP weapnext\n"); *************** *** 242,246 **** Cbuf.AddText("exec config.cfg\n"); ! Cbuf.AddEarlyCommands(true); Cbuf.Execute(); } --- 242,246 ---- Cbuf.AddText("exec config.cfg\n"); ! Cbuf.AddEarlyCommands(clear); Cbuf.Execute(); } |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:07
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/render/lwjgl Modified Files: Tag: RST LWJGLBase.java Log Message: Index: LWJGLBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/LWJGLBase.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** LWJGLBase.java 16 Dec 2004 19:53:41 -0000 1.1 --- LWJGLBase.java 31 Dec 2004 14:08:38 -0000 1.1.2.1 *************** *** 1,365 **** ! /* ! * LWJGLBase.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.lwjgl; ! ! import jake2.Defines; ! import jake2.client.VID; ! import jake2.client.viddef_t; ! import jake2.game.cvar_t; ! import jake2.qcommon.xcommand_t; ! ! import java.awt.Dimension; ! import java.util.LinkedList; ! ! import org.lwjgl.LWJGLException; ! import org.lwjgl.opengl.Display; ! import org.lwjgl.opengl.DisplayMode; ! import org.lwjgl.opengl.GL11; ! import org.lwjgl.util.GLImpl; ! ! public abstract class LWJGLBase { ! // IMPORTED FUNCTIONS ! protected DisplayMode oldDisplayMode; ! ! protected GLImpl gl=new GLImpl(); ! ! // window position on the screen ! int window_xpos, window_ypos; ! protected viddef_t vid = new viddef_t(); ! ! // handles the post initialization with JoglRenderer ! protected boolean post_init = false; ! protected boolean contextInUse = false; ! protected abstract boolean R_Init2(); ! ! protected final xcommand_t INIT_CALLBACK = new xcommand_t() { ! public void execute() { ! // only used for the first run (initialization) ! // clear the screen ! gl.glClearColor(0, 0, 0, 0); ! gl.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); ! ! // ! // check the post init process ! // ! if (!post_init) { ! VID.Printf(Defines.PRINT_ALL, "Missing multi-texturing for FastJOGL renderer\n"); ! } ! ! GLimp_EndFrame(); ! } ! }; ! protected xcommand_t callback = INIT_CALLBACK; ! ! protected cvar_t vid_fullscreen; ! ! // enum rserr_t ! protected static final int rserr_ok = 0; ! protected static final int rserr_invalid_fullscreen = 1; ! protected static final int rserr_invalid_mode = 2; ! protected static final int rserr_unknown = 3; ! ! private java.awt.DisplayMode toAwtDisplayMode(DisplayMode m) ! { ! return new java.awt.DisplayMode(m.getWidth(),m.getHeight(),m.getBitsPerPixel(),m.getFrequency()); ! } ! ! public java.awt.DisplayMode[] getModeList() ! { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(toAwtDisplayMode(oldDisplayMode)); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! java.awt.DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (java.awt.DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(toAwtDisplayMode(m)); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, toAwtDisplayMode(m)); ! } else if (m.getFrequency() > ml.getRefreshRate()){ ! l.remove(j); ! l.add(j, toAwtDisplayMode(m)); ! } ! } ! java.awt.DisplayMode[] ma = new java.awt.DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! public DisplayMode[] getLWJGLModeList() { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(oldDisplayMode); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(m); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, m); ! } else if (m.getFrequency() > ml.getFrequency()){ ! l.remove(j); ! l.add(j, m); ! } ! } ! DisplayMode[] ma = new DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! private DisplayMode findDisplayMode(Dimension dim) { ! DisplayMode mode = null; ! DisplayMode m = null; ! DisplayMode[] modes = getLWJGLModeList(); ! int w = dim.width; ! int h = dim.height; ! ! for (int i = 0; i < modes.length; i++) { ! m = modes[i]; ! if (m.getWidth() == w && m.getHeight() == h) { ! mode = m; ! break; ! } ! } ! if (mode == null) mode = oldDisplayMode; ! return mode; ! } ! ! String getModeString(DisplayMode m) { ! StringBuffer sb = new StringBuffer(); ! sb.append(m.getWidth()); ! sb.append('x'); ! sb.append(m.getHeight()); ! sb.append('x'); ! sb.append(m.getBitsPerPixel()); ! sb.append('@'); ! sb.append(m.getFrequency()); ! sb.append("Hz"); ! return sb.toString(); ! } ! ! /** ! * @param dim ! * @param mode ! * @param fullscreen ! * @return enum rserr_t ! */ ! protected int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen) { ! ! Dimension newDim = new Dimension(); ! ! VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); ! ! VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); ! ! /* ! * fullscreen handling ! */ ! if (oldDisplayMode == null) { ! oldDisplayMode = Display.getDisplayMode(); ! } ! ! if (!VID.GetModeInfo(newDim, mode)) { ! VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); ! return rserr_invalid_mode; ! } ! ! VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); ! ! // destroy the existing window ! GLimp_Shutdown(); ! ! Display.setTitle("Jake2"); ! ! DisplayMode displayMode = findDisplayMode(newDim); ! newDim.width = displayMode.getWidth(); ! newDim.height = displayMode.getHeight(); ! ! if (fullscreen) ! { ! try { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! Display.setLocation(0,0); ! ! try { ! Display.setFullscreen(fullscreen); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! ! VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); ! ! } ! else ! { ! try ! { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! try { ! Display.setFullscreen(false); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! Display.setLocation(window_xpos, window_ypos); ! } ! ! vid.width = newDim.width; ! vid.height = newDim.height; ! ! try ! { ! Display.create(); ! } ! catch (LWJGLException e) ! { ! return rserr_unknown; ! } ! ! // let the sound and input subsystems know about the new window ! VID.NewWindow(vid.width, vid.height); ! ! post_init = R_Init2(); ! ! updateScreen(); ! ! return rserr_ok; ! } ! ! protected void GLimp_Shutdown() { ! if (oldDisplayMode != null && Display.isFullscreen()) { ! try { ! Display.setFullscreen(false); ! Display.setDisplayMode(oldDisplayMode); ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! if (Display.isCreated()) Display.destroy(); ! ! post_init = false; ! callback = INIT_CALLBACK; ! } ! ! /** ! * @return true ! */ ! protected boolean GLimp_Init(int xpos, int ypos) { ! // do nothing ! window_xpos = xpos; ! window_ypos = ypos; ! return true; ! } ! ! protected void GLimp_EndFrame() { ! gl.glFlush(); ! // swap buffer ! // TODO this and a new JOGL-release solves the flickering bug (Loading) ! // canvas.swapBuffers(); ! } ! protected void GLimp_BeginFrame(float camera_separation) { ! // do nothing ! } ! ! protected void GLimp_AppActivate(boolean activate) { ! // do nothing ! } ! ! protected void GLimp_EnableLogging(boolean enable) { ! // doesn't need jogl logging ! // do nothing ! } ! ! protected void GLimp_LogNewFrame() { ! // doesn't need jogl logging ! // do nothing ! } ! ! /* ! * @see jake2.client.refexport_t#updateScreen() ! */ ! public void updateScreen() { ! this.callback = INIT_CALLBACK; ! ! contextInUse = true; ! callback.execute(); ! contextInUse = false; ! ! Display.update(); ! } ! ! public void updateScreen(xcommand_t callback) { ! this.callback = callback; ! ! contextInUse = true; ! callback.execute(); ! contextInUse = false; ! ! Display.update(); ! } ! } --- 1,324 ---- ! /* ! * LWJGLBase.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.lwjgl; ! ! import jake2.Defines; ! import jake2.client.VID; ! import jake2.client.viddef_t; ! import jake2.game.cvar_t; ! import jake2.qcommon.xcommand_t; ! ! import java.awt.Dimension; ! import java.util.LinkedList; ! ! import org.lwjgl.LWJGLException; ! import org.lwjgl.opengl.Display; ! import org.lwjgl.opengl.DisplayMode; ! import org.lwjgl.util.GLImpl; ! ! /** ! * LWJGLBase ! * ! * @author dsanders/cwei ! */ ! public abstract class LWJGLBase { ! // IMPORTED FUNCTIONS ! protected DisplayMode oldDisplayMode; ! ! protected GLImpl gl = new GLImpl(); ! ! // window position on the screen ! int window_xpos, window_ypos; ! protected viddef_t vid = new viddef_t(); ! ! // handles the post initialization with LWJGLRenderer ! protected abstract boolean R_Init2(); ! ! protected cvar_t vid_fullscreen; ! ! // enum rserr_t ! protected static final int rserr_ok = 0; ! protected static final int rserr_invalid_fullscreen = 1; ! protected static final int rserr_invalid_mode = 2; ! protected static final int rserr_unknown = 3; ! ! private java.awt.DisplayMode toAwtDisplayMode(DisplayMode m) ! { ! return new java.awt.DisplayMode(m.getWidth(),m.getHeight(),m.getBitsPerPixel(),m.getFrequency()); ! } ! ! public java.awt.DisplayMode[] getModeList() ! { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(toAwtDisplayMode(oldDisplayMode)); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! java.awt.DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (java.awt.DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(toAwtDisplayMode(m)); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, toAwtDisplayMode(m)); ! } else if (m.getFrequency() > ml.getRefreshRate()){ ! l.remove(j); ! l.add(j, toAwtDisplayMode(m)); ! } ! } ! java.awt.DisplayMode[] ma = new java.awt.DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! public DisplayMode[] getLWJGLModeList() { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(oldDisplayMode); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(m); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, m); ! } else if (m.getFrequency() > ml.getFrequency()){ ! l.remove(j); ! l.add(j, m); ! } ! } ! DisplayMode[] ma = new DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! private DisplayMode findDisplayMode(Dimension dim) { ! DisplayMode mode = null; ! DisplayMode m = null; ! DisplayMode[] modes = getLWJGLModeList(); ! int w = dim.width; ! int h = dim.height; ! ! for (int i = 0; i < modes.length; i++) { ! m = modes[i]; ! if (m.getWidth() == w && m.getHeight() == h) { ! mode = m; ! break; ! } ! } ! if (mode == null) mode = oldDisplayMode; ! return mode; ! } ! ! String getModeString(DisplayMode m) { ! StringBuffer sb = new StringBuffer(); ! sb.append(m.getWidth()); ! sb.append('x'); ! sb.append(m.getHeight()); ! sb.append('x'); ! sb.append(m.getBitsPerPixel()); ! sb.append('@'); ! sb.append(m.getFrequency()); ! sb.append("Hz"); ! return sb.toString(); ! } ! ! /** ! * @param dim ! * @param mode ! * @param fullscreen ! * @return enum rserr_t ! */ ! protected int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen) { ! ! Dimension newDim = new Dimension(); ! ! VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); ! ! VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); ! ! /* ! * fullscreen handling ! */ ! if (oldDisplayMode == null) { ! oldDisplayMode = Display.getDisplayMode(); ! } ! ! if (!VID.GetModeInfo(newDim, mode)) { ! VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); ! return rserr_invalid_mode; ! } ! ! VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); ! ! // destroy the existing window ! GLimp_Shutdown(); ! ! Display.setTitle("Jake2"); ! ! DisplayMode displayMode = findDisplayMode(newDim); ! newDim.width = displayMode.getWidth(); ! newDim.height = displayMode.getHeight(); ! ! if (fullscreen) ! { ! try { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! Display.setLocation(0,0); ! ! try { ! Display.setFullscreen(fullscreen); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! ! VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); ! ! } ! else ! { ! try ! { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! try { ! Display.setFullscreen(false); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! Display.setLocation(window_xpos, window_ypos); ! } ! ! vid.width = newDim.width; ! vid.height = newDim.height; ! ! try ! { ! Display.create(); ! } ! catch (LWJGLException e) ! { ! return rserr_unknown; ! } ! ! // let the sound and input subsystems know about the new window ! VID.NewWindow(vid.width, vid.height); ! return rserr_ok; ! } ! ! protected void GLimp_Shutdown() { ! if (oldDisplayMode != null && Display.isFullscreen()) { ! try { ! Display.setDisplayMode(oldDisplayMode); ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! while (Display.isCreated()) { ! Display.destroy(); ! } ! } ! ! /** ! * @return true ! */ ! protected boolean GLimp_Init(int xpos, int ypos) { ! // do nothing ! window_xpos = xpos; ! window_ypos = ypos; ! return true; ! } ! ! protected void GLimp_EndFrame() { ! gl.glFlush(); ! // swap buffers ! Display.update(); ! } ! ! protected void GLimp_BeginFrame(float camera_separation) { ! // do nothing ! } ! ! protected void GLimp_AppActivate(boolean activate) { ! // do nothing ! } ! ! protected void GLimp_EnableLogging(boolean enable) { ! // do nothing ! } ! ! protected void GLimp_LogNewFrame() { ! // do nothing ! } ! ! /** ! * this is a hack for jogl renderers. ! * @param callback ! */ ! public final void updateScreen(xcommand_t callback) { ! callback.execute(); ! } ! } |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:07
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/render Modified Files: Tag: RST LWJGLRenderer.java Log Message: Index: LWJGLRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/LWJGLRenderer.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** LWJGLRenderer.java 14 Dec 2004 12:57:14 -0000 1.2 --- LWJGLRenderer.java 31 Dec 2004 14:08:53 -0000 1.2.2.1 *************** *** 1,313 **** ! /* ! * LWJGLRenderer.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.lwjgl.Misc; ! import jake2.sys.KBD; ! import jake2.sys.LWJGLKBD; ! ! import java.awt.Dimension; ! ! /** ! * LWJGLRenderer ! * ! * @author dsanders/cwei ! */ ! final class LWJGLRenderer extends Misc implements refexport_t, Ref { ! ! private LWJGLKBD kbd=new LWJGLKBD(); ! ! public static final String DRIVER_NAME = "lwjgl"; ! ! 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) { ! ! // pre init ! if (!R_Init(vid_xpos, vid_ypos)) return false; ! // calls the R_Init2() internally ! updateScreen(); ! // the result from R_Init2() ! return post_init; ! } ! ! /** ! * @see jake2.client.refexport_t#Shutdown() ! */ ! public void Shutdown() { ! R_Shutdown(); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginRegistration(java.lang.String) ! */ ! public void BeginRegistration(String map) { ! if (contextInUse) { ! R_BeginRegistration(map); ! return; ! } ! this.name = map; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! R_BeginRegistration(LWJGLRenderer.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 R_RegisterModel(name); ! ! model = null; ! this.name = name; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! LWJGLRenderer.this.model = R_RegisterModel(LWJGLRenderer.this.name); ! } ! }); ! return model; ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterSkin(java.lang.String) ! */ ! public image_t RegisterSkin(String name) { ! if (contextInUse) ! return R_RegisterSkin(name); ! ! this.image = null; ! this.name = name; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! LWJGLRenderer.this.image = R_RegisterSkin(LWJGLRenderer.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 Draw_FindPic(name); ! ! this.image = null; ! this.name = name; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! LWJGLRenderer.this.image = Draw_FindPic(LWJGLRenderer.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) { ! R_SetSky(name, rotate, axis); ! return; ! } ! ! this.name = name; ! this.rotate = rotate; ! this.axis = axis; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! R_SetSky(LWJGLRenderer.this.name, LWJGLRenderer.this.rotate, LWJGLRenderer.this.axis); ! } ! }); ! ! } ! ! /** ! * @see jake2.client.refexport_t#EndRegistration() ! */ ! public void EndRegistration() { ! if (contextInUse) { ! R_EndRegistration(); ! return; ! } ! ! updateScreen(new xcommand_t() { ! public void execute() { ! R_EndRegistration(); ! } ! }); ! } ! ! /** ! * @see jake2.client.refexport_t#RenderFrame(jake2.client.refdef_t) ! */ ! public void RenderFrame(refdef_t fd) { ! R_RenderFrame(fd); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawGetPicSize(java.awt.Dimension, java.lang.String) ! */ ! public void DrawGetPicSize(Dimension dim, String name) { ! Draw_GetPicSize(dim, name); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawPic(int, int, java.lang.String) ! */ ! public void DrawPic(int x, int y, String name) { ! 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) { ! Draw_StretchPic(x, y, w, h, name); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawChar(int, int, int) ! */ ! public void DrawChar(int x, int y, int num) { ! Draw_Char(x, y, 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) { ! 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) { ! Draw_Fill(x, y, w, h, c); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawFadeScreen() ! */ ! public void DrawFadeScreen() { ! 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) { ! Draw_StretchRaw(x, y, w, h, cols, rows, data); ! } ! ! /** ! * @see jake2.client.refexport_t#CinematicSetPalette(byte[]) ! */ ! public void CinematicSetPalette(byte[] palette) { ! R_SetPalette(palette); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginFrame(float) ! */ ! public void BeginFrame(float camera_separation) { ! R_BeginFrame(camera_separation); ! } ! ! /** ! * @see jake2.client.refexport_t#EndFrame() ! */ ! public void EndFrame() { ! GLimp_EndFrame(); ! } ! ! /** ! * @see jake2.client.refexport_t#AppActivate(boolean) ! */ ! public void AppActivate(boolean activate) { ! GLimp_AppActivate(activate); ! } ! ! public int apiVersion() { ! return Defines.API_VERSION; ! } ! ! // ============================================================================ ! // Ref interface ! // ============================================================================ ! ! public String getName() { ! return DRIVER_NAME; ! } ! ! public String toString() { ! return DRIVER_NAME; ! } ! ! public refexport_t GetRefAPI() { ! return this; ! } ! ! public KBD getKeyboardHandler() { return kbd; } } \ No newline at end of file --- 1,235 ---- ! /* ! * LWJGLRenderer.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.render.lwjgl.Misc; ! import jake2.sys.KBD; ! import jake2.sys.LWJGLKBD; ! ! import java.awt.Dimension; ! ! /** ! * LWJGLRenderer ! * ! * @author dsanders/cwei ! */ ! final class LWJGLRenderer extends Misc implements refexport_t, Ref { ! ! private LWJGLKBD kbd=new LWJGLKBD(); ! ! public static final String DRIVER_NAME = "lwjgl"; ! ! 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) { ! ! // pre init ! if (!R_Init(vid_xpos, vid_ypos)) return false; ! // post init ! boolean ok = R_Init2(); ! if (!ok) { ! VID.Printf(Defines.PRINT_ALL, "Missing multi-texturing for LWJGL renderer\n"); ! } ! return ok; ! } ! ! /** ! * @see jake2.client.refexport_t#Shutdown() ! */ ! public void Shutdown() { ! R_Shutdown(); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginRegistration(java.lang.String) ! */ ! public final void BeginRegistration(String map) { ! R_BeginRegistration(map); ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterModel(java.lang.String) ! */ ! public final model_t RegisterModel(String name) { ! return R_RegisterModel(name); ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterSkin(java.lang.String) ! */ ! public final image_t RegisterSkin(String name) { ! return R_RegisterSkin(name); ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterPic(java.lang.String) ! */ ! public final image_t RegisterPic(String name) { ! return Draw_FindPic(name); ! } ! /** ! * @see jake2.client.refexport_t#SetSky(java.lang.String, float, float[]) ! */ ! public final void SetSky(String name, float rotate, float[] axis) { ! R_SetSky(name, rotate, axis); ! } ! ! /** ! * @see jake2.client.refexport_t#EndRegistration() ! */ ! public final void EndRegistration() { ! R_EndRegistration(); ! } ! ! /** ! * @see jake2.client.refexport_t#RenderFrame(jake2.client.refdef_t) ! */ ! public final void RenderFrame(refdef_t fd) { ! R_RenderFrame(fd); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawGetPicSize(java.awt.Dimension, java.lang.String) ! */ ! public final void DrawGetPicSize(Dimension dim, String name) { ! 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) { ! 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) { ! 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) { ! 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) { ! 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) { ! Draw_Fill(x, y, w, h, c); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawFadeScreen() ! */ ! public final void DrawFadeScreen() { ! 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) { ! Draw_StretchRaw(x, y, w, h, cols, rows, data); ! } ! ! /** ! * @see jake2.client.refexport_t#CinematicSetPalette(byte[]) ! */ ! public final void CinematicSetPalette(byte[] palette) { ! R_SetPalette(palette); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginFrame(float) ! */ ! public final void BeginFrame(float camera_separation) { ! R_BeginFrame(camera_separation); ! } ! ! /** ! * @see jake2.client.refexport_t#EndFrame() ! */ ! public final void EndFrame() { ! GLimp_EndFrame(); ! } ! ! /** ! * @see jake2.client.refexport_t#AppActivate(boolean) ! */ ! public final void AppActivate(boolean activate) { ! GLimp_AppActivate(activate); ! } ! ! public final int apiVersion() { ! return Defines.API_VERSION; ! } ! ! // ============================================================================ ! // Ref interface ! // ============================================================================ ! ! public final String getName() { ! return DRIVER_NAME; ! } ! ! public final String toString() { ! return DRIVER_NAME; ! } ! ! public final refexport_t GetRefAPI() { ! return this; ! } ! ! public final KBD getKeyboardHandler() { return kbd; } } \ No newline at end of file |
From: Rene S. <sa...@us...> - 2004-12-31 14:09:07
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1235/src/jake2/sys Modified Files: Tag: RST LWJGLKBD.java Log Message: Index: LWJGLKBD.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/LWJGLKBD.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** LWJGLKBD.java 16 Dec 2004 22:45:54 -0000 1.6 --- LWJGLKBD.java 31 Dec 2004 14:08:54 -0000 1.6.2.1 *************** *** 82,94 **** } ! while (Mouse.next()) ! { ! int button=Mouse.getEventButton(); ! if (button >= 0) ! { if (button == 1 && mouseHasTwoButtons) { button = 2; // A three button mouse numbering scheme... } Do_Key_Event(Key.K_MOUSE1 + button, Mouse.getEventButtonState()); } } --- 82,101 ---- } ! while (Mouse.next()) { ! int button = Mouse.getEventButton(); ! if (button >= 0) { if (button == 1 && mouseHasTwoButtons) { button = 2; // A three button mouse numbering scheme... } Do_Key_Event(Key.K_MOUSE1 + button, Mouse.getEventButtonState()); + } else { + button = Mouse.getEventDWheel(); + if (button > 0) { + Do_Key_Event(Key.K_MWHEELUP, true); + Do_Key_Event(Key.K_MWHEELUP, false); + } else if (button < 0) { + Do_Key_Event(Key.K_MWHEELDOWN, true); + Do_Key_Event(Key.K_MWHEELDOWN, false); + } } } |
From: Carsten W. <ca...@us...> - 2004-12-23 00:52:31
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31871/src/jake2/sound/lwjgl Modified Files: LWJGLSoundImpl.java Channel.java Added Files: PlaySound.java Log Message: synchronized with joal sound driver; --- NEW FILE: PlaySound.java --- /* * Created on Dec 22, 2004 * * Copyright (C) 2003 * * $Id: PlaySound.java,v 1.1 2004/12/23 00:52:12 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.sound.lwjgl; import jake2.Globals; import jake2.util.Math3D; /** * PlaySound * * @author cwei */ public class PlaySound { final static int MAX_PLAYSOUNDS = 128; // list with sentinel private static PlaySound freeList; private static PlaySound playableList; private static PlaySound[] backbuffer = new PlaySound[MAX_PLAYSOUNDS]; static { for (int i = 0; i < backbuffer.length; i++) { backbuffer[i] = new PlaySound(); } // init the sentinels freeList = new PlaySound(); playableList = new PlaySound(); // reset the lists reset(); } // sound attributes int type; int entnum; int entchannel; int bufferId; // float volume; float attenuation; float[] origin = {0,0,0}; // begin time in ms private long beginTime; // for linked list private PlaySound prev, next; private PlaySound() { prev = next = null; this.clear(); } private void clear() { type = bufferId = entnum = entchannel = -1; // volume = attenuation = beginTime = 0; attenuation = beginTime = 0; // Math3D.VectorClear(origin); } static void reset() { // init the sentinels freeList.next = freeList.prev = freeList; playableList.next = playableList.prev = playableList; // concat the the freeList PlaySound ps; for (int i = 0; i < backbuffer.length; i++) { ps = backbuffer[i]; ps.clear(); ps.prev = freeList; ps.next = freeList.next; ps.prev.next = ps; ps.next.prev = ps; } } static PlaySound nextPlayableSound() { PlaySound ps = null; while (true) { ps = playableList.next; if (ps == playableList || ps.beginTime > Globals.cl.time) return null; PlaySound.release(ps); return ps; } } private static PlaySound get() { PlaySound ps = freeList.next; if (ps == freeList) return null; ps.prev.next = ps.next; ps.next.prev = ps.prev; return ps; } private static void add(PlaySound ps) { PlaySound sort = playableList.next; for (; sort != playableList && sort.beginTime < ps.beginTime; sort = sort.next); ps.next = sort; ps.prev = sort.prev; ps.next.prev = ps; ps.prev.next = ps; } private static void release(PlaySound ps) { ps.prev.next = ps.next; ps.next.prev = ps.prev; // add to free list ps.next = freeList.next; freeList.next.prev = ps; ps.prev = freeList; freeList.next = ps; } static void allocate(float[] origin, int entnum, int entchannel, int bufferId, float volume, float attenuation, float timeoffset) { PlaySound ps = PlaySound.get(); if (ps != null) { // find the right sound type if (entnum == Globals.cl.playernum + 1) { ps.type = Channel.LISTENER; } else if (origin != null) { ps.type = Channel.FIXED; Math3D.VectorCopy(origin, ps.origin); } else { ps.type = Channel.DYNAMIC; } ps.entnum = entnum; ps.entchannel = entchannel; ps.bufferId = bufferId; // ps.volume = volume; ps.attenuation = attenuation; ps.beginTime = Globals.cl.time + (long)(timeoffset * 1000); PlaySound.add(ps); } else { System.err.println("PlaySounds out of Limit"); } } } Index: LWJGLSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/LWJGLSoundImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LWJGLSoundImpl.java 21 Dec 2004 00:42:31 -0000 1.3 --- LWJGLSoundImpl.java 23 Dec 2004 00:52:12 -0000 1.4 *************** *** 9,33 **** import jake2.Defines; import jake2.Globals; - import jake2.client.CL; - import jake2.client.CL_ents; import jake2.game.*; import jake2.qcommon.*; import jake2.sound.*; ! import jake2.util.*; - import java.io.IOException; - import java.io.RandomAccessFile; import java.nio.*; - import java.util.*; - import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.openal.*; import org.lwjgl.openal.eax.*; - import org.lwjgl.openal.eax.EAX20; - import org.lwjgl.openal.eax.EAXListenerProperties; /** * LWJGLSoundImpl */ public final class LWJGLSoundImpl implements Sound { --- 9,28 ---- import jake2.Defines; import jake2.Globals; import jake2.game.*; import jake2.qcommon.*; import jake2.sound.*; ! import jake2.util.Lib; ! import jake2.util.Vargs; import java.nio.*; import org.lwjgl.LWJGLException; import org.lwjgl.openal.*; import org.lwjgl.openal.eax.*; /** * LWJGLSoundImpl + * + * @author dsanders/cwei */ public final class LWJGLSoundImpl implements Sound { *************** *** 42,51 **** private static final int MAX_SFX = Defines.MAX_SOUNDS * 2; - private static final int MAX_CHANNELS = 32; ! private IntBuffer buffers = BufferUtils.createIntBuffer(MAX_SFX); ! private IntBuffer sources = BufferUtils.createIntBuffer(MAX_CHANNELS); ! private Channel[] channels = null; ! private int num_channels = 0; // singleton --- 37,42 ---- private static final int MAX_SFX = Defines.MAX_SOUNDS * 2; ! private IntBuffer buffers = Lib.newIntBuffer(MAX_SFX); // singleton *************** *** 72,76 **** AL10.alGenBuffers(buffers); s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); ! initChannels(); AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED); Cmd.AddCommand("play", new xcommand_t() { --- 63,68 ---- AL10.alGenBuffers(buffers); s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); ! int count = Channel.init(buffers, s_volume.value); ! Com.Printf("... using " + count + " channels\n"); AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED); Cmd.AddCommand("play", new xcommand_t() { *************** *** 97,101 **** num_sfx = 0; - Com.Printf("sound sampling rate: 44100Hz\n"); --- 89,92 ---- *************** *** 159,196 **** } ! private void initChannels() { ! ! // create channels ! channels = new Channel[MAX_CHANNELS]; ! ! int sourceId; ! IntBuffer tmp = BufferUtils.createIntBuffer(1); ! int error; ! for (int i = 0; i < MAX_CHANNELS; i++) { ! ! AL10.alGenSources(tmp); ! sourceId = tmp.get(0); ! ! //if ((error = al.alGetError()) != AL.AL_NO_ERROR) break; ! if (sourceId <= 0) break; ! ! sources.put(i, sourceId); ! ! channels[i] = new Channel(sourceId); ! num_channels++; ! ! // set default values for AL sources ! AL10.alSourcef (sourceId, AL10.AL_GAIN, s_volume.value); ! AL10.alSourcef (sourceId, AL10.AL_PITCH, 1.0f); ! AL10.alSourcei (sourceId, AL10.AL_SOURCE_ABSOLUTE, AL10.AL_TRUE); ! AL10.nalSourcefv(sourceId, AL10.AL_VELOCITY, NULLVECTOR_BUFFER,0); ! AL10.alSourcei (sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! AL10.alSourcef (sourceId, AL10.AL_REFERENCE_DISTANCE, 300.0f); ! AL10.alSourcef (sourceId, AL10.AL_MIN_GAIN, 0.0005f); ! AL10.alSourcef (sourceId, AL10.AL_MAX_GAIN, 1.0f); ! } ! Com.Printf("... using " + num_channels + " channels\n"); ! } ! /* (non-Javadoc) --- 150,156 ---- } ! // TODO check the sfx direct buffer size ! // 2MB sfx buffer ! ByteBuffer sfxDataBuffer = Lib.newByteBuffer(2 * 1024 * 1024); /* (non-Javadoc) *************** *** 204,210 **** int format = AL10.AL_FORMAT_MONO16; ! ByteBuffer data = BufferUtils.createByteBuffer(sfx.cache.data.length); ! data.put(sfx.cache.data); data.rewind(); int freq = sfx.cache.speed; --- 164,171 ---- int format = AL10.AL_FORMAT_MONO16; ! ByteBuffer data = sfxDataBuffer.slice(); ! data.put(sfx.cache.data, 0, sfx.cache.data.length); data.rewind(); + data.limit(sfx.cache.data.length); int freq = sfx.cache.speed; *************** *** 236,241 **** public void Shutdown() { StopAllSounds(); ! ! AL10.alDeleteSources(sources); AL10.alDeleteBuffers(buffers); exitOpenAL(); --- 197,201 ---- public void Shutdown() { StopAllSounds(); ! Channel.shutdown(); AL10.alDeleteBuffers(buffers); exitOpenAL(); *************** *** 253,264 **** } num_sfx = 0; - num_channels = 0; } - //private final static float[] NULLVECTOR = {0, 0, 0}; - private final static FloatBuffer NULLVECTOR_BUFFER=Lib.newFloatBuffer(3); - private float[] entityOrigin = {0, 0, 0}; - private float[] sourceOrigin = {0, 0, 0}; - /* (non-Javadoc) * @see jake2.sound.SoundImpl#StartSound(float[], int, int, jake2.sound.sfx_t, float, float, float) --- 213,218 ---- *************** *** 278,339 **** attenuation *= 0.5f; ! Channel ch = pickChannel(entnum, entchannel, buffers.get(sfx.bufferId), attenuation); ! ! if (ch == null) return; ! ! if (entnum == Globals.cl.playernum + 1) { ! ch.addListener(); ! } else if (origin != null) { ! ch.addFixed(origin); ! } else { ! ch.addDynamic(entnum); ! } ! } ! ! Channel pickChannel(int entnum, int entchannel, int bufferId, float rolloff) { ! ! Channel ch = null; ! int state; ! int i; ! ! for (i = 0; i < num_channels; i++) { ! ch = channels[i]; ! ! if (entchannel != 0 && ch.entnum == entnum && ch.entchannel == entchannel) { ! // always override sound from same entity ! break; ! } ! ! // don't let monster sounds override player sounds ! if ((ch.entnum == Globals.cl.playernum+1) && (entnum != Globals.cl.playernum+1) && ch.bufferId != -1) ! continue; ! ! // looking for a free AL source ! if (!ch.active) { ! break; ! } ! } ! ! if (i == num_channels) ! return null; ! ! ch.entnum = entnum; ! ch.entchannel = entchannel; ! if (ch.bufferId != bufferId) { ! ch.bufferId = bufferId; ! ch.bufferChanged = true; ! } ! ch.rolloff = rolloff * 2; ! ch.active = true; ! ch.modified = true; ! ! return ch; } ! private float[] listenerOrigin = {0, 0, 0}; ! private FloatBuffer listenerOriginBuffer=FloatBuffer.wrap(listenerOrigin); ! ! private float[] listenerOrientation = {0, 0, 0, 0, 0, 0}; ! private FloatBuffer listenerOrientationBuffer=FloatBuffer.wrap(listenerOrientation); /* (non-Javadoc) --- 232,240 ---- attenuation *= 0.5f; ! PlaySound.allocate(origin, entnum, entchannel, buffers.get(sfx.bufferId), fvol, attenuation, timeofs); } ! private FloatBuffer listenerOrigin = Lib.newFloatBuffer(3); ! private FloatBuffer listenerOrientation = Lib.newFloatBuffer(6); /* (non-Javadoc) *************** *** 342,350 **** public void Update(float[] origin, float[] forward, float[] right, float[] up) { ! convertVector(origin, listenerOrigin); ! AL10.nalListenerfv(AL10.AL_POSITION, listenerOriginBuffer,0); ! convertOrientation(forward, up, listenerOrientation); ! AL10.nalListenerfv(AL10.AL_ORIENTATION, listenerOrientationBuffer,0); if (hasEAX){ --- 243,251 ---- public void Update(float[] origin, float[] forward, float[] right, float[] up) { ! Channel.convertVector(origin, listenerOrigin); ! AL10.nalListenerfv(AL10.AL_POSITION, listenerOrigin, 0); ! Channel.convertOrientation(forward, up, listenerOrientation); ! AL10.nalListenerfv(AL10.AL_ORIENTATION, listenerOrientation, 0); if (hasEAX){ *************** *** 356,361 **** } ! AddLoopSounds(origin); ! playChannels(listenerOrigin); } --- 257,263 ---- } ! Channel.addLoopSounds(); ! Channel.addPlaySounds(); ! Channel.playAllSounds(listenerOrigin, s_volume.value); } *************** *** 369,513 **** EAX20.eaxSet(EAX20.LISTENER_GUID, EAXListenerProperties.EAXLISTENER_ENVIRONMENT | EAXListenerProperties.EAXLISTENER_DEFERRED, 0, eaxEnv, 4); } - - Map looptable = new Hashtable(MAX_CHANNELS); - - /* - ================== - S_AddLoopSounds - - Entities with a ->sound field will generated looped sounds - that are automatically started, stopped, and merged together - as the entities are sent to the client - ================== - */ - void AddLoopSounds(float[] listener) { - - if (Globals.cl_paused.value != 0.0f) { - removeUnusedLoopSounds(); - return; - } - - if (Globals.cls.state != Globals.ca_active) { - removeUnusedLoopSounds(); - return; - } - - if (!Globals.cl.sound_prepped) { - removeUnusedLoopSounds(); - return; - } - - Channel ch; - sfx_t sfx; - sfxcache_t sc; - int num; - entity_state_t ent; - Object key; - int sound = 0; - - for (int i=0 ; i<Globals.cl.frame.num_entities ; i++) { - num = (Globals.cl.frame.parse_entities + i)&(Defines.MAX_PARSE_ENTITIES-1); - ent = Globals.cl_parse_entities[num]; - sound = ent.sound; - - if (sound == 0) continue; - - key = new Integer(ent.number); - ch = (Channel)looptable.get(key); - - if (ch != null) { - // keep on looping - ch.autosound = true; - ch.origin = ent.origin; - continue; - } - - sfx = Globals.cl.sound_precache[sound]; - if (sfx == null) - continue; // bad sound effect - - sc = sfx.cache; - if (sc == null) - continue; - - // allocate a channel - ch = pickChannel(0, 0, buffers.get(sfx.bufferId), 6); - if (ch == null) - break; - - ch.addFixed(ent.origin); - ch.autosound = true; - - looptable.put(key, ch); - AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_TRUE); - } - - removeUnusedLoopSounds(); - - } - - void removeUnusedLoopSounds() { - Channel ch; - // stop unused loopsounds - for (Iterator iter = looptable.values().iterator(); iter.hasNext();) { - ch = (Channel)iter.next(); - if (!ch.autosound) { - AL10.alSourceStop(ch.sourceId); - AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); - iter.remove(); - ch.clear(); - } - } - } - - void playChannels(float[] listenerOrigin) - { - float[] sourceOrigin = {0, 0, 0}; - FloatBuffer sourceOriginBuffer=FloatBuffer.wrap(sourceOrigin); - - float[] entityOrigin = {0, 0, 0}; - Channel ch; - int sourceId; - int state; - - for (int i = 0; i < num_channels; i++) { - ch = channels[i]; - if (ch.active) { - sourceId = ch.sourceId; - - switch (ch.type) { - case Channel.LISTENER: - Math3D.VectorCopy(listenerOrigin, sourceOrigin); - break; - case Channel.DYNAMIC: - CL_ents.GetEntitySoundOrigin(ch.entity, entityOrigin); - convertVector(entityOrigin, sourceOrigin); - break; - case Channel.FIXED: - convertVector(ch.origin, sourceOrigin); - break; - } - - if (ch.modified) { - if (ch.bufferChanged) - AL10.alSourcei (sourceId, AL10.AL_BUFFER, ch.bufferId); - - AL10.alSourcef (sourceId, AL10.AL_GAIN, s_volume.value); - AL10.alSourcef (sourceId, AL10.AL_ROLLOFF_FACTOR, ch.rolloff); - AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOriginBuffer,0); - AL10.alSourcePlay(sourceId); - ch.modified = false; - } else { - state = AL10.alGetSourcei(ch.sourceId, AL10.AL_SOURCE_STATE); - if (state == AL10.AL_PLAYING) { - AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOriginBuffer,0); - } else { - ch.clear(); - } - } - ch.autosound = false; - } - } - } /* (non-Javadoc) --- 271,274 ---- *************** *** 515,538 **** */ public void StopAllSounds() { ! for (int i = 0; i < num_channels; i++) { ! AL10.alSourceStop(sources.get(i)); ! AL10.alSourcei(sources.get(i), AL10.AL_BUFFER, 0); ! channels[i].clear(); ! } ! } ! ! static void convertVector(float[] from, float[] to) { ! to[0] = from[0]; ! to[1] = from[2]; ! to[2] = -from[1]; ! } ! ! static void convertOrientation(float[] forward, float[] up, float[] orientation) { ! orientation[0] = forward[0]; ! orientation[1] = forward[2]; ! orientation[2] = -forward[1]; ! orientation[3] = up[0]; ! orientation[4] = up[2]; ! orientation[5] = -up[1]; } --- 276,281 ---- */ public void StopAllSounds() { ! PlaySound.reset(); ! Channel.reset(); } *************** *** 544,548 **** } - int s_registration_sequence; boolean s_registering; --- 287,290 ---- *************** *** 604,609 **** // determine what model the client is using ! // TODO configstrings for player male and female are wrong ! String model = "male"; int n = Globals.CS_PLAYERSKINS + ent.number - 1; if (Globals.cl.configstrings[n] != null) { --- 346,350 ---- // determine what model the client is using ! String model = null; int n = Globals.CS_PLAYERSKINS + ent.number - 1; if (Globals.cl.configstrings[n] != null) { *************** *** 627,649 **** sfx = FindName(sexedFilename, false); ! if (sfx == null) { ! // no, so see if it exists ! RandomAccessFile f = null; ! try { ! f = FS.FOpenFile(sexedFilename.substring(1)); ! } catch (IOException e) {} ! if (f != null) { ! // yes, close the file and register it ! try { ! FS.FCloseFile(f); ! } catch (IOException e1) {} ! sfx = RegisterSound(sexedFilename); ! } else { ! // no, revert to the male sound in the pak0.pak ! String maleFilename = "player/male/" + base.substring(1); ! sfx = AliasName(sexedFilename, maleFilename); ! } } ! return sfx; } --- 368,390 ---- sfx = FindName(sexedFilename, false); ! if (sfx != null) return sfx; ! ! // ! // fall back strategies ! // ! // not found , so see if it exists ! if (FS.FileLength(sexedFilename.substring(1)) > 0) { ! // yes, register it ! return RegisterSound(sexedFilename); } ! // try it with the female sound in the pak0.pak ! if (model.equalsIgnoreCase("female")) { ! String femaleFilename = "player/female/" + base.substring(1); ! if (FS.FileLength("sound/" + femaleFilename) > 0) ! return AliasName(sexedFilename, femaleFilename); ! } ! // no chance, revert to the male sound in the pak0.pak ! String maleFilename = "player/male/" + base.substring(1); ! return AliasName(sexedFilename, maleFilename); } Index: Channel.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/Channel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Channel.java 16 Dec 2004 20:17:55 -0000 1.1 --- Channel.java 23 Dec 2004 00:52:12 -0000 1.2 *************** *** 27,34 **** package jake2.sound.lwjgl; /** * Channel * ! * @author cwei */ public class Channel { --- 27,49 ---- package jake2.sound.lwjgl; + import jake2.Defines; + import jake2.Globals; + import jake2.client.CL_ents; + import jake2.game.entity_state_t; + import jake2.sound.sfx_t; + import jake2.sound.sfxcache_t; + import jake2.util.Lib; + import jake2.util.Math3D; + + import java.nio.FloatBuffer; + import java.nio.IntBuffer; + import java.util.*; + + import org.lwjgl.openal.AL10; + /** * Channel * ! * @author dsanders/cwei */ public class Channel { *************** *** 37,84 **** final static int FIXED = 1; final static int DYNAMIC = 2; ! ! int entnum; ! int entchannel; ! int bufferId; ! float rolloff; ! boolean autosound = false; ! int sourceId; ! boolean active = false; ! boolean modified = false; ! boolean bufferChanged = false; // sound attributes ! int type; ! int entity; ! float[] origin = {0, 0, 0}; ! ! Channel(int sourceId) { this.sourceId = sourceId; clear(); } ! void addListener() { ! type = LISTENER; } ! void addFixed(float[] origin) { ! type = FIXED; ! this.origin = origin; } - void addDynamic(int entity) { - type = DYNAMIC; - this.entity = entity; } ! void clear() { ! entnum = -1; ! entchannel = -1; ! bufferId = -1; ! bufferChanged = false; ! rolloff = 0; ! autosound = false; ! active = false; ! modified = false; } } --- 52,350 ---- final static int FIXED = 1; final static int DYNAMIC = 2; ! final static int MAX_CHANNELS = 32; ! private final static FloatBuffer NULLVECTOR = Lib.newFloatBuffer(3); + private static Channel[] channels = new Channel[MAX_CHANNELS]; + private static IntBuffer sources = Lib.newIntBuffer(MAX_CHANNELS); + // a reference of L:WJGLSoundImpl.buffers + private static IntBuffer buffers; + private static Map looptable = new Hashtable(MAX_CHANNELS); + + private static boolean isInitialized = false; + private static int numChannels; + // sound attributes ! private int type; ! private int entnum; ! private int entchannel; ! private int bufferId; ! private int sourceId; ! // private float volume; ! private float rolloff; ! private float[] origin = {0, 0, 0}; ! ! // update flags ! private boolean autosound = false; ! private boolean active = false; ! private boolean modified = false; ! private boolean bufferChanged = false; ! ! private Channel(int sourceId) { this.sourceId = sourceId; clear(); } ! private void clear() { ! entnum = entchannel = bufferId = -1; ! bufferChanged = false; ! // volume = 1.0f; ! rolloff = 0; ! autosound = false; ! active = false; ! modified = false; ! } ! ! private static IntBuffer tmp = Lib.newIntBuffer(1); ! ! static int init(IntBuffer buffers, float masterVolume) { ! Channel.buffers = buffers; ! // create channels ! int sourceId; ! int error; ! for (int i = 0; i < MAX_CHANNELS; i++) { ! ! AL10.alGenSources(tmp); ! sourceId = tmp.get(0); ! ! if (sourceId <= 0) break; ! ! sources.put(i, sourceId); ! ! channels[i] = new Channel(sourceId); ! numChannels++; ! ! // set default values for AL sources ! AL10.alSourcef (sourceId, AL10.AL_GAIN, masterVolume); ! AL10.alSourcef (sourceId, AL10.AL_PITCH, 1.0f); ! AL10.alSourcei (sourceId, AL10.AL_SOURCE_ABSOLUTE, AL10.AL_TRUE); ! AL10.nalSourcefv(sourceId, AL10.AL_VELOCITY, NULLVECTOR, 0); ! AL10.alSourcei (sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! AL10.alSourcef (sourceId, AL10.AL_REFERENCE_DISTANCE, 300.0f); ! AL10.alSourcef (sourceId, AL10.AL_MIN_GAIN, 0.0005f); ! AL10.alSourcef (sourceId, AL10.AL_MAX_GAIN, 1.0f); ! } ! isInitialized = true; ! return numChannels; ! } ! ! static void reset() { ! for (int i = 0; i < numChannels; i++) { ! AL10.alSourceStop(sources.get(i)); ! AL10.alSourcei(sources.get(i), AL10.AL_BUFFER, 0); ! channels[i].clear(); ! } } + + static void shutdown() { + AL10.alDeleteSources(sources); + numChannels = 0; + isInitialized = false; + } + + static void addPlaySounds() { + while (Channel.assign(PlaySound.nextPlayableSound())); + } + + private static boolean assign(PlaySound ps) { + if (ps == null) return false; + Channel ch = null; + int i; + for (i = 0; i < numChannels; i++) { + ch = channels[i]; + + if (ps.entchannel != 0 && ch.entnum == ps.entnum && ch.entchannel == ps.entchannel) { + // always override sound from same entity + if (ch.bufferId != ps.bufferId) { + AL10.alSourceStop(ch.sourceId); + } + break; + } + + // don't let monster sounds override player sounds + if ((ch.entnum == Globals.cl.playernum+1) && (ps.entnum != Globals.cl.playernum+1) && ch.bufferId != -1) + continue; + + // looking for a free AL source + if (!ch.active) { + break; + } + } ! if (i == numChannels) ! return false; ! ! ch.type = ps.type; ! if (ps.type == Channel.FIXED) ! Math3D.VectorCopy(ps.origin, ch.origin); ! ch.entnum = ps.entnum; ! ch.entchannel = ps.entchannel; ! ch.bufferChanged = (ch.bufferId != ps.bufferId); ! ch.bufferId = ps.bufferId; ! ch.rolloff = ps.attenuation * 2; ! //ch.volume = ps.volume; ! ch.active = true; ! ch.modified = true; ! return true; ! } ! ! private static Channel pickForLoop(int bufferId, float attenuation) { ! Channel ch; ! for (int i = 0; i < numChannels; i++) { ! ch = channels[i]; ! // looking for a free AL source ! if (!ch.active) { ! ch.entnum = 0; ! ch.entchannel = 0; ! ch.bufferChanged = (ch.bufferId != bufferId); ! ch.bufferId = bufferId; ! ch.rolloff = attenuation * 2; ! ch.active = true; ! ch.modified = true; ! return ch; ! } ! } ! return null; ! } ! ! private static FloatBuffer sourceOriginBuffer = Lib.newFloatBuffer(3); ! ! static void playAllSounds(FloatBuffer listenerOrigin, float masterVolume) { ! float[] entityOrigin = {0, 0, 0}; ! FloatBuffer sourceOrigin = sourceOriginBuffer; ! Channel ch; ! int sourceId; ! int state; ! ! for (int i = 0; i < numChannels; i++) { ! ch = channels[i]; ! if (ch.active) { ! sourceId = ch.sourceId; ! switch (ch.type) { ! case Channel.LISTENER: ! sourceOrigin = listenerOrigin; ! break; ! case Channel.DYNAMIC: ! CL_ents.GetEntitySoundOrigin(ch.entnum, entityOrigin); ! convertVector(entityOrigin, sourceOrigin); ! break; ! case Channel.FIXED: ! convertVector(ch.origin, sourceOrigin); ! break; ! } ! ! if (ch.modified) { ! if (ch.bufferChanged) { ! AL10.alSourcei(sourceId, AL10.AL_BUFFER, ch.bufferId); ! } ! // AL10.alSourcef (sourceId, AL10.AL_GAIN, masterVolume * ch.volume); ! AL10.alSourcef (sourceId, AL10.AL_GAIN, masterVolume); ! AL10.alSourcef (sourceId, AL10.AL_ROLLOFF_FACTOR, ch.rolloff); ! AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOrigin, 0); ! AL10.alSourcePlay(sourceId); ! ch.modified = false; ! } else { ! state = AL10.alGetSourcei(sourceId, AL10.AL_SOURCE_STATE); ! if (state == AL10.AL_PLAYING) { ! AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOrigin, 0); ! } else { ! ch.clear(); ! } ! } ! ch.autosound = false; ! } ! } } + + /* + * adddLoopSounds + * Entities with a ->sound field will generated looped sounds + * that are automatically started, stopped, and merged together + * as the entities are sent to the client + */ + static void addLoopSounds() { + + if ((Globals.cl_paused.value != 0.0f) || (Globals.cls.state != Globals.ca_active) || !Globals.cl.sound_prepped) { + removeUnusedLoopSounds(); + return; + } + + Channel ch; + sfx_t sfx; + sfxcache_t sc; + int num; + entity_state_t ent; + Object key; + int sound = 0; + + for (int i=0 ; i<Globals.cl.frame.num_entities ; i++) { + num = (Globals.cl.frame.parse_entities + i)&(Defines.MAX_PARSE_ENTITIES-1); + ent = Globals.cl_parse_entities[num]; + sound = ent.sound; + + if (sound == 0) continue; + + key = new Integer(ent.number); + ch = (Channel)looptable.get(key); + + if (ch != null) { + // keep on looping + ch.autosound = true; + Math3D.VectorCopy(ent.origin, ch.origin); + continue; + } + + sfx = Globals.cl.sound_precache[sound]; + if (sfx == null) + continue; // bad sound effect + + sc = sfx.cache; + if (sc == null) + continue; + + // allocate a channel + ch = Channel.pickForLoop(buffers.get(sfx.bufferId), 6); + if (ch == null) + break; + + ch.type = FIXED; + Math3D.VectorCopy(ent.origin, ch.origin); + ch.autosound = true; + + looptable.put(key, ch); + AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_TRUE); + } + + removeUnusedLoopSounds(); } ! private static void removeUnusedLoopSounds() { ! Channel ch; ! // stop unused loopsounds ! for (Iterator iter = looptable.values().iterator(); iter.hasNext();) { ! ch = (Channel)iter.next(); ! if (!ch.autosound) { ! AL10.alSourceStop(ch.sourceId); ! AL10.alSourcei(ch.sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! iter.remove(); ! ch.clear(); ! } ! } ! } ! ! static void convertVector(float[] from, FloatBuffer to) { ! to.put(0, from[0]); ! to.put(1, from[2]); ! to.put(2, -from[1]); } + + static void convertOrientation(float[] forward, float[] up, FloatBuffer orientation) { + orientation.put(0, forward[0]); + orientation.put(1, forward[2]); + orientation.put(2, -forward[1]); + orientation.put(3, up[0]); + orientation.put(4, up[2]); + orientation.put(5, -up[1]); + } + } |
From: Carsten W. <ca...@us...> - 2004-12-22 23:53:16
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15985/src/jake2/sound/joal Modified Files: PlaySound.java Log Message: file header changed Index: PlaySound.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/PlaySound.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlaySound.java 27 Oct 2004 16:51:32 -0000 1.1 --- PlaySound.java 22 Dec 2004 23:53:05 -0000 1.2 *************** *** 2,21 **** * Created on Oct 26, 2004 * ! * TODO To change the template for this generated file go to ! * Window - Preferences - Java - Code Style - Code Templates */ ! package jake2.sound.joal; ! import java.util.Vector; import jake2.Globals; - import jake2.sound.sfx_t; import jake2.util.Math3D; /** * @author cwei - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates */ public class PlaySound { --- 2,37 ---- * Created on Oct 26, 2004 * ! * Copyright (C) 2003 ! * ! * $Id$ */ ! /* ! 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.sound.joal; import jake2.Globals; import jake2.util.Math3D; /** + * PlaySound + * * @author cwei */ public class PlaySound { |
From: Holger Z. <hz...@us...> - 2004-12-22 15:50:52
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27543/src/jake2/client Modified Files: Menu.java Log Message: fix menu stacking Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Menu.java 7 Oct 2004 14:13:00 -0000 1.12 --- Menu.java 22 Dec 2004 15:50:40 -0000 1.13 *************** *** 199,207 **** Com.Error(ERR_FATAL, "PushMenu: MAX_MENU_DEPTH"); ! m_layers[m_menudepth].draw = m_drawfunc; ! m_layers[m_menudepth].key = m_keyfunc; ! m_menudepth++; } ! m_drawfunc = draw; m_keyfunc = key; --- 199,206 ---- Com.Error(ERR_FATAL, "PushMenu: MAX_MENU_DEPTH"); ! m_layers[m_menudepth].draw = draw;//m_drawfunc; ! m_layers[m_menudepth].key = key;//m_keyfunc; } ! m_menudepth++; m_drawfunc = draw; m_keyfunc = key; *************** *** 223,235 **** static void PopMenu() { S.StartLocalSound(menu_out_sound); - if (m_menudepth < 1) - Com.Error(ERR_FATAL, "PopMenu: depth < 1"); m_menudepth--; ! m_drawfunc = m_layers[m_menudepth].draw; ! m_keyfunc = m_layers[m_menudepth].key; if (0 == m_menudepth) ForceMenuOff(); } --- 222,238 ---- static void PopMenu() { S.StartLocalSound(menu_out_sound); m_menudepth--; + if (m_menudepth < 0) + Com.Error(ERR_FATAL, "PopMenu: depth < 1"); ! if (0 < m_menudepth){ ! m_drawfunc = m_layers[m_menudepth-1].draw; ! m_keyfunc = m_layers[m_menudepth-1].key; ! } if (0 == m_menudepth) ForceMenuOff(); + + } *************** *** 2906,2920 **** }; static void Menu_StartServer_f() { StartServer_MenuInit(); ! PushMenu(new xcommand_t() { ! public void execute() { ! StartServer_MenuDraw(); ! } ! }, new keyfunc_t() { ! public String execute(int key) { ! return StartServer_MenuKey(key); ! } ! }); } --- 2909,2925 ---- }; + static xcommand_t startServer_MenuDraw = new xcommand_t() { + public void execute() { + StartServer_MenuDraw(); + } + }; + static keyfunc_t startServer_MenuKey = new keyfunc_t() { + public String execute(int key) { + return StartServer_MenuKey(key); + } + }; static void Menu_StartServer_f() { StartServer_MenuInit(); ! PushMenu(startServer_MenuDraw, startServer_MenuKey); } |
From: Carsten W. <ca...@us...> - 2004-12-21 00:42:43
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10813/src/jake2/sound/lwjgl Modified Files: LWJGLSoundImpl.java Log Message: EAX bugfix Index: LWJGLSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/LWJGLSoundImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LWJGLSoundImpl.java 16 Dec 2004 20:33:08 -0000 1.2 --- LWJGLSoundImpl.java 21 Dec 2004 00:42:31 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- import org.lwjgl.LWJGLException; import org.lwjgl.openal.*; + import org.lwjgl.openal.eax.*; import org.lwjgl.openal.eax.EAX20; import org.lwjgl.openal.eax.EAXListenerProperties; *************** *** 131,136 **** if (AL10.alIsExtensionPresent("EAX2.0")) { ! Com.Printf("... using EAX2.0\n"); ! hasEAX=true; } else --- 132,143 ---- if (AL10.alIsExtensionPresent("EAX2.0")) { ! try { ! EAX.create(); ! Com.Printf("... using EAX2.0\n"); ! hasEAX=true; ! } catch (LWJGLException e) { ! Com.Printf("... can't create EAX2.0\n"); ! hasEAX=false; ! } } else *************** *** 144,147 **** --- 151,158 ---- void exitOpenAL() { + // Release the EAX context. + if (hasEAX){ + EAX.destroy(); + } // Release the context and the device. AL.destroy(); *************** *** 326,339 **** private FloatBuffer listenerOrientationBuffer=FloatBuffer.wrap(listenerOrientation); - private IntBuffer eaxEnv = Lib.newIntBuffer(1); - private int currentEnv = -1; - private boolean changeEnv = true; - - // TODO workaround for JOAL-bug - // should be EAX.LISTENER - private final static int EAX_LISTENER = 0; - // should be EAX.SOURCE - private final static int EAX_SOURCE = 1; - /* (non-Javadoc) * @see jake2.sound.SoundImpl#Update(float[], float[], float[], float[]) --- 337,340 ---- *************** *** 347,370 **** AL10.nalListenerfv(AL10.AL_ORIENTATION, listenerOrientationBuffer,0); ! if (hasEAX) ! { ! // workaround for environment initialisation ! if (currentEnv == -1) ! { ! eaxEnv.put(0, EAX20.EAX_ENVIRONMENT_UNDERWATER); ! EAX20.eaxSet(EAX_LISTENER, EAXListenerProperties.EAXLISTENER_ENVIRONMENT | EAXListenerProperties.EAXLISTENER_DEFERRED, 0, eaxEnv, 4); ! changeEnv = true; ! } ! if ((GameBase.gi.pointcontents.pointcontents(origin)& Defines.MASK_WATER)!= 0) { ! changeEnv = currentEnv != EAX20.EAX_ENVIRONMENT_UNDERWATER; ! currentEnv = EAX20.EAX_ENVIRONMENT_UNDERWATER; } else { ! changeEnv = currentEnv != EAX20.EAX_ENVIRONMENT_GENERIC; ! currentEnv = EAX20.EAX_ENVIRONMENT_GENERIC; ! } ! if (changeEnv) { ! eaxEnv.put(0, currentEnv); ! EAX20.eaxSet(EAX_LISTENER, EAXListenerProperties.EAXLISTENER_ENVIRONMENT | EAXListenerProperties.EAXLISTENER_DEFERRED, 0, eaxEnv, 4); } } --- 348,356 ---- AL10.nalListenerfv(AL10.AL_ORIENTATION, listenerOrientationBuffer,0); ! if (hasEAX){ if ((GameBase.gi.pointcontents.pointcontents(origin)& Defines.MASK_WATER)!= 0) { ! changeEnvironment(EAX20.EAX_ENVIRONMENT_UNDERWATER); } else { ! changeEnvironment(EAX20.EAX_ENVIRONMENT_GENERIC); } } *************** *** 374,377 **** --- 360,373 ---- } + private IntBuffer eaxEnv = Lib.newIntBuffer(1); + private int currentEnv = EAX20.EAX_ENVIRONMENT_UNDERWATER; + + private void changeEnvironment(int env) { + if (env == currentEnv) return; + currentEnv = env; + eaxEnv.put(0, currentEnv); + EAX20.eaxSet(EAX20.LISTENER_GUID, EAXListenerProperties.EAXLISTENER_ENVIRONMENT | EAXListenerProperties.EAXLISTENER_DEFERRED, 0, eaxEnv, 4); + } + Map looptable = new Hashtable(MAX_CHANNELS); |
From: Carsten W. <ca...@us...> - 2004-12-20 21:51:30
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2521/src/jake2/render/lwjgl Modified Files: LWJGLBase.java Log Message: the jogl overhead was removed; the flickering bug fixed; the window destroy bug fixed (since 0.94 lwjgl); Index: LWJGLBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/LWJGLBase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LWJGLBase.java 16 Dec 2004 19:53:41 -0000 1.1 --- LWJGLBase.java 20 Dec 2004 21:51:18 -0000 1.2 *************** *** 1,365 **** ! /* ! * LWJGLBase.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.lwjgl; ! ! import jake2.Defines; ! import jake2.client.VID; ! import jake2.client.viddef_t; ! import jake2.game.cvar_t; ! import jake2.qcommon.xcommand_t; ! ! import java.awt.Dimension; ! import java.util.LinkedList; ! ! import org.lwjgl.LWJGLException; ! import org.lwjgl.opengl.Display; ! import org.lwjgl.opengl.DisplayMode; ! import org.lwjgl.opengl.GL11; ! import org.lwjgl.util.GLImpl; ! ! public abstract class LWJGLBase { ! // IMPORTED FUNCTIONS ! protected DisplayMode oldDisplayMode; ! ! protected GLImpl gl=new GLImpl(); ! ! // window position on the screen ! int window_xpos, window_ypos; ! protected viddef_t vid = new viddef_t(); ! ! // handles the post initialization with JoglRenderer ! protected boolean post_init = false; ! protected boolean contextInUse = false; ! protected abstract boolean R_Init2(); ! ! protected final xcommand_t INIT_CALLBACK = new xcommand_t() { ! public void execute() { ! // only used for the first run (initialization) ! // clear the screen ! gl.glClearColor(0, 0, 0, 0); ! gl.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); ! ! // ! // check the post init process ! // ! if (!post_init) { ! VID.Printf(Defines.PRINT_ALL, "Missing multi-texturing for FastJOGL renderer\n"); ! } ! ! GLimp_EndFrame(); ! } ! }; ! protected xcommand_t callback = INIT_CALLBACK; ! ! protected cvar_t vid_fullscreen; ! ! // enum rserr_t ! protected static final int rserr_ok = 0; ! protected static final int rserr_invalid_fullscreen = 1; ! protected static final int rserr_invalid_mode = 2; ! protected static final int rserr_unknown = 3; ! ! private java.awt.DisplayMode toAwtDisplayMode(DisplayMode m) ! { ! return new java.awt.DisplayMode(m.getWidth(),m.getHeight(),m.getBitsPerPixel(),m.getFrequency()); ! } ! ! public java.awt.DisplayMode[] getModeList() ! { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(toAwtDisplayMode(oldDisplayMode)); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! java.awt.DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (java.awt.DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(toAwtDisplayMode(m)); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, toAwtDisplayMode(m)); ! } else if (m.getFrequency() > ml.getRefreshRate()){ ! l.remove(j); ! l.add(j, toAwtDisplayMode(m)); ! } ! } ! java.awt.DisplayMode[] ma = new java.awt.DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! public DisplayMode[] getLWJGLModeList() { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(oldDisplayMode); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(m); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, m); ! } else if (m.getFrequency() > ml.getFrequency()){ ! l.remove(j); ! l.add(j, m); ! } ! } ! DisplayMode[] ma = new DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! private DisplayMode findDisplayMode(Dimension dim) { ! DisplayMode mode = null; ! DisplayMode m = null; ! DisplayMode[] modes = getLWJGLModeList(); ! int w = dim.width; ! int h = dim.height; ! ! for (int i = 0; i < modes.length; i++) { ! m = modes[i]; ! if (m.getWidth() == w && m.getHeight() == h) { ! mode = m; ! break; ! } ! } ! if (mode == null) mode = oldDisplayMode; ! return mode; ! } ! ! String getModeString(DisplayMode m) { ! StringBuffer sb = new StringBuffer(); ! sb.append(m.getWidth()); ! sb.append('x'); ! sb.append(m.getHeight()); ! sb.append('x'); ! sb.append(m.getBitsPerPixel()); ! sb.append('@'); ! sb.append(m.getFrequency()); ! sb.append("Hz"); ! return sb.toString(); ! } ! ! /** ! * @param dim ! * @param mode ! * @param fullscreen ! * @return enum rserr_t ! */ ! protected int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen) { ! ! Dimension newDim = new Dimension(); ! ! VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); ! ! VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); ! ! /* ! * fullscreen handling ! */ ! if (oldDisplayMode == null) { ! oldDisplayMode = Display.getDisplayMode(); ! } ! ! if (!VID.GetModeInfo(newDim, mode)) { ! VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); ! return rserr_invalid_mode; ! } ! ! VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); ! ! // destroy the existing window ! GLimp_Shutdown(); ! ! Display.setTitle("Jake2"); ! ! DisplayMode displayMode = findDisplayMode(newDim); ! newDim.width = displayMode.getWidth(); ! newDim.height = displayMode.getHeight(); ! ! if (fullscreen) ! { ! try { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! Display.setLocation(0,0); ! ! try { ! Display.setFullscreen(fullscreen); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! ! VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); ! ! } ! else ! { ! try ! { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! try { ! Display.setFullscreen(false); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! Display.setLocation(window_xpos, window_ypos); ! } ! ! vid.width = newDim.width; ! vid.height = newDim.height; ! ! try ! { ! Display.create(); ! } ! catch (LWJGLException e) ! { ! return rserr_unknown; ! } ! ! // let the sound and input subsystems know about the new window ! VID.NewWindow(vid.width, vid.height); ! ! post_init = R_Init2(); ! ! updateScreen(); ! ! return rserr_ok; ! } ! ! protected void GLimp_Shutdown() { ! if (oldDisplayMode != null && Display.isFullscreen()) { ! try { ! Display.setFullscreen(false); ! Display.setDisplayMode(oldDisplayMode); ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! if (Display.isCreated()) Display.destroy(); ! ! post_init = false; ! callback = INIT_CALLBACK; ! } ! ! /** ! * @return true ! */ ! protected boolean GLimp_Init(int xpos, int ypos) { ! // do nothing ! window_xpos = xpos; ! window_ypos = ypos; ! return true; ! } ! ! protected void GLimp_EndFrame() { ! gl.glFlush(); ! // swap buffer ! // TODO this and a new JOGL-release solves the flickering bug (Loading) ! // canvas.swapBuffers(); ! } ! protected void GLimp_BeginFrame(float camera_separation) { ! // do nothing ! } ! ! protected void GLimp_AppActivate(boolean activate) { ! // do nothing ! } ! ! protected void GLimp_EnableLogging(boolean enable) { ! // doesn't need jogl logging ! // do nothing ! } ! ! protected void GLimp_LogNewFrame() { ! // doesn't need jogl logging ! // do nothing ! } ! ! /* ! * @see jake2.client.refexport_t#updateScreen() ! */ ! public void updateScreen() { ! this.callback = INIT_CALLBACK; ! ! contextInUse = true; ! callback.execute(); ! contextInUse = false; ! ! Display.update(); ! } ! ! public void updateScreen(xcommand_t callback) { ! this.callback = callback; ! ! contextInUse = true; ! callback.execute(); ! contextInUse = false; ! ! Display.update(); ! } ! } --- 1,324 ---- ! /* ! * LWJGLBase.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.lwjgl; ! ! import jake2.Defines; ! import jake2.client.VID; ! import jake2.client.viddef_t; ! import jake2.game.cvar_t; ! import jake2.qcommon.xcommand_t; ! ! import java.awt.Dimension; ! import java.util.LinkedList; ! ! import org.lwjgl.LWJGLException; ! import org.lwjgl.opengl.Display; ! import org.lwjgl.opengl.DisplayMode; ! import org.lwjgl.util.GLImpl; ! ! /** ! * LWJGLBase ! * ! * @author dsanders/cwei ! */ ! public abstract class LWJGLBase { ! // IMPORTED FUNCTIONS ! protected DisplayMode oldDisplayMode; ! ! protected GLImpl gl = new GLImpl(); ! ! // window position on the screen ! int window_xpos, window_ypos; ! protected viddef_t vid = new viddef_t(); ! ! // handles the post initialization with LWJGLRenderer ! protected abstract boolean R_Init2(); ! ! protected cvar_t vid_fullscreen; ! ! // enum rserr_t ! protected static final int rserr_ok = 0; ! protected static final int rserr_invalid_fullscreen = 1; ! protected static final int rserr_invalid_mode = 2; ! protected static final int rserr_unknown = 3; ! ! private java.awt.DisplayMode toAwtDisplayMode(DisplayMode m) ! { ! return new java.awt.DisplayMode(m.getWidth(),m.getHeight(),m.getBitsPerPixel(),m.getFrequency()); ! } ! ! public java.awt.DisplayMode[] getModeList() ! { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(toAwtDisplayMode(oldDisplayMode)); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! java.awt.DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (java.awt.DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(toAwtDisplayMode(m)); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, toAwtDisplayMode(m)); ! } else if (m.getFrequency() > ml.getRefreshRate()){ ! l.remove(j); ! l.add(j, toAwtDisplayMode(m)); ! } ! } ! java.awt.DisplayMode[] ma = new java.awt.DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! public DisplayMode[] getLWJGLModeList() { ! DisplayMode[] modes = Display.getAvailableDisplayModes(); ! ! LinkedList l = new LinkedList(); ! l.add(oldDisplayMode); ! ! for (int i = 0; i < modes.length; i++) { ! DisplayMode m = modes[i]; ! ! if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; ! if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; ! if (m.getHeight() < 240 || m.getWidth() < 320) continue; ! ! int j = 0; ! DisplayMode ml = null; ! for (j = 0; j < l.size(); j++) { ! ml = (DisplayMode)l.get(j); ! if (ml.getWidth() > m.getWidth()) break; ! if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; ! } ! if (j == l.size()) { ! l.addLast(m); ! } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { ! l.add(j, m); ! } else if (m.getFrequency() > ml.getFrequency()){ ! l.remove(j); ! l.add(j, m); ! } ! } ! DisplayMode[] ma = new DisplayMode[l.size()]; ! l.toArray(ma); ! return ma; ! } ! ! private DisplayMode findDisplayMode(Dimension dim) { ! DisplayMode mode = null; ! DisplayMode m = null; ! DisplayMode[] modes = getLWJGLModeList(); ! int w = dim.width; ! int h = dim.height; ! ! for (int i = 0; i < modes.length; i++) { ! m = modes[i]; ! if (m.getWidth() == w && m.getHeight() == h) { ! mode = m; ! break; ! } ! } ! if (mode == null) mode = oldDisplayMode; ! return mode; ! } ! ! String getModeString(DisplayMode m) { ! StringBuffer sb = new StringBuffer(); ! sb.append(m.getWidth()); ! sb.append('x'); ! sb.append(m.getHeight()); ! sb.append('x'); ! sb.append(m.getBitsPerPixel()); ! sb.append('@'); ! sb.append(m.getFrequency()); ! sb.append("Hz"); ! return sb.toString(); ! } ! ! /** ! * @param dim ! * @param mode ! * @param fullscreen ! * @return enum rserr_t ! */ ! protected int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen) { ! ! Dimension newDim = new Dimension(); ! ! VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); ! ! VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); ! ! /* ! * fullscreen handling ! */ ! if (oldDisplayMode == null) { ! oldDisplayMode = Display.getDisplayMode(); ! } ! ! if (!VID.GetModeInfo(newDim, mode)) { ! VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); ! return rserr_invalid_mode; ! } ! ! VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); ! ! // destroy the existing window ! GLimp_Shutdown(); ! ! Display.setTitle("Jake2"); ! ! DisplayMode displayMode = findDisplayMode(newDim); ! newDim.width = displayMode.getWidth(); ! newDim.height = displayMode.getHeight(); ! ! if (fullscreen) ! { ! try { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! Display.setLocation(0,0); ! ! try { ! Display.setFullscreen(fullscreen); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! ! VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); ! ! } ! else ! { ! try ! { ! Display.setDisplayMode(displayMode); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_mode; ! } ! ! try { ! Display.setFullscreen(false); ! } ! catch (LWJGLException e) ! { ! return rserr_invalid_fullscreen; ! } ! Display.setLocation(window_xpos, window_ypos); ! } ! ! vid.width = newDim.width; ! vid.height = newDim.height; ! ! try ! { ! Display.create(); ! } ! catch (LWJGLException e) ! { ! return rserr_unknown; ! } ! ! // let the sound and input subsystems know about the new window ! VID.NewWindow(vid.width, vid.height); ! return rserr_ok; ! } ! ! protected void GLimp_Shutdown() { ! if (oldDisplayMode != null && Display.isFullscreen()) { ! try { ! Display.setDisplayMode(oldDisplayMode); ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! while (Display.isCreated()) { ! Display.destroy(); ! } ! } ! ! /** ! * @return true ! */ ! protected boolean GLimp_Init(int xpos, int ypos) { ! // do nothing ! window_xpos = xpos; ! window_ypos = ypos; ! return true; ! } ! ! protected void GLimp_EndFrame() { ! gl.glFlush(); ! // swap buffers ! Display.update(); ! } ! ! protected void GLimp_BeginFrame(float camera_separation) { ! // do nothing ! } ! ! protected void GLimp_AppActivate(boolean activate) { ! // do nothing ! } ! ! protected void GLimp_EnableLogging(boolean enable) { ! // do nothing ! } ! ! protected void GLimp_LogNewFrame() { ! // do nothing ! } ! ! /** ! * this is a hack for jogl renderers. ! * @param callback ! */ ! public final void updateScreen(xcommand_t callback) { ! callback.execute(); ! } ! } |
From: Carsten W. <ca...@us...> - 2004-12-20 21:49:25
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2058/src/jake2/render Modified Files: LWJGLRenderer.java Log Message: the jogl overhead was removed Index: LWJGLRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/LWJGLRenderer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LWJGLRenderer.java 14 Dec 2004 12:57:14 -0000 1.2 --- LWJGLRenderer.java 20 Dec 2004 21:49:14 -0000 1.3 *************** *** 1,313 **** ! /* ! * LWJGLRenderer.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.lwjgl.Misc; ! import jake2.sys.KBD; ! import jake2.sys.LWJGLKBD; ! ! import java.awt.Dimension; ! ! /** ! * LWJGLRenderer ! * ! * @author dsanders/cwei ! */ ! final class LWJGLRenderer extends Misc implements refexport_t, Ref { ! ! private LWJGLKBD kbd=new LWJGLKBD(); ! ! public static final String DRIVER_NAME = "lwjgl"; ! ! 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) { ! ! // pre init ! if (!R_Init(vid_xpos, vid_ypos)) return false; ! // calls the R_Init2() internally ! updateScreen(); ! // the result from R_Init2() ! return post_init; ! } ! ! /** ! * @see jake2.client.refexport_t#Shutdown() ! */ ! public void Shutdown() { ! R_Shutdown(); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginRegistration(java.lang.String) ! */ ! public void BeginRegistration(String map) { ! if (contextInUse) { ! R_BeginRegistration(map); ! return; ! } ! this.name = map; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! R_BeginRegistration(LWJGLRenderer.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 R_RegisterModel(name); ! ! model = null; ! this.name = name; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! LWJGLRenderer.this.model = R_RegisterModel(LWJGLRenderer.this.name); ! } ! }); ! return model; ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterSkin(java.lang.String) ! */ ! public image_t RegisterSkin(String name) { ! if (contextInUse) ! return R_RegisterSkin(name); ! ! this.image = null; ! this.name = name; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! LWJGLRenderer.this.image = R_RegisterSkin(LWJGLRenderer.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 Draw_FindPic(name); ! ! this.image = null; ! this.name = name; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! LWJGLRenderer.this.image = Draw_FindPic(LWJGLRenderer.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) { ! R_SetSky(name, rotate, axis); ! return; ! } ! ! this.name = name; ! this.rotate = rotate; ! this.axis = axis; ! ! updateScreen(new xcommand_t() { ! public void execute() { ! R_SetSky(LWJGLRenderer.this.name, LWJGLRenderer.this.rotate, LWJGLRenderer.this.axis); ! } ! }); ! ! } ! ! /** ! * @see jake2.client.refexport_t#EndRegistration() ! */ ! public void EndRegistration() { ! if (contextInUse) { ! R_EndRegistration(); ! return; ! } ! ! updateScreen(new xcommand_t() { ! public void execute() { ! R_EndRegistration(); ! } ! }); ! } ! ! /** ! * @see jake2.client.refexport_t#RenderFrame(jake2.client.refdef_t) ! */ ! public void RenderFrame(refdef_t fd) { ! R_RenderFrame(fd); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawGetPicSize(java.awt.Dimension, java.lang.String) ! */ ! public void DrawGetPicSize(Dimension dim, String name) { ! Draw_GetPicSize(dim, name); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawPic(int, int, java.lang.String) ! */ ! public void DrawPic(int x, int y, String name) { ! 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) { ! Draw_StretchPic(x, y, w, h, name); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawChar(int, int, int) ! */ ! public void DrawChar(int x, int y, int num) { ! Draw_Char(x, y, 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) { ! 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) { ! Draw_Fill(x, y, w, h, c); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawFadeScreen() ! */ ! public void DrawFadeScreen() { ! 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) { ! Draw_StretchRaw(x, y, w, h, cols, rows, data); ! } ! ! /** ! * @see jake2.client.refexport_t#CinematicSetPalette(byte[]) ! */ ! public void CinematicSetPalette(byte[] palette) { ! R_SetPalette(palette); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginFrame(float) ! */ ! public void BeginFrame(float camera_separation) { ! R_BeginFrame(camera_separation); ! } ! ! /** ! * @see jake2.client.refexport_t#EndFrame() ! */ ! public void EndFrame() { ! GLimp_EndFrame(); ! } ! ! /** ! * @see jake2.client.refexport_t#AppActivate(boolean) ! */ ! public void AppActivate(boolean activate) { ! GLimp_AppActivate(activate); ! } ! ! public int apiVersion() { ! return Defines.API_VERSION; ! } ! ! // ============================================================================ ! // Ref interface ! // ============================================================================ ! ! public String getName() { ! return DRIVER_NAME; ! } ! ! public String toString() { ! return DRIVER_NAME; ! } ! ! public refexport_t GetRefAPI() { ! return this; ! } ! ! public KBD getKeyboardHandler() { return kbd; } } \ No newline at end of file --- 1,235 ---- ! /* ! * LWJGLRenderer.java ! * Copyright (C) 2004 ! * ! * $Id$ ! */ ! /* ! 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.render.lwjgl.Misc; ! import jake2.sys.KBD; ! import jake2.sys.LWJGLKBD; ! ! import java.awt.Dimension; ! ! /** ! * LWJGLRenderer ! * ! * @author dsanders/cwei ! */ ! final class LWJGLRenderer extends Misc implements refexport_t, Ref { ! ! private LWJGLKBD kbd=new LWJGLKBD(); ! ! public static final String DRIVER_NAME = "lwjgl"; ! ! 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) { ! ! // pre init ! if (!R_Init(vid_xpos, vid_ypos)) return false; ! // post init ! boolean ok = R_Init2(); ! if (!ok) { ! VID.Printf(Defines.PRINT_ALL, "Missing multi-texturing for LWJGL renderer\n"); ! } ! return ok; ! } ! ! /** ! * @see jake2.client.refexport_t#Shutdown() ! */ ! public void Shutdown() { ! R_Shutdown(); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginRegistration(java.lang.String) ! */ ! public final void BeginRegistration(String map) { ! R_BeginRegistration(map); ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterModel(java.lang.String) ! */ ! public final model_t RegisterModel(String name) { ! return R_RegisterModel(name); ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterSkin(java.lang.String) ! */ ! public final image_t RegisterSkin(String name) { ! return R_RegisterSkin(name); ! } ! ! /** ! * @see jake2.client.refexport_t#RegisterPic(java.lang.String) ! */ ! public final image_t RegisterPic(String name) { ! return Draw_FindPic(name); ! } ! /** ! * @see jake2.client.refexport_t#SetSky(java.lang.String, float, float[]) ! */ ! public final void SetSky(String name, float rotate, float[] axis) { ! R_SetSky(name, rotate, axis); ! } ! ! /** ! * @see jake2.client.refexport_t#EndRegistration() ! */ ! public final void EndRegistration() { ! R_EndRegistration(); ! } ! ! /** ! * @see jake2.client.refexport_t#RenderFrame(jake2.client.refdef_t) ! */ ! public final void RenderFrame(refdef_t fd) { ! R_RenderFrame(fd); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawGetPicSize(java.awt.Dimension, java.lang.String) ! */ ! public final void DrawGetPicSize(Dimension dim, String name) { ! 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) { ! 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) { ! 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) { ! 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) { ! 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) { ! Draw_Fill(x, y, w, h, c); ! } ! ! /** ! * @see jake2.client.refexport_t#DrawFadeScreen() ! */ ! public final void DrawFadeScreen() { ! 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) { ! Draw_StretchRaw(x, y, w, h, cols, rows, data); ! } ! ! /** ! * @see jake2.client.refexport_t#CinematicSetPalette(byte[]) ! */ ! public final void CinematicSetPalette(byte[] palette) { ! R_SetPalette(palette); ! } ! ! /** ! * @see jake2.client.refexport_t#BeginFrame(float) ! */ ! public final void BeginFrame(float camera_separation) { ! R_BeginFrame(camera_separation); ! } ! ! /** ! * @see jake2.client.refexport_t#EndFrame() ! */ ! public final void EndFrame() { ! GLimp_EndFrame(); ! } ! ! /** ! * @see jake2.client.refexport_t#AppActivate(boolean) ! */ ! public final void AppActivate(boolean activate) { ! GLimp_AppActivate(activate); ! } ! ! public final int apiVersion() { ! return Defines.API_VERSION; ! } ! ! // ============================================================================ ! // Ref interface ! // ============================================================================ ! ! public final String getName() { ! return DRIVER_NAME; ! } ! ! public final String toString() { ! return DRIVER_NAME; ! } ! ! public final refexport_t GetRefAPI() { ! return this; ! } ! ! public final KBD getKeyboardHandler() { return kbd; } } \ No newline at end of file |
From: Holger Z. <hz...@us...> - 2004-12-20 15:24:45
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7299/src/jake2/sys Modified Files: LWJGLKBD.java Log Message: mousewheel support Index: LWJGLKBD.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/LWJGLKBD.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LWJGLKBD.java 16 Dec 2004 22:45:54 -0000 1.6 --- LWJGLKBD.java 20 Dec 2004 15:24:30 -0000 1.7 *************** *** 82,94 **** } ! while (Mouse.next()) ! { ! int button=Mouse.getEventButton(); ! if (button >= 0) ! { if (button == 1 && mouseHasTwoButtons) { button = 2; // A three button mouse numbering scheme... } Do_Key_Event(Key.K_MOUSE1 + button, Mouse.getEventButtonState()); } } --- 82,101 ---- } ! while (Mouse.next()) { ! int button = Mouse.getEventButton(); ! if (button >= 0) { if (button == 1 && mouseHasTwoButtons) { button = 2; // A three button mouse numbering scheme... } Do_Key_Event(Key.K_MOUSE1 + button, Mouse.getEventButtonState()); + } else { + button = Mouse.getEventDWheel(); + if (button > 0) { + Do_Key_Event(Key.K_MWHEELUP, true); + Do_Key_Event(Key.K_MWHEELUP, false); + } else if (button < 0) { + Do_Key_Event(Key.K_MWHEELDOWN, true); + Do_Key_Event(Key.K_MWHEELDOWN, false); + } } } |
From: Holger Z. <hz...@us...> - 2004-12-20 13:20:42
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11994/src/jake2/qcommon Modified Files: Qcommon.java Log Message: command line settings always override config file Index: Qcommon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Qcommon.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Qcommon.java 3 Nov 2004 08:53:27 -0000 1.12 --- Qcommon.java 20 Dec 2004 13:20:31 -0000 1.13 *************** *** 78,87 **** Jake2.Q2Dialog.setStatus("loading config..."); ! reconfigure(); FS.setCDDir(); // use cddir from config.cfg FS.markBaseSearchPaths(); // mark the default search paths Jake2.Q2Dialog.testQ2Data(); // test for valid baseq2 ! reconfigure(); // reload default.cfg and config.cfg // --- 78,87 ---- Jake2.Q2Dialog.setStatus("loading config..."); ! reconfigure(false); FS.setCDDir(); // use cddir from config.cfg FS.markBaseSearchPaths(); // mark the default search paths Jake2.Q2Dialog.testQ2Data(); // test for valid baseq2 ! reconfigure(true); // reload default.cfg and config.cfg // *************** *** 234,238 **** } ! static void reconfigure() { Cbuf.AddText("exec default.cfg\n"); Cbuf.AddText("bind MWHEELUP weapnext\n"); --- 234,238 ---- } ! static void reconfigure(boolean clear) { Cbuf.AddText("exec default.cfg\n"); Cbuf.AddText("bind MWHEELUP weapnext\n"); *************** *** 242,246 **** Cbuf.AddText("exec config.cfg\n"); ! Cbuf.AddEarlyCommands(true); Cbuf.Execute(); } --- 242,246 ---- Cbuf.AddText("exec config.cfg\n"); ! Cbuf.AddEarlyCommands(clear); Cbuf.Execute(); } |
From: Holger Z. <hz...@us...> - 2004-12-20 12:39:20
|
Update of /cvsroot/jake2/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3210 Modified Files: build.xml Log Message: lwjgl webstart version Index: build.xml =================================================================== RCS file: /cvsroot/jake2/jake2/build.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** build.xml 3 Nov 2004 16:16:15 -0000 1.17 --- build.xml 20 Dec 2004 12:39:10 -0000 1.18 *************** *** 24,27 **** --- 24,29 ---- <pathelement location="lib/jogl/jogl.jar"/> <pathelement location="lib/joal/linux/joal.jar"/> + <pathelement location="lib/lwjgl/lwjgl.jar"/> + <pathelement location="lib/lwjgl/lwjgl_util.jar"/> </path> *************** *** 69,73 **** <fileset dir="lib/jogl"> <include name="*.jar"/> ! </fileset> </copy> <copy todir="${dist}/lib/linux"> --- 71,78 ---- <fileset dir="lib/jogl"> <include name="*.jar"/> ! </fileset> ! <fileset dir="lib/lwjgl"> ! <include name="*.jar"/> ! </fileset> </copy> <copy todir="${dist}/lib/linux"> *************** *** 79,82 **** --- 84,92 ---- </fileset> </copy> + <copy todir="${dist}/lib/linux/lwjgl"> + <fileset dir="lib/lwjgl/linux"> + <include name="*"/> + </fileset> + </copy> <copy todir="${dist}/lib/windows"> <fileset dir="lib/jogl/windows"> *************** *** 85,88 **** --- 95,101 ---- <fileset dir="lib/joal/windows"> <include name="*"/> + </fileset> + <fileset dir="lib/lwjgl/windows"> + <include name="*"/> </fileset> </copy> *************** *** 226,229 **** --- 239,245 ---- <include name="libjoal.so"/> </jar> + <jar destfile="webstart/lib/linux/lwjgl-native.jar" basedir="${dist}/lib/linux/lwjgl"> + <include name="*.so"/> + </jar> <jar destfile="webstart/lib/linux/openal.jar" basedir="${dist}/lib/linux"> <include name="libopenal.so"/> *************** *** 239,242 **** --- 255,262 ---- <include name="OpenAL32.dll"/> </jar> + <jar destfile="webstart/lib/windows/lwjgl-native.jar" basedir="${dist}/lib/windows"> + <include name="lwjgl.dll"/> + <include name="lwjglaudio.dll"/> + </jar> <signjar keystore="${user.home}/bytonic" alias="hoz" storepass="${bytonic.pass}"> <fileset dir="webstart/lib"> |
From: Holger Z. <hz...@us...> - 2004-12-20 12:39:18
|
Update of /cvsroot/jake2/jake2/webstart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3210/webstart Modified Files: jake2_jogl11ATI.jnlp Added Files: jake2_lwjgl.jnlp Log Message: lwjgl webstart version --- NEW FILE: jake2_lwjgl.jnlp --- <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="http://www.bytonic.de/downloads" href="jake2_lwjgl.jnlp"> <information> <title>Jake2</title> <vendor>Bytonic Software</vendor> <homepage href="http://www.bytonic.de/html/jake2.html"/> <description>Java port of the Quake2 game engine</description> <icon href="http://jake2.sourceforge.net/icon.gif"/> <offline-allowed/> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.4+" max-heap-size="128M"/> <jar href="http://jake2.sourceforge.net/lib/jake2.jar"/> <jar href="http://jake2.sourceforge.net/lib/lwjgl.jar"/> <jar href="http://jake2.sourceforge.net/lib/lwjgl_util.jar"/> <property name="sun.java2d.noddraw" value="true"/> </resources> <resources os="Linux"> <j2se version="1.4+" max-heap-size="128M"/> <nativelib href="http://jake2.sourceforge.net/lib/linux/lwjgl-native.jar"/> </resources> <resources os="Windows"> <j2se version="1.4+" max-heap-size="128M"/> <nativelib href="http://jake2.sourceforge.net/lib/windows/lwjgl-native.jar"/> </resources> <application-desc main-class="jake2.Jake2"> <argument>+set</argument> <argument>vid_ref</argument> <argument>lwjgl</argument> <argument>+set</argument> <argument>+s_impl</argument> <argument>+lwjgl</argument> </application-desc> </jnlp> Index: jake2_jogl11ATI.jnlp =================================================================== RCS file: /cvsroot/jake2/jake2/webstart/jake2_jogl11ATI.jnlp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jake2_jogl11ATI.jnlp 3 Nov 2004 16:16:16 -0000 1.4 --- jake2_jogl11ATI.jnlp 20 Dec 2004 12:39:09 -0000 1.5 *************** *** 2,6 **** <jnlp spec="1.0+" codebase="http://www.bytonic.de/downloads" ! href="jake2_jogl11.jnlp"> <information> --- 2,6 ---- <jnlp spec="1.0+" codebase="http://www.bytonic.de/downloads" ! href="jake2_jogl11ATI.jnlp"> <information> |
From: Holger Z. <hz...@us...> - 2004-12-20 12:38:45
|
Update of /cvsroot/jake2/jake2/lib/lwjgl/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3010/lib/lwjgl/linux Modified Files: libopenal.so liblwjgl.so Log Message: lwjgl 0.94 Index: liblwjgl.so =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/linux/liblwjgl.so,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsBDCNZi and /tmp/cvsjbLI35 differ Index: libopenal.so =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/linux/libopenal.so,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsnFgo1X and /tmp/cvsBrU4xL differ |
From: Holger Z. <hz...@us...> - 2004-12-20 12:38:41
|
Update of /cvsroot/jake2/jake2/lib/lwjgl/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3010/lib/lwjgl/windows Modified Files: lwjgl.dll Log Message: lwjgl 0.94 Index: lwjgl.dll =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/windows/lwjgl.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsCTfYgX and /tmp/cvsTQbziG differ |
From: Holger Z. <hz...@us...> - 2004-12-20 12:38:41
|
Update of /cvsroot/jake2/jake2/lib/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3010/lib/lwjgl Modified Files: lwjgl.jar lwjgl_util.jar Log Message: lwjgl 0.94 Index: lwjgl.jar =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/lwjgl.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvskJ4hJY and /tmp/cvsNc2hOH differ Index: lwjgl_util.jar =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/lwjgl_util.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsFHEMEa and /tmp/cvsbUIyRT differ |