Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 12, 2008, 10:53:51 PM (17 years ago)
Author:
landauf
Message:
  • added feature to add a callback function to configvalues. they get called if the value changes. an examples is in Core.cc.
  • changed the SetConfigValue macro and the Identifier::updateConfigValues() function to work properly with inherited classes in both possible cases: 1) they overwrite the config-value or 2) they don't. an example is ParticleProjectile that defines it's own speed_ configvalue.
Location:
code/branches/core3/src/core/input
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/core/input/InputManager.cc

    r1586 r1596  
    340340          getIdentifier()->addConfigValueContainer("CoeffPos", cont);
    341341      }
    342       cont->getValue(&coeffPos);
     342      cont->getValue(&coeffPos, this);
    343343
    344344      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
     
    348348          getIdentifier()->addConfigValueContainer("CoeffNeg", cont);
    349349      }
    350       cont->getValue(&coeffNeg);
     350      cont->getValue(&coeffNeg, this);
    351351
    352352      cont = getIdentifier()->getConfigValueContainer("Zero");
     
    356356          getIdentifier()->addConfigValueContainer("Zero", cont);
    357357      }
    358       cont->getValue(&zero);
     358      cont->getValue(&zero, this);
    359359
    360360      // copy values to our own variables
  • code/branches/core3/src/core/input/KeyBinder.cc

    r1586 r1596  
    234234  void KeyBinder::setConfigValues()
    235235  {
    236     SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.05f)  .description("Threshold for analog axes until which the state is 0.");
    237     SetConfigValueGeneric(KeyBinder, mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
    238     SetConfigValueGeneric(KeyBinder, bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
    239     SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.05f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
    240     SetConfigValueGeneric(KeyBinder, mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
    241     SetConfigValueGeneric(KeyBinder, bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
     236    SetConfigValue(/*Generic(KeyBinder, */analogThreshold_, 0.05f)  .description("Threshold for analog axes until which the state is 0.");
     237    SetConfigValue(/*Generic(KeyBinder, */mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
     238    SetConfigValue(/*Generic(KeyBinder, */bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
     239    SetConfigValue(/*Generic(KeyBinder, */derivePeriod_, 0.05f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
     240    SetConfigValue(/*Generic(KeyBinder, */mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
     241    SetConfigValue(/*Generic(KeyBinder, */bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
    242242
    243243    float oldThresh = buttonThreshold_;
    244     SetConfigValueGeneric(KeyBinder, buttonThreshold_, 0.80f).description("Threshold for analog axes until which the button is not pressed.");
     244    SetConfigValue(/*Generic(KeyBinder, */buttonThreshold_, 0.80f).description("Threshold for analog axes until which the button is not pressed.");
    245245    if (oldThresh != buttonThreshold_)
    246246      for (unsigned int i = 0; i < nHalfAxes_s; i++)
     
    272272    }
    273273    std::string old = button.bindingString_;
    274     cont->getValue(&button.bindingString_);
     274    cont->getValue(&button.bindingString_, this);
    275275
    276276    // keybinder stuff
Note: See TracChangeset for help on using the changeset viewer.