<commit_before>"""
    renderstates
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging

from OpenGL import GL

from mcedit2.rendering import rendergraph

log = logging.getLogger(__name__)



class RenderstatePlainNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        pass

    def exit(self):
        pass

class RenderstateVinesNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glDisable(GL.GL_CULL_FACE)
        GL.glEnable(GL.GL_ALPHA_TEST)

    def exit(self):
        GL.glPopAttrib()

class RenderstateLowDetailNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glDisable(GL.GL_CULL_FACE)
        GL.glDisable(GL.GL_TEXTURE_2D)

    def exit(self):
        GL.glPopAttrib()

class RenderstateAlphaTestNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glEnable(GL.GL_ALPHA_TEST)

    def exit(self):
        GL.glPopAttrib()

class _RenderstateAlphaBlendNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glEnable(GL.GL_BLEND)

    def exit(self):
        GL.glPopAttrib()

class RenderstateWaterNode(_RenderstateAlphaBlendNode):
    pass

class RenderstateIceNode(_RenderstateAlphaBlendNode):
    pass

class RenderstateEntityNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glDisable(GL.GL_DEPTH_TEST)
        # GL.glDisable(GL.GL_CULL_FACE)
        GL.glDisable(GL.GL_TEXTURE_2D)
        GL.glEnable(GL.GL_BLEND)

    def exit(self):
        GL.glPopAttrib()

allRenderstates = (
    RenderstateLowDetailNode,
    RenderstatePlainNode,
    RenderstateVinesNode,
    RenderstateAlphaTestNode,
    RenderstateWaterNode,
    RenderstateIceNode,
    RenderstateEntityNode,
)
<commit_msg>Don't show [tile]entities behind walls, to reduce clutter.<commit_after>"""
    renderstates
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging

from OpenGL import GL

from mcedit2.rendering import rendergraph
from mcedit2.rendering.depths import DepthOffset

log = logging.getLogger(__name__)



class RenderstatePlainNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        pass

    def exit(self):
        pass

class RenderstateVinesNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glDisable(GL.GL_CULL_FACE)
        GL.glEnable(GL.GL_ALPHA_TEST)

    def exit(self):
        GL.glPopAttrib()

class RenderstateLowDetailNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glDisable(GL.GL_CULL_FACE)
        GL.glDisable(GL.GL_TEXTURE_2D)

    def exit(self):
        GL.glPopAttrib()

class RenderstateAlphaTestNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glEnable(GL.GL_ALPHA_TEST)

    def exit(self):
        GL.glPopAttrib()

class _RenderstateAlphaBlendNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT)
        GL.glEnable(GL.GL_BLEND)

    def exit(self):
        GL.glPopAttrib()

class RenderstateWaterNode(_RenderstateAlphaBlendNode):
    pass

class RenderstateIceNode(_RenderstateAlphaBlendNode):
    pass

class RenderstateEntityNode(rendergraph.RenderstateRenderNode):
    def enter(self):
        GL.glPushAttrib(GL.GL_ENABLE_BIT | GL.GL_POLYGON_BIT)
        GL.glPolygonOffset(DepthOffset.Renderer-1, DepthOffset.Renderer-1)
        GL.glEnable(GL.GL_POLYGON_OFFSET_FILL)
        #GL.glDisable(GL.GL_DEPTH_TEST)
        # GL.glDisable(GL.GL_CULL_FACE)
        GL.glDisable(GL.GL_TEXTURE_2D)
        GL.glEnable(GL.GL_BLEND)

    def exit(self):
        GL.glPopAttrib()

allRenderstates = (
    RenderstateLowDetailNode,
    RenderstatePlainNode,
    RenderstateVinesNode,
    RenderstateAlphaTestNode,
    RenderstateWaterNode,
    RenderstateIceNode,
    RenderstateEntityNode,
)

{'fraction_non_alphanumeric': 0.08569388240895025, 'fraction_numerical': 0.0021423470602237563, 'mean_word_length': 3.689732142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2749218', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1397, 'n_words': 201}