Skip to content

Commit

Permalink
Update memory load
Browse files Browse the repository at this point in the history
  • Loading branch information
hackermdch committed Sep 22, 2024
1 parent 03ce246 commit eda1cf6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class FlutterInstance(assets: String?, val rect: FlutterRect, var width: Int, va
POST_BLUR.setUniformValue("NoiseStrength", composeData.noise)
POST_BLUR.setUniformValue("Opacity", composeData.opacity)
POST_BLUR.render(0f)
// -Dorg.lwjgl.glfw.libname=/usr/lib/libglfw.so
}

override fun close() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.primogemstudio.advancedfmk.flutter

import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kDown
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kHover
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kMove
import com.primogemstudio.advancedfmk.flutter.FlutterPointerPhase.kUp

object FlutterMouseEvent {
fun onMouseButton(phase: Int, x: Double, y: Double): Boolean {
for (i in FlutterEvents.instances) {
Expand All @@ -14,8 +19,8 @@ object FlutterMouseEvent {
0.0,
0
)
if (phase == FlutterPointerPhase.kDown) i.pressed = true
else if (phase == FlutterPointerPhase.kUp) i.pressed = false
if (phase == kDown) i.pressed = true
else if (phase == kUp) i.pressed = false
return true
}
}
Expand All @@ -27,7 +32,7 @@ object FlutterMouseEvent {
if (i.hitTest(x, y)) {
FlutterNative.sendPointerEvent(
i.handle,
if (i.pressed) FlutterPointerPhase.kMove else FlutterPointerPhase.kHover,
if (i.pressed) kMove else kHover,
x - i.rect.left,
y - i.rect.top,
FlutterSignalKind.None,
Expand All @@ -46,7 +51,7 @@ object FlutterMouseEvent {
if (i.hitTest(x, y)) {
FlutterNative.sendPointerEvent(
i.handle,
if (i.pressed) FlutterPointerPhase.kUp else FlutterPointerPhase.kHover,
if (i.pressed) kUp else kHover,
x - i.rect.left,
y - i.rect.top,
FlutterSignalKind.Scroll,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public final class FlutterNative {
static {
System.load("/home/coder2/flutter/engine_build/test/src/out/host_release/libflutter_minecraft.so");
System.load("D:/engine/src/out/host_release/flutter_minecraft.dll");
}

static Cleaner cleaner = Cleaner.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public abstract class RenderSystemMixin {
@Inject(method = "render", at = @At(value = "RETURN"))
private void flipFrame(DeltaTracker deltaTracker, boolean renderLevel, CallbackInfo ci) {
if (instance == null) {
instance = new FlutterInstance("/home/coder2/flutter/flutter_demo/build/linux/x64/release/bundle/data/flutter_assets", new FlutterRect(), 600, 800);
instance = new FlutterInstance("jar://app", new FlutterRect(), 600, 800);
instance.sendSizeEvent();
instance.getComposeData().setBlurType(1);
instance.getComposeData().setBlurRadius(8);
instance.getComposeData().setNoise(0.005f);
Expand Down
Binary file added flutter-ui/src/main/resources/icudtl.dat
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ fun main() {
GL.createCapabilities()
initResources()
createShader()
flutterInstance = FlutterNative.createInstance("F:/Else Language/Dart/flutter-starrail/build/app")
flutterInstance = FlutterNative.createInstance("jar://app")
FlutterNative.sendMetricsEvent(flutterInstance, 800, 600, 0)

glfwSetWindowSizeCallback(window) { _, w, h ->
Expand Down Expand Up @@ -159,7 +159,6 @@ fun main() {
glfwSwapBuffers(window)
glfwPollEvents()
}

FlutterNative.destroyInstance(flutterInstance)
glfwDestroyWindow(window)
glfwTerminate()
Expand Down

0 comments on commit eda1cf6

Please sign in to comment.