<commit_before>#include "pch.h"
#include "main.h"
#include "services/service_manager.h"
#include "services/render_service.h"
#include "services/input_service.h"
#include "services/tracker_service.h"
#include <curl/curl.h>


#ifdef __APPLE__
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#endif
#endif

#ifdef __ANDROID__
#include <android_native_app_glue.h>
#include <android/window.h>
extern struct android_app* __state;


extern "C"
{

void Java_com_dreamfarmgames_util_DFGActivity_receiptReceived(JNIEnv* env, jobject thiz, jstring textObject)
{
    const char* text = env->GetStringUTFChars(textObject, NULL);

    static_cast<DfgGame *>(gameplay::Game::getInstance())->onReceiptReceived(text);

    env->ReleaseStringUTFChars(textObject, text);
}

}

#endif

#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif




DfgGame::DfgGame()
    : _hyperKeyPressed(false)
{
#ifdef __EMSCRIPTEN__
    _hasIndexedDB = EM_ASM_INT_V({
        return typeof window === 'object' && (window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB) ? 1 : 0;
    });
#endif
}

void DfgGame::initialize()
{
#ifndef __EMSCRIPTEN__
    // initialize curl before any services get created
    curl_global_init(CURL_GLOBAL_ALL);
#endif

    // create services
    _inputService = ServiceManager::getInstance()->registerService< InputService >(NULL);

    Service * render_dep[] = { _inputService, NULL };
    _renderService = ServiceManager::getInstance()->registerService< RenderService >(render_dep);

    setVsync(false);

    _userFolder = getAppPrivateFolderPath();
#ifdef WIN32
    _mkdir(_userFolder.c_str());
#else
    mkdir( _userFolder.c_str( ), 0777 );
#endif
    _userFolder += "/DFG";
#ifdef WIN32
    _mkdir(_userFolder.c_str());
#else<commit_msg>remove vsync forced off<commit_after>#include "pch.h"
#include "main.h"
#include "services/service_manager.h"
#include "services/render_service.h"
#include "services/input_service.h"
#include "services/tracker_service.h"
#include <curl/curl.h>


#ifdef __APPLE__
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#endif
#endif

#ifdef __ANDROID__
#include <android_native_app_glue.h>
#include <android/window.h>
extern struct android_app* __state;


extern "C"
{

void Java_com_dreamfarmgames_util_DFGActivity_receiptReceived(JNIEnv* env, jobject thiz, jstring textObject)
{
    const char* text = env->GetStringUTFChars(textObject, NULL);

    static_cast<DfgGame *>(gameplay::Game::getInstance())->onReceiptReceived(text);

    env->ReleaseStringUTFChars(textObject, text);
}

}

#endif

#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif




DfgGame::DfgGame()
    : _hyperKeyPressed(false)
{
#ifdef __EMSCRIPTEN__
    _hasIndexedDB = EM_ASM_INT_V({
        return typeof window === 'object' && (window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB) ? 1 : 0;
    });
#endif
}

void DfgGame::initialize()
{
#ifndef __EMSCRIPTEN__
    // initialize curl before any services get created
    curl_global_init(CURL_GLOBAL_ALL);
#endif

    // create services
    _inputService = ServiceManager::getInstance()->registerService< InputService >(NULL);

    Service * render_dep[] = { _inputService, NULL };
    _renderService = ServiceManager::getInstance()->registerService< RenderService >(render_dep);

    _userFolder = getAppPrivateFolderPath();
#ifdef WIN32
    _mkdir(_userFolder.c_str());
#else
    mkdir( _userFolder.c_str( ), 0777 );
#endif
    _userFolder += "/DFG";
#ifdef WIN32
    _mkdir(_userFolder.c_str());
#else
{'fraction_non_alphanumeric': 0.12834075723830735, 'fraction_numerical': 0.005567928730512249, 'mean_word_length': 5.325704225352113, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 31, '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': '5079898', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1224, 'n_words': 239}