Hello,
Does anyone know if there is a way to achieve this?
I'm not exactly sure how to go about this since the bsp code is compiled into the lib.
So how would I go about integrating an actual bsp loader fuction without being able to add it directly to the bsp loader?
This is basicly what I need. Just a piece only.
bool BspLoader::findVectorByName(float* outvec,const char* name)
{
const char *cl;
BSPVector3 origin;
bool found = false;
parseEntities();
for ( int i = 1; i < m_num_entities; i++ ) {
cl = getValueForKey (&m_entities[i], "classname");
if ( !strcmp( cl, "info_player_start" ) ) {
getVectorForKey( &m_entities[i], "origin", origin );
found = true;
break;
}
if ( !strcmp( cl, "info_player_deathmatch" ) ) {
getVectorForKey( &m_entities[i], "origin", origin );
found = true;
break;
}
}
if (found)
{
outvec[0] = origin[0];
outvec[1] = origin[1];
outvec[2] = origin[2];
}
return found;
}
const BSPEntity * BspLoader::getEntityByValue( const char* name, const char* value)
{
const BSPEntity* entity = NULL;
for ( int i = 1; i < m_num_entities; i++ ) {
const BSPEntity& ent = m_entities[i];
const char* cl = getValueForKey (&m_entities[i], name);
if ( !strcmp( cl, value ) ) {
entity = &ent;
break;
}
}
return entity;
}
Has anyone done anything simular or should I just write my own BSP loader?
Chris