mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-23 02:00:58 +00:00
Fixed exportFGD to make func_static dynamic for model loading
This commit is contained in:
parent
7b65cb4959
commit
a6bf995acc
1 changed files with 22 additions and 1 deletions
|
@ -2396,6 +2396,21 @@ void idDeclManagerLocal::ExportDeclsToTrenchBroom_f( const idCmdArgs& args )
|
|||
dictToWrite.Set( "light", "300" );
|
||||
}
|
||||
|
||||
if( idStr::Icmp( decl->GetName(), "light" ) == 0 ||
|
||||
idStr::Icmp( decl->GetName(), "func_static" ) == 0 )
|
||||
{
|
||||
// entities with dynamic models
|
||||
|
||||
evar_t ev;
|
||||
ev.fullname = "editor_model model";
|
||||
ev.name = "model";
|
||||
ev.desc = "Model Selection (ex mapobjects/model.obj)";
|
||||
ev.type = EVAR_MODEL;
|
||||
evars.Append( ev );
|
||||
|
||||
//dictToWrite.Set( "model", "" );
|
||||
}
|
||||
|
||||
for( int i = 0; i < decl->dict.GetNumKeyVals(); i++ )
|
||||
{
|
||||
kv = decl->dict.GetKeyVal( i );
|
||||
|
@ -2462,7 +2477,8 @@ void idDeclManagerLocal::ExportDeclsToTrenchBroom_f( const idCmdArgs& args )
|
|||
bool writeModel = false;
|
||||
idStrStatic< MAX_OSPATH > exportedModelFileName;
|
||||
|
||||
if( idStr::Icmp( decl->GetName(), "light" ) != 0 )
|
||||
if( idStr::Icmp( decl->GetName(), "light" ) != 0 &&
|
||||
idStr::Icmp( decl->GetName(), "func_static" ) != 0 )
|
||||
{
|
||||
//kv = dictToWrite.MatchPrefix( "model" );
|
||||
//while( kv )
|
||||
|
@ -2508,6 +2524,11 @@ void idDeclManagerLocal::ExportDeclsToTrenchBroom_f( const idCmdArgs& args )
|
|||
{
|
||||
file->Printf( "model({ \"path\": \"%s\" }) ", exportedModelFileName.c_str() );
|
||||
}
|
||||
else if( idStr::Icmp( decl->GetName(), "func_static" ) == 0 )
|
||||
{
|
||||
// dynamic model case
|
||||
file->Printf( "model({ \"path\" : model }) " );
|
||||
}
|
||||
|
||||
file->Printf( "= %s : \"%s\"\n", decl->GetName(), text.c_str() );
|
||||
file->Printf( "[\n" );
|
||||
|
|
Loading…
Reference in a new issue