fix more bugs and crap
This commit is contained in:
parent
890dc4f228
commit
649462ff5c
|
@ -40,8 +40,8 @@ extern "C" {
|
|||
#include <windows.h>
|
||||
typedef unsigned __int64 QWORD;
|
||||
#include <float.h>
|
||||
#define isnan(v) _isnan(v)
|
||||
#define isinf(v) (!_finite(v))
|
||||
//#define isnan(v) _isnan(v)
|
||||
//#define isinf(v) (!_finite(v))
|
||||
|
||||
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */
|
||||
#define FF_INTDEF 2
|
||||
|
|
|
@ -320,8 +320,37 @@ LegacyEntry LegacyFile[] =
|
|||
|
||||
static std::string GetDefaultKey(std::string path)
|
||||
{
|
||||
std::regex re("(Instance|Window)(\\d+)\\.");
|
||||
return std::regex_replace(path, re, "$1*.");
|
||||
std::string tables[] = {"Instance", "Window", "Camera"};
|
||||
|
||||
std::string ret = "";
|
||||
int plen = path.length();
|
||||
for (int i = 0; i < plen;)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
for (auto& tbl : tables)
|
||||
{
|
||||
int tlen = tbl.length();
|
||||
if ((plen-i) <= tlen) continue;
|
||||
if (path.substr(i, tlen) != tbl) continue;
|
||||
if (path[i+tlen] < '0' || path[i+tlen] > '9') continue;
|
||||
|
||||
ret += tbl + "*";
|
||||
i = path.find('.', i+tlen);
|
||||
if (i == std::string::npos) return ret;
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
ret += path[i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,12 +25,7 @@
|
|||
#include <unordered_map>
|
||||
#include <tuple>
|
||||
|
||||
#ifndef TOML11_VALUE_HPP
|
||||
namespace toml
|
||||
{
|
||||
class value;
|
||||
}
|
||||
#endif
|
||||
#include "toml/value.hpp"
|
||||
|
||||
namespace Config
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue