<commit_before>#include "window/ClientWindow.h"

/*
Copyright (C) 2016 AGC.


This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.


This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.


You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

using namespace x801::game;

#include <GLFW/glfw3.h>
#include <imgui.h>
#include <imgui_impl_glfw_gl3.h>
#include "Server.h"

extern agl::GLFWApplication* agl::currentApp;

static void customKeyCallback(
    GLFWwindow* window, int key, int scancode, int action, int mode) {
  ImGui_ImplGlfwGL3_KeyCallback(window, key, scancode, action, mode);
  ImGuiIO& io = ImGui::GetIO();
  if (io.WantCaptureKeyboard) return;
  if (action == GLFW_PRESS) agl::currentApp->setKey(key);
	else if (action == GLFW_RELEASE) agl::currentApp->resetKey(key);
}

void x801::game::ClientWindow::initialise() {
  std::cerr << "x801::game::ClientWindow::initialise();\n";
  glfwSetInputMode(underlying(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
	glfwSetKeyCallback(underlying(), customKeyCallback);
  glfwSetMouseButtonCallback(underlying(), ImGui_ImplGlfwGL3_MouseButtonCallback);
  glfwSetScrollCallback(underlying(), ImGui_ImplGlfwGL3_ScrollCallback);
  glfwSetCharCallback(underlying(), ImGui_ImplGlfwGL3_CharCallback);
  ImGui_ImplGlfwGL3_Init(underlying(), false);
  ImGuiIO& io = ImGui::GetIO();
  //io.Fonts->AddFontFromFileTTF("/home/uruwi/kiloji/kiloji_p.ttf", 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
  io.Fonts->AddFontFromFileTTF("intrinsic-assets/VLGothic/VL-PGothic-Regular.ttf", 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
  chat = new ChatWindow(this);
  tr = new TerrainRenderer(this);
  terrain = new agl::Sprite2D(tr->fboTex);
  terrain->setApp(this);
  terrain->addSprite({
    0, 0, 1280, 960,
    0, 0, 1280, 960
  });
  terrain->setUp();
}

static const int keycodes[] = {
  GLFW_KEY_UP,
  GLFW_KEY_DOWN,
  GLFW_KEY_LEFT,
  GLFW_KEY_RIGHT,
};

static const int keycodeCount = sizeof(keycodes) / sizeof(keycodes[0]);

void x801::game::ClientWindow::tick() {<commit_msg>Extend glyph ranges<commit_after>#include "window/ClientWindow.h"

/*
Copyright (C) 2016 AGC.


This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.


This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.


You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

using namespace x801::game;

#include <GLFW/glfw3.h>
#include <imgui.h>
#include <imgui_impl_glfw_gl3.h>
#include "Server.h"

extern agl::GLFWApplication* agl::currentApp;

static void customKeyCallback(
    GLFWwindow* window, int key, int scancode, int action, int mode) {
  ImGui_ImplGlfwGL3_KeyCallback(window, key, scancode, action, mode);
  ImGuiIO& io = ImGui::GetIO();
  if (io.WantCaptureKeyboard) return;
  if (action == GLFW_PRESS) agl::currentApp->setKey(key);
	else if (action == GLFW_RELEASE) agl::currentApp->resetKey(key);
}

static const ImWchar range[] = { 0x20, 0xFFFF, 0 };

void x801::game::ClientWindow::initialise() {
  std::cerr << "x801::game::ClientWindow::initialise();\n";
  glfwSetInputMode(underlying(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
	glfwSetKeyCallback(underlying(), customKeyCallback);
  glfwSetMouseButtonCallback(underlying(), ImGui_ImplGlfwGL3_MouseButtonCallback);
  glfwSetScrollCallback(underlying(), ImGui_ImplGlfwGL3_ScrollCallback);
  glfwSetCharCallback(underlying(), ImGui_ImplGlfwGL3_CharCallback);
  ImGui_ImplGlfwGL3_Init(underlying(), false);
  ImGuiIO& io = ImGui::GetIO();
  //io.Fonts->AddFontFromFileTTF("/home/uruwi/kiloji/kiloji_p.ttf", 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
  io.Fonts->AddFontFromFileTTF("intrinsic-assets/VLGothic/VL-PGothic-Regular.ttf", 18.0f, nullptr, range);
  chat = new ChatWindow(this);
  tr = new TerrainRenderer(this);
  terrain = new agl::Sprite2D(tr->fboTex);
  terrain->setApp(this);
  terrain->addSprite({
    0, 0, 1280, 960,
    0, 0, 1280, 960
  });
  terrain->setUp();
}

static const int keycodes[] = {
  GLFW_KEY_UP,
  GLFW_KEY_DOWN,
  GLFW_KEY_LEFT,
  GLFW_KEY_RIGHT,
};

static const int keycodeCount = sizeof(keycodes) / sizeof(keycodes[0]);

void x801::game::ClientWindow::tick() {
{'fraction_non_alphanumeric': 0.1194831013916501, 'fraction_numerical': 0.020874751491053677, 'mean_word_length': 5.654761904761905, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1663270', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1714, 'n_words': 447}