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: Carsten W. <ca...@us...> - 2005-04-27 12:42:21
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22420/src/jake2/sound/lwjgl Modified Files: Channel.java Log Message: now we need a lower reference distance (see the modification before) (better attenuation effects) Index: Channel.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/Channel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Channel.java 27 Apr 2005 12:21:24 -0000 1.4 --- Channel.java 27 Apr 2005 12:41:47 -0000 1.5 *************** *** 122,126 **** 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); --- 122,126 ---- AL10.nalSourcefv(sourceId, AL10.AL_VELOCITY, NULLVECTOR, 0); AL10.alSourcei (sourceId, AL10.AL_LOOPING, AL10.AL_FALSE); ! AL10.alSourcef (sourceId, AL10.AL_REFERENCE_DISTANCE, 200.0f); AL10.alSourcef (sourceId, AL10.AL_MIN_GAIN, 0.0005f); AL10.alSourcef (sourceId, AL10.AL_MAX_GAIN, 1.0f); |
From: Carsten W. <ca...@us...> - 2005-04-27 12:39:52
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21252/src/jake2/sound/joal Modified Files: JOALSoundImpl.java Channel.java Log Message: change the master volume (listener) only on Update not per source Index: Channel.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/Channel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Channel.java 27 Oct 2004 16:51:32 -0000 1.2 --- Channel.java 27 Apr 2005 12:39:23 -0000 1.3 *************** *** 27,42 **** package jake2.sound.joal; - import java.util.*; - - import net.java.games.joal.AL; import jake2.Defines; import jake2.Globals; import jake2.client.CL_ents; import jake2.game.entity_state_t; - import jake2.qcommon.Com; import jake2.sound.sfx_t; import jake2.sound.sfxcache_t; import jake2.util.Math3D; /** * Channel --- 27,44 ---- package jake2.sound.joal; 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.Math3D; + import java.util.Hashtable; + import java.util.Iterator; + import java.util.Map; + + import net.java.games.joal.AL; + /** * Channel *************** *** 93,97 **** } ! static int init(AL al, int[] buffers, float masterVolume) { Channel.al = al; Channel.buffers = buffers; --- 95,99 ---- } ! static int init(AL al, int[] buffers) { Channel.al = al; Channel.buffers = buffers; *************** *** 113,122 **** // set default values for AL sources ! al.alSourcef (sourceId, AL.AL_GAIN, masterVolume); al.alSourcef (sourceId, AL.AL_PITCH, 1.0f); al.alSourcei (sourceId, AL.AL_SOURCE_ABSOLUTE, AL.AL_TRUE); al.alSourcefv(sourceId, AL.AL_VELOCITY, NULLVECTOR); al.alSourcei (sourceId, AL.AL_LOOPING, AL.AL_FALSE); ! al.alSourcef (sourceId, AL.AL_REFERENCE_DISTANCE, 300.0f); al.alSourcef (sourceId, AL.AL_MIN_GAIN, 0.0005f); al.alSourcef (sourceId, AL.AL_MAX_GAIN, 1.0f); --- 115,124 ---- // set default values for AL sources ! al.alSourcef (sourceId, AL.AL_GAIN, 1.0f); al.alSourcef (sourceId, AL.AL_PITCH, 1.0f); al.alSourcei (sourceId, AL.AL_SOURCE_ABSOLUTE, AL.AL_TRUE); al.alSourcefv(sourceId, AL.AL_VELOCITY, NULLVECTOR); al.alSourcei (sourceId, AL.AL_LOOPING, AL.AL_FALSE); ! al.alSourcef (sourceId, AL.AL_REFERENCE_DISTANCE, 200.0f); al.alSourcef (sourceId, AL.AL_MIN_GAIN, 0.0005f); al.alSourcef (sourceId, AL.AL_MAX_GAIN, 1.0f); *************** *** 205,211 **** } ! static void playAllSounds(float[] listenerOrigin, float masterVolume) { ! float[] sourceOrigin = {0, 0, 0}; ! float[] entityOrigin = {0, 0, 0}; Channel ch; int sourceId; --- 207,215 ---- } ! // stack variables ! private static float[] entityOrigin = {0, 0, 0}; ! private static float[] sourceOrigin = {0, 0, 0}; ! ! static void playAllSounds(float[] listenerOrigin) { Channel ch; int sourceId; *************** *** 233,238 **** al.alSourcei(sourceId, AL.AL_BUFFER, ch.bufferId); } ! // al.alSourcef (sourceId, AL.AL_GAIN, masterVolume * ch.volume); ! al.alSourcef (sourceId, AL.AL_GAIN, masterVolume); al.alSourcef (sourceId, AL.AL_ROLLOFF_FACTOR, ch.rolloff); al.alSourcefv(sourceId, AL.AL_POSITION, sourceOrigin); --- 237,241 ---- al.alSourcei(sourceId, AL.AL_BUFFER, ch.bufferId); } ! // al.alSourcef (sourceId, AL.AL_GAIN, ch.volume); al.alSourcef (sourceId, AL.AL_ROLLOFF_FACTOR, ch.rolloff); al.alSourcefv(sourceId, AL.AL_POSITION, sourceOrigin); Index: JOALSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/JOALSoundImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** JOALSoundImpl.java 26 Apr 2005 22:39:34 -0000 1.12 --- JOALSoundImpl.java 27 Apr 2005 12:39:23 -0000 1.13 *************** *** 94,100 **** return false; } ! al.alGenBuffers(MAX_SFX, buffers); s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); ! int count = Channel.init(al, buffers, s_volume.value); Com.Printf("... using " + count + " channels\n"); al.alDistanceModel(AL.AL_INVERSE_DISTANCE_CLAMPED); --- 94,102 ---- return false; } ! // set the master volume s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); ! ! al.alGenBuffers(MAX_SFX, buffers); ! int count = Channel.init(al, buffers); Com.Printf("... using " + count + " channels\n"); al.alDistanceModel(AL.AL_INVERSE_DISTANCE_CLAMPED); *************** *** 267,270 **** --- 269,275 ---- al.alListenerfv(AL.AL_ORIENTATION, listenerOrientation); + // set the listener (master) volume + al.alListenerf(AL.AL_GAIN, s_volume.value); + if (eax != null) { // workaround for environment initialisation *************** *** 290,294 **** Channel.addLoopSounds(); Channel.addPlaySounds(); ! Channel.playAllSounds(listenerOrigin, s_volume.value); } --- 295,299 ---- Channel.addLoopSounds(); Channel.addPlaySounds(); ! Channel.playAllSounds(listenerOrigin); } *************** *** 297,300 **** --- 302,307 ---- */ public void StopAllSounds() { + // mute the listener (master) + al.alListenerf(AL.AL_GAIN, 0); PlaySound.reset(); Channel.reset(); |
From: Carsten W. <ca...@us...> - 2005-04-27 12:21:58
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10584/src/jake2/sound/lwjgl Modified Files: LWJGLSoundImpl.java Channel.java Log Message: change the master volume (listener) only on Update not per source Index: Channel.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/Channel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Channel.java 25 Apr 2005 22:50:25 -0000 1.3 --- Channel.java 27 Apr 2005 12:21:24 -0000 1.4 *************** *** 38,42 **** import java.nio.FloatBuffer; import java.nio.IntBuffer; ! import java.util.*; import org.lwjgl.openal.AL10; --- 38,44 ---- import java.nio.FloatBuffer; import java.nio.IntBuffer; ! import java.util.Hashtable; ! import java.util.Iterator; ! import java.util.Map; import org.lwjgl.openal.AL10; *************** *** 97,101 **** private static IntBuffer tmp = Lib.newIntBuffer(1); ! static int init(IntBuffer buffers, float masterVolume) { Channel.buffers = buffers; // create channels --- 99,103 ---- private static IntBuffer tmp = Lib.newIntBuffer(1); ! static int init(IntBuffer buffers) { Channel.buffers = buffers; // create channels *************** *** 115,119 **** // 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); --- 117,121 ---- // set default values for AL sources ! AL10.alSourcef (sourceId, AL10.AL_GAIN, 1.0f); AL10.alSourcef (sourceId, AL10.AL_PITCH, 1.0f); AL10.alSourcei (sourceId, AL10.AL_SOURCE_ABSOLUTE, AL10.AL_TRUE); *************** *** 209,214 **** private static FloatBuffer sourceOriginBuffer = Lib.newFloatBuffer(3); ! static void playAllSounds(FloatBuffer listenerOrigin, float masterVolume) { ! float[] entityOrigin = {0, 0, 0}; FloatBuffer sourceOrigin = sourceOriginBuffer; Channel ch; --- 211,218 ---- private static FloatBuffer sourceOriginBuffer = Lib.newFloatBuffer(3); ! //stack variable ! private static float[] entityOrigin = {0, 0, 0}; ! ! static void playAllSounds(FloatBuffer listenerOrigin) { FloatBuffer sourceOrigin = sourceOriginBuffer; Channel ch; *************** *** 239,244 **** 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); --- 243,247 ---- AL10.alSourcei(sourceId, AL10.AL_BUFFER, ch.bufferId); } ! // AL10.alSourcef (sourceId, AL10.AL_GAIN, ch.volume); AL10.alSourcef (sourceId, AL10.AL_ROLLOFF_FACTOR, ch.rolloff); AL10.nalSourcefv(sourceId, AL10.AL_POSITION, sourceOrigin, 0); Index: LWJGLSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/LWJGLSoundImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LWJGLSoundImpl.java 26 Apr 2005 22:34:17 -0000 1.6 --- LWJGLSoundImpl.java 27 Apr 2005 12:21:24 -0000 1.7 *************** *** 15,23 **** import jake2.util.Vargs; ! import java.nio.*; import org.lwjgl.LWJGLException; import org.lwjgl.openal.*; ! import org.lwjgl.openal.eax.*; /** --- 15,27 ---- import jake2.util.Vargs; ! import java.nio.ByteBuffer; ! import java.nio.FloatBuffer; ! import java.nio.IntBuffer; import org.lwjgl.LWJGLException; import org.lwjgl.openal.*; ! import org.lwjgl.openal.eax.EAX; ! import org.lwjgl.openal.eax.EAX20; ! import org.lwjgl.openal.eax.EAXListenerProperties; /** *************** *** 61,67 **** } ! 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); --- 65,72 ---- } ! // set the listerner (master) volume s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); ! AL10.alGenBuffers(buffers); ! int count = Channel.init(buffers); Com.Printf("... using " + count + " channels\n"); AL10.alDistanceModel(AL10.AL_INVERSE_DISTANCE_CLAMPED); *************** *** 240,243 **** --- 245,251 ---- AL10.nalListenerfv(AL10.AL_ORIENTATION, listenerOrientation, 0); + // set the master volume + AL10.alListenerf(AL10.AL_GAIN, s_volume.value); + if (hasEAX){ if ((GameBase.gi.pointcontents.pointcontents(origin)& Defines.MASK_WATER)!= 0) { *************** *** 250,254 **** Channel.addLoopSounds(); Channel.addPlaySounds(); ! Channel.playAllSounds(listenerOrigin, s_volume.value); } --- 258,262 ---- Channel.addLoopSounds(); Channel.addPlaySounds(); ! Channel.playAllSounds(listenerOrigin); } *************** *** 267,270 **** --- 275,280 ---- */ public void StopAllSounds() { + // mute the listener (master) + AL10.alListenerf(AL10.AL_GAIN, 0); PlaySound.reset(); Channel.reset(); |
From: Carsten W. <ca...@us...> - 2005-04-26 22:39:42
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30397/src/jake2/sound/joal Modified Files: JOALSoundImpl.java Log Message: code cleanup Index: JOALSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/JOALSoundImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JOALSoundImpl.java 26 Apr 2005 20:17:54 -0000 1.11 --- JOALSoundImpl.java 26 Apr 2005 22:39:34 -0000 1.12 *************** *** 15,18 **** --- 15,19 ---- import jake2.util.Vargs; + import java.awt.image.SampleModel; import java.io.*; import java.nio.IntBuffer; *************** *** 177,192 **** * @see jake2.sound.SoundImpl#RegisterSound(jake2.sound.sfx_t) */ ! private void initBuffer(sfx_t sfx) { ! if (sfx.cache == null ) { ! //System.out.println(sfx.name + " " + sfx.cache.length+ " " + sfx.cache.loopstart + " " + sfx.cache.speed + " " + sfx.cache.stereo + " " + sfx.cache.width); ! return; ! } ! ! int format = AL.AL_FORMAT_MONO16; ! byte[] data = sfx.cache.data; ! int freq = sfx.cache.speed; ! int size = data.length; ! ! al.alBufferData( buffers[sfx.bufferId], format, data, size, freq); } --- 178,184 ---- * @see jake2.sound.SoundImpl#RegisterSound(jake2.sound.sfx_t) */ ! private void initBuffer(byte[] samples, int bufferId, int freq) { ! al.alBufferData(buffers[bufferId], AL.AL_FORMAT_MONO16, samples, ! samples.length, freq); } *************** *** 513,518 **** sfxcache_t sc = WaveLoader.LoadSound(s); if (sc != null) { ! initBuffer(s); s.isCached = true; } return sc; --- 505,512 ---- sfxcache_t sc = WaveLoader.LoadSound(s); if (sc != null) { ! initBuffer(sc.data, s.bufferId, sc.speed); s.isCached = true; + // free samples for GC + s.cache.data = null; } return sc; |
From: Carsten W. <ca...@us...> - 2005-04-26 22:34:26
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27491/src/jake2/sound/lwjgl Modified Files: LWJGLSoundImpl.java Log Message: code cleanup Index: LWJGLSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/LWJGLSoundImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LWJGLSoundImpl.java 26 Apr 2005 20:17:54 -0000 1.5 --- LWJGLSoundImpl.java 26 Apr 2005 22:34:17 -0000 1.6 *************** *** 152,174 **** // TODO check the sfx direct buffer size // 2MB sfx buffer ! ByteBuffer sfxDataBuffer = Lib.newByteBuffer(2 * 1024 * 1024); /* (non-Javadoc) * @see jake2.sound.SoundImpl#RegisterSound(jake2.sound.sfx_t) */ ! private void initBuffer(sfx_t sfx) { ! if (sfx.cache == null ) { ! //System.out.println(sfx.name + " " + sfx.cache.length+ " " + sfx.cache.loopstart + " " + sfx.cache.speed + " " + sfx.cache.stereo + " " + sfx.cache.width); ! return; ! } ! ! 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; ! ! AL10.alBufferData( buffers.get(sfx.bufferId), format, data, freq); } --- 152,165 ---- // TODO check the sfx direct buffer size // 2MB sfx buffer ! private ByteBuffer sfxDataBuffer = Lib.newByteBuffer(2 * 1024 * 1024); /* (non-Javadoc) * @see jake2.sound.SoundImpl#RegisterSound(jake2.sound.sfx_t) */ ! private void initBuffer(byte[] samples, int bufferId, int freq) { ByteBuffer data = sfxDataBuffer.slice(); ! data.put(samples).flip(); ! AL10.alBufferData(buffers.get(bufferId), AL10.AL_FORMAT_MONO16, ! data, freq); } *************** *** 485,490 **** sfxcache_t sc = WaveLoader.LoadSound(s); if (sc != null) { ! initBuffer(s); s.isCached = true; } return sc; --- 476,483 ---- sfxcache_t sc = WaveLoader.LoadSound(s); if (sc != null) { ! initBuffer(sc.data, s.bufferId, sc.speed); s.isCached = true; + // free samples for GC + s.cache.data = null; } return sc; |
From: Carsten W. <ca...@us...> - 2005-04-26 22:16:51
|
Update of /cvsroot/jake2/jake2/src/jake2/sound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17852/src/jake2/sound Modified Files: WaveLoader.java Log Message: code clean up Index: WaveLoader.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/WaveLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WaveLoader.java 3 Nov 2004 20:15:02 -0000 1.3 --- WaveLoader.java 26 Apr 2005 22:16:34 -0000 1.4 *************** *** 57,77 **** */ public static sfxcache_t LoadSound(sfx_t s) { - String namebuffer; - byte[] data; - wavinfo_t info; - int len; - float stepscale; - sfxcache_t sc = null; - int size; - String name; - if (s.name.charAt(0) == '*') return null; // see if still in memory ! sc = s.cache; if (sc != null) return sc; // load it in if (s.truename != null) --- 57,69 ---- */ public static sfxcache_t LoadSound(sfx_t s) { if (s.name.charAt(0) == '*') return null; // see if still in memory ! sfxcache_t sc = s.cache; if (sc != null) return sc; + String name; // load it in if (s.truename != null) *************** *** 80,90 **** name = s.name; if (name.charAt(0) == '#') namebuffer = name.substring(1); - else namebuffer = "sound/" + name; ! data = FS.LoadFile(namebuffer); if (data == null) { --- 72,82 ---- name = s.name; + String namebuffer; if (name.charAt(0) == '#') namebuffer = name.substring(1); else namebuffer = "sound/" + name; ! byte[] data = FS.LoadFile(namebuffer); if (data == null) { *************** *** 92,98 **** return null; } ! size = data.length; ! info = GetWavinfo(s.name, data, size); AudioInputStream in = null; --- 84,90 ---- return null; } ! int size = data.length; ! wavinfo_t info = GetWavinfo(s.name, data, size); AudioInputStream in = null; |
From: Carsten W. <ca...@us...> - 2005-04-26 20:18:08
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14747/src/jake2/sound/joal Modified Files: JOALSoundImpl.java Log Message: bugfix: very stupid sound registration ;-) now the dynamic sounds (weapons) will be loaded only once. This solves the lwjgl crash too. Index: JOALSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/JOALSoundImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JOALSoundImpl.java 3 Nov 2004 12:17:17 -0000 1.10 --- JOALSoundImpl.java 26 Apr 2005 20:17:54 -0000 1.11 *************** *** 510,515 **** */ public sfxcache_t LoadSound(sfx_t s) { sfxcache_t sc = WaveLoader.LoadSound(s); ! initBuffer(s); return sc; } --- 510,519 ---- */ public sfxcache_t LoadSound(sfx_t s) { + if (s.isCached) return s.cache; sfxcache_t sc = WaveLoader.LoadSound(s); ! if (sc != null) { ! initBuffer(s); ! s.isCached = true; ! } return sc; } *************** *** 519,525 **** */ public void StartLocalSound(String sound) { ! sfx_t sfx; ! ! sfx = RegisterSound(sound); if (sfx == null) { Com.Printf("S_StartLocalSound: can't cache " + sound + "\n"); --- 523,527 ---- */ public void StartLocalSound(String sound) { ! sfx_t sfx = RegisterSound(sound); if (sfx == null) { Com.Printf("S_StartLocalSound: can't cache " + sound + "\n"); |
From: Carsten W. <ca...@us...> - 2005-04-26 20:18:08
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14747/src/jake2/sound/lwjgl Modified Files: LWJGLSoundImpl.java Log Message: bugfix: very stupid sound registration ;-) now the dynamic sounds (weapons) will be loaded only once. This solves the lwjgl crash too. Index: LWJGLSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/LWJGLSoundImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LWJGLSoundImpl.java 23 Dec 2004 00:52:12 -0000 1.4 --- LWJGLSoundImpl.java 26 Apr 2005 20:17:54 -0000 1.5 *************** *** 482,487 **** */ public sfxcache_t LoadSound(sfx_t s) { sfxcache_t sc = WaveLoader.LoadSound(s); ! initBuffer(s); return sc; } --- 482,491 ---- */ public sfxcache_t LoadSound(sfx_t s) { + if (s.isCached) return s.cache; sfxcache_t sc = WaveLoader.LoadSound(s); ! if (sc != null) { ! initBuffer(s); ! s.isCached = true; ! } return sc; } |
From: Carsten W. <ca...@us...> - 2005-04-26 20:11:15
|
Update of /cvsroot/jake2/jake2/src/jake2/sound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11112/src/jake2/sound Modified Files: sfx_t.java Log Message: new attribute for cached sounds Index: sfx_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/sfx_t.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sfx_t.java 13 Jul 2004 11:20:27 -0000 1.2 --- sfx_t.java 26 Apr 2005 20:11:03 -0000 1.3 *************** *** 37,40 **** --- 37,41 ---- // is used for AL buffers public int bufferId = -1; + public boolean isCached = false; public void clear() { *************** *** 43,46 **** --- 44,48 ---- registration_sequence = 0; bufferId = -1; + isCached = false; } } |
From: Carsten W. <ca...@us...> - 2005-04-25 22:50:54
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14489/src/jake2/sound/lwjgl Modified Files: Channel.java Log Message: bugfix: this have to be a copy of the listener origin (I hope this solves the lwjgl openal problem) Index: Channel.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/lwjgl/Channel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Channel.java 23 Dec 2004 00:52:12 -0000 1.2 --- Channel.java 25 Apr 2005 22:50:25 -0000 1.3 *************** *** 222,226 **** switch (ch.type) { case Channel.LISTENER: ! sourceOrigin = listenerOrigin; break; case Channel.DYNAMIC: --- 222,228 ---- switch (ch.type) { case Channel.LISTENER: ! sourceOrigin.put(0, listenerOrigin.get(0)); ! sourceOrigin.put(1, listenerOrigin.get(1)); ! sourceOrigin.put(2, listenerOrigin.get(2)); break; case Channel.DYNAMIC: |
From: Carsten W. <ca...@us...> - 2005-04-25 17:41:15
|
Update of /cvsroot/jake2/jake2/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31082/scripts Modified Files: Jake2.bat Jake2.sh Log Message: put the lwjgl libs into classpath Index: Jake2.bat =================================================================== RCS file: /cvsroot/jake2/jake2/scripts/Jake2.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jake2.bat 9 Jul 2004 06:50:50 -0000 1.2 --- Jake2.bat 25 Apr 2005 17:40:54 -0000 1.3 *************** *** 1,3 **** @echo off SET PATH=lib\windows;%PATH% ! java -Xmx128M -Dsun.java2d.noddraw=true -Djava.library.path=lib/windows -cp lib/jake2.jar;lib/jogl.jar;lib/windows/joal.jar jake2.Jake2 \ No newline at end of file --- 1,4 ---- @echo off SET PATH=lib\windows;%PATH% ! SET CP=lib/jake2.jar;lib/jogl.jar;lib/windows/joal.jar;lib/lwjgl.jar;lib/lwjgl_util.jar ! java -Xmx128M -Dsun.java2d.noddraw=true -Djava.library.path=lib/windows -cp %CP% jake2.Jake2 \ No newline at end of file Index: Jake2.sh =================================================================== RCS file: /cvsroot/jake2/jake2/scripts/Jake2.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jake2.sh 9 Jul 2004 06:50:50 -0000 1.2 --- Jake2.sh 25 Apr 2005 17:41:05 -0000 1.3 *************** *** 2,6 **** export LD_LIBRARY_PATH=lib/linux ! CP=lib/jake2.jar:lib/jogl.jar:lib/linux/joal.jar exec java -Xmx128M -Djava.library.path=lib/linux -cp $CP jake2.Jake2 --- 2,6 ---- export LD_LIBRARY_PATH=lib/linux ! CP=lib/jake2.jar:lib/jogl.jar:lib/linux/joal.jar:lib/lwjgl.jar:lib/lwjgl_util.jar exec java -Xmx128M -Djava.library.path=lib/linux -cp $CP jake2.Jake2 |
From: Carsten W. <ca...@us...> - 2005-04-25 09:24:20
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1934/src/jake2/render/lwjgl Modified Files: Misc.java Log Message: import cleanup Index: Misc.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Misc.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Misc.java 25 Apr 2005 02:18:20 -0000 1.3 --- Misc.java 25 Apr 2005 09:24:09 -0000 1.4 *************** *** 29,46 **** import jake2.client.VID; import jake2.qcommon.FS; - import jake2.util.Lib; - import java.awt.image.BufferedImage; - import java.io.*; import java.io.File; ! import java.io.IOException; ! import java.nio.*; ! import java.nio.ByteBuffer; import java.nio.FloatBuffer; ! import java.nio.channels.Channel; import java.nio.channels.FileChannel; - import javax.imageio.ImageIO; - import org.lwjgl.BufferUtils; import org.lwjgl.opengl.EXTPointParameters; --- 29,39 ---- import jake2.client.VID; import jake2.qcommon.FS; import java.io.File; ! import java.io.RandomAccessFile; import java.nio.FloatBuffer; ! import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import org.lwjgl.BufferUtils; import org.lwjgl.opengl.EXTPointParameters; |
From: Carsten W. <ca...@us...> - 2005-04-25 09:23:23
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv994/src/jake2/render/jogl Modified Files: Misc.java Log Message: screenshot function for (fast)jogl drivers. Needs a callback mechanism and a sliced buffer. Index: Misc.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Misc.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Misc.java 16 Jul 2004 10:11:35 -0000 1.3 --- Misc.java 25 Apr 2005 09:23:13 -0000 1.4 *************** *** 26,31 **** --- 26,41 ---- package jake2.render.jogl; + import java.io.File; + import java.io.RandomAccessFile; + import java.nio.ByteBuffer; + import java.nio.MappedByteBuffer; + import java.nio.channels.FileChannel; + + import org.lwjgl.opengl.GL11; + import jake2.Defines; import jake2.client.VID; + import jake2.qcommon.FS; + import jake2.qcommon.xcommand_t; import net.java.games.jogl.GL; import net.java.games.jogl.WGL; *************** *** 112,182 **** // } TargaHeader; ! /* ! ================== ! GL_ScreenShot_f ! ================== ! */ ! void GL_ScreenShot_f() ! { ! // byte *buffer; ! // char picname[80]; ! // char checkname[MAX_OSPATH]; ! // int i, c, temp; ! // FILE *f; ! // ! // // create the scrnshots directory if it doesn't exist ! // Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot", ri.FS_Gamedir()); ! // Sys_Mkdir (checkname); ! // ! //// ! //// find a file name to save it to ! //// ! // strcpy(picname,"quake00.tga"); ! // ! // for (i=0 ; i<=99 ; i++) ! // { ! // picname[5] = i/10 + '0'; ! // picname[6] = i%10 + '0'; ! // Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot/%s", ri.FS_Gamedir(), picname); ! // f = fopen (checkname, "r"); ! // if (!f) ! // break; // file doesn't exist ! // fclose (f); ! // } ! // if (i==100) ! // { ! // VID.Printf (PRINT_ALL, "SCR_ScreenShot_f: Couldn't create a file\n"); ! // return; ! // } ! // ! // ! // buffer = malloc(vid.width*vid.height*3 + 18); ! // memset (buffer, 0, 18); ! // buffer[2] = 2; // uncompressed type ! // buffer[12] = vid.width&255; ! // buffer[13] = vid.width>>8; ! // buffer[14] = vid.height&255; ! // buffer[15] = vid.height>>8; ! // buffer[16] = 24; // pixel size ! // ! // qglReadPixels (0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 ); ! // ! // // swap rgb to bgr ! // c = 18+vid.width*vid.height*3; ! // for (i=18 ; i<c ; i+=3) ! // { ! // temp = buffer[i]; ! // buffer[i] = buffer[i+2]; ! // buffer[i+2] = temp; ! // } ! // ! // f = fopen (checkname, "rw"); ! // fwrite (buffer, 1, c, f); ! // fclose (f); ! // ! // free (buffer); ! // VID.Printf (PRINT_ALL, "Wrote %s\n", picname); ! } /* --- 122,198 ---- // } TargaHeader; + private final static int TGA_HEADER_SIZE = 18; ! /** ! * GL_ScreenShot_f ! */ ! void GL_ScreenShot_f() { ! if (contextInUse) { ! screenshot_f(); ! } else { ! updateScreen(screenshotCall); ! } ! } ! ! private xcommand_t screenshotCall = new xcommand_t() { ! public void execute() { ! screenshot_f(); ! } ! }; ! ! private void screenshot_f() { ! FS.CreatePath(FS.Gamedir() + "/scrshot/jake00.tga"); ! File file = new File(FS.Gamedir() + "/scrshot/jake00.tga"); ! // find a valid file name ! int i = 0; ! while (file.exists() && i++ < 100) { ! file = new File(FS.Gamedir() + "/scrshot/jake" + (i/10) + (i%10) + ".tga"); ! } ! if (i == 100) { ! VID.Printf(Defines.PRINT_ALL, "Couldn't create a new screenshot file\n"); ! return; ! } ! ! try { ! RandomAccessFile out = new RandomAccessFile(file, "rw"); ! FileChannel ch = out.getChannel(); ! int fileLength = TGA_HEADER_SIZE + vid.width * vid.height * 3; ! out.setLength(fileLength); ! MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, ! fileLength); ! ! // write the TGA header ! image.put(0, (byte) 0).put(1, (byte) 0); ! image.put(2, (byte) 2); // uncompressed type ! image.put(12, (byte) (vid.width & 0xFF)); // vid.width ! image.put(13, (byte) (vid.width >> 8)); // vid.width ! image.put(14, (byte) (vid.height & 0xFF)); // vid.height ! image.put(15, (byte) (vid.height >> 8)); // vid.height ! image.put(16, (byte) 24); // pixel size ! ! // go to image data position ! image.position(TGA_HEADER_SIZE); ! // jogl needs a sliced buffer ! ByteBuffer rgb = image.slice(); ! // read the RGB values into the image buffer ! gl.glReadPixels(0, 0, vid.width, vid.height, GL11.GL_RGB, ! GL11.GL_UNSIGNED_BYTE, rgb); ! ! // flip RGB to BGR ! byte tmp; ! for (i = TGA_HEADER_SIZE; i < fileLength; i += 3) { ! tmp = image.get(i); ! image.put(i, image.get(i + 2)); ! image.put(i + 2, tmp); ! } ! // close the file channel ! ch.close(); ! } catch (Exception e) { ! // TODO Auto-generated catch block ! e.printStackTrace(); ! } ! ! VID.Printf(Defines.PRINT_ALL, "Wrote " + file + '\n'); ! } /* |
From: Carsten W. <ca...@us...> - 2005-04-25 09:23:23
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv994/src/jake2/render/fastjogl Modified Files: Misc.java Log Message: screenshot function for (fast)jogl drivers. Needs a callback mechanism and a sliced buffer. Index: Misc.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Misc.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Misc.java 22 Sep 2004 19:22:10 -0000 1.3 --- Misc.java 25 Apr 2005 09:23:14 -0000 1.4 *************** *** 26,31 **** --- 26,41 ---- package jake2.render.fastjogl; + import java.io.File; + import java.io.RandomAccessFile; + import java.nio.ByteBuffer; + import java.nio.MappedByteBuffer; + import java.nio.channels.FileChannel; + + import org.lwjgl.opengl.GL11; + import jake2.Defines; import jake2.client.VID; + import jake2.qcommon.FS; + import jake2.qcommon.xcommand_t; import net.java.games.jogl.GL; import net.java.games.jogl.WGL; *************** *** 99,169 **** // unsigned char pixel_size, attributes; // } TargaHeader; ! /* ! ================== ! GL_ScreenShot_f ! ================== ! */ void GL_ScreenShot_f() { ! // byte *buffer; ! // char picname[80]; ! // char checkname[MAX_OSPATH]; ! // int i, c, temp; ! // FILE *f; ! // ! // // create the scrnshots directory if it doesn't exist ! // Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot", ri.FS_Gamedir()); ! // Sys_Mkdir (checkname); ! // ! //// ! //// find a file name to save it to ! //// ! // strcpy(picname,"quake00.tga"); ! // ! // for (i=0 ; i<=99 ; i++) ! // { ! // picname[5] = i/10 + '0'; ! // picname[6] = i%10 + '0'; ! // Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot/%s", ri.FS_Gamedir(), picname); ! // f = fopen (checkname, "r"); ! // if (!f) ! // break; // file doesn't exist ! // fclose (f); ! // } ! // if (i==100) ! // { ! // VID.Printf (PRINT_ALL, "SCR_ScreenShot_f: Couldn't create a file\n"); ! // return; ! // } ! // ! // ! // buffer = malloc(vid.width*vid.height*3 + 18); ! // memset (buffer, 0, 18); ! // buffer[2] = 2; // uncompressed type ! // buffer[12] = vid.width&255; ! // buffer[13] = vid.width>>8; ! // buffer[14] = vid.height&255; ! // buffer[15] = vid.height>>8; ! // buffer[16] = 24; // pixel size ! // ! // qglReadPixels (0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 ); ! // ! // // swap rgb to bgr ! // c = 18+vid.width*vid.height*3; ! // for (i=18 ; i<c ; i+=3) ! // { ! // temp = buffer[i]; ! // buffer[i] = buffer[i+2]; ! // buffer[i+2] = temp; ! // } ! // ! // f = fopen (checkname, "rw"); ! // fwrite (buffer, 1, c, f); ! // fclose (f); ! // ! // free (buffer); ! // VID.Printf (PRINT_ALL, "Wrote %s\n", picname); } /* ** GL_Strings_f --- 109,187 ---- // unsigned char pixel_size, attributes; // } TargaHeader; + + private final static int TGA_HEADER_SIZE = 18; ! /** ! * GL_ScreenShot_f ! */ void GL_ScreenShot_f() { ! if (contextInUse) { ! screenshot_f(); ! } else { ! updateScreen(screenshotCall); ! } } + private xcommand_t screenshotCall = new xcommand_t() { + public void execute() { + screenshot_f(); + } + }; + + private void screenshot_f() { + FS.CreatePath(FS.Gamedir() + "/scrshot/jake00.tga"); + File file = new File(FS.Gamedir() + "/scrshot/jake00.tga"); + // find a valid file name + int i = 0; + while (file.exists() && i++ < 100) { + file = new File(FS.Gamedir() + "/scrshot/jake" + (i/10) + (i%10) + ".tga"); + } + if (i == 100) { + VID.Printf(Defines.PRINT_ALL, "Couldn't create a new screenshot file\n"); + return; + } + + try { + RandomAccessFile out = new RandomAccessFile(file, "rw"); + FileChannel ch = out.getChannel(); + int fileLength = TGA_HEADER_SIZE + vid.width * vid.height * 3; + out.setLength(fileLength); + MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, + fileLength); + + // write the TGA header + image.put(0, (byte) 0).put(1, (byte) 0); + image.put(2, (byte) 2); // uncompressed type + image.put(12, (byte) (vid.width & 0xFF)); // vid.width + image.put(13, (byte) (vid.width >> 8)); // vid.width + image.put(14, (byte) (vid.height & 0xFF)); // vid.height + image.put(15, (byte) (vid.height >> 8)); // vid.height + image.put(16, (byte) 24); // pixel size + + // go to image data position + image.position(TGA_HEADER_SIZE); + // jogl needs a sliced buffer + ByteBuffer rgb = image.slice(); + // read the RGB values into the image buffer + gl.glReadPixels(0, 0, vid.width, vid.height, GL11.GL_RGB, + GL11.GL_UNSIGNED_BYTE, rgb); + + // flip RGB to BGR + byte tmp; + for (i = TGA_HEADER_SIZE; i < fileLength; i += 3) { + tmp = image.get(i); + image.put(i, image.get(i + 2)); + image.put(i + 2, tmp); + } + // close the file channel + ch.close(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + VID.Printf(Defines.PRINT_ALL, "Wrote " + file + '\n'); + } + /* ** GL_Strings_f |
From: Carsten W. <ca...@us...> - 2005-04-25 02:18:36
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10298/src/jake2/render/lwjgl Modified Files: Misc.java Log Message: The first screenshot implementation (lwjgl) Index: Misc.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Misc.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Misc.java 14 Dec 2004 12:56:59 -0000 1.2 --- Misc.java 25 Apr 2005 02:18:20 -0000 1.3 *************** *** 28,33 **** --- 28,45 ---- import jake2.Defines; import jake2.client.VID; + import jake2.qcommon.FS; + import jake2.util.Lib; + import java.awt.image.BufferedImage; + import java.io.*; + import java.io.File; + import java.io.IOException; + import java.nio.*; + import java.nio.ByteBuffer; import java.nio.FloatBuffer; + import java.nio.channels.Channel; + import java.nio.channels.FileChannel; + + import javax.imageio.ImageIO; import org.lwjgl.BufferUtils; *************** *** 97,101 **** } - // /* // ============================================================================== --- 109,112 ---- *************** *** 114,118 **** // } TargaHeader; ! /* ================== --- 125,130 ---- // } TargaHeader; ! private final static int TGA_HEADER_SIZE = 18; ! /* ================== *************** *** 122,184 **** void GL_ScreenShot_f() { ! // byte *buffer; ! // char picname[80]; ! // char checkname[MAX_OSPATH]; ! // int i, c, temp; ! // FILE *f; ! // ! // // create the scrnshots directory if it doesn't exist ! // Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot", ri.FS_Gamedir()); ! // Sys_Mkdir (checkname); ! // ! //// ! //// find a file name to save it to ! //// ! // strcpy(picname,"quake00.tga"); ! // ! // for (i=0 ; i<=99 ; i++) ! // { ! // picname[5] = i/10 + '0'; ! // picname[6] = i%10 + '0'; ! // Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot/%s", ri.FS_Gamedir(), picname); ! // f = fopen (checkname, "r"); ! // if (!f) ! // break; // file doesn't exist ! // fclose (f); ! // } ! // if (i==100) ! // { ! // VID.Printf (PRINT_ALL, "SCR_ScreenShot_f: Couldn't create a file\n"); ! // return; ! // } ! // ! // ! // buffer = malloc(vid.width*vid.height*3 + 18); ! // memset (buffer, 0, 18); ! // buffer[2] = 2; // uncompressed type ! // buffer[12] = vid.width&255; ! // buffer[13] = vid.width>>8; ! // buffer[14] = vid.height&255; ! // buffer[15] = vid.height>>8; ! // buffer[16] = 24; // pixel size ! // ! // qglReadPixels (0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 ); ! // ! // // swap rgb to bgr ! // c = 18+vid.width*vid.height*3; ! // for (i=18 ; i<c ; i+=3) ! // { ! // temp = buffer[i]; ! // buffer[i] = buffer[i+2]; ! // buffer[i+2] = temp; ! // } ! // ! // f = fopen (checkname, "rw"); ! // fwrite (buffer, 1, c, f); ! // fclose (f); ! // ! // free (buffer); ! // VID.Printf (PRINT_ALL, "Wrote %s\n", picname); ! } /* --- 134,189 ---- void GL_ScreenShot_f() { ! FS.CreatePath(FS.Gamedir() + "/scrshot/jake00.tga"); ! File file = new File(FS.Gamedir() + "/scrshot/jake00.tga"); ! // find a valid file name ! int i = 0; ! while (file.exists() && i++ < 100) { ! file = new File(FS.Gamedir() + "/scrshot/jake" + (i/10) + (i%10) + ".tga"); ! } ! if (i == 100) { ! VID.Printf(Defines.PRINT_ALL, "Couldn't create a new screenshot file\n"); ! return; ! } ! ! try { ! RandomAccessFile out = new RandomAccessFile(file, "rw"); ! FileChannel ch = out.getChannel(); ! int fileLength = TGA_HEADER_SIZE + vid.width * vid.height * 3; ! out.setLength(fileLength); ! MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, ! fileLength); ! ! // write the TGA header ! image.put(0, (byte) 0).put(1, (byte) 0); ! image.put(2, (byte) 2); // uncompressed type ! image.put(12, (byte) (vid.width & 0xFF)); // vid.width ! image.put(13, (byte) (vid.width >> 8)); // vid.width ! image.put(14, (byte) (vid.height & 0xFF)); // vid.height ! image.put(15, (byte) (vid.height >> 8)); // vid.height ! image.put(16, (byte) 24); // pixel size ! ! // go to image data position ! image.position(TGA_HEADER_SIZE); ! ! // read the RGB values into the image buffer ! gl.glReadPixels(0, 0, vid.width, vid.height, GL11.GL_RGB, ! GL11.GL_UNSIGNED_BYTE, image); ! ! // flip RGB to BGR ! byte tmp; ! for (i = TGA_HEADER_SIZE; i < fileLength; i += 3) { ! tmp = image.get(i); ! image.put(i, image.get(i + 2)); ! image.put(i + 2, tmp); ! } ! // close the file channel ! ch.close(); ! } catch (Exception e) { ! // TODO Auto-generated catch block ! e.printStackTrace(); ! } ! ! VID.Printf(Defines.PRINT_ALL, "Wrote " + file + '\n'); ! } /* |
From: Carsten W. <ca...@us...> - 2005-04-08 14:05:50
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29976/src/jake2/render/jogl Modified Files: Mesh.java Log Message: bugfix [ 1144565 ] power shield of monster "brain" not displayed correctly Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Mesh.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Mesh.java 22 Sep 2004 19:22:16 -0000 1.7 --- Mesh.java 8 Apr 2005 14:05:34 -0000 1.8 *************** *** 246,252 **** | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE | Defines.RF_SHELL_HALF_DAM)) != 0) { ! gl ! .glColor4f(shadelight[0], shadelight[1], shadelight[2], ! alpha); } else { gl.glEnableClientState(GL.GL_COLOR_ARRAY); --- 246,252 ---- | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE | Defines.RF_SHELL_HALF_DAM)) != 0) { ! ! gl.glDisableClientState(GL.GL_COLOR_ARRAY); ! gl.glColor4f(shadelight[0], shadelight[1], shadelight[2], alpha); } else { gl.glEnableClientState(GL.GL_COLOR_ARRAY); |
From: Carsten W. <ca...@us...> - 2005-04-07 15:29:30
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31708/src/jake2/client Modified Files: VID.java Log Message: the brightness slider now modifies the gl_modulate value too, because it looks better than a pure gamma correction. Index: VID.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/VID.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** VID.java 12 Jan 2005 08:36:21 -0000 1.14 --- VID.java 7 Apr 2005 15:29:21 -0000 1.15 *************** *** 426,432 **** ** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3 */ ! float gamma = ( 0.8f - ( s_brightness_slider.curvalue/10.0f - 0.5f ) ) + 0.5f; Cvar.SetValue( "vid_gamma", gamma ); Cvar.SetValue( "sw_stipplealpha", s_stipple_box.curvalue ); Cvar.SetValue( "gl_picmip", 3 - s_tq_slider.curvalue ); --- 426,438 ---- ** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3 */ ! // the original was modified, because on CRTs it was too dark. ! // the slider range is [5; 13] ! // gamma: [1.1; 0.7] ! float gamma = ( 0.4f - ( s_brightness_slider.curvalue/20.0f - 0.25f ) ) + 0.7f; ! // modulate: [1.0; 2.6] ! float modulate = s_brightness_slider.curvalue * 0.2f; Cvar.SetValue( "vid_gamma", gamma ); + Cvar.SetValue( "gl_modulate", modulate); Cvar.SetValue( "sw_stipplealpha", s_stipple_box.curvalue ); Cvar.SetValue( "gl_picmip", 3 - s_tq_slider.curvalue ); |
From: Carsten W. <ca...@us...> - 2005-04-07 15:26:28
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29423/src/jake2/render/jogl Modified Files: Main.java Log Message: initial value of gl_modulate is set to 1.5 because the game was mostly too dark. Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Main.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Main.java 8 Dec 2004 09:58:34 -0000 1.6 --- Main.java 7 Apr 2005 15:25:49 -0000 1.7 *************** *** 954,958 **** gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); gl_log = Cvar.Get("gl_log", "0", 0); gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); --- 954,958 ---- gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1.5", Globals.CVAR_ARCHIVE); gl_log = Cvar.Get("gl_log", "0", 0); gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); |
From: Carsten W. <ca...@us...> - 2005-04-07 15:26:27
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29423/src/jake2/render/lwjgl Modified Files: Main.java Log Message: initial value of gl_modulate is set to 1.5 because the game was mostly too dark. Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Main.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Main.java 21 Jan 2005 22:25:23 -0000 1.5 --- Main.java 7 Apr 2005 15:25:49 -0000 1.6 *************** *** 958,962 **** gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); gl_log = Cvar.Get("gl_log", "0", 0); gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); --- 958,962 ---- gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1.5", Globals.CVAR_ARCHIVE); gl_log = Cvar.Get("gl_log", "0", 0); gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); |
From: Carsten W. <ca...@us...> - 2005-04-07 15:26:12
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29423/src/jake2/render/fastjogl Modified Files: Main.java Log Message: initial value of gl_modulate is set to 1.5 because the game was mostly too dark. Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Main.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Main.java 16 Jan 2005 17:08:57 -0000 1.6 --- Main.java 7 Apr 2005 15:25:49 -0000 1.7 *************** *** 956,960 **** gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); gl_log = Cvar.Get("gl_log", "0", 0); gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); --- 956,960 ---- gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1.5", Globals.CVAR_ARCHIVE); gl_log = Cvar.Get("gl_log", "0", 0); gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); |
From: Rene S. <sa...@us...> - 2005-03-13 20:52:20
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21888/src/jake2/game Modified Files: Cmd.java Log Message: fixes bug on say command with 1 argument Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Cmd.java 13 Feb 2005 17:02:46 -0000 1.12 --- Cmd.java 13 Mar 2005 20:52:05 -0000 1.13 *************** *** 251,254 **** --- 251,255 ---- cmd_argc = 0; + cmd_args = ""; int len = Lib.strlen(text); |
From: Rene S. <sa...@us...> - 2005-02-20 21:51:17
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17458/src/jake2/game Modified Files: GameTarget.java GameBase.java Fire.java GameFunc.java Log Message: VectorEquals instead of VectorCompare Index: GameTarget.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTarget.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GameTarget.java 19 Feb 2005 21:18:44 -0000 1.4 --- GameTarget.java 20 Feb 2005 21:50:36 -0000 1.5 *************** *** 609,613 **** Math3D.VectorSubtract(point, self.s.origin, self.movedir); Math3D.VectorNormalize(self.movedir); ! if (0 == Math3D.VectorCompare(self.movedir, last_movedir)) self.spawnflags |= 0x80000000; } --- 609,613 ---- Math3D.VectorSubtract(point, self.s.origin, self.movedir); Math3D.VectorNormalize(self.movedir); ! if (!Math3D.VectorEquals(self.movedir, last_movedir)) self.spawnflags |= 0x80000000; } Index: Fire.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Fire.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fire.java 22 Sep 2004 19:22:02 -0000 1.4 --- Fire.java 20 Feb 2005 21:50:36 -0000 1.5 *************** *** 146,150 **** Math3D.VectorCopy(tr.endpos, water_start); ! if (0 == Math3D.VectorCompare(start, tr.endpos)) { if ((tr.contents & Defines.CONTENTS_WATER) != 0) { if (Lib.strcmp(tr.surface.name, "*brwater") == 0) --- 146,150 ---- Math3D.VectorCopy(tr.endpos, water_start); ! if (!Math3D.VectorEquals(start, tr.endpos)) { if ((tr.contents & Defines.CONTENTS_WATER) != 0) { if (Lib.strcmp(tr.surface.name, "*brwater") == 0) Index: GameBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameBase.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GameBase.java 13 Feb 2005 17:02:45 -0000 1.9 --- GameBase.java 20 Feb 2005 21:50:36 -0000 1.10 *************** *** 287,293 **** public static void G_SetMovedir(float[] angles, float[] movedir) { ! if (Math3D.VectorCompare(angles, VEC_UP) != 0) { Math3D.VectorCopy(MOVEDIR_UP, movedir); ! } else if (Math3D.VectorCompare(angles, VEC_DOWN) != 0) { Math3D.VectorCopy(MOVEDIR_DOWN, movedir); } else { --- 287,293 ---- public static void G_SetMovedir(float[] angles, float[] movedir) { ! if (Math3D.VectorEquals(angles, VEC_UP)) { Math3D.VectorCopy(MOVEDIR_UP, movedir); ! } else if (Math3D.VectorEquals(angles, VEC_DOWN)) { Math3D.VectorCopy(MOVEDIR_DOWN, movedir); } else { Index: GameFunc.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameFunc.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GameFunc.java 22 Sep 2004 19:22:04 -0000 1.5 --- GameFunc.java 20 Feb 2005 21:50:36 -0000 1.6 *************** *** 669,673 **** move); ! if (Math3D.VectorCompare(move, Globals.vec3_origin) != 0) { AngleMove_Done.think(ent); return true; --- 669,673 ---- move); ! if (Math3D.VectorEquals(move, Globals.vec3_origin)) { AngleMove_Done.think(ent); return true; *************** *** 882,886 **** static EntUseAdapter rotating_use = new EntUseAdapter() { public void use(edict_t self, edict_t other, edict_t activator) { ! if (0 == Math3D.VectorCompare(self.avelocity, Globals.vec3_origin)) { self.s.sound = 0; Math3D.VectorClear(self.avelocity); --- 882,886 ---- static EntUseAdapter rotating_use = new EntUseAdapter() { public void use(edict_t self, edict_t other, edict_t activator) { ! if (!Math3D.VectorEquals(self.avelocity, Globals.vec3_origin)) { self.s.sound = 0; Math3D.VectorClear(self.avelocity); *************** *** 1973,1977 **** public void use(edict_t self, edict_t other, edict_t activator) { // make sure we're not already moving ! if (0 == Math3D.VectorCompare(self.s.origin, Globals.vec3_origin)) return; --- 1973,1977 ---- public void use(edict_t self, edict_t other, edict_t activator) { // make sure we're not already moving ! if (!Math3D.VectorEquals(self.s.origin, Globals.vec3_origin)) return; |
From: Rene S. <sa...@us...> - 2005-02-20 21:51:17
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17458/src/jake2/util Modified Files: Math3D.java Log Message: VectorEquals instead of VectorCompare Index: Math3D.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Math3D.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Math3D.java 16 Jan 2005 17:04:50 -0000 1.8 --- Math3D.java 20 Feb 2005 21:50:36 -0000 1.9 *************** *** 75,83 **** a[0] = a[1] = a[2] = 0; } ! public static int VectorCompare(float[] v1, float[] v2) { if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) ! return 0; ! return 1; } public static void VectorNegate(float[] from, float[] to) { --- 75,83 ---- a[0] = a[1] = a[2] = 0; } ! public static boolean VectorEquals(float[] v1, float[] v2) { if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) ! return false; ! return true; } public static void VectorNegate(float[] from, float[] to) { |
From: Rene S. <sa...@us...> - 2005-02-20 21:51:07
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17458/src/jake2/server Modified Files: SV.java Log Message: VectorEquals instead of VectorCompare Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SV.java 22 Sep 2004 19:22:12 -0000 1.10 --- SV.java 20 Feb 2005 21:50:37 -0000 1.11 *************** *** 201,205 **** for (j = 0; j < numplanes; j++) if ((j != i) ! && Math3D.VectorCompare(planes[i], planes[j]) == 0.0f) { if (Math3D.DotProduct(new_velocity, planes[j]) < 0) break; // not ok --- 201,205 ---- for (j = 0; j < numplanes; j++) if ((j != i) ! && !Math3D.VectorEquals(planes[i], planes[j])) { if (Math3D.DotProduct(new_velocity, planes[j]) < 0) break; // not ok |
From: Rene S. <sa...@us...> - 2005-02-20 21:51:07
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17458/src/jake2/client Modified Files: CL_tent.java Log Message: VectorEquals instead of VectorCompare Index: CL_tent.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_tent.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CL_tent.java 21 Jan 2005 01:14:47 -0000 1.9 --- CL_tent.java 20 Feb 2005 21:50:52 -0000 1.10 *************** *** 1566,1570 **** // if it's a non-origin offset, it's a player, so use the // hardcoded player offset ! if (Math3D.VectorCompare(b[i].offset, Globals.vec3_origin) == 0) { Math3D.VectorMA(org, -(b[i].offset[0]) + 1, r, org); Math3D.VectorMA(org, -(b[i].offset[1]), f, org); --- 1566,1570 ---- // if it's a non-origin offset, it's a player, so use the // hardcoded player offset ! if (!Math3D.VectorEquals(b[i].offset, Globals.vec3_origin)) { Math3D.VectorMA(org, -(b[i].offset[0]) + 1, r, org); Math3D.VectorMA(org, -(b[i].offset[1]), f, org); |