.. | .. |
---|
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()); |
---|
.. | .. |
---|
460 | 466 | importOBJItem.addActionListener(this); |
---|
461 | 467 | import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
462 | 468 | import3DSItem.addActionListener(this); |
---|
| 469 | + if (Globals.ADVANCED) |
---|
| 470 | + { |
---|
463 | 471 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
464 | 472 | importVRMLX3DItem.addActionListener(this); |
---|
| 473 | + } |
---|
465 | 474 | menu.add("-"); |
---|
466 | 475 | importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
467 | 476 | importGFDItem.addActionListener(this); |
---|
.. | .. |
---|
1786 | 1795 | cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
1787 | 1796 | creditsPanel.setName("Credits"); |
---|
1788 | 1797 | |
---|
1789 | | - cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1798 | + cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
1790 | 1799 | creditsPanel.add(ogaLabel); |
---|
1791 | 1800 | |
---|
1792 | | - cButton opengameartButton; |
---|
1793 | | - creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
1794 | | - opengameartButton.setToolTipText("https://opengameart.org"); |
---|
| 1801 | + cButton creditButton; |
---|
| 1802 | + creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1803 | + creditButton.setToolTipText("https://opengameart.org"); |
---|
1795 | 1804 | |
---|
1796 | | - opengameartButton.addMouseListener(new MouseAdapter() |
---|
| 1805 | + creditButton.addMouseListener(new MouseAdapter() |
---|
1797 | 1806 | { |
---|
1798 | 1807 | public void mouseClicked(MouseEvent e) |
---|
1799 | 1808 | { |
---|
.. | .. |
---|
1808 | 1817 | } |
---|
1809 | 1818 | }); |
---|
1810 | 1819 | |
---|
1811 | | - for (int i=10; --i>=0;) |
---|
| 1820 | + ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF); |
---|
| 1821 | + creditsPanel.add(ogaLabel); |
---|
| 1822 | + |
---|
| 1823 | + creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF)); |
---|
| 1824 | + creditButton.setToolTipText("https://3delicious.net"); |
---|
| 1825 | + |
---|
| 1826 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1827 | + { |
---|
| 1828 | + public void mouseClicked(MouseEvent e) |
---|
| 1829 | + { |
---|
| 1830 | + try |
---|
| 1831 | + { |
---|
| 1832 | + Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net")); |
---|
| 1833 | + } catch (Exception e1) |
---|
| 1834 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1835 | + { |
---|
| 1836 | + e1.printStackTrace(); |
---|
| 1837 | + } |
---|
| 1838 | + } |
---|
| 1839 | + }); |
---|
| 1840 | + |
---|
| 1841 | + creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF)); |
---|
| 1842 | + creditButton.setToolTipText("https://archive3d.net"); |
---|
| 1843 | + |
---|
| 1844 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1845 | + { |
---|
| 1846 | + public void mouseClicked(MouseEvent e) |
---|
| 1847 | + { |
---|
| 1848 | + try |
---|
| 1849 | + { |
---|
| 1850 | + Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net")); |
---|
| 1851 | + } catch (Exception e1) |
---|
| 1852 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1853 | + { |
---|
| 1854 | + e1.printStackTrace(); |
---|
| 1855 | + } |
---|
| 1856 | + } |
---|
| 1857 | + }); |
---|
| 1858 | + |
---|
| 1859 | + creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF)); |
---|
| 1860 | + creditButton.setToolTipText("https://turbosquid.com"); |
---|
| 1861 | + |
---|
| 1862 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1863 | + { |
---|
| 1864 | + public void mouseClicked(MouseEvent e) |
---|
| 1865 | + { |
---|
| 1866 | + try |
---|
| 1867 | + { |
---|
| 1868 | + Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free")); |
---|
| 1869 | + } catch (Exception e1) |
---|
| 1870 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1871 | + { |
---|
| 1872 | + e1.printStackTrace(); |
---|
| 1873 | + } |
---|
| 1874 | + } |
---|
| 1875 | + }); |
---|
| 1876 | + |
---|
| 1877 | + for (int i=6; --i>=0;) |
---|
1812 | 1878 | { |
---|
1813 | 1879 | creditsPanel.add(new cGridBag()); |
---|
1814 | 1880 | } |
---|
.. | .. |
---|
2616 | 2682 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
2617 | 2683 | colorSection.add(backlit); |
---|
2618 | 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 | + |
---|
2619 | 2691 | //panel.add(new JSeparator()); |
---|
2620 | 2692 | |
---|
2621 | 2693 | //panel.add(globalSection); |
---|
.. | .. |
---|
3667 | 3739 | shadowField.setFloat(mat.shadow); |
---|
3668 | 3740 | textureField.setFloat(mat.texture); |
---|
3669 | 3741 | opacityField.setFloat(mat.opacity); |
---|
| 3742 | + parallaxField.setFloat(mat.parallax + 0.25f); |
---|
3670 | 3743 | fakedepthField.setFloat(mat.fakedepth); |
---|
3671 | 3744 | shadowbiasField.setFloat(mat.shadowbias); |
---|
3672 | 3745 | bumpField.setInteger(1); // dec 2013 |
---|
.. | .. |
---|
4891 | 4964 | current.shadow = (float) shadowField.getFloat(); |
---|
4892 | 4965 | current.texture = (float) textureField.getFloat(); |
---|
4893 | 4966 | current.opacity = (float) opacityField.getFloat(); |
---|
| 4967 | + current.parallax = (float) parallaxField.getFloat() - 0.25f; |
---|
4894 | 4968 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4895 | 4969 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4896 | 4970 | |
---|
.. | .. |
---|
4945 | 5019 | textureField.SetToolTipValue((mat.texture)); |
---|
4946 | 5020 | if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
4947 | 5021 | opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5022 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5023 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
4948 | 5024 | if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
4949 | 5025 | fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4950 | 5026 | if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
.. | .. |
---|
6201 | 6277 | cNumberSlider textureField; |
---|
6202 | 6278 | JLabel opacityLabel; |
---|
6203 | 6279 | cNumberSlider opacityField; |
---|
| 6280 | + JLabel parallaxLabel; |
---|
| 6281 | + cNumberSlider parallaxField; |
---|
6204 | 6282 | JLabel fakedepthLabel; |
---|
6205 | 6283 | cNumberSlider fakedepthField; |
---|
6206 | 6284 | JLabel shadowbiasLabel; |
---|