and also make those changes to C client. (and also fix held block colour)

This commit is contained in:
UnknownShadow200 2018-08-03 15:15:36 +10:00
parent 3b24617c62
commit 03b061083e
3 changed files with 13 additions and 19 deletions

View file

@ -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 + "..");

View file

@ -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;

View file

@ -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);