mirror of https://github.com/AxioDL/metaforce.git
HMDL outputting fixes
This commit is contained in:
parent
db335e5d98
commit
ad1a47e8b4
|
@ -5,6 +5,10 @@ if(MSVC)
|
||||||
# Shaddup MSVC
|
# Shaddup MSVC
|
||||||
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 /wd4267 /wd4244)
|
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 /wd4267 /wd4244)
|
||||||
else()
|
else()
|
||||||
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
||||||
|
message(WARNING "GCC needs -fpermissive for nested type redeclarations; expect lotsa warnings!!")
|
||||||
|
endif()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-multichar -fno-exceptions")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-multichar -fno-exceptions")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -128,6 +128,7 @@ def cook(writebuf, mesh_obj, output_mode, max_skin_banks, max_octant_length=None
|
||||||
skin_slot_set = set()
|
skin_slot_set = set()
|
||||||
faces = list(mat_faces_rem)
|
faces = list(mat_faces_rem)
|
||||||
for f in faces:
|
for f in faces:
|
||||||
|
if dlay:
|
||||||
ret_faces = None
|
ret_faces = None
|
||||||
for v in f.verts:
|
for v in f.verts:
|
||||||
sg = tuple(sorted(v[dlay].items()))
|
sg = tuple(sorted(v[dlay].items()))
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit b6b54d092130aa9d31e845c768faf8f08b7a30b1
|
Subproject commit 39dd15cd55e6432a4ea35949c81ef1803cc8955e
|
|
@ -148,7 +148,7 @@ struct IR : BigDNA
|
||||||
struct LoadImm : BigDNA
|
struct LoadImm : BigDNA
|
||||||
{
|
{
|
||||||
DECL_DNA
|
DECL_DNA
|
||||||
Value<atVec4f> m_immVec;
|
Value<atVec4f> m_immVec = {};
|
||||||
} m_loadImm;
|
} m_loadImm;
|
||||||
|
|
||||||
enum ArithmeticOpType : uint8_t
|
enum ArithmeticOpType : uint8_t
|
||||||
|
|
|
@ -18,7 +18,7 @@ enum HMDLTopology : atUint32
|
||||||
struct HMDLMeta : Athena::io::DNA<Athena::BigEndian>
|
struct HMDLMeta : Athena::io::DNA<Athena::BigEndian>
|
||||||
{
|
{
|
||||||
DECL_DNA
|
DECL_DNA
|
||||||
Value<atUint32> magic = SBIG('TACO');
|
Value<atUint32> magic = 'TACO';
|
||||||
Value<HMDLTopology> topology;
|
Value<HMDLTopology> topology;
|
||||||
Value<atUint32> vertStride;
|
Value<atUint32> vertStride;
|
||||||
Value<atUint32> vertCount;
|
Value<atUint32> vertCount;
|
||||||
|
|
|
@ -361,7 +361,6 @@ void Lexer::EmitVec3(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
|
||||||
if (!gn)
|
if (!gn)
|
||||||
{
|
{
|
||||||
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location);
|
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location);
|
||||||
ir.m_instructions.back().m_loadImm.m_immVec = {};
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +399,6 @@ void Lexer::EmitVec4(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
|
||||||
if (!gn)
|
if (!gn)
|
||||||
{
|
{
|
||||||
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location);
|
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location);
|
||||||
ir.m_instructions.back().m_loadImm.m_immVec = {};
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,11 +600,14 @@ void Lexer::EmitVectorSwizzle(IR& ir, const Lexer::OperationNode* swizNode, IR::
|
||||||
{
|
{
|
||||||
atVec4f* opt = &ir.m_instructions.back().m_loadImm.m_immVec;
|
atVec4f* opt = &ir.m_instructions.back().m_loadImm.m_immVec;
|
||||||
const SourceLocation& loc = ir.m_instructions.back().m_loc;
|
const SourceLocation& loc = ir.m_instructions.back().m_loc;
|
||||||
atVec4f eval;
|
atVec4f eval = {};
|
||||||
switch (str.size())
|
switch (str.size())
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
eval = {opt->vec[SwizzleCompIdx(str[0], m_diag, loc)]};
|
eval.vec[0] = opt->vec[SwizzleCompIdx(str[0], m_diag, loc)];
|
||||||
|
eval.vec[1] = eval.vec[0];
|
||||||
|
eval.vec[2] = eval.vec[0];
|
||||||
|
eval.vec[3] = eval.vec[0];
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
eval.vec[0] = opt->vec[SwizzleCompIdx(str[0], m_diag, loc)];
|
eval.vec[0] = opt->vec[SwizzleCompIdx(str[0], m_diag, loc)];
|
||||||
|
@ -698,6 +699,7 @@ void Lexer::RecursiveFuncCompile(IR& ir, const Lexer::OperationNode* funcNode, I
|
||||||
ir.m_instructions.emplace_back(IR::OpCall, funcNode->m_tok.m_location);
|
ir.m_instructions.emplace_back(IR::OpCall, funcNode->m_tok.m_location);
|
||||||
IR::Instruction& inst = ir.m_instructions.back();
|
IR::Instruction& inst = ir.m_instructions.back();
|
||||||
inst.m_call.m_name = funcNode->m_tok.m_tokenString;
|
inst.m_call.m_name = funcNode->m_tok.m_tokenString;
|
||||||
|
inst.m_call.m_argInstCount = instIdxs.size();
|
||||||
inst.m_call.m_argInstIdxs = std::move(instIdxs);
|
inst.m_call.m_argInstIdxs = std::move(instIdxs);
|
||||||
inst.m_target = target;
|
inst.m_target = target;
|
||||||
if (tgt > ir.m_regCount)
|
if (tgt > ir.m_regCount)
|
||||||
|
|
|
@ -16,7 +16,7 @@ HMDLData::HMDLData(boo::IGraphicsDataFactory* factory,
|
||||||
Athena::io::MemoryReader r((atUint8*)metaData, HECL_HMDL_META_SZ);
|
Athena::io::MemoryReader r((atUint8*)metaData, HECL_HMDL_META_SZ);
|
||||||
meta.read(r);
|
meta.read(r);
|
||||||
}
|
}
|
||||||
if (meta.magic != FOURCC('TACO'))
|
if (meta.magic != 'TACO')
|
||||||
Log.report(LogVisor::FatalError, "invalid HMDL magic");
|
Log.report(LogVisor::FatalError, "invalid HMDL magic");
|
||||||
|
|
||||||
m_vbo = factory->newStaticBuffer(boo::BufferUseVertex, vbo, meta.vertStride, meta.vertCount);
|
m_vbo = factory->newStaticBuffer(boo::BufferUseVertex, vbo, meta.vertStride, meta.vertCount);
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
#ifndef IRUNTIMECACHE_HPP
|
|
||||||
#define IRUNTIMECACHE_HPP
|
|
||||||
|
|
||||||
#endif // IRUNTIMECACHE_HPP
|
|
|
@ -1,4 +0,0 @@
|
||||||
#ifndef IRUNTIMEOBJECT_HPP
|
|
||||||
#define IRUNTIMEOBJECT_HPP
|
|
||||||
|
|
||||||
#endif // IRUNTIMEOBJECT_HPP
|
|
|
@ -1,4 +0,0 @@
|
||||||
#ifndef IRUNTIMESPEC_HPP
|
|
||||||
#define IRUNTIMESPEC_HPP
|
|
||||||
|
|
||||||
#endif // IRUNTIMESPEC_HPP
|
|
Loading…
Reference in New Issue