mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-12 16:37:38 +00:00
partial maintain state
This commit is contained in:
4 files changed
+18
-18
No files matched your search
@@ -24,7 +24,6 @@ object MaterialRenderHelper {
|
||||
|
||||
def start(pos: Vector3, pass: Int, uvt: UVTransformation) = {
|
||||
this.pass = pass
|
||||
// TODO: update to use a thread local copy
|
||||
builder = CCRenderState.instance().pipeline.builder()
|
||||
builder.add(pos.translation()).add(uvt)
|
||||
this
|
||||
@@ -86,9 +85,10 @@ class BlockMicroMaterial(val block: Block, val meta: Int = 0)
|
||||
if (pass == -1)
|
||||
block.getBlockColor << 8 | 0xff
|
||||
else {
|
||||
val pos = CCRenderState.instance().lightMatrix.pos
|
||||
val state = CCRenderState.instance
|
||||
val pos = state.lightMatrix.pos
|
||||
block.colorMultiplier(
|
||||
CCRenderState.instance().lightMatrix.access,
|
||||
state.lightMatrix.access,
|
||||
pos.x,
|
||||
pos.y,
|
||||
pos.z
|
||||
|
||||
@@ -73,10 +73,9 @@ trait HollowMicroblockClient
|
||||
}
|
||||
|
||||
override def drawBreaking(renderBlocks: RenderBlocks) {
|
||||
CCRenderState.instance().reset()
|
||||
CCRenderState
|
||||
.instance()
|
||||
.setPipeline(
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.setPipeline(
|
||||
new Translation(x, y, z),
|
||||
new IconTransformation(renderBlocks.overrideBlockTexture)
|
||||
)
|
||||
|
||||
@@ -170,17 +170,17 @@ object ItemMicroPartRenderer extends IItemRenderer {
|
||||
GL11.glScaled(0.5, 0.5, 0.5)
|
||||
if (t == ItemRenderType.INVENTORY || t == ItemRenderType.ENTITY)
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f)
|
||||
// TODO: update to use a thread local copy
|
||||
TextureUtils.bindAtlas(0)
|
||||
CCRenderState.instance().reset()
|
||||
CCRenderState.instance().useNormals = true
|
||||
CCRenderState.instance().pullLightmap()
|
||||
CCRenderState.instance().startDrawing()
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.useNormals = true
|
||||
state.pullLightmap()
|
||||
state.startDrawing()
|
||||
val part =
|
||||
mcrClass.create(true, getMaterialID(item)).asInstanceOf[MicroblockClient]
|
||||
part.setShape(size, mcrClass.itemSlot)
|
||||
part.render(new Vector3(0.5, 0.5, 0.5).subtract(part.getBounds.center), -1)
|
||||
CCRenderState.instance().draw()
|
||||
state.draw()
|
||||
GL11.glPopMatrix()
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ object MicroblockRender {
|
||||
return
|
||||
val pos = placement.pos
|
||||
val part = placement.part.asInstanceOf[MicroblockClient]
|
||||
val state = CCRenderState.instance
|
||||
|
||||
glPushMatrix()
|
||||
glTranslated(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5)
|
||||
@@ -42,12 +43,12 @@ object MicroblockRender {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||
// TODO: update to use a thread local copy
|
||||
TextureUtils.bindAtlas(0)
|
||||
CCRenderState.instance().reset()
|
||||
CCRenderState.instance().alphaOverride = 80
|
||||
CCRenderState.instance().useNormals = true
|
||||
CCRenderState.instance().startDrawing()
|
||||
state.reset()
|
||||
state.alphaOverride = 80
|
||||
state.useNormals = true
|
||||
state.startDrawing()
|
||||
part.render(Vector3.zero, -1)
|
||||
CCRenderState.instance().draw()
|
||||
state.draw()
|
||||
|
||||
glDisable(GL_BLEND)
|
||||
glDepthMask(true)
|
||||
|
||||
Reference in new issue
Block a user