-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Investigated reading meshes for SM64DS BMDs.
- Loading branch information
1 parent
e720b60
commit 0e9100d
Showing
4 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
FinModelUtility/Games/SuperMario64Ds/SuperMario64Ds/src/010/Bmd.bt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//------------------------------------------------ | ||
//--- 010 Editor v14.0 Binary Template | ||
// | ||
// File: | ||
// Authors: | ||
// Version: | ||
// Purpose: | ||
// Category: | ||
// File Mask: | ||
// ID Bytes: | ||
// History: | ||
//------------------------------------------------ | ||
|
||
|
||
typedef struct { | ||
uint scaleFactor; | ||
|
||
uint boneCount; | ||
uint bonesOffset; | ||
|
||
uint displayListCount; | ||
uint displayListsOffset; | ||
|
||
uint textureCount; | ||
uint texturesOffset; | ||
|
||
uint texturePaletteCount; | ||
uint texturePalettesOffset; | ||
|
||
uint materialCount; | ||
uint materialsOffset; | ||
|
||
uint transformAndBoneMapOffset; | ||
uint textureAndPaletteDataBlock; | ||
} FileHeader; | ||
|
||
FileHeader fileHeader; | ||
|
||
|
||
typedef struct { | ||
uint unknown; | ||
uint dataOffset; | ||
|
||
local ulong tmp = FTell(); | ||
FSeek(dataOffset); | ||
|
||
uint transformCount; | ||
uint transformsOffset; | ||
|
||
uint opcodesByteLength; | ||
uint opcodesOffset; | ||
|
||
FSeek(transformsOffset); | ||
byte transforms[transformCount]; | ||
|
||
FSeek(tmp); | ||
} DisplayList; | ||
|
||
FSeek(fileHeader.displayListsOffset); | ||
DisplayList displayLists[fileHeader.displayListCount] <optimize=false>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
FinModelUtility/Games/SuperMario64Ds/SuperMario64Ds/src/schema/bmd/DisplayList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using fin.schema; | ||
|
||
using schema.binary; | ||
using schema.binary.attributes; | ||
|
||
namespace sm64ds.schema.bmd; | ||
|
||
[BinarySchema] | ||
public partial class DisplayList : IBinaryConvertible { | ||
[Unknown] | ||
public uint Unknown { get; set; } | ||
|
||
public uint DataOffset { get; set; } | ||
|
||
[RAtPosition(nameof(DataOffset))] | ||
public DisplayListData Data { get; } = new(); | ||
} | ||
|
||
[BinarySchema] | ||
public partial class DisplayListData : IBinaryConvertible { | ||
public uint TransformCount { get; set; } | ||
public uint TransformsOffset { get; set; } | ||
|
||
public uint OpcodesByteLength { get; set; } | ||
public uint OpcodesOffset { get; set; } | ||
|
||
[RAtPosition(nameof(TransformsOffset))] | ||
[RSequenceLengthSource(nameof(TransformCount))] | ||
public byte[] TransformIds { get; set; } | ||
} |