From 235841e01f5bceaacf4726ea840a40c452fce000 Mon Sep 17 00:00:00 2001 From: spx Date: Wed, 19 Jan 2011 15:31:45 +0000 Subject: [PATCH] Added AutoScale=2 and "k" postfix to Meter=STRING. ---- For instance: A=2800000000, B=0 - AutoScale=0 AutoScale is disabled. Uses Scale value. (Same as before.) A="2800000000", B="0" - AutoScale=1 Scales value by 1024. (Same as before.) A="2.6 G", B="0.0 " - AutoScale=2 Scales value by 1000. A="2.8 G", B="0.0 " - AutoScale=1k Scales value by 1024, and uses kilo as the lowest unit. A="2.6 G", B="0.0 k" - AutoScale=2k Scales value by 1000, and uses kilo as the lowest unit. A="2.8 G", B="0.0 k" ---- --- Library/AboutDialog.cpp | 4 +-- Library/ConfigParser.cpp | 2 +- Library/Measure.cpp | 49 +++++++++++++++++++++++--------- Library/Measure.h | 16 +++++++++-- Library/MeasureDiskSpace.cpp | 2 +- Library/MeasureDiskSpace.h | 2 +- Library/MeasurePlugin.cpp | 2 +- Library/MeasurePlugin.h | 2 +- Library/MeasureRegistry.cpp | 2 +- Library/MeasureRegistry.h | 2 +- Library/MeasureScript.cpp | 2 +- Library/MeasureScript.h | 2 +- Library/MeasureTime.cpp | 2 +- Library/MeasureTime.h | 2 +- Library/MeasureUptime.cpp | 2 +- Library/MeasureUptime.h | 2 +- Library/Meter.cpp | 4 +-- Library/MeterImage.cpp | 4 +-- Library/MeterString.cpp | 23 +++++++++++++-- Library/MeterString.h | 3 +- Library/MeterWindow.cpp | 2 +- Library/Rainmeter.cpp | 2 +- Library/lua/glue/lua_measure.cpp | 6 ++-- Library/lua/glue/lua_measure.h | 2 +- 24 files changed, 97 insertions(+), 44 deletions(-) diff --git a/Library/AboutDialog.cpp b/Library/AboutDialog.cpp index 2de26983..37a4ec26 100644 --- a/Library/AboutDialog.cpp +++ b/Library/AboutDialog.cpp @@ -204,10 +204,10 @@ void UpdateAboutStatistics(LPCTSTR entryName) WCHAR buffer[256]; double minVal = (*i)->GetMinValue(); double maxVal = (*i)->GetMaxValue(); - CMeasure::GetScaledValue(1, minVal, buffer, _countof(buffer)); + CMeasure::GetScaledValue(AUTOSCALE_ON, 1, minVal, buffer, _countof(buffer)); std::wstring range = buffer; range += L" - "; - CMeasure::GetScaledValue(1, maxVal, buffer, _countof(buffer)); + CMeasure::GetScaledValue(AUTOSCALE_ON, 1, maxVal, buffer, _countof(buffer)); range += buffer; if (name && *name) diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index 636cfd5c..4e558957 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -530,7 +530,7 @@ bool CConfigParser::ReplaceMeasures(std::wstring& result) CMeasure* measure = GetMeasure(var); if (measure) { - std::wstring value = measure->GetStringValue(false, 1, -1, false); + std::wstring value = measure->GetStringValue(AUTOSCALE_OFF, 1, -1, false); // Measure found, replace it with the value result.replace(result.begin() + pos, result.begin() + end + 1, value); diff --git a/Library/Measure.cpp b/Library/Measure.cpp index 2da2f5a5..df4765b1 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -38,6 +38,27 @@ #include "Error.h" #include "Litestep.h" +enum AUTOSCALE_INDEX +{ + AUTOSCALE_INDEX_1024 = 0, + AUTOSCALE_INDEX_1000 = 1 +}; + +static const double g_TblScale[2][4] = { + { + 1024.0 * 1024.0 * 1024.0 * 1024.0, + 1024.0 * 1024.0 * 1024.0, + 1024.0 * 1024.0, + 1024.0 + }, + { + 1000.0 * 1000.0 * 1000.0 * 1000.0, + 1000.0 * 1000.0 * 1000.0, + 1000.0 * 1000.0, + 1000.0 + } +}; + const int MEDIAN_SIZE = 7; extern CRainmeter* Rainmeter; @@ -500,7 +521,7 @@ double CMeasure::GetValueRange() ** decimals Number of decimals used in the value. If -1, get rid of ".00000" for dynamic variables. ** percentual Return the value as % from the maximum value. */ -const WCHAR* CMeasure::GetStringValue(bool autoScale, double scale, int decimals, bool percentual) +const WCHAR* CMeasure::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual) { static WCHAR buffer[MAX_LINE_LENGTH]; WCHAR format[32]; @@ -519,9 +540,9 @@ const WCHAR* CMeasure::GetStringValue(bool autoScale, double scale, int decimals _snwprintf_s(buffer, _TRUNCATE, format, val); } } - else if(autoScale) + else if(autoScale != AUTOSCALE_OFF) { - GetScaledValue(decimals, GetValue(), buffer, _countof(buffer)); + GetScaledValue(autoScale, decimals, GetValue(), buffer, _countof(buffer)); } else { @@ -552,7 +573,7 @@ const WCHAR* CMeasure::GetStringValue(bool autoScale, double scale, int decimals return CheckSubstitute(buffer); } -void CMeasure::GetScaledValue(int decimals, double theValue, WCHAR* buffer, size_t sizeInWords) +void CMeasure::GetScaledValue(AUTOSCALE autoScale, int decimals, double theValue, WCHAR* buffer, size_t sizeInWords) { WCHAR format[32]; double value = 0; @@ -566,25 +587,27 @@ void CMeasure::GetScaledValue(int decimals, double theValue, WCHAR* buffer, size _snwprintf_s(format, _TRUNCATE, L"%%.%if", decimals); } - if(theValue > 1000.0 * 1000.0 * 1000.0 * 1000.0) + int index = (autoScale == AUTOSCALE_1000 || autoScale == AUTOSCALE_1000K) ? AUTOSCALE_INDEX_1000 : AUTOSCALE_INDEX_1024; + + if(theValue > (g_TblScale[index][0] * 0.99)) { wcsncat_s(format, L" T", _TRUNCATE); - value = theValue / (1024.0 * 1024.0 * 1024.0 * 1024.0); + value = theValue / g_TblScale[index][0]; } - else if(theValue > 1000.0 * 1000.0 * 1000.0) + else if(theValue > (g_TblScale[index][1] * 0.99)) { wcsncat_s(format, L" G", _TRUNCATE); - value = theValue / (1024.0 * 1024.0 * 1024.0); + value = theValue / g_TblScale[index][1]; } - else if(theValue > 1000.0 * 1000.0) + else if(theValue > (g_TblScale[index][2] * 0.99)) { wcsncat_s(format, L" M", _TRUNCATE); - value = theValue / (1024.0 * 1024.0); + value = theValue / g_TblScale[index][2]; } - else if(theValue > 1000.0) + else if(autoScale == AUTOSCALE_1024K || autoScale == AUTOSCALE_1000K || theValue > (g_TblScale[index][3] * 0.99)) { wcsncat_s(format, L" k", _TRUNCATE); - value = theValue / 1024.0; + value = theValue / g_TblScale[index][3]; } else { @@ -604,7 +627,7 @@ const WCHAR* CMeasure::GetStats() { static std::wstring value; - value = GetStringValue(true, 1, 1, false); + value = GetStringValue(AUTOSCALE_ON, 1, 1, false); return value.c_str(); } diff --git a/Library/Measure.h b/Library/Measure.h index 9d4764bf..2b5c6200 100644 --- a/Library/Measure.h +++ b/Library/Measure.h @@ -23,6 +23,18 @@ #include "Litestep.h" #include "Group.h" +enum AUTOSCALE +{ + AUTOSCALE_1024 = 1, // scales by 1024 + AUTOSCALE_1000 = 2, // scales by 1000 + + AUTOSCALE_1024K = 101, // scales by 1024, and uses kilo as the lowest unit + AUTOSCALE_1000K = 102, // scales by 1000, and uses kilo as the lowest unit + + AUTOSCALE_OFF = 0, + AUTOSCALE_ON = AUTOSCALE_1024 +}; + class CMeter; class CMeasure : public CGroup @@ -59,8 +71,8 @@ public: int GetUpdateCounter() { return m_UpdateCounter; } int GetUpdateDivider() { return m_UpdateDivider; } - virtual const WCHAR* GetStringValue(bool autoScale, double scale, int decimals, bool percentual); - static void GetScaledValue(int decimals, double theValue, WCHAR* buffer, size_t sizeInWords); + virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual); + static void GetScaledValue(AUTOSCALE autoScale, int decimals, double theValue, WCHAR* buffer, size_t sizeInWords); static CMeasure* Create(const WCHAR* measure, CMeterWindow* meterWindow); diff --git a/Library/MeasureDiskSpace.cpp b/Library/MeasureDiskSpace.cpp index c81e6fed..9763e020 100644 --- a/Library/MeasureDiskSpace.cpp +++ b/Library/MeasureDiskSpace.cpp @@ -127,7 +127,7 @@ bool CMeasureDiskSpace::Update() ** Returns the time as string. ** */ -const WCHAR* CMeasureDiskSpace::GetStringValue(bool autoScale, double scale, int decimals, bool percentual) +const WCHAR* CMeasureDiskSpace::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual) { if (m_Label) { diff --git a/Library/MeasureDiskSpace.h b/Library/MeasureDiskSpace.h index 541c9e6b..0ebe1b90 100644 --- a/Library/MeasureDiskSpace.h +++ b/Library/MeasureDiskSpace.h @@ -29,7 +29,7 @@ public: virtual void ReadConfig(CConfigParser& parser, const WCHAR* section); virtual bool Update(); - virtual const WCHAR* GetStringValue(bool autoScale, double scale, int decimals, bool percentual); + virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual); private: std::wstring m_Drive; diff --git a/Library/MeasurePlugin.cpp b/Library/MeasurePlugin.cpp index 70934d9f..069ba628 100644 --- a/Library/MeasurePlugin.cpp +++ b/Library/MeasurePlugin.cpp @@ -220,7 +220,7 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section) ** Gets the string value from the plugin. ** */ -const WCHAR* CMeasurePlugin::GetStringValue(bool autoScale, double scale, int decimals, bool percentual) +const WCHAR* CMeasurePlugin::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual) { if(GetStringFunc) { diff --git a/Library/MeasurePlugin.h b/Library/MeasurePlugin.h index 7aa2bd60..fe745e6a 100644 --- a/Library/MeasurePlugin.h +++ b/Library/MeasurePlugin.h @@ -36,7 +36,7 @@ public: virtual void ReadConfig(CConfigParser& parser, const WCHAR* section); virtual bool Update(); - virtual const WCHAR* GetStringValue(bool autoScale, double scale, int decimals, bool percentual); + virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual); virtual void ExecuteBang(const WCHAR* args); private: diff --git a/Library/MeasureRegistry.cpp b/Library/MeasureRegistry.cpp index 0f99b33f..d6f6b6a1 100644 --- a/Library/MeasureRegistry.cpp +++ b/Library/MeasureRegistry.cpp @@ -177,7 +177,7 @@ void CMeasureRegistry::ReadConfig(CConfigParser& parser, const WCHAR* section) ** value to string as normal. ** */ -const WCHAR* CMeasureRegistry::GetStringValue(bool autoScale, double scale, int decimals, bool percentual) +const WCHAR* CMeasureRegistry::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual) { if (m_StringValue.empty()) { diff --git a/Library/MeasureRegistry.h b/Library/MeasureRegistry.h index ce2fe8be..73ee3eb5 100644 --- a/Library/MeasureRegistry.h +++ b/Library/MeasureRegistry.h @@ -29,7 +29,7 @@ public: virtual void ReadConfig(CConfigParser& parser, const WCHAR* section); virtual bool Update(); - virtual const WCHAR* GetStringValue(bool autoScale, double scale, int decimals, bool percentual); + virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual); private: std::wstring m_RegKeyName; diff --git a/Library/MeasureScript.cpp b/Library/MeasureScript.cpp index 31edc1ff..2e6e7e16 100644 --- a/Library/MeasureScript.cpp +++ b/Library/MeasureScript.cpp @@ -81,7 +81,7 @@ void CMeasureScript::SetValue(double d) ** decimals Number of decimals used in the value. ** percentual Return the value as % from the maximum value. */ -const WCHAR* CMeasureScript::GetStringValue(bool autoScale, double scale, int decimals, bool percentual) +const WCHAR* CMeasureScript::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual) { if (m_bGetStringValueDefined && m_pLuaScript->IsInitialized() ) diff --git a/Library/MeasureScript.h b/Library/MeasureScript.h index 6f1d9e93..5a47a588 100644 --- a/Library/MeasureScript.h +++ b/Library/MeasureScript.h @@ -23,7 +23,7 @@ public: void SetValue(double d); - virtual const WCHAR* GetStringValue(bool autoScale, double scale, int decimals, bool percentual); + virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual); void MeterMouseEvent(CMeter* p_pMeter, MOUSE p_eMouse); void RunFunctionWithMeter(const char* p_strFunction, CMeter* p_pMeter); diff --git a/Library/MeasureTime.cpp b/Library/MeasureTime.cpp index 6f8cf3a0..e10028c3 100644 --- a/Library/MeasureTime.cpp +++ b/Library/MeasureTime.cpp @@ -168,7 +168,7 @@ bool CMeasureTime::Update() ** Returns the time as string. ** */ -const WCHAR* CMeasureTime::GetStringValue(bool autoScale, double scale, int decimals, bool percentual) +const WCHAR* CMeasureTime::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual) { static WCHAR tmpSz[MAX_LINE_LENGTH]; struct tm today; diff --git a/Library/MeasureTime.h b/Library/MeasureTime.h index e412cce5..acf83f66 100644 --- a/Library/MeasureTime.h +++ b/Library/MeasureTime.h @@ -29,7 +29,7 @@ public: virtual void ReadConfig(CConfigParser& parser, const WCHAR* section); virtual bool Update(); - virtual const WCHAR* GetStringValue(bool autoScale, double scale, int decimals, bool percentual); + virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual); private: void TimeToString(WCHAR* buf, size_t bufLen, const WCHAR* format, const struct tm* time); diff --git a/Library/MeasureUptime.cpp b/Library/MeasureUptime.cpp index 108ddebd..bcd489c8 100644 --- a/Library/MeasureUptime.cpp +++ b/Library/MeasureUptime.cpp @@ -75,7 +75,7 @@ bool CMeasureUptime::Update() ** Returns the uptime as string. ** */ -const WCHAR* CMeasureUptime::GetStringValue(bool autoScale, double scale, int decimals, bool percentual) +const WCHAR* CMeasureUptime::GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual) { static WCHAR buffer[MAX_LINE_LENGTH]; diff --git a/Library/MeasureUptime.h b/Library/MeasureUptime.h index a479f8c5..66938e33 100644 --- a/Library/MeasureUptime.h +++ b/Library/MeasureUptime.h @@ -28,7 +28,7 @@ public: virtual ~CMeasureUptime(); virtual bool Update(); - virtual const WCHAR* GetStringValue(bool autoScale, double scale, int decimals, bool percentual); + virtual const WCHAR* GetStringValue(AUTOSCALE autoScale, double scale, int decimals, bool percentual); virtual void ReadConfig(CConfigParser& parser, const WCHAR* section); private: diff --git a/Library/Meter.cpp b/Library/Meter.cpp index 145307a9..d9eee503 100644 --- a/Library/Meter.cpp +++ b/Library/Meter.cpp @@ -649,12 +649,12 @@ void CMeter::ReplaceToolTipMeasures(std::wstring& str) // Get the values for the measures for (size_t i = 0; i < m_AllMeasures.size(); ++i) { - stringValues.push_back(m_AllMeasures[i]->GetStringValue(true, 1, 0, false)); + stringValues.push_back(m_AllMeasures[i]->GetStringValue(AUTOSCALE_ON, 1, 0, false)); } } else if (m_Measure != NULL) { - stringValues.push_back(m_Measure->GetStringValue(true, 1, 0, false)); + stringValues.push_back(m_Measure->GetStringValue(AUTOSCALE_ON, 1, 0, false)); } else { diff --git a/Library/MeterImage.cpp b/Library/MeterImage.cpp index c1b13ca5..cc366b19 100644 --- a/Library/MeterImage.cpp +++ b/Library/MeterImage.cpp @@ -182,7 +182,7 @@ bool CMeterImage::Update() if (m_Measure) // read from the measures { - std::wstring val = m_Measure->GetStringValue(false, 1, 0, false); + std::wstring val = m_Measure->GetStringValue(AUTOSCALE_OFF, 1, 0, false); if (m_ImageName.empty()) { @@ -197,7 +197,7 @@ bool CMeterImage::Update() // Get the values for the other measures for (size_t i = 0; i < m_Measures.size(); ++i) { - stringValues.push_back(m_Measures[i]->GetStringValue(false, 1, 0, false)); + stringValues.push_back(m_Measures[i]->GetStringValue(AUTOSCALE_OFF, 1, 0, false)); } m_ImageNameResult = m_ImageName; diff --git a/Library/MeterString.cpp b/Library/MeterString.cpp index 73931f4a..cfc9acd3 100644 --- a/Library/MeterString.cpp +++ b/Library/MeterString.cpp @@ -71,7 +71,7 @@ CMeterString::CMeterString(CMeterWindow* meterWindow) : CMeter(meterWindow), m_EffectColor(Color::Black) { m_Effect = EFFECT_NONE; - m_AutoScale = true; + m_AutoScale = AUTOSCALE_OFF; m_Align = ALIGN_LEFT; m_Font = NULL; m_FontFamily = NULL; @@ -315,7 +315,6 @@ void CMeterString::ReadConfig(const WCHAR* section) m_Text = parser.ReadString(section, L"Text", L""); m_Percentual = 0!=parser.ReadInt(section, L"Percentual", 0); - m_AutoScale = 0!=parser.ReadInt(section, L"AutoScale", 0); m_ClipString = 0!=parser.ReadInt(section, L"ClipString", 0); m_FontFace = parser.ReadString(section, L"FontFace", L"Arial"); @@ -334,6 +333,24 @@ void CMeterString::ReadConfig(const WCHAR* section) m_Angle = (Gdiplus::REAL)parser.ReadFloat(section, L"Angle", 0.0); + std::wstring autoscale = parser.ReadString(section, L"AutoScale", L"0"); + int autoscaleValue = _wtoi(autoscale.c_str()); + if (autoscaleValue == 0) + { + m_AutoScale = AUTOSCALE_OFF; + } + else + { + if (autoscale.find_last_of(L"kK") == std::wstring::npos) + { + m_AutoScale = (autoscaleValue == 2) ? AUTOSCALE_1000 : AUTOSCALE_1024; + } + else + { + m_AutoScale = (autoscaleValue == 2) ? AUTOSCALE_1000K : AUTOSCALE_1024K; + } + } + std::wstring scale = parser.ReadString(section, L"Scale", L"1"); if (scale.find(L'.') == std::wstring::npos) { @@ -467,7 +484,7 @@ bool CMeterString::Update() { std::vector stringValues; - int decimals = (m_NumOfDecimals != -1) ? m_NumOfDecimals : (m_NoDecimals && (m_Percentual || !m_AutoScale)) ? 0 : 1; + int decimals = (m_NumOfDecimals != -1) ? m_NumOfDecimals : (m_NoDecimals && (m_Percentual || m_AutoScale == AUTOSCALE_OFF)) ? 0 : 1; if (m_Measure) stringValues.push_back(m_Measure->GetStringValue(m_AutoScale, m_Scale, decimals, m_Percentual)); diff --git a/Library/MeterString.h b/Library/MeterString.h index 0fb7cba4..5cb04d09 100644 --- a/Library/MeterString.h +++ b/Library/MeterString.h @@ -21,6 +21,7 @@ #include "Meter.h" #include "MeterWindow.h" +#include "Measure.h" namespace Gdiplus { @@ -78,7 +79,7 @@ private: std::wstring m_Prefix; // The prefix of the text std::wstring m_Text; // The text std::wstring m_FontFace; // name of the font face - bool m_AutoScale; // true, if the value should be autoscaled + AUTOSCALE m_AutoScale; // true, if the value should be autoscaled METER_ALIGNMENT m_Align; // Alignment of the text TEXTSTYLE m_Style; // Style of the text TEXTEFFECT m_Effect; // Text effect diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index a1c2f24f..84ae7324 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -2730,7 +2730,7 @@ void CMeterWindow::Update(bool nodraw) // std::list::iterator i = m_Measures.begin(); // for( ; i != m_Measures.end(); i++) // { -// const char* sz = (*i)->GetStringValue(true, 1, 1, false); +// const char* sz = (*i)->GetStringValue(AUTOSCALE_ON, 1, 1, false); // if (sz && wcslen(sz) > 0) // { // WCHAR* wideSz = CMeter::ConvertToWide(sz); diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index def3468a..a4d42ee2 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -3068,7 +3068,7 @@ std::wstring CRainmeter::ParseCommand(const WCHAR* command, CMeterWindow* meterW { if (_wcsicmp((*iter)->GetName(), measureName.c_str()) == 0) { - std::wstring value = (*iter)->GetStringValue(false, 1, -1, false); + std::wstring value = (*iter)->GetStringValue(AUTOSCALE_OFF, 1, -1, false); strCommand.replace(start, (end - start) + 1, value); start += value.length(); break; diff --git a/Library/lua/glue/lua_measure.cpp b/Library/lua/glue/lua_measure.cpp index 7747be63..cda79724 100644 --- a/Library/lua/glue/lua_measure.cpp +++ b/Library/lua/glue/lua_measure.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: measure -** Generated automatically by tolua++-1.0.92 on 11/23/10 00:33:48. +** Generated automatically by tolua++-1.0.92 on 01/19/11 04:59:42. */ #ifndef __cplusplus @@ -451,7 +451,7 @@ static int tolua_measure_CMeasure_GetStringValue00(lua_State* tolua_S) tolua_Error tolua_err; if ( !tolua_isusertype(tolua_S,1,"CMeasure",0,&tolua_err) || - !tolua_isboolean(tolua_S,2,1,&tolua_err) || + !tolua_isnumber(tolua_S,2,1,&tolua_err) || !tolua_isnumber(tolua_S,3,1,&tolua_err) || !tolua_isnumber(tolua_S,4,1,&tolua_err) || !tolua_isboolean(tolua_S,5,1,&tolua_err) || @@ -462,7 +462,7 @@ static int tolua_measure_CMeasure_GetStringValue00(lua_State* tolua_S) #endif { CMeasure* self = (CMeasure*) tolua_tousertype(tolua_S,1,0); - bool autoScale = ((bool) tolua_toboolean(tolua_S,2,false)); + AUTOSCALE autoScale = ((AUTOSCALE) (int) tolua_tonumber(tolua_S,2,0)); double scale = ((double) tolua_tonumber(tolua_S,3,1.0)); int decimals = ((int) tolua_tonumber(tolua_S,4,0)); bool percentual = ((bool) tolua_toboolean(tolua_S,5,false)); diff --git a/Library/lua/glue/lua_measure.h b/Library/lua/glue/lua_measure.h index af16d78f..92c8db75 100644 --- a/Library/lua/glue/lua_measure.h +++ b/Library/lua/glue/lua_measure.h @@ -1,6 +1,6 @@ /* ** Lua binding: measure -** Generated automatically by tolua++-1.0.92 on 11/23/10 00:33:48. +** Generated automatically by tolua++-1.0.92 on 01/19/11 04:59:42. */ /* Exported function */