<commit_before>#include "preview.h"
#include "renderer.h"

#include <stdlib.h>
#include "../renderer.h"
#include "../camera.h"

struct PreviewRenderer
{
    Renderer* renderer;
};

static PreviewRenderer* _createRenderer()
{
    PreviewRenderer* renderer;

    renderer = (PreviewRenderer*)malloc(sizeof(PreviewRenderer));
    renderer->renderer = rendererCreate();

    return renderer;
}

static void _deleteRenderer(PreviewRenderer* renderer)
{
    rendererDelete(renderer->renderer);
    free(renderer);
}

static void _setCamera(PreviewRenderer* renderer, Vector3 location, Vector3 target)
{
    cameraSetLocation(renderer->renderer->render_camera, location);
    cameraSetTarget(renderer->renderer->render_camera, target);
}

PreviewClass previewCreateClass(FuncPreviewCustomizeRenderer customizeRenderer, FuncPreviewBindDefinition bindDefinition, FuncPreviewGetPixelColor getPixelColor)
{
    PreviewClass result;

    result.createRenderer = _createRenderer;
    result.deleteRenderer = _deleteRenderer;

    result.setCamera = _setCamera;<commit_msg>-<commit_after>#include "preview.h"

#include <stdlib.h>
#include "../renderer.h"
#include "../camera.h"

struct PreviewRenderer
{
    Renderer* renderer;
};

static PreviewRenderer* _createRenderer()
{
    PreviewRenderer* renderer;

    renderer = (PreviewRenderer*)malloc(sizeof(PreviewRenderer));
    renderer->renderer = rendererCreate();

    return renderer;
}

static void _deleteRenderer(PreviewRenderer* renderer)
{
    rendererDelete(renderer->renderer);
    free(renderer);
}

static void _setCamera(PreviewRenderer* renderer, Vector3 location, Vector3 target)
{
    cameraSetLocation(&renderer->renderer->render_camera, location.x, location.y, location.z);
    cameraSetTarget(&renderer->renderer->render_camera, target.x, target.y, target.z);
}

PreviewClass previewCreateClass(FuncPreviewCustomizeRenderer customizeRenderer, FuncPreviewBindDefinition bindDefinition, FuncPreviewGetPixelColor getPixelColor)
{
    PreviewClass result;

    result.createRenderer = _createRenderer;
    result.deleteRenderer = _deleteRenderer;

    result.setCamera = _setCamera;
{'fraction_non_alphanumeric': 0.10543580131208997, 'fraction_numerical': 0.0018744142455482662, 'mean_word_length': 5.777777777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3925027', 'n_tokens_mistral': 607, 'n_tokens_neox': 605, 'n_words': 117}