Normand Briere
2019-06-17 e36047725ce3217618d4e5807ac7c8769b9e3598
Object3D.java
....@@ -4351,6 +4351,55 @@
43514351 }
43524352 }
43534353
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
+
43544403 void RepairTexture()
43554404 {
43564405 if (this instanceof FileObject || blockloop)
....@@ -5673,10 +5722,12 @@
56735722 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
56745723
56755724 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5676
- (touched || (bRep != null && bRep.displaylist <= 0)))
5725
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5726
+ (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0)))
56775727 {
56785728 Globals.lighttouched = true;
56795729 } // all panes...
5730
+
56805731 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56815732 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56825733 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5844,16 +5895,27 @@
58445895 tex = GetTextures();
58455896 }
58465897
5847
- boolean failed = false;
5898
+ boolean failedPigment = false;
5899
+ boolean failedBump = false;
58485900
58495901 try
58505902 {
5851
- display.BindTextures(tex, texres);
5903
+ display.BindPigmentTexture(tex, texres);
58525904 }
58535905 catch (Exception e)
58545906 {
58555907 System.err.println("FAILED: " + this);
5856
- failed = true;
5908
+ failedPigment = true;
5909
+ }
5910
+
5911
+ try
5912
+ {
5913
+ display.BindBumpTexture(tex, texres);
5914
+ }
5915
+ catch (Exception e)
5916
+ {
5917
+ //System.err.println("FAILED: " + this);
5918
+ failedBump = true;
58575919 }
58585920
58595921 if (!compiled)
....@@ -5876,8 +5938,11 @@
58765938 }
58775939 }
58785940
5879
- if (!failed)
5880
- display.ReleaseTextures(tex);
5941
+ if (!failedBump)
5942
+ display.ReleaseBumpTexture(tex);
5943
+
5944
+ if (!failedPigment)
5945
+ display.ReleasePigmentTexture(tex);
58815946
58825947 display.PopMaterial(this, selected);
58835948 }
....@@ -7102,7 +7167,7 @@
71027167 spot.translate(32, 32);
71037168 spotw = spot.x + spot.width;
71047169 spoth = spot.y + spot.height;
7105
- info.g.setColor(Color.blue);
7170
+ info.g.setColor(Color.cyan);
71067171 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
71077172 // if (CameraPane.Xmin > spot.x)
71087173 // {
....@@ -7120,11 +7185,12 @@
71207185 // {
71217186 // CameraPane.Ymax = spoth;
71227187 // }
7123
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7124
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7188
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7189
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
71257190 spot.translate(0, -32);
7126
- info.g.setColor(Color.green);
7191
+ info.g.setColor(Color.yellow);
71277192 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7193
+ info.g.setColor(Color.green);
71287194 // if (CameraPane.Xmin > spot.x)
71297195 // {
71307196 // CameraPane.Xmin = spot.x;
....@@ -7442,19 +7508,20 @@
74427508 switch (info.pane.RenderCamera().viewCode)
74437509 {
74447510 case 3: // '\001'
7445
- if (modified)
7511
+ if (modified || opposite)
74467512 {
74477513 //LA.matScale(toParent, 1, hScale, vScale);
74487514 LA.matScale(toParent, totalScale, 1, 1);
74497515 } // vScale, 1);
74507516 else
74517517 {
7518
+ // EXCEPTION!
74527519 LA.matScale(toParent, totalScale, totalScale, totalScale);
74537520 } // vScale, 1);
74547521 break;
74557522
74567523 case 2: // '\002'
7457
- if (modified)
7524
+ if (modified || opposite)
74587525 {
74597526 //LA.matScale(toParent, hScale, 1, vScale);
74607527 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7465,7 +7532,7 @@
74657532 break;
74667533
74677534 case 1: // '\003'
7468
- if (modified)
7535
+ if (modified || opposite)
74697536 {
74707537 //LA.matScale(toParent, hScale, vScale, 1);
74717538 LA.matScale(toParent, 1, 1, totalScale);