mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Porting Forge rendering code to 1.13 (#5132)
This commit is contained in:
1 parent
eac693e785
commit
dde7dccef1
57 files changed
+1186
-775
No files matched your search
@@ -39,12 +39,12 @@ import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexBuffer;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.resources.IReloadableResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.resources.IReloadableResourceManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.client.resource.ISelectiveResourceReloadListener;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
public CloudRenderer()
|
||||
{
|
||||
// Resource manager should always be reloadable.
|
||||
((IReloadableResourceManager) mc.getResourceManager()).registerReloadListener(this);
|
||||
((IReloadableResourceManager) mc.func_195551_G()).func_199006_a(this);
|
||||
}
|
||||
|
||||
private int getScale()
|
||||
@@ -345,24 +345,14 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
float g = (float) color.y;
|
||||
float b = (float) color.z;
|
||||
|
||||
if (mc.gameSettings.anaglyph)
|
||||
{
|
||||
float tempR = r * 0.3F + g * 0.59F + b * 0.11F;
|
||||
float tempG = r * 0.3F + g * 0.7F;
|
||||
float tempB = r * 0.3F + b * 0.7F;
|
||||
r = tempR;
|
||||
g = tempG;
|
||||
b = tempB;
|
||||
}
|
||||
|
||||
if (COLOR_TEX == null)
|
||||
COLOR_TEX = new DynamicTexture(1, 1);
|
||||
COLOR_TEX = new DynamicTexture(1, 1, false);
|
||||
|
||||
// Apply a color multiplier through a texture upload if shaders aren't supported.
|
||||
COLOR_TEX.getTextureData()[0] = 255 << 24
|
||||
COLOR_TEX.func_195414_e().func_195700_a(0, 0, 255 << 24
|
||||
| ((int) (r * 255)) << 16
|
||||
| ((int) (g * 255)) << 8
|
||||
| (int) (b * 255);
|
||||
| (int) (b * 255));
|
||||
COLOR_TEX.updateDynamicTexture();
|
||||
|
||||
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
||||
@@ -404,22 +394,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||
GlStateManager.callList(displayList);
|
||||
|
||||
// Full render.
|
||||
if (!mc.gameSettings.anaglyph)
|
||||
{
|
||||
GlStateManager.colorMask(true, true, true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (EntityRenderer.anaglyphField)
|
||||
{
|
||||
case 0:
|
||||
GlStateManager.colorMask(false, true, true, true);
|
||||
break;
|
||||
case 1:
|
||||
GlStateManager.colorMask(true, false, false, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
GlStateManager.colorMask(true, true, true, true);
|
||||
|
||||
// Wireframe for debug.
|
||||
if (WIREFRAME)
|
||||
|
||||
Reference in new issue
Block a user