2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:44:56 +00:00

Windows fixes

This commit is contained in:
Jack Andersen
2018-10-14 10:16:21 -10:00
parent 1559163f98
commit 1851308021
68 changed files with 1343 additions and 968 deletions

View File

@@ -379,7 +379,7 @@ bool Cook(const hecl::blender::MapArea& mapaIn, const hecl::ProjectPath& out)
{
if (mapaIn.verts.size() >= 256)
{
Log.report(logvisor::Error, _S("MAPA %s vertex range exceeded [%d/%d]"),
Log.report(logvisor::Error, _SYS_STR("MAPA %s vertex range exceeded [%d/%d]"),
out.getRelativePath().data(), mapaIn.verts.size(), 255);
return false;
}

View File

@@ -125,7 +125,7 @@ bool MAPU::Cook(const hecl::blender::MapUniverse& mapuIn, const hecl::ProjectPat
mapu.worlds.emplace_back();
MAPU::World& wldOut = mapu.worlds.back();
wldOut.name = wld.name;
wldOut.mlvl = hecl::ProjectPath(wld.worldPath, _S("!world.*"));
wldOut.mlvl = hecl::ProjectPath(wld.worldPath, _SYS_STR("!world.*"));
wldOut.transform.xf[0] = wld.xf.val[0];
wldOut.transform.xf[1] = wld.xf.val[1];
wldOut.transform.xf[2] = wld.xf.val[2];

View File

@@ -16,7 +16,7 @@ bool ReadMLVLToBlender(hecl::blender::Connection& conn,
bool force,
std::function<void(const hecl::SystemChar*)> fileChanged)
{
hecl::ProjectPath blendPath = outPath.getWithExtension(_S(".blend"), true);
hecl::ProjectPath blendPath = outPath.getWithExtension(_SYS_STR(".blend"), true);
if (!force && blendPath.isFile())
return true;

View File

@@ -1,4 +1,4 @@
#include <athena/Types.hpp>
#include "athena/Types.hpp"
#include "OBBTreeBuilder.hpp"
#include "zeus/CTransform.hpp"
#include "DataSpec/DNAMP1/DCLN.hpp"
@@ -48,7 +48,9 @@ static FittedOBB BuildFromCovarianceMatrix(gmm::dense_matrix<float>& C,
// extract the eigenvalues and eigenvectors from C
gmm::dense_matrix<float> eigvec(3,3);
std::vector<float> eigval(3);
gmm::symmetric_qr_algorithm(C, eigval, eigvec);
using namespace gmm;
using MAT1 = gmm::dense_matrix<float>;
gmm::symmetric_qr_algorithm(C, eigval, eigvec, default_tol_for_qr);
// find the right, up and forward vectors from the eigenvectors
zeus::CVector3f r(eigvec(0,0), eigvec(1,0), eigvec(2,0));

View File

@@ -264,7 +264,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getCharacterWorking(const EntryType* en
if (entry->type == FOURCC('EVNT'))
{
hecl::SystemStringConv wideStr(characterSearch->second.second);
return characterPath.getWithExtension((hecl::SystemString(_S(".")) + wideStr.c_str()).c_str(), true);
return characterPath.getWithExtension((hecl::SystemString(_SYS_STR(".")) + wideStr.c_str()).c_str(), true);
}
return characterPath.ensureAuxInfo(characterSearch->second.second);
}
@@ -299,7 +299,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getWorking(const EntryType* entry,
if (extractor.fileExts[0] && !extractor.fileExts[1])
entName += extractor.fileExts[0];
else if (extractor.fileExts[0])
entName += _S(".*");
entName += _SYS_STR(".*");
else if (hecl::ProjectPath chWork = getCharacterWorking(entry))
return chWork;
return hecl::ProjectPath(pakPath, entName).ensureAuxInfo(auxInfo);
@@ -320,7 +320,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getWorking(const EntryType* entry,
if (extractor.fileExts[0] && !extractor.fileExts[1])
entName += extractor.fileExts[0];
else if (extractor.fileExts[0])
entName += _S(".*");
entName += _SYS_STR(".*");
else if (hecl::ProjectPath chWork = getCharacterWorking(entry))
return chWork;
if (bridge.getPAK().m_noShare)
@@ -347,7 +347,7 @@ hecl::ProjectPath PAKRouter<BRIDGETYPE>::getWorking(const EntryType* entry,
if (extractor.fileExts[0] && !extractor.fileExts[1])
entName += extractor.fileExts[0];
else if (extractor.fileExts[0])
entName += _S(".*");
entName += _SYS_STR(".*");
else if (hecl::ProjectPath chWork = getCharacterWorking(entry))
return chWork;
hecl::ProjectPath sharedPath(m_sharedWorking, entName);
@@ -442,7 +442,7 @@ hecl::SystemString PAKRouter<BRIDGETYPE>::getResourceRelativePath(const EntryTyp
hecl::ProjectPath aPath = getWorking(&a, BRIDGETYPE::LookupExtractor(*node, *pak, a));
hecl::SystemString ret;
for (int i=0 ; i<aPath.levelCount() ; ++i)
ret += _S("../");
ret += _SYS_STR("../");
hecl::ProjectPath bPath = getWorking(be, BRIDGETYPE::LookupExtractor(*node, *pak, *be));
ret += bPath.getRelativePath();
return ret;
@@ -543,7 +543,7 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
{
cooked.makeDirChain(false);
PAKEntryReadStream s = entryPtr->beginReadStream(*node);
FILE* fout = hecl::Fopen(cooked.getAbsolutePath().data(), _S("wb"));
FILE* fout = hecl::Fopen(cooked.getAbsolutePath().data(), _SYS_STR("wb"));
fwrite(s.data(), 1, s.length(), fout);
fclose(fout);
}

View File

@@ -1013,11 +1013,11 @@ bool TXTR::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
uint16_t height = rs.readUint16Big();
uint32_t numMips = rs.readUint32Big();
FILE* fp = hecl::Fopen(outPath.getAbsolutePath().data(), _S("wb"));
FILE* fp = hecl::Fopen(outPath.getAbsolutePath().data(), _SYS_STR("wb"));
if (!fp)
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for writing"),
_SYS_STR("Unable to open '%s' for writing"),
outPath.getAbsolutePath().data());
return false;
}
@@ -1271,11 +1271,11 @@ static int GetNumPaletteEntriesForGCN(png_structp png, png_infop info)
bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath)
{
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _S("rb"));
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (!inf)
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for reading"),
_SYS_STR("Unable to open '%s' for reading"),
inPath.getAbsolutePath().data());
return false;
}
@@ -1285,7 +1285,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
fread(header, 1, 8, inf);
if (png_sig_cmp((png_const_bytep)header, 0, 8))
{
Log.report(logvisor::Error, _S("invalid PNG signature in '%s'"),
Log.report(logvisor::Error, _SYS_STR("invalid PNG signature in '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
return false;
@@ -1310,7 +1310,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (setjmp(png_jmpbuf(pngRead)))
{
Log.report(logvisor::Error, _S("unable to initialize libpng I/O for '%s'"),
Log.report(logvisor::Error, _SYS_STR("unable to initialize libpng I/O for '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1356,7 +1356,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (bitDepth != 8)
{
Log.report(logvisor::Error, _S("'%s' is not 8 bits-per-channel"),
Log.report(logvisor::Error, _SYS_STR("'%s' is not 8 bits-per-channel"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1390,7 +1390,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
nComps = 1;
break;
default:
Log.report(logvisor::Error, _S("unsupported color type in '%s'"),
Log.report(logvisor::Error, _SYS_STR("unsupported color type in '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1413,7 +1413,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (setjmp(png_jmpbuf(pngRead)))
{
Log.report(logvisor::Error, _S("unable to read image in '%s'"),
Log.report(logvisor::Error, _SYS_STR("unable to read image in '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1629,7 +1629,7 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
if (outf.hasError())
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for writing"),
_SYS_STR("Unable to open '%s' for writing"),
outPath.getAbsolutePath().data());
return false;
}
@@ -1645,11 +1645,11 @@ bool TXTR::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath)
{
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _S("rb"));
FILE* inf = hecl::Fopen(inPath.getAbsolutePath().data(), _SYS_STR("rb"));
if (!inf)
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for reading"),
_SYS_STR("Unable to open '%s' for reading"),
inPath.getAbsolutePath().data());
return false;
}
@@ -1659,7 +1659,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
fread(header, 1, 8, inf);
if (png_sig_cmp((png_const_bytep)header, 0, 8))
{
Log.report(logvisor::Error, _S("invalid PNG signature in '%s'"),
Log.report(logvisor::Error, _SYS_STR("invalid PNG signature in '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
return false;
@@ -1684,7 +1684,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (setjmp(png_jmpbuf(pngRead)))
{
Log.report(logvisor::Error, _S("unable to initialize libpng I/O for '%s'"),
Log.report(logvisor::Error, _SYS_STR("unable to initialize libpng I/O for '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1722,7 +1722,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (bitDepth != 8)
{
Log.report(logvisor::Error, _S("'%s' is not 8 bits-per-channel"),
Log.report(logvisor::Error, _SYS_STR("'%s' is not 8 bits-per-channel"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1754,7 +1754,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
paletteBuf = ReadPalette(pngRead, info, paletteSize);
break;
default:
Log.report(logvisor::Error, _S("unsupported color type in '%s'"),
Log.report(logvisor::Error, _SYS_STR("unsupported color type in '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1775,7 +1775,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (setjmp(png_jmpbuf(pngRead)))
{
Log.report(logvisor::Error, _S("unable to read image in '%s'"),
Log.report(logvisor::Error, _SYS_STR("unable to read image in '%s'"),
inPath.getAbsolutePath().data());
fclose(inf);
png_destroy_read_struct(&pngRead, &info, nullptr);
@@ -1908,7 +1908,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP
if (outf.hasError())
{
Log.report(logvisor::Error,
_S("Unable to open '%s' for writing"),
_SYS_STR("Unable to open '%s' for writing"),
outPath.getAbsolutePath().data());
return false;
}