<commit_before>package nona.starwars.engine.rendering;

public class RenderingEngine {

    private static RenderingEngine renderingEngine = new RenderingEngine();

    public static RenderingEngine getInstance() {
        return renderingEngine;
    }

    public void draw(Bitmap bitmap, Bitmap destination, int x, int y) {
        int xmax = bitmap.getWidth() < destination.getWidth() ? bitmap.getWidth() : destination.getWidth();
        int ymax = bitmap.getHeight() < destination.getHeight() ? bitmap.getHeight() : destination.getHeight();
        int xCount = 0;
        int yCount = 0;
        for(int i = x; i < xmax; i++) {
            xCount++;
            for(int j = y; j < ymax; j++) {
                yCount++;

                int locationOnDestination = i + j * destination.getWidth();
                int locationOnBitmap = xCount + yCount * bitmap.getWidth();

                destination.setComponent(locationOnDestination + 0, bitmap.getComponent(locationOnBitmap + 0));
                destination.setComponent(locationOnDestination + 1, bitmap.getComponent(locationOnBitmap + 1));
                destination.setComponent(locationOnDestination + 2, bitmap.getComponent(locationOnBitmap + 2));
                destination.setComponent(locationOnDestination + 3, bitmap.getComponent(locationOnBitmap + 3));
            }
        }
    }

}<commit_msg>Changed Bitmap drawing<commit_after>package nona.starwars.engine.rendering;

public class RenderingEngine {

    private static RenderingEngine renderingEngine = new RenderingEngine();

    public static RenderingEngine getInstance() {
        return renderingEngine;
    }

    public void draw(Bitmap bitmap, Bitmap destination, int x, int y) {
        for(int xx = x; xx < bitmap.getWidth(); xx++) {
            if(xx >= destination.getWidth() || xx < 0) continue;
            for(int yy = y; yy < bitmap.getHeight(); yy++) {
                if(yy >= destination.getHeight() || yy < 0) continue;

                int locationOnDestination = xx + yy * destination.getWidth();
                int locationOnBitmap = (xx - x) + (yy - y) * bitmap.getWidth();

                destination.setComponent(locationOnDestination + 0, bitmap.getComponent(locationOnBitmap + 0));
                destination.setComponent(locationOnDestination + 1, bitmap.getComponent(locationOnBitmap + 1));
                destination.setComponent(locationOnDestination + 2, bitmap.getComponent(locationOnBitmap + 2));
                destination.setComponent(locationOnDestination + 3, bitmap.getComponent(locationOnBitmap + 3));
            }
        }
    }

}
{'fraction_non_alphanumeric': 0.10570662581386442, 'fraction_numerical': 0.0076599004212945234, 'mean_word_length': 2.684062059238364, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, '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': '5625241', 'n_tokens_mistral': 711, 'n_tokens_neox': 664, 'n_words': 164}