Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax
In directory usw-pr-cvs1:/tmp/cvs-serv22911/org/lwjgl/openal/eax
Modified Files:
EAXBufferProperties.java
Log Message:
fix: now reading ints instead of longs - buffer overflow, since longs are 64 bit in java
Index: EAXBufferProperties.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- EAXBufferProperties.java 3 Sep 2002 11:17:42 -0000 1.2
+++ EAXBufferProperties.java 11 Sep 2002 16:46:26 -0000 1.3
@@ -40,7 +40,9 @@
/**
* $Id$
*
- * This class encapsultaes the EAXBUFFERPROPERTIES struct
+ * This class encapsultaes the EAXBUFFERPROPERTIES struct. Since longs
+ * are 64 bit in Java and "typically" 32 on other platforms, we cheat by reading an
+ * int when reading a long field.
*
* @author Brian Matzon <br...@ma...>
* @version $Revision$
@@ -202,8 +204,8 @@
*
* @return direct path level
*/
- public long getDirect() {
- return eaxBufferProperties.getLong(direct_offset);
+ public int getDirect() {
+ return eaxBufferProperties.getInt(direct_offset);
}
/**
@@ -211,8 +213,8 @@
*
* @param direct direct path level to set to
*/
- public void setDirect(long direct) {
- eaxBufferProperties.putLong(direct_offset, direct);
+ public void setDirect(int direct) {
+ eaxBufferProperties.putInt(direct_offset, direct);
}
/**
@@ -220,8 +222,8 @@
*
* @return direct path level at high frequencies
*/
- public long getDirectHF() {
- return eaxBufferProperties.getLong(directHF_offset);
+ public int getDirectHF() {
+ return eaxBufferProperties.getInt(directHF_offset);
}
/**
@@ -229,8 +231,8 @@
*
* @param direct direct path level at high frequencies to set to
*/
- public void setDirectHF(long directHF) {
- eaxBufferProperties.putLong(directHF_offset, directHF);
+ public void setDirectHF(int directHF) {
+ eaxBufferProperties.putInt(directHF_offset, directHF);
}
/**
@@ -238,8 +240,8 @@
*
* @return room effect level
*/
- public long getRoom() {
- return eaxBufferProperties.getLong(room_offset);
+ public int getRoom() {
+ return eaxBufferProperties.getInt(room_offset);
}
/**
@@ -247,8 +249,8 @@
*
* @param room room effect level to set to
*/
- public void setRoom(long room) {
- eaxBufferProperties.putLong(room_offset, room);
+ public void setRoom(int room) {
+ eaxBufferProperties.putInt(room_offset, room);
}
/**
@@ -256,8 +258,8 @@
*
* @return room effect level at high frequencies
*/
- public long getRoomHF() {
- return eaxBufferProperties.getLong(roomHF_offset);
+ public int getRoomHF() {
+ return eaxBufferProperties.getInt(roomHF_offset);
}
/**
@@ -265,8 +267,8 @@
*
* @param room room effect level at high frequencies to set to
*/
- public void setRoomHF(long roomHF) {
- eaxBufferProperties.putLong(roomHF_offset, roomHF);
+ public void setRoomHF(int roomHF) {
+ eaxBufferProperties.putInt(roomHF_offset, roomHF);
}
/**
@@ -292,8 +294,8 @@
*
* @return main obstruction control (attenuation at high frequencies)
*/
- public long getObstruction() {
- return eaxBufferProperties.getLong(obstruction_offset);
+ public int getObstruction() {
+ return eaxBufferProperties.getInt(obstruction_offset);
}
/**
@@ -301,8 +303,8 @@
*
* @param obstruction main obstruction control (attenuation at high frequencies) to set to
*/
- public void setObstruction(long obstruction) {
- eaxBufferProperties.putLong(obstruction_offset, obstruction);
+ public void setObstruction(int obstruction) {
+ eaxBufferProperties.putInt(obstruction_offset, obstruction);
}
/**
@@ -328,8 +330,8 @@
*
* @return main occlusion control (attenuation at high frequencies)
*/
- public long getOcclusion() {
- return eaxBufferProperties.getLong(occlusion_offset);
+ public int getOcclusion() {
+ return eaxBufferProperties.getInt(occlusion_offset);
}
/**
@@ -337,8 +339,8 @@
*
* @param occlusion main occlusion control (attenuation at high frequencies) to set to
*/
- public void setOcclusion(long occlusion) {
- eaxBufferProperties.putLong(occlusion_offset, occlusion);
+ public void setOcclusion(int occlusion) {
+ eaxBufferProperties.putInt(occlusion_offset, occlusion);
}
/**
@@ -382,8 +384,8 @@
*
* @return OutsideVolumeHF
*/
- public long getOutsideVolumeHF() {
- return eaxBufferProperties.getLong(outsideVolumeHF_offset);
+ public int getOutsideVolumeHF() {
+ return eaxBufferProperties.getInt(outsideVolumeHF_offset);
}
/**
@@ -391,8 +393,8 @@
*
* @param outsideVolumeHF OutsideVolumeHF to set to
*/
- public void setOutsideVolumeHF(long outsideVolumeHF) {
- eaxBufferProperties.putLong(outsideVolumeHF_offset, outsideVolumeHF);
+ public void setOutsideVolumeHF(int outsideVolumeHF) {
+ eaxBufferProperties.putInt(outsideVolumeHF_offset, outsideVolumeHF);
}
/**
@@ -418,8 +420,8 @@
*
* @return modifier for behavior of properties
*/
- public long getFlags() {
- return eaxBufferProperties.getLong(flags_offset);
+ public int getFlags() {
+ return eaxBufferProperties.getInt(flags_offset);
}
/**
@@ -427,8 +429,8 @@
*
* @param flags modifier for behavior of properties to set to
*/
- public void setFlags(long flags) {
- eaxBufferProperties.putLong(flags_offset, flags);
+ public void setFlags(int flags) {
+ eaxBufferProperties.putInt(flags_offset, flags);
}
/**
|