]> git.mxchange.org Git - flightgear.git/commitdiff
Patches from Melchior Franz:
authordavid <david>
Tue, 26 Mar 2002 16:10:53 +0000 (16:10 +0000)
committerdavid <david>
Tue, 26 Mar 2002 16:10:53 +0000 (16:10 +0000)
The first hunk might not be necessary, but the light_coverage property
was the only one that wasn't explicitly defaulted, which is unfair.  ;-)
   The second hunk adds the missing initialization to the init routine.
This is necessary, because (unlike the material entries from material.xml)
the generated light entries don't get the light coverage set. Yet
obj.cxx:795 reads this information out fot every leaf, although not needed
in the case of lights. Avoiding this isn't worth the trouble.
   The last hunk sets the missing normal_index. The POINTS branch in
gen_leaf was always called with this int_list empty, which made the normals
handling use data garbage.

src/Objects/newmat.cxx
src/Objects/obj.cxx

index dab03e1ebda06dc851dcea8a5e7ecbb64cc673aa..9d11efa97ef67c2ef8bc934fc4954a95a43a5142 100644 (file)
@@ -119,7 +119,7 @@ FGNewMat::read_properties (const SGPropertyNode * props)
   wrapu = props->getBoolValue("wrapu", true);
   wrapv = props->getBoolValue("wrapv", true);
   mipmap = props->getBoolValue("mipmap", true);
-  light_coverage = props->getDoubleValue("light-coverage");
+  light_coverage = props->getDoubleValue("light-coverage", 0.0);
 
   ambient[0] = props->getDoubleValue("ambient/r", 0.0);
   ambient[1] = props->getDoubleValue("ambient/g", 0.0);
@@ -160,6 +160,7 @@ FGNewMat::init ()
   wrapu = true;
   wrapv = true;
   mipmap = true;
+  light_coverage = 0.0;
   texture_loaded = false;
   refcount = 0;
   for (int i = 0; i < 4; i++)
index 5ad88014a8d5d00d7528dd8dd81d24e2dc28bc60..dba84040c368b00c16116523a64ceb225e26bc46 100644 (file)
@@ -942,6 +942,7 @@ bool fgBinObjLoad( const string& path, const bool is_base,
            material = tmp_mat;
        }
        vertex_index = pts_v[i];
+       normal_index = pts_n[i];
        tex_index.clear();
        ssgLeaf *leaf = gen_leaf( path, GL_POINTS, material,
                                  nodes, normals, texcoords,