예제 #1
0
 void SortListsByTexture()
 {
     if (tocallSolid == null)
     {
         tocallSolid       = new ToCall[texturesCount];
         tocallTransparent = new ToCall[texturesCount];
         for (int i = 0; i < texturesCount; i++)
         {
             tocallSolid[i]       = new ToCall();
             tocallTransparent[i] = new ToCall();
         }
         for (int i = 0; i < texturesCount; i++)
         {
             int max = 256;
             tocallSolid[i].Lists       = new Model[max];
             tocallSolid[i].Max         = max;
             tocallTransparent[i].Lists = new Model[max];
             tocallTransparent[i].Max   = max;
         }
     }
     for (int i = 0; i < texturesCount; i++)
     {
         tocallSolid[i].Count       = 0;
         tocallTransparent[i].Count = 0;
     }
     for (int i = 0; i < modelsCount; i++)
     {
         ListInfo li = models[i];
         if (!li.render)
         {
             continue;
         }
         if (li.empty)
         {
             continue;
         }
         ToCall tocall;
         if (!li.transparent)
         {
             tocall = tocallSolid[li.texture];
         }
         else
         {
             tocall = tocallTransparent[li.texture];
         }
         if (tocall.Count >= tocall.Max)
         {
             Model[] old  = tocall.Lists;
             Model[] new_ = new Model[tocall.Max * 2];
             for (int k = 0; k < tocall.Max; k++)
             {
                 new_[k] = old[k];
             }
             tocall.Lists = new_;
             tocall.Max   = tocall.Max * 2;
         }
         tocall.Lists[tocall.Count++] = models[i].model;
     }
 }
예제 #2
0
 //delegate void BW();
 //BW bW;
 public Form2()
 {
     InitializeComponent();
     statusStrip1.Visible = true;
     tableCon             = new TableCon(Table1);
     ClearListBox         = ClearBox;
     AddList = AddToListBox;
     SetNum  = SetNumber;//读取完表格后更改最大值,最小值
     //bW = SelectPosition;
 }
예제 #3
0
 private void SortListsByTexture()
 {
     if (tocallSolid == null)
     {
         tocallSolid       = new ToCall[texturesCount];
         tocallTransparent = new ToCall[texturesCount];
         for (int i = 0; i < texturesCount; i++)
         {
             tocallSolid[i]       = new ToCall();
             tocallTransparent[i] = new ToCall();
         }
         for (int i = 0; i < texturesCount; i++)
         {
             tocallSolid[i].Lists       = new int[MAX_DISPLAY_LISTS];
             tocallTransparent[i].Lists = new int[MAX_DISPLAY_LISTS];
         }
     }
     for (int i = 0; i < texturesCount; i++)
     {
         tocallSolid[i].Count       = 0;
         tocallTransparent[i].Count = 0;
     }
     for (int i = 0; i < count; i++)
     {
         ListInfo li = listinfo[i];
         if (!li.render)
         {
             continue;
         }
         if (li.empty)
         {
             continue;
         }
         if (!li.transparent)
         {
             ToCall tocall = tocallSolid[li.texture];
             tocall.Lists[tocall.Count] = GetList(i);
             tocall.Count++;
         }
         else
         {
             ToCall tocall = tocallTransparent[li.texture];
             tocall.Lists[tocall.Count] = GetList(i);
             tocall.Count++;
         }
     }
 }
예제 #4
0
        // Constructor
        public Confirmation(Point location, string message, ToCall funcToCall, bool yesFirst = false)
        {
            // Set private variables
            location_   = location;
            funcToCall_ = funcToCall;
            message_    = message;


            // Initialize component
            InitializeComponent();

            if (yesFirst)
            {
                YesButton.TabIndex = 1;
                NoButton.TabIndex  = 2;
                //YesButton.Select
            }
            ConfirmText.Text = message;
        }
예제 #5
0
 void SortListsByTexture()
 {
     if (tocallSolid == null)
     {
         tocallSolid = new ToCall[texturesCount];
         tocallTransparent = new ToCall[texturesCount];
         for (int i = 0; i < texturesCount; i++)
         {
             tocallSolid[i] = new ToCall();
             tocallTransparent[i] = new ToCall();
         }
         for (int i = 0; i < texturesCount; i++)
         {
             int max = 256;
             tocallSolid[i].Lists = new Model[max];
             tocallSolid[i].Max = max;
             tocallTransparent[i].Lists = new Model[max];
             tocallTransparent[i].Max = max;
         }
     }
     for (int i = 0; i < texturesCount; i++)
     {
         tocallSolid[i].Count = 0;
         tocallTransparent[i].Count = 0;
     }
     for (int i = 0; i < modelsCount; i++)
     {
         ListInfo li = models[i];
         if (!li.render)
         {
             continue;
         }
         if (li.empty)
         {
             continue;
         }
         ToCall tocall;
         if (!li.transparent)
         {
             tocall = tocallSolid[li.texture];
         }
         else
         {
             tocall = tocallTransparent[li.texture];
         }
         if (tocall.Count >= tocall.Max)
         {
             Model[] old = tocall.Lists;
             Model[] new_ = new Model[tocall.Max * 2];
             for (int k = 0; k < tocall.Max; k++)
             {
                 new_[k] = old[k];
             }
             tocall.Lists = new_;
             tocall.Max = tocall.Max * 2;
         }
         tocall.Lists[tocall.Count++] = models[i].model;
     }
 }