mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Update console.h
This commit is contained in:
parent
8176145aaa
commit
dc16c50e4e
|
|
@ -168,7 +168,7 @@ class ConsoleValue
|
|||
}
|
||||
else if (type == ConsoleValueType::cvString)
|
||||
{
|
||||
if (s && s[0])
|
||||
if (s != StringTable->EmptyString())
|
||||
dFree(s);
|
||||
}
|
||||
type = ConsoleValueType::cvNULL;
|
||||
|
|
@ -181,63 +181,6 @@ public:
|
|||
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)
|
||||
{
|
||||
switch (ref.type)
|
||||
|
|
|
|||
Loading…
Reference in a new issue