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

View File

@ -128,17 +128,18 @@ 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:
ret_faces = None if dlay:
for v in f.verts: ret_faces = None
sg = tuple(sorted(v[dlay].items())) for v in f.verts:
if sg not in skin_slot_set: sg = tuple(sorted(v[dlay].items()))
if max_skin_banks > 0 and len(skin_slot_set) == max_skin_banks: if sg not in skin_slot_set:
ret_faces = False if max_skin_banks > 0 and len(skin_slot_set) == max_skin_banks:
break ret_faces = False
skin_slot_set.add(sg) break
skin_slot_set.add(sg)
if ret_faces == False: if ret_faces == False:
break break
the_list.append(f) the_list.append(f)
mat_faces_rem.remove(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 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

View File

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

View File

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

View File

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

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