Esempio n. 1
0
        public PathPointObj(PathObj parent, BCSV.Entry entry) : base(Vector3.Zero, Vector3.Zero, Vector3.One)
        {
            mEntry  = entry;
            mParent = parent;

            mID = mEntry.Get <short>("id");

            mPosition = new Vector3
            {
                X = mEntry.Get <float>("pnt0_x"),
                Y = mEntry.Get <float>("pnt0_y"),
                Z = mEntry.Get <float>("pnt0_z")
            };

            mPoint1 = new Vector3
            {
                X = mEntry.Get <float>("pnt1_x"),
                Y = mEntry.Get <float>("pnt1_y"),
                Z = mEntry.Get <float>("pnt1_z")
            };

            mPoint2 = new Vector3
            {
                X = mEntry.Get <float>("pnt2_x"),
                Y = mEntry.Get <float>("pnt2_y"),
                Z = mEntry.Get <float>("pnt2_z")
            };

            mPointArgs = new int[8];

            for (int i = 0; i < 8; i++)
            {
                mPointArgs[i] = mEntry.Get <int>($"point_arg{i}");
            }
        }
Esempio n. 2
0
 public StageObj(BCSV.Entry entry)
 {
     mEntry    = entry;
     mName     = mEntry.Get <string>("name");
     mPosition = new Vector3(mEntry.Get <float>("pos_x"), mEntry.Get <float>("pos_y"), mEntry.Get <float>("pos_z"));
     mRotation = new Vector3(mEntry.Get <float>("dir_x"), mEntry.Get <float>("dir_y"), mEntry.Get <float>("dir_z"));
 }
Esempio n. 3
0
 public Light(BCSV.Entry e, string parent) : base(Vector3.Zero)
 {
     mEntry     = e;
     mLightName = mEntry.Get <string>("AreaLightName");
     mLightNo   = mEntry.Get <int>("LightID");
     mParent    = parent;
 }
Esempio n. 4
0
        public AreaObj(BCSV.Entry entry, Zone parentZone, string path) : base(entry)
        {
            mParentZone = parentZone;
            string[] content = path.Split('/');
            mDirectory = content[0];
            mLayer     = content[1];
            mFile      = content[2];

            mType    = "AreaObj";
            Position = new Vector3(Get <float>("pos_x") / 100, Get <float>("pos_y") / 100, Get <float>("pos_z") / 100);
            Rotation = new Vector3(Get <float>("dir_x"), Get <float>("dir_y"), Get <float>("dir_z"));
            Scale    = new Vector3(Get <float>("scale_x"), Get <float>("scale_y"), Get <float>("scale_z"));
        }
Esempio n. 5
0
        public PathObj(BCSV.Entry entry, Zone parentZone, RARCFilesystem filesystem)
        {
            mName = entry.Get <string>("name");
            mID   = entry.Get <short>("no");
            mZone = parentZone;

            mPathPointObjs = new List <PathPointObj>();

            BCSV b = new BCSV(filesystem.OpenFile($"/Stage/jmp/Path/CommonPathPointInfo.{mID}"));

            foreach (BCSV.Entry e in b.mEntries)
            {
                mPathPointObjs.Add(new PathPointObj(this, e));
            }
        }
Esempio n. 6
0
        public StartObj(BCSV.Entry entry, Zone parentZone, string path) : base(entry)
        {
            mParentZone = parentZone;
            string[] content = path.Split('/');
            mDirectory = content[0];
            mLayer     = content[1];
            mFile      = content[2];

            mType    = "StartObj";
            Position = new Vector3(Get <float>("pos_x") / 100, Get <float>("pos_y") / 100, Get <float>("pos_z") / 100);
            Rotation = new Vector3(Get <float>("dir_x"), Get <float>("dir_y"), Get <float>("dir_z"));
            Scale    = new Vector3(Get <float>("scale_x"), Get <float>("scale_y"), Get <float>("scale_z"));

            mMarioNo  = Get <int>("MarioNo");
            mCameraID = Get <int>("Camera_id");
            mObjArg0  = Get <int>("Obj_arg0");
        }
