mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Update console.h
This commit is contained in:
parent
8176145aaa
commit
dc16c50e4e
1 changed files with 1 additions and 58 deletions
|
|
@ -168,7 +168,7 @@ class ConsoleValue
|
||||||
}
|
}
|
||||||
else if (type == ConsoleValueType::cvString)
|
else if (type == ConsoleValueType::cvString)
|
||||||
{
|
{
|
||||||
if (s && s[0])
|
if (s != StringTable->EmptyString())
|
||||||
dFree(s);
|
dFree(s);
|
||||||
}
|
}
|
||||||
type = ConsoleValueType::cvNULL;
|
type = ConsoleValueType::cvNULL;
|
||||||
|
|
@ -181,63 +181,6 @@ public:
|
||||||
s = const_cast<char*>(StringTable->EmptyString());
|
s = const_cast<char*>(StringTable->EmptyString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsoleValue(ConsoleValue&& ref) noexcept
|
|
||||||
{
|
|
||||||
if (ref.type == ConsoleValueType::cvNULL)
|
|
||||||
{
|
|
||||||
std::cout << "Cannot Move a variable twice!";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (ref.type)
|
|
||||||
{
|
|
||||||
case cvInteger:
|
|
||||||
setInt(ref.i);
|
|
||||||
break;
|
|
||||||
case cvFloat:
|
|
||||||
setFloat(ref.f);
|
|
||||||
break;
|
|
||||||
case cvSTEntry:
|
|
||||||
setStringTableEntry(ref.s);
|
|
||||||
break;
|
|
||||||
case cvString:
|
|
||||||
setString(ref.s);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
setConsoleData(ref.ct->consoleType, ref.ct->dataPtr, ref.ct->enumTable);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ref.cleanupData();
|
|
||||||
}
|
|
||||||
|
|
||||||
TORQUE_FORCEINLINE ConsoleValue& operator=(ConsoleValue&& ref) noexcept
|
|
||||||
{
|
|
||||||
if (ref.type == ConsoleValueType::cvNULL)
|
|
||||||
{
|
|
||||||
std::cout << "Cannot Move a variable twice!";
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
switch (ref.type)
|
|
||||||
{
|
|
||||||
case cvInteger:
|
|
||||||
setInt(ref.i);
|
|
||||||
break;
|
|
||||||
case cvFloat:
|
|
||||||
setFloat(ref.f);
|
|
||||||
break;
|
|
||||||
case cvSTEntry:
|
|
||||||
setStringTableEntry(ref.s);
|
|
||||||
break;
|
|
||||||
case cvString:
|
|
||||||
setString(ref.s);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
setConsoleData(ref.ct->consoleType, ref.ct->dataPtr, ref.ct->enumTable);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ref.cleanupData();
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleValue(const ConsoleValue& ref)
|
ConsoleValue(const ConsoleValue& ref)
|
||||||
{
|
{
|
||||||
switch (ref.type)
|
switch (ref.type)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue