Here are some bugs I discovered in the flightgear code:

1) in main.cxx, fgIdleFunction (at the end): fgRequestRedraw() is never called after fgSplashUpdate; therefore the splash screen is not shown before the idle function is set to fgMainLoop.

2) input.cxx, FGInput::doKey (int k, int modifiers, int x, int y):
there are two big bugs that compensate each other:

                                // Key pressed.
  if (modifiers&KEYMOD_RELEASED == 0) {
    SG_LOG( SG_INPUT, SG_DEBUG, "User pressed key " << k
            << " with modifiers " << modifiers );
    if (!b.last_state || b.is_repeatable) {
      ...
    }
  }
                                // Key released.
  else {
    SG_LOG(SG_INPUT, SG_DEBUG, "User released key " << k
           << " with modifiers " << modifiers);
    if (b.last_state) {
      const binding_list_t &bindings =
        _find_key_bindings(k, modifiers);
      ...
    }
  }

modifiers&KEYMOD_RELEASED == 0 evaluates as modifiers&(KEYMOD_RELEASED == 0) and is always false. But it works because b.last_state is initialised to -1 and never changed. So the "key released" part of the function always fire the right events ("key pressed" when modifiers = 0, and "key released" when modifiers = 1).
the second bug in this routine is that (!b.last_state || b.is_repeatable) is always false (last_state==-1 and is_repeatable==0). So if the first bug is corrected, the pressed key events will never be fired...


Olivier A.



_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to