///////////////////////////////////////// //public class ParameterItem //{ // internal ParameterContainer container; // internal string name; // internal ParameterType type; // internal int elementCount; // internal int valueDataPosition = -1; // internal object valueReference; // // // public string Name // { // get { return name; } // } // public ParameterType Type // { // get { return type; } // //!!!!set? // } // public int ElementCount // { // get { return elementCount; } // //!!!!set? // } // //!!!!было // //unsafe object MakeObjectFromArrayPointer( byte* p ) // //{ // // //!!!!пашет? // // Type classType = ParameterTypeUtility.GetClassType( Type ); // // if( classType == null ) // // return null; // // return Marshal.PtrToStructure( (IntPtr)p, classType ); // //} // //!!!!было // //public object Value // //{ // // get // // { // // if( valueReference != null ) // // return valueReference; // // else if( valueDataPosition != -1 ) // // { // // //!!!!check valid array size // // int bytes = GetTotalSizeInBytes(); // // unsafe // // { // // fixed ( byte* pDataContainer = container.data ) // // { // // return MakeObjectFromArrayPointer( pDataContainer + valueDataPosition ); // // } // // } // // } // // return null; // // } // //} // public int GetTotalSizeInBytes() // { // return ParameterTypeUtility.GetElementSizeInBytes( Type ) * elementCount; // } // public ArraySegment<byte> GetValue() // { // //!!!!!так? // if( valueDataPosition == -1 ) // Log.Fatal( "StringKeyDataContainer: ParameterItem: GetValue: No data in byte array." ); // //!!!!check valid array size // return new ArraySegment<byte>( container.data, valueDataPosition, GetTotalSizeInBytes() ); // } // ////!!!!надо ли // //public void GetValue( byte[] outputArray, int outputArrayIndex ) // //{ // // //!!!!!так? // // if( valueDataPosition == -1 ) // // Log.Fatal( "StringKeyDataContainer: ParameterItem: GetValue: No data in byte array." ); // // //!!!!check valid array size // // Buffer.BlockCopy( container.data, valueDataPosition, outputArray, outputArrayIndex, GetTotalSizeInBytes() ); // //} // //public object DefaultValue // //{ // // get { return defaultValue; } // // //set // // //{ // // // this.defaultValue = value; // // //} // //} // public override string ToString() // { // return string.Format( "{0}{1} {2}", type, ( elementCount != 0 ? string.Format( "[{0}]", elementCount ) : "" ), name ); // } //} //////////// //public ICollection<ParameterItem> AllParameters //{ // get // { // if( parameters == null ) // return new ParameterItem[ 0 ]; // return parameters.Values; // } //} //!!!!было //public ParameterItem GetByName( string name ) //{ // if( parameters == null ) // return null; // ParameterItem item; // parameters.TryGetValue( name, out item ); // return item; //} public void Set(ref ViewportRenderingContext.BindTextureData data) { if (TextureParameters == null) { TextureParameters = new OpenList <ViewportRenderingContext.BindTextureData>(16); } TextureParameters.Add(ref data); }
public void Set(ViewportRenderingContext.BindTextureData data) { Set(ref data); }