Void Add ( const FixPt &arg, FixPt &result ) const

From FM Plugin Wikipedia
Jump to: navigation, search

FixPt Add

This function allows you to add a given FixPt to another, and store the result in a third FixPt


In the following example, we will add 20 and 5 together, returning 25 in 'result'

// takes an initial 'value1', adds 'value2' to it and stores in 'result'

fmx::FixPtAutoPtr    value1,  value2,  result;

value1->AssignInt( 20 );
value2->AssignInt( 5 );

value1->Add( *value2 ,  *result );



In the next example, we will add 5 to our original value of 20

// takes an initial 'value1' and adds 'value2' to it

fmx::FixPtAutoPtr    value1,  value2;

value1->AssignInt( 20 );
value2->AssignInt( 5 );

value1->Add( *value2 ,  *value1 );