Example #1
0
 void ResetData()
 {
     for (int i = 0; i < MaxCutsceneNum; i++)
     {
         Data[i] = new CutSceneData();
     }
 }
Example #2
0
 void ResetData()
 {
     for (int i = 0; i < MaxCutsceneNum; i++)
     {
         Data[i] = new CutSceneData();
     }
 }
Example #3
0
        public void SaveOrLoad(Serializer serializer)
        {
            var entries = new LoadAndSaveEntry[]
            {
                LoadAndSaveEntry.Create(reader =>
                {
                    StackPointer       = reader.ReadByte();
                    var cutScenePtr    = reader.ReadInt32s(MaxCutsceneNum);
                    var cutSceneScript = reader.ReadBytes(MaxCutsceneNum);
                    var cutSceneData   = reader.ReadInt16s(MaxCutsceneNum);

                    // load Cut Scene Data
                    for (var i = 0; i < MaxCutsceneNum; i++)
                    {
                        var data = new CutSceneData
                        {
                            Pointer = cutScenePtr[i],
                            Script  = cutSceneScript[i],
                            Data    = cutSceneData[i]
                        };
                        Data[i] = data;
                    }
                    ScriptIndex = reader.ReadInt16();
                }, writer =>
                {
                    var cutScenePtr    = new int[MaxCutsceneNum];
                    var cutSceneScript = new byte[MaxCutsceneNum];
                    var cutSceneData   = new short[MaxCutsceneNum];
                    var cutSceneStack  = Data;
                    for (var i = 0; i < cutSceneStack.Length; i++)
                    {
                        cutScenePtr[i]    = cutSceneStack[i].Pointer;
                        cutSceneScript[i] = cutSceneStack[i].Script;
                        cutSceneData[i]   = (short)cutSceneStack[i].Data;
                    }
                    writer.WriteByte(StackPointer);
                    writer.WriteInt32s(cutScenePtr, MaxCutsceneNum);
                    writer.WriteBytes(cutSceneScript, MaxCutsceneNum);
                    writer.WriteInt16s(cutSceneData, MaxCutsceneNum);
                    writer.WriteInt16(ScriptIndex);
                }, 8)
            };

            entries.ForEach(e => e.Execute(serializer));
        }
Example #4
0
        public void SaveOrLoad(Serializer serializer)
        {
            var entries = new LoadAndSaveEntry[]
            {
                LoadAndSaveEntry.Create(reader =>
                    {
                        StackPointer = reader.ReadByte();
                        var cutScenePtr = reader.ReadInt32s(MaxCutsceneNum);
                        var cutSceneScript = reader.ReadBytes(MaxCutsceneNum);
                        var cutSceneData = reader.ReadInt16s(MaxCutsceneNum);

                        // load Cut Scene Data
                        for (var i = 0; i < MaxCutsceneNum; i++)
                        {
                            var data = new CutSceneData
                            {
                                Pointer = cutScenePtr[i],
                                Script = cutSceneScript[i],
                                Data = cutSceneData[i]
                            };
                            Data[i] = data;
                        }
                        ScriptIndex = reader.ReadInt16();
                    }, writer =>
                    {
                        var cutScenePtr = new int[MaxCutsceneNum];
                        var cutSceneScript = new byte[MaxCutsceneNum];
                        var cutSceneData = new short[MaxCutsceneNum];
                        var cutSceneStack = Data;
                        for (var i = 0; i < cutSceneStack.Length; i++)
                        {
                            cutScenePtr[i] = cutSceneStack[i].Pointer;   
                            cutSceneScript[i] = cutSceneStack[i].Script;   
                            cutSceneData[i] = (short)cutSceneStack[i].Data;   
                        }
                        writer.WriteByte(StackPointer);
                        writer.WriteInt32s(cutScenePtr, MaxCutsceneNum);
                        writer.WriteBytes(cutSceneScript, MaxCutsceneNum);
                        writer.WriteInt16s(cutSceneData, MaxCutsceneNum);
                        writer.WriteInt16(ScriptIndex);
                    }, 8)
            };
            entries.ForEach(e => e.Execute(serializer));
        }
Example #5
0
 public CutScene()
 {
     Data = new CutSceneData[MaxCutsceneNum];
     ResetData();
 }
Example #6
0
 public CutScene()
 {
     Data = new CutSceneData[MaxCutsceneNum];
     ResetData();
 }