-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull in what we have for Xande so far #67
Conversation
src/Lumina/GameData.cs
Outdated
@@ -206,6 +207,7 @@ public GameData( string dataPath, ILogger logger, LuminaOptions? options = null! | |||
|
|||
var file = Activator.CreateInstance< T >(); | |||
file.Data = fileContent; | |||
if( origPath != null ) file.FilePath = ParseFilePath( origPath )!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always use curly braces
src/Lumina/Models/Models/Model.cs
Outdated
@@ -93,7 +93,7 @@ private void BuildModel() | |||
ReadStrings(); | |||
ReadMaterials(); | |||
ReadMeshes(); | |||
ReadShapes(); | |||
ReadShapes(Meshes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
src/Lumina/Models/Models/Model.cs
Outdated
@@ -127,14 +127,19 @@ private void ReadMaterials() | |||
} | |||
} | |||
|
|||
private void ReadShapes() | |||
private void ReadShapes(IReadOnlyList<Mesh> meshes ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
src/Lumina/Models/Models/Shape.cs
Outdated
public string ShapeName { get; private set; } | ||
public struct ShapeMesh { | ||
public Mesh AssociatedMesh; | ||
public (ushort BaseIndicesIndex, ushort ReplacedVertexIndex)[] Values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wtf tier spacing
src/Lumina/Models/Models/Shape.cs
Outdated
public static IReadOnlyList< ShapeMesh > ConstructList( MdlFile file, IReadOnlyList<Mesh> meshes ) | ||
{ | ||
var ret = new ShapeMesh[file.ModelHeader.ShapeMeshCount]; | ||
var idx = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wtf tier spacing
src/Lumina/Models/Models/Shape.cs
Outdated
Name = model.StringOffsetToStringMap[ (int) currentShape.StringOffset ]; | ||
Meshes = new ShapeMesh[currentShape.ShapeMeshCount[ (int) lod ]]; | ||
var end = currentShape.ShapeMeshCount[(int)lod]; | ||
var offset = currentShape.ShapeMeshStartIndex[(int)lod]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
public ushort Offset; | ||
public ushort Value; | ||
public ushort BaseIndicesIndex; // PROBABLY: Index into the Indices array of a mesh. | ||
public ushort ReplacingVertexIndex; // PROBABLY: Index into the (without transformation probably unused) vertex of a mesh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there probs should be obsolete backing fields for this but i dont know if i care
@@ -337,15 +337,15 @@ public static ShapeStruct Read( LuminaBinaryReader br ) | |||
|
|||
public struct ShapeMeshStruct | |||
{ | |||
public uint StartIndex; | |||
public uint MeshIndexOffset; // from TT: The offset to the index block this Shape Data should be replacing in. -- This is how Shape Data is tied to each mesh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this as a doc comment not a normal comment
public ushort Offset; | ||
public ushort Value; | ||
public ushort BaseIndicesIndex; // PROBABLY: Index into the Indices array of a mesh. | ||
public ushort ReplacingVertexIndex; // PROBABLY: Index into the (without transformation probably unused) vertex of a mesh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc comments here too
src/Lumina/Models/Models/Shape.cs
Outdated
|
||
public Shape(Model model, int shapeIndex) | ||
public Shape(Model model, Model.ModelLod lod, IReadOnlyList<ShapeMesh> shapeMeshes, int shapeIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
/// <typeparam name="T">The type of <see cref="FileResource"/> to load the raw file in to</typeparam> | ||
/// <returns>The requested file if found, null if not</returns> | ||
/// <exception cref="FileNotFoundException">The path given doesn't point to an existing file</exception> | ||
public T GetFileFromDisk< T >( string path ) where T : FileResource | ||
public T GetFileFromDisk< T >( string path, string? origPath = null ) where T : FileResource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if that's a concern, but this breaks backwards compatibility by the way.
IIRC, creating Func<string, T>
delegates out of this method won't work any more, also the code that depends on it will need a recompile.
I'm being harassed by people in the Penumbra Discord to work on Xande again so that means this needs to be merged. Is it finished? Who knows!