Refactor + render animation tweaks + updated frame properties + bug fixes

This commit is contained in:
2025-12-17 23:02:00 -05:00
parent b4b4fe3714
commit 119bbc4081
63 changed files with 1964 additions and 1701 deletions
+55
View File
@@ -0,0 +1,55 @@
#include "process_.h"
namespace anm2ed::util
{
Process::Process(const char* command, const char* mode) { open(command, mode); }
Process::~Process() { close(); }
bool Process::open(const char* command, const char* mode)
{
close();
#ifdef WIN32
pipe = _popen(command, mode);
#else
pipe = popen(command, mode);
#endif
return pipe != nullptr;
}
int Process::close()
{
if (pipe)
{
#ifdef WIN32
auto result = _pclose(pipe);
#else
auto result = pclose(pipe);
#endif
pipe = nullptr;
return result;
}
return -1;
}
std::string Process::output_get_and_close()
{
std::string output{};
if (!pipe) return {};
char buffer[256];
while (fgets(buffer, sizeof(buffer), pipe))
output += buffer;
close();
return output;
}
FILE* Process::get() const { return pipe; }
Process::operator bool() const { return pipe != nullptr; }
}