minor cleanup

This commit is contained in:
Nick Fisher
2023-10-16 15:07:57 +08:00
parent 4088853705
commit a0cdbde89f
2 changed files with 22 additions and 21 deletions

View File

@@ -16,7 +16,7 @@ Future<void> main() async {
if (!golden.existsSync()) {
throw Exception(
"Golden image doesn't exist yet. Make sure you have run integraton_test_update_goldens.dart first");
"Golden image ${golden.path} doesn't exist yet. Make sure you have run integraton_test_update_goldens.dart first");
}
var result = await compareImages(

View File

@@ -11,7 +11,6 @@ import 'package:polyvox_filament/generated_bindings.dart';
const FilamentEntity _FILAMENT_ASSET_ERROR = 0;
class FilamentControllerFFI extends FilamentController {
late MethodChannel _channel = MethodChannel("app.polyvox.filament/event");
@@ -104,7 +103,7 @@ class FilamentControllerFFI extends FilamentController {
@override
Future destroyTexture() async {
if(_textureId != null) {
if (_textureId != null) {
throw Exception("No texture available");
}
print("Destroying texture");
@@ -194,7 +193,7 @@ class FilamentControllerFFI extends FilamentController {
_assetManager = _lib.get_asset_manager(_viewer!);
_isReadyForScene.complete(true);
return TextureDetails(textureId: _textureId!, width: width, height:height);
return TextureDetails(textureId: _textureId!, width: width, height: height);
}
///
@@ -267,7 +266,8 @@ class FilamentControllerFFI extends FilamentController {
/// 1) never destroy the texture, simply allocate a large (4k?) texture and crop as needed
/// 2) double-buffering?
@override
Future<TextureDetails> resize(int width, int height, {double scaleFactor = 1.0}) async {
Future<TextureDetails> resize(int width, int height,
{double scaleFactor = 1.0}) async {
if (_textureId == null) {
throw Exception("No texture created, ignoring call to resize.");
}
@@ -309,9 +309,10 @@ class FilamentControllerFFI extends FilamentController {
_viewer!, size.width.toInt(), size.height.toInt(), 1.0);
await setRendering(_rendering);
_textureId = textures[0];
return TextureDetails(textureId: _textureId!, width: width, height:height);
return TextureDetails(textureId: _textureId!, width: width, height: height);
}
@override