/* ******************************************************** */ //! Draw-Object Set /*! @param InstanceRoot Draw-Object's Root @retval Return-Value (None) Don't use this function. <br> (This function is for Internal-Processing) */ public void DrawSet(Library_SpriteStudio.Script.Root InstanceRoot) { if(null != ChainDrawObject) { /* MEMO: Sort execute after all Draw-Objects are set. */ InstanceRoot.DrawObject.Data.InstanceRoot = InstanceRoot; ChainDrawObject.ChainAddForce(InstanceRoot.DrawObject); } }
/* ******************************************************** */ //! Get Material /*! @param IndexCellMap Serial-number of using Cell-Map @param Operation Color-Blend Operation for the target @retval Return-Value Material */ public Material MaterialGet(int IndexCellMap, Library_SpriteStudio.KindColorOperationEffect KindOperation) { #if false return(( (0 <= IndexCellMap) && (DataCellMap.ListDataCellMap.Length > IndexCellMap) && (Library_SpriteStudio.KindColorOperationEffect.NON < KindOperation) && (Library_SpriteStudio.KindColorOperationEffect.TERMINATOR > KindOperation) ) ? TableMaterial[(IndexCellMap * ((int)Library_SpriteStudio.KindColorOperationEffect.TERMINATOR - 1)) + ((int)KindOperation - 1)] : null ); #else if((0 > IndexCellMap) && (DataCellMap.ListDataCellMap.Length <= IndexCellMap)) { return(null); } if((Library_SpriteStudio.KindColorOperationEffect.NON >= KindOperation) && (Library_SpriteStudio.KindColorOperationEffect.TERMINATOR_KIND <= KindOperation)) { return(null); } int IndexBlendKind = (int)KindOperation - 1; int IndexMaterial = IndexMaterialBlendDefault[IndexBlendKind]; if((null != IndexMaterialBlendOffset) && (0 < IndexMaterialBlendOffset.Length)) { IndexMaterial += IndexMaterialBlendOffset[IndexBlendKind]; } return(TableMaterial[(IndexCellMap * ((int)Library_SpriteStudio.KindColorOperationEffect.TERMINATOR - 1)) + IndexMaterial]); #endif }
/* ******************************************************** */ //! Get Material /*! @param TextureNo Serial-number of using texture @param Operation Color-Blend Operation for the target @retval Return-Value (None) Don't use this function. <br> (This function is for the animation-parts' scripts.) */ public Material MaterialGet(int TextureNo, Library_SpriteStudio.KindColorOperation Operation) { int MaterialNo = TextureNo * ((int)Library_SpriteStudio.KindColorOperation.TERMINATOR - 1); return(((null != TableMaterial) && (0 <= TextureNo)) ? TableMaterial[MaterialNo] : null); }
/* ******************************************************** */ //! Add Mesh to Draw-Manager /*! @param TextureNo Serial-number of using texture @param Operation Color-Blend Operation for the target @param DataMeshInformation Mesh Information @retval Return-Value (None) Don't use this function. <br> (This function is for the animation-parts' scripts.) */ public void MeshAdd(int TextureNo, Library_SpriteStudio.KindColorOperation Operation, InformationMeshData DataMeshInformation) { if(0 > TextureNo) { return; } if(null == TableListMesh) { TableListMesh = new ArrayList(); TableListMesh.Clear(); } int MaterialNo = TextureNo * ((int)Library_SpriteStudio.KindColorOperation.TERMINATOR - 1) + ((int)Operation - 1); int CountList = TableListMesh.Count; int ListNo = -1; ListMeshDraw ListMesh = null; if(0 == TableListMesh.Count) { goto MeshAdd_NewListAdd; } else { ListNo = 0; ListMesh = TableListMesh[0] as ListMeshDraw; for(int i=1; i<CountList; i++) { ListMesh = TableListMesh[i] as ListMeshDraw; if(DataMeshInformation.Priority < ListMesh.PriorityMinimum) { ListNo = i - 1; break; } ListMesh = null; } if(null == ListMesh) { /* Highest-Priority */ ListNo = CountList - 1; ListMesh = TableListMesh[ListNo] as ListMeshDraw; if(ListMesh.MaterialNo != MaterialNo) { if(DataMeshInformation.Priority < ListMesh.PriorityMaximum) { goto MeshAdd_NewListInsertSplit; } else { goto MeshAdd_NewListAdd; } } } else { ListMesh = TableListMesh[ListNo] as ListMeshDraw; if(ListMesh.MaterialNo != MaterialNo) { if(DataMeshInformation.Priority < ListMesh.PriorityMaximum) { goto MeshAdd_NewListInsertSplit; } else { ListNo++; if(CountList <= ListNo) { goto MeshAdd_NewListAdd; } else { ListMeshDraw ListMeshNext = TableListMesh[ListNo] as ListMeshDraw; if(ListMeshNext.MaterialNo != MaterialNo) { ListNo--; goto MeshAdd_NewListInsert; } else { ListMesh = ListMeshNext; } } } } } ListMesh.MeshAdd(ref DataMeshInformation); } return; MeshAdd_NewListAdd: ListMesh = new ListMeshDraw(); ListMesh.MaterialNo = MaterialNo; TableListMesh.Add(ListMesh); ListMesh.MeshAdd(ref DataMeshInformation); return; MeshAdd_NewListInsert: ListMesh = new ListMeshDraw(); ListMesh.MaterialNo = MaterialNo; TableListMesh.Insert(ListNo + 1, ListMesh); ListMesh.MeshAdd(ref DataMeshInformation); return; MeshAdd_NewListInsertSplit: { ListMeshDraw ListMeshSplit = ListMesh.ListSplit(DataMeshInformation.Priority); int ListNoNext = ListNo + 1; if(CountList <= ListNoNext) { TableListMesh.Add(ListMeshSplit); } else { TableListMesh.Insert(ListNoNext, ListMeshSplit); } int CountOld = ListMesh.Count; ListMesh = new ListMeshDraw(); ListMesh.MaterialNo = MaterialNo; TableListMesh.Insert(ListNoNext, ListMesh); if(0 >= CountOld) { TableListMesh.RemoveAt(ListNo); } } ListMesh.MeshAdd(ref DataMeshInformation); return; }
/* ******************************************************** */ //! Registration of calling-back of "User-Data" /*! @param PartsName Name of animation-part @param AnimationDataParts control data for animation-part @param FrameNoData Frame-No, "User-Data" is arranged @param Data Instance "User-Data" @retval Return-Value (None) Don't use this function. <br> (This function is for the animation-parts' scripts.) */ public void CallBackExecUserData(string PartsName, Library_SpriteStudio.AnimationData AnimationDataParts, int FrameNoData, Library_SpriteStudio.KeyFrame.ValueUser Data) { if(null == ListCallBackUserData) { ListCallBackUserData = new ArrayList(); ListCallBackUserData.Clear(); } ParameterCallBackUserData Parameter = new ParameterCallBackUserData(); Parameter.PartsName = string.Copy(PartsName); Parameter.AnimationDataParts = AnimationDataParts; Parameter.FrameNo = FrameNoData; Parameter.Data = Data; ListCallBackUserData.Add(Parameter); }