<commit_before>package h2d;

@:allow(h2d)
class Tile {

	var innerTex : h3d.mat.Texture;

	var u : Float;
	var v : Float;
	var u2 : Float;
	var v2 : Float;

	public var dx : Float;
	public var dy : Float;
	public var x(default,null) : Float;
	public var y(default,null) : Float;
	public var width(default,null) : Float;
	public var height(default,null) : Float;

	public var ix(get,never) : Int;
	function get_ix() return Std.int(x);

	public var iy(get,never) : Int;
	function get_iy() return Std.int(y);

	public var iwidth(get,never) : Int;
	function get_iwidth() return Std.int(width);

	public var iheight(get,never) : Int;
	function get_iheight() return Std.int(height);

	function new(tex : h3d.mat.Texture, x : Float, y : Float, w : Float, h : Float, dx : Float=0, dy : Float=0) {
		this.innerTex = tex;
		this.x = x;
		this.y = y;
		this.width = w;
		this.height = h;
		this.dx = dx;
		this.dy = dy;
		if( tex != null ) setTexture(tex);
	}

	public inline function getTexture():h3d.mat.Texture {
		return innerTex;
	}

	public function isDisposed() {
		return innerTex == null || innerTex.isDisposed();
	}

	function setTexture(tex : h3d.mat.Texture) {<commit_msg>more precise calculations for Tile ix/iy/iwidth/iheight<commit_after>package h2d;

@:allow(h2d)
class Tile {

	var innerTex : h3d.mat.Texture;

	var u : Float;
	var v : Float;
	var u2 : Float;
	var v2 : Float;

	public var dx : Float;
	public var dy : Float;
	public var x(default,null) : Float;
	public var y(default,null) : Float;
	public var width(default,null) : Float;
	public var height(default,null) : Float;

	public var ix(get,never) : Int;
	inline function get_ix() return Math.floor(x);

	public var iy(get,never) : Int;
	inline function get_iy() return Math.floor(y);

	public var iwidth(get,never) : Int;
	inline function get_iwidth() return Math.ceil(width + x) - ix;

	public var iheight(get,never) : Int;
	inline function get_iheight() return Std.ceil(height + y) - iy;

	function new(tex : h3d.mat.Texture, x : Float, y : Float, w : Float, h : Float, dx : Float=0, dy : Float=0) {
		this.innerTex = tex;
		this.x = x;
		this.y = y;
		this.width = w;
		this.height = h;
		this.dx = dx;
		this.dy = dy;
		if( tex != null ) setTexture(tex);
	}

	public inline function getTexture():h3d.mat.Texture {
		return innerTex;
	}

	public function isDisposed() {
		return innerTex == null || innerTex.isDisposed();
	}

	function setTexture(tex : h3d.mat.Texture) {
{'fraction_non_alphanumeric': 0.1371264838313549, 'fraction_numerical': 0.008186655751125664, 'mean_word_length': 3.7827788649706457, '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': '5949788', 'n_tokens_mistral': 959, 'n_tokens_neox': 912, 'n_words': 263}