formatting
This commit is contained in:
@@ -86,8 +86,9 @@ class FFIFilamentApp extends FilamentApp<Pointer> {
|
|||||||
config.disableHandleUseAfterFreeCheck,
|
config.disableHandleUseAfterFreeCheck,
|
||||||
cb));
|
cb));
|
||||||
final nameComponentManager = NameComponentManager_create();
|
final nameComponentManager = NameComponentManager_create();
|
||||||
final gltfAssetLoader = await withPointerCallback<TGltfAssetLoader>(
|
final gltfAssetLoader = await withPointerCallback<TGltfAssetLoader>((cb) =>
|
||||||
(cb) => GltfAssetLoader_createRenderThread(engine, nullptr, nameComponentManager, cb));
|
GltfAssetLoader_createRenderThread(
|
||||||
|
engine, nullptr, nameComponentManager, cb));
|
||||||
final renderer = await withPointerCallback<TRenderer>(
|
final renderer = await withPointerCallback<TRenderer>(
|
||||||
(cb) => Engine_createRendererRenderThread(engine, cb));
|
(cb) => Engine_createRendererRenderThread(engine, cb));
|
||||||
final ubershaderMaterialProvider =
|
final ubershaderMaterialProvider =
|
||||||
@@ -101,8 +102,6 @@ class FFIFilamentApp extends FilamentApp<Pointer> {
|
|||||||
|
|
||||||
RenderThread_setRenderTicker(renderTicker);
|
RenderThread_setRenderTicker(renderTicker);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FilamentApp.instance = FFIFilamentApp(
|
FilamentApp.instance = FFIFilamentApp(
|
||||||
engine,
|
engine,
|
||||||
gltfAssetLoader,
|
gltfAssetLoader,
|
||||||
@@ -153,6 +152,7 @@ class FFIFilamentApp extends FilamentApp<Pointer> {
|
|||||||
Future<SwapChain> createHeadlessSwapChain(int width, int height,
|
Future<SwapChain> createHeadlessSwapChain(int width, int height,
|
||||||
{bool hasStencilBuffer = false}) async {
|
{bool hasStencilBuffer = false}) async {
|
||||||
var flags = TSWAP_CHAIN_CONFIG_TRANSPARENT | TSWAP_CHAIN_CONFIG_READABLE;
|
var flags = TSWAP_CHAIN_CONFIG_TRANSPARENT | TSWAP_CHAIN_CONFIG_READABLE;
|
||||||
|
|
||||||
if (hasStencilBuffer) {
|
if (hasStencilBuffer) {
|
||||||
flags |= TSWAP_CHAIN_CONFIG_HAS_STENCIL_BUFFER;
|
flags |= TSWAP_CHAIN_CONFIG_HAS_STENCIL_BUFFER;
|
||||||
}
|
}
|
||||||
@@ -321,7 +321,6 @@ class FFIFilamentApp extends FilamentApp<Pointer> {
|
|||||||
TextureSamplerType textureSamplerType = TextureSamplerType.SAMPLER_2D,
|
TextureSamplerType textureSamplerType = TextureSamplerType.SAMPLER_2D,
|
||||||
TextureFormat textureFormat = TextureFormat.RGBA16F,
|
TextureFormat textureFormat = TextureFormat.RGBA16F,
|
||||||
int? importedTextureHandle}) async {
|
int? importedTextureHandle}) async {
|
||||||
|
|
||||||
var bitmask = flags.fold(0, (a, b) => a | b.value);
|
var bitmask = flags.fold(0, (a, b) => a | b.value);
|
||||||
|
|
||||||
final texturePtr = await withPointerCallback<TTexture>((cb) {
|
final texturePtr = await withPointerCallback<TTexture>((cb) {
|
||||||
@@ -378,20 +377,16 @@ class FFIFilamentApp extends FilamentApp<Pointer> {
|
|||||||
/// If [requireAlpha] is true, the decoded image will always contain an
|
/// If [requireAlpha] is true, the decoded image will always contain an
|
||||||
/// alpha channel (even if the original image did not contain one).
|
/// alpha channel (even if the original image did not contain one).
|
||||||
///
|
///
|
||||||
Future<LinearImage> decodeImage(Uint8List data, { String name = "image", bool requireAlpha = false}) async {
|
Future<LinearImage> decodeImage(Uint8List data,
|
||||||
|
{String name = "image", bool requireAlpha = false}) async {
|
||||||
late Pointer stackPtr;
|
late Pointer stackPtr;
|
||||||
if (FILAMENT_WASM) {
|
if (FILAMENT_WASM) {
|
||||||
//stackPtr = stackSave();
|
//stackPtr = stackSave();
|
||||||
}
|
}
|
||||||
var now = DateTime.now();
|
var now = DateTime.now();
|
||||||
|
|
||||||
var ptr = Image_decode(
|
var ptr = Image_decode(data.address, data.length,
|
||||||
data.address,
|
name.toNativeUtf8().cast<Char>(), requireAlpha);
|
||||||
data.length,
|
|
||||||
name.toNativeUtf8().cast<Char>(),
|
|
||||||
requireAlpha
|
|
||||||
);
|
|
||||||
|
|
||||||
var finished = DateTime.now();
|
var finished = DateTime.now();
|
||||||
print(
|
print(
|
||||||
@@ -1211,4 +1206,6 @@ class FFIFilamentApp extends FilamentApp<Pointer> {
|
|||||||
Vector3(bb.centerX, bb.centerY, bb.centerZ),
|
Vector3(bb.centerX, bb.centerY, bb.centerZ),
|
||||||
Vector3(bb.halfExtentX, bb.halfExtentY, bb.halfExtentZ));
|
Vector3(bb.halfExtentX, bb.halfExtentY, bb.halfExtentZ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user