From 03b061083e2ed0015881456f1d7cd794897d763f Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 3 Aug 2018 15:15:36 +1000 Subject: [PATCH] and also make those changes to C client. (and also fix held block colour) --- ClassicalSharp/Program.cs | 7 ------- src/Client/EnvRenderer.c | 24 ++++++++++++------------ src/Client/HeldBlockRenderer.c | 1 + 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/ClassicalSharp/Program.cs b/ClassicalSharp/Program.cs index 914407cc6..3f4009805 100644 --- a/ClassicalSharp/Program.cs +++ b/ClassicalSharp/Program.cs @@ -22,13 +22,6 @@ namespace ClassicalSharp { return; } - // NOTE: we purposely put this in another method, as we need to ensure - // that we do not reference any OpenTK code directly in the main function - // (such as DisplayDevice), which otherwise causes native crash. - RunGame(args); - } - - static void RunGame(string[] args) { ErrorHandler.InstallHandler("client.log"); OpenTK.Configuration.SkipPerfCountersHack(); Utils.LogDebug("Starting " + AppName + ".."); diff --git a/src/Client/EnvRenderer.c b/src/Client/EnvRenderer.c index ff612ad8f..777f96481 100644 --- a/src/Client/EnvRenderer.c +++ b/src/Client/EnvRenderer.c @@ -305,23 +305,23 @@ static void EnvRenderer_UpdateSkybox(void) { static VertexP3fT2fC4b vertices[SKYBOX_COUNT] = { /* Front quad */ - { 1, -1, -1, {0,0,0,0}, 0.25f, 1.00f }, { -1, -1, -1, {0,0,0,0}, 0.50f, 1.00f }, - { -1, 1, -1, {0,0,0,0}, 0.50f, 0.50f }, { 1, 1, -1, {0,0,0,0}, 0.25f, 0.50f }, + { -1, -1, -1, {0,0,0,0}, 0.25f, 1.00f }, { 1, -1, -1, {0,0,0,0}, 0.50f, 1.00f }, + { 1, 1, -1, {0,0,0,0}, 0.50f, 0.50f }, { -1, 1, -1, {0,0,0,0}, 0.25f, 0.50f }, /* Left quad */ - { 1, -1, 1, {0,0,0,0}, 0.00f, 1.00f }, { 1, -1, -1, {0,0,0,0}, 0.25f, 1.00f }, - { 1, 1, -1, {0,0,0,0}, 0.25f, 0.50f }, { 1, 1, 1, {0,0,0,0}, 0.00f, 0.50f }, + { -1, -1, 1, {0,0,0,0}, 0.00f, 1.00f }, { -1, -1, -1, {0,0,0,0}, 0.25f, 1.00f }, + { -1, 1, -1, {0,0,0,0}, 0.25f, 0.50f }, { -1, 1, 1, {0,0,0,0}, 0.00f, 0.50f }, /* Back quad */ - { -1, -1, 1, {0,0,0,0}, 0.75f, 1.00f }, { 1, -1, 1, {0,0,0,0}, 1.00f, 1.00f }, - { 1, 1, 1, {0,0,0,0}, 1.00f, 0.50f }, { -1, 1, 1, {0,0,0,0}, 0.75f, 0.50f }, + { 1, -1, 1, {0,0,0,0}, 0.75f, 1.00f }, { -1, -1, 1, {0,0,0,0}, 1.00f, 1.00f }, + { -1, 1, 1, {0,0,0,0}, 1.00f, 0.50f }, { 1, 1, 1, {0,0,0,0}, 0.75f, 0.50f }, /* Right quad */ - { -1, -1, -1, {0,0,0,0}, 0.50f, 1.00f }, { -1, -1, 1, {0,0,0,0}, 0.75f, 1.00f }, - { -1, 1, 1, {0,0,0,0}, 0.75f, 0.50f }, { -1, 1, -1, {0,0,0,0}, 0.50f, 0.50f }, + { 1, -1, -1, {0,0,0,0}, 0.50f, 1.00f }, { 1, -1, 1, {0,0,0,0}, 0.75f, 1.00f }, + { 1, 1, 1, {0,0,0,0}, 0.75f, 0.50f }, { 1, 1, -1, {0,0,0,0}, 0.50f, 0.50f }, /* Top quad */ - { -1, 1, -1, {0,0,0,0}, 0.50f, 0.50f }, { -1, 1, 1, {0,0,0,0}, 0.50f, 0.00f }, - { 1, 1, 1, {0,0,0,0}, 0.25f, 0.00f }, { 1, 1, -1, {0,0,0,0}, 0.25f, 0.50f }, + { 1, 1, -1, {0,0,0,0}, 0.50f, 0.50f }, { 1, 1, 1, {0,0,0,0}, 0.50f, 0.00f }, + { -1, 1, 1, {0,0,0,0}, 0.25f, 0.00f }, { -1, 1, -1, {0,0,0,0}, 0.25f, 0.50f }, /* Bottom quad */ - { -1, -1, -1, {0,0,0,0}, 0.75f, 0.50f }, { -1, -1, 1, {0,0,0,0}, 0.75f, 0.00f }, - { 1, -1, 1, {0,0,0,0}, 0.50f, 0.00f }, { 1, -1, -1, {0,0,0,0}, 0.50f, 0.50f }, + { 1, -1, -1, {0,0,0,0}, 0.75f, 0.50f }, { 1, -1, 1, {0,0,0,0}, 0.75f, 0.00f }, + { -1, -1, 1, {0,0,0,0}, 0.50f, 0.00f }, { -1, -1, -1, {0,0,0,0}, 0.50f, 0.50f }, }; Int32 i; diff --git a/src/Client/HeldBlockRenderer.c b/src/Client/HeldBlockRenderer.c index b234c8002..00618d05b 100644 --- a/src/Client/HeldBlockRenderer.c +++ b/src/Client/HeldBlockRenderer.c @@ -226,6 +226,7 @@ static void HeldBlockRenderer_Init(void) { held_entityVTABLE = *held_entity.VTABLE; held_entityVTABLE.GetCol = HeldBlockRenderer_GetCol; held_entity.VTABLE = &held_entityVTABLE; + held_entity.NoShade = true; held_lastBlock = Inventory_SelectedBlock; Event_RegisterVoid(&GfxEvents_ProjectionChanged, NULL, HeldBlockRenderer_ProjectionChanged);