diff --git a/dtool/src/cppparser/cppType.cxx b/dtool/src/cppparser/cppType.cxx index 5b12d07455..09c19f94f6 100644 --- a/dtool/src/cppparser/cppType.cxx +++ b/dtool/src/cppparser/cppType.cxx @@ -34,6 +34,10 @@ CPPType(const CPPFile &file) : CPPDeclaration(file) { _declaration = (CPPTypeDeclaration *)NULL; + + // This is set true by interrogate when the "forcetype" keyword is + // used. + _forcetype = false; } //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/cppparser/cppType.h b/dtool/src/cppparser/cppType.h index 2e04eb5807..1258fec2c7 100644 --- a/dtool/src/cppparser/cppType.h +++ b/dtool/src/cppparser/cppType.h @@ -77,6 +77,7 @@ public: static string get_preferred_name_for(const CPPType *type); CPPTypeDeclaration *_declaration; + bool _forcetype; protected: typedef set Types; diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 2970e54747..6a05255f22 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -145,6 +145,7 @@ do_command(const string &command, const string ¶ms) { nout << "Unknown type: forcetype " << params << "\n"; } else { type = type->resolve_type(&parser, &parser); + type->_forcetype = true; _forcetype.insert(type->get_local_name(&parser)); } diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index 7b414dfe78..049054a3cf 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -1704,11 +1704,15 @@ bool TypeManager::IsLocal(CPPType *in_type) // A local means it was compiled in this scope of work.. // IE a should actualy generate code for this objects.... CPPType *base_type = resolve_type(unwrap(in_type)); + if (base_type->_forcetype) { + return true; + } - if(base_type->_file._source == CPPFile::S_local && !base_type->is_incomplete()) - return true; + if (base_type->_file._source == CPPFile::S_local && !base_type->is_incomplete()) { + return true; + } - return false; + return false; /*