improved laser rendering for composite architects, #1544

This commit is contained in:
SpaceToad 2014-09-06 18:51:49 +02:00
parent b9f10af73b
commit 416180819b
8 changed files with 17 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -41,9 +41,10 @@ public class RenderArchitect extends RenderBoxProvider {
if (laser != null) {
GL11.glPushMatrix();
RenderLaser
.doRenderLaser(
.doRenderLaserWave(
TileEntityRendererDispatcher.instance.field_147553_e,
laser, EntityLaser.LASER_TEXTURES[4]);
laser, EntityLaser.LASER_TEXTURES[3]);
GL11.glPopMatrix();
}
}

View file

@ -55,7 +55,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
private RecursiveBlueprintReader reader;
public TileArchitect() {
box.kind = Kind.STRIPES;
box.kind = Kind.BLUE_STRIPES;
}
@Override
@ -260,7 +260,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory, IBoxPro
public void addSubBlueprint(TileEntity sub) {
subBlueprints.add(new BlockIndex(sub));
LaserData laser = new LaserData(new Position(this), new Position(sub));
LaserData laser = new LaserData(new Position(sub), new Position(this));
laser.head.x += 0.5F;
laser.head.y += 0.5F;

View file

@ -28,6 +28,8 @@ public class RenderBoxProvider extends TileEntitySpecialRenderer {
private static final ResourceLocation LASER_GREEN = new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_3.png");
private static final ResourceLocation LASER_BLUE = new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_4.png");
private static final ResourceLocation STRIPES = new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/stripes.png");
private static final ResourceLocation BLUE_STRIPES = new ResourceLocation("buildcraft",
DefaultProps.TEXTURE_PATH_ENTITIES + "/blue_stripes.png");
public RenderBoxProvider() {
}
@ -81,6 +83,8 @@ public class RenderBoxProvider extends TileEntitySpecialRenderer {
return LASER_BLUE;
case STRIPES:
return STRIPES;
case BLUE_STRIPES:
return BLUE_STRIPES;
}
return null;

View file

@ -32,7 +32,8 @@ public class Box implements IBox {
LASER_YELLOW,
LASER_GREEN,
LASER_BLUE,
STRIPES
STRIPES,
BLUE_STRIPES,
}
@NetworkData

View file

@ -22,7 +22,8 @@ public abstract class EntityLaser extends Entity {
new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_2.png"),
new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_3.png"),
new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/laser_4.png"),
new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/stripes.png")};
new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/stripes.png"),
new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_ENTITIES + "/blue_stripes.png")};
public LaserData data = new LaserData();

View file

@ -22,7 +22,7 @@ public class LaserData {
@NetworkData
public boolean isVisible = true;
public double renderSize = 0;
public double renderSize = 1.0 / 16.0;
public double angleY = 0;
public double angleZ = 0;

View file

@ -123,6 +123,7 @@ public class RenderLaser extends Render {
GL11.glPushMatrix();
GL11.glTranslated(laser.head.x, laser.head.y, laser.head.z);
laser.update();
GL11.glRotatef((float) laser.angleZ, 0, 1, 0);
@ -172,12 +173,12 @@ public class RenderLaser extends Render {
initScaledBoxes();
doRenderLaserLine (laser.renderSize, laser.laserTexAnimation);
doRenderLaserLine(laser.renderSize, laser.laserTexAnimation);
GL11.glPopMatrix();
}
private static void doRenderLaserLine (double len, int texId) {
private static void doRenderLaserLine(double len, int texId) {
float lasti = 0;
if (len - 1 > 0) {