prepare for atlas texturing

pull/12/head
hYdos 2020-03-01 19:44:38 +10:00
parent 2768e05d48
commit 6849bea21a
4 changed files with 17 additions and 1 deletions

View File

@ -64,6 +64,7 @@ public class Block
this.identifier = properties.identifier;
this.caveCarveThreshold = properties.caveCarveThreshold;
IDENTIFIER_TO_BLOCK.put(this.identifier, this);
Blocks.blocks.add(this);
}
public static final Block getBlock(String identifier)

View File

@ -1,9 +1,14 @@
package com.github.halotroop.litecraft.types.block;
import java.util.*;
import com.github.halotroop.litecraft.types.block.Block.Properties;
public final class Blocks
{
public static List<Block> blocks = new ArrayList<Block>();
public static final Block AIR = new Block(new Properties("air").visible(false).fullCube(false));
public static final Block GRASS = new Block(new Properties("block/cubes/soil/grass/grass_top.png").caveCarveThreshold(0.04f));
public static final Block DIRT = new Block("block/cubes/soil/dirt.png", new Properties("dirt").caveCarveThreshold(0.04f));

View File

@ -1,6 +1,7 @@
package com.github.halotroop.litecraft.world.dimension;
import com.github.halotroop.litecraft.world.gen.*;
import com.github.halotroop.litecraft.world.gen.modifier.CavesModifier;
public final class Dimensions
{

View File

@ -6,6 +6,7 @@ import java.util.*;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.*;
import com.github.halotroop.litecraft.types.block.*;
import com.github.hydos.ginger.engine.io.Window;
import com.github.hydos.ginger.engine.render.models.RawModel;
import com.github.hydos.ginger.engine.render.texture.*;
@ -104,7 +105,15 @@ public class Loader
public static int loadTexture(String path)
{ return loadTextureDirectly("/textures/" + path); }
public int createBlockAtlas()
{
for(Block block: Blocks.blocks) {
}
return 0;
}
public static int loadTextureDirectly(String path)
{
int textureID = GL11.glGenTextures();