Merge pull request #313 from ensiform/misc_model_static_fix

Jedi Academy misc_model_static support for radiant.
This commit is contained in:
Timothee "TTimo" Besset 2015-10-03 11:50:10 -05:00
commit 6ab189f0b1
3 changed files with 28 additions and 2 deletions

View File

@ -121,6 +121,8 @@ void setSpecialLoad( eclass_t *e, const char* pWhat, char*& p ){
}
}
qboolean IsModelEntity( const char *name );
eclass_t *Eclass_InitFromText( char *text ){
char *t;
int len;
@ -253,7 +255,7 @@ eclass_t *Eclass_InitFromText( char *text ){
if ( strcmpi( e->name, "path" ) == 0 ) {
e->nShowFlags |= ECLASS_PATH;
}
if ( strcmpi( e->name, "misc_model" ) == 0 ) {
if ( IsModelEntity( e->name ) == qtrue ) {
e->nShowFlags |= ECLASS_MISCMODEL;
}

View File

@ -141,6 +141,8 @@ bfilter_t *FilterAddBase( bfilter_t *pFilter ){
pFilter = FilterAddImpl( pFilter,3,0,"trigger",EXCLUDE_TRIGGERS,true );
pFilter = FilterAddImpl( pFilter,3,0,"misc_model",EXCLUDE_MODELS,true );
pFilter = FilterAddImpl( pFilter,3,0,"misc_gamemodel",EXCLUDE_MODELS,true );
pFilter = FilterAddImpl( pFilter,3,0,"misc_model_static",EXCLUDE_MODELS,true );
pFilter = FilterAddImpl( pFilter,3,0,"model_static",EXCLUDE_MODELS,true );
pFilter = FilterAddImpl( pFilter,4,ECLASS_LIGHT,NULL,EXCLUDE_LIGHTS,true );
pFilter = FilterAddImpl( pFilter,4,ECLASS_PATH,NULL,EXCLUDE_PATHS,true );
pFilter = FilterAddImpl( pFilter,1,0,"lightgrid",EXCLUDE_LIGHTGRID,true );

View File

@ -356,6 +356,28 @@ void DrawPathLines( void ){
extern void AssignModel();
static const char *model_classnames[] =
{
"misc_model",
"misc_model_static",
"misc_gamemodel",
"model_static",
};
static const size_t model_classnames_count = sizeof( model_classnames ) / sizeof( *model_classnames );
qboolean IsModelEntity( const char *name )
{
for ( size_t i = 0; i < model_classnames_count; i++ )
{
if ( stricmp( name, model_classnames[i] ) == 0 )
{
return qtrue;
}
}
return qfalse;
}
void CreateEntityFromName( const char* name, const vec3_t origin ){
entity_t *e;
brush_t* b;
@ -431,7 +453,7 @@ void CreateEntityFromName( const char* name, const vec3_t origin ){
}
Select_Brush( e->brushes.onext );
if ( ( stricmp( name, "misc_model" ) == 0 ) || ( stricmp( name, "misc_gamemodel" ) == 0 ) || ( strcmpi( name, "model_static" ) == 0 ) ) {
if ( IsModelEntity( name ) == qtrue ) {
SetInspectorMode( W_ENTITY );
AssignModel();
}