diff options
author | Carsten Weisse <[email protected]> | 2004-12-14 12:48:51 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2004-12-14 12:48:51 +0000 |
commit | c752401a542c0484c98fdb9904b2910d7f6ae349 (patch) | |
tree | 0cd72db76ee5cd2f6f1d5a34df5a6191b840c8db /src/jake2/client | |
parent | 4822cf7fe0530c92dc5dcf6830bd4c1fcb0b5608 (diff) |
the backbuffer of colorArray is a ByteBuffer; we need this for lwjgl
Diffstat (limited to 'src/jake2/client')
-rw-r--r-- | src/jake2/client/particle_t.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/jake2/client/particle_t.java b/src/jake2/client/particle_t.java index 027cadf..b94f411 100644 --- a/src/jake2/client/particle_t.java +++ b/src/jake2/client/particle_t.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 20.11.2003 by RST. -// $Id: particle_t.java,v 1.2 2004-07-09 06:50:50 hzi Exp $ +// $Id: particle_t.java,v 1.3 2004-12-14 12:48:51 cawe Exp $ package jake2.client; @@ -30,13 +30,21 @@ import java.nio.*; public class particle_t { + // lwjgl renderer needs a ByteBuffer + private static ByteBuffer colorByteArray = Lib.newByteBuffer(Defines.MAX_PARTICLES * Lib.SIZEOF_INT, ByteOrder.LITTLE_ENDIAN); + public static FloatBuffer vertexArray = Lib.newFloatBuffer(Defines.MAX_PARTICLES * 3); - public static IntBuffer colorArray = Lib.newIntBuffer(Defines.MAX_PARTICLES, ByteOrder.LITTLE_ENDIAN); public static int[] colorTable = new int[256]; + public static IntBuffer colorArray = colorByteArray.asIntBuffer(); + public static void setColorPalette(int[] palette) { for (int i=0; i < 256; i++) { colorTable[i] = palette[i] & 0x00FFFFFF; } } + + public static ByteBuffer getColorAsByteBuffer() { + return colorByteArray; + } } |