<commit_before>#pragma once
#include "augs/drawing/drawing.h"
#include "augs/drawing/drawing_input_base.h"
#include "augs/drawing/make_sprite.h"
#include "augs/texture_atlas/atlas_entry.h"
#include "augs/build_settings/platform_defines.h"
#include "augs/drawing/sprite.h"

namespace augs {
	template <class I, class F>
	FORCE_INLINE void for_each_tile(
		const sprite<I>& spr, 
		F callback, 
		const real32 final_rotation, 
		const augs::atlas_entry& diffuse
	) {
		const auto drawn_size = spr.get_size();

		const auto original_size = diffuse.get_original_size();
		const auto h = vec2(original_size) / 2;

		const auto times = drawn_size / original_size;

		for (int y = 0; y < times.y; ++y) {
			for (int x = 0; x < times.x; ++x) {
				auto piece_offset = vec2(original_size * vec2i(x, y)) + h;
				piece_offset.rotate(final_rotation, vec2());

				callback(piece_offset);
			}
		}
	}

	template <class id_type>
	FORCE_INLINE void detail_draw(
		const sprite<id_type>& spr,
		const sprite_drawing_input in,
		const atlas_entry considered_texture,
		const vec2 target_position,<commit_msg>First working test of tiled sprites<commit_after>#pragma once
#include "augs/drawing/drawing.h"
#include "augs/drawing/drawing_input_base.h"
#include "augs/drawing/make_sprite.h"
#include "augs/texture_atlas/atlas_entry.h"
#include "augs/build_settings/platform_defines.h"
#include "augs/drawing/sprite.h"

namespace augs {
	template <class I, class F>
	FORCE_INLINE void for_each_tile(
		const sprite<I>& spr, 
		F callback, 
		const real32 final_rotation, 
		const augs::atlas_entry& diffuse
	) {
		const auto drawn_size = spr.get_size();

		const auto original_size = diffuse.get_original_size();
		const auto times = drawn_size / original_size;
		const auto lt = -vec2(original_size * (times - vec2i(1, 1))) / 2;

		for (int y = 0; y < times.y; ++y) {
			for (int x = 0; x < times.x; ++x) {
				auto piece_offset = lt + vec2(original_size * vec2i(x, y));
				piece_offset.rotate(final_rotation, vec2());

				callback(piece_offset);
			}
		}
	}

	template <class id_type>
	FORCE_INLINE void detail_draw(
		const sprite<id_type>& spr,
		const sprite_drawing_input in,
		const atlas_entry considered_texture,
		const vec2 target_position,
{'fraction_non_alphanumeric': 0.11648745519713262, 'fraction_numerical': 0.010304659498207885, 'mean_word_length': 4.419902912621359, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '5084649', 'n_tokens_mistral': 912, 'n_tokens_neox': 816, 'n_words': 195}