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

Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks

This commit is contained in:
Rémi Verschelde
2021-05-04 14:41:06 +02:00
parent 64a63e0861
commit b5e1e05ef2
1439 changed files with 1 additions and 34187 deletions

View File

@@ -34,16 +34,13 @@ import java.util.HashMap;
import java.util.Set;
public class Dictionary extends HashMap<String, Object> {
protected String[] keys_cache;
public String[] get_keys() {
String[] ret = new String[size()];
int i = 0;
Set<String> keys = keySet();
for (String key : keys) {
ret[i] = key;
i++;
};
@@ -52,12 +49,10 @@ public class Dictionary extends HashMap<String, Object> {
};
public Object[] get_values() {
Object[] ret = new Object[size()];
int i = 0;
Set<String> keys = keySet();
for (String key : keys) {
ret[i] = get(key);
i++;
};
@@ -70,7 +65,6 @@ public class Dictionary extends HashMap<String, Object> {
};
public void set_values(Object[] vals) {
int i = 0;
for (String key : keys_cache) {
put(key, vals[i]);

View File

@@ -46,7 +46,6 @@ import androidx.fragment.app.FragmentActivity;
* within an Android app.
*/
public abstract class FullScreenGodotApp extends FragmentActivity implements GodotHost {
@Nullable
private Godot godotFragment;

View File

@@ -116,7 +116,6 @@ import java.util.Locale;
import javax.microedition.khronos.opengles.GL10;
public class Godot extends Fragment implements SensorEventListener, IDownloaderClient {
static final int MAX_SINGLETONS = 64;
private IStub mDownloaderClientStub;
private TextView mStatusText;
@@ -171,9 +170,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
static public class SingletonBase {
protected void registerClass(String p_name, String[] p_methods) {
GodotPlugin.nativeRegisterSingleton(p_name, this);
Class clazz = getClass();
@@ -297,7 +294,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
for (int i = 0; i < singleton_count; i++) {
singletons[i].onMainActivityResult(requestCode, resultCode, data);
}
for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) {
@@ -533,7 +529,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
for (int i = 0; i < argc; i++) {
r = is.read(len);
if (r < 4) {
return new String[0];
}
int strlen = ((int)(len[3] & 0xFF) << 24) | ((int)(len[2] & 0xFF) << 16) | ((int)(len[1] & 0xFF) << 8) | ((int)(len[0] & 0xFF));
@@ -581,9 +576,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
String expansion_pack_path;
private void initializeGodot() {
if (expansion_pack_path != null) {
String[] new_cmdline;
int cll = 0;
if (command_line != null) {
@@ -648,7 +641,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
List<String> new_args = new LinkedList<String>();
for (int i = 0; i < command_line.length; i++) {
boolean has_extra = i < command_line.length - 1;
if (command_line[i].equals(XRMode.REGULAR.cmdLineArg)) {
xrMode = XRMode.REGULAR;
@@ -693,7 +685,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
if (new_args.isEmpty()) {
command_line = null;
} else {
command_line = new_args.toArray(new String[new_args.size()]);
}
if (use_apk_expansion && main_pack_md5 != null && main_pack_key != null) {
@@ -715,7 +706,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
boolean pack_valid = true;
if (!f.exists()) {
pack_valid = false;
} else if (obbIsCorrupted(expansion_pack_path, main_pack_md5)) {
@@ -727,7 +717,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
if (!pack_valid) {
Intent notifierIntent = new Intent(activity, activity.getClass());
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TOP);
@@ -785,7 +774,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
@Override
public void onDestroy() {
for (int i = 0; i < singleton_count; i++) {
singletons[i].onMainDestroy();
}
@@ -826,7 +814,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
public String getClipboard() {
String copiedText = "";
if (mClipboard.getPrimaryClip() != null) {
@@ -838,7 +825,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
public void setClipboard(String p_text) {
ClipData clip = ClipData.newPlainText("myLabel", p_text);
mClipboard.setPrimaryClip(clip);
}
@@ -873,7 +859,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
for (int i = 0; i < singleton_count; i++) {
singletons[i].onMainResume();
}
for (GodotPlugin plugin : pluginRegistry.getAllPlugins()) {
@@ -1013,9 +998,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
}
private boolean obbIsCorrupted(String f, String main_pack_md5) {
try {
InputStream fis = new FileInputStream(f);
// Create MD5 Hash

View File

@@ -46,7 +46,6 @@ import com.google.android.vending.expansion.downloader.DownloaderClientMarshalle
* <receiver android:name=".GodotDownloaderAlarmReceiver"/>
*/
public class GodotDownloaderAlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d("GODOT", "Alarma recivida");

View File

@@ -37,7 +37,6 @@ import java.util.List;
* Denotate a component (e.g: Activity, Fragment) that hosts the {@link Godot} fragment.
*/
public interface GodotHost {
/**
* Provides a set of command line parameters to setup the engine.
*/

View File

@@ -55,7 +55,6 @@ import java.util.Locale;
// Wrapper for native library
public class GodotIO {
AssetManager am;
final Activity activity;
GodotEditText edit;
@@ -77,7 +76,6 @@ public class GodotIO {
public int last_file_id = 1;
class AssetData {
public boolean eof = false;
public String path;
public InputStream is;
@@ -88,7 +86,6 @@ public class GodotIO {
SparseArray<AssetData> streams;
public int file_open(String path, boolean write) {
//System.out.printf("file_open: Attempt to Open %s\n",path);
//Log.v("MyApp", "TRYING TO OPEN FILE: " + path);
@@ -101,7 +98,6 @@ public class GodotIO {
ad.is = am.open(path);
} catch (Exception e) {
//System.out.printf("Exception on file_open: %s\n",path);
return -1;
}
@@ -109,7 +105,6 @@ public class GodotIO {
try {
ad.len = ad.is.available();
} catch (Exception e) {
System.out.printf("Exception availabling on file_open: %s\n", path);
return -1;
}
@@ -122,7 +117,6 @@ public class GodotIO {
return last_file_id;
}
public int file_get_size(int id) {
if (streams.get(id) == null) {
System.out.printf("file_get_size: Invalid file id: %d\n", id);
return -1;
@@ -131,7 +125,6 @@ public class GodotIO {
return streams.get(id).len;
}
public void file_seek(int id, int bytes) {
if (streams.get(id) == null) {
System.out.printf("file_get_size: Invalid file id: %d\n", id);
return;
@@ -144,7 +137,6 @@ public class GodotIO {
bytes = 0;
try {
if (bytes > (int)ad.pos) {
int todo = bytes - (int)ad.pos;
while (todo > 0) {
@@ -152,7 +144,6 @@ public class GodotIO {
}
ad.pos = bytes;
} else if (bytes < (int)ad.pos) {
ad.is = am.open(ad.path);
ad.pos = bytes;
@@ -164,14 +155,12 @@ public class GodotIO {
ad.eof = false;
} catch (IOException e) {
System.out.printf("Exception on file_seek: %s\n", e);
return;
}
}
public int file_tell(int id) {
if (streams.get(id) == null) {
System.out.printf("file_read: Can't tell eof for invalid file id: %d\n", id);
return 0;
@@ -181,7 +170,6 @@ public class GodotIO {
return ad.pos;
}
public boolean file_eof(int id) {
if (streams.get(id) == null) {
System.out.printf("file_read: Can't check eof for invalid file id: %d\n", id);
return false;
@@ -192,7 +180,6 @@ public class GodotIO {
}
public byte[] file_read(int id, int bytes) {
if (streams.get(id) == null) {
System.out.printf("file_read: Can't read invalid file id: %d\n", id);
return new byte[0];
@@ -201,13 +188,11 @@ public class GodotIO {
AssetData ad = streams.get(id);
if (ad.pos + bytes > ad.len) {
bytes = ad.len - ad.pos;
ad.eof = true;
}
if (bytes == 0) {
return new byte[0];
}
@@ -216,7 +201,6 @@ public class GodotIO {
try {
r = ad.is.read(buf1);
} catch (IOException e) {
System.out.printf("Exception on file_read: %s\n", e);
return new byte[bytes];
}
@@ -228,19 +212,16 @@ public class GodotIO {
ad.pos += r;
if (r < bytes) {
byte[] buf2 = new byte[r];
for (int i = 0; i < r; i++)
buf2[i] = buf1[i];
return buf2;
} else {
return buf1;
}
}
public void file_close(int id) {
if (streams.get(id) == null) {
System.out.printf("file_close: Can't close invalid file id: %d\n", id);
return;
@@ -254,7 +235,6 @@ public class GodotIO {
/////////////////////////
class AssetDir {
public String[] files;
public int current;
public String path;
@@ -265,7 +245,6 @@ public class GodotIO {
SparseArray<AssetDir> dirs;
public int dir_open(String path) {
AssetDir ad = new AssetDir();
ad.current = 0;
ad.path = path;
@@ -278,7 +257,6 @@ public class GodotIO {
return -1;
}
} catch (IOException e) {
System.out.printf("Exception on dir_open: %s\n", e);
return -1;
}
@@ -317,7 +295,6 @@ public class GodotIO {
}
public String dir_next(int id) {
if (dirs.get(id) == null) {
System.out.printf("dir_next: invalid dir id: %d\n", id);
return "";
@@ -336,7 +313,6 @@ public class GodotIO {
}
public void dir_close(int id) {
if (dirs.get(id) == null) {
System.out.printf("dir_close: invalid dir id: %d\n", id);
return;
@@ -346,7 +322,6 @@ public class GodotIO {
}
GodotIO(Activity p_activity) {
am = p_activity.getAssets();
activity = p_activity;
//streams = new HashMap<Integer, AssetData>();
@@ -437,7 +412,6 @@ public class GodotIO {
}
public void audioPause(boolean p_pause) {
if (p_pause)
mAudioTrack.pause();
else
@@ -449,7 +423,6 @@ public class GodotIO {
/////////////////////////
public int openURI(String p_uri) {
try {
Log.v("MyApp", "TRYING TO OPEN URI: " + p_uri);
String path = p_uri;
@@ -458,7 +431,6 @@ public class GodotIO {
//absolute path to filesystem, prepend file://
path = "file://" + path;
if (p_uri.endsWith(".png") || p_uri.endsWith(".jpg") || p_uri.endsWith(".gif") || p_uri.endsWith(".webp")) {
type = "image/*";
}
}
@@ -474,18 +446,15 @@ public class GodotIO {
activity.startActivity(intent);
return 0;
} catch (ActivityNotFoundException e) {
return 1;
}
}
public String getDataDir() {
return activity.getFilesDir().getAbsolutePath();
}
public String getLocale() {
return Locale.getDefault().toString();
}
@@ -534,9 +503,7 @@ public class GodotIO {
};
public void setScreenOrientation(int p_orientation) {
switch (p_orientation) {
case SCREEN_LANDSCAPE: {
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} break;
@@ -613,7 +580,6 @@ public class GodotIO {
public static final int SYSTEM_DIR_RINGTONES = 7;
public String getSystemDir(int idx) {
String what = "";
switch (idx) {
case SYSTEM_DIR_DESKTOP: {
@@ -658,7 +624,6 @@ public class GodotIO {
public static String unique_id = "";
public String getUniqueID() {
return unique_id;
}
}

View File

@@ -40,7 +40,6 @@ import javax.microedition.khronos.opengles.GL10;
* Wrapper for native library
*/
public class GodotLib {
public static GodotIO io;
static {

View File

@@ -43,7 +43,6 @@ import javax.microedition.khronos.opengles.GL10;
* Godot's renderer implementation.
*/
class GodotRenderer implements GLSurfaceView.Renderer {
private final GodotPluginRegistry pluginRegistry;
private boolean activityJustResumed = false;

View File

@@ -68,7 +68,6 @@ import android.view.MotionEvent;
* bit depths). Failure to do so would result in an EGL_BAD_MATCH error.
*/
public class GodotView extends GLSurfaceView {
private static String TAG = GodotView.class.getSimpleName();
private final Godot godot;
@@ -118,11 +117,9 @@ public class GodotView extends GLSurfaceView {
}
private void init(XRMode xrMode, boolean translucent, int depth, int stencil) {
setPreserveEGLContextOnPause(true);
setFocusableInTouchMode(true);
switch (xrMode) {
case OVR:
// Replace the default egl config chooser.
setEGLConfigChooser(new OvrConfigChooser());

View File

@@ -41,7 +41,6 @@ import android.view.MotionEvent;
* https://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener
*/
public class GodotGestureHandler extends GestureDetector.SimpleOnGestureListener {
private final GodotView godotView;
public GodotGestureHandler(GodotView godotView) {

View File

@@ -58,7 +58,6 @@ import java.util.Set;
* Handles input related events for the {@link GodotView} view.
*/
public class GodotInputHandler implements InputDeviceListener {
private final String tag = this.getClass().getSimpleName();
private final SparseIntArray mJoystickIds = new SparseIntArray(4);

View File

@@ -120,7 +120,6 @@ public interface InputManagerCompat {
* Use this to construct a compatible InputManager.
*/
public static class Factory {
/**
* Constructs and returns a compatible InputManger
*

View File

@@ -29,7 +29,6 @@ import java.util.Map;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public class InputManagerV16 implements InputManagerCompat {
private final InputManager mInputManager;
private final Map<InputManagerCompat.InputDeviceListener, V16InputDeviceListener> mListeners;

View File

@@ -79,7 +79,6 @@ import javax.microedition.khronos.opengles.GL10;
* 'godot/plugin/v1/[PluginName]/'
*/
public abstract class GodotPlugin {
private static final String TAG = GodotPlugin.class.getSimpleName();
private final Godot godot;

View File

@@ -39,7 +39,6 @@ import java.util.Set;
* Provides the set of information expected from a Godot plugin.
*/
public interface GodotPluginInfoProvider {
/**
* Returns the name of the plugin.
*/

View File

@@ -50,7 +50,6 @@ import java.util.concurrent.ConcurrentHashMap;
* Registry used to load and access the registered Godot Android plugins.
*/
public final class GodotPluginRegistry {
private static final String TAG = GodotPluginRegistry.class.getSimpleName();
private static final String GODOT_PLUGIN_V1_NAME_PREFIX = "org.godotengine.plugin.v1.";

View File

@@ -40,7 +40,6 @@ import java.util.Arrays;
* Store information about a {@link GodotPlugin}'s signal.
*/
public final class SignalInfo {
private final String name;
private final Class<?>[] paramTypes;
private final String[] paramTypesNames;

View File

@@ -34,7 +34,6 @@ import java.security.MessageDigest;
import java.util.Random;
public class Crypt {
public static String md5(String input) {
try {
// Create MD5 Hash

View File

@@ -40,7 +40,6 @@ import javax.microedition.khronos.egl.EGLDisplay;
* Contains GL utilities methods.
*/
public class GLUtils {
private static final String TAG = GLUtils.class.getSimpleName();
public static final boolean DEBUG = false;

View File

@@ -41,7 +41,6 @@ import android.util.Log;
* to receive broadcast and multicast packets.
*/
public class GodotNetUtils {
/* A single, reference counted, multicast lock, or null if permission CHANGE_WIFI_MULTICAST_STATE is missing */
private WifiManager.MulticastLock multicastLock;

View File

@@ -48,7 +48,6 @@ import java.util.List;
* @author Cagdas Caglak <cagdascaglak@gmail.com>
*/
public final class PermissionsUtil {
private static final String TAG = PermissionsUtil.class.getSimpleName();
static final int REQUEST_RECORD_AUDIO_PERMISSION = 1;

View File

@@ -41,7 +41,6 @@ import javax.microedition.khronos.egl.EGLDisplay;
* EGL config chooser for the Oculus Mobile VR SDK.
*/
public class OvrConfigChooser implements GLSurfaceView.EGLConfigChooser {
private static final int[] CONFIG_ATTRIBS = {
EGL10.EGL_RED_SIZE, 8,
EGL10.EGL_GREEN_SIZE, 8,

View File

@@ -42,7 +42,6 @@ import javax.microedition.khronos.egl.EGLDisplay;
* EGL Context factory for the Oculus mobile VR SDK.
*/
public class OvrContextFactory implements GLSurfaceView.EGLContextFactory {
private static final int[] CONTEXT_ATTRIBS = {
EGL14.EGL_CONTEXT_CLIENT_VERSION, 3, EGL10.EGL_NONE
};

View File

@@ -41,7 +41,6 @@ import javax.microedition.khronos.egl.EGLSurface;
* EGL window surface factory for the Oculus mobile VR SDK.
*/
public class OvrWindowSurfaceFactory implements GLSurfaceView.EGLWindowSurfaceFactory {
private final static int[] SURFACE_ATTRIBS = {
EGL10.EGL_WIDTH, 16,
EGL10.EGL_HEIGHT, 16,

View File

@@ -42,7 +42,6 @@ import javax.microedition.khronos.egl.EGLDisplay;
* Used to select the egl config for pancake games.
*/
public class RegularConfigChooser implements GLSurfaceView.EGLConfigChooser {
private static final String TAG = RegularConfigChooser.class.getSimpleName();
private int[] mValue = new int[1];
@@ -81,7 +80,6 @@ public class RegularConfigChooser implements GLSurfaceView.EGLConfigChooser {
}
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
/* Get the number of minimally matching EGL configurations
*/
int[] num_config = new int[1];
@@ -136,7 +134,6 @@ public class RegularConfigChooser implements GLSurfaceView.EGLConfigChooser {
private int findConfigAttrib(EGL10 egl, EGLDisplay display,
EGLConfig config, int attribute, int defaultValue) {
if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
return mValue[0];
}

View File

@@ -40,7 +40,6 @@ import javax.microedition.khronos.egl.EGLDisplay;
/* Fallback if 32bit View is not supported*/
public class RegularFallbackConfigChooser extends RegularConfigChooser {
private static final String TAG = RegularFallbackConfigChooser.class.getSimpleName();
private RegularConfigChooser fallback;