srell thank you
This commit is contained in:
parent
b0b73bb47e
commit
19e7374ac4
103 changed files with 22545 additions and 32 deletions
|
@ -25,16 +25,10 @@ namespace {
|
|||
NVL::String speaker;
|
||||
u32 scene_pos = 0;
|
||||
|
||||
char* date;
|
||||
}
|
||||
|
||||
namespace ADVect {
|
||||
void Init(std::string name, const std::vector<NVL::Parse::Scene>& sc) {
|
||||
std::time_t now_time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
||||
date = std::ctime(&now_time);
|
||||
date[10] = '\0';
|
||||
date = &date[4];
|
||||
|
||||
m_name = name;
|
||||
scenes = sc; // sure make a copy whatever
|
||||
|
||||
|
@ -151,7 +145,7 @@ namespace ADVect {
|
|||
|
||||
|
||||
bgfx::dbgTextClear();
|
||||
bgfx::dbgTextPrintf(0, 44, 0xF0, "NouVeL x ADVect :: %s 2022", date);
|
||||
bgfx::dbgTextPrintf(0, 44, 0xF0, "NouVeL x ADVect :: %s %s", __DATE__, __TIME__);
|
||||
bgfx::dbgTextPrintf(0, 43, 0xF0, "Current Position: %u", scene_pos);
|
||||
bgfx::dbgTextPrintf(0, 42, 0xF0, "Current Scene: %s", NVL::to_std_string(scenes[current_scene].name).c_str());
|
||||
|
||||
|
|
|
@ -12,8 +12,9 @@ include_directories ("include" "../NVL/")
|
|||
add_subdirectory("ext/freetype")
|
||||
add_subdirectory("ext/bgfx")
|
||||
if (WIN32)
|
||||
target_link_libraries (Game ${PROJECT_SOURCE_DIR}/lib/SDL2.lib ${PROJECT_SOURCE_DIR}/lib/SDL2main.lib NVL freetype bgfx bx)
|
||||
include_directories("include_windows")
|
||||
target_link_libraries (Game PRIVATE ${PROJECT_SOURCE_DIR}/lib/SDL2.lib ${PROJECT_SOURCE_DIR}/lib/SDL2main.lib NVL freetype bgfx bx)
|
||||
else ()
|
||||
target_link_libraries (Game NVL freetype bgfx bx)
|
||||
add_compile_options(-lSDL2)
|
||||
find_package(SDL2 REQUIRED)
|
||||
target_link_libraries (Game PRIVATE NVL freetype bgfx bx SDL2::SDL2 SDL2::SDL2main)
|
||||
endif ()
|
|
@ -14,14 +14,14 @@ namespace {
|
|||
FT_Error error;
|
||||
FT_Face face_regular, face_bold;
|
||||
|
||||
static struct PosUVVertex
|
||||
{
|
||||
struct PosUVVertex {
|
||||
f32 x;
|
||||
f32 y;
|
||||
f32 z;
|
||||
f32 u;
|
||||
f32 v;
|
||||
} quad_vert[] =
|
||||
};
|
||||
static PosUVVertex quad_vert[] =
|
||||
{
|
||||
{ 0.f, 0.f, 0.0f, 0.0f, 0.0f },
|
||||
{ 0.f, 1.f, 0.0f, 0.0f, 1.0f },
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import subprocess, os
|
||||
|
||||
plats = [
|
||||
{ 'location': 'glsl', 'frag': '440', 'vert': '440' },
|
||||
{ 'location': 'glsl', 'frag': '140', 'vert': '140' },
|
||||
{ 'location': 'dx11', 'frag': 'ps_5_0', 'vert': 'vs_5_0' },
|
||||
{ 'location': 'spirv', 'frag': 'spirv', 'vert': 'spirv' }
|
||||
]
|
||||
|
|
|
@ -7,6 +7,6 @@ SAMPLER2D(s_texColor, 0);
|
|||
|
||||
void main()
|
||||
{
|
||||
vec2 uv = { v_texcoord0.x, 1.0f - v_texcoord0.y };
|
||||
vec2 uv = vec2(v_texcoord0.x, 1.0f - v_texcoord0.y);
|
||||
gl_FragColor = vec4(1.0, 1.0, 1.0, texture2D(s_texColor, uv).a);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ SAMPLER2D(s_texColor, 0);
|
|||
|
||||
void main()
|
||||
{
|
||||
vec2 uv = { v_texcoord0.x, 1.0f - v_texcoord0.y };
|
||||
vec2 uv = vec2(v_texcoord0.x, 1.0f - v_texcoord0.y);
|
||||
gl_FragColor = texture2D(s_texColor, uv);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,18 @@
|
|||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"intelliSenseMode": "windows-clang-x64"
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": []
|
||||
}
|
||||
]
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
cmake_minimum_required (VERSION 3.8)
|
||||
|
||||
project (NVL)
|
||||
include_directories("include")
|
||||
add_library (NVL STATIC "NouVeL.cpp" "Parser.cpp" "Environment.cpp" "Environment.h" "Common.h")
|
||||
# add_executable (NVL "NouVeL.cpp" "Parser.cpp" "Environment.cpp" "Environment.h" "Common.h" )
|
||||
|
||||
|
|
|
@ -41,5 +41,6 @@ namespace NVL::Environment {
|
|||
struct Markup {
|
||||
u32 begin, end;
|
||||
std::vector<std::pair<String, std::vector<String>>> efs;
|
||||
} UnpackMarkupVariable(const Variable& m);
|
||||
};
|
||||
Markup UnpackMarkupVariable(const Variable& m);
|
||||
}
|
||||
|
|
|
@ -5,10 +5,9 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#include <regex>
|
||||
#include <srell.hpp>
|
||||
|
||||
#include <utility>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "Environment.h"
|
||||
|
||||
|
@ -18,10 +17,10 @@ namespace {
|
|||
struct ParseGroup {
|
||||
String accept;
|
||||
|
||||
operator String() const {
|
||||
constexpr operator String() const {
|
||||
return accept;
|
||||
}
|
||||
bool operator== (const String& other) const {
|
||||
constexpr bool operator== (const String& other) const {
|
||||
return accept == other;
|
||||
}
|
||||
};
|
||||
|
@ -29,7 +28,7 @@ namespace {
|
|||
struct Match {
|
||||
String accept;
|
||||
|
||||
operator Char() const {
|
||||
constexpr operator Char() const {
|
||||
if (accept.length() == 1)
|
||||
return accept[0];
|
||||
else {
|
||||
|
@ -37,7 +36,7 @@ namespace {
|
|||
return '\0';
|
||||
}
|
||||
}
|
||||
bool operator== (const String& other) const {
|
||||
constexpr bool operator== (const String& other) const {
|
||||
return accept == other;
|
||||
}
|
||||
};
|
||||
|
@ -344,15 +343,16 @@ namespace {
|
|||
* - Vec: Params
|
||||
*/
|
||||
Parse::Object MatchMarkup(String& s) {
|
||||
static const std::regex typer(R"((?:^|[^\\])\[([^\]]+)\]\s*\{([^\}]+)\})"); // G1 -> Specifiers, G2 -> Contents
|
||||
static const std::regex effect(R"(\s*(?:([^,\(\)]+?)\s*\(\s*([^\(\)]+?)\s*\)|([^,\(\)]+?))\s*(?:,\s*|$))"); // G1 & G2 -> Func, G3 -> Attr
|
||||
static const std::regex param(R"(([^,]+?)\s*(?:,\s*|$))"); // Comma split of func args
|
||||
static const srell::basic_regex<Char>
|
||||
typer(uR"((?:^|[^\\])\[([^\]]+)\]\s*\{([^\}]+)\})"), // G1 -> Specifiers, G2 -> Contents
|
||||
effect(uR"(\s*(?:([^,\(\)]+?)\s*\(\s*([^\(\)]+?)\s*\)|([^,\(\)]+?))\s*(?:,\s*|$))"), // G1 & G2 -> Func, G3 -> Attr
|
||||
param(uR"(([^,]+?)\s*(?:,\s*|$))"); // Comma split of func args
|
||||
|
||||
std::vector<Parse::Object> tags;
|
||||
|
||||
std::match_results<String::const_iterator> tags_match;
|
||||
std::match_results<String::const_iterator> effects_match;
|
||||
std::match_results<String::const_iterator> params_match;
|
||||
srell::match_results<String::const_iterator> tags_match;
|
||||
srell::match_results<String::const_iterator> effects_match;
|
||||
srell::match_results<String::const_iterator> params_match;
|
||||
|
||||
String reconstruction{};
|
||||
|
||||
|
@ -362,7 +362,7 @@ namespace {
|
|||
|
||||
// Match tags
|
||||
String::const_iterator tags_start(s.cbegin());
|
||||
while (std::regex_search(tags_start, s.cend(), tags_match, typer)) {
|
||||
while (srell::regex_search(tags_start, s.cend(), tags_match, typer)) {
|
||||
has_markup = true;
|
||||
Parse::Object m{ Parse::Type::Array, std::vector<Parse::Object>{} };
|
||||
reconstruction.append(tags_match.prefix().first, std::next(tags_match[0].first, 1)); // match will overmatch behind by 1
|
||||
|
@ -381,14 +381,14 @@ namespace {
|
|||
|
||||
// Match markup options
|
||||
String::const_iterator effects_start(tags_match[1].first);
|
||||
while (std::regex_search(effects_start, tags_match[1].second, effects_match, effect)) {
|
||||
while (srell::regex_search(effects_start, tags_match[1].second, effects_match, effect)) {
|
||||
if (effects_match[3].matched) {
|
||||
effects.push_back({ Parse::Type::String, effects_match[3].str() });
|
||||
}
|
||||
else {
|
||||
std::vector<Parse::Object> args;
|
||||
String::const_iterator params_start(effects_match[2].first);
|
||||
while (std::regex_search(params_start, effects_match[2].second, params_match, param)) {
|
||||
while (srell::regex_search(params_start, effects_match[2].second, params_match, param)) {
|
||||
size_t temp = 0;
|
||||
args.push_back(ParseExpression(params_match[1].str() + SEPARATOR.accept[0], temp)); // PeekToken will freak out if I don't do this
|
||||
params_start = params_match.suffix().first;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue