daily update on 20240828 by nitload youmu, autotexture added

This commit is contained in:
Nitload
2024-08-28 10:58:31 +08:00
parent d082071f2d
commit 1ee4e4a42f
586 changed files with 60910 additions and 123106 deletions
+32 -2
View File
@@ -1,4 +1,34 @@
using StgSharp.Data.FileIO;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="Area.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp.Data.FileIO;
using System;
using System.Collections.Generic;
@@ -15,6 +45,6 @@ namespace StgSharp.Data
/// </summary>
public partial class Area
{
}
}
+6 -6
View File
@@ -43,19 +43,19 @@ namespace StgSharp.Data
public struct SSDSegmentHead
{
[FieldOffset(12)] internal byte size;
[FieldOffset(0)] internal M128 data;
[FieldOffset(13)] public byte selfDefine_1;
[FieldOffset(14)] public byte selfDefine_2;
[FieldOffset(15)] public byte selfDefine_3;
[FieldOffset(0)] public int globalID;
[FieldOffset(4)] public int nextID;
[FieldOffset(8)] public int previousHash;
[FieldOffset(12)] internal byte size;
[FieldOffset(13)] public byte selfDefine_1;
[FieldOffset(14)] public byte selfDefine_2;
[FieldOffset(15)] public byte selfDefine_3;
public int Size
{
get => ((int)size) + 1;
+18 -18
View File
@@ -54,24 +54,6 @@ namespace StgSharp.Data
this.PreviousHash = previousHash;
}
public static SSDSegment FromStream(byte[] stream)
{
if (stream.Length != 16 * StgSharp.ssdSegmentLength)
{
throw new ArgumentException();
}
SSDSegment ret = new SSDSegment();
fixed (byte* bptr = stream)
{
ret.Head.data = *(M128*)bptr;
for (int i = 1; i < StgSharp.ssdSegmentLength; i++)
{
ret.WriteData<M128>(i - 1, *(M128*)(bptr + 16 * i));
}
}
return ret;
}
public byte this[int index]
{
get
@@ -113,6 +95,24 @@ namespace StgSharp.Data
}
}
public static SSDSegment FromStream(byte[] stream)
{
if (stream.Length != 16 * StgSharp.ssdSegmentLength)
{
throw new ArgumentException();
}
SSDSegment ret = new SSDSegment();
fixed (byte* bptr = stream)
{
ret.Head.data = *(M128*)bptr;
for (int i = 1; i < StgSharp.ssdSegmentLength; i++)
{
ret.WriteData<M128>(i - 1, *(M128*)(bptr + (16 * i)));
}
}
return ret;
}
public byte[] GetBytes()
{
byte[] ret = new byte[16 * StgSharp.ssdSegmentLength];
+2 -2
View File
@@ -39,11 +39,11 @@ namespace StgSharp.Data
{
public partial class SSD
{
private SSDrawHead head;
private Dictionary<string, SSDraw> fileList;
private FileStream file;
private SSDrawHead head;
public SSD()
{
@@ -39,9 +39,10 @@ namespace StgSharp.Data
{
public class SSDFolder : ISSDSerializable
{
internal Dictionary<string, SSDFolder> folders;
internal int _folderID;
internal string _name;
internal Dictionary<string, SSDFolder> folders;
internal SSDFolder()
{
@@ -68,6 +69,11 @@ namespace StgSharp.Data
public SerializableTypeCode SSDTypeCode => SerializableTypeCode.VirtualFolder;
public void FromBytes(byte[] stream)
{
throw new NotImplementedException();
}
//TODO 虚拟文件夹的GetBytes好难写
public byte[] GetBytes()
@@ -75,10 +81,5 @@ namespace StgSharp.Data
throw new NotImplementedException();
}
public void FromBytes(byte[] stream)
{
throw new NotImplementedException();
}
}
}
+3 -1
View File
@@ -47,6 +47,7 @@ namespace StgSharp.Data.FileIO
{
public class SSDraw
{
private byte[] data;
public SSDraw(string name, Stream streamSource)
@@ -62,13 +63,14 @@ namespace StgSharp.Data.FileIO
public SSDrawHead Head { get; set; }
public string Name { get; set; }
}
[StructLayout(LayoutKind.Explicit, Size = 32 * 16)]
public unsafe struct SSDrawHead
{
}