Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
code fixes for Hunter-based build
Browse files Browse the repository at this point in the history
  • Loading branch information
rbsheth authored and ruslo committed Jun 9, 2019
1 parent 20e08e7 commit 37fae20
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/D3MFOpcPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,23 @@ int IOSystem2Unzip::testerror(voidpf /*opaque*/, voidpf /*stream*/) {
zlib_filefunc_def IOSystem2Unzip::get(IOSystem* pIOHandler) {
zlib_filefunc_def mapping;

#ifdef ASSIMP_USE_HUNTER
mapping.zopen_file = (open_file_func)open;
mapping.zread_file = (read_file_func)read;
mapping.zwrite_file = (write_file_func)write;
mapping.ztell_file = (tell_file_func)tell;
mapping.zseek_file = (seek_file_func)seek;
mapping.zclose_file = (close_file_func)close;
mapping.zerror_file = (error_file_func)testerror;
#else
mapping.zopen_file = open;
mapping.zread_file = read;
mapping.zwrite_file = write;
mapping.ztell_file = tell;
mapping.zseek_file = seek;
mapping.zclose_file = close;
mapping.zerror_file = testerror;
#endif
mapping.opaque = reinterpret_cast<voidpf>(pIOHandler);

return mapping;
Expand Down
12 changes: 12 additions & 0 deletions code/OpenGEXImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ static void propId2StdString( Property *prop, std::string &name, std::string &ke
}

if ( nullptr != prop->m_key ) {
#ifdef ASSIMP_USE_HUNTER
name = prop->m_key->m_text.m_buffer;
#else
name = prop->m_key->m_buffer;
#endif
if ( Value::ddl_string == prop->m_value->m_type ) {
key = prop->m_value->getString();
}
Expand Down Expand Up @@ -497,7 +501,11 @@ static void getRefNames( DDLNode *node, std::vector<std::string> &names ) {
for( size_t i = 0; i < ref->m_numRefs; i++ ) {
Name *currentName( ref->m_referencedName[ i ] );
if( nullptr != currentName && nullptr != currentName->m_id ) {
#ifdef ASSIMP_USE_HUNTER
const std::string name( currentName->m_id->m_text.m_buffer );
#else
const std::string name( currentName->m_id->m_buffer );
#endif
if( !name.empty() ) {
names.push_back( name );
}
Expand Down Expand Up @@ -1038,7 +1046,11 @@ void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene * /*pS
col.g = col4.g;
col.b = col4.b;
}
#ifdef ASSIMP_USE_HUNTER
const ColorType colType( getColorType( &prop->m_key->m_text ) );
#else
const ColorType colType( getColorType( prop->m_key ) );
#endif
if( DiffuseColor == colType ) {
m_currentMaterial->AddProperty( &col, 1, AI_MATKEY_COLOR_DIFFUSE );
} else if( SpecularColor == colType ) {
Expand Down
10 changes: 10 additions & 0 deletions code/Q3BSPZipArchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,23 @@ int IOSystem2Unzip::testerror(voidpf /*opaque*/, voidpf /*stream*/) {
zlib_filefunc_def IOSystem2Unzip::get(IOSystem* pIOHandler) {
zlib_filefunc_def mapping;

#ifdef ASSIMP_USE_HUNTER
mapping.zopen_file = (open_file_func)open;
mapping.zread_file = (read_file_func)read;
mapping.zwrite_file = (write_file_func)write;
mapping.ztell_file = (tell_file_func)tell;
mapping.zseek_file = (seek_file_func)seek;
mapping.zclose_file = (close_file_func)close;
mapping.zerror_file = (error_file_func)testerror;
#else
mapping.zopen_file = open;
mapping.zread_file = read;
mapping.zwrite_file = write;
mapping.ztell_file = tell;
mapping.zseek_file = seek;
mapping.zclose_file = close;
mapping.zerror_file = testerror;
#endif
mapping.opaque = (voidpf) pIOHandler;

return mapping;
Expand Down

0 comments on commit 37fae20

Please sign in to comment.