Skip to content

Commit fafe8a7

Browse files
Grabli66stephengold
authored andcommitted
Fixes error of loading assets
1 parent efc1962 commit fafe8a7

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

jme3-examples/src/main/java/jme3test/bullet/TestQ3.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,18 @@ public class TestQ3 extends SimpleApplication implements ActionListener {
6161
private static boolean useHttp = false;
6262
private boolean left=false,right=false,up=false,down=false;
6363

64-
public static void main(String[] args) {
65-
File file = new File("quake3level.zip");
66-
if (!file.exists()) {
67-
useHttp = true;
68-
}
64+
public static void main(String[] args) {
6965
TestQ3 app = new TestQ3();
7066
app.start();
7167
}
7268

7369
@Override
7470
public void simpleInitApp() {
71+
File file = new File("quake3level.zip");
72+
if (!file.exists()) {
73+
useHttp = true;
74+
}
75+
7576
bulletAppState = new BulletAppState();
7677
stateManager.attach(bulletAppState);
7778
flyCam.setMoveSpeed(100);

jme3-examples/src/main/java/jme3test/post/TestMultiplesFilters.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ public class TestMultiplesFilters extends SimpleApplication {
5454

5555
private static boolean useHttp = false;
5656

57-
public static void main(String[] args) {
58-
File file = new File("wildhouse.zip");
59-
if (!file.exists()) {
60-
useHttp = true;
61-
}
57+
public static void main(String[] args) {
6258
TestMultiplesFilters app = new TestMultiplesFilters();
6359
app.start();
6460
}
@@ -68,6 +64,11 @@ public static void main(String[] args) {
6864

6965
@Override
7066
public void simpleInitApp() {
67+
File file = new File("wildhouse.zip");
68+
if (!file.exists()) {
69+
useHttp = true;
70+
}
71+
7172
this.flyCam.setMoveSpeed(10);
7273
cam.setLocation(new Vector3f(6.0344796f, 1.5054002f, 55.572033f));
7374
cam.setRotation(new Quaternion(0.0016069f, 0.9810479f, -0.008143323f, 0.19358753f));

jme3-examples/src/main/java/jme3test/scene/TestSceneLoading.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,18 @@ public void simpleUpdate(float tpf){
6464

6565
@Override
6666
public void simpleInitApp() {
67+
File file = new File("wildhouse.zip");
68+
if (!file.exists()) {
69+
useHttp = true;
70+
}
71+
6772
this.flyCam.setMoveSpeed(10);
6873

6974
// load sky
7075
rootNode.attachChild(SkyFactory.createSky(assetManager,
7176
"Textures/Sky/Bright/BrightSky.dds",
7277
SkyFactory.EnvMapType.CubeMap));
73-
74-
File file = new File("wildhouse.zip");
75-
if (!file.exists()) {
76-
useHttp = true;
77-
}
78+
7879
// create the geometry and attach it
7980
// load the level from zip or http zip
8081
if (useHttp) {

jme3-examples/src/main/java/jme3test/water/TestPostWaterLake.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,18 @@ public class TestPostWaterLake extends SimpleApplication {
4949

5050
private static boolean useHttp = false;
5151

52-
public static void main(String[] args) {
53-
File file = new File("wildhouse.zip");
54-
if (!file.exists()) {
55-
useHttp = true;
56-
}
52+
public static void main(String[] args) {
5753
TestPostWaterLake app = new TestPostWaterLake();
5854
app.start();
5955
}
6056

6157
@Override
6258
public void simpleInitApp() {
59+
File file = new File("wildhouse.zip");
60+
if (!file.exists()) {
61+
useHttp = true;
62+
}
63+
6364
this.flyCam.setMoveSpeed(10);
6465
cam.setLocation(new Vector3f(-27.0f, 1.0f, 75.0f));
6566
// cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f));
@@ -68,12 +69,7 @@ public void simpleInitApp() {
6869
rootNode.attachChild(SkyFactory.createSky(assetManager,
6970
"Textures/Sky/Bright/BrightSky.dds",
7071
SkyFactory.EnvMapType.CubeMap));
71-
72-
File file = new File("wildhouse.zip");
7372

74-
if (file.exists()) {
75-
useHttp = false;
76-
}
7773
// create the geometry and attach it
7874
// load the level from zip or http zip
7975
if (useHttp) {

jme3-examples/src/main/java/jme3test/water/TestSceneWater.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
public class TestSceneWater extends SimpleApplication {
5252

5353
// set default for applets
54-
private static boolean useHttp = true;
54+
private static boolean useHttp = false;
5555

5656
public static void main(String[] args) {
5757

@@ -61,6 +61,11 @@ public static void main(String[] args) {
6161

6262
@Override
6363
public void simpleInitApp() {
64+
File file = new File("wildhouse.zip");
65+
if (!file.exists()) {
66+
useHttp = true;
67+
}
68+
6469
this.flyCam.setMoveSpeed(10);
6570
Node mainScene=new Node();
6671
cam.setLocation(new Vector3f(-27.0f, 1.0f, 75.0f));
@@ -71,11 +76,7 @@ public void simpleInitApp() {
7176
"Textures/Sky/Bright/BrightSky.dds",
7277
SkyFactory.EnvMapType.CubeMap));
7378

74-
75-
File file = new File("wildhouse.zip");
76-
if (file.exists()) {
77-
useHttp = false;
78-
}
79+
7980
// create the geometry and attach it
8081
// load the level from zip or http zip
8182
if (useHttp) {

0 commit comments

Comments
 (0)