diff --git a/SnitchLists.md b/SnitchLists.md index 1b8940b..8a3797d 100644 --- a/SnitchLists.md +++ b/SnitchLists.md @@ -2,7 +2,7 @@ The Snitch list is one of the main objects used in Snitch Master. It is a very useful tool that you can use to group together Snitches that meet certain criteria. -Snitches are then displayed in the world and io JourneyMap with the color of their top Snitch list. +Snitches are then displayed in the world and in JourneyMap with the color of their top Snitch list. This tutorial will help you with learning to use Snitch list qualifier language so you can group your Snitches together however you like. diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/ConfigGuiFactory.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/ConfigGuiFactory.java index a601c7e..a354826 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/ConfigGuiFactory.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/ConfigGuiFactory.java @@ -1,5 +1,6 @@ package com.gmail.nuclearcat1337.snitch_master.gui; +import com.gmail.nuclearcat1337.snitch_master.gui.screens.SettingsGui; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.fml.client.IModGuiFactory; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/ControlGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/ControlGui.java deleted file mode 100644 index d056dcc..0000000 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/ControlGui.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.gmail.nuclearcat1337.snitch_master.gui.controls; - -import net.minecraft.client.gui.GuiControls; -import net.minecraft.client.gui.GuiTextField; - -/** - * Created by Mr_Little_Kitty on 1/7/2017. - */ -public class ControlGui -{ -} diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/DropMenu.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/DropMenu.java new file mode 100644 index 0000000..0436803 --- /dev/null +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/DropMenu.java @@ -0,0 +1,70 @@ +package com.gmail.nuclearcat1337.snitch_master.gui.controls; + +import com.gmail.nuclearcat1337.snitch_master.SnitchMaster; +import com.gmail.nuclearcat1337.snitch_master.util.GeneralUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; + +/** + * Created by Mr_Little_Kitty on 1/20/2017. + */ +public class DropMenu extends GuiButton +{ + public static final ResourceLocation MENU_BUTTON = new ResourceLocation(SnitchMaster.MODID,"snitchMasterMain.png"); + + public DropMenu(int buttonId, int x, int y) + { + super(buttonId, x, y, 16, 16, ""); + } + + + + @Override + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if(super.mousePressed(mc,mouseX,mouseY)) + { + + return true; + } + return false; + } + + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if(this.visible) + { + //GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int i = this.getHoverState(this.hovered); + + GlStateManager.color(1.0f,1.0f,1.0f,1.0f); + + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); + + mc.getTextureManager().bindTexture(BUTTON_TEXTURES); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height); + +// if(i == 2) //They are hovering over the button +// { +// float f3 = (float)(16777120 >> 24 & 255) / 255.0F; +// float f = (float)(16777120 >> 16 & 255) / 255.0F; +// float f1 = (float)(16777120 >> 8 & 255) / 255.0F; +// float f2 = (float)(16777120 & 255) / 255.0F; +// GlStateManager.color(f, f1, f2, f3); +// } + + mc.getTextureManager().bindTexture(MENU_BUTTON); + this.drawTexturedModalRect(this.xPosition+4,this.yPosition+4,0,0,8,8); + + this.mouseDragged(mc, mouseX, mouseY); + } + } +} diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/OptionSlider.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/OptionSlider.java deleted file mode 100644 index 52f0d70..0000000 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/controls/OptionSlider.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.gmail.nuclearcat1337.snitch_master.gui.controls; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; - -/** - * Created by Mr_Little_Kitty on 9/15/2016. - */ -public class OptionSlider extends GuiButton -{ - private boolean sliderClicked; - - private float currentValue; - - - private final float lowerBound; - private final float upperBound; - - public OptionSlider(int id, int xPos, int yPos, int width, int height, float lowerBound, float upperBound) - { - super(id, xPos, yPos, width,height, ""); - this.lowerBound = lowerBound; - this.upperBound = upperBound; - this.currentValue = 1.0f; - } - -// public boolean mousePressed(Minecraft p_146116_1_, int p_146116_2_, int p_146116_3_) -// { -// if (super.mousePressed(p_146116_1_, p_146116_2_, p_146116_3_)) -// { -// this.currentValue = (float)(p_146116_2_ - (this.xPosition + 4)) / (float)(this.width - 8); -// -// if (this.currentValue < 0.0F) -// { -// this.currentValue = 0.0F; -// } -// -// if (this.currentValue > 1.0F) -// { -// this.currentValue = 1.0F; -// } -// -// SV.settings.setOptionFloatValue(this.option, this.option.denormalizeValue(this.field_146134_p)); -// this.displayString = SV.settings.getKeyBinding(this.option); -// this.field_146135_o = true; -// return true; -// } -// else -// { -// return false; -// } -// } -// -// /** -// * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). -// */ -// public void mouseReleased(int p_146118_1_, int p_146118_2_) -// { -// this.field_146135_o = false; -// } -} diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditColorGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditColorGui.java similarity index 98% rename from src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditColorGui.java rename to src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditColorGui.java index f4d17cd..626a315 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditColorGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditColorGui.java @@ -1,5 +1,6 @@ -package com.gmail.nuclearcat1337.snitch_master.gui; +package com.gmail.nuclearcat1337.snitch_master.gui.screens; +import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; import com.gmail.nuclearcat1337.snitch_master.gui.controls.TextBox; import com.gmail.nuclearcat1337.snitch_master.snitches.SnitchList; import com.gmail.nuclearcat1337.snitch_master.util.Acceptor; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditDescriptionGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditDescriptionGui.java similarity index 71% rename from src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditDescriptionGui.java rename to src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditDescriptionGui.java index aa147a0..d66363c 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditDescriptionGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditDescriptionGui.java @@ -1,4 +1,4 @@ -package com.gmail.nuclearcat1337.snitch_master.gui; +package com.gmail.nuclearcat1337.snitch_master.gui.screens; import net.minecraft.client.gui.GuiScreen; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditStringGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditStringGui.java similarity index 96% rename from src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditStringGui.java rename to src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditStringGui.java index 458cdb3..13575e6 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/EditStringGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/EditStringGui.java @@ -1,5 +1,6 @@ -package com.gmail.nuclearcat1337.snitch_master.gui; +package com.gmail.nuclearcat1337.snitch_master.gui.screens; +import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; import com.gmail.nuclearcat1337.snitch_master.gui.controls.TextBox; import com.gmail.nuclearcat1337.snitch_master.util.Acceptor; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/MainGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/MainGui.java similarity index 97% rename from src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/MainGui.java rename to src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/MainGui.java index f9cfb0d..b062587 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/MainGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/MainGui.java @@ -1,6 +1,7 @@ -package com.gmail.nuclearcat1337.snitch_master.gui; +package com.gmail.nuclearcat1337.snitch_master.gui.screens; import com.gmail.nuclearcat1337.snitch_master.SnitchMaster; +import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; import com.gmail.nuclearcat1337.snitch_master.gui.snitchliststable.SnitchListRemoveColumn; import com.gmail.nuclearcat1337.snitch_master.gui.snitchliststable.SnitchListsTable; import com.gmail.nuclearcat1337.snitch_master.gui.snitchtable.SnitchRemoveColumn; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/NewSnitchListGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/NewSnitchListGui.java similarity index 97% rename from src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/NewSnitchListGui.java rename to src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/NewSnitchListGui.java index b6864a6..e8fb6c2 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/NewSnitchListGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/NewSnitchListGui.java @@ -1,7 +1,8 @@ -package com.gmail.nuclearcat1337.snitch_master.gui; +package com.gmail.nuclearcat1337.snitch_master.gui.screens; import com.gmail.nuclearcat1337.snitch_master.SnitchMaster; import com.gmail.nuclearcat1337.snitch_master.api.SnitchListQualifier; +import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; import com.gmail.nuclearcat1337.snitch_master.gui.controls.TextBox; import com.gmail.nuclearcat1337.snitch_master.gui.snitchliststable.SnitchListsTable; import com.gmail.nuclearcat1337.snitch_master.snitches.SnitchList; @@ -54,7 +55,7 @@ public void initGui() rgbBoxWidth = nameBoxWidth/3; qualifierStringWidth = mc.fontRendererObj.getStringWidth("Qualifier"); createNewListStringWidth = mc.fontRendererObj.getStringWidth(CREATE_NEW_LIST_STRING); - buttonWidth = (qualifierBoxWidth-GuiConstants.STANDARD_SEPARATION_DISTANCE)/3; + buttonWidth = (qualifierBoxWidth- GuiConstants.STANDARD_SEPARATION_DISTANCE)/3; int yPos = (this.height / 2) - (GuiConstants.STANDARD_BUTTON_HEIGHT*3) - (GuiConstants.STANDARD_SEPARATION_DISTANCE) ; int xPos = (this.width/2) - (nameBoxWidth/2); diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/SettingsGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/SettingsGui.java similarity index 98% rename from src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/SettingsGui.java rename to src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/SettingsGui.java index 5e2490d..552dd9e 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/SettingsGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/SettingsGui.java @@ -1,7 +1,8 @@ -package com.gmail.nuclearcat1337.snitch_master.gui; +package com.gmail.nuclearcat1337.snitch_master.gui.screens; import com.gmail.nuclearcat1337.snitch_master.Settings; import com.gmail.nuclearcat1337.snitch_master.SnitchMaster; +import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/TargetedSnitchUpdateGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/TargetedSnitchUpdateGui.java similarity index 97% rename from src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/TargetedSnitchUpdateGui.java rename to src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/TargetedSnitchUpdateGui.java index 38e27e7..a857539 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/TargetedSnitchUpdateGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/screens/TargetedSnitchUpdateGui.java @@ -1,5 +1,6 @@ -package com.gmail.nuclearcat1337.snitch_master.gui; +package com.gmail.nuclearcat1337.snitch_master.gui.screens; +import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; import com.gmail.nuclearcat1337.snitch_master.gui.controls.TextBox; import com.gmail.nuclearcat1337.snitch_master.handlers.ChatSnitchParser; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListNameColumn.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListNameColumn.java index d596285..274850a 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListNameColumn.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListNameColumn.java @@ -1,6 +1,6 @@ package com.gmail.nuclearcat1337.snitch_master.gui.snitchliststable; -import com.gmail.nuclearcat1337.snitch_master.gui.EditStringGui; +import com.gmail.nuclearcat1337.snitch_master.gui.screens.EditStringGui; import com.gmail.nuclearcat1337.snitch_master.gui.tables.TableColumn; import com.gmail.nuclearcat1337.snitch_master.snitches.SnitchList; import com.gmail.nuclearcat1337.snitch_master.snitches.SnitchLists; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListsTable.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListsTable.java index ad42ac8..28dceab 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListsTable.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/snitchliststable/SnitchListsTable.java @@ -3,10 +3,10 @@ import com.gmail.nuclearcat1337.snitch_master.Settings; import com.gmail.nuclearcat1337.snitch_master.SnitchMaster; import com.gmail.nuclearcat1337.snitch_master.api.SnitchListQualifier; -import com.gmail.nuclearcat1337.snitch_master.gui.EditColorGui; -import com.gmail.nuclearcat1337.snitch_master.gui.EditStringGui; +import com.gmail.nuclearcat1337.snitch_master.gui.screens.EditColorGui; +import com.gmail.nuclearcat1337.snitch_master.gui.screens.EditStringGui; import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; -import com.gmail.nuclearcat1337.snitch_master.gui.NewSnitchListGui; +import com.gmail.nuclearcat1337.snitch_master.gui.screens.NewSnitchListGui; import com.gmail.nuclearcat1337.snitch_master.gui.snitchtable.*; import com.gmail.nuclearcat1337.snitch_master.gui.tables.TableButtonColumn; import com.gmail.nuclearcat1337.snitch_master.gui.tables.TableColumn; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/tables/TableTopGui.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/tables/TableTopGui.java index 95a4404..64e5bae 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/tables/TableTopGui.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/gui/tables/TableTopGui.java @@ -1,6 +1,7 @@ package com.gmail.nuclearcat1337.snitch_master.gui.tables; import com.gmail.nuclearcat1337.snitch_master.gui.GuiConstants; +import com.gmail.nuclearcat1337.snitch_master.gui.controls.DropMenu; import com.gmail.nuclearcat1337.snitch_master.util.Pair; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -91,7 +92,9 @@ public void initGui() buttonList.add(doneButton); buttonList.add(columnsButton); - initializeButtons(2); + //buttonList.add(new DropMenu(2,20,20)); + + initializeButtons(3); super.initGui(); } diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/ChatSnitchParser.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/ChatSnitchParser.java index 736f3ff..b471de5 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/ChatSnitchParser.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/ChatSnitchParser.java @@ -136,6 +136,7 @@ private boolean tryParsePlaceMessage(ITextComponent msg) return false; ITextComponent hoverComponent = siblings.get(0); + HoverEvent hover = hoverComponent.getStyle().getHoverEvent(); if(hover != null) { @@ -161,9 +162,9 @@ private Snitch parseSnitchFromChat(String text) String[] groupArgs = args[2].split(" "); int x, y, z; - x = Integer.parseInt(locationArgs[0].substring(2)); - y = Integer.parseInt(locationArgs[1]); - z = Integer.parseInt(locationArgs[2].substring(0, locationArgs[2].length() - 1)); + x = Integer.parseInt(locationArgs[1].substring(1)); + y = Integer.parseInt(locationArgs[2]); + z = Integer.parseInt(locationArgs[3].substring(0, locationArgs[3].length() - 1)); String world = worldArgs.length > 1 ? worldArgs[1] : snitchMaster.getCurrentWorld(); Location loc = new Location(x, y, z, world); diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/KeyHandler.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/KeyHandler.java index 8deafd5..5325724 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/KeyHandler.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/KeyHandler.java @@ -1,7 +1,7 @@ package com.gmail.nuclearcat1337.snitch_master.handlers; import com.gmail.nuclearcat1337.snitch_master.SnitchMaster; -import com.gmail.nuclearcat1337.snitch_master.gui.MainGui; +import com.gmail.nuclearcat1337.snitch_master.gui.screens.MainGui; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.fml.client.registry.ClientRegistry; diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/QuietTimeHandler.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/QuietTimeHandler.java index c4e8486..3eaa58d 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/QuietTimeHandler.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/handlers/QuietTimeHandler.java @@ -16,6 +16,7 @@ */ public class QuietTimeHandler implements IAlertRecipient { + private static final String QUIET_TIME_CONFIG_KEY = "quiet-time-config"; private final Settings settings; public QuietTimeHandler(Settings settings) diff --git a/src/main/java/com/gmail/nuclearcat1337/snitch_master/util/GeneralUtils.java b/src/main/java/com/gmail/nuclearcat1337/snitch_master/util/GeneralUtils.java index 663edd1..f8b0621 100644 --- a/src/main/java/com/gmail/nuclearcat1337/snitch_master/util/GeneralUtils.java +++ b/src/main/java/com/gmail/nuclearcat1337/snitch_master/util/GeneralUtils.java @@ -1,5 +1,10 @@ package com.gmail.nuclearcat1337.snitch_master.util; +import org.lwjgl.util.*; +import org.lwjgl.util.Color; + +import java.nio.ByteBuffer; + /** * Created by Mr_Little_Kitty on 7/16/2016. */ @@ -14,4 +19,36 @@ public static double DistanceSquared(int x1, int z1, int y1, int x2, int z2, int { return Math.pow(x2 - x1,2) + Math.pow(z2 - z1,2) + Math.pow(y2 - y1,2); } + +// public static int ToColor(float red, float green, float blue, float alpha) +// { +// int returnVal = (Normalize(alpha) << 24); +// returnVal = returnVal | (Normalize(blue) << 16); +// returnVal = returnVal | (Normalize(green) << 8); +// returnVal = returnVal | (Normalize(green)); +// return returnVal; +// } +// +// private static final int RANGE = 127; +// +// private static int Normalize(float value) +// { +// int b; +// if(Float.isNaN(value)) +// b = 0; +// else if(value > 1) +// b = 1; +// else if (value < -1) +// b = -1; +// else +// { +// value = value * (RANGE); +// if(value >= 0) +// value += 0.5f; +// else +// value -= 0.5f; +// b = (int)value; +// } +// return b; +// } }