Fixed all errors.

This commit is contained in:
2023-12-18 02:13:20 -08:00
parent 3acb78f247
commit 0a6f5533ee
37 changed files with 950 additions and 1090 deletions

View File

@@ -15,15 +15,15 @@
namespace ehs
{
constexpr Char_32 name_32[] = U"Lone Wolf Engine";
constexpr Char_16 name_16[] = L"Lone Wolf Engine";
constexpr Char_8 name_8[] = "Lone Wolf Engine";
constexpr Char_32 acronym_32[] = U"LWE";
constexpr Char_16 acronym_16[] = L"LWE";
constexpr Char_8 acronym_8[] = "LWE";
constexpr Char_32 versionId_32[] = U"Beta";
constexpr Char_16 versionId_16[] = L"Beta";
constexpr Char_8 versionId_8[] = "Beta";
constexpr Char_32 name_32[] = U"Event Horizon Suite";
constexpr Char_16 name_16[] = L"Event Horizon Suite";
constexpr Char_8 name_8[] = "Event Horizon Suite";
constexpr Char_32 acronym_32[] = U"EHS";
constexpr Char_16 acronym_16[] = L"EHS";
constexpr Char_8 acronym_8[] = "EHS";
constexpr Char_32 versionId_32[] = U"Release";
constexpr Char_16 versionId_16[] = L"Release";
constexpr Char_8 versionId_8[] = "Release";
Str_8 appName;
Str_8 appVerId;
@@ -94,7 +94,7 @@ namespace ehs
return appVer;
}
bool DecodeWAV(const lwe::AudioCodec* const codec, lwe::Serializer<lwe::UInt_64>& in, lwe::Audio* out)
bool DecodeWAV(const ehs::AudioCodec* const codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Audio* out)
{
RIFF riff(in);
@@ -255,7 +255,7 @@ namespace ehs
return true;
}
bool EncodeEHA(const lwe::AudioCodec* const codec, lwe::Serializer<lwe::UInt_64>& out, const lwe::Audio* in)
bool EncodeEHA(const ehs::AudioCodec* const codec, ehs::Serializer<ehs::UInt_64>& out, const ehs::Audio* in)
{
Serializer<UInt_64> result(codec->GetEndianness());
result.WriteVersion({1, 0, 0});
@@ -277,7 +277,7 @@ namespace ehs
return true;
}
bool DecodeEHA(const lwe::AudioCodec* const codec, lwe::Serializer<lwe::UInt_64>& in, lwe::Audio* out)
bool DecodeEHA(const ehs::AudioCodec* const codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Audio* out)
{
Version version = in.ReadVersion();
if (version != Version(1, 0, 0))
@@ -303,7 +303,7 @@ namespace ehs
return true;
}
bool DecodePNG(const lwe::ImgCodec* const codec, lwe::Serializer<lwe::UInt_64>& in, lwe::Img* out)
bool DecodePNG(const ehs::ImgCodec* const codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Img* out)
{
PNG png(out->GetId(), in);
@@ -329,7 +329,7 @@ namespace ehs
else if (colorType == 6)
channels = 4;
*out = Img(out->GetId(), bitDepth, channels, width, height, out->GetAspect(), true);
*out = Img(out->GetId(), bitDepth, channels, width, height);
UInt_8 compression = ihdrData->Read<UInt_8>();
if (compression)
@@ -417,7 +417,7 @@ namespace ehs
return true;
}
bool EncodeQOI(const lwe::ImgCodec* const codec, lwe::Serializer<lwe::UInt_64>& out, const lwe::Img* in)
bool EncodeQOI(const ehs::ImgCodec* const codec, ehs::Serializer<ehs::UInt_64>& out, const ehs::Img* in)
{
UInt_8 channels = in->Channels();
UInt_64 width = in->Width();
@@ -536,7 +536,7 @@ namespace ehs
return true;
}
bool DecodeQOI(const lwe::ImgCodec* const codec, lwe::Serializer<lwe::UInt_64>& in, lwe::Img* out)
bool DecodeQOI(const ehs::ImgCodec* const codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Img* out)
{
Str_8 imgType = in.ReadStr<Char_8, UInt_64>(4);
if (imgType != "qoif")
@@ -555,7 +555,7 @@ namespace ehs
UInt_64 size = width * channels * height;
*out = Img(out->GetId(), bitDepth, channels, width, height, out->GetAspect(), true);
*out = Img(out->GetId(), bitDepth, channels, width, height);
Byte prevPixel[4] = {0, 0, 0, 255};
@@ -623,45 +623,45 @@ namespace ehs
int main()
{
lwe::Audio::AddCodec({
ehs::Audio::AddCodec({
"Waveform Audio",
"wav",
lwe::Endianness::LE,
ehs::Endianness::LE,
nullptr,
lwe::DecodeWAV
ehs::DecodeWAV
});
lwe::Audio::AddCodec({
ehs::Audio::AddCodec({
"Event Horizon Audio",
"eha",
lwe::Endianness::LE,
lwe::EncodeEHA,
lwe::DecodeEHA
ehs::Endianness::LE,
ehs::EncodeEHA,
ehs::DecodeEHA
});
lwe::Img::AddCodec({
ehs::Img::AddCodec({
"Portable Network Graphic",
"png",
lwe::Endianness::BE,
ehs::Endianness::BE,
nullptr,
lwe::DecodePNG
ehs::DecodePNG
});
lwe::Img::AddCodec({
ehs::Img::AddCodec({
"Quite OK Image",
"qoi",
lwe::Endianness::BE,
lwe::EncodeQOI,
lwe::DecodeQOI
ehs::Endianness::BE,
ehs::EncodeQOI,
ehs::DecodeQOI
});
lwe::GarbageCollector::Start();
ehs::GarbageCollector::Start();
const lwe::SInt_32 code = Main(&lwe::appName, &lwe::appVerId, &lwe::appVer);
const ehs::SInt_32 code = Main(&ehs::appName, &ehs::appVerId, &ehs::appVer);
if (code)
EHS_LOG("Warning", 0, "Executable exited with code #" + lwe::Str_8::FromNum(code) + ".");
EHS_LOG("Warning", 0, "Executable exited with code #" + ehs::Str_8::FromNum(code) + ".");
lwe::GarbageCollector::Stop();
ehs::GarbageCollector::Stop();
return code;
}