|
From: Curtis L. O. <cu...@fl...> - 2001-06-12 15:51:25
|
I did a little diagnostics on this problem and here's what's
happening.
There was a typo in the $fgbase/materials file where an alias was
pointing to a non-existant material name. (This has been fixed.)
The alias code didn't check to see if this condition would occur so it
was putting a 'NULL' entry in the material library which was causing
the crash. It now checks for and skips bad aliases and prints a
warning message.
Curt.
Norman Vine writes:
> Erik Hofman writes:
> >
> >Alex Perry wrote:
> >>
> >> > slot.get_state() returns 0xcccccccc.
> >> > Does slot.get_state() return valid values on Linux/CygWin?
> >> > The first time its called, the value is good, the second time it is
> >> > bad.
> >>
> >> F9 works find under Linux. The terrain textures go away, to bright
> green,
> >> but the sky and panel continue to be textured.
>
> F9 is broken for me on Cygwin also :-(
>
> >I've found the problem.
> >When a texture is an alias it's not initialized properly.
>
> Good Catch !!
>
> >Change FlightGear/src/Objects/matlib.cxx
> >
> >if ( material_name == "alias" ) {
> > string src_mat, dst_mat;
> > in >> dst_mat >> src_mat;
> > SG_LOG( SG_GENERAL, SG_INFO, " Material alias: " << dst_mat <<
> > " mapped to " << src_mat );
> > FGNewMat m = matlib[src_mat];
> >
> > // ADD THIS LINE
> > m.build_ssg_state( GL_FLAT, fgGetBool("/sim/rendering/textures"),
> >false );
> >
> > matlib[dst_mat] = m;
> >} else
> >
> >This seems to be the same problem as i had with :
> >material_lib.load_next_deferred();
> >
> >Where the slot.get_texture_name_c_str() hasn't been initialized to
> >something like "".
>
> Almost ......
>
> It looks like we have a problem with class FGMaterialLib
>
> currently this is
>
> // Material management class
> class FGMaterialLib {
>
> private:
>
> // associative array of materials
> typedef map < string, FGNewMat, less<string> > material_map;
>
> I think inorder for aliases to work we want
>
> typedef FGNewMatPtr FGNewMat *
> typedef map < string, FGNewMatPtr, less<string> > material_map;
>
> or some such
>
> This will require a bit of thought and code restructuring
> but it looks like a showstopper to me the way it is :-((
>
> Curt ???
>
> Norman
>
>
> _______________________________________________
> Flightgear-devel mailing list
> Fli...@li...
> http://lists.sourceforge.net/lists/listinfo/flightgear-devel
--
Curtis Olson Human Factors Research Lab FlightGear Project
Twin Cities cu...@hf... cu...@fl...
Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org
|