diff --git a/Minecraft.Client/Textures.cpp b/Minecraft.Client/Textures.cpp index ab9db75d..b149c554 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -428,7 +428,7 @@ void Textures::bindTextureLayers(ResourceLocation *resource) for( int i = 0; i < layers; i++ ) { - RenderManager.TextureBind(loadTexture(resource->getTexture(i))); + RenderManager.TextureBind(i, loadTexture(resource->getTexture(i))); } } @@ -1520,3 +1520,4 @@ bool Textures::IsOriginalImage(TEXTURE_NAME texId, const wstring& name) return false; } + diff --git a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h index 737caa98..7efb48a2 100644 --- a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h @@ -145,6 +145,7 @@ public: int TextureCreate(); void TextureFree(int idx); void TextureBind(int idx); + void TextureBind(int layer, int idx); void TextureBindVertex(int idx); void TextureSetTextureLevels(int levels); int TextureGetTextureLevels(); @@ -300,3 +301,4 @@ const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP; extern C4JRender RenderManager; + diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Input.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Input.lib index 97574f8b..7eb8adc5 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Input.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Input.lib differ diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib index ce813f01..747d00da 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib differ diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile.lib index 67ccaac6..f5bcb75b 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile.lib differ diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile_d.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile_d.lib index 64f56bc2..629f4fdf 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile_d.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Profile_d.lib differ diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Render.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Render.lib index 88d8ea78..438694fe 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Render.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Render.lib differ diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_d.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_d.lib index e7fc9c31..e92d2eec 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_d.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_d.lib differ diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage.lib index 7779496c..ab622033 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage.lib differ diff --git a/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib b/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib index 5699e91c..677931b6 100644 Binary files a/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib and b/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib differ diff --git a/Minecraft.Client/glWrapper.cpp b/Minecraft.Client/glWrapper.cpp index 540271b9..a7bc43e6 100644 --- a/Minecraft.Client/glWrapper.cpp +++ b/Minecraft.Client/glWrapper.cpp @@ -3,6 +3,17 @@ #include "..\Minecraft.World\IntBuffer.h" #include "..\Minecraft.World\ByteBuffer.h" +static int g_activeTextureLayer = 0; + +static int getTextureLayer(int textureUnit) +{ + if (textureUnit == GL_TEXTURE1) + return 1; + if (textureUnit >= GL_TEXTURE0) + return textureUnit - GL_TEXTURE0; + return 0; +} + void glViewport(int x, int y, int w, int h) { // We don't really need anything here because minecraft doesn't current do anything other than the default viewport @@ -139,7 +150,7 @@ void Display::swapBuffers() void glBindTexture(int target,int texture) { - RenderManager.TextureBind(texture); + RenderManager.TextureBind(g_activeTextureLayer, texture); } void glTexImage2D(int target,int level,int internalformat,int width,int height,int border,int format,int type, ByteBuffer *data) @@ -190,7 +201,7 @@ void glDisable(int state) switch(state) { case GL_TEXTURE_2D: - RenderManager.TextureBind(-1); + RenderManager.TextureBind(g_activeTextureLayer, -1); break; case GL_BLEND: RenderManager.StateSetBlendEnable(false); @@ -390,4 +401,23 @@ void glTexGen(int coord, int mode, FloatBuffer *vec) void glCullFace(int dir) { RenderManager.StateSetFaceCullCW( dir == GL_BACK); -} \ No newline at end of file +} +void glClientActiveTexture(int texture) +{ + glActiveTexture(texture); +} + +void glActiveTexture(int texture) +{ + int layer = getTextureLayer(texture); + if (layer < 0) + { + layer = 0; + } + else if (layer > 3) + { + layer = 3; + } + g_activeTextureLayer = layer; +} + diff --git a/Minecraft.Client/stubs.cpp b/Minecraft.Client/stubs.cpp index 16215ba2..43eae721 100644 --- a/Minecraft.Client/stubs.cpp +++ b/Minecraft.Client/stubs.cpp @@ -122,13 +122,6 @@ void glColorMaterial(int,int) } //1.8.2 -void glClientActiveTexture(int) -{ -} - -void glActiveTexture(int) -{ -} void glFlush() { @@ -157,4 +150,4 @@ DWORD XCamSetView( ) { return 0; } XCAMDEVICESTATE XCamGetStatus() { return XCAMDEVICESTATE_DISCONNECTED; } -#endif \ No newline at end of file +#endif