Example #1
0
File: slo.cpp Project: UIKit0/aqsis
/** Return pointer to shader symbol definition for argument specified by symbol name */
SLO_VISSYMDEF* Slo_GetArgByName ( char* name )
{
	std::string param_name(name);
	if (slovissymdef_data.find(std::string(name)) == slovissymdef_data.end())
	{
		
		SLX_VISSYMDEF* slxdef = SLX_GetArgByName(name);
		param_name = slxdef->svd_name;
		
		// convert SLX_VISSYMDEF to SLO_VISSYMDEF
		SLO_VISSYMDEF slodef;
		initParamStruct(&slodef);
		if (SlxLastError == RIE_NOERROR)
		{
			convertVISSYMDEFStruct (slxdef, &slodef);
		}
		else
		{
			return NULL;
		}
		
		slovissymdef_data[param_name] = slodef;
		// slovissymdef_namemap becomes out of sync here as we don't have an id
		// for this param, Slo_GetArgById will catch this
	}
	
	return &slovissymdef_data[param_name];
}
Example #2
0
/*
 * Return pointer to shader symbol definition for argument specified by symbol name.
 * 
 * \param name  Parameter name.
 * \return Returns a SLO_VISSYMDEF struct or NULL on error.
 */
SLO_VISSYMDEF * Slo_GetArgByName ( char * name )
{
	SLX_VISSYMDEF * slxdef;
	SLO_VISSYMDEF * slodef;
	
	slodef = NULL;
	slxdef = SLX_GetArgByName( name );
	if ( slxdef != NULL )
	{
		slodef = LookUpSLOSymDef( slxdef );
	}
	return slodef;
}