Skip to content

Commit 299cfd8

Browse files
committed
Merge branch '0.9.1'
2 parents 8e4c879 + b37a048 commit 299cfd8

File tree

281 files changed

+9097
-4919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+9097
-4919
lines changed

.idea/artifacts/jme3_spaceshift_extension.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/jme3_spaceshift_extension_sources.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/ronn.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jme3-spaceshift-editor.iml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build-native.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project name="jME SpaceShift Editor" default="do-deploy" basedir="build"
33
xmlns:fx="javafx:com.sun.javafx.tools.ant">
44

5-
<property name="editor.version" value="0.9.0" />
5+
<property name="editor.version" value="0.9.1" />
66

77
<target name="init-fx-tasks">
88
<path id="fxant">
@@ -46,6 +46,13 @@
4646
</fileset>
4747
</copy>
4848

49+
<copy todir="externalLibs/extensions/simsilica">
50+
<fileset dir="../libs/extensions/simsilica" >
51+
<include name="**/*sources*"/>
52+
<include name="**/*javadoc*"/>
53+
</fileset>
54+
</copy>
55+
4956
<copy todir="externalLibs/extensions/toneg0d">
5057
<fileset dir="../libs/extensions/toneg0d" >
5158
<include name="**/*sources*"/>
@@ -111,6 +118,9 @@
111118
<fileset dir="build/libs/extensions/toneg0d">
112119
<include name="*"/>
113120
</fileset>
121+
<fileset dir="build/libs/extensions/simsilica">
122+
<include name="*"/>
123+
</fileset>
114124
</classpath>
115125
</javac>
116126

@@ -175,6 +185,12 @@
175185
</fileset>
176186
</copy>
177187

