Skip to content

Commit

Permalink
delete useless fields and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Mar 22, 2021
1 parent feffbdb commit d6638e0
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 84 deletions.
Expand Up @@ -63,7 +63,6 @@
public class AndroidJoystickJoyInput14 {
private static final Logger logger = Logger.getLogger(AndroidJoystickJoyInput14.class.getName());

private boolean loaded = false;
private AndroidJoyInput joyInput;
private Map<Integer, AndroidJoystick> joystickIndex = new HashMap<>();

Expand Down Expand Up @@ -173,8 +172,6 @@ public List<Joystick> loadJoysticks(int joyId, InputManager inputManager) {
}
}


loaded = true;
return joysticks;
}

Expand Down
Expand Up @@ -69,7 +69,6 @@ public class AndroidTouchInput implements TouchInput {
private boolean mouseEventsInvertX = false;
private boolean mouseEventsInvertY = false;
private boolean keyboardEventsEnabled = false;
private boolean dontSendHistory = false;

protected int numPointers = 0;
final private HashMap<Integer, Vector2f> lastPositions = new HashMap<>();
Expand Down Expand Up @@ -162,7 +161,7 @@ public boolean onTouch(MotionEvent event) {
boolean bWasHandled = false;
TouchEvent touch = null;
// System.out.println("native : " + event.getAction());
int action = getAction(event);
getAction(event);

This comment has been minimized.

Copy link
@Ali-RS

Ali-RS Mar 23, 2021

Member

@stephengold should this line be removed as well?

This comment has been minimized.

Copy link
@stephengold

stephengold Mar 23, 2021

Author Member

Yes, unless it has side effects.

int pointerIndex = getPointerIndex(event);
int pointerId = getPointerId(event);
Vector2f lastPos = lastPositions.get(pointerId);
Expand Down Expand Up @@ -469,7 +468,7 @@ public boolean isSimulateKeyboard() {

@Override
public void setOmitHistoricEvents(boolean dontSendHistory) {
this.dontSendHistory = dontSendHistory;
// not implemented
}

}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2019 jMonkeyEngine
* Copyright (c) 2018-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -91,10 +91,6 @@ public class DacLinks
* local copy of {@link com.jme3.math.Transform#IDENTITY}
*/
final private static Transform transformIdentity = new Transform();
/**
* local copy of {@link com.jme3.math.Vector3f#ZERO}
*/
final private static Vector3f translateIdentity = new Vector3f(0f, 0f, 0f);
// *************************************************************************
// fields

Expand Down
3 changes: 1 addition & 2 deletions jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java
Expand Up @@ -80,7 +80,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
private int newHeight = 1;
private AtomicBoolean reshapeNeeded = new AtomicBoolean(false);
private final Object lock = new Object();
private AppProfiler prof;

public AwtPanel(PaintMode paintMode) {
this(paintMode, false);
Expand Down Expand Up @@ -338,6 +337,6 @@ public void cleanup() {

@Override
public void setProfiler(AppProfiler profiler) {
this.prof = profiler;
// not implemented
}
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -51,7 +51,6 @@ public class ReflectionProcessor implements SceneProcessor {
private Camera reflectionCam;
private FrameBuffer reflectionBuffer;
private Plane reflectionClipPlane;
private AppProfiler prof;

/**
* Creates a ReflectionProcessor
Expand Down Expand Up @@ -111,7 +110,6 @@ public void cleanup() {

@Override
public void setProfiler(AppProfiler profiler) {
this.prof = profiler;
}

/**
Expand Down
Expand Up @@ -22,7 +22,6 @@ public class IosInputHandler implements TouchInput {
private boolean mouseEventsInvertX = false;
private boolean mouseEventsInvertY = false;
private boolean keyboardEventsEnabled = false;
private boolean dontSendHistory = false;

// Internal
private boolean initialized = false;
Expand Down Expand Up @@ -114,7 +113,7 @@ public boolean isSimulateKeyboard() {

@Override
public void setOmitHistoricEvents(boolean dontSendHistory) {
this.dontSendHistory = dontSendHistory;
// not implemented
}

// ----------------
Expand Down
Expand Up @@ -53,7 +53,6 @@ public class CachedOggStream implements PhysicalOggStream {

private boolean closed = false;
private boolean eos = false;
private boolean bos = false;
private InputStream sourceStream;
private HashMap<Integer, LogicalOggStream> logicalStreams
= new HashMap<>();
Expand Down Expand Up @@ -130,9 +129,7 @@ private int readOggNextPage() throws IOException {
return -1;

OggPage op = OggPage.create(sourceStream);
if (!op.isBos()){
bos = true;
}
op.isBos();

This comment has been minimized.

Copy link
@Ali-RS

Ali-RS Mar 23, 2021

Member

@stephengold should this line be removed as well?

This comment has been minimized.

Copy link
@stephengold

stephengold Mar 23, 2021

Author Member

Yes, unless it has side effects.

if (op.isEos()){
eos = true;
lastPage = op;
Expand Down
Expand Up @@ -55,8 +55,6 @@ public class LwjglMouseInput implements MouseInput {
private LwjglAbstractDisplay context;

private RawInputListener listener;

private boolean supportHardwareCursor = false;
private boolean cursorVisible = true;

/**
Expand All @@ -79,7 +77,7 @@ public void initialize() {
try {
Mouse.create();
logger.fine("Mouse created.");
supportHardwareCursor = (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0;
Cursor.getCapabilities();

This comment has been minimized.

Copy link
@Ali-RS

Ali-RS Mar 23, 2021

Member

@stephengold should this line be removed as well?

This comment has been minimized.

Copy link
@stephengold

stephengold Mar 23, 2021

Author Member

Yes, unless it has side effects.


// Recall state that was set before initialization
Mouse.setGrabbed(!cursorVisible);
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -130,7 +130,6 @@ private static ByteBuffer transformCursorImage(final IntBuffer imageData, final
private int mouseX;
private int mouseY;
private int mouseWheel;
private int currentWidth;
private int currentHeight;

private boolean cursorVisible;
Expand Down Expand Up @@ -209,7 +208,7 @@ private void initCallbacks() {

glfwGetWindowSize(window, width, height);

currentWidth = width.get();
width.get();

This comment has been minimized.

Copy link
@Ali-RS

Ali-RS Mar 23, 2021

Member

@stephengold should this line be removed as well?

This comment has been minimized.

Copy link
@stephengold

stephengold Mar 23, 2021

Author Member

Yes, unless it has side effects.

currentHeight = height.get();
}

Expand Down Expand Up @@ -239,7 +238,6 @@ public void invoke(final long window, final int button, final int action, final
@Override
public void invoke(final long window, final int width, final int height) {
currentHeight = height;
currentWidth = width;
}
});
}
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -53,12 +53,6 @@ public class UdpConnector implements Connector
private byte[] buffer = new byte[65535];
private AtomicBoolean connected = new AtomicBoolean(false);

/**
* In order to provide proper available() checking, we
* potentially queue one datagram.
*/
private DatagramPacket pending;

/**
* Creates a new UDP connection that send datagrams to the
* specified address and port.
Expand Down
Expand Up @@ -64,7 +64,6 @@ public abstract class Serializer {
private static final List<SerializerRegistration> registrations = new ArrayList<SerializerRegistration>();

private static final Serializer fieldSerializer = new FieldSerializer();
private static final Serializer serializableSerializer = new SerializableSerializer();
private static final Serializer arraySerializer = new ArraySerializer();

private static short nextAvailableId = -2; // historically the first ID was always -2
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2018 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -70,7 +70,6 @@ public class NiftyJmeDisplay implements SceneProcessor {
protected ResourceLocationJme resourceLocation;

protected int w, h;
private AppProfiler prof;

protected class ResourceLocationJme implements ResourceLocation {

Expand Down Expand Up @@ -372,7 +371,7 @@ public void cleanup() {

@Override
public void setProfiler(AppProfiler profiler) {
this.prof = profiler;
// not implemented
}

}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2015 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -53,15 +53,9 @@ private static enum AlphaSource {
FromTextureIntensity;
}

private String type;
private FbxImage media;

// TODO: not currently used.
private AlphaSource alphaSource = AlphaSource.FromTextureAlpha;
private String uvSet;
private int wrapModeU = 0, wrapModeV = 0;
private final Vector2f uvTranslation = new Vector2f(0, 0);
private final Vector2f uvScaling = new Vector2f(1, 1);

public FbxTexture(AssetManager assetManager, String sceneFolderName) {
super(assetManager, sceneFolderName);
Expand Down Expand Up @@ -105,7 +99,7 @@ public void fromElement(FbxElement element) {
if (getSubclassName().equals("")) {
for (FbxElement e : element.children) {
if (e.id.equals("Type")) {
type = (String) e.properties.get(0);
e.properties.get(0);

This comment has been minimized.

Copy link
@Ali-RS

Ali-RS Mar 23, 2021

Member

@stephengold should this line be removed as well?

This comment has been minimized.

Copy link
@stephengold

stephengold Mar 23, 2021

Author Member

Yes, unless it has side effects.

}
/*else if (e.id.equals("FileName")) {
filename = (String) e.properties.get(0);
Expand Down
Expand Up @@ -60,7 +60,6 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
private static final Logger logger = Logger.getLogger(FbxMesh.class.getName());

private FbxPolygon[] polygons;
private int[] edges;
private FbxLayerElement[] layerElements;
private Vector3f[] positions;
private FbxLayer[] layers;
Expand Down Expand Up @@ -167,7 +166,6 @@ private void setPositions(double[] positions) {
}

private void setEdges(int[] edges) {
this.edges = edges;
// TODO: ...
}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -42,17 +42,15 @@
*/
public class GlbLoader extends GltfLoader {

private static final int GLTF_MAGIC = 0x46546C67;
private static final int JSON_TYPE = 0x4E4F534A;
private static final int BIN_TYPE = 0x004E4942;
private ArrayList<byte[]> data = new ArrayList<>();

@Override
public Object load(AssetInfo assetInfo) throws IOException {
data.clear();
LittleEndien stream = new LittleEndien(new DataInputStream(assetInfo.openStream()));
int magic = stream.readInt();
int version = stream.readInt();
/* magic */ stream.readInt();
/* version */ stream.readInt();
int length = stream.readInt();

byte[] json = null;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -93,10 +93,6 @@ public class GltfLoader implements AssetLoader {
private static Map<String, MaterialAdapter> defaultMaterialAdapters = new HashMap<>();
private CustomContentManager customContentManager = new CustomContentManager();
private boolean useNormalsFlag = false;
private Quaternion tmpQuat = new Quaternion();
private Transform tmpTransforms = new Transform();
private Transform tmpTransforms2 = new Transform();
private Matrix4f tmpMat = new Matrix4f();

Map<SkinData, List<Spatial>> skinnedSpatials = new HashMap<>();
IntMap<SkinBuffers> skinBuffers = new IntMap<>();
Expand Down Expand Up @@ -128,7 +124,7 @@ protected Object loadFromStream(AssetInfo assetInfo, InputStream stream) throws
docRoot = new JsonParser().parse(new JsonReader(new InputStreamReader(stream))).getAsJsonObject();

JsonObject asset = docRoot.getAsJsonObject().get("asset").getAsJsonObject();
String generator = getAsString(asset, "generator");
getAsString(asset, "generator");

This comment has been minimized.

Copy link
@Ali-RS

Ali-RS Mar 23, 2021

Member

@stephengold should this line be removed as well?

This comment has been minimized.

Copy link
@stephengold

stephengold Mar 23, 2021

Author Member

Yes, unless it has side effects.

String version = getAsString(asset, "version");
String minVersion = getAsString(asset, "minVersion");
if (!isSupported(version, minVersion)) {
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -52,7 +52,6 @@ public class AssetTileLoader implements TerrainGridTileLoader {
private AssetManager manager;
private String assetPath;
private String name;
private int size;
private int patchSize;
private int quadSize;

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -55,9 +55,6 @@ public class ImageTileLoader implements TerrainGridTileLoader{
private final Namer namer;
private int patchSize;
private int quadSize;
private float heightScale = 1;
//private int imageType = BufferedImage.TYPE_USHORT_GRAY; // 16 bit grayscale
//private ImageHeightmap customImageHeightmap;

public ImageTileLoader(final String textureBase, final String textureExt, AssetManager assetManager) {
this(assetManager, new Namer() {
Expand All @@ -78,7 +75,7 @@ public ImageTileLoader(AssetManager assetManager, Namer namer) {
* Affects the vertical scale of the terrain when loaded.
*/
public void setHeightScale(float heightScale) {
this.heightScale = heightScale;
// not implemented
}


Expand Down

0 comments on commit d6638e0

Please sign in to comment.