<commit_before>package stray.util.render;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;

public class BlendMaskUtil {

	public static void drawAlphaMask(Batch batch, Texture alphamask, float x, float y, float width,
			float height) {
		// disable RGB color, only enable ALPHA to the frame buffer
		Gdx.gl.glColorMask(false, false, false, true);

		// change the blending function for our alpha map
		batch.setBlendFunction(GL20.GL_ONE, GL20.GL_ZERO);

		// draw alpha mask sprite(s)
		batch.draw(alphamask, x, y, width, height);

		// flush the batch to the GPU
		batch.flush();
	}

	public static void drawAlphaMask(Batch batch, Texture alphamask, float x, float y) {
		drawAlphaMask(batch, alphamask, x, y, alphamask.getWidth(), alphamask.getHeight());
	}

	public static void beginSprites(Batch batch) {
		// now that the buffer has our alpha, we simply draw the sprite with the
		// mask applied
		Gdx.gl.glColorMask(true, true, true, true);
		batch.setBlendFunction(GL20.GL_DST_ALPHA, GL20.GL_ONE_MINUS_DST_ALPHA);
	}

}<commit_msg>Added blend function resetter<commit_after>package stray.util.render;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;

public class BlendMaskUtil {

	public static void drawAlphaMask(Batch batch, Texture alphamask, float x, float y, float width,
			float height) {
		// disable RGB color, only enable ALPHA to the frame buffer
		Gdx.gl.glColorMask(false, false, false, true);

		// change the blending function for our alpha map
		batch.setBlendFunction(GL20.GL_ONE, GL20.GL_ZERO);

		// draw alpha mask sprite(s)
		batch.draw(alphamask, x, y, width, height);

		// flush the batch to the GPU
		batch.flush();
	}

	public static void drawAlphaMask(Batch batch, Texture alphamask, float x, float y) {
		drawAlphaMask(batch, alphamask, x, y, alphamask.getWidth(), alphamask.getHeight());
	}

	public static void beginSprites(Batch batch) {
		// now that the buffer has our alpha, we simply draw the sprite with the
		// mask applied
		Gdx.gl.glColorMask(true, true, true, true);
		batch.setBlendFunction(GL20.GL_DST_ALPHA, GL20.GL_ONE_MINUS_DST_ALPHA);
	}
	
	public static void endSprites(Batch batch){
		batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
	}

}
{'fraction_non_alphanumeric': 0.10312243221035333, 'fraction_numerical': 0.010682004930156122, 'mean_word_length': 4.447427293064877, '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': '2353507', 'n_tokens_mistral': 924, 'n_tokens_neox': 838, 'n_words': 234}