Normand Briere
2019-08-20 564f4d12d93813b5d680fc24d4f118c3886d96ed
ObjEditor.java
....@@ -134,8 +134,14 @@
134134
135135 try
136136 {
137
- BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
138
-
137
+ BufferedImage image;
138
+
139
+ if (name.endsWith("jpg"))
140
+ // Much faster!
141
+ image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage();
142
+ else
143
+ image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
144
+
139145 // if (image.getWidth() > 48 && image.getHeight() > 48)
140146 // {
141147 // BufferedImage resized = new BufferedImage(48, 48, image.getType());
....@@ -2676,6 +2682,12 @@
26762682 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
26772683 colorSection.add(backlit);
26782684
2685
+ cGridBag parallax = new cGridBag();
2686
+ parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints);
2687
+ parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2688
+ parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.5, -0.25)); // , aConstraints);
2689
+ colorSection.add(parallax);
2690
+
26792691 //panel.add(new JSeparator());
26802692
26812693 //panel.add(globalSection);
....@@ -3727,6 +3739,7 @@
37273739 shadowField.setFloat(mat.shadow);
37283740 textureField.setFloat(mat.texture);
37293741 opacityField.setFloat(mat.opacity);
3742
+ parallaxField.setFloat(mat.parallax + 0.25f);
37303743 fakedepthField.setFloat(mat.fakedepth);
37313744 shadowbiasField.setFloat(mat.shadowbias);
37323745 bumpField.setInteger(1); // dec 2013
....@@ -4951,6 +4964,7 @@
49514964 current.shadow = (float) shadowField.getFloat();
49524965 current.texture = (float) textureField.getFloat();
49534966 current.opacity = (float) opacityField.getFloat();
4967
+ current.parallax = (float) parallaxField.getFloat() - 0.25f;
49544968 current.fakedepth = (float) fakedepthField.getFloat();
49554969 current.shadowbias = (float) shadowbiasField.getFloat();
49564970
....@@ -5005,6 +5019,8 @@
50055019 textureField.SetToolTipValue((mat.texture));
50065020 if (!Equal(opacityField.getFloat(), mat.opacity))
50075021 opacityField.SetToolTipValue((mat.opacity));
5022
+ //if (!Equal(parallaxField.getFloat(), mat.parallax))
5023
+ parallaxField.SetToolTipValue((mat.parallax));
50085024 if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
50095025 fakedepthField.SetToolTipValue((mat.fakedepth));
50105026 if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
....@@ -6261,6 +6277,8 @@
62616277 cNumberSlider textureField;
62626278 JLabel opacityLabel;
62636279 cNumberSlider opacityField;
6280
+ JLabel parallaxLabel;
6281
+ cNumberSlider parallaxField;
62646282 JLabel fakedepthLabel;
62656283 cNumberSlider fakedepthField;
62666284 JLabel shadowbiasLabel;