<commit_before>package jsettlers.graphics.map.draw;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import jsettlers.graphics.map.MapDrawContext;

public class DrawBuffer {
	
	private static final int BUFFERS = 5;
	private final MapDrawContext context;
	private float z;

	class Buffer {
		/**
		 * Bytes we need for one vertex
		 */
		private static final int VERTEX_LENGTH = 5 * 4 + 4;
		private static final int TRIAMGLE_LENGTH = 3 * VERTEX_LENGTH;
		private static final int BUFFER_TRIANGLES = 1000;


		/**
		 * The last texture we set.
		 */
		private int currentTexture = 0;

		private int currentTriangles = 0;

		protected final ByteBuffer byteBuffer;

		protected Buffer() {
			byteBuffer =
			        ByteBuffer.allocateDirect(BUFFER_TRIANGLES * TRIAMGLE_LENGTH);
			byteBuffer.order(ByteOrder.nativeOrder());
		}

		protected void setForTexture(int texture) {
			if (currentTexture != texture) {
				if (currentTriangles != 0) {
					draw();
				}
				currentTexture = texture;
			}
		}

		protected void draw() {
			System.out.println("draw " + currentTriangles + " tris of " + currentTexture);
			byteBuffer.rewind();<commit_msg>Changed everything on the map to use the DrawBuffer<commit_after>package jsettlers.graphics.map.draw;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import jsettlers.graphics.map.MapDrawContext;

public class DrawBuffer {
	
	private static final int BUFFERS = 5;
	private final MapDrawContext context;
	private float z;

	class Buffer {
		/**
		 * Bytes we need for one vertex
		 */
		private static final int VERTEX_LENGTH = 5 * 4 + 4;
		private static final int TRIAMGLE_LENGTH = 3 * VERTEX_LENGTH;
		private static final int BUFFER_TRIANGLES = 1000;


		/**
		 * The last texture we set.
		 */
		private int currentTexture = 0;

		private int currentTriangles = 0;

		protected final ByteBuffer byteBuffer;

		protected Buffer() {
			byteBuffer =
			        ByteBuffer.allocateDirect(BUFFER_TRIANGLES * TRIAMGLE_LENGTH);
			byteBuffer.order(ByteOrder.nativeOrder());
		}

		protected void setForTexture(int texture) {
			if (currentTexture != texture) {
				if (currentTriangles != 0) {
					draw();
				}
				currentTexture = texture;
			}
		}

		protected void draw() {
			// System.out.println("draw " + currentTriangles + " tris of " + currentTexture);
			byteBuffer.rewind();
{'fraction_non_alphanumeric': 0.09211087420042643, 'fraction_numerical': 0.01023454157782516, 'mean_word_length': 3.4770992366412212, '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': '5993305', 'n_tokens_mistral': 849, 'n_tokens_neox': 694, 'n_words': 203}