From 2f07a00b54658993773d52474aa6f3f64cca843b Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 23 Mar 2018 22:02:27 +1100 Subject: [PATCH] Fix last commit --- .../Entities/Components/CollisionsComponent.cs | 7 +++++-- Launcher2/Gui/Views/ChooseModeView.cs | 18 +++++++++--------- Launcher2/Gui/Views/ColoursView.cs | 6 +++--- Launcher2/Gui/Views/MainView.cs | 4 ++-- Launcher2/Gui/Views/ServersView.cs | 12 ++++++------ Launcher2/Gui/Widgets/Widget.cs | 4 ++-- src/Client/EntityComponents.c | 8 ++++---- 7 files changed, 31 insertions(+), 28 deletions(-) diff --git a/ClassicalSharp/Entities/Components/CollisionsComponent.cs b/ClassicalSharp/Entities/Components/CollisionsComponent.cs index 9c1a07814..7d1b34846 100644 --- a/ClassicalSharp/Entities/Components/CollisionsComponent.cs +++ b/ClassicalSharp/Entities/Components/CollisionsComponent.cs @@ -53,8 +53,11 @@ namespace ClassicalSharp.Entities { State state = Searcher.stateCache[i]; bPos.X = state.X >> 3; bPos.Y = state.Y >> 3; bPos.Z = state.Z >> 3; int block = (state.X & 0x7) | (state.Y & 0x7) << 3 | (state.Z & 0x7) << 6; - blockBB.Min = bPos + BlockInfo.MinBB[block]; - blockBB.Max = bPos + BlockInfo.MaxBB[block]; + + blockBB.Min = BlockInfo.MinBB[block]; + blockBB.Min.X += bPos.X; blockBB.Min.Y += bPos.Y; blockBB.Min.Z += bPos.Z; + blockBB.Max = BlockInfo.MaxBB[block]; + blockBB.Max.X += bPos.X; blockBB.Max.Y += bPos.Y; blockBB.Max.Z += bPos.Z; if (!entityExtentBB.Intersects(blockBB)) continue; // Recheck time to collide with block (as colliding with blocks modifies this) diff --git a/Launcher2/Gui/Views/ChooseModeView.cs b/Launcher2/Gui/Views/ChooseModeView.cs index 7fb911866..b4dfd328e 100644 --- a/Launcher2/Gui/Views/ChooseModeView.cs +++ b/Launcher2/Gui/Views/ChooseModeView.cs @@ -42,27 +42,27 @@ namespace Launcher.Gui.Views { nIndex = widgetIndex; Makers.Button(this, "Enhanced", 145, 35, titleFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 250, -72); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 250, -72); Makers.Label(this, "&eEnables custom blocks, changing env", textFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, -72 - 12); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, -72 - 12); Makers.Label(this, "&esettings, longer messages, and more", textFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, -72 + 12); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, -72 + 12); clHaxIndex = widgetIndex; Makers.Button(this, "Classic +hax", 145, 35, titleFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 250, 0); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 250, 0); Makers.Label(this, "&eSame as Classic mode, except that", textFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 0 - 12); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 0 - 12); Makers.Label(this, "&ehacks (noclip/fly/speed) are enabled", textFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 0 + 12); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 0 + 12); clIndex = widgetIndex; Makers.Button(this, "Classic", 145, 35, titleFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 250, 72); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 250, 72); Makers.Label(this, "&eOnly uses blocks and features from", textFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 72 - 12); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 72 - 12); Makers.Label(this, "ðe original minecraft classic", textFont) - .SetLocation(Anchor.LeftOrTop, Anchor.Centre, middle - 85, 72 + 12); + .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 72 + 12); if (FirstTime) { backIndex = -1; diff --git a/Launcher2/Gui/Views/ColoursView.cs b/Launcher2/Gui/Views/ColoursView.cs index 9e9eac349..2057fdfc9 100644 --- a/Launcher2/Gui/Views/ColoursView.cs +++ b/Launcher2/Gui/Views/ColoursView.cs @@ -60,11 +60,11 @@ namespace Launcher.Gui.Views { sliderIndex = widgetIndex; Makers.Slider(this, 100, 10, 30, 255, FastColour.Red) - .SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 5, 5); + .SetLocation(Anchor.Min, Anchor.Min, 5, 5); Makers.Slider(this, 100, 10, 30, 255, FastColour.Green) - .SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 5, 25); + .SetLocation(Anchor.Min, Anchor.Min, 5, 25); Makers.Slider(this, 100, 10, 30, 255, FastColour.Blue) - .SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 5, 45); + .SetLocation(Anchor.Min, Anchor.Min, 5, 45); } public void MakeAllRGBTriplets(bool force) { diff --git a/Launcher2/Gui/Views/MainView.cs b/Launcher2/Gui/Views/MainView.cs index 2615a56a4..b70a65a6f 100644 --- a/Launcher2/Gui/Views/MainView.cs +++ b/Launcher2/Gui/Views/MainView.cs @@ -65,11 +65,11 @@ namespace Launcher.Gui.Views { widgets[sslIndex + 1].Visible = sslVisible; Makers.Label(this, updateText, inputHintFont) - .SetLocation(Anchor.BottomOrRight, Anchor.BottomOrRight, -10, -45); + .SetLocation(Anchor.Max, Anchor.Max, -10, -45); settingsIndex = widgetIndex; Makers.Button(this, "Options", 100, buttonHeight, titleFont) - .SetLocation(Anchor.BottomOrRight, Anchor.BottomOrRight, -6, -6); + .SetLocation(Anchor.Max, Anchor.Max, -6, -6); } } } diff --git a/Launcher2/Gui/Views/ServersView.cs b/Launcher2/Gui/Views/ServersView.cs index 2b8492afe..4acf9bacb 100644 --- a/Launcher2/Gui/Views/ServersView.cs +++ b/Launcher2/Gui/Views/ServersView.cs @@ -36,18 +36,18 @@ namespace Launcher.Gui.Views { protected override void MakeWidgets() { widgetIndex = 0; MakeInput(Get(0), 370, false, 32, "&gSearch servers..") - .SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 10, 10); + .SetLocation(Anchor.Min, Anchor.Min, 10, 10); MakeInput(Get(1), 475, false, 32, "&gclassicube.net/server/play/...") - .SetLocation(Anchor.LeftOrTop, Anchor.BottomOrRight, 10, -10); + .SetLocation(Anchor.Min, Anchor.Max, 10, -10); Makers.Button(this, "Back", 110, 30, titleFont) - .SetLocation(Anchor.BottomOrRight, Anchor.LeftOrTop, -10, 10); + .SetLocation(Anchor.Max, Anchor.Min, -10, 10); Makers.Button(this, "Connect", 130, 30, titleFont) - .SetLocation(Anchor.BottomOrRight, Anchor.BottomOrRight, -10, -10); + .SetLocation(Anchor.Max, Anchor.Max, -10, -10); MakeTableWidget(); Makers.Button(this, RefreshText, 110, 30, titleFont) - .SetLocation(Anchor.BottomOrRight, Anchor.LeftOrTop, -135, 10); + .SetLocation(Anchor.Max, Anchor.Min, -135, 10); } string Get(int index) { @@ -93,7 +93,7 @@ namespace Launcher.Gui.Views { void ResetTable(TableWidget widget) { widget.SetEntries(game.Servers); widget.SetDrawData(drawer, tableFont, textFont, - Anchor.LeftOrTop, Anchor.LeftOrTop, tableX, tableY); + Anchor.Min, Anchor.Min, tableX, tableY); widget.SortDefault(); } diff --git a/Launcher2/Gui/Widgets/Widget.cs b/Launcher2/Gui/Widgets/Widget.cs index 1d16ca8aa..90f0ae00f 100644 --- a/Launcher2/Gui/Widgets/Widget.cs +++ b/Launcher2/Gui/Widgets/Widget.cs @@ -63,8 +63,8 @@ namespace Launcher.Gui.Widgets { } static int CalcPos(Anchor anchor, int offset, int size, int axisLen) { - if (anchor == Anchor.LeftOrTop) return offset; - if (anchor == Anchor.BottomOrRight) return offset + axisLen - size; + if (anchor == Anchor.Min) return offset; + if (anchor == Anchor.Max) return offset + axisLen - size; return offset + axisLen / 2 - size / 2; } } diff --git a/src/Client/EntityComponents.c b/src/Client/EntityComponents.c index 6e061da80..7b798362f 100644 --- a/src/Client/EntityComponents.c +++ b/src/Client/EntityComponents.c @@ -467,10 +467,10 @@ void ShadowComponent_DrawCoords(VertexP3fT2fC4b** vertices, Entity* entity, Shad VertexP3fT2fC4b* ptr = *vertices; VertexP3fT2fC4b v; v.Y = data->Y; v.Col = col; - v.X = x1; v.Z = z1; v.U = u1; v.V = v1; *ptr = v; ptr++; - v.X = x2; v.U = u2; *ptr = v; ptr++; - v.Z = z2; v.V = v2; *ptr = v; ptr++; - v.X = x1; v.U = u1; *ptr = v; ptr++; + v.X = x1; v.Z = z1; v.U = u1; v.V = v1; *ptr++ = v; + v.X = x2; v.U = u2; *ptr++ = v; + v.Z = z2; v.V = v2; *ptr++ = v; + v.X = x1; v.U = u1; *ptr++ = v; *vertices = ptr; }