Rename "BlockRenderer" to "GLBlockRenderer"

pull/12/head^2
Caroline Bell 2020-03-03 16:37:21 -08:00
parent 09124112c3
commit 3ae89df0cd
5 changed files with 16 additions and 16 deletions

View File

@ -208,5 +208,5 @@ public class Litecraft extends Game
@Override
public void renderScene()
{ world.render(GingerRegister.getInstance().masterRenderer.blockRenderer); }
{ world.render(GingerRegister.getInstance().masterRenderer.gLBlockRenderer); }
}

View File

@ -14,12 +14,12 @@ import com.github.hydos.ginger.engine.opengl.render.models.GLTexturedModel;
import com.github.hydos.ginger.engine.opengl.render.shaders.StaticShader;
import com.github.hydos.ginger.engine.opengl.utils.GLLoader;
public class BlockRenderer extends Renderer implements WorldGenConstants
public class GLBlockRenderer extends Renderer implements WorldGenConstants
{
public StaticShader shader;
public int atlasID;
public BlockRenderer(StaticShader shader, Matrix4f projectionMatrix)
public GLBlockRenderer(StaticShader shader, Matrix4f projectionMatrix)
{
this.shader = shader;
shader.start();

View File

@ -6,7 +6,7 @@ import java.util.function.ToIntFunction;
import org.joml.Vector3f;
import com.github.halotroop.litecraft.logic.SODSerializable;
import com.github.halotroop.litecraft.render.BlockRenderer;
import com.github.halotroop.litecraft.render.GLBlockRenderer;
import com.github.halotroop.litecraft.types.block.*;
import com.github.halotroop.litecraft.world.gen.WorldGenConstants;
@ -67,7 +67,7 @@ public class Chunk implements BlockAccess, WorldGenConstants, SODSerializable
return this.blockInstances[index(x, y, z)];
}
public void render(BlockRenderer blockRenderer)
public void render(GLBlockRenderer gLBlockRenderer)
{
if (shouldRender)
{
@ -103,9 +103,9 @@ public class Chunk implements BlockAccess, WorldGenConstants, SODSerializable
}
renderedBlocks = tempList.toArray(BlockInstance[]::new);
}
blockRenderer.prepareRender();
blockRenderer.render(renderedBlocks);
blockRenderer.shader.stop();
gLBlockRenderer.prepareRender();
gLBlockRenderer.render(renderedBlocks);
gLBlockRenderer.shader.stop();
}
}

View File

@ -8,7 +8,7 @@ import java.util.function.LongConsumer;
import org.joml.Vector3f;
import com.github.halotroop.litecraft.Litecraft;
import com.github.halotroop.litecraft.render.BlockRenderer;
import com.github.halotroop.litecraft.render.GLBlockRenderer;
import com.github.halotroop.litecraft.save.LitecraftSave;
import com.github.halotroop.litecraft.types.block.*;
import com.github.halotroop.litecraft.types.entity.PlayerEntity;
@ -166,18 +166,18 @@ public class World implements BlockAccess, WorldGenConstants
public Chunk optimiseChunk(Chunk chunk)
{ return chunk; }
public void render(BlockRenderer blockRenderer)
public void render(GLBlockRenderer gLBlockRenderer)
{
blockRenderer.prepareModel(this.dummy.getModel());
gLBlockRenderer.prepareModel(this.dummy.getModel());
try
{
this.chunks.forEach((pos, c) -> c.render(blockRenderer));
this.chunks.forEach((pos, c) -> c.render(gLBlockRenderer));
}
catch (NullPointerException e)
{
System.out.println("Null chunk - we should look into fixing this");
}
blockRenderer.unbindModel();
gLBlockRenderer.unbindModel();
}
public void unloadAllChunks()

View File

@ -6,7 +6,7 @@ import java.util.*;
import org.joml.*;
import org.lwjgl.opengl.*;
import com.github.halotroop.litecraft.render.BlockRenderer;
import com.github.halotroop.litecraft.render.GLBlockRenderer;
import com.github.hydos.ginger.engine.common.api.GingerRegister;
import com.github.hydos.ginger.engine.common.cameras.Camera;
import com.github.hydos.ginger.engine.common.elements.GuiTexture;
@ -32,7 +32,7 @@ public class MasterRenderer
// GL11.glCullFace(GL11.GL_BACK);
}
public BlockRenderer blockRenderer;
public GLBlockRenderer gLBlockRenderer;
private StaticShader entityShader;
public ObjectRenderer entityRenderer;
private GuiShader guiShader;
@ -48,7 +48,7 @@ public class MasterRenderer
{
createProjectionMatrix();
entityShader = new StaticShader();
blockRenderer = new BlockRenderer(entityShader, projectionMatrix);
gLBlockRenderer = new GLBlockRenderer(entityShader, projectionMatrix);
entityRenderer = new ObjectRenderer(entityShader, projectionMatrix);
guiShader = new GuiShader();
guiRenderer = new GuiRenderer(guiShader);