From 2ad9667b5063300cac3fa1ac26c79a5a12a5ea82 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 7 Sep 2017 18:44:21 +0200 Subject: [PATCH] rwengine: add per-font mapping + unicode support + tests --- rwengine/CMakeLists.txt | 2 - rwengine/src/engine/GameData.hpp | 2 +- rwengine/src/engine/GameState.hpp | 4 +- rwengine/src/engine/ScreenText.hpp | 2 +- rwengine/src/loaders/LoaderGXT.cpp | 3 +- rwengine/src/render/TextRenderer.hpp | 2 +- rwengine/src/script/ScriptFunctions.hpp | 2 +- rwlib/CMakeLists.txt | 9 + rwlib/source/fonts/FontMap.cpp | 79 +++++ rwlib/source/fonts/FontMap.hpp | 95 ++++++ rwlib/source/fonts/FontMapGta3.cpp | 208 ++++++++++++ rwlib/source/fonts/FontMapGta3.hpp | 28 ++ .../data => rwlib/source/fonts}/GameTexts.cpp | 0 .../data => rwlib/source/fonts}/GameTexts.hpp | 12 +- rwlib/source/fonts/Unicode.cpp | 110 +++++++ rwlib/source/fonts/Unicode.hpp | 303 ++++++++++++++++++ tests/CMakeLists.txt | 1 + tests/test_StringEncoding.cpp | 200 ++++++++++++ tests/test_Text.cpp | 10 +- 19 files changed, 1055 insertions(+), 17 deletions(-) create mode 100644 rwlib/source/fonts/FontMap.cpp create mode 100644 rwlib/source/fonts/FontMap.hpp create mode 100644 rwlib/source/fonts/FontMapGta3.cpp create mode 100644 rwlib/source/fonts/FontMapGta3.hpp rename {rwengine/src/data => rwlib/source/fonts}/GameTexts.cpp (100%) rename {rwengine/src/data => rwlib/source/fonts}/GameTexts.hpp (92%) create mode 100644 rwlib/source/fonts/Unicode.cpp create mode 100644 rwlib/source/fonts/Unicode.hpp create mode 100644 tests/test_StringEncoding.cpp diff --git a/rwengine/CMakeLists.txt b/rwengine/CMakeLists.txt index 3fb6c821..5bb66093 100644 --- a/rwengine/CMakeLists.txt +++ b/rwengine/CMakeLists.txt @@ -37,8 +37,6 @@ set(RWENGINE_SOURCES src/data/Chase.hpp src/data/CollisionModel.hpp src/data/CutsceneData.hpp - src/data/GameTexts.cpp - src/data/GameTexts.hpp src/data/InstanceData.hpp src/data/ModelData.cpp src/data/ModelData.hpp diff --git a/rwengine/src/engine/GameData.hpp b/rwengine/src/engine/GameData.hpp index 979c5281..2a8727fc 100644 --- a/rwengine/src/engine/GameData.hpp +++ b/rwengine/src/engine/GameData.hpp @@ -18,11 +18,11 @@ #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/rwengine/src/engine/GameState.hpp b/rwengine/src/engine/GameState.hpp index f8fc5818..e67b4ce2 100644 --- a/rwengine/src/engine/GameState.hpp +++ b/rwengine/src/engine/GameState.hpp @@ -9,15 +9,13 @@ #include #include -#include #include #include #include - #include #include +#include #include - #include