Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wgreenberg committed Nov 12, 2024
1 parent 8415175 commit 4c92c5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions rust/src/unity/types/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ pub struct ChannelInfo {
pub stream: u8,
pub offset: u8,
pub format: VertexFormat,
#[deku(bits = "3")]
pub dimension: u8,
#[deku(bits = "1", pad_bits_after = "4")]
pub instance_data: u8,
}

#[derive(DekuRead, Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/AShortHike/Scenes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ const id = 'AShortHike';
const name = 'A Short Hike';

const sceneDescs = [
new AShortHikeSceneDesc(`level0`, "Main Menu"),
new AShortHikeSceneDesc(`level1`, "Main Menu"),
new AShortHikeSceneDesc(`level2`, "The Island"),
];

Expand Down
6 changes: 5 additions & 1 deletion src/Common/Unity/AssetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,11 @@ function vertexFormatToGfxFormatBase(vertexFormat: UnityVertexFormat): GfxFormat

function vertexFormatToGfxFormat(vertexFormat: UnityVertexFormat, dimension: number): GfxFormat {
const baseFormat = vertexFormatToGfxFormatBase(vertexFormat);
const compFlags = dimension as FormatCompFlags;
let maskedDimension = dimension & 0x0F;
if (![1, 2, 3, 4].includes(maskedDimension)) {
throw new Error(`invalid dimension ${maskedDimension}`);
}
const compFlags = maskedDimension as FormatCompFlags;
return setFormatCompFlags(baseFormat, compFlags);
}

Expand Down

0 comments on commit 4c92c5e

Please sign in to comment.