mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
fix more bugs and crap
This commit is contained in:
parent
890dc4f228
commit
649462ff5c
@ -40,8 +40,8 @@ extern "C" {
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
typedef unsigned __int64 QWORD;
|
typedef unsigned __int64 QWORD;
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#define isnan(v) _isnan(v)
|
//#define isnan(v) _isnan(v)
|
||||||
#define isinf(v) (!_finite(v))
|
//#define isinf(v) (!_finite(v))
|
||||||
|
|
||||||
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */
|
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */
|
||||||
#define FF_INTDEF 2
|
#define FF_INTDEF 2
|
||||||
|
@ -320,8 +320,37 @@ LegacyEntry LegacyFile[] =
|
|||||||
|
|
||||||
static std::string GetDefaultKey(std::string path)
|
static std::string GetDefaultKey(std::string path)
|
||||||
{
|
{
|
||||||
std::regex re("(Instance|Window)(\\d+)\\.");
|
std::string tables[] = {"Instance", "Window", "Camera"};
|
||||||
return std::regex_replace(path, re, "$1*.");
|
|
||||||
|
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 <unordered_map>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#ifndef TOML11_VALUE_HPP
|
#include "toml/value.hpp"
|
||||||
namespace toml
|
|
||||||
{
|
|
||||||
class value;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Config
|
namespace Config
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user