yay merge conflict fixes

pull/12/head
hYdos 2020-03-03 16:27:53 +10:00
parent 86a82d9a6a
commit a635c549c1
8 changed files with 13 additions and 32 deletions

View File

@ -20,14 +20,8 @@ import com.github.hydos.ginger.engine.common.obj.ModelLoader;
import com.github.hydos.ginger.engine.opengl.api.*; import com.github.hydos.ginger.engine.opengl.api.*;
import com.github.hydos.ginger.engine.opengl.postprocessing.PostProcessing; import com.github.hydos.ginger.engine.opengl.postprocessing.PostProcessing;
import com.github.hydos.ginger.engine.opengl.render.MasterRenderer; import com.github.hydos.ginger.engine.opengl.render.MasterRenderer;
<<<<<<< Upstream, based on origin/liteCraft
import com.github.hydos.ginger.engine.opengl.render.models.TexturedModel;
import com.github.hydos.ginger.engine.opengl.utils.GLLoader; import com.github.hydos.ginger.engine.opengl.utils.GLLoader;
=======
import com.github.hydos.ginger.engine.opengl.render.models.GLTexturedModel; import com.github.hydos.ginger.engine.opengl.render.models.GLTexturedModel;
import com.github.hydos.ginger.engine.opengl.utils.GlLoader;
>>>>>>> 9a8fdc4 yEs
import tk.valoeghese.gateways.client.io.*; import tk.valoeghese.gateways.client.io.*;
public class Litecraft extends Game public class Litecraft extends Game

View File

@ -10,7 +10,7 @@ import com.github.hydos.ginger.engine.common.elements.objects.RenderObject;
import com.github.hydos.ginger.engine.common.io.Window; import com.github.hydos.ginger.engine.common.io.Window;
import com.github.hydos.ginger.engine.common.math.Maths; import com.github.hydos.ginger.engine.common.math.Maths;
import com.github.hydos.ginger.engine.opengl.render.Renderer; import com.github.hydos.ginger.engine.opengl.render.Renderer;
import com.github.hydos.ginger.engine.opengl.render.models.TexturedModel; 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.render.shaders.StaticShader;
public class BlockRenderer extends Renderer implements WorldGenConstants public class BlockRenderer extends Renderer implements WorldGenConstants
@ -34,7 +34,7 @@ public class BlockRenderer extends Renderer implements WorldGenConstants
shader.loadTransformationMatrix(transformationMatrix); shader.loadTransformationMatrix(transformationMatrix);
} }
public void prepareModel(TexturedModel model) public void prepareModel(GLTexturedModel model)
{ {
GL30.glBindVertexArray(model.getRawModel().getVaoID()); GL30.glBindVertexArray(model.getRawModel().getVaoID());
GL20.glEnableVertexAttribArray(0); GL20.glEnableVertexAttribArray(0);
@ -78,7 +78,7 @@ public class BlockRenderer extends Renderer implements WorldGenConstants
for (BlockInstance entity : renderList) { for (BlockInstance entity : renderList) {
if (entity != null && entity.getModel() != null) if (entity != null && entity.getModel() != null)
{ {
TexturedModel blockModel = entity.getModel(); GLTexturedModel blockModel = entity.getModel();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID()); GL11.glBindTexture(GL11.GL_TEXTURE_2D, blockModel.getTexture().getTextureID());
prepBlockInstance(entity); prepBlockInstance(entity);
GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0); GL11.glDrawElements(GL11.GL_TRIANGLES, blockModel.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0);

View File

@ -8,7 +8,7 @@ import com.github.halotroop.litecraft.world.gen.WorldGenConstants;
import com.github.hydos.ginger.engine.common.Constants; import com.github.hydos.ginger.engine.common.Constants;
import com.github.hydos.ginger.engine.common.api.GingerRegister; import com.github.hydos.ginger.engine.common.api.GingerRegister;
import com.github.hydos.ginger.engine.common.io.Window; import com.github.hydos.ginger.engine.common.io.Window;
import com.github.hydos.ginger.engine.opengl.render.models.TexturedModel; import com.github.hydos.ginger.engine.opengl.render.models.GLTexturedModel;
public class PlayerEntity extends Entity implements WorldGenConstants public class PlayerEntity extends Entity implements WorldGenConstants
{ {
@ -17,7 +17,7 @@ public class PlayerEntity extends Entity implements WorldGenConstants
private boolean noWeight = true; private boolean noWeight = true;
private int chunkX, chunkY, chunkZ; private int chunkX, chunkY, chunkZ;
public PlayerEntity(TexturedModel model, Vector3f position, float rotX, float rotY, float rotZ, Vector3f scale) public PlayerEntity(GLTexturedModel model, Vector3f position, float rotX, float rotY, float rotZ, Vector3f scale)
{ {
super(model, position, rotX, rotY, rotZ, scale); super(model, position, rotX, rotY, rotZ, scale);
this.chunkX = (int) position.x >> POS_SHIFT; this.chunkX = (int) position.x >> POS_SHIFT;

View File

@ -86,15 +86,10 @@ public class World implements BlockAccess, WorldGenConstants
public PlayerEntity spawnPlayer(float x, float y, float z) public PlayerEntity spawnPlayer(float x, float y, float z)
{ {
// Player model and stuff // Player model and stuff
<<<<<<< Upstream, based on origin/liteCraft
TexturedModel dirtModel = ModelLoader.loadGenericCube("block/cubes/soil/dirt.png"); GLTexturedModel dirtModel = ModelLoader.loadGenericCube("block/cubes/soil/dirt.png");
this.playerEntity = new PlayerEntity(dirtModel, new Vector3f(x, y, z), 0, 180f, 0, new Vector3f(0.2f, 0.2f, 0.2f)); this.playerEntity = new PlayerEntity(dirtModel, new Vector3f(x, y, z), 0, 180f, 0, new Vector3f(0.2f, 0.2f, 0.2f));
this.playerEntity.setVisible(false); this.playerEntity.setVisible(false);
=======
GLTexturedModel dirtModel = ModelLoader.loadGenericCube("block/cubes/soil/dirt.png");
this.player = new Player(dirtModel, new Vector3f(x, y, z), 0, 180f, 0, new Vector3f(0.2f, 0.2f, 0.2f));
this.player.setVisible(false);
>>>>>>> 9a8fdc4 yEs
// Generate world around player // Generate world around player
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
System.out.println("Generating world!"); System.out.println("Generating world!");

View File

@ -12,7 +12,7 @@ import com.github.hydos.ginger.engine.common.math.Maths;
import com.github.hydos.ginger.engine.opengl.render.Renderer; import com.github.hydos.ginger.engine.opengl.render.Renderer;
import com.github.hydos.ginger.engine.opengl.render.models.GLTexturedModel; 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.render.shaders.StaticShader;
import com.github.hydos.ginger.engine.opengl.utils.GlLoader; import com.github.hydos.ginger.engine.opengl.utils.GLLoader;
public class BlockRenderer extends Renderer implements WorldGenConstants public class BlockRenderer extends Renderer implements WorldGenConstants
{ {
@ -25,7 +25,7 @@ public class BlockRenderer extends Renderer implements WorldGenConstants
shader.start(); shader.start();
shader.loadProjectionMatrix(projectionMatrix); shader.loadProjectionMatrix(projectionMatrix);
shader.stop(); shader.stop();
this.atlasID = GlLoader.createBlockAtlas(); this.atlasID = GLLoader.createBlockAtlas();
} }
private void prepBlockInstance(RenderObject entity) private void prepBlockInstance(RenderObject entity)

View File

@ -10,11 +10,7 @@ public class ModelLoader
public static GLTexturedModel loadGenericCube(String cubeTexture) public static GLTexturedModel loadGenericCube(String cubeTexture)
{ {
Mesh data = StaticCube.getCube(); Mesh data = StaticCube.getCube();
<<<<<<< Upstream, based on origin/liteCraft GLTexturedModel tm = new GLTexturedModel(GLLoader.loadToVAO(data.getVertices(), data.getIndices(), data.getNormals(), data.getTextureCoords()), new ModelTexture(cubeTexture));
TexturedModel tm = new TexturedModel(GLLoader.loadToVAO(data.getVertices(), data.getIndices(), data.getNormals(), data.getTextureCoords()), new ModelTexture(cubeTexture));
=======
GLTexturedModel tm = new GLTexturedModel(GlLoader.loadToVAO(data.getVertices(), data.getIndices(), data.getNormals(), data.getTextureCoords()), new ModelTexture(cubeTexture));
>>>>>>> 9a8fdc4 yEs
return tm; return tm;
} }
@ -25,10 +21,6 @@ public class ModelLoader
public static GLTexturedModel loadModel(String objPath, String texturePath) public static GLTexturedModel loadModel(String objPath, String texturePath)
{ {
Mesh data = OBJFileLoader.loadModel(objPath); Mesh data = OBJFileLoader.loadModel(objPath);
<<<<<<< Upstream, based on origin/liteCraft return new GLTexturedModel(GLLoader.loadToVAO(data.getVertices(), data.getIndices(), data.getNormals(), data.getTextureCoords()), new ModelTexture(texturePath));
return new TexturedModel(GLLoader.loadToVAO(data.getVertices(), data.getIndices(), data.getNormals(), data.getTextureCoords()), new ModelTexture(texturePath));
=======
return new GLTexturedModel(GlLoader.loadToVAO(data.getVertices(), data.getIndices(), data.getNormals(), data.getTextureCoords()), new ModelTexture(texturePath));
>>>>>>> 9a8fdc4 yEs
} }
} }

View File

@ -3,7 +3,7 @@ package com.github.hydos.ginger.engine.opengl.api;
import org.joml.Vector2f; import org.joml.Vector2f;
import com.github.hydos.ginger.engine.common.api.GingerRegister; import com.github.hydos.ginger.engine.common.api.GingerRegister;
import com.github.hydos.ginger.engine.common.api.game.*; import com.github.hydos.ginger.engine.common.api.game.Game;
import com.github.hydos.ginger.engine.common.elements.buttons.TextureButton; import com.github.hydos.ginger.engine.common.elements.buttons.TextureButton;
import com.github.hydos.ginger.engine.common.elements.objects.RenderObject; import com.github.hydos.ginger.engine.common.elements.objects.RenderObject;
import com.github.hydos.ginger.engine.common.font.*; import com.github.hydos.ginger.engine.common.font.*;

View File

@ -11,7 +11,7 @@ import com.github.hydos.ginger.engine.common.io.Window;
import com.github.hydos.ginger.engine.opengl.render.models.RawModel; import com.github.hydos.ginger.engine.opengl.render.models.RawModel;
import com.github.hydos.ginger.engine.opengl.render.texture.Image; import com.github.hydos.ginger.engine.opengl.render.texture.Image;
public class GlLoader public class GLLoader
{ {
private static List<Integer> vaos = new ArrayList<Integer>(); private static List<Integer> vaos = new ArrayList<Integer>();
private static List<Integer> vbos = new ArrayList<Integer>(); private static List<Integer> vbos = new ArrayList<Integer>();