Skip to content

Commit

Permalink
17 Bindings!
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed Jun 9, 2016
1 parent 3c71fdd commit d96d585
Show file tree
Hide file tree
Showing 22 changed files with 890 additions and 488 deletions.
2 changes: 1 addition & 1 deletion minecriftversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
of_json_name = "1.7.10_HD_U_D1"
of_file_md5 = "57c724fe8335c82aef8d54c101043e60"
minecrift_version_num = "1.7.10"
minecrift_build = "Vivecraft-jrbudda16"
minecrift_build = "Vivecraft-jrbudda17"
of_file_extension = ".jar"
mcp_version = "mcp908"
mcp_uses_generics = False
Expand Down
36 changes: 17 additions & 19 deletions patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -9,19 +9,42 @@
@@ -9,19 +9,40 @@
import com.google.common.util.concurrent.ListenableFutureTask;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
+import com.mtbs3d.minecrift.api.*;
+import com.mtbs3d.minecrift.control.GuiScreenNavigator;
+import com.mtbs3d.minecrift.gameplay.BowTracker;
+import com.mtbs3d.minecrift.gameplay.VRPlayer;
+import com.mtbs3d.minecrift.provider.*;
+import com.mtbs3d.minecrift.render.FBOParams;
+import com.mtbs3d.minecrift.render.RenderConfigException;
+import com.mtbs3d.minecrift.render.ShaderHelper;
+import com.mtbs3d.minecrift.settings.VRHotkeys;
+import com.mtbs3d.minecrift.control.ControlBinding;
+import com.mtbs3d.minecrift.settings.VRSettings;
+import com.mtbs3d.minecrift.utils.TextureSelector;
+
Expand Down Expand Up @@ -43,7 +41,7 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -30,26 +53,18 @@
@@ -30,26 +51,18 @@
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
Expand Down Expand Up @@ -76,15 +74,15 @@
import net.minecraft.client.gui.achievement.GuiAchievement;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.gui.stream.GuiStreamUnavailable;
@@ -97,6 +112,7 @@
@@ -97,6 +110,7 @@
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.shader.Framebuffer;
+import net.minecraft.client.shader.ShaderGroup;
import net.minecraft.client.stream.IStream;
import net.minecraft.client.stream.NullStream;
import net.minecraft.client.stream.TwitchStream;
@@ -127,6 +143,8 @@
@@ -127,6 +141,8 @@
import net.minecraft.profiler.Profiler;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.integrated.IntegratedServer;
Expand All @@ -93,15 +91,15 @@
import net.minecraft.stats.AchievementList;
import net.minecraft.stats.IStatStringFormat;
import net.minecraft.stats.StatFileWriter;
@@ -142,6 +160,7 @@
@@ -142,6 +158,7 @@
import net.minecraft.util.Session;
import net.minecraft.util.Timer;
import net.minecraft.util.Util;
+import net.minecraft.util.Vec3;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell;
@@ -150,640 +169,936 @@
@@ -150,640 +167,936 @@
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
Expand Down Expand Up @@ -1026,7 +1024,7 @@
+ * The minecriftVerString will be automatically updated by the build scripts, do not modify here.
+ * Modify minecriftversion.py in root minecrift dir.
+ */
+ public final String minecriftVerString = "ViveCraft 1.7.10 Vivecraft-jrbudda16";
+ public final String minecriftVerString = "ViveCraft 1.7.10 Vivecraft-jrbudda17";
+ /* end version */
+ /** END MINECRIFT */
+
Expand Down Expand Up @@ -1661,7 +1659,7 @@
{
this.mojangLogo = this.renderEngine.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(this.mcDefaultResourcePack.getInputStream(locationMojangPng))));
this.renderEngine.bindTexture(this.mojangLogo);
@@ -791,2348 +1106,3857 @@
@@ -791,2348 +1104,3857 @@
catch (IOException var7)
{
logger.error("Unable to load logo: " + locationMojangPng, var7);
Expand Down Expand Up @@ -6904,8 +6902,10 @@
+
+ displayFBWidth = (Display.getWidth() < 1) ? 1 : Display.getWidth();
+ displayFBHeight = (Display.getHeight() < 1) ? 1 : Display.getHeight();
+
+ distortionRenderTargetSize[0] = new Sizei(displayFBWidth, displayFBHeight);
+ distortionRenderTargetSize[1] = distortionRenderTargetSize[0];
+
+ this.EyeTextureSize[0].w = this.displayWidth = (int)ceil((displayFBWidth * superSampleScaleFactor));
+ this.EyeTextureSize[0].h = this.displayHeight = (int)ceil((displayFBHeight * superSampleScaleFactor));
+ this.EyeTextureSize[1] = this.EyeTextureSize[0];
Expand Down Expand Up @@ -6936,7 +6936,6 @@
+
+ viewPortCount = 2;
+
+ // Oculus scaled render height seems ridiculous? For DK1, yes.
+ }
+
+ if (this.framebuffers[0] != null) {
Expand Down Expand Up @@ -6995,7 +6994,7 @@
+ this.entityRenderer.generatedIconMipmaps[1] = false;
+
+ if (this.stereoProvider.providesMirrorTexture() && this.vrSettings.displayMirrorMode != VRSettings.MIRROR_OFF)
+ {
+ { //alwasy false
+ this.mirrorFBWidth = this.displayFBWidth;
+ this.mirrorFBHeight = this.displayFBHeight;
+ if (this.vrSettings.displayMirrorMode == VRSettings.MIRROR_ON_FULL_FRAME_RATE_SINGLE_VIEW ||
Expand All @@ -7016,7 +7015,7 @@
+ this.checkGLError("Mirror framebuffer setup");
+
+ if (this.stereoProvider.providesRenderTextures())
+ {
+ { //always true
+ // Source render textures
+ RenderTextureSet renderTextures = this.stereoProvider.createRenderTextureSet(
+ distortionRenderTargetSize[0].w,
Expand Down Expand Up @@ -7123,6 +7122,7 @@
+ }
+ this.loadingScreen = new LoadingScreenRenderer(this, this.stereoProvider.isGuiOrtho() ? this.displayWidth : this.displayFBWidth, this.stereoProvider.isGuiOrtho() ? this.displayHeight : this.displayFBHeight);
+ this.loadingScreen.deleteFramebuffer();
+
+ if (this.stereoProvider.isGuiOrtho()) {
+ this.loadingScreen.renderTarget = this.getFramebuffer();
+ }
Expand Down Expand Up @@ -7157,10 +7157,10 @@
+
+ if (this.firstInit)
+ {
+ // Workaround for bad init of Oculus SDK
+ this.firstInit = false;
+ this.reinitFramebuffers = true;
+ System.out.println("[Minecrift] Now re-init for Oculus SDK weirdness...");
+// // Workaround for bad init of Oculus SDK
+// this.firstInit = false;
+// this.reinitFramebuffers = true;
+// System.out.println("[Minecrift] Now re-init for Oculus SDK weirdness...");
+ }
+ }
+
Expand Down Expand Up @@ -7375,8 +7375,6 @@
+ System.err.println("Skipping loading: [MumbleLink library]: Configuration setting disabled loading");
+ }
+
+ GuiScreenNavigator.initGuiLeftTop();
+
+ this.EyeTextureSize[0] = new Sizei();
+ this.EyeTextureSize[1] = new Sizei();
+
Expand Down
7 changes: 5 additions & 2 deletions patches/net/minecraft/client/gui/GuiScreen.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -220,24 +220,26 @@
else
{
this.drawBackground(tint);
@@ -441,4 +535,79 @@
@@ -441,4 +535,82 @@
{
return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54);
}
+
+ /** MINECRIFT ADDITIONS BELOW */
+
+ public static boolean mouseDown;
+ public void mouseDown( int rawX, int rawY, int button )
+ {
+ int var1 = rawX * this.width / this.mc.displayFBWidth;
+ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1;
+ this.eventButton = button;
+ this.lastMouseEvent = Minecraft.getSystemTime();
+ mouseClicked(var1, var2, button);
+ mouseDown = true;
+ }
+
+ public void mouseUp( int rawX, int rawY, int button )
+ {
+ mouseDown = false;
+ int var1 = rawX * this.width / this.mc.displayFBWidth;
+ int var2 = this.height - rawY * this.height / this.mc.displayFBHeight - 1;
+ mouseReleased(var1, var2, button);
Expand All @@ -260,6 +262,7 @@
+
+ public void mouseGuiUp( int guiX, int guiY, int button )
+ {
+ mouseDown = false;
+ mouseReleased(guiX, guiY, button);
+ }
+
Expand Down
113 changes: 104 additions & 9 deletions patches/net/minecraft/client/gui/GuiSlot.java.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
--- a/net/minecraft/client/gui/GuiSlot.java
+++ b/net/minecraft/client/gui/GuiSlot.java
@@ -1,28 +1,31 @@
package net.minecraft.client.gui;

+import com.mtbs3d.minecrift.control.GuiScreenNavigator;
@@ -3,26 +3,28 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
Expand Down Expand Up @@ -40,6 +37,14 @@
/** The buttonID of the button used to scroll up */
private int scrollUpButtonID;

@@ -32,6 +34,7 @@
protected int mouseY;
protected boolean field_148163_i = true;

+
/** Where the mouse was in the window when you first clicked to scroll */
private float initialClickY = -2.0F;

@@ -55,7 +58,9 @@
*/
private boolean showSelectionBox = true;
Expand All @@ -51,18 +56,90 @@
private boolean enabled = true;
private static final String __OBFID = "CL_00000679";

@@ -242,7 +247,9 @@
@@ -227,10 +232,12 @@
}
}

- public void drawScreen(int p_148128_1_, int p_148128_2_, float p_148128_3_)
+
+
+ public void drawScreen(int mx, int my, float nano)
{
- this.mouseX = p_148128_1_;
- this.mouseY = p_148128_2_;
+ this.mouseX = mx;
+ this.mouseY = my;
this.drawBackground();
int var4 = this.getSize();
int var5 = this.getScrollBarX();
@@ -240,35 +247,37 @@
int var13;
int var19;

if (p_148128_1_ > this.left && p_148128_1_ < this.right && p_148128_2_ > this.top && p_148128_2_ < this.bottom)
- if (p_148128_1_ > this.left && p_148128_1_ < this.right && p_148128_2_ > this.top && p_148128_2_ < this.bottom)
+ if (mx > this.left && mx < this.right && my > this.top && my < this.bottom)
{
- if (Mouse.isButtonDown(0) && this.getEnabled())
+ /** MINECRIFT */ // Allow gui cursor emulation with clickable scroll bars
+ if (( Mouse.isButtonDown(0) || GuiScreenNavigator.selectDepressed )&& this.getEnabled())
+ if (( Mouse.isButtonDown(0) || GuiScreen.mouseDown )&& this.getEnabled())
+ /** END MINECRIFT */
{
if (this.initialClickY == -1.0F)
{
@@ -346,16 +353,21 @@
boolean var15 = true;

- if (p_148128_2_ >= this.top && p_148128_2_ <= this.bottom)
+ if (my >= this.top && my <= this.bottom)
{
int var8 = this.width / 2 - this.getListWidth() / 2;
var9 = this.width / 2 + this.getListWidth() / 2;
- var10 = p_148128_2_ - this.top - this.headerPadding + (int)this.amountScrolled - 4;
+ var10 = my - this.top - this.headerPadding + (int)this.amountScrolled - 4;
int var11 = var10 / this.slotHeight;

- if (p_148128_1_ >= var8 && p_148128_1_ <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4)
+ if (mx >= var8 && mx <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4)
{
boolean var12 = var11 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L;
- this.elementClicked(var11, var12, p_148128_1_, p_148128_2_);
+ this.elementClicked(var11, var12, mx, my);
this.selectedElement = var11;
this.lastClicked = Minecraft.getSystemTime();
}
- else if (p_148128_1_ >= var8 && p_148128_1_ <= var9 && var10 < 0)
+ else if (mx >= var8 && mx <= var9 && var10 < 0)
{
- this.func_148132_a(p_148128_1_ - var8, p_148128_2_ - this.top + (int)this.amountScrolled - 4);
+ this.func_148132_a(mx - var8, my - this.top + (int)this.amountScrolled - 4);
var15 = false;
}

- if (p_148128_1_ >= var5 && p_148128_1_ <= var6)
+ if (mx >= var5 && mx <= var6)
{
this.scrollMultiplier = -1.0F;
var19 = this.func_148135_f();
@@ -299,7 +308,7 @@

if (var15)
{
- this.initialClickY = (float)p_148128_2_;
+ this.initialClickY = (float)my;
}
else
{
@@ -313,8 +322,8 @@
}
else if (this.initialClickY >= 0.0F)
{
- this.amountScrolled -= ((float)p_148128_2_ - this.initialClickY) * this.scrollMultiplier;
- this.initialClickY = (float)p_148128_2_;
+ this.amountScrolled -= ((float)my - this.initialClickY) * this.scrollMultiplier;
+ this.initialClickY = (float)my;
}
}
else
@@ -346,16 +355,21 @@
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator var16 = Tessellator.instance;
Expand Down Expand Up @@ -94,7 +171,25 @@
var9 = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
var10 = this.top + 4 - (int)this.amountScrolled;

@@ -539,4 +551,33 @@
@@ -364,7 +378,7 @@
this.drawListHeader(var9, var10, var16);
}

- this.drawSelectionBox(var9, var10, p_148128_1_, p_148128_2_);
+ this.drawSelectionBox(var9, var10, mx, my);
GL11.glDisable(GL11.GL_DEPTH_TEST);
byte var18 = 4;
this.overlayBackground(0, this.top, 255, 255);
@@ -436,7 +450,7 @@
var16.draw();
}

- this.func_148142_b(p_148128_1_, p_148128_2_);
+ this.func_148142_b(mx, my);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glEnable(GL11.GL_ALPHA_TEST);
@@ -539,4 +553,33 @@
{
return this.slotHeight;
}
Expand Down
15 changes: 14 additions & 1 deletion patches/net/minecraft/client/gui/GuiTextField.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/client/gui/GuiTextField.java
+++ b/net/minecraft/client/gui/GuiTextField.java
@@ -1,9 +1,12 @@
@@ -1,18 +1,21 @@
package net.minecraft.client.gui;

+import net.minecraft.client.Minecraft;
Expand All @@ -13,6 +13,19 @@
public class GuiTextField extends Gui
{
private final FontRenderer fontRendererInstance;
- private final int xPosition;
- private final int yPosition;
+ public int xPosition;
+ public int yPosition;

/** The width of this text field. */
- private final int width;
- private final int height;
+ public int width;
+ public int height;

/** Has the current text being edited on the textbox. */
private String text = "";
@@ -473,6 +476,13 @@
if (this.canLoseFocus)
{
Expand Down
Loading

0 comments on commit d96d585

Please sign in to comment.