1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "nel/misc/progress_callback.h"
20 #include "nel/misc/debug.h"
29 float IProgressCallback::getCropedValue (float value
) const
31 nlassert (_CropedValues
.size ()>0);
32 const CCropedValues
&values
= _CropedValues
.back ();
33 return value
*(values
.Max
-values
.Min
)+values
.Min
;
36 IProgressCallback::IProgressCallback ()
38 _CropedValues
.push_back (CCropedValues (0, 1));
41 void IProgressCallback::pushCropedValues (float min
, float max
)
43 nlassert (_CropedValues
.size ()>0);
44 //const CCropedValues &values = _CropedValues.back ();
45 _CropedValues
.push_back (CCropedValues (getCropedValue (min
), getCropedValue (max
)));
48 void IProgressCallback::popCropedValues ()
50 nlassert (_CropedValues
.size ()>1);
51 _CropedValues
.pop_back ();
54 void IProgressCallback::progress (float /* progressValue */)