mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of ssh://git.axiodl.com:6431/AxioDL/hecl
This commit is contained in:
commit
9bb45dae80
|
@ -260,7 +260,7 @@ public:
|
|||
std::vector<std::string>& lockAndRead();
|
||||
void addLine(std::string_view line);
|
||||
void removeLine(std::string_view refLine);
|
||||
bool checkForLine(std::string_view refLine);
|
||||
bool checkForLine(std::string_view refLine) const;
|
||||
void unlockAndDiscard();
|
||||
bool unlockAndCommit();
|
||||
};
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
constexpr DNAFourCC(const FourCC& other) noexcept : FourCC(other) {}
|
||||
constexpr DNAFourCC(const char* name) noexcept : FourCC(name) {}
|
||||
constexpr DNAFourCC(uint32_t n) noexcept : FourCC(n) {}
|
||||
constexpr DNAFourCC(athena::io::IStreamReader& r) { read(r); }
|
||||
DNAFourCC(athena::io::IStreamReader& r) { read(r); }
|
||||
AT_DECL_EXPLICIT_DNA_YAML
|
||||
};
|
||||
template <>
|
||||
|
|
|
@ -129,14 +129,14 @@ public:
|
|||
Token() = default;
|
||||
Token(const Token& other) = delete;
|
||||
Token& operator=(const Token& other) = delete;
|
||||
Token& operator=(Token&& other) {
|
||||
Token& operator=(Token&& other) noexcept {
|
||||
m_pool = other.m_pool;
|
||||
m_index = other.m_index;
|
||||
m_div = other.m_div;
|
||||
other.m_index = -1;
|
||||
return *this;
|
||||
}
|
||||
Token(Token&& other) : m_pool(other.m_pool), m_index(other.m_index), m_div(other.m_div) { other.m_index = -1; }
|
||||
Token(Token&& other) noexcept : m_pool(other.m_pool), m_index(other.m_index), m_div(other.m_div) { other.m_index = -1; }
|
||||
|
||||
~Token() {
|
||||
if (m_index != -1) {
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
Token() = default;
|
||||
Token(const Token& other) = delete;
|
||||
Token& operator=(const Token& other) = delete;
|
||||
Token& operator=(Token&& other) {
|
||||
Token& operator=(Token&& other) noexcept {
|
||||
m_pool = other.m_pool;
|
||||
m_index = other.m_index;
|
||||
m_count = other.m_count;
|
||||
|
@ -140,7 +140,7 @@ public:
|
|||
other.m_index = -1;
|
||||
return *this;
|
||||
}
|
||||
Token(Token&& other) : m_pool(other.m_pool), m_index(other.m_index), m_count(other.m_count), m_div(other.m_div) {
|
||||
Token(Token&& other) noexcept : m_pool(other.m_pool), m_index(other.m_index), m_count(other.m_count), m_div(other.m_div) {
|
||||
other.m_index = -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -485,20 +485,20 @@ class Time final {
|
|||
time_t ts;
|
||||
|
||||
public:
|
||||
Time() : ts(time(NULL)) {}
|
||||
Time(time_t ti) : ts(ti) {}
|
||||
Time(const Time& other) { ts = other.ts; }
|
||||
time_t getTs() const { return ts; }
|
||||
Time& operator=(const Time& other) {
|
||||
Time() : ts(std::time(nullptr)) {}
|
||||
constexpr Time(time_t ti) noexcept : ts{ti} {}
|
||||
constexpr Time(const Time& other) noexcept : ts{other.ts} {}
|
||||
[[nodiscard]] constexpr time_t getTs() const { return ts; }
|
||||
constexpr Time& operator=(const Time& other) noexcept {
|
||||
ts = other.ts;
|
||||
return *this;
|
||||
}
|
||||
bool operator==(const Time& other) const { return ts == other.ts; }
|
||||
bool operator!=(const Time& other) const { return ts != other.ts; }
|
||||
bool operator<(const Time& other) const { return ts < other.ts; }
|
||||
bool operator>(const Time& other) const { return ts > other.ts; }
|
||||
bool operator<=(const Time& other) const { return ts <= other.ts; }
|
||||
bool operator>=(const Time& other) const { return ts >= other.ts; }
|
||||
[[nodiscard]] constexpr bool operator==(const Time& other) const noexcept { return ts == other.ts; }
|
||||
[[nodiscard]] constexpr bool operator!=(const Time& other) const noexcept { return ts != other.ts; }
|
||||
[[nodiscard]] constexpr bool operator<(const Time& other) const noexcept { return ts < other.ts; }
|
||||
[[nodiscard]] constexpr bool operator>(const Time& other) const noexcept { return ts > other.ts; }
|
||||
[[nodiscard]] constexpr bool operator<=(const Time& other) const noexcept { return ts <= other.ts; }
|
||||
[[nodiscard]] constexpr bool operator>=(const Time& other) const noexcept { return ts >= other.ts; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cerrno>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
@ -60,24 +62,27 @@ std::vector<std::string>& Project::ConfigFile::lockAndRead() {
|
|||
mainString += std::string(readBuf, readSz);
|
||||
}
|
||||
|
||||
std::string::const_iterator begin = mainString.begin();
|
||||
std::string::const_iterator end = mainString.begin();
|
||||
auto begin = mainString.cbegin();
|
||||
auto end = mainString.cbegin();
|
||||
|
||||
m_lines.clear();
|
||||
while (end != mainString.end()) {
|
||||
std::string::const_iterator origEnd = end;
|
||||
if (*end == '\0')
|
||||
auto origEnd = end;
|
||||
if (*end == '\0') {
|
||||
break;
|
||||
else if (CheckNewLineAdvance(end)) {
|
||||
if (begin != origEnd)
|
||||
m_lines.push_back(std::string(begin, origEnd));
|
||||
}
|
||||
if (CheckNewLineAdvance(end)) {
|
||||
if (begin != origEnd) {
|
||||
m_lines.emplace_back(begin, origEnd);
|
||||
}
|
||||
begin = end;
|
||||
continue;
|
||||
}
|
||||
++end;
|
||||
}
|
||||
if (begin != end)
|
||||
m_lines.push_back(std::string(begin, end));
|
||||
if (begin != end) {
|
||||
m_lines.emplace_back(begin, end);
|
||||
}
|
||||
|
||||
return m_lines;
|
||||
}
|
||||
|
@ -102,16 +107,13 @@ void Project::ConfigFile::removeLine(std::string_view refLine) {
|
|||
}
|
||||
}
|
||||
|
||||
bool Project::ConfigFile::checkForLine(std::string_view refLine) {
|
||||
bool Project::ConfigFile::checkForLine(std::string_view refLine) const {
|
||||
if (!m_lockedFile) {
|
||||
LogModule.reportSource(logvisor::Fatal, __FILE__, __LINE__, fmt("Project::ConfigFile::lockAndRead not yet called"));
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const std::string& line : m_lines)
|
||||
if (line == refLine)
|
||||
return true;
|
||||
return false;
|
||||
return std::any_of(m_lines.cbegin(), m_lines.cend(), [&refLine](const auto& line) { return line == refLine; });
|
||||
}
|
||||
|
||||
void Project::ConfigFile::unlockAndDiscard() {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace hecl {
|
||||
static const SystemRegex regPATHCOMP(_SYS_STR("[/\\\\]*([^/\\\\]+)"), SystemRegex::ECMAScript | SystemRegex::optimize);
|
||||
static const SystemRegex regDRIVELETTER(_SYS_STR("^([^/]*)/"), SystemRegex::ECMAScript | SystemRegex::optimize);
|
||||
|
||||
static SystemString CanonRelPath(SystemStringView path) {
|
||||
/* Tokenize Path */
|
||||
|
|
|
@ -11,7 +11,7 @@ static logvisor::Module HMDL_Log("HMDL");
|
|||
HMDLData::HMDLData(boo::IGraphicsDataFactory::Context& ctx, const void* metaData, const void* vbo, const void* ibo) {
|
||||
HMDLMeta meta;
|
||||
{
|
||||
athena::io::MemoryReader r((atUint8*)metaData, HECL_HMDL_META_SZ);
|
||||
athena::io::MemoryReader r(metaData, HECL_HMDL_META_SZ);
|
||||
meta.read(r);
|
||||
}
|
||||
if (meta.magic != 'TACO')
|
||||
|
@ -20,8 +20,8 @@ HMDLData::HMDLData(boo::IGraphicsDataFactory::Context& ctx, const void* metaData
|
|||
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, vbo, meta.vertStride, meta.vertCount);
|
||||
m_ibo = ctx.newStaticBuffer(boo::BufferUse::Index, ibo, 4, meta.indexCount);
|
||||
|
||||
size_t elemCount = 2 + meta.colorCount + meta.uvCount + meta.weightCount;
|
||||
m_vtxFmtData.reset(new boo::VertexElementDescriptor[elemCount]);
|
||||
const size_t elemCount = 2 + meta.colorCount + meta.uvCount + meta.weightCount;
|
||||
m_vtxFmtData = std::make_unique<boo::VertexElementDescriptor[]>(elemCount);
|
||||
|
||||
m_vtxFmtData[0].semantic = boo::VertexSemantic::Position3;
|
||||
m_vtxFmtData[1].semantic = boo::VertexSemantic::Normal3;
|
||||
|
|
Loading…
Reference in New Issue