Esempio n. 7
0
        public Camera(BCSV.Entry entry, Zone parent) : base(Vector3.Zero)
        {
            mEntry = entry;

            mName       = mEntry.Get <string>("id");
            mParentZone = parent;

            mType = mEntry.Get <string>("camtype");

            mFields = new Dictionary <string, object>();

            // the first thing we load are the camera-type specific fields
            List <string> fields = CameraUtil.GetStrings(mType).ToList();

            foreach (string field in fields)
            {
                if (field == "none")
                {
                    break;
                }

                string type = CameraUtil.GetTypeOfField(field);

                switch (type)
                {
                case "float":
                    mFields[field] = mEntry.Get <float>(field);
                    break;

                case "int":
                    mFields[field] = mEntry.Get <int>(field);
                    break;

                case "string":
                    mFields[field] = mEntry.Get <string>(field);
                    break;
                }
            }

            Dictionary <string, string> allFields = CameraUtil.GetAll();

            foreach (string s in allFields.Keys)
            {
                string type = CameraUtil.GetTypeOfField(s);

                if (!mEntry.ContainsKey(s))
                {
                    continue;
                }

                switch (type)
                {
                case "float":
                    mFields[s] = mEntry.Get <float>(s);
                    break;

                case "int":
                    mFields[s] = mEntry.Get <int>(s);
                    break;

                case "string":
                    mFields[s] = mEntry.Get <string>(s);
                    break;
                }
            }
        }
Esempio n. 8
0
        private void saveAll_Btn_Click(object sender, EventArgs e)
        {
            TabPageCollection tabs = bcsvEditorsTabControl.TabPages;

            foreach (TabPage tabPage in tabs)
            {
                // since we're saving, we can strip that * from tab pages
                tabPage.Text = tabPage.Text.Replace("*", "");
                DataGridView dataGrid = mEditors[tabPage.Text];
                BCSV         file     = mFiles[tabPage.Text];

                file.mEntries.Clear();

                foreach (DataGridViewRow r in dataGrid.Rows)
                {
                    if (r.IsNewRow)
                    {
                        continue;
                    }

                    BCSV.Entry entry = new BCSV.Entry();
                    file.mEntries.Add(entry);

                    foreach (BCSV.Field f in file.mFields.Values)
                    {
                        uint   hash   = f.mHash;
                        string valStr = r.Cells[hash.ToString("X8")].FormattedValue.ToString();

                        try
                        {
                            switch (f.mType)
                            {
                            case 0:
                            case 3:
                                entry.Add(hash, uint.Parse(valStr));
                                break;

                            case 4:
                                entry.Add(hash, ushort.Parse(valStr));
                                break;

                            case 5:
                                entry.Add(hash, byte.Parse(valStr));
                                break;

                            case 2:
                                entry.Add(hash, float.Parse(valStr));
                                break;

                            case 6:
                                entry.Add(hash, valStr);
                                break;
                            }
                        }
                        catch
                        {
                            switch (f.mType)
                            {
                            case 0:
                            case 3:
                                entry.Add(hash, (uint)0);
                                break;

                            case 4:
                                entry.Add(hash, (ushort)0);
                                break;

                            case 5:
                                entry.Add(hash, (byte)0);
                                break;

                            case 2:
                                entry.Add(hash, 0f);
                                break;

                            case 6:
                                entry.Add(hash, "");
                                break;
                            }
                        }
                    }
                }

                file.Save();
                mFilesystem.Save();
            }
        }
Esempio n. 9
0
 public LightEntry(BCSV.Entry entry)
 {
     mEntry         = entry;
     mAreaLightName = mEntry.Get <string>("AreaLightName");
 }
Esempio n. 10
0
 public AbstractObj(BCSV.Entry entry) : base(Vector3.Zero, Vector3.Zero, Vector3.Zero)
 {
     mEntry = entry;
     mName  = Get <string>("name");
 }