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
|
||||
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 /wd4267 /wd4244)
|
||||
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")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -128,17 +128,18 @@ def cook(writebuf, mesh_obj, output_mode, max_skin_banks, max_octant_length=None
|
|||
skin_slot_set = set()
|
||||
faces = list(mat_faces_rem)
|
||||
for f in faces:
|
||||
ret_faces = None
|
||||
for v in f.verts:
|
||||
sg = tuple(sorted(v[dlay].items()))
|
||||
if sg not in skin_slot_set:
|
||||
if max_skin_banks > 0 and len(skin_slot_set) == max_skin_banks:
|
||||
ret_faces = False
|
||||
break
|
||||
skin_slot_set.add(sg)
|
||||
if dlay:
|
||||
ret_faces = None
|
||||
for v in f.verts:
|
||||
sg = tuple(sorted(v[dlay].items()))
|
||||
if sg not in skin_slot_set:
|
||||
if max_skin_banks > 0 and len(skin_slot_set) == max_skin_banks:
|
||||
ret_faces = False
|
||||
break
|
||||
skin_slot_set.add(sg)
|
||||
|
||||
if ret_faces == False:
|
||||
break
|
||||
if ret_faces == False:
|
||||
break
|
||||
|
||||
the_list.append(f)
|
||||
mat_faces_rem.remove(f)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b6b54d092130aa9d31e845c768faf8f08b7a30b1
|
||||
Subproject commit 39dd15cd55e6432a4ea35949c81ef1803cc8955e
|
|
@ -148,7 +148,7 @@ struct IR : BigDNA
|
|||
struct LoadImm : BigDNA
|
||||
{
|
||||
DECL_DNA
|
||||
Value<atVec4f> m_immVec;
|
||||
Value<atVec4f> m_immVec = {};
|
||||
} m_loadImm;
|
||||
|
||||
enum ArithmeticOpType : uint8_t
|
||||
|
|
|
@ -18,7 +18,7 @@ enum HMDLTopology : atUint32
|
|||
struct HMDLMeta : Athena::io::DNA<Athena::BigEndian>
|
||||
{
|
||||
DECL_DNA
|
||||
Value<atUint32> magic = SBIG('TACO');
|
||||
Value<atUint32> magic = 'TACO';
|
||||
Value<HMDLTopology> topology;
|
||||
Value<atUint32> vertStride;
|
||||
Value<atUint32> vertCount;
|
||||
|
|
|
@ -361,7 +361,6 @@ void Lexer::EmitVec3(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
|
|||
if (!gn)
|
||||
{
|
||||
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location);
|
||||
ir.m_instructions.back().m_loadImm.m_immVec = {};
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -400,7 +399,6 @@ void Lexer::EmitVec4(IR& ir, const Lexer::OperationNode* funcNode, IR::RegID tar
|
|||
if (!gn)
|
||||
{
|
||||
ir.m_instructions.emplace_back(IR::OpLoadImm, funcNode->m_tok.m_location);
|
||||
ir.m_instructions.back().m_loadImm.m_immVec = {};
|
||||
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;
|
||||
const SourceLocation& loc = ir.m_instructions.back().m_loc;
|
||||
atVec4f eval;
|
||||
atVec4f eval = {};
|
||||
switch (str.size())
|
||||
{
|
||||
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;
|
||||
case 3:
|
||||
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::Instruction& inst = ir.m_instructions.back();
|
||||
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_target = target;
|
||||
if (tgt > ir.m_regCount)
|
||||
|
|
|
@ -16,7 +16,7 @@ HMDLData::HMDLData(boo::IGraphicsDataFactory* factory,
|
|||
Athena::io::MemoryReader r((atUint8*)metaData, HECL_HMDL_META_SZ);
|
||||
meta.read(r);
|
||||
}
|
||||
if (meta.magic != FOURCC('TACO'))
|
||||
if (meta.magic != 'TACO')
|
||||
Log.report(LogVisor::FatalError, "invalid HMDL magic");
|
||||
|
||||
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