-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dispose): add "dispose texture" logic(draft)
update wonder-webgl version
- Loading branch information
Showing
27 changed files
with
947 additions
and
381 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
let isGroup = (component, gameObjectsMap) => | ||
switch (GameObjectsMapService.getGameObjects(component, gameObjectsMap)) { | ||
| Some(arr) when arr |> Js.Array.length > 0 => true | ||
| _ => false | ||
}; | ||
|
||
let removeGameObject = (gameObject, component, gameObjectsMap) => | ||
GameObjectsMapService.removeGameObject( | ||
gameObject, | ||
component, | ||
gameObjectsMap, | ||
); | ||
|
||
let batchRemoveGameObjects = (gameObjectArr, component, gameObjectsMap) => | ||
GameObjectsMapService.batchRemoveGameObjects( | ||
gameObjectArr, | ||
component, | ||
gameObjectsMap, | ||
); |
This file was deleted.
Oops, something went wrong.
117 changes: 57 additions & 60 deletions
117
src/service/primitive/buffer/DisposeTypeArrayService.re
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 |
---|---|---|
@@ -1,75 +1,72 @@ | ||
let deleteBySwapAndResetFloat32TypeArr = | ||
[@bs] | ||
( | ||
((sourceIndex, targetIndex), typeArr, length, defaultValueArr) => { | ||
open Js.Typed_array; | ||
for (i in 0 to length - 1) { | ||
Float32Array.unsafe_set( | ||
typeArr, | ||
sourceIndex + i, | ||
Float32Array.unsafe_get(typeArr, targetIndex + i) | ||
); | ||
Float32Array.unsafe_set(typeArr, targetIndex + i, defaultValueArr[i]) | ||
}; | ||
typeArr | ||
} | ||
); | ||
(. (sourceIndex, targetIndex), typeArr, length, defaultValueArr) => { | ||
open Js.Typed_array; | ||
for (i in 0 to length - 1) { | ||
Float32Array.unsafe_set( | ||
typeArr, | ||
sourceIndex + i, | ||
Float32Array.unsafe_get(typeArr, targetIndex + i), | ||
); | ||
Float32Array.unsafe_set(typeArr, targetIndex + i, defaultValueArr[i]); | ||
}; | ||
typeArr; | ||
}; | ||
|
||
let deleteSingleValueBySwapAndResetFloat32TypeArr = | ||
[@bs] | ||
( | ||
((sourceIndex, targetIndex), typeArr, length: int, defaultValue) => { | ||
open Js.Typed_array; | ||
Float32Array.unsafe_set(typeArr, sourceIndex, Float32Array.unsafe_get(typeArr, targetIndex)); | ||
Float32Array.unsafe_set(typeArr, targetIndex, defaultValue); | ||
typeArr | ||
} | ||
); | ||
(. (sourceIndex, targetIndex), typeArr, length: int, defaultValue) => { | ||
open Js.Typed_array; | ||
Float32Array.unsafe_set( | ||
typeArr, | ||
sourceIndex, | ||
Float32Array.unsafe_get(typeArr, targetIndex), | ||
); | ||
Float32Array.unsafe_set(typeArr, targetIndex, defaultValue); | ||
typeArr; | ||
}; | ||
|
||
let deleteSingleValueBySwapUint32TypeArr = (sourceIndex, lastIndex, typeArr) => { | ||
open Js.Typed_array; | ||
Uint32Array.unsafe_set(typeArr, sourceIndex, Uint32Array.unsafe_get(typeArr, lastIndex)); | ||
typeArr | ||
Uint32Array.unsafe_set( | ||
typeArr, | ||
sourceIndex, | ||
Uint32Array.unsafe_get(typeArr, lastIndex), | ||
); | ||
typeArr; | ||
}; | ||
|
||
let deleteAndResetFloat32TypeArr = | ||
[@bs] | ||
( | ||
(sourceIndex, length, defaultValueArr, typeArr) => { | ||
open Js.Typed_array; | ||
for (i in 0 to length - 1) { | ||
Float32Array.unsafe_set(typeArr, sourceIndex + i, defaultValueArr[i]) | ||
}; | ||
typeArr | ||
} | ||
); | ||
(. sourceIndex, length, defaultValueArr, typeArr) => { | ||
open Js.Typed_array; | ||
for (i in 0 to length - 1) { | ||
Float32Array.unsafe_set(typeArr, sourceIndex + i, defaultValueArr[i]); | ||
}; | ||
typeArr; | ||
}; | ||
|
||
let deleteAndResetFloat32 = | ||
[@bs] | ||
( | ||
(sourceIndex, defaultValue, typeArr) => { | ||
open Js.Typed_array; | ||
Float32Array.unsafe_set(typeArr, sourceIndex, defaultValue); | ||
typeArr | ||
} | ||
); | ||
(. sourceIndex, defaultValue, typeArr) => { | ||
open Js.Typed_array; | ||
Float32Array.unsafe_set(typeArr, sourceIndex, defaultValue); | ||
typeArr; | ||
}; | ||
|
||
let deleteAndResetUint32 = | ||
[@bs] | ||
( | ||
(sourceIndex, defaultValue, typeArr) => { | ||
open Js.Typed_array; | ||
Uint32Array.unsafe_set(typeArr, sourceIndex, defaultValue); | ||
typeArr | ||
} | ||
); | ||
(. sourceIndex, defaultValue, typeArr) => { | ||
open Js.Typed_array; | ||
Uint32Array.unsafe_set(typeArr, sourceIndex, defaultValue); | ||
typeArr; | ||
}; | ||
|
||
let deleteAndResetUint8 = | ||
[@bs] | ||
( | ||
(sourceIndex, defaultValue, typeArr) => { | ||
open Js.Typed_array; | ||
Uint8Array.unsafe_set(typeArr, sourceIndex, defaultValue); | ||
typeArr | ||
} | ||
); | ||
(. sourceIndex, defaultValue, typeArr) => { | ||
open Js.Typed_array; | ||
Uint8Array.unsafe_set(typeArr, sourceIndex, defaultValue); | ||
typeArr; | ||
}; | ||
|
||
let deleteAndResetUint16 = | ||
(. sourceIndex, defaultValue, typeArr) => { | ||
open Js.Typed_array; | ||
Uint16Array.unsafe_set(typeArr, sourceIndex, defaultValue); | ||
typeArr; | ||
}; |
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
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
6 changes: 3 additions & 3 deletions
6
src/service/record/main/material/basic/GroupBasicMaterialService.re
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
6 changes: 3 additions & 3 deletions
6
src/service/record/main/material/light/GroupLightMaterialService.re
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
Oops, something went wrong.