Exemplo n.º 1
0
        public void Update(Polymodel model, int id)
        {
            isLocked = true;
            txtModelNumModels.Text    = model.NumSubmodels.ToString();
            txtModelDataSize.Text     = model.ModelIDTASize.ToString();
            txtModelRadius.Text       = model.Radius.ToString();
            txtModelTextureCount.Text = model.NumTextures.ToString();
            UIUtil.SafeFillComboBox(cbModelLowDetail, model.SimplerModels);
            UIUtil.SafeFillComboBox(cbModelDyingModel, model.DyingModelnum + 1);
            UIUtil.SafeFillComboBox(cbModelDeadModel, model.DeadModelnum + 1);
            ModelNumSpinner.Minimum = -1;
            ModelNumSpinner.Value   = -1;
            ModelNumSpinner.Maximum = model.NumSubmodels - 1;

            txtModelMinX.Text = model.Mins.X.ToString();
            txtModelMinY.Text = model.Mins.Y.ToString();
            txtModelMinZ.Text = model.Mins.Z.ToString();
            txtModelMaxX.Text = model.Maxs.X.ToString();
            txtModelMaxY.Text = model.Maxs.Y.ToString();
            txtModelMaxZ.Text = model.Maxs.Z.ToString();

            if (hxmFile != null)
            {
                int numNewTextures = hxmFile.CountUniqueObjBitmaps(model);
                ModelNumTextures.Text         = numNewTextures.ToString();
                ModelNumPointers.Text         = model.NumTextures.ToString();
                ModelBasePointerSpinner.Value = model.FirstTexture;
                ModelBaseTextureSpinner.Value = model.BaseTexture;

                for (int i = 0; i < numNewTextures; i++)
                {
                    ushort index = hxmFile.GetObjBitmap(i + model.BaseTexture);
                    if (hxmFile.BaseHAM.piggyFile.Bitmaps[index].IsAnimated)
                    {
                        AnimatedWarningLabel.Visible = true;
                    }
                    else
                    {
                        AnimatedWarningLabel.Visible = false;
                    }
                }
            }

            modelRenderer.SetModel(model);
            ModelViewControl.Invalidate();

            modelID    = id;
            this.model = model;
            isLocked   = false;
        }
Exemplo n.º 2
0
        private void UpdateModelTexturePanel(Polymodel model)
        {
            int numNewTextures = datafile.CountUniqueObjBitmaps(model);

            ModelNumTextures.Text         = numNewTextures.ToString();
            ModelNumPointers.Text         = model.NumTextures.ToString();
            ModelBasePointerSpinner.Value = model.FirstTexture;
            ModelBaseTextureSpinner.Value = model.BaseTexture;

            for (int i = 0; i < numNewTextures; i++)
            {
                ushort index = datafile.GetObjBitmap(i + model.BaseTexture);
                if (datafile.BaseHAM.piggyFile.Bitmaps[index].IsAnimated)
                {
                    AnimatedWarningLabel.Visible = true;
                }
                else
                {
                    AnimatedWarningLabel.Visible = false;
                }
            }
        }