diff --git a/lwjgl-rundir/resources/glsl/core.glsl b/lwjgl-rundir/resources/glsl/core.glsl index 75ecc38..ca739a0 100644 --- a/lwjgl-rundir/resources/glsl/core.glsl +++ b/lwjgl-rundir/resources/glsl/core.glsl @@ -181,14 +181,21 @@ void main(){ /* https://bugs.chromium.org/p/angleproject/issues/detail?id=4994 */ uv = ((uv * anisotropic_fix) - fract(uv * anisotropic_fix) + 0.5) / anisotropic_fix; - color *= texture(tex0, uv).bgra; + vec4 texColor = texture(tex0, uv); #else - color *= texture(tex0, (matrix_t * vec4(v_texture0, 0.0, 1.0)).xy).bgra; + vec4 texColor = texture(tex0, (matrix_t * vec4(v_texture0, 0.0, 1.0)).xy); #endif #else - color *= texture(tex0, (matrix_t * vec4(texCoordV0, 0.0, 1.0)).xy).bgra; + vec4 texColor = texture(tex0, (matrix_t * vec4(texCoordV0, 0.0, 1.0)).xy); #endif + +#ifdef CC_swap_rb + color *= texColor.rgba; +#else + color *= texColor.bgra; +#endif + #endif #ifdef CC_alphatest diff --git a/samples/ayunami2000/VideoMapPacketCodec.java b/samples/ayunami2000/VideoMapPacketCodec.java new file mode 100644 index 0000000..a16c75a --- /dev/null +++ b/samples/ayunami2000/VideoMapPacketCodec.java @@ -0,0 +1,283 @@ +package ayunami2000; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +public class VideoMapPacketCodec { + + public final int[][] mapIds; + private boolean loop; + private String url; + private int duration; + private long timestamp; + private long pauseTimestamp; + private double posX; + private double posY; + private double posZ; + private float volume; + private int frameRate; + private boolean requiresFullResetPacket; + private boolean requiresPositionPacket; + private boolean isDisabled; + + /** + * @param mapIds 2D grid of map IDs that make up the screen (mapIds[y][x]) + * @param posX audio playback X coord + * @param posY audio playback Y coord + * @param posZ audio playback Z coord + * @param volume the volume of the clip + */ + public VideoMapPacketCodec(int[][] mapIds, double posX, double posY, double posZ, float volume) { + this.mapIds = mapIds; + this.url = null; + this.posX = posX; + this.posY = posY; + this.posZ = posZ; + this.volume = 1.0f; + this.frameRate = 60; + this.requiresPositionPacket = true; + this.requiresFullResetPacket = true; + this.isDisabled = true; + } + + /** + * @param mapIds 2D grid of map IDs that make up the screen (mapIds[y][x]) + * @param posX audio playback X coord + * @param posY audio playback Y coord + * @param posZ audio playback Z coord + */ + public VideoMapPacketCodec(int[][] mapIds, double posX, double posY, double posZ) { + this(mapIds, posX, posY, posZ, 1.0f); + } + + /** + * @param posX audio playback X coord + * @param posY audio playback Y coord + * @param posZ audio playback Z coord + * @param volume the volume of the clip + * @return packet to send to players + */ + public byte[] moveAudioSource(double posX, double posY, double posZ, float volume) { + this.posX = posX; + this.posY = posY; + this.posZ = posZ; + this.volume = volume; + this.requiresPositionPacket = true; + return syncPlaybackWithPlayers(); + } + + /** + * unloads video and resets all map object to vanilla renderer + * @return packet to send to players + */ + public byte[] disableVideo() { + isDisabled = true; + return syncPlaybackWithPlayers(); + } + + /** + * syncs the server side video timestamp with players + * @return packet to send to players + */ + public byte[] syncPlaybackWithPlayers() { + try { + ByteArrayOutputStream bao = new ByteArrayOutputStream(); + DataOutputStream str = new DataOutputStream(bao); + + if(isDisabled) { + str.write(0); + int x = mapIds[0].length; + int y = mapIds.length; + str.write((x << 4) | y); + for(int yy = 0; yy < y; ++yy) { + for(int xx = 0; xx < x; ++xx) { + str.writeShort(mapIds[yy][xx]); + } + } + return bao.toByteArray(); + } + + int packetType = 1; + if(requiresFullResetPacket) { + packetType = packetType | 2; + } + if(requiresFullResetPacket || requiresPositionPacket) { + packetType = packetType | 4; + } + + str.write(packetType); + + if(requiresFullResetPacket) { + int x = mapIds[0].length; + int y = mapIds.length; + str.write((x << 4) | y); + for(int yy = 0; yy < y; ++yy) { + for(int xx = 0; xx < x; ++xx) { + str.writeShort(mapIds[yy][xx]); + } + } + str.write(frameRate); + str.writeInt(duration); + str.writeUTF(url); + } + + if(requiresFullResetPacket || requiresPositionPacket) { + str.writeFloat(volume); + str.writeDouble(posX); + str.writeDouble(posY); + str.writeDouble(posZ); + } + + str.writeInt(getElapsedMillis()); + str.writeBoolean(loop); + str.writeBoolean(pauseTimestamp > 0l); + + requiresFullResetPacket = false; + requiresPositionPacket = false; + + return bao.toByteArray(); + }catch(IOException e) { + throw new RuntimeException("serialization error", e); + } + } + + /** + * this is dual purpose, it calculates elapsed time but also loops or pauses the video if it is finished playing + */ + private int getElapsedMillis() { + if(pauseTimestamp > 0l) { + return (int)(pauseTimestamp - timestamp); + } + int t = (int)(System.currentTimeMillis() - timestamp); + if(loop) { + while(t > duration) { + t -= duration; + timestamp += duration; + } + }else { + if(t > duration) { + timestamp = (int)(System.currentTimeMillis() - duration); + return duration; + } + } + return t; + } + + /** + * @param url URL to an MP4 or other HTML5 supported video file + * @param loop If the video file should loop + * @param durationSeconds duration of the video in seconds + * @return packet to send to players + */ + public byte[] beginPlayback(String url, boolean loop, float duration) { + this.url = url; + this.loop = loop; + this.duration = (int)(duration * 1000.0f); + this.pauseTimestamp = 0l; + this.timestamp = 0l; + this.requiresFullResetPacket = true; + this.isDisabled = false; + return syncPlaybackWithPlayers(); + } + + /** + * Tells the browser to pre-load a URL to a video to be played in the future + * @param url the URL of the video + * @param ttl the amount of time the video should stay loaded + * @return packet to send to players + */ + public static byte[] bufferVideo(String url, int ttl) { + try { + ByteArrayOutputStream bao = new ByteArrayOutputStream(); + DataOutputStream str = new DataOutputStream(bao); + str.write(8); + str.writeInt(ttl); + str.writeUTF(url); + return bao.toByteArray(); + }catch(IOException e) { + throw new RuntimeException("serialization error", e); + } + } + + /** + * @return the duration of the current clip + */ + public float getDuration() { + return duration * 0.001f; + } + + /** + * @return the URL of the current clip + */ + public String getURL() { + return url; + } + + /** + * @return the server's current timestamp + */ + public float getPlaybackTime() { + return getElapsedMillis() * 0.001f; + } + + /** + * @param time time in seconds to seek the video to + */ + public byte[] setPlaybackTime(float time) { + timestamp = System.currentTimeMillis() - (int)(time * 1000.0f); + return syncPlaybackWithPlayers(); + } + + /** + * @return if playback is complete (false if loop) + */ + public boolean isPlaybackFinished() { + return !loop && getElapsedMillis() == duration; + } + + /** + * @param loop video should loop + */ + public byte[] setLoopEnable(boolean loop) { + this.loop = loop; + return syncPlaybackWithPlayers(); + } + + /** + * @return if loop is enabled + */ + public boolean isLoopEnable() { + return loop; + } + + /** + * @param pause set if video should pause + * @return packet to send to players + */ + public byte[] setPaused(boolean pause) { + getElapsedMillis(); + if(pause && pauseTimestamp <= 0l) { + pauseTimestamp = System.currentTimeMillis(); + }else if(!pause && pauseTimestamp > 0l) { + timestamp = System.currentTimeMillis() - (pauseTimestamp - timestamp); + pauseTimestamp = 0l; + } + return syncPlaybackWithPlayers(); + } + + /** + * @return if video is currently paused + */ + public boolean isPaused() { + return pauseTimestamp > 0l; + } + + /** + * @return current server-side volume + */ + public float getVolume() { + return volume; + } + +} diff --git a/samples/ayunami2000/VideoMapPacketCodecBukkit.java b/samples/ayunami2000/VideoMapPacketCodecBukkit.java new file mode 100644 index 0000000..4edbd46 --- /dev/null +++ b/samples/ayunami2000/VideoMapPacketCodecBukkit.java @@ -0,0 +1,132 @@ +package ayunami2000; + +import java.util.List; + +import org.bukkit.craftbukkit.v1_5_R3.entity.CraftPlayer; +import org.bukkit.entity.Player; + +import net.minecraft.server.v1_5_R3.Packet; +import net.minecraft.server.v1_5_R3.Packet131ItemData; + +public class VideoMapPacketCodecBukkit extends VideoMapPacketCodec { + + /** + * @param mapIds 2D grid of map IDs that make up the screen (mapIds[y][x]) + * @param posX audio playback X coord + * @param posY audio playback Y coord + * @param posZ audio playback Z coord + * @param volume the volume of the clip + */ + public VideoMapPacketCodecBukkit(int[][] mapIds, double posX, double posY, double posZ, float volume) { + super(mapIds, posX, posY, posZ, volume); + } + + /** + * @param mapIds 2D grid of map IDs that make up the screen (mapIds[y][x]) + * @param posX audio playback X coord + * @param posY audio playback Y coord + * @param posZ audio playback Z coord + */ + public VideoMapPacketCodecBukkit(int[][] mapIds, double posX, double posY, double posZ) { + super(mapIds, posX, posY, posZ, 1.0f); + } + + public static class VideoMapPacket { + protected final Object packet; + protected VideoMapPacket(byte[] packet) { + this.packet = new Packet131ItemData((short)104, (short)0, packet); + } + public Object getNativePacket() { + return packet; + } + public void send(Player p) { + nativeSendPacketToPlayer(p, packet); + } + public void send(Player... p) { + for(Player pp : p) { + nativeSendPacketToPlayer(pp, packet); + } + } + public void send(List p) { + for(Player pp : p) { + nativeSendPacketToPlayer(pp, packet); + } + } + } + + /** + * @param posX audio playback X coord + * @param posY audio playback Y coord + * @param posZ audio playback Z coord + * @param volume the volume of the clip + * @return packet to send to players + */ + public VideoMapPacket moveAudioSourceBukkit(double posX, double posY, double posZ, float volume) { + return new VideoMapPacket(moveAudioSource(posX, posY, posZ, volume)); + } + + /** + * unloads video and resets all map object to vanilla renderer + * @return packet to send to players + */ + public VideoMapPacket disableVideoBukkit() { + return new VideoMapPacket(disableVideo()); + } + + /** + * syncs the server side video timestamp with players + * @return packet to send to players + */ + public VideoMapPacket syncPlaybackWithPlayersBukkit() { + return new VideoMapPacket(syncPlaybackWithPlayers()); + } + + /** + * @param url URL to an MP4 or other HTML5 supported video file + * @param loop If the video file should loop + * @param durationSeconds duration of the video in seconds + * @return packet to send to players + */ + public VideoMapPacket beginPlaybackBukkit(String url, boolean loop, float duration) { + return new VideoMapPacket(beginPlayback(url, loop, duration)); + } + + /** + * Tells the browser to pre-load a URL to a video to be played in the future + * @param url the URL of the video + * @param ttl the amount of time the video should stay loaded + * @return packet to send to players + */ + public static VideoMapPacket bufferVideoBukkit(String url, int ttl) { + return new VideoMapPacket(bufferVideo(url, ttl)); + } + + /** + * @param time time in seconds to seek the video to + */ + public VideoMapPacket setPlaybackTimeBukkit(float time) { + return new VideoMapPacket(setPlaybackTime(time)); + } + + /** + * @param loop video should loop + */ + public VideoMapPacket setLoopEnableBukkit(boolean loop) { + return new VideoMapPacket(setLoopEnable(loop)); + } + + /** + * @param pause set if video should pause + * @return packet to send to players + */ + public VideoMapPacket setPausedBukkit(boolean pause) { + return new VideoMapPacket(setPaused(pause)); + } + + public static void nativeSendPacketToPlayer(Player player, Object obj) { + if(obj == null) { + return; + } + ((CraftPlayer)player).getHandle().playerConnection.sendPacket((Packet)obj); + } +} diff --git a/samples/plugin.yml b/samples/plugin.yml index a6e8b1f..03a9b58 100644 --- a/samples/plugin.yml +++ b/samples/plugin.yml @@ -8,4 +8,8 @@ commands: samplemap: description: test ayunami map system usage: /samplemap [mapid] [image file] [16bpp|24bpp] [compress] - permission: eaglersamples.samplemap \ No newline at end of file + permission: eaglersamples.samplemap + videomap: + description: test video map system (place video_map_config.txt in your server's working directory) + usage: /videomap [url] [duration or ttl] + permission: eaglersamples.videomap \ No newline at end of file diff --git a/samples/plugin/CommandVideoMap.java b/samples/plugin/CommandVideoMap.java new file mode 100644 index 0000000..3fc70a7 --- /dev/null +++ b/samples/plugin/CommandVideoMap.java @@ -0,0 +1,155 @@ +package plugin; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import ayunami2000.VideoMapPacketCodecBukkit; + +public class CommandVideoMap implements CommandExecutor { + + private VideoMapPacketCodecBukkit currentCodecInstance = null; + + @Override + public boolean onCommand(CommandSender arg0, Command arg1, String arg2, String[] arg3) { + if(!(arg0 instanceof Player)) { + arg0.sendMessage(ChatColor.RED + "Internal Error: " + ChatColor.WHITE + "CommmandSender must be a Player"); + return false; + } + if(arg3.length == 3 && arg3[0].equalsIgnoreCase("begin")) { + try { + List mapRows = new ArrayList(); + double x = 0.0d; + double y = 0.0d; + double z = 0.0d; + float volume = -1.0f; + BufferedReader r = new BufferedReader(new FileReader(new File("video_map_config.txt"))); + String str; + while((str = r.readLine()) != null) { + str = str.trim(); + if(str.startsWith("#")) { + continue; + }else if(str.startsWith("x")) { + int i = str.indexOf('='); + if(i > 0) { + x = Double.parseDouble(str.substring(i + 1).trim()); + } + }else if(str.startsWith("y")) { + int i = str.indexOf('='); + if(i > 0) { + y = Double.parseDouble(str.substring(i + 1).trim()); + } + }else if(str.startsWith("z")) { + int i = str.indexOf('='); + if(i > 0) { + z = Double.parseDouble(str.substring(i + 1).trim()); + } + }else if(str.startsWith("volume")) { + int i = str.indexOf('='); + if(i > 0) { + volume = Float.parseFloat(str.substring(i + 1).trim()); + } + }else { + try { + String[] digits = str.split(","); + int firstInt = Integer.parseInt(digits[0].trim()); + int[] newRow = new int[digits.length]; + newRow[0] = firstInt; + for(int i = 1; i < digits.length; ++i) { + newRow[i] = Integer.parseInt(digits[i].trim()); + } + if(mapRows.size() > 0 && mapRows.get(0).length != newRow.length) { + throw new IOException("All rows in map list must be the same length (" + mapRows.get(0).length + " != " + newRow.length + ")"); + } + mapRows.add(newRow); + }catch(NumberFormatException t) { + } + } + } + r.close(); + if(mapRows.size() > 0) { + if(currentCodecInstance != null) { + currentCodecInstance.disableVideoBukkit().send((Player)arg0); + currentCodecInstance = null; + } + int[][] matrix = new int[mapRows.size()][mapRows.get(0).length]; + for(int i = 0, l = mapRows.size(); i < l; ++i) { + for(int j = 0; j < matrix[i].length; ++j) { + matrix[i][j] = mapRows.get(i)[j]; + } + } + currentCodecInstance = new VideoMapPacketCodecBukkit(matrix, x, y, z, volume); + currentCodecInstance.beginPlaybackBukkit(arg3[1], true, arg3[2].indexOf('.') > 0 ? Float.parseFloat(arg3[2]) : Float.parseFloat(arg3[2] + ".0")).send((Player)arg0); + arg0.sendMessage(ChatColor.GREEN + "Enabled video map, URL:" + ChatColor.WHITE + " " + arg3[1]); + return true; + }else { + throw new IOException("No map rows were defined"); + } + }catch(IOException ex) { + arg0.sendMessage(ChatColor.RED + "Internal Error while reading \'video_map_config.txt\': " + ChatColor.WHITE + ex.toString()); + } + }else if((arg3.length == 2 || arg3.length == 3) && arg3[0].equalsIgnoreCase("preload")) { + int ttl = arg3.length == 3 ? Integer.parseInt(arg3[2]) * 1000 : 180 * 1000; + VideoMapPacketCodecBukkit.bufferVideoBukkit(arg3[1], ttl).send((Player)arg0); + arg0.sendMessage(ChatColor.GREEN + "Buffered video URL:" + ChatColor.WHITE + " " + arg3[1] + " " + ChatColor.GREEN + "for " + ChatColor.WHITE + (ttl / 1000) + ChatColor.GREEN + " seconds"); + return true; + }else { + if(arg3.length == 1 && arg3[0].equalsIgnoreCase("stop")) { + if(currentCodecInstance != null) { + currentCodecInstance.disableVideoBukkit().send((Player)arg0); + currentCodecInstance = null; + arg0.sendMessage(ChatColor.GREEN + "Disabled video map"); + return true; + }else { + arg0.sendMessage(ChatColor.RED + "Error: " + ChatColor.WHITE + "no video is loaded"); + } + }else if(arg3.length == 1 && arg3[0].equalsIgnoreCase("pause")) { + if(currentCodecInstance != null) { + currentCodecInstance.setPausedBukkit(true).send((Player)arg0); + arg0.sendMessage(ChatColor.GREEN + "Paused video map"); + return true; + }else { + arg0.sendMessage(ChatColor.RED + "Error: " + ChatColor.WHITE + "no video is loaded"); + } + }else if(arg3.length == 1 && arg3[0].equalsIgnoreCase("resume")) { + if(currentCodecInstance != null) { + currentCodecInstance.setPausedBukkit(false).send((Player)arg0); + arg0.sendMessage(ChatColor.GREEN + "Resumed video map"); + return true; + }else { + arg0.sendMessage(ChatColor.RED + "Error: " + ChatColor.WHITE + "no video is loaded"); + } + }else if((arg3.length == 1 || arg3.length == 2) && arg3[0].equalsIgnoreCase("loop")) { + if(currentCodecInstance != null) { + boolean gottaLoop = arg3.length == 1 || arg3[1].equalsIgnoreCase("true"); + currentCodecInstance.setLoopEnableBukkit(gottaLoop).send((Player)arg0); + arg0.sendMessage(ChatColor.GREEN + (gottaLoop ? "Enabled video map loop" : "Disabled video map loop")); + return true; + }else { + arg0.sendMessage(ChatColor.RED + "Error: " + ChatColor.WHITE + "no video is loaded"); + } + }else if(arg3.length == 1 && arg3[0].equalsIgnoreCase("move")) { + if(currentCodecInstance != null) { + Location l = ((Player)arg0).getLocation(); + currentCodecInstance.moveAudioSourceBukkit(l.getX(), l.getY(), l.getZ(), currentCodecInstance.getVolume()).send((Player)arg0); + arg0.sendMessage(ChatColor.GREEN + "Repositioned audio source to " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ()); + return true; + }else { + arg0.sendMessage(ChatColor.RED + "Error: " + ChatColor.WHITE + "no video is loaded"); + } + } + } + return false; + } + +} diff --git a/samples/plugin/EaglerSamplesPlugin.java b/samples/plugin/EaglerSamplesPlugin.java index 9975129..e31e24c 100644 --- a/samples/plugin/EaglerSamplesPlugin.java +++ b/samples/plugin/EaglerSamplesPlugin.java @@ -6,6 +6,7 @@ public class EaglerSamplesPlugin extends JavaPlugin { public void onEnable() { getCommand("samplemap").setExecutor(new CommandSampleMap(this)); + getCommand("videomap").setExecutor(new CommandVideoMap()); } public void onDisable() { diff --git a/samples/readme.txt b/samples/readme.txt index 40bd36c..2ebc57a 100644 --- a/samples/readme.txt +++ b/samples/readme.txt @@ -1 +1,3 @@ -These are sample source files to assist the process of integrating Eaglercraft into other projects, or to assist the process of integrating other projects into Eaglercraft \ No newline at end of file +These are sample source files to assist the process of integrating Eaglercraft into other projects, or to assist the process of integrating other projects into Eaglercraft + +place "video_map_config.txt" in the working directory of the server to use /videomap \ No newline at end of file diff --git a/samples/video_map_config.txt b/samples/video_map_config.txt new file mode 100644 index 0000000..5e03104 --- /dev/null +++ b/samples/video_map_config.txt @@ -0,0 +1,14 @@ +# type map ids like this to create the video screen: + +1, 2, 3 +4, 5, 6 + +# position and volume: + +x = 0.0 +y = 0.0 +z = 0.0 + +volume = 1.0 + +# set volume to '-1.0' to disable directional audio \ No newline at end of file diff --git a/src/lwjgl/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java b/src/lwjgl/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java index c477887..6e260df 100644 --- a/src/lwjgl/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java +++ b/src/lwjgl/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java @@ -607,6 +607,73 @@ public class EaglerAdapterImpl2 { return GL20.glGetAttribLocation(p1.obj, p2); } + public static final boolean isVideoSupported() { + return false; + } + public static final void loadVideo(String src, boolean autoplay) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void loadVideo(String src, boolean autoplay, String setJavascriptPointer) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void loadVideo(String src, boolean autoplay, String setJavascriptPointer, String javascriptOnloadFunction) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void bufferVideo(String src, int ttl) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void unloadVideo() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final boolean isVideoLoaded() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final boolean isVideoPaused() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void setVideoPaused(boolean pause) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void setVideoLoop(boolean pause) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void setVideoVolume(float x, float y, float z, float v) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void updateVideoTexture() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void bindVideoTexture() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final int getVideoWidth() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final int getVideoHeight() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final float getVideoCurrentTime() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void setVideoCurrentTime(float seconds) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final float getVideoDuration() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + public static final void setVideoFrameRate(float seconds) { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } + + public static final int VIDEO_ERR_NONE = -1; + public static final int VIDEO_ERR_ABORTED = 1; + public static final int VIDEO_ERR_NETWORK = 2; + public static final int VIDEO_ERR_DECODE = 3; + public static final int VIDEO_ERR_SRC_NOT_SUPPORTED = 4; + + public static final int getVideoError() { + throw new UnsupportedOperationException("Video is not supported in LWJGL runtime"); + } // ======================================================================================= // ======================================================================================= @@ -1119,10 +1186,10 @@ public class EaglerAdapterImpl2 { return s; } public static final void setListenerPos(float x, float y, float z, float vx, float vy, float vz, float pitch, float yaw) { - float var11 = MathHelper.cos(-yaw * 0.017453292F - (float) Math.PI); - float var12 = MathHelper.sin(-yaw * 0.017453292F - (float) Math.PI); + float var11 = -MathHelper.cos(-yaw * 0.017453292F - (float) Math.PI); + float var12 = -MathHelper.sin(-yaw * 0.017453292F - (float) Math.PI); float var13 = -var12; - float var14 = -MathHelper.sin(-pitch * 0.017453292F - (float) Math.PI); + float var14 = MathHelper.sin(-pitch * 0.017453292F - (float) Math.PI); float var15 = -var11; float var16 = 0.0F; float var17 = 1.0F; diff --git a/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java b/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java index b769640..510dbb3 100644 --- a/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java +++ b/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java @@ -4,11 +4,14 @@ public class ConfigConstants { public static boolean profanity = false; - public static final String version = "22w15d"; + public static final String version = "22w16a"; public static final String mainMenuString = "eaglercraft " + version; public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft"; public static final boolean html5build = true; + + public static String ayonullTitle = null; + public static String ayonullLink = null; } diff --git a/src/main/java/net/lax1dude/eaglercraft/GuiScreenLicense.java b/src/main/java/net/lax1dude/eaglercraft/GuiScreenLicense.java new file mode 100644 index 0000000..3e082d3 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/GuiScreenLicense.java @@ -0,0 +1,101 @@ +package net.lax1dude.eaglercraft; + +import net.minecraft.src.GuiButton; +import net.minecraft.src.GuiScreen; + +public class GuiScreenLicense extends GuiScreen { + + private final GuiScreen continueScreen; + private boolean hasCheckedBox = false; + private int beginOffset = 0; + private GuiButton acceptButton; + + public GuiScreenLicense(GuiScreen scr) { + continueScreen = scr; + } + + public void initGui() { + beginOffset = this.height / 2 - 100; + if(beginOffset < 5) { + beginOffset = 5; + } + this.buttonList.add(new GuiButton(1, this.width / 2 - 120, beginOffset + 180, 115, 20, new String(License.line61))); + this.buttonList.add(acceptButton = new GuiButton(2, this.width / 2 + 5, beginOffset + 180, 115, 20, new String(License.line60))); + acceptButton.enabled = false; + } + + protected void actionPerformed(GuiButton par1GuiButton) { + if(par1GuiButton.id == 2) { + LocalStorageManager.profileSettingsStorage.setBoolean("acceptLicense", true); + LocalStorageManager.saveStorageP(); + mc.displayGuiScreen(continueScreen); + }else if(par1GuiButton.id == 1) { + mc.displayGuiScreen(new GuiScreenLicenseDeclined()); + } + } + + private static final TextureLocation beaconx = new TextureLocation("/gui/beacon.png"); + + public void drawScreen(int mx, int my, float par3) { + drawDefaultBackground(); + acceptButton.enabled = hasCheckedBox; + super.drawScreen(mx, my, par3); + + EaglerAdapter.glPushMatrix(); + EaglerAdapter.glScalef(1.33f, 1.33f, 1.33f); + drawCenteredString(fontRenderer, new String(License.line00), width * 3 / 8, beginOffset * 3 / 4, 0xDDDD55); + EaglerAdapter.glPopMatrix(); + + drawCenteredString(fontRenderer, new String(License.line10), width / 2, beginOffset + 22, 0xFF7777); + drawCenteredString(fontRenderer, new String(License.line11), width / 2, beginOffset + 33, 0xFF7777); + drawCenteredString(fontRenderer, new String(License.line12), width / 2, beginOffset + 44, 0xFF7777); + + drawCenteredString(fontRenderer, new String(License.line20), width / 2, beginOffset + 62, 0x448844); + drawCenteredString(fontRenderer, new String(License.line21), width / 2, beginOffset + 71, 0x448844); + + EaglerAdapter.glPushMatrix(); + EaglerAdapter.glScalef(0.75f, 0.75f, 0.75f); + drawCenteredString(fontRenderer, new String(License.line30), width * 4 / 6, (beginOffset + 89) * 4 / 3, 0x666666); + drawCenteredString(fontRenderer, new String(License.line31), width * 4 / 6, (beginOffset + 97) * 4 / 3, 0x999999); + drawCenteredString(fontRenderer, new String(License.line32), width * 4 / 6, (beginOffset + 105) * 4 / 3, 0x999999); + EaglerAdapter.glPopMatrix(); + + drawCenteredString(fontRenderer, new String(License.line40), width / 2, beginOffset + 120, 0xFF7777); + + boolean mouseOverCheck = width / 2 - 100 < mx && width / 2 - 83 > mx && beginOffset + 142 < my && beginOffset + 159 > my; + + if(mouseOverCheck) { + EaglerAdapter.glColor4f(0.7f, 0.7f, 1.0f, 1.0f); + }else { + EaglerAdapter.glColor4f(0.6f, 0.6f, 0.6f, 1.0f); + } + + beaconx.bindTexture(); + + EaglerAdapter.glPushMatrix(); + EaglerAdapter.glScalef(0.75f, 0.75f, 0.75f); + drawTexturedModalRect((width / 2 - 100) * 4 / 3, (beginOffset + 142) * 4 / 3, 22, 219, 22, 22); + EaglerAdapter.glPopMatrix(); + + if(hasCheckedBox) { + EaglerAdapter.glPushMatrix(); + EaglerAdapter.glColor4f(1.1f, 1.1f, 1.1f, 1.0f); + EaglerAdapter.glTranslatef(0.5f, 0.5f, 0.0f); + drawTexturedModalRect((width / 2 - 100), (beginOffset + 142), 90, 222, 16, 16); + EaglerAdapter.glPopMatrix(); + } + + EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + + drawString(fontRenderer, new String(License.line50), width / 2 - 75, beginOffset + 147, 0xEEEEEE); + } + + protected void mouseClicked(int par1, int par2, int par3) { + super.mouseClicked(par1, par2, par3); + if(width / 2 - 100 < par1 && width / 2 - 83 > par1 && beginOffset + 142 < par2 && beginOffset + 159 > par2) { + this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); + hasCheckedBox = !hasCheckedBox; + } + } + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/GuiScreenLicenseDeclined.java b/src/main/java/net/lax1dude/eaglercraft/GuiScreenLicenseDeclined.java new file mode 100644 index 0000000..86dd5ec --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/GuiScreenLicenseDeclined.java @@ -0,0 +1,13 @@ +package net.lax1dude.eaglercraft; + +import net.minecraft.src.GuiScreen; + +public class GuiScreenLicenseDeclined extends GuiScreen { + + public void drawScreen(int mx, int my, float par3) { + this.drawDefaultBackground(); + drawCenteredString(fontRenderer, new String(License.line70), width / 2, height / 3 - 10, 0xFFFFFF); + drawCenteredString(fontRenderer, new String(License.line71), width / 2, height / 3 + 18, 0xFF7777); + drawCenteredString(fontRenderer, new String(License.line72), width / 2, height / 3 + 35, 0x666666); + } +} diff --git a/src/main/java/net/lax1dude/eaglercraft/License.java b/src/main/java/net/lax1dude/eaglercraft/License.java new file mode 100644 index 0000000..7ad5355 --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/License.java @@ -0,0 +1,129 @@ +package net.lax1dude.eaglercraft; + +public class License { + + /* + * This is the text on the 'License Agreement' screen + * It is encoded to stop people from easily modifying it + * in classes.js via find/replace in a text editor + */ + + static final byte[] line00 = new byte[] { + (byte)76,(byte)105,(byte)99,(byte)101,(byte)110,(byte)115,(byte)101,(byte)32,(byte)39,(byte)65, + (byte)103,(byte)114,(byte)101,(byte)101,(byte)109,(byte)101,(byte)110,(byte)116,(byte)39 + }; + + static final byte[] line10 = new byte[] { + (byte)69,(byte)97,(byte)103,(byte)108,(byte)101,(byte)114,(byte)99,(byte)114,(byte)97,(byte)102, + (byte)116,(byte)32,(byte)105,(byte)115,(byte)32,(byte)194,(byte)167,(byte)100,(byte)102,(byte)114, + (byte)101,(byte)101,(byte)32,(byte)115,(byte)111,(byte)102,(byte)116,(byte)119,(byte)97,(byte)114, + (byte)101,(byte)44,(byte)194,(byte)167,(byte)114,(byte)32,(byte)105,(byte)102,(byte)32,(byte)115, + (byte)111,(byte)109,(byte)101,(byte)111,(byte)110,(byte)101,(byte)32,(byte)105,(byte)110,(byte)116, + (byte)101,(byte)110,(byte)116,(byte)105,(byte)111,(byte)110,(byte)97,(byte)108,(byte)108,(byte)121, + (byte)32,(byte)99,(byte)104,(byte)97,(byte)114,(byte)103,(byte)101,(byte)100 + }; + + static final byte[] line11 = new byte[] {(byte)121,(byte)111,(byte)117,(byte)32,(byte)97,(byte)110, + (byte)121,(byte)32,(byte)115,(byte)117,(byte)109,(byte)32,(byte)111,(byte)102,(byte)32,(byte)109, + (byte)111,(byte)110,(byte)101,(byte)121,(byte)32,(byte)116,(byte)111,(byte)32,(byte)103,(byte)97, + (byte)105,(byte)110,(byte)32,(byte)97,(byte)99,(byte)99,(byte)101,(byte)115,(byte)115,(byte)32, + (byte)116,(byte)111,(byte)32,(byte)116,(byte)104,(byte)105,(byte)115,(byte)32,(byte)102,(byte)105, + (byte)108,(byte)101,(byte)44,(byte)32,(byte)121,(byte)111,(byte)117,(byte)32,(byte)97,(byte)114, + (byte)101,(byte)32,(byte)97,(byte)110 + }; + + static final byte[] line12 = new byte[] {(byte)105,(byte)100,(byte)105,(byte)111,(byte)116,(byte)32, + (byte)97,(byte)110,(byte)100,(byte)32,(byte)97,(byte)32,(byte)118,(byte)105,(byte)99,(byte)116, + (byte)105,(byte)109,(byte)32,(byte)111,(byte)102,(byte)32,(byte)112,(byte)105,(byte)114,(byte)97, + (byte)99,(byte)121,(byte)46,(byte)32,(byte)83,(byte)116,(byte)111,(byte)112,(byte)32,(byte)112, + (byte)108,(byte)97,(byte)121,(byte)105,(byte)110,(byte)103,(byte)32,(byte)121,(byte)111,(byte)117, + (byte)114,(byte)115,(byte)101,(byte)108,(byte)102,(byte)46 + }; + + static final byte[] line20 = new byte[] { + (byte)67,(byte)108,(byte)105,(byte)99,(byte)107,(byte)32,(byte)39,(byte)70,(byte)111,(byte)114, + (byte)107,(byte)32,(byte)111,(byte)110,(byte)32,(byte)71,(byte)105,(byte)116,(byte)104,(byte)117, + (byte)98,(byte)39,(byte)32,(byte)111,(byte)110,(byte)32,(byte)116,(byte)104,(byte)101,(byte)32, + (byte)109,(byte)97,(byte)105,(byte)110,(byte)32,(byte)109,(byte)101,(byte)110,(byte)117,(byte)32, + (byte)116,(byte)111,(byte)32,(byte)97,(byte)99,(byte)99,(byte)101,(byte)115,(byte)115,(byte)32, + (byte)116,(byte)104,(byte)101,(byte)32,(byte)111,(byte)102,(byte)102,(byte)105,(byte)99,(byte)97,(byte)108 + }; + + static final byte[] line21 = new byte[] { + (byte)115,(byte)111,(byte)117,(byte)114,(byte)99,(byte)101,(byte)32,(byte)99,(byte)111,(byte)100, + (byte)101,(byte)32,(byte)116,(byte)111,(byte)32,(byte)100,(byte)111,(byte)119,(byte)110,(byte)108, + (byte)111,(byte)97,(byte)100,(byte)32,(byte)116,(byte)104,(byte)105,(byte)115,(byte)32,(byte)101, + (byte)100,(byte)117,(byte)99,(byte)97,(byte)116,(byte)105,(byte)111,(byte)110,(byte)97,(byte)108, + (byte)32,(byte)112,(byte)114,(byte)111,(byte)106,(byte)101,(byte)99,(byte)116,(byte)32,(byte)108, + (byte)101,(byte)103,(byte)105,(byte)116,(byte)105,(byte)109,(byte)97,(byte)116,(byte)101,(byte)108,(byte)121 + }; + + static final byte[] line30 = new byte[] { + (byte)73,(byte)32,(byte)97,(byte)109,(byte)32,(byte)97,(byte)119,(byte)97,(byte)114,(byte)101, + (byte)32,(byte)116,(byte)104,(byte)97,(byte)116,(byte)32,(byte)116,(byte)104,(byte)105,(byte)115, + (byte)32,(byte)112,(byte)114,(byte)111,(byte)106,(byte)101,(byte)99,(byte)116,(byte)32,(byte)118, + (byte)105,(byte)111,(byte)108,(byte)97,(byte)116,(byte)101,(byte)100,(byte)32,(byte)77,(byte)111, + (byte)106,(byte)97,(byte)110,(byte)103,(byte)39,(byte)115,(byte)32,(byte)84,(byte)101,(byte)114, + (byte)109,(byte)115,(byte)32,(byte)111,(byte)102,(byte)32,(byte)83,(byte)101,(byte)114,(byte)118, + (byte)105,(byte)99,(byte)101 + }; + + static final byte[] line31 = new byte[] { + (byte)84,(byte)104,(byte)105,(byte)115,(byte)32,(byte)105,(byte)115,(byte)32,(byte)103,(byte)111, + (byte)105,(byte)110,(byte)103,(byte)32,(byte)116,(byte)111,(byte)32,(byte)99,(byte)104,(byte)97, + (byte)110,(byte)103,(byte)101,(byte)32,(byte)105,(byte)110,(byte)32,(byte)97,(byte)32,(byte)102, + (byte)101,(byte)119,(byte)32,(byte)119,(byte)101,(byte)101,(byte)107,(byte)115,(byte)44,(byte)32, + (byte)119,(byte)104,(byte)101,(byte)110,(byte)32,(byte)73,(byte)32,(byte)99,(byte)111,(byte)110, + (byte)118,(byte)101,(byte)114,(byte)116,(byte)32,(byte)116,(byte)104,(byte)105,(byte)115,(byte)32, + (byte)103,(byte)97,(byte)109,(byte)101 + }; + + static final byte[] line32 = new byte[] { + (byte)105,(byte)110,(byte)116,(byte)111,(byte)32,(byte)97,(byte)110,(byte)32,(byte)111,(byte)110, + (byte)108,(byte)105,(byte)110,(byte)101,(byte)45,(byte)109,(byte)111,(byte)100,(byte)101,(byte)32, + (byte)112,(byte)108,(byte)117,(byte)103,(byte)105,(byte)110,(byte)32,(byte)116,(byte)104,(byte)97, + (byte)116,(byte)32,(byte)114,(byte)101,(byte)113,(byte)117,(byte)105,(byte)114,(byte)101,(byte)115, + (byte)32,(byte)97,(byte)32,(byte)109,(byte)105,(byte)99,(byte)114,(byte)111,(byte)115,(byte)111, + (byte)102,(byte)116,(byte)32,(byte)97,(byte)99,(byte)99,(byte)111,(byte)117,(byte)110,(byte)116,(byte)46 + }; + + static final byte[] line40 = new byte[] { + (byte)85,(byte)110,(byte)116,(byte)105,(byte)108,(byte)32,(byte)116,(byte)104,(byte)101,(byte)110, + (byte)44,(byte)32,(byte)68,(byte)79,(byte)32,(byte)78,(byte)79,(byte)84,(byte)32,(byte)66,(byte)85, + (byte)89,(byte)32,(byte)79,(byte)82,(byte)32,(byte)83,(byte)69,(byte)76,(byte)76,(byte)32,(byte)65, + (byte)67,(byte)67,(byte)69,(byte)83,(byte)83,(byte)32,(byte)84,(byte)79,(byte)32,(byte)84,(byte)72, + (byte)73,(byte)83,(byte)32,(byte)80,(byte)82,(byte)79,(byte)74,(byte)69,(byte)67,(byte)84 + }; + + static final byte[] line50 = new byte[] { + (byte)73,(byte)32,(byte)117,(byte)110,(byte)100,(byte)101,(byte)114,(byte)115,(byte)116,(byte)97, + (byte)110,(byte)100,(byte)32,(byte)97,(byte)110,(byte)100,(byte)32,(byte)107,(byte)110,(byte)111, + (byte)119,(byte)32,(byte)104,(byte)111,(byte)119,(byte)32,(byte)116,(byte)111,(byte)32,(byte)114, + (byte)101,(byte)97,(byte)100 + }; + + static final byte[] line60 = new byte[] {(byte)65,(byte)99,(byte)99,(byte)101,(byte)112,(byte)116}; + + static final byte[] line61 = new byte[] {(byte)68,(byte)101,(byte)99,(byte)108,(byte)105,(byte)110,(byte)101}; + + static final byte[] line70 = new byte[] { + (byte)84,(byte)101,(byte)114,(byte)109,(byte)115,(byte)32,(byte)111,(byte)102,(byte)32,(byte)83, + (byte)101,(byte)114,(byte)118,(byte)105,(byte)99,(byte)101,(byte)32,(byte)68,(byte)101,(byte)99, + (byte)108,(byte)105,(byte)110,(byte)101,(byte)100 + }; + + static final byte[] line71 = new byte[] { + (byte)121,(byte)111,(byte)117,(byte)32,(byte)99,(byte)97,(byte)110,(byte)110,(byte)111,(byte)116, + (byte)32,(byte)117,(byte)115,(byte)101,(byte)32,(byte)116,(byte)104,(byte)105,(byte)115,(byte)32, + (byte)115,(byte)111,(byte)102,(byte)116,(byte)119,(byte)97,(byte)114,(byte)101,(byte)32,(byte)105, + (byte)102,(byte)32,(byte)121,(byte)111,(byte)117,(byte)32,(byte)100,(byte)111,(byte)32,(byte)110, + (byte)111,(byte)116,(byte)32,(byte)97,(byte)99,(byte)99,(byte)101,(byte)112,(byte)116 + }; + + static final byte[] line72 = new byte[] { + (byte)114,(byte)101,(byte)102,(byte)114,(byte)101,(byte)115,(byte)104,(byte)32,(byte)116,(byte)104, + (byte)101,(byte)32,(byte)112,(byte)97,(byte)103,(byte)101,(byte)32,(byte)116,(byte)111,(byte)32, + (byte)116,(byte)114,(byte)121,(byte)32,(byte)97,(byte)103,(byte)97,(byte)105,(byte)110 + }; + +} diff --git a/src/main/java/net/lax1dude/eaglercraft/glemu/EaglerAdapterGL30.java b/src/main/java/net/lax1dude/eaglercraft/glemu/EaglerAdapterGL30.java index e769b19..a11c443 100644 --- a/src/main/java/net/lax1dude/eaglercraft/glemu/EaglerAdapterGL30.java +++ b/src/main/java/net/lax1dude/eaglercraft/glemu/EaglerAdapterGL30.java @@ -15,116 +15,116 @@ import net.lax1dude.eaglercraft.glemu.vector.Vector4f; public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { - public static final int GL_ZERO = 0; - public static final int GL_ONE = 1; - public static final int GL_TEXTURE_2D = 2; - public static final int GL_SMOOTH = 3; - public static final int GL_DEPTH_TEST = 4; - public static final int GL_LEQUAL = 5; - public static final int GL_ALPHA_TEST = 6; - public static final int GL_GREATER = 7; - public static final int GL_BACK = 8; - public static final int GL_PROJECTION = 9; - public static final int GL_MODELVIEW = 10; - public static final int GL_COLOR_BUFFER_BIT = 1; - public static final int GL_DEPTH_BUFFER_BIT = 2; - public static final int GL_LIGHTING = 13; - public static final int GL_FOG = 14; - public static final int GL_COLOR_MATERIAL = 15; - public static final int GL_BLEND = 16; - public static final int GL_RGBA = 18; - public static final int GL_UNSIGNED_BYTE = 19; - public static final int GL_TEXTURE_WIDTH = 20; - public static final int GL_LIGHT0 = 21; - public static final int GL_LIGHT1 = 22; - public static final int GL_POSITION = 30; - public static final int GL_DIFFUSE = 31; - public static final int GL_SPECULAR = 32; - public static final int GL_AMBIENT = 33; - public static final int GL_FLAT = 34; - public static final int GL_LIGHT_MODEL_AMBIENT = 35; - public static final int GL_FRONT_AND_BACK = 36; - public static final int GL_AMBIENT_AND_DIFFUSE = 37; - public static final int GL_MODELVIEW_MATRIX = 38; - public static final int GL_PROJECTION_MATRIX = 39; - public static final int GL_VIEWPORT = 40; - public static final int GL_RESCALE_NORMAL = 41; - public static final int GL_SRC_ALPHA = 42; - public static final int GL_ONE_MINUS_SRC_ALPHA = 43; - public static final int GL_ONE_MINUS_DST_COLOR = 44; - public static final int GL_ONE_MINUS_SRC_COLOR = 45; - public static final int GL_CULL_FACE = 46; - public static final int GL_TEXTURE_MIN_FILTER = 47; - public static final int GL_TEXTURE_MAG_FILTER = 48; - public static final int GL_LINEAR = 49; - public static final int GL_COLOR_LOGIC_OP = 50; - public static final int GL_OR_REVERSE = 51; - public static final int GL_EQUAL = 52; - public static final int GL_SRC_COLOR = 53; - public static final int GL_TEXTURE = 54; - public static final int GL_FRONT = 55; - public static final int GL_COMPILE = 56; - public static final int GL_S = 57; - public static final int GL_T = 58; - public static final int GL_R = 59; - public static final int GL_Q = 60; - public static final int GL_TEXTURE_GEN_S = 61; - public static final int GL_TEXTURE_GEN_T = 62; - public static final int GL_TEXTURE_GEN_R = 63; - public static final int GL_TEXTURE_GEN_Q = 64; - public static final int GL_TEXTURE_GEN_MODE = 65; - public static final int GL_OBJECT_PLANE = 66; - public static final int GL_EYE_PLANE = 67; - public static final int GL_OBJECT_LINEAR = 68; - public static final int GL_EYE_LINEAR = 69; - public static final int GL_NEAREST = 70; - public static final int GL_CLAMP = 71; - public static final int GL_TEXTURE_WRAP_S = 72; - public static final int GL_TEXTURE_WRAP_T = 73; - public static final int GL_REPEAT = 74; - public static final int GL_BGRA = 75; - public static final int GL_UNSIGNED_INT_8_8_8_8_REV = 76; - public static final int GL_DST_COLOR = 77; - public static final int GL_POLYGON_OFFSET_FILL = 78; - public static final int GL_NORMALIZE = 79; - public static final int GL_DST_ALPHA = 80; - public static final int GL_FLOAT = 81; - public static final int GL_TEXTURE_COORD_ARRAY = 82; - public static final int GL_SHORT = 83; - public static final int GL_COLOR_ARRAY = 84; - public static final int GL_VERTEX_ARRAY = 85; - public static final int GL_TRIANGLES = 86; - public static final int GL_NORMAL_ARRAY = 87; - public static final int GL_TEXTURE_3D = 88; - public static final int GL_FOG_MODE = 89; - public static final int GL_EXP = 90; - public static final int GL_FOG_DENSITY = 91; - public static final int GL_FOG_START = 92; - public static final int GL_FOG_END = 93; - public static final int GL_FOG_COLOR = 94; - public static final int GL_TRIANGLE_STRIP = 95; - public static final int GL_PACK_ALIGNMENT = 96; - public static final int GL_UNPACK_ALIGNMENT = 97; - public static final int GL_QUADS = 98; - public static final int GL_TEXTURE0 = 99; - public static final int GL_TEXTURE1 = 100; - public static final int GL_TEXTURE2 = 101; - public static final int GL_TEXTURE3 = 102; - public static final int GL_INVALID_ENUM = 140; - public static final int GL_INVALID_VALUE= 141; - public static final int GL_INVALID_OPERATION = 142; - public static final int GL_OUT_OF_MEMORY = 143; - public static final int GL_CONTEXT_LOST_WEBGL = 144; - public static final int GL_TRIANGLE_FAN = 145; - public static final int GL_LINE_STRIP = 146; - public static final int GL_LIGHTING2 = 147; - public static final int GL_LINES = 148; - public static final int GL_NEAREST_MIPMAP_LINEAR = 149; - public static final int GL_TEXTURE_MAX_ANISOTROPY = 150; - public static final int GL_TEXTURE_MAX_LEVEL = 151; - public static final int GL_LINEAR_MIPMAP_LINEAR = 152; - public static final int GL_LINEAR_MIPMAP_NEAREST = 153; - public static final int GL_NEAREST_MIPMAP_NEAREST = 154; + public static final int GL_ZERO = RealOpenGLEnums.GL_ZERO; + public static final int GL_ONE = RealOpenGLEnums.GL_ONE; + public static final int GL_TEXTURE_2D = RealOpenGLEnums.GL_TEXTURE_2D; + public static final int GL_SMOOTH = RealOpenGLEnums.GL_SMOOTH; + public static final int GL_DEPTH_TEST = RealOpenGLEnums.GL_DEPTH_TEST; + public static final int GL_LEQUAL = RealOpenGLEnums.GL_LEQUAL; + public static final int GL_ALPHA_TEST = RealOpenGLEnums.GL_ALPHA_TEST; + public static final int GL_GREATER = RealOpenGLEnums.GL_GREATER; + public static final int GL_BACK = RealOpenGLEnums.GL_BACK; + public static final int GL_PROJECTION = RealOpenGLEnums.GL_PROJECTION; + public static final int GL_MODELVIEW = RealOpenGLEnums.GL_MODELVIEW; + public static final int GL_COLOR_BUFFER_BIT = RealOpenGLEnums.GL_COLOR_BUFFER_BIT; + public static final int GL_DEPTH_BUFFER_BIT = RealOpenGLEnums.GL_DEPTH_BUFFER_BIT; + public static final int GL_LIGHTING = RealOpenGLEnums.GL_LIGHTING; + public static final int GL_FOG = RealOpenGLEnums.GL_FOG; + public static final int GL_COLOR_MATERIAL = RealOpenGLEnums.GL_COLOR_MATERIAL; + public static final int GL_BLEND = RealOpenGLEnums.GL_BLEND; + public static final int GL_RGBA = RealOpenGLEnums.GL_RGBA; + public static final int GL_UNSIGNED_BYTE = RealOpenGLEnums.GL_UNSIGNED_BYTE; + public static final int GL_TEXTURE_WIDTH = RealOpenGLEnums.GL_TEXTURE_WIDTH; + public static final int GL_LIGHT0 = RealOpenGLEnums.GL_LIGHT0; + public static final int GL_LIGHT1 = RealOpenGLEnums.GL_LIGHT1; + public static final int GL_POSITION = RealOpenGLEnums.GL_POSITION; + public static final int GL_DIFFUSE = RealOpenGLEnums.GL_DIFFUSE; + public static final int GL_SPECULAR = RealOpenGLEnums.GL_SPECULAR; + public static final int GL_AMBIENT = RealOpenGLEnums.GL_AMBIENT; + public static final int GL_FLAT = RealOpenGLEnums.GL_FLAT; + public static final int GL_LIGHT_MODEL_AMBIENT = RealOpenGLEnums.GL_LIGHT_MODEL_AMBIENT; + public static final int GL_FRONT_AND_BACK = RealOpenGLEnums.GL_FRONT_AND_BACK; + public static final int GL_AMBIENT_AND_DIFFUSE = RealOpenGLEnums.GL_AMBIENT_AND_DIFFUSE; + public static final int GL_MODELVIEW_MATRIX = RealOpenGLEnums.GL_MODELVIEW_MATRIX; + public static final int GL_PROJECTION_MATRIX = RealOpenGLEnums.GL_PROJECTION_MATRIX; + public static final int GL_VIEWPORT = RealOpenGLEnums.GL_VIEWPORT; + public static final int GL_RESCALE_NORMAL = RealOpenGLEnums.GL_RESCALE_NORMAL; + public static final int GL_SRC_ALPHA = RealOpenGLEnums.GL_SRC_ALPHA; + public static final int GL_ONE_MINUS_SRC_ALPHA = RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA; + public static final int GL_ONE_MINUS_DST_COLOR = RealOpenGLEnums.GL_ONE_MINUS_DST_COLOR; + public static final int GL_ONE_MINUS_SRC_COLOR = RealOpenGLEnums.GL_ONE_MINUS_SRC_COLOR; + public static final int GL_CULL_FACE = RealOpenGLEnums.GL_CULL_FACE; + public static final int GL_TEXTURE_MIN_FILTER = RealOpenGLEnums.GL_TEXTURE_MIN_FILTER; + public static final int GL_TEXTURE_MAG_FILTER = RealOpenGLEnums.GL_TEXTURE_MAG_FILTER; + public static final int GL_LINEAR = RealOpenGLEnums.GL_LINEAR; + public static final int GL_COLOR_LOGIC_OP = RealOpenGLEnums.GL_COLOR_LOGIC_OP; + public static final int GL_OR_REVERSE = RealOpenGLEnums.GL_OR_REVERSE; + public static final int GL_EQUAL = RealOpenGLEnums.GL_EQUAL; + public static final int GL_SRC_COLOR = RealOpenGLEnums.GL_SRC_COLOR; + public static final int GL_TEXTURE = RealOpenGLEnums.GL_TEXTURE; + public static final int GL_FRONT = RealOpenGLEnums.GL_FRONT; + public static final int GL_COMPILE = RealOpenGLEnums.GL_COMPILE; + public static final int GL_S = RealOpenGLEnums.GL_S; + public static final int GL_T = RealOpenGLEnums.GL_T; + public static final int GL_R = RealOpenGLEnums.GL_R; + public static final int GL_Q = RealOpenGLEnums.GL_Q; + public static final int GL_TEXTURE_GEN_S = RealOpenGLEnums.GL_TEXTURE_GEN_S; + public static final int GL_TEXTURE_GEN_T = RealOpenGLEnums.GL_TEXTURE_GEN_T; + public static final int GL_TEXTURE_GEN_R = RealOpenGLEnums.GL_TEXTURE_GEN_R; + public static final int GL_TEXTURE_GEN_Q = RealOpenGLEnums.GL_TEXTURE_GEN_Q; + public static final int GL_TEXTURE_GEN_MODE = RealOpenGLEnums.GL_TEXTURE_GEN_MODE; + public static final int GL_OBJECT_PLANE = RealOpenGLEnums.GL_OBJECT_PLANE; + public static final int GL_EYE_PLANE = RealOpenGLEnums.GL_EYE_PLANE; + public static final int GL_OBJECT_LINEAR = RealOpenGLEnums.GL_OBJECT_LINEAR; + public static final int GL_EYE_LINEAR = RealOpenGLEnums.GL_EYE_LINEAR; + public static final int GL_NEAREST = RealOpenGLEnums.GL_NEAREST; + public static final int GL_CLAMP = RealOpenGLEnums.GL_CLAMP_TO_EDGE; + public static final int GL_TEXTURE_WRAP_S = RealOpenGLEnums.GL_TEXTURE_WRAP_S; + public static final int GL_TEXTURE_WRAP_T = RealOpenGLEnums.GL_TEXTURE_WRAP_T; + public static final int GL_REPEAT = RealOpenGLEnums.GL_REPEAT; + public static final int GL_BGRA = RealOpenGLEnums.GL_BGRA; + public static final int GL_UNSIGNED_INT_8_8_8_8_REV = RealOpenGLEnums.GL_UNSIGNED_INT_8_8_8_8_REV; + public static final int GL_DST_COLOR = RealOpenGLEnums.GL_DST_COLOR; + public static final int GL_POLYGON_OFFSET_FILL = RealOpenGLEnums.GL_POLYGON_OFFSET_FILL; + public static final int GL_NORMALIZE = RealOpenGLEnums.GL_NORMALIZE; + public static final int GL_DST_ALPHA = RealOpenGLEnums.GL_DST_ALPHA; + public static final int GL_FLOAT = RealOpenGLEnums.GL_FLOAT; + public static final int GL_TEXTURE_COORD_ARRAY = RealOpenGLEnums.GL_TEXTURE_COORD_ARRAY; + public static final int GL_SHORT = RealOpenGLEnums.GL_SHORT; + public static final int GL_COLOR_ARRAY = RealOpenGLEnums.GL_COLOR_ARRAY; + public static final int GL_VERTEX_ARRAY = RealOpenGLEnums.GL_VERTEX_ARRAY; + public static final int GL_TRIANGLES = RealOpenGLEnums.GL_TRIANGLES; + public static final int GL_NORMAL_ARRAY = RealOpenGLEnums.GL_NORMAL_ARRAY; + public static final int GL_TEXTURE_3D = RealOpenGLEnums.GL_TEXTURE_3D; + public static final int GL_FOG_MODE = RealOpenGLEnums.GL_FOG_MODE; + public static final int GL_EXP = RealOpenGLEnums.GL_EXP; + public static final int GL_FOG_DENSITY = RealOpenGLEnums.GL_FOG_DENSITY; + public static final int GL_FOG_START = RealOpenGLEnums.GL_FOG_START; + public static final int GL_FOG_END = RealOpenGLEnums.GL_FOG_END; + public static final int GL_FOG_COLOR = RealOpenGLEnums.GL_FOG_COLOR; + public static final int GL_TRIANGLE_STRIP = RealOpenGLEnums.GL_TRIANGLE_STRIP; + public static final int GL_PACK_ALIGNMENT = RealOpenGLEnums.GL_PACK_ALIGNMENT; + public static final int GL_UNPACK_ALIGNMENT = RealOpenGLEnums.GL_UNPACK_ALIGNMENT; + public static final int GL_QUADS = RealOpenGLEnums.GL_QUADS; + public static final int GL_TEXTURE0 = RealOpenGLEnums.GL_TEXTURE0; + public static final int GL_TEXTURE1 = RealOpenGLEnums.GL_TEXTURE1; + public static final int GL_TEXTURE2 = RealOpenGLEnums.GL_TEXTURE2; + public static final int GL_TEXTURE3 = RealOpenGLEnums.GL_TEXTURE3; + public static final int GL_INVALID_ENUM = RealOpenGLEnums.GL_INVALID_ENUM; + public static final int GL_INVALID_VALUE = RealOpenGLEnums.GL_INVALID_VALUE; + public static final int GL_INVALID_OPERATION = RealOpenGLEnums.GL_INVALID_OPERATION; + public static final int GL_OUT_OF_MEMORY = RealOpenGLEnums.GL_OUT_OF_MEMORY; + public static final int GL_CONTEXT_LOST_WEBGL = -100; + public static final int GL_TRIANGLE_FAN = RealOpenGLEnums.GL_TRIANGLE_FAN; + public static final int GL_LINE_STRIP = RealOpenGLEnums.GL_LINE_STRIP; + public static final int EAG_SWAP_RB = -101; + public static final int GL_LINES = RealOpenGLEnums.GL_LINES; + public static final int GL_NEAREST_MIPMAP_LINEAR = RealOpenGLEnums.GL_NEAREST_MIPMAP_LINEAR; + public static final int GL_TEXTURE_MAX_ANISOTROPY = -103; + public static final int GL_TEXTURE_MAX_LEVEL = RealOpenGLEnums.GL_TEXTURE_MAX_LEVEL; + public static final int GL_LINEAR_MIPMAP_LINEAR = RealOpenGLEnums.GL_LINEAR_MIPMAP_LINEAR; + public static final int GL_LINEAR_MIPMAP_NEAREST = RealOpenGLEnums.GL_LINEAR_MIPMAP_NEAREST; + public static final int GL_NEAREST_MIPMAP_NEAREST = RealOpenGLEnums.GL_NEAREST_MIPMAP_NEAREST; public static final boolean isWebGL = _wisWebGL(); @@ -166,6 +166,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { private static TextureGL boundTexture0 = null; private static boolean enableAnisotropicPatch = false; private static boolean hintAnisotropicPatch = false; + private static boolean swapRB = false; public static final void anisotropicPatch(boolean e) { enableAnisotropicPatch = e; @@ -291,8 +292,6 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { case GL_LIGHTING: enableLighting = true; break; - case GL_LIGHTING2: - break; case GL_ALPHA_TEST: enableAlphaTest = true; break; @@ -310,6 +309,10 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { break; case GL_POLYGON_OFFSET_FILL: _wglEnable(_wGL_POLYGON_OFFSET_FILL); + break; + case EAG_SWAP_RB: + swapRB = true; + break; default: break; } @@ -334,14 +337,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { alphaThresh = p2; } public static final void glCullFace(int p1) { - int f = _wGL_BACK; - switch(p1) { - case GL_BACK: f = _wGL_BACK; break; - case GL_FRONT: f = _wGL_FRONT; break; - case GL_FRONT_AND_BACK: f = _wGL_FRONT_AND_BACK; break; - default: break; - } - _wglCullFace(f); + _wglCullFace(p1); } public static final void glMatrixMode(int p1) { matrixMode = p1; @@ -364,14 +360,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { _wglViewport(p1, p2, p3, p4); } public static final void glClear(int p1) { - int f = 0; - if((p1 & GL_COLOR_BUFFER_BIT) == GL_COLOR_BUFFER_BIT) { - f = f | _wGL_COLOR_BUFFER_BIT; - } - if((p1 & GL_DEPTH_BUFFER_BIT) == GL_DEPTH_BUFFER_BIT) { - f = f | _wGL_DEPTH_BUFFER_BIT; - } - _wglClear(f); + _wglClear(p1); } public static final void glOrtho(float left, float right, float bottom, float top, float zNear, float zFar) { Matrix4f res = getMatrix(); @@ -427,8 +416,6 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { case GL_LIGHTING: enableLighting = false; break; - case GL_LIGHTING2: - break; case GL_ALPHA_TEST: enableAlphaTest = false; break; @@ -446,6 +433,10 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { break; case GL_POLYGON_OFFSET_FILL: _wglDisable(_wGL_POLYGON_OFFSET_FILL); + break; + case EAG_SWAP_RB: + swapRB = false; + break; default: break; } @@ -458,10 +449,6 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { } public static final int glGetError() { int err = _wglGetError(); - if(err == _wGL_INVALID_ENUM) return GL_INVALID_ENUM; - if(err == _wGL_INVALID_OPERATION) return GL_INVALID_OPERATION; - if(err == _wGL_INVALID_VALUE) return GL_INVALID_VALUE; - if(err == _wGL_OUT_OF_MEMORY) return GL_OUT_OF_MEMORY; if(err == _wGL_CONTEXT_LOST_WEBGL) return GL_CONTEXT_LOST_WEBGL; return err; } @@ -598,34 +585,8 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { } } public static final void glBlendFunc(int p1, int p2) { - int pp1 = 0; - int pp2 = 0; - switch(p1) { - default: - case GL_SRC_ALPHA: pp1 = _wGL_SRC_ALPHA; break; - case GL_ONE_MINUS_SRC_ALPHA: pp1 = _wGL_ONE_MINUS_SRC_ALPHA; break; - case GL_DST_ALPHA: pp1 = _wGL_DST_ALPHA; break; - case GL_DST_COLOR: pp1 = _wGL_DST_COLOR; break; - case GL_SRC_COLOR: pp1 = _wGL_SRC_COLOR; break; - case GL_ONE_MINUS_SRC_COLOR: pp1 = _wGL_ONE_MINUS_SRC_COLOR; break; - case GL_ONE_MINUS_DST_COLOR: pp1 = _wGL_ONE_MINUS_DST_COLOR; break; - case GL_ONE: pp1 = _wGL_ONE; break; - case GL_ZERO: pp1 = _wGL_ZERO; break; - } - switch(p2) { - default: - case GL_SRC_ALPHA: pp2 = _wGL_SRC_ALPHA; break; - case GL_ONE_MINUS_SRC_ALPHA: pp2 = _wGL_ONE_MINUS_SRC_ALPHA; break; - case GL_DST_ALPHA: pp2 = _wGL_DST_ALPHA; break; - case GL_DST_COLOR: pp2 = _wGL_DST_COLOR; break; - case GL_SRC_COLOR: pp2 = _wGL_SRC_COLOR; break; - case GL_ONE_MINUS_SRC_COLOR: pp2 = _wGL_ONE_MINUS_SRC_COLOR; break; - case GL_ONE_MINUS_DST_COLOR: pp1 = _wGL_ONE_MINUS_DST_COLOR; break; - case GL_ONE: pp2 = _wGL_ONE; break; - case GL_ZERO: pp2 = _wGL_ZERO; break; - } fogPremultiply = (p1 == GL_ONE && p2 == GL_ONE_MINUS_SRC_ALPHA); - _wglBlendFunc(pp1, pp2); + _wglBlendFunc(p1, p2); } public static final void glDepthMask(boolean p1) { _wglDepthMask(p1); @@ -655,57 +616,17 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { _wglCopyTexSubImage2D(_wGL_TEXTURE_2D, p2, p3, p4, p5, p6, p7, p8); } public static final void glTexParameteri(int p1, int p2, int p3) { - int pp1 = 0; - switch(p1) { - default: - case GL_TEXTURE_2D: pp1 = _wGL_TEXTURE_2D; break; - //case GL_TEXTURE_3D: pp1 = _wGL_TEXTURE_3D; break; + if(selectedTex == 0 && boundTexture0 != null && p2 == GL_TEXTURE_MAG_FILTER) { + boundTexture0.nearest = p3 == GL_NEAREST; } - int pp2 = 0; - switch(p2) { - default: - case GL_TEXTURE_MAG_FILTER: pp2 = _wGL_TEXTURE_MAG_FILTER; break; - case GL_TEXTURE_MIN_FILTER: pp2 = _wGL_TEXTURE_MIN_FILTER; break; - case GL_TEXTURE_WRAP_S: pp2 = _wGL_TEXTURE_WRAP_S; break; - case GL_TEXTURE_WRAP_T: pp2 = _wGL_TEXTURE_WRAP_T; break; - case GL_TEXTURE_MAX_LEVEL: pp2 = _wGL_TEXTURE_MAX_LEVEL; break; - } - int pp3 = 0; - switch(p3) { - default: - pp3 = p3; break; - case GL_LINEAR: pp3 = _wGL_LINEAR; break; - case GL_NEAREST_MIPMAP_LINEAR: pp3 = _wGL_NEAREST_MIPMAP_LINEAR; break; - case GL_LINEAR_MIPMAP_LINEAR: pp3 = _wGL_LINEAR_MIPMAP_LINEAR; break; - case GL_LINEAR_MIPMAP_NEAREST: pp3 = _wGL_LINEAR_MIPMAP_NEAREST; break; - case GL_NEAREST_MIPMAP_NEAREST: pp3 = _wGL_NEAREST_MIPMAP_NEAREST; break; - case GL_NEAREST: pp3 = _wGL_NEAREST; break; - case GL_REPEAT: pp3 = _wGL_REPEAT; break; - case GL_CLAMP: pp3 = _wGL_CLAMP; break; - } - - if(selectedTex == 0 && boundTexture0 != null && pp2 == _wGL_TEXTURE_MAG_FILTER) { - boundTexture0.nearest = pp3 == _wGL_NEAREST; - } - _wglTexParameteri(pp1, pp2, pp3); + _wglTexParameteri(p1, p2, p3); updateAnisotropicPatch(); } public static final void glTexParameterf(int p1, int p2, float p3) { - int pp1 = 0; - switch(p1) { - default: - case GL_TEXTURE_2D: pp1 = _wGL_TEXTURE_2D; break; - //case GL_TEXTURE_3D: pp1 = _wGL_TEXTURE_3D; break; - } - int pp2 = 0; - switch(p2) { - default: - case GL_TEXTURE_MAX_ANISOTROPY: pp2 = _wGL_TEXTURE_MAX_ANISOTROPY; break; - } - if(selectedTex == 0 && boundTexture0 != null && pp2 == _wGL_TEXTURE_MAX_ANISOTROPY) { + if(selectedTex == 0 && boundTexture0 != null && p2 == GL_TEXTURE_MAX_ANISOTROPY) { boundTexture0.anisotropic = p3 > 1.0f; } - _wglTexParameterf(pp1, pp2, p3); + _wglTexParameterf(p1, p2 == GL_TEXTURE_MAX_ANISOTROPY ? _wGL_TEXTURE_MAX_ANISOTROPY : p2, p3); updateAnisotropicPatch(); } public static final void glLogicOp(int p1) { @@ -944,6 +865,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { mode = (mode | (enableTexture2D ? FixedFunctionShader.UNIT0 : 0)); mode = (mode | (enableTexture2D_1 ? FixedFunctionShader.UNIT1 : 0)); mode = (mode | ((enableTexture2D && (enableAnisotropicFix || (hintAnisotropicPatch && enableAnisotropicPatch))) ? FixedFunctionShader.FIX_ANISOTROPIC : 0)); + mode = (mode | (swapRB ? FixedFunctionShader.SWAP_RB : 0)); return mode; } private static final int getShaderModeFlag() { @@ -959,6 +881,7 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { mode = (mode | (enableTexture2D ? FixedFunctionShader.UNIT0 : 0)); mode = (mode | (enableTexture2D_1 ? FixedFunctionShader.UNIT1 : 0)); mode = (mode | ((enableTexture2D && (enableAnisotropicFix || (hintAnisotropicPatch && enableAnisotropicPatch))) ? FixedFunctionShader.FIX_ANISOTROPIC : 0)); + mode = (mode | (swapRB ? FixedFunctionShader.SWAP_RB : 0)); return mode; } private static FixedFunctionShader shader = null; @@ -1031,31 +954,25 @@ public class EaglerAdapterGL30 extends EaglerAdapterImpl2 { _wglDrawQuadArrays(p2, p3); triangleDrawn += p3 / 2; }else { - int drawMode = 0; switch(p1) { default: case GL_TRIANGLES: - drawMode = _wGL_TRIANGLES; triangleDrawn += p3 / 3; break; case GL_TRIANGLE_STRIP: - drawMode = _wGL_TRIANGLE_STRIP; triangleDrawn += p3 - 2; break; case GL_TRIANGLE_FAN: - drawMode = _wGL_TRIANGLE_FAN; triangleDrawn += p3 - 2; break; case GL_LINE_STRIP: - drawMode = _wGL_LINE_STRIP; triangleDrawn += p3 - 1; break; case GL_LINES: - drawMode = _wGL_LINES; triangleDrawn += p3 / 2; break; } - _wglDrawArrays(drawMode, p2, p3); + _wglDrawArrays(p1, p2, p3); } shader.unuseProgram(); diff --git a/src/main/java/net/lax1dude/eaglercraft/glemu/FixedFunctionShader.java b/src/main/java/net/lax1dude/eaglercraft/glemu/FixedFunctionShader.java index b357b59..f9352ec 100644 --- a/src/main/java/net/lax1dude/eaglercraft/glemu/FixedFunctionShader.java +++ b/src/main/java/net/lax1dude/eaglercraft/glemu/FixedFunctionShader.java @@ -9,7 +9,7 @@ import static net.lax1dude.eaglercraft.glemu.EaglerAdapterGL30.*; public class FixedFunctionShader { - private static final FixedFunctionShader[] instances = new FixedFunctionShader[2048]; //lol + private static final FixedFunctionShader[] instances = new FixedFunctionShader[4096]; //lol public static void refreshCoreGL() { for(int i = 0; i < instances.length; ++i) { @@ -32,6 +32,7 @@ public class FixedFunctionShader { public static final int UNIT0 = 256; public static final int UNIT1 = 512; public static final int FIX_ANISOTROPIC = 1024; + public static final int SWAP_RB = 2048; public static FixedFunctionShader instance(int i) { FixedFunctionShader s = instances[i]; @@ -47,6 +48,7 @@ public class FixedFunctionShader { boolean CC_unit0 = false; boolean CC_unit1 = false; boolean CC_anisotropic = false; + boolean CC_swap_rb = false; if((i & COLOR) == COLOR) { CC_a_color = true; } @@ -80,7 +82,11 @@ public class FixedFunctionShader { if((i & FIX_ANISOTROPIC) == FIX_ANISOTROPIC) { CC_anisotropic = true; } - s = new FixedFunctionShader(i, CC_a_color, CC_a_normal, CC_a_texture0, CC_a_texture1, CC_TEX_GEN_STRQ, CC_lighting, CC_fog, CC_alphatest, CC_unit0, CC_unit1, CC_anisotropic); + if((i & SWAP_RB) == SWAP_RB) { + CC_swap_rb = true; + } + s = new FixedFunctionShader(i, CC_a_color, CC_a_normal, CC_a_texture0, CC_a_texture1, CC_TEX_GEN_STRQ, CC_lighting, + CC_fog, CC_alphatest, CC_unit0, CC_unit1, CC_anisotropic, CC_swap_rb); instances[i] = s; } return s; @@ -99,6 +105,7 @@ public class FixedFunctionShader { private final boolean enable_unit0; private final boolean enable_unit1; private final boolean enable_anisotropic_fix; + private final boolean enable_swap_rb; private final ProgramGL globject; private UniformGL u_matrix_m = null; @@ -148,7 +155,8 @@ public class FixedFunctionShader { public final BufferGL genericBuffer; public boolean bufferIsInitialized = false; - private FixedFunctionShader(int j, boolean CC_a_color, boolean CC_a_normal, boolean CC_a_texture0, boolean CC_a_texture1, boolean CC_TEX_GEN_STRQ, boolean CC_lighting, boolean CC_fog, boolean CC_alphatest, boolean CC_unit0, boolean CC_unit1, boolean CC_anisotropic_fix) { + private FixedFunctionShader(int j, boolean CC_a_color, boolean CC_a_normal, boolean CC_a_texture0, boolean CC_a_texture1, boolean CC_TEX_GEN_STRQ, boolean CC_lighting, + boolean CC_fog, boolean CC_alphatest, boolean CC_unit0, boolean CC_unit1, boolean CC_anisotropic_fix, boolean CC_swap_rb) { enable_color = CC_a_color; enable_normal = CC_a_normal; enable_texture0 = CC_a_texture0; @@ -160,6 +168,7 @@ public class FixedFunctionShader { enable_unit0 = CC_unit0; enable_unit1 = CC_unit1; enable_anisotropic_fix = CC_anisotropic_fix; + enable_swap_rb = CC_swap_rb; if(shaderSource == null) { shaderSource = fileContents("/glsl/core.glsl"); @@ -177,6 +186,7 @@ public class FixedFunctionShader { if(enable_unit0) source += "#define CC_unit0\n"; if(enable_unit1) source += "#define CC_unit1\n"; if(enable_anisotropic_fix) source += "#define CC_patch_anisotropic\n"; + if(enable_swap_rb) source += "#define CC_swap_rb\n"; source += shaderSource; ShaderGL v = _wglCreateShader(_wGL_VERTEX_SHADER); diff --git a/src/main/java/net/lax1dude/eaglercraft/glemu/RealOpenGLEnums.java b/src/main/java/net/lax1dude/eaglercraft/glemu/RealOpenGLEnums.java new file mode 100644 index 0000000..7641deb --- /dev/null +++ b/src/main/java/net/lax1dude/eaglercraft/glemu/RealOpenGLEnums.java @@ -0,0 +1,2417 @@ +package net.lax1dude.eaglercraft.glemu; + +public class RealOpenGLEnums { + + // Field descriptor #544 I + public static final int GL_ACCUM = 256; + + // Field descriptor #544 I + public static final int GL_LOAD = 257; + + // Field descriptor #544 I + public static final int GL_RETURN = 258; + + // Field descriptor #544 I + public static final int GL_MULT = 259; + + // Field descriptor #544 I + public static final int GL_ADD = 260; + + // Field descriptor #544 I + public static final int GL_NEVER = 512; + + // Field descriptor #544 I + public static final int GL_LESS = 513; + + // Field descriptor #544 I + public static final int GL_EQUAL = 514; + + // Field descriptor #544 I + public static final int GL_LEQUAL = 515; + + // Field descriptor #544 I + public static final int GL_GREATER = 516; + + // Field descriptor #544 I + public static final int GL_NOTEQUAL = 517; + + // Field descriptor #544 I + public static final int GL_GEQUAL = 518; + + // Field descriptor #544 I + public static final int GL_ALWAYS = 519; + + // Field descriptor #544 I + public static final int GL_CURRENT_BIT = 1; + + // Field descriptor #544 I + public static final int GL_POINT_BIT = 2; + + // Field descriptor #544 I + public static final int GL_LINE_BIT = 4; + + // Field descriptor #544 I + public static final int GL_POLYGON_BIT = 8; + + // Field descriptor #544 I + public static final int GL_POLYGON_STIPPLE_BIT = 16; + + // Field descriptor #544 I + public static final int GL_PIXEL_MODE_BIT = 32; + + // Field descriptor #544 I + public static final int GL_LIGHTING_BIT = 64; + + // Field descriptor #544 I + public static final int GL_FOG_BIT = 128; + + // Field descriptor #544 I + public static final int GL_DEPTH_BUFFER_BIT = 256; + + // Field descriptor #544 I + public static final int GL_ACCUM_BUFFER_BIT = 512; + + // Field descriptor #544 I + public static final int GL_STENCIL_BUFFER_BIT = 1024; + + // Field descriptor #544 I + public static final int GL_VIEWPORT_BIT = 2048; + + // Field descriptor #544 I + public static final int GL_TRANSFORM_BIT = 4096; + + // Field descriptor #544 I + public static final int GL_ENABLE_BIT = 8192; + + // Field descriptor #544 I + public static final int GL_COLOR_BUFFER_BIT = 16384; + + // Field descriptor #544 I + public static final int GL_HINT_BIT = 32768; + + // Field descriptor #544 I + public static final int GL_EVAL_BIT = 65536; + + // Field descriptor #544 I + public static final int GL_LIST_BIT = 131072; + + // Field descriptor #544 I + public static final int GL_TEXTURE_BIT = 262144; + + // Field descriptor #544 I + public static final int GL_SCISSOR_BIT = 524288; + + // Field descriptor #544 I + public static final int GL_ALL_ATTRIB_BITS = 1048575; + + // Field descriptor #544 I + public static final int GL_POINTS = 0; + + // Field descriptor #544 I + public static final int GL_LINES = 1; + + // Field descriptor #544 I + public static final int GL_LINE_LOOP = 2; + + // Field descriptor #544 I + public static final int GL_LINE_STRIP = 3; + + // Field descriptor #544 I + public static final int GL_TRIANGLES = 4; + + // Field descriptor #544 I + public static final int GL_TRIANGLE_STRIP = 5; + + // Field descriptor #544 I + public static final int GL_TRIANGLE_FAN = 6; + + // Field descriptor #544 I + public static final int GL_QUADS = 7; + + // Field descriptor #544 I + public static final int GL_QUAD_STRIP = 8; + + // Field descriptor #544 I + public static final int GL_POLYGON = 9; + + // Field descriptor #544 I + public static final int GL_ZERO = 0; + + // Field descriptor #544 I + public static final int GL_ONE = 1; + + // Field descriptor #544 I + public static final int GL_SRC_COLOR = 768; + + // Field descriptor #544 I + public static final int GL_ONE_MINUS_SRC_COLOR = 769; + + // Field descriptor #544 I + public static final int GL_SRC_ALPHA = 770; + + // Field descriptor #544 I + public static final int GL_ONE_MINUS_SRC_ALPHA = 771; + + // Field descriptor #544 I + public static final int GL_DST_ALPHA = 772; + + // Field descriptor #544 I + public static final int GL_ONE_MINUS_DST_ALPHA = 773; + + // Field descriptor #544 I + public static final int GL_DST_COLOR = 774; + + // Field descriptor #544 I + public static final int GL_ONE_MINUS_DST_COLOR = 775; + + // Field descriptor #544 I + public static final int GL_SRC_ALPHA_SATURATE = 776; + + // Field descriptor #544 I + public static final int GL_CONSTANT_COLOR = 32769; + + // Field descriptor #544 I + public static final int GL_ONE_MINUS_CONSTANT_COLOR = 32770; + + // Field descriptor #544 I + public static final int GL_CONSTANT_ALPHA = 32771; + + // Field descriptor #544 I + public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 32772; + + // Field descriptor #544 I + public static final int GL_TRUE = 1; + + // Field descriptor #544 I + public static final int GL_FALSE = 0; + + // Field descriptor #544 I + public static final int GL_CLIP_PLANE0 = 12288; + + // Field descriptor #544 I + public static final int GL_CLIP_PLANE1 = 12289; + + // Field descriptor #544 I + public static final int GL_CLIP_PLANE2 = 12290; + + // Field descriptor #544 I + public static final int GL_CLIP_PLANE3 = 12291; + + // Field descriptor #544 I + public static final int GL_CLIP_PLANE4 = 12292; + + // Field descriptor #544 I + public static final int GL_CLIP_PLANE5 = 12293; + + // Field descriptor #544 I + public static final int GL_BYTE = 5120; + + // Field descriptor #544 I + public static final int GL_UNSIGNED_BYTE = 5121; + + // Field descriptor #544 I + public static final int GL_SHORT = 5122; + + // Field descriptor #544 I + public static final int GL_UNSIGNED_SHORT = 5123; + + // Field descriptor #544 I + public static final int GL_INT = 5124; + + // Field descriptor #544 I + public static final int GL_UNSIGNED_INT = 5125; + + // Field descriptor #544 I + public static final int GL_FLOAT = 5126; + + // Field descriptor #544 I + public static final int GL_2_BYTES = 5127; + + // Field descriptor #544 I + public static final int GL_3_BYTES = 5128; + + // Field descriptor #544 I + public static final int GL_4_BYTES = 5129; + + // Field descriptor #544 I + public static final int GL_DOUBLE = 5130; + + // Field descriptor #544 I + public static final int GL_NONE = 0; + + // Field descriptor #544 I + public static final int GL_FRONT_LEFT = 1024; + + // Field descriptor #544 I + public static final int GL_FRONT_RIGHT = 1025; + + // Field descriptor #544 I + public static final int GL_BACK_LEFT = 1026; + + // Field descriptor #544 I + public static final int GL_BACK_RIGHT = 1027; + + // Field descriptor #544 I + public static final int GL_FRONT = 1028; + + // Field descriptor #544 I + public static final int GL_BACK = 1029; + + // Field descriptor #544 I + public static final int GL_LEFT = 1030; + + // Field descriptor #544 I + public static final int GL_RIGHT = 1031; + + // Field descriptor #544 I + public static final int GL_FRONT_AND_BACK = 1032; + + // Field descriptor #544 I + public static final int GL_AUX0 = 1033; + + // Field descriptor #544 I + public static final int GL_AUX1 = 1034; + + // Field descriptor #544 I + public static final int GL_AUX2 = 1035; + + // Field descriptor #544 I + public static final int GL_AUX3 = 1036; + + // Field descriptor #544 I + public static final int GL_NO_ERROR = 0; + + // Field descriptor #544 I + public static final int GL_INVALID_ENUM = 1280; + + // Field descriptor #544 I + public static final int GL_INVALID_VALUE = 1281; + + // Field descriptor #544 I + public static final int GL_INVALID_OPERATION = 1282; + + // Field descriptor #544 I + public static final int GL_STACK_OVERFLOW = 1283; + + // Field descriptor #544 I + public static final int GL_STACK_UNDERFLOW = 1284; + + // Field descriptor #544 I + public static final int GL_OUT_OF_MEMORY = 1285; + + // Field descriptor #544 I + public static final int GL_2D = 1536; + + // Field descriptor #544 I + public static final int GL_3D = 1537; + + // Field descriptor #544 I + public static final int GL_3D_COLOR = 1538; + + // Field descriptor #544 I + public static final int GL_3D_COLOR_TEXTURE = 1539; + + // Field descriptor #544 I + public static final int GL_4D_COLOR_TEXTURE = 1540; + + // Field descriptor #544 I + public static final int GL_PASS_THROUGH_TOKEN = 1792; + + // Field descriptor #544 I + public static final int GL_POINT_TOKEN = 1793; + + // Field descriptor #544 I + public static final int GL_LINE_TOKEN = 1794; + + // Field descriptor #544 I + public static final int GL_POLYGON_TOKEN = 1795; + + // Field descriptor #544 I + public static final int GL_BITMAP_TOKEN = 1796; + + // Field descriptor #544 I + public static final int GL_DRAW_PIXEL_TOKEN = 1797; + + // Field descriptor #544 I + public static final int GL_COPY_PIXEL_TOKEN = 1798; + + // Field descriptor #544 I + public static final int GL_LINE_RESET_TOKEN = 1799; + + // Field descriptor #544 I + public static final int GL_EXP = 2048; + + // Field descriptor #544 I + public static final int GL_EXP2 = 2049; + + // Field descriptor #544 I + public static final int GL_CW = 2304; + + // Field descriptor #544 I + public static final int GL_CCW = 2305; + + // Field descriptor #544 I + public static final int GL_COEFF = 2560; + + // Field descriptor #544 I + public static final int GL_ORDER = 2561; + + // Field descriptor #544 I + public static final int GL_DOMAIN = 2562; + + // Field descriptor #544 I + public static final int GL_CURRENT_COLOR = 2816; + + // Field descriptor #544 I + public static final int GL_CURRENT_INDEX = 2817; + + // Field descriptor #544 I + public static final int GL_CURRENT_NORMAL = 2818; + + // Field descriptor #544 I + public static final int GL_CURRENT_TEXTURE_COORDS = 2819; + + // Field descriptor #544 I + public static final int GL_CURRENT_RASTER_COLOR = 2820; + + // Field descriptor #544 I + public static final int GL_CURRENT_RASTER_INDEX = 2821; + + // Field descriptor #544 I + public static final int GL_CURRENT_RASTER_TEXTURE_COORDS = 2822; + + // Field descriptor #544 I + public static final int GL_CURRENT_RASTER_POSITION = 2823; + + // Field descriptor #544 I + public static final int GL_CURRENT_RASTER_POSITION_VALID = 2824; + + // Field descriptor #544 I + public static final int GL_CURRENT_RASTER_DISTANCE = 2825; + + // Field descriptor #544 I + public static final int GL_POINT_SMOOTH = 2832; + + // Field descriptor #544 I + public static final int GL_POINT_SIZE = 2833; + + // Field descriptor #544 I + public static final int GL_POINT_SIZE_RANGE = 2834; + + // Field descriptor #544 I + public static final int GL_POINT_SIZE_GRANULARITY = 2835; + + // Field descriptor #544 I + public static final int GL_LINE_SMOOTH = 2848; + + // Field descriptor #544 I + public static final int GL_LINE_WIDTH = 2849; + + // Field descriptor #544 I + public static final int GL_LINE_WIDTH_RANGE = 2850; + + // Field descriptor #544 I + public static final int GL_LINE_WIDTH_GRANULARITY = 2851; + + // Field descriptor #544 I + public static final int GL_LINE_STIPPLE = 2852; + + // Field descriptor #544 I + public static final int GL_LINE_STIPPLE_PATTERN = 2853; + + // Field descriptor #544 I + public static final int GL_LINE_STIPPLE_REPEAT = 2854; + + // Field descriptor #544 I + public static final int GL_LIST_MODE = 2864; + + // Field descriptor #544 I + public static final int GL_MAX_LIST_NESTING = 2865; + + // Field descriptor #544 I + public static final int GL_LIST_BASE = 2866; + + // Field descriptor #544 I + public static final int GL_LIST_INDEX = 2867; + + // Field descriptor #544 I + public static final int GL_POLYGON_MODE = 2880; + + // Field descriptor #544 I + public static final int GL_POLYGON_SMOOTH = 2881; + + // Field descriptor #544 I + public static final int GL_POLYGON_STIPPLE = 2882; + + // Field descriptor #544 I + public static final int GL_EDGE_FLAG = 2883; + + // Field descriptor #544 I + public static final int GL_CULL_FACE = 2884; + + // Field descriptor #544 I + public static final int GL_CULL_FACE_MODE = 2885; + + // Field descriptor #544 I + public static final int GL_FRONT_FACE = 2886; + + // Field descriptor #544 I + public static final int GL_LIGHTING = 2896; + + // Field descriptor #544 I + public static final int GL_LIGHT_MODEL_LOCAL_VIEWER = 2897; + + // Field descriptor #544 I + public static final int GL_LIGHT_MODEL_TWO_SIDE = 2898; + + // Field descriptor #544 I + public static final int GL_LIGHT_MODEL_AMBIENT = 2899; + + // Field descriptor #544 I + public static final int GL_SHADE_MODEL = 2900; + + // Field descriptor #544 I + public static final int GL_COLOR_MATERIAL_FACE = 2901; + + // Field descriptor #544 I + public static final int GL_COLOR_MATERIAL_PARAMETER = 2902; + + // Field descriptor #544 I + public static final int GL_COLOR_MATERIAL = 2903; + + // Field descriptor #544 I + public static final int GL_FOG = 2912; + + // Field descriptor #544 I + public static final int GL_FOG_INDEX = 2913; + + // Field descriptor #544 I + public static final int GL_FOG_DENSITY = 2914; + + // Field descriptor #544 I + public static final int GL_FOG_START = 2915; + + // Field descriptor #544 I + public static final int GL_FOG_END = 2916; + + // Field descriptor #544 I + public static final int GL_FOG_MODE = 2917; + + // Field descriptor #544 I + public static final int GL_FOG_COLOR = 2918; + + // Field descriptor #544 I + public static final int GL_DEPTH_RANGE = 2928; + + // Field descriptor #544 I + public static final int GL_DEPTH_TEST = 2929; + + // Field descriptor #544 I + public static final int GL_DEPTH_WRITEMASK = 2930; + + // Field descriptor #544 I + public static final int GL_DEPTH_CLEAR_VALUE = 2931; + + // Field descriptor #544 I + public static final int GL_DEPTH_FUNC = 2932; + + // Field descriptor #544 I + public static final int GL_ACCUM_CLEAR_VALUE = 2944; + + // Field descriptor #544 I + public static final int GL_STENCIL_TEST = 2960; + + // Field descriptor #544 I + public static final int GL_STENCIL_CLEAR_VALUE = 2961; + + // Field descriptor #544 I + public static final int GL_STENCIL_FUNC = 2962; + + // Field descriptor #544 I + public static final int GL_STENCIL_VALUE_MASK = 2963; + + // Field descriptor #544 I + public static final int GL_STENCIL_FAIL = 2964; + + // Field descriptor #544 I + public static final int GL_STENCIL_PASS_DEPTH_FAIL = 2965; + + // Field descriptor #544 I + public static final int GL_STENCIL_PASS_DEPTH_PASS = 2966; + + // Field descriptor #544 I + public static final int GL_STENCIL_REF = 2967; + + // Field descriptor #544 I + public static final int GL_STENCIL_WRITEMASK = 2968; + + // Field descriptor #544 I + public static final int GL_MATRIX_MODE = 2976; + + // Field descriptor #544 I + public static final int GL_NORMALIZE = 2977; + + // Field descriptor #544 I + public static final int GL_VIEWPORT = 2978; + + // Field descriptor #544 I + public static final int GL_MODELVIEW_STACK_DEPTH = 2979; + + // Field descriptor #544 I + public static final int GL_PROJECTION_STACK_DEPTH = 2980; + + // Field descriptor #544 I + public static final int GL_TEXTURE_STACK_DEPTH = 2981; + + // Field descriptor #544 I + public static final int GL_MODELVIEW_MATRIX = 2982; + + // Field descriptor #544 I + public static final int GL_PROJECTION_MATRIX = 2983; + + // Field descriptor #544 I + public static final int GL_TEXTURE_MATRIX = 2984; + + // Field descriptor #544 I + public static final int GL_ATTRIB_STACK_DEPTH = 2992; + + // Field descriptor #544 I + public static final int GL_CLIENT_ATTRIB_STACK_DEPTH = 2993; + + // Field descriptor #544 I + public static final int GL_ALPHA_TEST = 3008; + + // Field descriptor #544 I + public static final int GL_ALPHA_TEST_FUNC = 3009; + + // Field descriptor #544 I + public static final int GL_ALPHA_TEST_REF = 3010; + + // Field descriptor #544 I + public static final int GL_DITHER = 3024; + + // Field descriptor #544 I + public static final int GL_BLEND_DST = 3040; + + // Field descriptor #544 I + public static final int GL_BLEND_SRC = 3041; + + // Field descriptor #544 I + public static final int GL_BLEND = 3042; + + // Field descriptor #544 I + public static final int GL_LOGIC_OP_MODE = 3056; + + // Field descriptor #544 I + public static final int GL_INDEX_LOGIC_OP = 3057; + + // Field descriptor #544 I + public static final int GL_COLOR_LOGIC_OP = 3058; + + // Field descriptor #544 I + public static final int GL_AUX_BUFFERS = 3072; + + // Field descriptor #544 I + public static final int GL_DRAW_BUFFER = 3073; + + // Field descriptor #544 I + public static final int GL_READ_BUFFER = 3074; + + // Field descriptor #544 I + public static final int GL_SCISSOR_BOX = 3088; + + // Field descriptor #544 I + public static final int GL_SCISSOR_TEST = 3089; + + // Field descriptor #544 I + public static final int GL_INDEX_CLEAR_VALUE = 3104; + + // Field descriptor #544 I + public static final int GL_INDEX_WRITEMASK = 3105; + + // Field descriptor #544 I + public static final int GL_COLOR_CLEAR_VALUE = 3106; + + // Field descriptor #544 I + public static final int GL_COLOR_WRITEMASK = 3107; + + // Field descriptor #544 I + public static final int GL_INDEX_MODE = 3120; + + // Field descriptor #544 I + public static final int GL_RGBA_MODE = 3121; + + // Field descriptor #544 I + public static final int GL_DOUBLEBUFFER = 3122; + + // Field descriptor #544 I + public static final int GL_STEREO = 3123; + + // Field descriptor #544 I + public static final int GL_RENDER_MODE = 3136; + + // Field descriptor #544 I + public static final int GL_PERSPECTIVE_CORRECTION_HINT = 3152; + + // Field descriptor #544 I + public static final int GL_POINT_SMOOTH_HINT = 3153; + + // Field descriptor #544 I + public static final int GL_LINE_SMOOTH_HINT = 3154; + + // Field descriptor #544 I + public static final int GL_POLYGON_SMOOTH_HINT = 3155; + + // Field descriptor #544 I + public static final int GL_FOG_HINT = 3156; + + // Field descriptor #544 I + public static final int GL_TEXTURE_GEN_S = 3168; + + // Field descriptor #544 I + public static final int GL_TEXTURE_GEN_T = 3169; + + // Field descriptor #544 I + public static final int GL_TEXTURE_GEN_R = 3170; + + // Field descriptor #544 I + public static final int GL_TEXTURE_GEN_Q = 3171; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_I = 3184; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_S_TO_S = 3185; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_R = 3186; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_G = 3187; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_B = 3188; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_A = 3189; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_R_TO_R = 3190; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_G_TO_G = 3191; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_B_TO_B = 3192; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_A_TO_A = 3193; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_I_SIZE = 3248; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_S_TO_S_SIZE = 3249; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_R_SIZE = 3250; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_G_SIZE = 3251; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_B_SIZE = 3252; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_I_TO_A_SIZE = 3253; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_R_TO_R_SIZE = 3254; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_G_TO_G_SIZE = 3255; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_B_TO_B_SIZE = 3256; + + // Field descriptor #544 I + public static final int GL_PIXEL_MAP_A_TO_A_SIZE = 3257; + + // Field descriptor #544 I + public static final int GL_UNPACK_SWAP_BYTES = 3312; + + // Field descriptor #544 I + public static final int GL_UNPACK_LSB_FIRST = 3313; + + // Field descriptor #544 I + public static final int GL_UNPACK_ROW_LENGTH = 3314; + + // Field descriptor #544 I + public static final int GL_UNPACK_SKIP_ROWS = 3315; + + // Field descriptor #544 I + public static final int GL_UNPACK_SKIP_PIXELS = 3316; + + // Field descriptor #544 I + public static final int GL_UNPACK_ALIGNMENT = 3317; + + // Field descriptor #544 I + public static final int GL_PACK_SWAP_BYTES = 3328; + + // Field descriptor #544 I + public static final int GL_PACK_LSB_FIRST = 3329; + + // Field descriptor #544 I + public static final int GL_PACK_ROW_LENGTH = 3330; + + // Field descriptor #544 I + public static final int GL_PACK_SKIP_ROWS = 3331; + + // Field descriptor #544 I + public static final int GL_PACK_SKIP_PIXELS = 3332; + + // Field descriptor #544 I + public static final int GL_PACK_ALIGNMENT = 3333; + + // Field descriptor #544 I + public static final int GL_MAP_COLOR = 3344; + + // Field descriptor #544 I + public static final int GL_MAP_STENCIL = 3345; + + // Field descriptor #544 I + public static final int GL_INDEX_SHIFT = 3346; + + // Field descriptor #544 I + public static final int GL_INDEX_OFFSET = 3347; + + // Field descriptor #544 I + public static final int GL_RED_SCALE = 3348; + + // Field descriptor #544 I + public static final int GL_RED_BIAS = 3349; + + // Field descriptor #544 I + public static final int GL_ZOOM_X = 3350; + + // Field descriptor #544 I + public static final int GL_ZOOM_Y = 3351; + + // Field descriptor #544 I + public static final int GL_GREEN_SCALE = 3352; + + // Field descriptor #544 I + public static final int GL_GREEN_BIAS = 3353; + + // Field descriptor #544 I + public static final int GL_BLUE_SCALE = 3354; + + // Field descriptor #544 I + public static final int GL_BLUE_BIAS = 3355; + + // Field descriptor #544 I + public static final int GL_ALPHA_SCALE = 3356; + + // Field descriptor #544 I + public static final int GL_ALPHA_BIAS = 3357; + + // Field descriptor #544 I + public static final int GL_DEPTH_SCALE = 3358; + + // Field descriptor #544 I + public static final int GL_DEPTH_BIAS = 3359; + + // Field descriptor #544 I + public static final int GL_MAX_EVAL_ORDER = 3376; + + // Field descriptor #544 I + public static final int GL_MAX_LIGHTS = 3377; + + // Field descriptor #544 I + public static final int GL_MAX_CLIP_PLANES = 3378; + + // Field descriptor #544 I + public static final int GL_MAX_TEXTURE_SIZE = 3379; + + // Field descriptor #544 I + public static final int GL_MAX_PIXEL_MAP_TABLE = 3380; + + // Field descriptor #544 I + public static final int GL_MAX_ATTRIB_STACK_DEPTH = 3381; + + // Field descriptor #544 I + public static final int GL_MAX_MODELVIEW_STACK_DEPTH = 3382; + + // Field descriptor #544 I + public static final int GL_MAX_NAME_STACK_DEPTH = 3383; + + // Field descriptor #544 I + public static final int GL_MAX_PROJECTION_STACK_DEPTH = 3384; + + // Field descriptor #544 I + public static final int GL_MAX_TEXTURE_STACK_DEPTH = 3385; + + // Field descriptor #544 I + public static final int GL_MAX_VIEWPORT_DIMS = 3386; + + // Field descriptor #544 I + public static final int GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 3387; + + // Field descriptor #544 I + public static final int GL_SUBPIXEL_BITS = 3408; + + // Field descriptor #544 I + public static final int GL_INDEX_BITS = 3409; + + // Field descriptor #544 I + public static final int GL_RED_BITS = 3410; + + // Field descriptor #544 I + public static final int GL_GREEN_BITS = 3411; + + // Field descriptor #544 I + public static final int GL_BLUE_BITS = 3412; + + // Field descriptor #544 I + public static final int GL_ALPHA_BITS = 3413; + + // Field descriptor #544 I + public static final int GL_DEPTH_BITS = 3414; + + // Field descriptor #544 I + public static final int GL_STENCIL_BITS = 3415; + + // Field descriptor #544 I + public static final int GL_ACCUM_RED_BITS = 3416; + + // Field descriptor #544 I + public static final int GL_ACCUM_GREEN_BITS = 3417; + + // Field descriptor #544 I + public static final int GL_ACCUM_BLUE_BITS = 3418; + + // Field descriptor #544 I + public static final int GL_ACCUM_ALPHA_BITS = 3419; + + // Field descriptor #544 I + public static final int GL_NAME_STACK_DEPTH = 3440; + + // Field descriptor #544 I + public static final int GL_AUTO_NORMAL = 3456; + + // Field descriptor #544 I + public static final int GL_MAP1_COLOR_4 = 3472; + + // Field descriptor #544 I + public static final int GL_MAP1_INDEX = 3473; + + // Field descriptor #544 I + public static final int GL_MAP1_NORMAL = 3474; + + // Field descriptor #544 I + public static final int GL_MAP1_TEXTURE_COORD_1 = 3475; + + // Field descriptor #544 I + public static final int GL_MAP1_TEXTURE_COORD_2 = 3476; + + // Field descriptor #544 I + public static final int GL_MAP1_TEXTURE_COORD_3 = 3477; + + // Field descriptor #544 I + public static final int GL_MAP1_TEXTURE_COORD_4 = 3478; + + // Field descriptor #544 I + public static final int GL_MAP1_VERTEX_3 = 3479; + + // Field descriptor #544 I + public static final int GL_MAP1_VERTEX_4 = 3480; + + // Field descriptor #544 I + public static final int GL_MAP2_COLOR_4 = 3504; + + // Field descriptor #544 I + public static final int GL_MAP2_INDEX = 3505; + + // Field descriptor #544 I + public static final int GL_MAP2_NORMAL = 3506; + + // Field descriptor #544 I + public static final int GL_MAP2_TEXTURE_COORD_1 = 3507; + + // Field descriptor #544 I + public static final int GL_MAP2_TEXTURE_COORD_2 = 3508; + + // Field descriptor #544 I + public static final int GL_MAP2_TEXTURE_COORD_3 = 3509; + + // Field descriptor #544 I + public static final int GL_MAP2_TEXTURE_COORD_4 = 3510; + + // Field descriptor #544 I + public static final int GL_MAP2_VERTEX_3 = 3511; + + // Field descriptor #544 I + public static final int GL_MAP2_VERTEX_4 = 3512; + + // Field descriptor #544 I + public static final int GL_MAP1_GRID_DOMAIN = 3536; + + // Field descriptor #544 I + public static final int GL_MAP1_GRID_SEGMENTS = 3537; + + // Field descriptor #544 I + public static final int GL_MAP2_GRID_DOMAIN = 3538; + + // Field descriptor #544 I + public static final int GL_MAP2_GRID_SEGMENTS = 3539; + + // Field descriptor #544 I + public static final int GL_TEXTURE_1D = 3552; + + // Field descriptor #544 I + public static final int GL_TEXTURE_2D = 3553; + + // Field descriptor #544 I + public static final int GL_FEEDBACK_BUFFER_POINTER = 3568; + + // Field descriptor #544 I + public static final int GL_FEEDBACK_BUFFER_SIZE = 3569; + + // Field descriptor #544 I + public static final int GL_FEEDBACK_BUFFER_TYPE = 3570; + + // Field descriptor #544 I + public static final int GL_SELECTION_BUFFER_POINTER = 3571; + + // Field descriptor #544 I + public static final int GL_SELECTION_BUFFER_SIZE = 3572; + + // Field descriptor #544 I + public static final int GL_TEXTURE_WIDTH = 4096; + + // Field descriptor #544 I + public static final int GL_TEXTURE_HEIGHT = 4097; + + // Field descriptor #544 I + public static final int GL_TEXTURE_INTERNAL_FORMAT = 4099; + + // Field descriptor #544 I + public static final int GL_TEXTURE_BORDER_COLOR = 4100; + + // Field descriptor #544 I + public static final int GL_TEXTURE_BORDER = 4101; + + // Field descriptor #544 I + public static final int GL_DONT_CARE = 4352; + + // Field descriptor #544 I + public static final int GL_FASTEST = 4353; + + // Field descriptor #544 I + public static final int GL_NICEST = 4354; + + // Field descriptor #544 I + public static final int GL_LIGHT0 = 16384; + + // Field descriptor #544 I + public static final int GL_LIGHT1 = 16385; + + // Field descriptor #544 I + public static final int GL_LIGHT2 = 16386; + + // Field descriptor #544 I + public static final int GL_LIGHT3 = 16387; + + // Field descriptor #544 I + public static final int GL_LIGHT4 = 16388; + + // Field descriptor #544 I + public static final int GL_LIGHT5 = 16389; + + // Field descriptor #544 I + public static final int GL_LIGHT6 = 16390; + + // Field descriptor #544 I + public static final int GL_LIGHT7 = 16391; + + // Field descriptor #544 I + public static final int GL_AMBIENT = 4608; + + // Field descriptor #544 I + public static final int GL_DIFFUSE = 4609; + + // Field descriptor #544 I + public static final int GL_SPECULAR = 4610; + + // Field descriptor #544 I + public static final int GL_POSITION = 4611; + + // Field descriptor #544 I + public static final int GL_SPOT_DIRECTION = 4612; + + // Field descriptor #544 I + public static final int GL_SPOT_EXPONENT = 4613; + + // Field descriptor #544 I + public static final int GL_SPOT_CUTOFF = 4614; + + // Field descriptor #544 I + public static final int GL_CONSTANT_ATTENUATION = 4615; + + // Field descriptor #544 I + public static final int GL_LINEAR_ATTENUATION = 4616; + + // Field descriptor #544 I + public static final int GL_QUADRATIC_ATTENUATION = 4617; + + // Field descriptor #544 I + public static final int GL_COMPILE = 4864; + + // Field descriptor #544 I + public static final int GL_COMPILE_AND_EXECUTE = 4865; + + // Field descriptor #544 I + public static final int GL_CLEAR = 5376; + + // Field descriptor #544 I + public static final int GL_AND = 5377; + + // Field descriptor #544 I + public static final int GL_AND_REVERSE = 5378; + + // Field descriptor #544 I + public static final int GL_COPY = 5379; + + // Field descriptor #544 I + public static final int GL_AND_INVERTED = 5380; + + // Field descriptor #544 I + public static final int GL_NOOP = 5381; + + // Field descriptor #544 I + public static final int GL_XOR = 5382; + + // Field descriptor #544 I + public static final int GL_OR = 5383; + + // Field descriptor #544 I + public static final int GL_NOR = 5384; + + // Field descriptor #544 I + public static final int GL_EQUIV = 5385; + + // Field descriptor #544 I + public static final int GL_INVERT = 5386; + + // Field descriptor #544 I + public static final int GL_OR_REVERSE = 5387; + + // Field descriptor #544 I + public static final int GL_COPY_INVERTED = 5388; + + // Field descriptor #544 I + public static final int GL_OR_INVERTED = 5389; + + // Field descriptor #544 I + public static final int GL_NAND = 5390; + + // Field descriptor #544 I + public static final int GL_SET = 5391; + + // Field descriptor #544 I + public static final int GL_EMISSION = 5632; + + // Field descriptor #544 I + public static final int GL_SHININESS = 5633; + + // Field descriptor #544 I + public static final int GL_AMBIENT_AND_DIFFUSE = 5634; + + // Field descriptor #544 I + public static final int GL_COLOR_INDEXES = 5635; + + // Field descriptor #544 I + public static final int GL_MODELVIEW = 5888; + + // Field descriptor #544 I + public static final int GL_PROJECTION = 5889; + + // Field descriptor #544 I + public static final int GL_TEXTURE = 5890; + + // Field descriptor #544 I + public static final int GL_COLOR = 6144; + + // Field descriptor #544 I + public static final int GL_DEPTH = 6145; + + // Field descriptor #544 I + public static final int GL_STENCIL = 6146; + + // Field descriptor #544 I + public static final int GL_COLOR_INDEX = 6400; + + // Field descriptor #544 I + public static final int GL_STENCIL_INDEX = 6401; + + // Field descriptor #544 I + public static final int GL_DEPTH_COMPONENT = 6402; + + // Field descriptor #544 I + public static final int GL_RED = 6403; + + // Field descriptor #544 I + public static final int GL_GREEN = 6404; + + // Field descriptor #544 I + public static final int GL_BLUE = 6405; + + // Field descriptor #544 I + public static final int GL_ALPHA = 6406; + + // Field descriptor #544 I + public static final int GL_RGB = 6407; + + // Field descriptor #544 I + public static final int GL_RGBA = 6408; + + // Field descriptor #544 I + public static final int GL_LUMINANCE = 6409; + + // Field descriptor #544 I + public static final int GL_LUMINANCE_ALPHA = 6410; + + // Field descriptor #544 I + public static final int GL_BITMAP = 6656; + + // Field descriptor #544 I + public static final int GL_POINT = 6912; + + // Field descriptor #544 I + public static final int GL_LINE = 6913; + + // Field descriptor #544 I + public static final int GL_FILL = 6914; + + // Field descriptor #544 I + public static final int GL_RENDER = 7168; + + // Field descriptor #544 I + public static final int GL_FEEDBACK = 7169; + + // Field descriptor #544 I + public static final int GL_SELECT = 7170; + + // Field descriptor #544 I + public static final int GL_FLAT = 7424; + + // Field descriptor #544 I + public static final int GL_SMOOTH = 7425; + + // Field descriptor #544 I + public static final int GL_KEEP = 7680; + + // Field descriptor #544 I + public static final int GL_REPLACE = 7681; + + // Field descriptor #544 I + public static final int GL_INCR = 7682; + + // Field descriptor #544 I + public static final int GL_DECR = 7683; + + // Field descriptor #544 I + public static final int GL_VENDOR = 7936; + + // Field descriptor #544 I + public static final int GL_RENDERER = 7937; + + // Field descriptor #544 I + public static final int GL_VERSION = 7938; + + // Field descriptor #544 I + public static final int GL_EXTENSIONS = 7939; + + // Field descriptor #544 I + public static final int GL_S = 8192; + + // Field descriptor #544 I + public static final int GL_T = 8193; + + // Field descriptor #544 I + public static final int GL_R = 8194; + + // Field descriptor #544 I + public static final int GL_Q = 8195; + + // Field descriptor #544 I + public static final int GL_MODULATE = 8448; + + // Field descriptor #544 I + public static final int GL_DECAL = 8449; + + // Field descriptor #544 I + public static final int GL_TEXTURE_ENV_MODE = 8704; + + // Field descriptor #544 I + public static final int GL_TEXTURE_ENV_COLOR = 8705; + + // Field descriptor #544 I + public static final int GL_TEXTURE_ENV = 8960; + + // Field descriptor #544 I + public static final int GL_EYE_LINEAR = 9216; + + // Field descriptor #544 I + public static final int GL_OBJECT_LINEAR = 9217; + + // Field descriptor #544 I + public static final int GL_SPHERE_MAP = 9218; + + // Field descriptor #544 I + public static final int GL_TEXTURE_GEN_MODE = 9472; + + // Field descriptor #544 I + public static final int GL_OBJECT_PLANE = 9473; + + // Field descriptor #544 I + public static final int GL_EYE_PLANE = 9474; + + // Field descriptor #544 I + public static final int GL_NEAREST = 9728; + + // Field descriptor #544 I + public static final int GL_LINEAR = 9729; + + // Field descriptor #544 I + public static final int GL_NEAREST_MIPMAP_NEAREST = 9984; + + // Field descriptor #544 I + public static final int GL_LINEAR_MIPMAP_NEAREST = 9985; + + // Field descriptor #544 I + public static final int GL_NEAREST_MIPMAP_LINEAR = 9986; + + // Field descriptor #544 I + public static final int GL_LINEAR_MIPMAP_LINEAR = 9987; + + // Field descriptor #544 I + public static final int GL_TEXTURE_MAG_FILTER = 10240; + + // Field descriptor #544 I + public static final int GL_TEXTURE_MIN_FILTER = 10241; + + // Field descriptor #544 I + public static final int GL_TEXTURE_WRAP_S = 10242; + + // Field descriptor #544 I + public static final int GL_TEXTURE_WRAP_T = 10243; + + // Field descriptor #544 I + public static final int GL_CLAMP = 10496; + + // Field descriptor #544 I + public static final int GL_REPEAT = 10497; + + // Field descriptor #544 I + public static final int GL_CLIENT_PIXEL_STORE_BIT = 1; + + // Field descriptor #544 I + public static final int GL_CLIENT_VERTEX_ARRAY_BIT = 2; + + // Field descriptor #544 I + public static final int GL_ALL_CLIENT_ATTRIB_BITS = -1; + + // Field descriptor #544 I + public static final int GL_POLYGON_OFFSET_FACTOR = 32824; + + // Field descriptor #544 I + public static final int GL_POLYGON_OFFSET_UNITS = 10752; + + // Field descriptor #544 I + public static final int GL_POLYGON_OFFSET_POINT = 10753; + + // Field descriptor #544 I + public static final int GL_POLYGON_OFFSET_LINE = 10754; + + // Field descriptor #544 I + public static final int GL_POLYGON_OFFSET_FILL = 32823; + + // Field descriptor #544 I + public static final int GL_ALPHA4 = 32827; + + // Field descriptor #544 I + public static final int GL_ALPHA8 = 32828; + + // Field descriptor #544 I + public static final int GL_ALPHA12 = 32829; + + // Field descriptor #544 I + public static final int GL_ALPHA16 = 32830; + + // Field descriptor #544 I + public static final int GL_LUMINANCE4 = 32831; + + // Field descriptor #544 I + public static final int GL_LUMINANCE8 = 32832; + + // Field descriptor #544 I + public static final int GL_LUMINANCE12 = 32833; + + // Field descriptor #544 I + public static final int GL_LUMINANCE16 = 32834; + + // Field descriptor #544 I + public static final int GL_LUMINANCE4_ALPHA4 = 32835; + + // Field descriptor #544 I + public static final int GL_LUMINANCE6_ALPHA2 = 32836; + + // Field descriptor #544 I + public static final int GL_LUMINANCE8_ALPHA8 = 32837; + + // Field descriptor #544 I + public static final int GL_LUMINANCE12_ALPHA4 = 32838; + + // Field descriptor #544 I + public static final int GL_LUMINANCE12_ALPHA12 = 32839; + + // Field descriptor #544 I + public static final int GL_LUMINANCE16_ALPHA16 = 32840; + + // Field descriptor #544 I + public static final int GL_INTENSITY = 32841; + + // Field descriptor #544 I + public static final int GL_INTENSITY4 = 32842; + + // Field descriptor #544 I + public static final int GL_INTENSITY8 = 32843; + + // Field descriptor #544 I + public static final int GL_INTENSITY12 = 32844; + + // Field descriptor #544 I + public static final int GL_INTENSITY16 = 32845; + + // Field descriptor #544 I + public static final int GL_R3_G3_B2 = 10768; + + // Field descriptor #544 I + public static final int GL_RGB4 = 32847; + + // Field descriptor #544 I + public static final int GL_RGB5 = 32848; + + // Field descriptor #544 I + public static final int GL_RGB8 = 32849; + + // Field descriptor #544 I + public static final int GL_RGB10 = 32850; + + // Field descriptor #544 I + public static final int GL_RGB12 = 32851; + + // Field descriptor #544 I + public static final int GL_RGB16 = 32852; + + // Field descriptor #544 I + public static final int GL_RGBA2 = 32853; + + // Field descriptor #544 I + public static final int GL_RGBA4 = 32854; + + // Field descriptor #544 I + public static final int GL_RGB5_A1 = 32855; + + // Field descriptor #544 I + public static final int GL_RGBA8 = 32856; + + // Field descriptor #544 I + public static final int GL_RGB10_A2 = 32857; + + // Field descriptor #544 I + public static final int GL_RGBA12 = 32858; + + // Field descriptor #544 I + public static final int GL_RGBA16 = 32859; + + // Field descriptor #544 I + public static final int GL_TEXTURE_RED_SIZE = 32860; + + // Field descriptor #544 I + public static final int GL_TEXTURE_GREEN_SIZE = 32861; + + // Field descriptor #544 I + public static final int GL_TEXTURE_BLUE_SIZE = 32862; + + // Field descriptor #544 I + public static final int GL_TEXTURE_ALPHA_SIZE = 32863; + + // Field descriptor #544 I + public static final int GL_TEXTURE_LUMINANCE_SIZE = 32864; + + // Field descriptor #544 I + public static final int GL_TEXTURE_INTENSITY_SIZE = 32865; + + // Field descriptor #544 I + public static final int GL_PROXY_TEXTURE_1D = 32867; + + // Field descriptor #544 I + public static final int GL_PROXY_TEXTURE_2D = 32868; + + // Field descriptor #544 I + public static final int GL_TEXTURE_PRIORITY = 32870; + + // Field descriptor #544 I + public static final int GL_TEXTURE_RESIDENT = 32871; + + // Field descriptor #544 I + public static final int GL_TEXTURE_BINDING_1D = 32872; + + // Field descriptor #544 I + public static final int GL_TEXTURE_BINDING_2D = 32873; + + // Field descriptor #544 I + public static final int GL_VERTEX_ARRAY = 32884; + + // Field descriptor #544 I + public static final int GL_NORMAL_ARRAY = 32885; + + // Field descriptor #544 I + public static final int GL_COLOR_ARRAY = 32886; + + // Field descriptor #544 I + public static final int GL_INDEX_ARRAY = 32887; + + // Field descriptor #544 I + public static final int GL_TEXTURE_COORD_ARRAY = 32888; + + // Field descriptor #544 I + public static final int GL_EDGE_FLAG_ARRAY = 32889; + + // Field descriptor #544 I + public static final int GL_VERTEX_ARRAY_SIZE = 32890; + + // Field descriptor #544 I + public static final int GL_VERTEX_ARRAY_TYPE = 32891; + + // Field descriptor #544 I + public static final int GL_VERTEX_ARRAY_STRIDE = 32892; + + // Field descriptor #544 I + public static final int GL_NORMAL_ARRAY_TYPE = 32894; + + // Field descriptor #544 I + public static final int GL_NORMAL_ARRAY_STRIDE = 32895; + + // Field descriptor #544 I + public static final int GL_COLOR_ARRAY_SIZE = 32897; + + // Field descriptor #544 I + public static final int GL_COLOR_ARRAY_TYPE = 32898; + + // Field descriptor #544 I + public static final int GL_COLOR_ARRAY_STRIDE = 32899; + + // Field descriptor #544 I + public static final int GL_INDEX_ARRAY_TYPE = 32901; + + // Field descriptor #544 I + public static final int GL_INDEX_ARRAY_STRIDE = 32902; + + // Field descriptor #544 I + public static final int GL_TEXTURE_COORD_ARRAY_SIZE = 32904; + + // Field descriptor #544 I + public static final int GL_TEXTURE_COORD_ARRAY_TYPE = 32905; + + // Field descriptor #544 I + public static final int GL_TEXTURE_COORD_ARRAY_STRIDE = 32906; + + // Field descriptor #544 I + public static final int GL_EDGE_FLAG_ARRAY_STRIDE = 32908; + + // Field descriptor #544 I + public static final int GL_VERTEX_ARRAY_POINTER = 32910; + + // Field descriptor #544 I + public static final int GL_NORMAL_ARRAY_POINTER = 32911; + + // Field descriptor #544 I + public static final int GL_COLOR_ARRAY_POINTER = 32912; + + // Field descriptor #544 I + public static final int GL_INDEX_ARRAY_POINTER = 32913; + + // Field descriptor #544 I + public static final int GL_TEXTURE_COORD_ARRAY_POINTER = 32914; + + // Field descriptor #544 I + public static final int GL_EDGE_FLAG_ARRAY_POINTER = 32915; + + // Field descriptor #544 I + public static final int GL_V2F = 10784; + + // Field descriptor #544 I + public static final int GL_V3F = 10785; + + // Field descriptor #544 I + public static final int GL_C4UB_V2F = 10786; + + // Field descriptor #544 I + public static final int GL_C4UB_V3F = 10787; + + // Field descriptor #544 I + public static final int GL_C3F_V3F = 10788; + + // Field descriptor #544 I + public static final int GL_N3F_V3F = 10789; + + // Field descriptor #544 I + public static final int GL_C4F_N3F_V3F = 10790; + + // Field descriptor #544 I + public static final int GL_T2F_V3F = 10791; + + // Field descriptor #544 I + public static final int GL_T4F_V4F = 10792; + + // Field descriptor #544 I + public static final int GL_T2F_C4UB_V3F = 10793; + + // Field descriptor #544 I + public static final int GL_T2F_C3F_V3F = 10794; + + // Field descriptor #544 I + public static final int GL_T2F_N3F_V3F = 10795; + + // Field descriptor #544 I + public static final int GL_T2F_C4F_N3F_V3F = 10796; + + // Field descriptor #544 I + public static final int GL_T4F_C4F_N3F_V4F = 10797; + + // Field descriptor #544 I + public static final int GL_LOGIC_OP = 3057; + + // Field descriptor #544 I + public static final int GL_TEXTURE_COMPONENTS = 4099; + + // Field descriptor #45 I + public static final int GL_TEXTURE_BINDING_3D = 32874; + + // Field descriptor #45 I + public static final int GL_PACK_SKIP_IMAGES = 32875; + + // Field descriptor #45 I + public static final int GL_PACK_IMAGE_HEIGHT = 32876; + + // Field descriptor #45 I + public static final int GL_UNPACK_SKIP_IMAGES = 32877; + + // Field descriptor #45 I + public static final int GL_UNPACK_IMAGE_HEIGHT = 32878; + + // Field descriptor #45 I + public static final int GL_TEXTURE_3D = 32879; + + // Field descriptor #45 I + public static final int GL_PROXY_TEXTURE_3D = 32880; + + // Field descriptor #45 I + public static final int GL_TEXTURE_DEPTH = 32881; + + // Field descriptor #45 I + public static final int GL_TEXTURE_WRAP_R = 32882; + + // Field descriptor #45 I + public static final int GL_MAX_3D_TEXTURE_SIZE = 32883; + + // Field descriptor #45 I + public static final int GL_BGR = 32992; + + // Field descriptor #45 I + public static final int GL_BGRA = 32993; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_BYTE_3_3_2 = 32818; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_BYTE_2_3_3_REV = 33634; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_SHORT_5_6_5 = 33635; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_SHORT_5_6_5_REV = 33636; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 32819; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_SHORT_4_4_4_4_REV = 33637; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 32820; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_SHORT_1_5_5_5_REV = 33638; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_INT_8_8_8_8 = 32821; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_INT_8_8_8_8_REV = 33639; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_INT_10_10_10_2 = 32822; + + // Field descriptor #45 I + public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 33640; + + // Field descriptor #45 I + public static final int GL_RESCALE_NORMAL = 32826; + + // Field descriptor #45 I + public static final int GL_LIGHT_MODEL_COLOR_CONTROL = 33272; + + // Field descriptor #45 I + public static final int GL_SINGLE_COLOR = 33273; + + // Field descriptor #45 I + public static final int GL_SEPARATE_SPECULAR_COLOR = 33274; + + // Field descriptor #45 I + public static final int GL_CLAMP_TO_EDGE = 33071; + + // Field descriptor #45 I + public static final int GL_TEXTURE_MIN_LOD = 33082; + + // Field descriptor #45 I + public static final int GL_TEXTURE_MAX_LOD = 33083; + + // Field descriptor #45 I + public static final int GL_TEXTURE_BASE_LEVEL = 33084; + + // Field descriptor #45 I + public static final int GL_TEXTURE_MAX_LEVEL = 33085; + + // Field descriptor #45 I + public static final int GL_MAX_ELEMENTS_VERTICES = 33000; + + // Field descriptor #45 I + public static final int GL_MAX_ELEMENTS_INDICES = 33001; + + // Field descriptor #45 I + public static final int GL_ALIASED_POINT_SIZE_RANGE = 33901; + + // Field descriptor #45 I + public static final int GL_ALIASED_LINE_WIDTH_RANGE = 33902; + + // Field descriptor #45 I + public static final int GL_SMOOTH_POINT_SIZE_RANGE = 2834; + + // Field descriptor #45 I + public static final int GL_SMOOTH_POINT_SIZE_GRANULARITY = 2835; + + // Field descriptor #45 I + public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 2850; + + // Field descriptor #45 I + public static final int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 2851; + + // Field descriptor #76 I + public static final int GL_TEXTURE0 = 33984; + + // Field descriptor #76 I + public static final int GL_TEXTURE1 = 33985; + + // Field descriptor #76 I + public static final int GL_TEXTURE2 = 33986; + + // Field descriptor #76 I + public static final int GL_TEXTURE3 = 33987; + + // Field descriptor #76 I + public static final int GL_TEXTURE4 = 33988; + + // Field descriptor #76 I + public static final int GL_TEXTURE5 = 33989; + + // Field descriptor #76 I + public static final int GL_TEXTURE6 = 33990; + + // Field descriptor #76 I + public static final int GL_TEXTURE7 = 33991; + + // Field descriptor #76 I + public static final int GL_TEXTURE8 = 33992; + + // Field descriptor #76 I + public static final int GL_TEXTURE9 = 33993; + + // Field descriptor #76 I + public static final int GL_TEXTURE10 = 33994; + + // Field descriptor #76 I + public static final int GL_TEXTURE11 = 33995; + + // Field descriptor #76 I + public static final int GL_TEXTURE12 = 33996; + + // Field descriptor #76 I + public static final int GL_TEXTURE13 = 33997; + + // Field descriptor #76 I + public static final int GL_TEXTURE14 = 33998; + + // Field descriptor #76 I + public static final int GL_TEXTURE15 = 33999; + + // Field descriptor #76 I + public static final int GL_TEXTURE16 = 34000; + + // Field descriptor #76 I + public static final int GL_TEXTURE17 = 34001; + + // Field descriptor #76 I + public static final int GL_TEXTURE18 = 34002; + + // Field descriptor #76 I + public static final int GL_TEXTURE19 = 34003; + + // Field descriptor #76 I + public static final int GL_TEXTURE20 = 34004; + + // Field descriptor #76 I + public static final int GL_TEXTURE21 = 34005; + + // Field descriptor #76 I + public static final int GL_TEXTURE22 = 34006; + + // Field descriptor #76 I + public static final int GL_TEXTURE23 = 34007; + + // Field descriptor #76 I + public static final int GL_TEXTURE24 = 34008; + + // Field descriptor #76 I + public static final int GL_TEXTURE25 = 34009; + + // Field descriptor #76 I + public static final int GL_TEXTURE26 = 34010; + + // Field descriptor #76 I + public static final int GL_TEXTURE27 = 34011; + + // Field descriptor #76 I + public static final int GL_TEXTURE28 = 34012; + + // Field descriptor #76 I + public static final int GL_TEXTURE29 = 34013; + + // Field descriptor #76 I + public static final int GL_TEXTURE30 = 34014; + + // Field descriptor #76 I + public static final int GL_TEXTURE31 = 34015; + + // Field descriptor #76 I + public static final int GL_ACTIVE_TEXTURE = 34016; + + // Field descriptor #76 I + public static final int GL_CLIENT_ACTIVE_TEXTURE = 34017; + + // Field descriptor #76 I + public static final int GL_MAX_TEXTURE_UNITS = 34018; + + // Field descriptor #76 I + public static final int GL_NORMAL_MAP = 34065; + + // Field descriptor #76 I + public static final int GL_REFLECTION_MAP = 34066; + + // Field descriptor #76 I + public static final int GL_TEXTURE_CUBE_MAP = 34067; + + // Field descriptor #76 I + public static final int GL_TEXTURE_BINDING_CUBE_MAP = 34068; + + // Field descriptor #76 I + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 34069; + + // Field descriptor #76 I + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 34070; + + // Field descriptor #76 I + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 34071; + + // Field descriptor #76 I + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072; + + // Field descriptor #76 I + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 34073; + + // Field descriptor #76 I + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074; + + // Field descriptor #76 I + public static final int GL_PROXY_TEXTURE_CUBE_MAP = 34075; + + // Field descriptor #76 I + public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 34076; + + // Field descriptor #76 I + public static final int GL_COMPRESSED_ALPHA = 34025; + + // Field descriptor #76 I + public static final int GL_COMPRESSED_LUMINANCE = 34026; + + // Field descriptor #76 I + public static final int GL_COMPRESSED_LUMINANCE_ALPHA = 34027; + + // Field descriptor #76 I + public static final int GL_COMPRESSED_INTENSITY = 34028; + + // Field descriptor #76 I + public static final int GL_COMPRESSED_RGB = 34029; + + // Field descriptor #76 I + public static final int GL_COMPRESSED_RGBA = 34030; + + // Field descriptor #76 I + public static final int GL_TEXTURE_COMPRESSION_HINT = 34031; + + // Field descriptor #76 I + public static final int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 34464; + + // Field descriptor #76 I + public static final int GL_TEXTURE_COMPRESSED = 34465; + + // Field descriptor #76 I + public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 34466; + + // Field descriptor #76 I + public static final int GL_COMPRESSED_TEXTURE_FORMATS = 34467; + + // Field descriptor #76 I + public static final int GL_MULTISAMPLE = 32925; + + // Field descriptor #76 I + public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 32926; + + // Field descriptor #76 I + public static final int GL_SAMPLE_ALPHA_TO_ONE = 32927; + + // Field descriptor #76 I + public static final int GL_SAMPLE_COVERAGE = 32928; + + // Field descriptor #76 I + public static final int GL_SAMPLE_BUFFERS = 32936; + + // Field descriptor #76 I + public static final int GL_SAMPLES = 32937; + + // Field descriptor #76 I + public static final int GL_SAMPLE_COVERAGE_VALUE = 32938; + + // Field descriptor #76 I + public static final int GL_SAMPLE_COVERAGE_INVERT = 32939; + + // Field descriptor #76 I + public static final int GL_MULTISAMPLE_BIT = 536870912; + + // Field descriptor #76 I + public static final int GL_TRANSPOSE_MODELVIEW_MATRIX = 34019; + + // Field descriptor #76 I + public static final int GL_TRANSPOSE_PROJECTION_MATRIX = 34020; + + // Field descriptor #76 I + public static final int GL_TRANSPOSE_TEXTURE_MATRIX = 34021; + + // Field descriptor #76 I + public static final int GL_TRANSPOSE_COLOR_MATRIX = 34022; + + // Field descriptor #76 I + public static final int GL_COMBINE = 34160; + + // Field descriptor #76 I + public static final int GL_COMBINE_RGB = 34161; + + // Field descriptor #76 I + public static final int GL_COMBINE_ALPHA = 34162; + + // Field descriptor #76 I + public static final int GL_SOURCE0_RGB = 34176; + + // Field descriptor #76 I + public static final int GL_SOURCE1_RGB = 34177; + + // Field descriptor #76 I + public static final int GL_SOURCE2_RGB = 34178; + + // Field descriptor #76 I + public static final int GL_SOURCE0_ALPHA = 34184; + + // Field descriptor #76 I + public static final int GL_SOURCE1_ALPHA = 34185; + + // Field descriptor #76 I + public static final int GL_SOURCE2_ALPHA = 34186; + + // Field descriptor #76 I + public static final int GL_OPERAND0_RGB = 34192; + + // Field descriptor #76 I + public static final int GL_OPERAND1_RGB = 34193; + + // Field descriptor #76 I + public static final int GL_OPERAND2_RGB = 34194; + + // Field descriptor #76 I + public static final int GL_OPERAND0_ALPHA = 34200; + + // Field descriptor #76 I + public static final int GL_OPERAND1_ALPHA = 34201; + + // Field descriptor #76 I + public static final int GL_OPERAND2_ALPHA = 34202; + + // Field descriptor #76 I + public static final int GL_RGB_SCALE = 34163; + + // Field descriptor #76 I + public static final int GL_ADD_SIGNED = 34164; + + // Field descriptor #76 I + public static final int GL_INTERPOLATE = 34165; + + // Field descriptor #76 I + public static final int GL_SUBTRACT = 34023; + + // Field descriptor #76 I + public static final int GL_CONSTANT = 34166; + + // Field descriptor #76 I + public static final int GL_PRIMARY_COLOR = 34167; + + // Field descriptor #76 I + public static final int GL_PREVIOUS = 34168; + + // Field descriptor #76 I + public static final int GL_DOT3_RGB = 34478; + + // Field descriptor #76 I + public static final int GL_DOT3_RGBA = 34479; + + // Field descriptor #76 I + public static final int GL_CLAMP_TO_BORDER = 33069; + + // Field descriptor #71 I + public static final int GL_ARRAY_BUFFER = 34962; + + // Field descriptor #71 I + public static final int GL_ELEMENT_ARRAY_BUFFER = 34963; + + // Field descriptor #71 I + public static final int GL_ARRAY_BUFFER_BINDING = 34964; + + // Field descriptor #71 I + public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 34965; + + // Field descriptor #71 I + public static final int GL_VERTEX_ARRAY_BUFFER_BINDING = 34966; + + // Field descriptor #71 I + public static final int GL_NORMAL_ARRAY_BUFFER_BINDING = 34967; + + // Field descriptor #71 I + public static final int GL_COLOR_ARRAY_BUFFER_BINDING = 34968; + + // Field descriptor #71 I + public static final int GL_INDEX_ARRAY_BUFFER_BINDING = 34969; + + // Field descriptor #71 I + public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 34970; + + // Field descriptor #71 I + public static final int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = 34971; + + // Field descriptor #71 I + public static final int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 34972; + + // Field descriptor #71 I + public static final int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 34973; + + // Field descriptor #71 I + public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING = 34974; + + // Field descriptor #71 I + public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975; + + // Field descriptor #71 I + public static final int GL_STREAM_DRAW = 35040; + + // Field descriptor #71 I + public static final int GL_STREAM_READ = 35041; + + // Field descriptor #71 I + public static final int GL_STREAM_COPY = 35042; + + // Field descriptor #71 I + public static final int GL_STATIC_DRAW = 35044; + + // Field descriptor #71 I + public static final int GL_STATIC_READ = 35045; + + // Field descriptor #71 I + public static final int GL_STATIC_COPY = 35046; + + // Field descriptor #71 I + public static final int GL_DYNAMIC_DRAW = 35048; + + // Field descriptor #71 I + public static final int GL_DYNAMIC_READ = 35049; + + // Field descriptor #71 I + public static final int GL_DYNAMIC_COPY = 35050; + + // Field descriptor #71 I + public static final int GL_READ_ONLY = 35000; + + // Field descriptor #71 I + public static final int GL_WRITE_ONLY = 35001; + + // Field descriptor #71 I + public static final int GL_READ_WRITE = 35002; + + // Field descriptor #71 I + public static final int GL_BUFFER_SIZE = 34660; + + // Field descriptor #71 I + public static final int GL_BUFFER_USAGE = 34661; + + // Field descriptor #71 I + public static final int GL_BUFFER_ACCESS = 35003; + + // Field descriptor #71 I + public static final int GL_BUFFER_MAPPED = 35004; + + // Field descriptor #71 I + public static final int GL_BUFFER_MAP_POINTER = 35005; + + // Field descriptor #71 I + public static final int GL_FOG_COORD_SRC = 33872; + + // Field descriptor #71 I + public static final int GL_FOG_COORD = 33873; + + // Field descriptor #71 I + public static final int GL_CURRENT_FOG_COORD = 33875; + + // Field descriptor #71 I + public static final int GL_FOG_COORD_ARRAY_TYPE = 33876; + + // Field descriptor #71 I + public static final int GL_FOG_COORD_ARRAY_STRIDE = 33877; + + // Field descriptor #71 I + public static final int GL_FOG_COORD_ARRAY_POINTER = 33878; + + // Field descriptor #71 I + public static final int GL_FOG_COORD_ARRAY = 33879; + + // Field descriptor #71 I + public static final int GL_FOG_COORD_ARRAY_BUFFER_BINDING = 34973; + + // Field descriptor #71 I + public static final int GL_SRC0_RGB = 34176; + + // Field descriptor #71 I + public static final int GL_SRC1_RGB = 34177; + + // Field descriptor #71 I + public static final int GL_SRC2_RGB = 34178; + + // Field descriptor #71 I + public static final int GL_SRC0_ALPHA = 34184; + + // Field descriptor #71 I + public static final int GL_SRC1_ALPHA = 34185; + + // Field descriptor #71 I + public static final int GL_SRC2_ALPHA = 34186; + + // Field descriptor #71 I + public static final int GL_SAMPLES_PASSED = 35092; + + // Field descriptor #71 I + public static final int GL_QUERY_COUNTER_BITS = 34916; + + // Field descriptor #71 I + public static final int GL_CURRENT_QUERY = 34917; + + // Field descriptor #71 I + public static final int GL_QUERY_RESULT = 34918; + + // Field descriptor #71 I + public static final int GL_QUERY_RESULT_AVAILABLE = 34919; + + // Field descriptor #194 I + public static final int GL_SHADING_LANGUAGE_VERSION = 35724; + + // Field descriptor #194 I + public static final int GL_CURRENT_PROGRAM = 35725; + + // Field descriptor #194 I + public static final int GL_SHADER_TYPE = 35663; + + // Field descriptor #194 I + public static final int GL_DELETE_STATUS = 35712; + + // Field descriptor #194 I + public static final int GL_COMPILE_STATUS = 35713; + + // Field descriptor #194 I + public static final int GL_LINK_STATUS = 35714; + + // Field descriptor #194 I + public static final int GL_VALIDATE_STATUS = 35715; + + // Field descriptor #194 I + public static final int GL_INFO_LOG_LENGTH = 35716; + + // Field descriptor #194 I + public static final int GL_ATTACHED_SHADERS = 35717; + + // Field descriptor #194 I + public static final int GL_ACTIVE_UNIFORMS = 35718; + + // Field descriptor #194 I + public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 35719; + + // Field descriptor #194 I + public static final int GL_ACTIVE_ATTRIBUTES = 35721; + + // Field descriptor #194 I + public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 35722; + + // Field descriptor #194 I + public static final int GL_SHADER_SOURCE_LENGTH = 35720; + + // Field descriptor #194 I + public static final int GL_SHADER_OBJECT = 35656; + + // Field descriptor #194 I + public static final int GL_FLOAT_VEC2 = 35664; + + // Field descriptor #194 I + public static final int GL_FLOAT_VEC3 = 35665; + + // Field descriptor #194 I + public static final int GL_FLOAT_VEC4 = 35666; + + // Field descriptor #194 I + public static final int GL_INT_VEC2 = 35667; + + // Field descriptor #194 I + public static final int GL_INT_VEC3 = 35668; + + // Field descriptor #194 I + public static final int GL_INT_VEC4 = 35669; + + // Field descriptor #194 I + public static final int GL_BOOL = 35670; + + // Field descriptor #194 I + public static final int GL_BOOL_VEC2 = 35671; + + // Field descriptor #194 I + public static final int GL_BOOL_VEC3 = 35672; + + // Field descriptor #194 I + public static final int GL_BOOL_VEC4 = 35673; + + // Field descriptor #194 I + public static final int GL_FLOAT_MAT2 = 35674; + + // Field descriptor #194 I + public static final int GL_FLOAT_MAT3 = 35675; + + // Field descriptor #194 I + public static final int GL_FLOAT_MAT4 = 35676; + + // Field descriptor #194 I + public static final int GL_SAMPLER_1D = 35677; + + // Field descriptor #194 I + public static final int GL_SAMPLER_2D = 35678; + + // Field descriptor #194 I + public static final int GL_SAMPLER_3D = 35679; + + // Field descriptor #194 I + public static final int GL_SAMPLER_CUBE = 35680; + + // Field descriptor #194 I + public static final int GL_SAMPLER_1D_SHADOW = 35681; + + // Field descriptor #194 I + public static final int GL_SAMPLER_2D_SHADOW = 35682; + + // Field descriptor #194 I + public static final int GL_VERTEX_SHADER = 35633; + + // Field descriptor #194 I + public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 35658; + + // Field descriptor #194 I + public static final int GL_MAX_VARYING_FLOATS = 35659; + + // Field descriptor #194 I + public static final int GL_MAX_VERTEX_ATTRIBS = 34921; + + // Field descriptor #194 I + public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 34930; + + // Field descriptor #194 I + public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660; + + // Field descriptor #194 I + public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661; + + // Field descriptor #194 I + public static final int GL_MAX_TEXTURE_COORDS = 34929; + + // Field descriptor #194 I + public static final int GL_VERTEX_PROGRAM_POINT_SIZE = 34370; + + // Field descriptor #194 I + public static final int GL_VERTEX_PROGRAM_TWO_SIDE = 34371; + + // Field descriptor #194 I + public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 34338; + + // Field descriptor #194 I + public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 34339; + + // Field descriptor #194 I + public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 34340; + + // Field descriptor #194 I + public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 34341; + + // Field descriptor #194 I + public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922; + + // Field descriptor #194 I + public static final int GL_CURRENT_VERTEX_ATTRIB = 34342; + + // Field descriptor #194 I + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 34373; + + // Field descriptor #194 I + public static final int GL_FRAGMENT_SHADER = 35632; + + // Field descriptor #194 I + public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657; + + // Field descriptor #194 I + public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 35723; + + // Field descriptor #194 I + public static final int GL_MAX_DRAW_BUFFERS = 34852; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER0 = 34853; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER1 = 34854; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER2 = 34855; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER3 = 34856; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER4 = 34857; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER5 = 34858; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER6 = 34859; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER7 = 34860; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER8 = 34861; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER9 = 34862; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER10 = 34863; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER11 = 34864; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER12 = 34865; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER13 = 34866; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER14 = 34867; + + // Field descriptor #194 I + public static final int GL_DRAW_BUFFER15 = 34868; + + // Field descriptor #194 I + public static final int GL_POINT_SPRITE = 34913; + + // Field descriptor #194 I + public static final int GL_COORD_REPLACE = 34914; + + // Field descriptor #194 I + public static final int GL_POINT_SPRITE_COORD_ORIGIN = 36000; + + // Field descriptor #194 I + public static final int GL_LOWER_LEFT = 36001; + + // Field descriptor #194 I + public static final int GL_UPPER_LEFT = 36002; + + // Field descriptor #194 I + public static final int GL_STENCIL_BACK_FUNC = 34816; + + // Field descriptor #194 I + public static final int GL_STENCIL_BACK_FAIL = 34817; + + // Field descriptor #194 I + public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 34818; + + // Field descriptor #194 I + public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 34819; + + // Field descriptor #194 I + public static final int GL_STENCIL_BACK_REF = 36003; + + // Field descriptor #194 I + public static final int GL_STENCIL_BACK_VALUE_MASK = 36004; + + // Field descriptor #194 I + public static final int GL_STENCIL_BACK_WRITEMASK = 36005; + + // Field descriptor #194 I + public static final int GL_BLEND_EQUATION_RGB = 32777; + + // Field descriptor #194 I + public static final int GL_BLEND_EQUATION_ALPHA = 34877; + +} diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index 6525adb..4f58dbf 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -10,7 +10,9 @@ import net.lax1dude.eaglercraft.EaglerAdapter; import net.lax1dude.eaglercraft.EaglerProfile; import net.lax1dude.eaglercraft.GuiScreenEditProfile; +import net.lax1dude.eaglercraft.GuiScreenLicense; import net.lax1dude.eaglercraft.GuiScreenVoiceChannel; +import net.lax1dude.eaglercraft.LocalStorageManager; import net.lax1dude.eaglercraft.adapter.Tessellator; import net.lax1dude.eaglercraft.glemu.EffectPipeline; import net.lax1dude.eaglercraft.glemu.FixedFunctionShader; @@ -247,11 +249,19 @@ public class Minecraft implements Runnable { showIntroAnimation(); String s = EaglerAdapter.getServerToJoinOnLaunch(); + GuiScreen scr; + if(s != null) { - this.displayGuiScreen(new GuiScreenEditProfile(new GuiConnecting(new GuiMainMenu(), this, new ServerData("Eaglercraft Server", s, false)))); + scr = new GuiScreenEditProfile(new GuiConnecting(new GuiMainMenu(), this, new ServerData("Eaglercraft Server", s, false))); }else { - this.displayGuiScreen(new GuiScreenEditProfile(new GuiMainMenu())); + scr = new GuiScreenEditProfile(new GuiMainMenu()); } + + if(!LocalStorageManager.profileSettingsStorage.getBoolean("acceptLicense")) { + scr = new GuiScreenLicense(scr); + } + + displayGuiScreen(scr); this.loadingScreen = new LoadingScreenRenderer(this); @@ -1441,6 +1451,9 @@ public class Minecraft implements Runnable { this.sndManager.playStreaming((String) null, 0.0F, 0.0F, 0.0F); this.sndManager.stopAllSounds(); + if(EaglerAdapter.isVideoSupported()) { + EaglerAdapter.unloadVideo(); + } this.theWorld = par1WorldClient; if (par1WorldClient != null) { diff --git a/src/main/java/net/minecraft/src/GuiIngame.java b/src/main/java/net/minecraft/src/GuiIngame.java index 73b5e6d..2a3b0a8 100644 --- a/src/main/java/net/minecraft/src/GuiIngame.java +++ b/src/main/java/net/minecraft/src/GuiIngame.java @@ -102,10 +102,10 @@ public class GuiIngame extends Gui { this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22); this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22); tex_icons.bindTexture(); - //EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND); - //EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE_MINUS_DST_COLOR, EaglerAdapter.GL_ONE_MINUS_SRC_COLOR); + EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND); + EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE_MINUS_DST_COLOR, EaglerAdapter.GL_ONE_MINUS_SRC_COLOR); this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); - //EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); + EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); var11 = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1; if (this.mc.thePlayer.hurtResistantTime < 10) { diff --git a/src/main/java/net/minecraft/src/GuiMultiplayer.java b/src/main/java/net/minecraft/src/GuiMultiplayer.java index 2abc147..f7bc582 100644 --- a/src/main/java/net/minecraft/src/GuiMultiplayer.java +++ b/src/main/java/net/minecraft/src/GuiMultiplayer.java @@ -3,6 +3,7 @@ package net.minecraft.src; import java.util.Collections; import java.util.List; +import net.lax1dude.eaglercraft.ConfigConstants; import net.lax1dude.eaglercraft.EaglerAdapter; public class GuiMultiplayer extends GuiScreen { @@ -287,8 +288,23 @@ public class GuiMultiplayer extends GuiScreen { this.lagTooltip = null; StringTranslate var4 = StringTranslate.getInstance(); this.drawDefaultBackground(); + + boolean showAyonull = ConfigConstants.ayonullTitle != null && ConfigConstants.ayonullLink != null; + + this.serverSlotContainer.top = showAyonull ? 42 : 32; this.serverSlotContainer.drawScreen(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, var4.translateKey("multiplayer.title"), this.width / 2, 20, 16777215); + + if(showAyonull) { + this.drawCenteredString(this.fontRenderer, ConfigConstants.ayonullTitle, this.width / 2, 12, 0xDDDD66); + + String link = ConfigConstants.ayonullLink; + int linkWidth = fontRenderer.getStringWidth(link); + boolean mouseOver = par1 > (this.width - linkWidth) / 2 - 10 && par1 < (this.width + linkWidth) / 2 + 10 && par2 > 21 && par2 < 35; + this.drawString(this.fontRenderer, EnumChatFormatting.UNDERLINE + link, (this.width - linkWidth) / 2, 23, mouseOver ? 0xBBBBFF : 0x7777DD); + }else { + this.drawCenteredString(this.fontRenderer, var4.translateKey("multiplayer.title"), this.width / 2, 16, 16777215); + } + super.drawScreen(par1, par2, par3); if (this.lagTooltip != null) { @@ -305,6 +321,19 @@ public class GuiMultiplayer extends GuiScreen { } } } + + + protected void mouseClicked(int par1, int par2, int par3) { + if (par3 == 0 && ConfigConstants.ayonullTitle != null && ConfigConstants.ayonullLink != null) { + int linkWidth = fontRenderer.getStringWidth(ConfigConstants.ayonullLink); + boolean mouseOver = par1 > (this.width - linkWidth) / 2 - 10 && par1 < (this.width + linkWidth) / 2 + 10 && par2 > 21 && par2 < 35; + if(mouseOver) { + EaglerAdapter.openLink(ConfigConstants.ayonullLink); + return; + } + } + super.mouseClicked(par1, par2, par3); + } /** * Join server by slot index diff --git a/src/main/java/net/minecraft/src/ItemMap.java b/src/main/java/net/minecraft/src/ItemMap.java index 73ac893..f2f5a5c 100644 --- a/src/main/java/net/minecraft/src/ItemMap.java +++ b/src/main/java/net/minecraft/src/ItemMap.java @@ -1,9 +1,12 @@ package net.minecraft.src; import java.io.ByteArrayInputStream; +import java.io.DataInputStream; import java.io.IOException; import java.util.List; +import net.lax1dude.eaglercraft.EaglerAdapter; + public class ItemMap extends ItemMapBase { protected ItemMap(int par1) { super(par1); @@ -273,4 +276,88 @@ public class ItemMap extends ItemMapBase { e.printStackTrace(); } } + + private static MapData getMapById(WorldClient theWorld, int id) { + String var2 = "map_" + id; + MapData var3 = (MapData) theWorld.loadItemData(MapData.class, var2); + if (var3 == null) { + var3 = new MapData(var2); + theWorld.setItemData(var2, var3); + } + return var3; + } + + public static void processVideoMap(WorldClient theWorld, byte[] data) { + if(!EaglerAdapter.isVideoSupported()) { + return; + } + try { + DataInputStream dat = new DataInputStream(new ByteArrayInputStream(data)); + int op = dat.read(); + if(op == 0) { + int count = dat.read(); + int w = (count >> 4) & 0xF; + int h = count & 0xF; + for(int y = 0; y < h; ++y) { + for(int x = 0; x < w; ++x) { + getMapById(theWorld, dat.readUnsignedShort()).enableVideoPlayback = false; + } + } + EaglerAdapter.unloadVideo(); + }else if(op == 8) { + int ttl = dat.readInt(); + String src = dat.readUTF(); + EaglerAdapter.bufferVideo(src, ttl); + }else { + boolean fullResetPacket = (op & 2) == 2; + boolean positionPacket = (op & 4) == 4; + + int fps = 0; + int len = 0; + String url = null; + if(fullResetPacket) { + int count = dat.read(); + int w = (count >> 4) & 0xF; + int h = count & 0xF; + float wf = 1.0f / w; + float hf = 1.0f / h; + for(int y = 0; y < h; ++y) { + for(int x = 0; x < w; ++x) { + MapData mp = getMapById(theWorld, dat.readUnsignedShort()); + mp.videoX1 = x * wf; + mp.videoY1 = y * hf; + mp.videoX2 = mp.videoX1 + wf; + mp.videoY2 = mp.videoY1 + hf; + mp.enableVideoPlayback = true; + } + } + fps = dat.read(); + len = dat.readInt(); + url = dat.readUTF(); + } + + if(positionPacket) { + float v = dat.readFloat(); + EaglerAdapter.setVideoVolume((float)dat.readDouble(), (float)dat.readDouble(), (float)dat.readDouble(), v); + } + + if(fullResetPacket) { + EaglerAdapter.setVideoFrameRate(fps); + EaglerAdapter.loadVideo(url, true); + } + + int time = dat.readInt(); + int timeNow = (int)(EaglerAdapter.getVideoCurrentTime() * 1000.0f); + if(MathHelper.abs_int(time - timeNow) > 1000) { + EaglerAdapter.setVideoCurrentTime(time * 0.001f); + } + + EaglerAdapter.setVideoLoop(dat.readBoolean()); + EaglerAdapter.setVideoPaused(dat.readBoolean()); + } + }catch(IOException e) { + System.err.println("Failed to read video map packet! " + e.toString()); + e.printStackTrace(); + } + } } diff --git a/src/main/java/net/minecraft/src/MapData.java b/src/main/java/net/minecraft/src/MapData.java index 6be5247..0806af2 100644 --- a/src/main/java/net/minecraft/src/MapData.java +++ b/src/main/java/net/minecraft/src/MapData.java @@ -372,4 +372,12 @@ public class MapData extends WorldSavedData { } } + public boolean enableVideoPlayback = false; + + public float videoX1 = 0.0f; + public float videoY1 = 0.0f; + public float videoX2 = 1.0f; + public float videoY2 = 1.0f; + + } diff --git a/src/main/java/net/minecraft/src/MapItemRenderer.java b/src/main/java/net/minecraft/src/MapItemRenderer.java index 6ebe258..04d0d38 100644 --- a/src/main/java/net/minecraft/src/MapItemRenderer.java +++ b/src/main/java/net/minecraft/src/MapItemRenderer.java @@ -26,65 +26,83 @@ public class MapItemRenderer { private static final TextureLocation mapicons = new TextureLocation("/misc/mapicons.png"); public void renderMap(EntityPlayer par1EntityPlayer, RenderEngine par2RenderEngine, MapData par3MapData) { - if(par3MapData.enableAyunami) { - System.arraycopy(par3MapData.ayunamiPixels, 0, intArray, 0, intArray.length); + float texX1 = 0.0f; + float texX2 = 1.0f; + float texY1 = 0.0f; + float texY2 = 1.0f; + boolean isVideoMode = EaglerAdapter.isVideoSupported() && par3MapData.enableVideoPlayback && EaglerAdapter.isVideoLoaded(); + if(isVideoMode) { + EaglerAdapter.glEnable(EaglerAdapter.EAG_SWAP_RB); + EaglerAdapter.updateVideoTexture(); + EaglerAdapter.bindVideoTexture(); + texX1 = par3MapData.videoX1; + texY1 = par3MapData.videoY1; + texX2 = par3MapData.videoX2; + texY2 = par3MapData.videoY2; }else { - for (int var4 = 0; var4 < 16384; ++var4) { - byte var5 = par3MapData.colors[var4]; - - if (var5 / 4 == 0) { - this.intArray[var4] = (var4 + var4 / 128 & 1) * 8 + 16 << 24; - } else { - int var6 = MapColor.mapColorArray[var5 / 4].colorValue; - int var7 = var5 & 3; - short var8 = 220; - - if (var7 == 2) { - var8 = 255; + if(par3MapData.enableAyunami) { + System.arraycopy(par3MapData.ayunamiPixels, 0, intArray, 0, intArray.length); + }else { + for (int var4 = 0; var4 < 16384; ++var4) { + byte var5 = par3MapData.colors[var4]; + + if (var5 / 4 == 0) { + this.intArray[var4] = (var4 + var4 / 128 & 1) * 8 + 16 << 24; + } else { + int var6 = MapColor.mapColorArray[var5 / 4].colorValue; + int var7 = var5 & 3; + short var8 = 220; + + if (var7 == 2) { + var8 = 255; + } + + if (var7 == 0) { + var8 = 180; + } + + int var9 = (var6 >> 16 & 255) * var8 / 255; + int var10 = (var6 >> 8 & 255) * var8 / 255; + int var11 = (var6 & 255) * var8 / 255; + + if (this.gameSettings.anaglyph) { + int var12 = (var9 * 30 + var10 * 59 + var11 * 11) / 100; + int var13 = (var9 * 30 + var10 * 70) / 100; + int var14 = (var9 * 30 + var11 * 70) / 100; + var9 = var12; + var10 = var13; + var11 = var14; + } + + this.intArray[var4] = -16777216 | var9 << 16 | var10 << 8 | var11; } - - if (var7 == 0) { - var8 = 180; - } - - int var9 = (var6 >> 16 & 255) * var8 / 255; - int var10 = (var6 >> 8 & 255) * var8 / 255; - int var11 = (var6 & 255) * var8 / 255; - - if (this.gameSettings.anaglyph) { - int var12 = (var9 * 30 + var10 * 59 + var11 * 11) / 100; - int var13 = (var9 * 30 + var10 * 70) / 100; - int var14 = (var9 * 30 + var11 * 70) / 100; - var9 = var12; - var10 = var13; - var11 = var14; - } - - this.intArray[var4] = -16777216 | var9 << 16 | var10 << 8 | var11; } } + par2RenderEngine.createTextureFromBytes(this.intArray, 128, 128, this.bufferedImage); } - - par2RenderEngine.createTextureFromBytes(this.intArray, 128, 128, this.bufferedImage); + byte var15 = 0; byte var16 = 0; Tessellator var17 = Tessellator.instance; float var18 = 0.0F; - EaglerAdapter.glBindTexture(EaglerAdapter.GL_TEXTURE_2D, this.bufferedImage); EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND); EaglerAdapter.glBlendFunc(EaglerAdapter.GL_ONE, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA); EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST); var17.startDrawingQuads(); - var17.addVertexWithUV((double) ((float) (var15 + 0) + var18), (double) ((float) (var16 + 128) - var18), -0.009999999776482582D, 0.0D, 1.0D); - var17.addVertexWithUV((double) ((float) (var15 + 128) - var18), (double) ((float) (var16 + 128) - var18), -0.009999999776482582D, 1.0D, 1.0D); - var17.addVertexWithUV((double) ((float) (var15 + 128) - var18), (double) ((float) (var16 + 0) + var18), -0.009999999776482582D, 1.0D, 0.0D); - var17.addVertexWithUV((double) ((float) (var15 + 0) + var18), (double) ((float) (var16 + 0) + var18), -0.009999999776482582D, 0.0D, 0.0D); + var17.addVertexWithUV((double) ((float) (var15 + 0) + var18), (double) ((float) (var16 + 128) - var18), -0.009999999776482582D, texX1, texY2); + var17.addVertexWithUV((double) ((float) (var15 + 128) - var18), (double) ((float) (var16 + 128) - var18), -0.009999999776482582D, texX2, texY2); + var17.addVertexWithUV((double) ((float) (var15 + 128) - var18), (double) ((float) (var16 + 0) + var18), -0.009999999776482582D, texX2, texY1); + var17.addVertexWithUV((double) ((float) (var15 + 0) + var18), (double) ((float) (var16 + 0) + var18), -0.009999999776482582D, texX1, texY1); var17.draw(); EaglerAdapter.glEnable(EaglerAdapter.GL_ALPHA_TEST); EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); par2RenderEngine.resetBoundTexture(); - if(!par3MapData.enableAyunami) { + if(isVideoMode) { + EaglerAdapter.glDisable(EaglerAdapter.EAG_SWAP_RB); + } + + if(!par3MapData.enableAyunami && !isVideoMode) { mapicons.bindTexture(); int var19 = 0; diff --git a/src/main/java/net/minecraft/src/NetClientHandler.java b/src/main/java/net/minecraft/src/NetClientHandler.java index 220786c..86c91dc 100644 --- a/src/main/java/net/minecraft/src/NetClientHandler.java +++ b/src/main/java/net/minecraft/src/NetClientHandler.java @@ -1015,6 +1015,8 @@ public class NetClientHandler extends NetHandler { ItemMap.getMPMapData(par1Packet131MapData.uniqueID, this.mc.theWorld).updateMPMapData(par1Packet131MapData.itemData); } else if (par1Packet131MapData.itemID == 103) { ItemMap.readAyunamiMapPacket(this.mc.theWorld, par1Packet131MapData.uniqueID, par1Packet131MapData.itemData); + } else if (par1Packet131MapData.itemID == 104) { + ItemMap.processVideoMap(this.mc.theWorld, par1Packet131MapData.itemData); } else { System.err.println("Unknown itemid: " + par1Packet131MapData.itemID); } diff --git a/src/main/java/net/minecraft/src/RenderSlime.java b/src/main/java/net/minecraft/src/RenderSlime.java index 77480c9..06dea28 100644 --- a/src/main/java/net/minecraft/src/RenderSlime.java +++ b/src/main/java/net/minecraft/src/RenderSlime.java @@ -19,7 +19,6 @@ public class RenderSlime extends RenderLiving { return 0; } else if (par2 == 0) { this.setRenderPassModel(this.scaleAmount); - EaglerAdapter.glEnable(EaglerAdapter.GL_NORMALIZE); EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND); EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA); return 1; diff --git a/src/main/java/net/minecraft/src/ServerList.java b/src/main/java/net/minecraft/src/ServerList.java index db2c410..48e5bb9 100644 --- a/src/main/java/net/minecraft/src/ServerList.java +++ b/src/main/java/net/minecraft/src/ServerList.java @@ -38,6 +38,8 @@ public class ServerList { NBTTagCompound nbt = CompressedStreamTools.readUncompressed(Base64.decodeBase64(base64)); ConfigConstants.profanity = nbt.getBoolean("profanity"); hideDownDefaultServers = nbt.getBoolean("hide_down"); + ConfigConstants.ayonullTitle = nbt.hasKey("serverListTitle") ? nbt.getString("serverListTitle") : null; + ConfigConstants.ayonullLink = nbt.hasKey("serverListLink") ? nbt.getString("serverListLink") : null; forcedServers.clear(); NBTTagList list = nbt.getTagList("servers"); for (int i = 0; i < list.tagCount(); ++i) { diff --git a/src/main/java/net/minecraft/src/WorldClient.java b/src/main/java/net/minecraft/src/WorldClient.java index 2f92228..bd152ed 100644 --- a/src/main/java/net/minecraft/src/WorldClient.java +++ b/src/main/java/net/minecraft/src/WorldClient.java @@ -29,7 +29,7 @@ public class WorldClient extends World { * with each subsequent tick until the spawn queue is empty. */ private Set entitySpawnQueue = new HashSet(); - private final Minecraft mc = Minecraft.getMinecraft(); + public final Minecraft mc = Minecraft.getMinecraft(); private final Set previousActiveChunkSet = new HashSet(); public WorldClient(NetClientHandler par1NetClientHandler, WorldSettings par2WorldSettings, int par3, int par4, Profiler par5Profiler) { diff --git a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java index 265cd8a..65567b3 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java @@ -11,6 +11,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.LinkedList; import java.util.Set; @@ -24,6 +25,7 @@ import org.teavm.jso.ajax.ReadyStateChangeHandler; import org.teavm.jso.ajax.XMLHttpRequest; import org.teavm.jso.browser.TimerHandler; import org.teavm.jso.browser.Window; +import org.teavm.jso.dom.events.Event; import org.teavm.jso.dom.events.EventListener; import org.teavm.jso.dom.events.KeyboardEvent; import org.teavm.jso.dom.events.MessageEvent; @@ -32,6 +34,8 @@ import org.teavm.jso.dom.events.WheelEvent; import org.teavm.jso.dom.html.HTMLCanvasElement; import org.teavm.jso.dom.html.HTMLDocument; import org.teavm.jso.dom.html.HTMLElement; +import org.teavm.jso.dom.html.HTMLVideoElement; +import org.teavm.jso.media.MediaError; import org.teavm.jso.typedarrays.ArrayBuffer; import org.teavm.jso.typedarrays.Float32Array; import org.teavm.jso.typedarrays.Int32Array; @@ -43,6 +47,7 @@ import org.teavm.jso.webaudio.AudioListener; import org.teavm.jso.webaudio.DecodeErrorCallback; import org.teavm.jso.webaudio.DecodeSuccessCallback; import org.teavm.jso.webaudio.GainNode; +import org.teavm.jso.webaudio.MediaElementAudioSourceNode; import org.teavm.jso.webaudio.MediaEvent; import org.teavm.jso.webaudio.PannerNode; import org.teavm.jso.webgl.WebGLBuffer; @@ -348,6 +353,20 @@ public class EaglerAdapterImpl2 { mouseEvents.clear(); keyEvents.clear(); + + Window.setInterval(new TimerHandler() { + @Override + public void onTimer() { + Iterator vids = videosBuffer.values().iterator(); + while(vids.hasNext()) { + BufferedVideo v = vids.next(); + if(System.currentTimeMillis() - v.requestedTime > v.ttl) { + v.videoElement.setSrc(""); + vids.remove(); + } + } + } + }, 5000); } public static final void destroyContext() { @@ -868,6 +887,302 @@ public class EaglerAdapterImpl2 { return getString("window.navigator.platform").toLowerCase().contains("win"); } + private static HTMLVideoElement currentVideo = null; + private static TextureGL videoTexture = null; + private static boolean videoIsLoaded = false; + private static boolean videoTexIsInitialized = false; + private static int frameRate = 17; + private static long frameTimer = 0l; + + public static final boolean isVideoSupported() { + return true; + } + public static final void loadVideo(String src, boolean autoplay) { + loadVideo(src, autoplay, null, null); + } + public static final void loadVideo(String src, boolean autoplay, String setJavascriptPointer) { + loadVideo(src, autoplay, setJavascriptPointer, null); + } + + @JSBody(params = { "ptr", "el" }, script = "window[ptr] = el;") + private static native void setVideoPointer(String ptr, HTMLVideoElement el); + @JSBody(params = { "ptr", "el" }, script = "window[ptr](el);") + private static native void callVideoLoadEvent(String ptr, HTMLVideoElement el); + + private static MediaElementAudioSourceNode currentVideoAudioSource = null; + + private static GainNode currentVideoAudioGain = null; + private static float currentVideoAudioGainValue = 1.0f; + + private static PannerNode currentVideoAudioPanner = null; + private static float currentVideoAudioX = 0.0f; + private static float currentVideoAudioY = 0.0f; + private static float currentVideoAudioZ = 0.0f; + + public static final void loadVideo(String src, boolean autoplay, String setJavascriptPointer, final String javascriptOnloadFunction) { + videoIsLoaded = false; + videoTexIsInitialized = false; + if(videoTexture == null) { + videoTexture = _wglGenTextures(); + } + if(currentVideo != null) { + currentVideo.pause(); + currentVideo.setSrc(""); + } + + BufferedVideo vid = videosBuffer.get(src); + + if(vid != null) { + currentVideo = vid.videoElement; + videosBuffer.remove(src); + }else { + currentVideo = (HTMLVideoElement) win.getDocument().createElement("video"); + currentVideo.setAutoplay(autoplay); + } + + if(setJavascriptPointer != null) { + setVideoPointer(setJavascriptPointer, currentVideo); + } + + currentVideo.addEventListener("playing", new EventListener() { + @Override + public void handleEvent(Event evt) { + videoIsLoaded = true; + if(javascriptOnloadFunction != null) { + callVideoLoadEvent(javascriptOnloadFunction, currentVideo); + } + } + }); + + if(vid == null) { + currentVideo.setControls(false); + currentVideo.setSrc(src); + }else { + if(autoplay) { + currentVideo.play(); + } + } + + if(currentVideoAudioSource != null) { + currentVideoAudioSource.disconnect(); + } + + currentVideoAudioSource = audioctx.createMediaElementSource(currentVideo); + + if(currentVideoAudioGainValue < 0.0f) { + currentVideoAudioSource.connect(audioctx.getDestination()); + }else { + if(currentVideoAudioGain == null) { + currentVideoAudioGain = audioctx.createGain(); + currentVideoAudioGain.getGain().setValue(currentVideoAudioGainValue > 1.0f ? 1.0f : currentVideoAudioGainValue); + } + + currentVideoAudioSource.connect(currentVideoAudioGain); + + if(currentVideoAudioPanner == null) { + currentVideoAudioPanner = audioctx.createPanner(); + currentVideoAudioPanner.setRolloffFactor(1f); + currentVideoAudioPanner.setDistanceModel("linear"); + currentVideoAudioPanner.setPanningModel("HRTF"); + currentVideoAudioPanner.setConeInnerAngle(360f); + currentVideoAudioPanner.setConeOuterAngle(0f); + currentVideoAudioPanner.setConeOuterGain(0f); + currentVideoAudioPanner.setOrientation(0f, 1f, 0f); + currentVideoAudioPanner.setPosition(currentVideoAudioX, currentVideoAudioY, currentVideoAudioZ); + currentVideoAudioPanner.setMaxDistance(currentVideoAudioGainValue * 16f + 0.1f); + currentVideoAudioGain.connect(currentVideoAudioPanner); + currentVideoAudioPanner.connect(audioctx.getDestination()); + } + } + + } + + private static class BufferedVideo { + + protected final HTMLVideoElement videoElement; + protected final String url; + protected final long requestedTime; + protected final int ttl; + + public BufferedVideo(HTMLVideoElement videoElement, String url, int ttl) { + this.videoElement = videoElement; + this.url = url; + this.requestedTime = System.currentTimeMillis(); + this.ttl = ttl; + } + + } + + private static final HashMap videosBuffer = new HashMap(); + + public static final void bufferVideo(String src, int ttl) { + if(!videosBuffer.containsKey(src)) { + HTMLVideoElement video = (HTMLVideoElement) win.getDocument().createElement("video"); + video.setAutoplay(false); + video.setPreload("auto"); + video.setControls(false); + video.setSrc(src); + videosBuffer.put(src, new BufferedVideo(video, src, ttl)); + } + } + + public static final void unloadVideo() { + if(videoTexture != null) { + _wglDeleteTextures(videoTexture); + videoTexture = null; + } + if(currentVideo != null) { + currentVideo.pause(); + currentVideo.setSrc(""); + currentVideo = null; + } + if(currentVideoAudioSource != null) { + currentVideoAudioSource.disconnect(); + } + } + public static final boolean isVideoLoaded() { + return videoTexture != null && currentVideo != null && videoIsLoaded; + } + public static final boolean isVideoPaused() { + return currentVideo == null || currentVideo.isPaused(); + } + public static final void setVideoPaused(boolean pause) { + if(currentVideo != null) { + if(pause) { + currentVideo.pause(); + }else { + currentVideo.play(); + } + } + } + public static final void setVideoLoop(boolean loop) { + if(currentVideo != null) { + currentVideo.setLoop(loop); + } + } + public static final void setVideoVolume(float x, float y, float z, float v) { + currentVideoAudioX = x; + currentVideoAudioY = y; + currentVideoAudioZ = z; + if(v < 0.0f) { + if(currentVideoAudioGainValue >= 0.0f && currentVideoAudioSource != null) { + currentVideoAudioSource.disconnect(); + currentVideoAudioSource.connect(audioctx.getDestination()); + } + currentVideoAudioGainValue = v; + }else { + if(currentVideoAudioGain != null) { + currentVideoAudioGain.getGain().setValue(v > 1.0f ? 1.0f : v); + if(currentVideoAudioGainValue < 0.0f && currentVideoAudioSource != null) { + currentVideoAudioSource.disconnect(); + currentVideoAudioSource.connect(currentVideoAudioGain); + } + } + currentVideoAudioGainValue = v; + if(currentVideoAudioPanner != null) { + currentVideoAudioPanner.setMaxDistance(v * 16f + 0.1f); + currentVideoAudioPanner.setPosition(x, y, z); + } + } + } + + @JSBody( + params = {"ctx", "target", "internalformat", "format", "type", "video"}, + script = "ctx.texImage2D(target, 0, internalformat, format, type, video);" + ) + private static native void html5VideoTexImage2D(WebGL2RenderingContext ctx, int target, int internalformat, int format, int type, HTMLVideoElement video); + + @JSBody( + params = {"ctx", "target", "format", "type", "video"}, + script = "ctx.texSubImage2D(target, 0, 0, 0, format, type, video);" + ) + private static native void html5VideoTexSubImage2D(WebGL2RenderingContext ctx, int target, int format, int type, HTMLVideoElement video); + + public static final void updateVideoTexture() { + long ms = System.currentTimeMillis(); + if(ms - frameTimer < frameRate && videoTexIsInitialized) { + return; + } + frameTimer = ms; + if(currentVideo != null && videoTexture != null && videoIsLoaded) { + _wglBindTexture(_wGL_TEXTURE_2D, videoTexture); + if(videoTexIsInitialized) { + html5VideoTexSubImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo); + }else { + html5VideoTexImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo); + _wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_S, _wGL_CLAMP); + _wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_T, _wGL_CLAMP); + _wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MIN_FILTER, _wGL_LINEAR); + _wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MAG_FILTER, _wGL_LINEAR); + videoTexIsInitialized = true; + } + } + } + public static final void bindVideoTexture() { + if(videoTexture != null) { + _wglBindTexture(_wGL_TEXTURE_2D, videoTexture); + } + } + public static final int getVideoWidth() { + if(currentVideo != null && videoIsLoaded) { + return currentVideo.getWidth(); + }else { + return -1; + } + } + public static final int getVideoHeight() { + if(currentVideo != null && videoIsLoaded) { + return currentVideo.getHeight(); + }else { + return -1; + } + } + public static final float getVideoCurrentTime() { + if(currentVideo != null && videoIsLoaded) { + return (float) currentVideo.getCurrentTime(); + }else { + return -1.0f; + } + } + public static final void setVideoCurrentTime(float seconds) { + if(currentVideo != null && videoIsLoaded) { + currentVideo.setCurrentTime(seconds); + } + } + public static final float getVideoDuration() { + if(currentVideo != null && videoIsLoaded) { + return (float) currentVideo.getDuration(); + }else { + return -1.0f; + } + } + + public static final int VIDEO_ERR_NONE = -1; + public static final int VIDEO_ERR_ABORTED = 1; + public static final int VIDEO_ERR_NETWORK = 2; + public static final int VIDEO_ERR_DECODE = 3; + public static final int VIDEO_ERR_SRC_NOT_SUPPORTED = 4; + + public static final int getVideoError() { + if(currentVideo != null && videoIsLoaded) { + MediaError err = currentVideo.getError(); + if(err != null) { + return err.getCode(); + }else { + return -1; + } + }else { + return -1; + } + } + + public static final void setVideoFrameRate(float fps) { + frameRate = (int)(1000.0f / fps); + if(frameRate < 1) { + frameRate = 1; + } + } + private static MouseEvent currentEvent = null; private static KeyboardEvent currentEventK = null; private static boolean[] buttonStates = new boolean[8]; @@ -1250,18 +1565,13 @@ public class EaglerAdapterImpl2 { public static native String getFileChooserResultName(); public static final void setListenerPos(float x, float y, float z, float vx, float vy, float vz, float pitch, float yaw) { - float var11 = MathHelper.cos(-yaw * 0.017453292F - (float) Math.PI); - float var12 = MathHelper.sin(-yaw * 0.017453292F - (float) Math.PI); - float var13 = -var12; - float var14 = -MathHelper.sin(-pitch * 0.017453292F - (float) Math.PI); - float var15 = -var11; - float var16 = 0.0F; - float var17 = 1.0F; - float var18 = 0.0F; + float var2 = MathHelper.cos(-yaw * 0.017453292F); + float var3 = MathHelper.sin(-yaw * 0.017453292F); + float var4 = -MathHelper.cos(-pitch * 0.017453292F); + float var5 = MathHelper.sin(-pitch * 0.017453292F); AudioListener l = audioctx.getListener(); l.setPosition(x, y, z); - l.setOrientation(var13, var14, var15, var16, var17, var18); - //l.setVelocity(vx, vy, vz); + l.setOrientation(var3 * var4, -var5, var2 * var4, 0.0f, 1.0f, 0.0f); } private static int playbackId = 0;