<commit_before>#include <jni.h>
#include <errno.h>

#include <EGL/egl.h>
#include <GLES/gl.h>

#include <android_native_app_glue.h>

#include <squirrel.h>
#include <sqstdio.h>
#include <sqstdaux.h>

#include <main.h>
#include <sqfunc.h>

/* global pointer to application engine */
struct engine *g_engine;

/*
 * extern common functions
 */
extern void LOGI(const SQChar* msg);
extern void LOGW(const SQChar* msg);
extern void LOGE(const SQChar* msg);

extern SQInteger sq_lexer(SQUserPointer asset);
extern SQInteger emoImportScript(HSQUIRRELVM v);
extern SQInteger emoSetOptions(HSQUIRRELVM v);
extern SQBool loadScriptFromAsset(const char* fname);

/**
 * Initialize the framework
 */
void emo_init_engine(struct engine* engine) {

    engine->sqvm = sq_open(SQUIRREL_VM_INITIAL_STACK_SIZE);
    engine->lastError = EMO_NO_ERROR;

    // disable drawframe callback to improve performance (default)
    engine->enableSQOnDrawFrame = SQFalse;

    // enable perspective hint to nicest (default)
    engine->enablePerspectiveNicest = SQTrue;

    /* init Squirrel VM */
    initSQVM(engine->sqvm);

    /* initialize squirrel functions */
    register_global_func(engine->sqvm, emoImportScript, "emo_import");
    register_global_func(engine->sqvm, emoSetOptions,   "emo_options");

    /* load main script */
    loadScriptFromAsset(SQUIRREL_MAIN_SCRIPT);

    /* call onLoad() */
    callSqFunctionNoParam(engine->sqvm, "onLoad");

}

/*
 * Initialize the display
 */
void emo_init_display(struct engine* engine) {

    /* initialize OpenGL state */

    if (engine->enablePerspectiveNicest) {
        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
LOGI("NICEST");
    } else {
        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
LOGI("FASTEST");
    }

    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);
    glDisable(GL_MULTISAMPLE);
    glDisable(GL_DITHER);
    glDisable(GL_COLOR_ARRAY);

    glEnable(GL_TEXTURE_2D);
    glEnable(GL_TEXTURE_COORD_ARRAY);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    glEnable(GL_VERTEX_ARRAY);
    glEnable(GL_CULL_FACE);
    glFrontFace(GL_CCW);
    glCullFace(GL_BACK);
}

/*
 * Draw current frame
 */
void emo_draw_frame(struct engine* engine) {
    glClearColor(0, 0, 0, 1);
    glClear(GL_COLOR_BUFFER_BIT);

    if (engine->enableSQOnDrawFrame) {
    	callSqFunctionNoParam(engine->sqvm, "onDrawFrame");
    }<commit_msg>remove unnecessary log<commit_after>#include <jni.h>
#include <errno.h>

#include <EGL/egl.h>
#include <GLES/gl.h>

#include <android_native_app_glue.h>

#include <squirrel.h>
#include <sqstdio.h>
#include <sqstdaux.h>

#include <main.h>
#include <sqfunc.h>

/* global pointer to application engine */
struct engine *g_engine;

/*
 * extern common functions
 */
extern void LOGI(const SQChar* msg);
extern void LOGW(const SQChar* msg);
extern void LOGE(const SQChar* msg);

extern SQInteger sq_lexer(SQUserPointer asset);
extern SQInteger emoImportScript(HSQUIRRELVM v);
extern SQInteger emoSetOptions(HSQUIRRELVM v);
extern SQBool loadScriptFromAsset(const char* fname);

/**
 * Initialize the framework
 */
void emo_init_engine(struct engine* engine) {

    engine->sqvm = sq_open(SQUIRREL_VM_INITIAL_STACK_SIZE);
    engine->lastError = EMO_NO_ERROR;

    // disable drawframe callback to improve performance (default)
    engine->enableSQOnDrawFrame = SQFalse;

    // enable perspective hint to nicest (default)
    engine->enablePerspectiveNicest = SQTrue;

    /* init Squirrel VM */
    initSQVM(engine->sqvm);

    /* initialize squirrel functions */
    register_global_func(engine->sqvm, emoImportScript, "emo_import");
    register_global_func(engine->sqvm, emoSetOptions,   "emo_options");

    /* load main script */
    loadScriptFromAsset(SQUIRREL_MAIN_SCRIPT);

    /* call onLoad() */
    callSqFunctionNoParam(engine->sqvm, "onLoad");

}

/*
 * Initialize the display
 */
void emo_init_display(struct engine* engine) {

    /* initialize OpenGL state */

    if (engine->enablePerspectiveNicest) {
        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
    } else {
        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
    }

    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);
    glDisable(GL_MULTISAMPLE);
    glDisable(GL_DITHER);
    glDisable(GL_COLOR_ARRAY);

    glEnable(GL_TEXTURE_2D);
    glEnable(GL_TEXTURE_COORD_ARRAY);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    glEnable(GL_VERTEX_ARRAY);
    glEnable(GL_CULL_FACE);
    glFrontFace(GL_CCW);
    glCullFace(GL_BACK);
}

/*
 * Draw current frame
 */
void emo_draw_frame(struct engine* engine) {
    glClearColor(0, 0, 0, 1);
    glClear(GL_COLOR_BUFFER_BIT);

    if (engine->enableSQOnDrawFrame) {
    	callSqFunctionNoParam(engine->sqvm, "onDrawFrame");
    }
{'fraction_non_alphanumeric': 0.11474730737365368, 'fraction_numerical': 0.002071251035625518, 'mean_word_length': 4.395530726256983, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 45, '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': '5414246', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1715, 'n_words': 322}