Ejemplo n.º 1
0
        public override void MigrateVersion(SR1_File file, SR1_File.Version targetVersion, SR1_File.MigrateFlags migrateFlags)
        {
            base.MigrateVersion(file, targetVersion, migrateFlags);

            if (file._Version != targetVersion)
            {
                if (file._Overrides.NewName != null)
                {
                    nameString.SetText(file._Overrides.NewName, 12);
                    scriptString.SetText(file._Overrides.NewName, 12);
                }
            }

            if (file._Version < SR1_File.Version.Retail_PC && targetVersion >= SR1_File.Version.Retail_PC)
            {
                //oflags.Value = 0x280042F1;
                //oflags2.Value = 0x06E80004;

                if (relocList.Offset != 0)
                {
                    file._Structures.Remove(relocList.Offset);
                    relocList.Offset = 0;
                }

                if (relocModule.Offset != 0)
                {
                    file._Structures.Remove(relocModule.Offset);
                    relocModule.Offset = 0;
                }
            }
        }
Ejemplo n.º 2
0
        public override void MigrateVersion(SR1_File file, SR1_File.Version targetVersion, SR1_File.MigrateFlags migrateFlags)
        {
            base.MigrateVersion(file, targetVersion, migrateFlags);

            if (file._Version != targetVersion)
            {
                if (file._Overrides.NewIntroIDs != null)
                {
                    UniqueID.Value = file._Overrides.NewIntroIDs[file._Overrides.NextIntroID];
                    file._Overrides.NextIntroID++;
                }

                if (file._Overrides.NewObjectNames.ContainsKey(name.ToString()))
                {
                    name.SetText(file._Overrides.NewObjectNames[name.ToString()], 16);
                }
            }
        }
Ejemplo n.º 3
0
        public override void MigrateVersion(SR1_File file, SR1_File.Version targetVersion, SR1_File.MigrateFlags migrateFlags)
        {
            base.MigrateVersion(file, targetVersion, migrateFlags);

            if (file._Version != targetVersion)
            {
                if (file._Overrides.NewName != null)
                {
                    worldNameString.SetText(file._Overrides.NewName, 12);
                }

                if (file._Overrides.NewStreamUnitID != 0)
                {
                    streamUnitID.Value = file._Overrides.NewStreamUnitID;
                }
            }

            if (file._Version < SR1_File.Version.Retail_PC && targetVersion >= SR1_File.Version.Retail_PC)
            {
                versionNumber.Value = SR1_File.RETAIL_VERSION;

                fogFar.Value          = 20000;
                fogNear.Value         = 19999;
                spectralFogFar.Value  = 20000;
                spectralFogNear.Value = 19999;
                waterFogFar.Value     = 20000;
                waterFogNear.Value    = 19999;
                vramSize.x.Value      = -1;
                vramSize.y.Value      = -1;
                vramSize.w.Value      = -1;
                vramSize.h.Value      = -1;
                holdFogFar.Value      = 20000;
                holdFogNear.Value     = 19999;
                TODfogNearFar[0]      = 19999;
                TODfogNearFar[1]      = 20000;
                TODfogNearFar[2]      = 19999;
                TODfogNearFar[3]      = 20000;
                TODfogNearFar[4]      = 19999;
                TODfogNearFar[5]      = 20000;
                TODfogNearFar[6]      = 19999;
                TODfogNearFar[7]      = 20000;

                if (SFXMarkerList.Offset != 0)
                {
                    file._Structures.Remove(SFXMarkerList.Offset);
                    NumberOfSFXMarkers.Value = 0;
                    SFXMarkerList.Offset     = 0;
                }

                if (lightListStruct1.Start != 0)
                {
                    file._Structures.Remove(lightListStruct1.Start);
                }

                if (push6Padding.Start != 0)
                {
                    file._Structures.Remove(push6Padding.Start);
                }

                if (depthQPTable.Offset != 0)
                {
                    file._Structures.Remove(depthQPTable.Offset);
                }

                if (bgAniList.Offset != 0)
                {
                    file._Structures.Remove(bgAniList.Offset);
                    bgAniList.Offset = 0;
                }

                if ((migrateFlags & SR1_File.MigrateFlags.RemoveEvents) != 0)
                {
                    // Can't use SignalListStart because I included data before that in the Events structure.
                    if (events.Start != 0)
                    {
                        file._Structures.Remove(events.Start);
                        PuzzleInstances.Offset = 0;
                        SignalListEnd.Offset   = events.End;
                    }
                }

                if ((migrateFlags & SR1_File.MigrateFlags.RemoveVertexMorphs) != 0)
                {
                    numVMObjects.Value = 0;
                    if (vmobjectList.Offset != 0)
                    {
                        file._Structures.Remove(vmobjectList.Offset);
                        vmobjectList.Offset = 0;
                    }
                }
            }

            if (file._Version <= SR1_File.Version.Feb16 && targetVersion >= SR1_File.Version.Retail_PC)
            {
                if (Name == "undrct20" || Name == "undrct2")
                {
                    unitFlags.Value = 0;
                }
            }

            /*if (Name == "city12")
             * {
             *      SR1_StructureSeries<MultiSignal> multiSignals =
             *              (SR1_StructureSeries<MultiSignal>)file._Structures[SignalListStart.Offset];
             *
             *      MultiSignal multiSignalA = (MultiSignal)multiSignals[0];
             *      Signal signalA = new Signal();
             *      SignalStreamLevel signalStreamLevelA = new SignalStreamLevel();
             *      signalStreamLevelA.currentnum.Value = multiSignalA.signalNum.Value;
             *      signalStreamLevelA.toname.SetReadMax(true);
             *      signalStreamLevelA.toname.SetText("city11,2", 16);
             *      signalStreamLevelA.streamID.Value = 154;
             *      signalA.data = signalStreamLevelA;
             *      signalA.id.Value = (int)Signal.SignalTypeJun01.HandleStreamLevel;
             *      multiSignalA.signalList.Add(signalA);
             *
             *      MultiSignal multiSignalB = (MultiSignal)multiSignals[1];
             *      Signal signalB = new Signal();
             *      SignalStreamLevel signalStreamLevelB = new SignalStreamLevel();
             *      signalStreamLevelB.currentnum.Value = multiSignalB.signalNum.Value;
             *      signalStreamLevelB.toname.SetText("city16,97", 16);
             *      signalStreamLevelB.streamID.Value = 215;
             *      signalB.data = signalStreamLevelB;
             *      signalB.id.Value = (int)Signal.SignalTypeJun01.HandleStreamLevel;
             *      multiSignalB.signalList.Add(signalB);
             * }*/
        }