All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.game.batch.Batch Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating Javascript and Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.5.0
Show newest version
package com.jtransc.game.batch;

import com.jtransc.media.JTranscRender;
import com.jtransc.game.math.Rectangle;

public class Batch {
	public int startIndex = 0;
	public int triangleCount = 0; // triangleCount
	public int texture = 0; // texture(int)
	public int blendMode = JTranscRender.BLEND_NORMAL; // blendMode(int) BLEND_NORMAL=1, BLEND_ADD=8
	public int maskType = 0;
	public int stencilIndex = 0;
	public Rectangle scissors = new Rectangle();

	public void reset() {
		startIndex = 0;
		triangleCount = 0;
		texture = 0;
		blendMode = 1;
		maskType = 0;
		stencilIndex = 0;
		scissors.setToBounds(0, 0, 0, 0);
	}

	public void write(int[] batches, int offset) {
		batches[offset + 0] = startIndex;
		batches[offset + 1] = triangleCount;
		batches[offset + 2] = texture;
		batches[offset + 3] = blendMode;
		batches[offset + 4] = maskType;
		batches[offset + 5] = stencilIndex;
		batches[offset + 6] = (int)scissors.getLeft();
		batches[offset + 7] = (int)scissors.getTop();
		batches[offset + 8] = (int)scissors.getRight();
		batches[offset + 9] = (int)scissors.getBottom();
		batches[offset + 10] = 0;
		batches[offset + 11] = 0;
		batches[offset + 12] = 0;
		batches[offset + 13] = 0;
		batches[offset + 14] = 0;
		batches[offset + 15] = 0;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy