Warning clean up in DDSPreview, TexturePanel and WidgetFactory before making an actual change
This commit is contained in:
parent
440009c3ac
commit
f31fee4f9a
@ -56,12 +56,12 @@ import javax.swing.JLabel;
|
||||
*/
|
||||
public class DDSPreview implements SceneListener {
|
||||
|
||||
private ProjectAssetManager assetManager;
|
||||
private final ProjectAssetManager assetManager;
|
||||
private JComponent picPreview;
|
||||
private Geometry quad;
|
||||
private Geometry quad3D;
|
||||
private Material material;
|
||||
private Material material3D;
|
||||
private final Geometry quad;
|
||||
private final Geometry quad3D;
|
||||
private final Material material;
|
||||
private final Material material3D;
|
||||
|
||||
public DDSPreview(ProjectAssetManager assetManager) {
|
||||
this.assetManager = assetManager;
|
||||
@ -95,7 +95,7 @@ public class DDSPreview implements SceneListener {
|
||||
} else if (key.getTextureTypeHint() == Texture.Type.ThreeDimensional) {
|
||||
geom = quad3D;
|
||||
assetManager.deleteFromCache(key);
|
||||
key.setAsTexture3D(true);
|
||||
key.setTextureTypeHint(Texture.Type.ThreeDimensional);
|
||||
t = assetManager.loadTexture(key);
|
||||
material3D.setTexture("Texture", t);
|
||||
geom.setMaterial(material3D);
|
||||
@ -104,7 +104,7 @@ public class DDSPreview implements SceneListener {
|
||||
}
|
||||
} else if (key.getTextureTypeHint() == Texture.Type.CubeMap) {
|
||||
assetManager.deleteFromCache(key);
|
||||
geom = SkyFactory.createSky(assetManager, textureName, false);
|
||||
geom = SkyFactory.createSky(assetManager, textureName, SkyFactory.EnvMapType.CubeMap);
|
||||
if (infoLabel != null) {
|
||||
infoLabel.setText(" " + displayName + " (CubeMap) w : " + t.getImage().getWidth() + " h : " + t.getImage().getHeight());
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ import org.openide.util.ImageUtilities;
|
||||
*/
|
||||
public class TexturePanel extends MaterialPropertyWidget {
|
||||
|
||||
private TexturePropertyEditor editor;
|
||||
private ProjectAssetManager manager;
|
||||
private final TexturePropertyEditor editor;
|
||||
private final ProjectAssetManager manager;
|
||||
private boolean flip = false;
|
||||
private boolean repeat = false;
|
||||
private String textureName = null;
|
||||
@ -58,17 +58,6 @@ public class TexturePanel extends MaterialPropertyWidget {
|
||||
}
|
||||
}
|
||||
|
||||
private String getName(String path) {
|
||||
int idx = path.lastIndexOf("/");
|
||||
if (idx != -1 && path.length() > idx + 1) {
|
||||
path = path.substring(idx + 1, path.length());
|
||||
}
|
||||
if (path.length() > 15) {
|
||||
path = path.substring(0, 15) + "..";
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
private void updateFlipRepeat() {
|
||||
if (flip && repeat) {
|
||||
property.setValue("Flip Repeat " + textureName);
|
||||
|
@ -18,7 +18,7 @@ public class WidgetFactory {
|
||||
|
||||
public static MaterialPropertyWidget getWidget(MaterialProperty prop, ProjectAssetManager manager){
|
||||
MaterialPropertyWidget widget;
|
||||
if(prop.getType().indexOf("Texture")>=0){
|
||||
if(prop.getType().contains("Texture")){
|
||||
widget=new TexturePanel(manager);
|
||||
widget.setProperty(prop);
|
||||
return widget;
|
||||
|
Loading…
x
Reference in New Issue
Block a user