/***********************************************************
	get entity info
***********************************************************/
entitiesTableStruct* ServerCharacterRenderer::GetEntitiesInfo()
{
	if(_estruct == NULL)
		_estruct = parseEntities(DataFileHandler::GetPath("FILE3D"));

	return _estruct;
}
Beispiel #2
0
void Test()
{
	entitiesTableStruct* entities = parseEntities(Lba1ModelDataPath+"FILE3D.HQR");
	LBA1ModelClass lba1mode(entities, Lba1ModelDataPath+"BODY.HQR", 
										Lba1ModelDataPath+"ANIM.HQR", 0, 0);
	osg::ref_ptr<osg::Node> modelnode = lba1mode.ExportOSGModel(false);

	//osgUtil::Optimizer optOSGFile;
	//optOSGFile.optimize (modelnode.get());
	osgDB::writeNodeFile(*modelnode.get(), "test.osgb", new osgDB::Options("Compressor=zlib"));	
}
Beispiel #3
0
void parseTweet(mxml_node_t *tweet, struct t_tweet *dest, int parseuser){
	mxml_node_t *value = NULL;

	if(parseuser){
		value = mxmlFindElement(tweet, tweet, "name", NULL, NULL, MXML_DESCEND);
		snprintf(dest->retweetby, 96, "Retweeted by %s", value->child->value.opaque);
	}

	value = mxmlFindElement(tweet, tweet, "current_user_retweet", NULL, NULL, MXML_DESCEND);
	if(value && value->child){
		value = mxmlFindElement(value, tweet, "id", NULL, NULL, MXML_DESCEND);
		sscanf(value->child->value.opaque, "%llu", &(dest->retweet_id));
		dest->flags |= RETWEETED;
	}

	value = mxmlFindElement(tweet, tweet, "retweeted_status", NULL, NULL, MXML_DESCEND);
	if(value && value->child){ //The retweeted status becomes the target unit
		tweet = value;
	}else{
		dest->retweetby[0] = 0;
	}

	value = mxmlFindElement(tweet, tweet, "created_at", NULL, NULL, MXML_DESCEND);
	{
		struct tm tm;
		strptime(value->child->value.opaque, tweet_format, &tm);
		tm.tm_isdst = -1;
		dest->created = mktime(&tm) - timeoffset;
	}

	value = mxmlFindElement(value, tweet, "id", NULL, NULL, MXML_DESCEND);
	sscanf(value->child->value.opaque, "%llu", &(dest->id));	
	value = mxmlFindElement(value, tweet, "text", NULL, NULL, MXML_DESCEND);
	wt_strncpy(dest->text, value->child->value.opaque, 765);

	if(parseuser){
		value = mxmlFindElement(tweet, tweet, "user", NULL, NULL, MXML_DESCEND);
		if(value && value->child) parseUser(value, &(dest->user));
	}

	value = mxmlFindElement(tweet, tweet, "favorited", NULL, NULL, MXML_DESCEND);
	if(value && value->child && value->child->value.opaque[0] == 't') dest->flags |= FAVORITED;
	value = mxmlFindElement(tweet, tweet, "retweeted", NULL, NULL, MXML_DESCEND);
	if(value && value->child && value->child->value.opaque[0] == 't') dest->flags |= RETWEETED;

	value = mxmlFindElement(tweet, tweet, "entities", NULL, NULL, MXML_DESCEND);
	if(value && value->child) parseEntities(value, dest);

	mxmlDelete(value);
}
Beispiel #4
0
 void MapReader::readEntities(Model::MapFormat::Type format, const BBox3& worldBounds) {
     m_worldBounds = worldBounds;
     parseEntities(format);
     resolveNodes();
 }