188+
<copy todir="dist/libs/extensions/simsilica">
189+
<fileset dir="externalLibs/extensions/simsilica">
190+
<include name="*"/>
191+
</fileset>
192+
</copy>
193+
178194
<fx:resources id="appRes">
179195
<fx:fileset dir="dist" includes="jme3-spaceshift-editor.jar"/>
180196
<fx:fileset dir="dist" includes="libs/*"/>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
<orderEntry type="module-library">
11+
<library>
12+
<CLASSES>
13+
<root url="file://$MODULE_DIR$/../libs/jME" />
14+
</CLASSES>
15+
<JAVADOC />
16+
<SOURCES>
17+
<root url="file://$MODULE_DIR$/../libs/jME" />
18+
</SOURCES>
19+
<jarDirectory url="file://$MODULE_DIR$/../libs/jME" recursive="false" />
20+
<jarDirectory url="file://$MODULE_DIR$/../libs/jME" recursive="false" type="SOURCES" />
21+
</library>
22+
</orderEntry>
23+
<orderEntry type="module-library">
24+
<library>
25+
<CLASSES>
26+
<root url="file://$MODULE_DIR$/../libs/extensions/simsilica" />
27+
</CLASSES>
28+
<JAVADOC />
29+
<SOURCES>
30+
<root url="file://$MODULE_DIR$/../libs/extensions/simsilica" />
31+
</SOURCES>
32+
<jarDirectory url="file://$MODULE_DIR$/../libs/extensions/simsilica" recursive="false" />
33+
<jarDirectory url="file://$MODULE_DIR$/../libs/extensions/simsilica" recursive="false" type="SOURCES" />
34+
</library>
35+
</orderEntry>
36+
<orderEntry type="module-library">
37+
<library>
38+
<CLASSES>
39+
<root url="file://$MODULE_DIR$/../libs/extensions" />
40+
</CLASSES>
41+
<JAVADOC />
42+
<SOURCES>
43+
<root url="file://$MODULE_DIR$/../libs/extensions" />
44+
</SOURCES>
45+
<jarDirectory url="file://$MODULE_DIR$/../libs/extensions" recursive="false" />
46+
<jarDirectory url="file://$MODULE_DIR$/../libs/extensions" recursive="false" type="SOURCES" />
47+
</library>
48+
</orderEntry>
49+
</component>
50+
</module>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package com.ss.extension.loader;
2+
3+
import com.jme3.app.Application;
4+
import com.jme3.asset.AssetInfo;
5+
import com.jme3.asset.AssetManager;
6+
import com.jme3.export.InputCapsule;
7+
import com.jme3.export.JmeImporter;
8+
import com.jme3.export.Savable;
9+
import com.jme3.export.binary.BinaryImporter;
10+
11+
import org.jetbrains.annotations.NotNull;
12+
13+
import java.io.IOException;
14+
15+
/**
16+
* The implementation of jME Importer to load scenes.
17+
*
18+
* @author JavaSaBr
19+
*/
20+
public class SceneLoader implements JmeImporter {
21+
22+
/**
23+
* The application.
24+
*/
25+
private static Application application;
26+
27+
/**
28+
* Install a scene loader to the asset manager.
29+
*
30+
* @param application the application.
31+
*/
32+
public static void install(@NotNull final Application application) {
33+
final AssetManager assetManager = application.getAssetManager();
34+
assetManager.unregisterLoader(BinaryImporter.class);
35+
assetManager.registerLoader(SceneLoader.class, "j3o", "j3f", "j3s");
36+
}
37+
38+
@NotNull
39+
private final BinaryImporter importer;
40+
41+
/**
42+
* The application.
43+
*/
44+
@NotNull
45+
private final Application app;
46+
47+
public SceneLoader() {
48+
importer = new BinaryImporter();
49+
app = SceneLoader.application;
50+
}
51+
52+
@Override
53+
public InputCapsule getCapsule(final Savable id) {
54+
return importer.getCapsule(id);
55+
}
56+
57+
@Override
58+
public AssetManager getAssetManager() {
59+
return importer.getAssetManager();
60+
}
61+
62+
@Override
63+
public int getFormatVersion() {
64+
return importer.getFormatVersion();
65+
}
66+
67+
@Override
68+
public Object load(@NotNull final AssetInfo assetInfo) throws IOException {
69+
return importer.load(assetInfo);
70+
}
71+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
package com.ss.extension.scene;
2+
3+
import com.jme3.export.InputCapsule;
4+
import com.jme3.export.JmeExporter;
5+
import com.jme3.export.JmeImporter;
6+
import com.jme3.export.OutputCapsule;
7+
import com.jme3.scene.Node;
8+
import com.jme3.util.clone.Cloner;
9+
10+
import org.jetbrains.annotations.NotNull;
11+
import org.jetbrains.annotations.Nullable;
12+
13+
import java.io.IOException;
14+
import java.util.Objects;
15+
16+
/**
17+
* The implementation of a scene layer.
18+
*
19+
* @author JavaSaBr
20+
*/
21+
public class SceneLayer extends Node {
22+
23+
/**
24+
* The parent scene node.
25+
*/
26+
@Nullable
27+
private SceneNode sceneNode;
28+
29+
/**
30+
* The flag that layer is builtin.
31+
*/
32+
private boolean builtIn;
33+
34+
/**
35+
* The flag of showing this layer.
36+
*/
37+
private boolean showed;
38+
39+
public SceneLayer() {
40+
super("Empty layer");
41+
}
42+
43+
public SceneLayer(@NotNull final String name, final boolean builtIn) {
44+
super(name);
45+
this.builtIn = builtIn;
46+
}
47+
48+
/**
49+
* @return true if this layer is built in.
50+
*/
51+
public boolean isBuiltIn() {
52+
return builtIn;
53+
}
54+
55+
/**
56+
* @param builtIn true if this layer is built in.
57+
*/
58+
public void setBuiltIn(final boolean builtIn) {
59+
this.builtIn = builtIn;
60+
}
61+
62+
/**
63+
* @param showed the flag of showing this layer.
64+
*/
65+
protected void setShowed(final boolean showed) {
66+
this.showed = showed;
67+
}
68+
69+
/**
70+
* @return true if this layer is showed.
71+
*/
72+
public boolean isShowed() {
73+
return showed;
74+
}
75+
76+
/**
77+
* @param sceneNode The parent scene node.
78+
*/
79+
public void setSceneNode(@Nullable final SceneNode sceneNode) {
80+
this.sceneNode = sceneNode;
81+
}
82+
83+
/**
84+
* @return the parent scene node.
85+
*/
86+
@NotNull
87+
public SceneNode getSceneNode() {
88+
return Objects.requireNonNull(sceneNode);
89+
}
90+
91+
/**
92+
* Hide this layer.
93+
*/
94+
public void hide() {
95+
if (!isShowed()) return;
96+
removeFromParent();
97+
setShowed(false);
98+
}
99+
100+
/**
101+
* Show this layer.
102+
*/
103+
public void show() {
104+
if (isShowed()) return;
105+
getSceneNode().attachChild(this);
106+
setShowed(true);
107+
}
108+
109+
@Override
110+
public void write(@NotNull final JmeExporter exporter) throws IOException {
111+
super.write(exporter);
112+
113+
final OutputCapsule capsule = exporter.getCapsule(this);
114+
capsule.write(isShowed(), "showed", false);
115+
capsule.write(isBuiltIn(), "builtIn", false);
116+
}
117+
118+
@Override
119+
public void read(@NotNull final JmeImporter importer) throws IOException {
120+
super.read(importer);
121+
122+
final InputCapsule capsule = importer.getCapsule(this);
123+
setShowed(capsule.readBoolean("showed", false));
124+
setBuiltIn(capsule.readBoolean("builtIn", false));
125+
}
126+
127+
@Override
128+
public void cloneFields(@NotNull final Cloner cloner, @NotNull final Object original) {
129+
super.cloneFields(cloner, original);
130+
131+
sceneNode = cloner.clone(sceneNode);
132+
}
133+
}

0 commit comments

Comments
 (0)