1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Merge pull request #37175 from m4gr3d/make_godot_plugin_callbacks_generic_3.2

[3.2] Update the naming scheme for the GodotPlugin's methods
This commit is contained in:
Rémi Verschelde
2020-04-17 00:08:27 +02:00
committed by GitHub
5 changed files with 23 additions and 21 deletions

View File

@@ -291,12 +291,12 @@ public abstract class Godot extends FragmentActivity implements SensorEventListe
};
/**
* Invoked on the GL thread when the Godot main loop has started.
* Invoked on the render thread when the Godot main loop has started.
*/
@CallSuper
protected void onGLGodotMainLoopStarted() {
protected void onGodotMainLoopStarted() {
for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) {
plugin.onGLGodotMainLoopStarted();
plugin.onGodotMainLoopStarted();
}
}
@@ -343,7 +343,7 @@ public abstract class Godot extends FragmentActivity implements SensorEventListe
// Must occur after GodotLib.setup has completed.
for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) {
plugin.onGLRegisterPluginWithGodotNative();
plugin.onRegisterPluginWithGodotNative();
}
setKeepScreenOn("True".equals(GodotLib.getGlobal("display/window/energy_saving/keep_screen_on")));
@@ -912,11 +912,11 @@ public abstract class Godot extends FragmentActivity implements SensorEventListe
}
/**
* Queue a runnable to be run on the GL thread.
* Queue a runnable to be run on the render thread.
* <p>
* This must be called after the GL thread has started.
* This must be called after the render thread has started.
*/
public final void runOnGLThread(@NonNull Runnable action) {
public final void runOnRenderThread(@NonNull Runnable action) {
if (mView != null) {
mView.queueEvent(action);
}

View File

@@ -91,8 +91,10 @@ public abstract class GodotPlugin {
/**
* Register the plugin with Godot native code.
*
* This method is invoked on the render thread.
*/
public final void onGLRegisterPluginWithGodotNative() {
public final void onRegisterPluginWithGodotNative() {
nativeRegisterSingleton(getPluginName(), this);
Class clazz = getClass();
@@ -183,9 +185,9 @@ public abstract class GodotPlugin {
public boolean onMainBackPressed() { return false; }
/**
* Invoked on the GL thread when the Godot main loop has started.
* Invoked on the render thread when the Godot main loop has started.
*/
public void onGLGodotMainLoopStarted() {}
public void onGodotMainLoopStarted() {}
/**
* Invoked once per frame on the GL thread after the frame is drawn.
@@ -249,12 +251,12 @@ public abstract class GodotPlugin {
}
/**
* Queue the specified action to be run on the GL thread.
* Queue the specified action to be run on the render thread.
*
* @param action the action to run on the GL thread
* @param action the action to run on the render thread
*/
protected void runOnGLThread(Runnable action) {
godot.runOnGLThread(action);
protected void runOnRenderThread(Runnable action) {
godot.runOnRenderThread(action);
}
/**