RE: MSVC6 compile - WIN98 SE crash -

IMHO, looking at new_gui.cxx, mildly suggests -

NewGUI::init ()
{
#ifdef   FGFS
   SGPath path = globals->get_fg_root();
   path.append("/gui");
   readDir(path.c_str());
#else // !FGFS
    char path[1024];
    ulMakePath(path, getenv("FG_ROOT"), "gui");
    readDir(path);
#endif   // FGFS y/n
}

but i am precipitous in my solution ... also my reading of plib
documentation is the -
    ulDir * dir = ulOpenDir(path);
opens any valid directory. In WIN32 that means a min. of 2,
perhaps called DOT(".") and DOUBLE DOT(".."), and these
can be discarded if you are 'searching' for file(s) to open as xml,
and create a property node of them ...

Thus suggest -
        if (dirEnt->d_isdir && dirEnt->d_name[0] != '.') {
            readDir(subpath);
        } else {
            SGPropertyNode_ptr props = new SGPropertyNode;

should be -

// DISCARD DOT and DOUBLE DOT, also .secret.xml!!!
//        if (dirEnt->d_isdir && dirEnt->d_name[0] != '.') {
        if (dirEnt->d_isdir && dirEnt->d_name[0] == '.') {
           // do nothing with these ...
        }
        else if( !dirEnt->d_isdir ) {    // if NOT just another FOLDER
//            readDir(subpath);
//        } else {    // assume is XML file - go do it.
//     get our xml data, tout suit ...
            SGPropertyNode_ptr props = new SGPropertyNode;

An additional else later could deal with delving into sub-directories
for xml directives, if required, especially if the file 'type' is assumed
to
be the ONLY 'findable' file item in that folder!

Does this mean the plib implemetation yields DIFFERENT results,
depending on the OS running. But that's NOT portable, is it?
But not sure why i, in WIN32, under MSVC6, win98 SE,
should be the first to point this out?

Will wait a bit! That did not solve all problems! It seems -
  ssgState *ovState            ;
is ASSUMED initialize to a 'NULL', while the MSVC compiler
will use an interesting 0xcdcdcdcd Debug value. I note in its creation -
   ssgContext () ;
no effort is made that 'protected' variables are initialized as
desired, yet later code can do -
void ssgContext::forceBasicState ()
{ if ( ! ovCullface )    // it can be <anything>
    glEnable ( GL_CULL_FACE ) ;
  cullFace = TRUE ;
  if ( ovState != NULL ) // any value in a storm!!!
    ovState -> force () ;
  else
    basicState -> force () ;
}

It's too much for day. Will try again tomorrow, maybe ...

Rgds,

Geoff.



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to