HMDL outputting fixes

This commit is contained in:
Jack Andersen 2015-11-14 13:40:32 -10:00
parent db335e5d98
commit ad1a47e8b4
28 changed files with 25 additions and 30 deletions

View File

@ -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()

View File

@ -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)

2
hecl/extern/Athena vendored

@ -1 +1 @@
Subproject commit b6b54d092130aa9d31e845c768faf8f08b7a30b1
Subproject commit 39dd15cd55e6432a4ea35949c81ef1803cc8955e

View File

@ -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

View File

@ -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;

View File

@ -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)

View File

@ -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);

View File

@ -1,4 +0,0 @@
#ifndef IRUNTIMECACHE_HPP
#define IRUNTIMECACHE_HPP
#endif // IRUNTIMECACHE_HPP

View File

@ -1,4 +0,0 @@
#ifndef IRUNTIMEOBJECT_HPP
#define IRUNTIMEOBJECT_HPP
#endif // IRUNTIMEOBJECT_HPP

View File

@ -1,4 +0,0 @@
#ifndef IRUNTIMESPEC_HPP
#define IRUNTIMESPEC_HPP
#endif // IRUNTIMESPEC_HPP