.. | .. |
---|
134 | 134 | |
---|
135 | 135 | try |
---|
136 | 136 | { |
---|
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 | + |
---|
139 | 145 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
140 | 146 | // { |
---|
141 | 147 | // BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
.. | .. |
---|
2676 | 2682 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
2677 | 2683 | colorSection.add(backlit); |
---|
2678 | 2684 | |
---|
| 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 | + |
---|
2679 | 2691 | //panel.add(new JSeparator()); |
---|
2680 | 2692 | |
---|
2681 | 2693 | //panel.add(globalSection); |
---|
.. | .. |
---|
3727 | 3739 | shadowField.setFloat(mat.shadow); |
---|
3728 | 3740 | textureField.setFloat(mat.texture); |
---|
3729 | 3741 | opacityField.setFloat(mat.opacity); |
---|
| 3742 | + parallaxField.setFloat(mat.parallax + 0.25f); |
---|
3730 | 3743 | fakedepthField.setFloat(mat.fakedepth); |
---|
3731 | 3744 | shadowbiasField.setFloat(mat.shadowbias); |
---|
3732 | 3745 | bumpField.setInteger(1); // dec 2013 |
---|
.. | .. |
---|
4951 | 4964 | current.shadow = (float) shadowField.getFloat(); |
---|
4952 | 4965 | current.texture = (float) textureField.getFloat(); |
---|
4953 | 4966 | current.opacity = (float) opacityField.getFloat(); |
---|
| 4967 | + current.parallax = (float) parallaxField.getFloat() - 0.25f; |
---|
4954 | 4968 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4955 | 4969 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4956 | 4970 | |
---|
.. | .. |
---|
5005 | 5019 | textureField.SetToolTipValue((mat.texture)); |
---|
5006 | 5020 | if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
5007 | 5021 | opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5022 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5023 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
5008 | 5024 | if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
5009 | 5025 | fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
5010 | 5026 | if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
.. | .. |
---|
6261 | 6277 | cNumberSlider textureField; |
---|
6262 | 6278 | JLabel opacityLabel; |
---|
6263 | 6279 | cNumberSlider opacityField; |
---|
| 6280 | + JLabel parallaxLabel; |
---|
| 6281 | + cNumberSlider parallaxField; |
---|
6264 | 6282 | JLabel fakedepthLabel; |
---|
6265 | 6283 | cNumberSlider fakedepthField; |
---|
6266 | 6284 | JLabel shadowbiasLabel; |
---|