| CameraPane.java | ●●●●● patch | view | raw | blame | history | |
| Composite.java | ●●●●● patch | view | raw | blame | history | |
| Object3D.java | ●●●●● patch | view | raw | blame | history | |
| iCameraPane.java | ●●●●● patch | view | raw | blame | history | 
CameraPane.java
.. .. @@ -7921,6 +7921,64 @@ 7921 7921 ReleaseTexture(pigment, false); 7922 7922 } 7923 7923 7924  + public void ReleasePigmentTexture(cTexture tex) // INTERFACE7925  + {7926  + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)7927  + {7928  + return;7929  + }7930  +7931  + if (tex == null)7932  + {7933  + ReleaseTexture(null, false);7934  + return;7935  + }7936  +7937  + String pigment = Object3D.GetPigment(tex);7938  +7939  + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))7940  + {7941  + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);7942  + // System.out.println("; bump = " + bump);7943  + }7944  +7945  + if (pigment.equals(""))7946  + {7947  + pigment = null;7948  + }7949  +7950  + ReleaseTexture(pigment, false);7951  + }7952  +7953  + public void ReleaseBumpTexture(cTexture tex) // INTERFACE7954  + {7955  + if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)7956  + {7957  + return;7958  + }7959  +7960  + if (tex == null)7961  + {7962  + ReleaseTexture(null, true);7963  + return;7964  + }7965  +7966  + String bump = Object3D.GetBump(tex);7967  +7968  + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))7969  + {7970  + // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);7971  + // System.out.println("; bump = " + bump);7972  + }7973  +7974  + if (bump.equals(""))7975  + {7976  + bump = null;7977  + }7978  +7979  + ReleaseTexture(bump, true);7980  + }7981  +7924 7982 void ReleaseTexture(String tex, boolean bump) 7925 7983 { 7926 7984 if (// DrawMode() != 0 || /*tex == null ||*/ .. .. @@ -8069,6 +8127,73 @@ 8069 8127 return; // true; 8070 8128 } 8071 8129 8130  + /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE8131  + {8132  + if (// DrawMode() != 0 || /*tex == null ||*/8133  + ambientOcclusion ) // || !textureon)8134  + {8135  + return; // false;8136  + }8137  +8138  + if (tex == null)8139  + {8140  + BindTexture(null,false,resolution);8141  + return;8142  + }8143  +8144  + String pigment = Object3D.GetPigment(tex);8145  +8146  + usedtextures.put(pigment, pigment);8147  +8148  + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))8149  + {8150  + // System.out.print("BIND +++++++++++++++ pigment = " + pigment);8151  + // System.out.println("; bump = " + bump);8152  + }8153  +8154  + if (pigment.equals(""))8155  + {8156  + pigment = null;8157  + }8158  +8159  + GetGL().glActiveTexture(GetGL().GL_TEXTURE0);8160  + BindTexture(pigment, false, resolution);8161  + }8162  +8163  + /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE8164  + {8165  + if (// DrawMode() != 0 || /*tex == null ||*/8166  + ambientOcclusion ) // || !textureon)8167  + {8168  + return; // false;8169  + }8170  +8171  + if (tex == null)8172  + {8173  + BindTexture(null,true,resolution);8174  + return;8175  + }8176  +8177  + String bump = Object3D.GetBump(tex);8178  +8179  + usedtextures.put(bump, bump);8180  +8181  + if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))8182  + {8183  + // System.out.print("BIND +++++++++++++++ pigment = " + pigment);8184  + // System.out.println("; bump = " + bump);8185  + }8186  +8187  + if (bump.equals(""))8188  + {8189  + bump = null;8190  + }8191  +8192  + GetGL().glActiveTexture(GetGL().GL_TEXTURE2);8193  + BindTexture(bump, true, resolution);8194  + GetGL().glActiveTexture(GetGL().GL_TEXTURE0);8195  + }8196  +8072 8197 java.util.HashSet<String> missingTextures = new java.util.HashSet<String>(); 8073 8198 8074 8199 private boolean FileExists(String tex) Composite.java
.. .. @@ -867,15 +867,29 @@ 867 867 tex = GetTextures(); 868 868 } 869 869 870  + boolean failedPigment = false;871  + boolean failedBump = false;872  +870 873 try 871 874 { 872  - display.BindTextures(tex, texres);875  + display.BindPigmentTexture(tex, texres);873 876 } 874 877 catch (Exception e) 875 878 { 876 879 System.err.println("FAILED: " + this); 880  + failedPigment = true;877 881 } 878  -882  +883  + try884  + {885  + display.BindBumpTexture(tex, texres);886  + }887  + catch (Exception e)888  + {889  + //System.err.println("FAILED: " + this);890  + failedBump = true;891  + }892  +879 893 if (//true) // new NORMAND 880 894 touched || softtouched) 881 895 { .. .. @@ -937,7 +951,11 @@ 937 951 } 938 952 } 939 953 940  - display.ReleaseTextures(tex);954  + if (!failedBump)955  + display.ReleaseBumpTexture(tex);956  +957  + if (!failedPigment)958  + display.ReleasePigmentTexture(tex);941 959 } 942 960 943 961 void Reset0() Object3D.java
.. .. @@ -4351,6 +4351,55 @@ 4351 4351 } 4352 4352 } 4353 4353 4354  + void RepairSOV()4355  + {4356  + if (blockloop)4357  + return;4358  +4359  + String texname = this.GetPigmentTexture();4360  +4361  + if (texname.startsWith("sov"))4362  + {4363  + String[] s = texname.split("/");4364  +4365  + String[] sname = s[1].split("Color.pn");4366  +4367  + texname = sname[0];4368  +4369  + if (sname.length > 1)4370  + {4371  + texname += "Color.jpg";4372  + }4373  +4374  + this.SetPigmentTexture("sov/" + texname);4375  + }4376  +4377  + texname = this.GetBumpTexture();4378  +4379  + if (texname.startsWith("sov"))4380  + {4381  + String[] s = texname.split("/");4382  +4383  + String[] sname = s[1].split("Bump.pn");4384  +4385  + texname = sname[0];4386  +4387  + if (sname.length > 1)4388  + {4389  + texname += "Bump.jpg";4390  + }4391  +4392  + this.SetBumpTexture("sov/" + texname);4393  + }4394  +4395  + for (int i=0; i<Size(); i++)4396  + {4397  + blockloop = true;4398  + get(i).RepairSOV();4399  + blockloop = false;4400  + }4401  + }4402  +4354 4403 void RepairTexture() 4355 4404 { 4356 4405 if (this instanceof FileObject || blockloop) .. .. @@ -5846,16 +5895,27 @@ 5846 5895 tex = GetTextures(); 5847 5896 } 5848 5897 5849  - boolean failed = false;5898  + boolean failedPigment = false;5899  + boolean failedBump = false;5850 5900 5851 5901 try 5852 5902 { 5853  - display.BindTextures(tex, texres);5903  + display.BindPigmentTexture(tex, texres);5854 5904 } 5855 5905 catch (Exception e) 5856 5906 { 5857 5907 System.err.println("FAILED: " + this); 5858  - failed = true;5908  + failedPigment = true;5909  + }5910  +5911  + try5912  + {5913  + display.BindBumpTexture(tex, texres);5914  + }5915  + catch (Exception e)5916  + {5917  + //System.err.println("FAILED: " + this);5918  + failedBump = true;5859 5919 } 5860 5920 5861 5921 if (!compiled) .. .. @@ -5878,8 +5938,11 @@ 5878 5938 } 5879 5939 } 5880 5940 5881  - if (!failed)5882  - display.ReleaseTextures(tex);5941  + if (!failedBump)5942  + display.ReleaseBumpTexture(tex);5943  +5944  + if (!failedPigment)5945  + display.ReleasePigmentTexture(tex);5883 5946 5884 5947 display.PopMaterial(this, selected); 5885 5948 } iCameraPane.java
.. .. @@ -55,8 +55,12 @@ 55 55 56 56 void DrawString(Object3D obj); 57 57 58  - void BindTextures(cTexture tex, int resolution) throws Exception;59  - void ReleaseTextures(cTexture tex);58  + //void BindTextures(cTexture tex, int resolution) throws Exception;59  + //void ReleaseTextures(cTexture tex);60  + void BindPigmentTexture(cTexture tex, int resolution) throws Exception;61  + void BindBumpTexture(cTexture tex, int resolution) throws Exception;62  + void ReleasePigmentTexture(cTexture tex);63  + void ReleaseBumpTexture(cTexture tex);60 64 61 65 void DrawFace(Object3D obj, Vertex pv, Vertex qv, Vertex rv, Face face); 62 66