summaryrefslogtreecommitdiff
path: root/common/light.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/light.cpp')
-rw-r--r--common/light.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/common/light.cpp b/common/light.cpp
index 8283c22..6150579 100644
--- a/common/light.cpp
+++ b/common/light.cpp
@@ -147,6 +147,25 @@ Light::~Light ()
delete m_pTarget;
}
+void Light::CreateName(const Light* pLight)
+{
+ int i, max = 0;
+
+ for (; pLight; pLight = pLight->m_pNext)
+ {
+ if (strncmp (pLight->m_strName, "Light ", 6) == 0)
+ {
+ if (sscanf(pLight->m_strName + 6, " #%d", &i) == 1)
+ {
+ if (i > max)
+ max = i;
+ }
+ }
+ }
+
+ sprintf (m_strName, "Light #%.2d", max+1);
+}
+
void Light::Select (bool bSelecting, bool bFocus, bool bMultiple)
{
if (bSelecting == true)