Skip to content
Permalink
Browse files

feat(asset-bundle): fix api->generateSingleRAB, generateSingleSAB: no…

…t return state
  • Loading branch information...
yyc-git committed May 14, 2019
1 parent 2e14fd1 commit 2a4affddd8c01440efc5c1c5fcb92c3b3326ac89
@@ -315,11 +315,11 @@ let _buildGeometryData =
(imageAlignedByteLength, imageBufferViewArr, {geometrys}, state) => {
let imageBufferViewIndex = imageBufferViewArr |> Js.Array.length;

let (state, geometryArr, uint8ArrayArr, bufferViewArr, byteOffset) =
let (geometryArr, uint8ArrayArr, bufferViewArr, byteOffset) =
geometrys
|> WonderCommonlib.ArrayService.reduceOneParam(
(.
(state, geometryArr, uint8ArrayArr, bufferViewArr, byteOffset),
(geometryArr, uint8ArrayArr, bufferViewArr, byteOffset),
geometryComponent,
) => {
let (vertexBufferView, bufferViewArr, byteOffset, uint8ArrayArr) =
@@ -396,7 +396,6 @@ let _buildGeometryData =
);

(
state,
geometryArr
|> ArrayService.push({
name:
@@ -421,11 +420,10 @@ let _buildGeometryData =
byteOffset,
);
},
(state, [||], [||], [||], imageAlignedByteLength),
([||], [||], [||], imageAlignedByteLength),
);

(
state,
geometryArr,
uint8ArrayArr,
bufferViewArr,
@@ -495,7 +493,6 @@ let buildJsonData = (resourceData, state) => {
let (basicMaterialArr, lightMaterialArr) =
_buildMaterialData(textureIndexMap, resourceData, state);
let (
state,
geometryArr,
geometryArrayBufferArr,
geometryBufferViewArr,
@@ -513,7 +510,6 @@ let buildJsonData = (resourceData, state) => {
let scriptAttributeArr = _buildScriptAttributeData(resourceData);

(
state,
(
imageArr,
textureArr,
@@ -33,7 +33,6 @@ let generateRAB =

let generateSingleRAB = (resourceData, state) => {
let (
state,
(
imageArr,
textureArr,
@@ -61,16 +60,13 @@ let generateSingleRAB = (resourceData, state) => {
bufferViews: Js.Array.concat(geometryBufferViewArr, imageBufferViewArr),
});

let rab =
generateRAB(
(
(imageBufferViewArr, geometryBufferViewArr),
imageUint8ArrayArr,
geometryUint8ArrayArr,
),
bufferTotalAlignedByteLength,
jsonUint8Array,
);

(state, rab);
generateRAB(
(
(imageBufferViewArr, geometryBufferViewArr),
imageUint8ArrayArr,
geometryUint8ArrayArr,
),
bufferTotalAlignedByteLength,
jsonUint8Array,
);
};
@@ -51,5 +51,5 @@ let generateSingleSAB = (sceneGameObject, imageUint8ArrayMap, state) => {
state,
);

(state, ConvertGLBSystem.convertGLBData(gltf, binBuffer));
ConvertGLBSystem.convertGLBData(gltf, binBuffer);
};
@@ -53,7 +53,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

let image2 =
@@ -80,7 +80,7 @@ let _ =
(),
);

let (state, rab2) =
let rab2 =
GenerateSingleRABSystem.generateSingleRAB(resourceData2, state);

GenerateAllABTool.TestWithTwoRAB.generateAllAB((rab1, rab2), state)
@@ -140,7 +140,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

let image2 =
@@ -170,7 +170,7 @@ let _ =
(),
);

let (state, rab2) =
let rab2 =
GenerateSingleRABSystem.generateSingleRAB(resourceData2, state);

GenerateAllABTool.TestWithTwoRAB.generateAllAB((rab1, rab2), state)
@@ -263,7 +263,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state)
@@ -352,7 +352,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state)
@@ -406,7 +406,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state)
@@ -483,7 +483,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state)
@@ -597,10 +597,10 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

let (state, rab2) =
let rab2 =
GenerateSingleRABSystem.generateSingleRAB(resourceData2, state);

GenerateAllABTool.TestWithTwoRAB.generateAllAB((rab1, rab2), state)
@@ -683,7 +683,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state)
@@ -740,7 +740,7 @@ let _ =
(),
);

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state)
@@ -773,10 +773,10 @@ let _ =
let resourceData1 =
GenerateSingleRABTool.ResourceData.buildResourceData();

let (state, rab1) =
let rab1 =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state^);

GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state)
GenerateAllABTool.TestWithOneRAB.generateAllAB(rab1, state^)
|> MostTool.testStream(data => {
let rab1RelativePath =
GenerateAllABTool.TestWithOneRAB.getRabRelativePath();
@@ -53,7 +53,7 @@ let _ =
(),
);

let (state, rab1) =
let (rab1) =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

let (state, gameObject2, transform2, (material2, texture2)) =
@@ -71,7 +71,7 @@ let _ =
let (canvas, context, (base64Str1, base64Str2)) =
GenerateSceneGraphSystemTool.prepareCanvas(sandbox);

let (state, sab1) =
let (sab1) =
GenerateSingleSABSystem.generateSingleSAB(
SceneAPI.getSceneGameObject(state),
WonderCommonlib.MutableSparseMapService.createEmpty(),
@@ -150,7 +150,7 @@ let _ =
(),
);

let (state, rab1) =
let (rab1) =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

let (state, gameObject2, transform2, (material2, texture2)) =
@@ -176,7 +176,7 @@ let _ =
let (canvas, context, (base64Str1, base64Str2)) =
GenerateSceneGraphSystemTool.prepareCanvas(sandbox);

let (state, sab1) =
let (sab1) =
GenerateSingleSABSystem.generateSingleSAB(
SceneAPI.getSceneGameObject(state),
WonderCommonlib.MutableSparseMapService.createEmpty(),
@@ -245,7 +245,7 @@ let _ =
(),
);

let (state, rab1) =
let (rab1) =
GenerateSingleRABSystem.generateSingleRAB(resourceData1, state);

let gameObject2Name = "gameObject2";
@@ -292,7 +292,7 @@ let _ =
|> SceneAPI.addSceneChild(transform2)
|> SceneAPI.addSceneChild(transform3);

let (state, sab1) =
let (sab1) =
GenerateSingleSABSystem.generateSingleSAB(
SceneAPI.getSceneGameObject(state),
WonderCommonlib.MutableSparseMapService.createEmpty(),

0 comments on commit 2a4affd

Please sign in to comment.
You can’t perform that action at this time.