mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Merge branch 'development' of https://github.com/GarageGames/Torque3D into memberMess
# Conflicts: # Engine/source/console/consoleFunctions.cpp
This commit is contained in:
commit
cbce2ee805
154 changed files with 2950 additions and 705 deletions
|
|
@ -245,11 +245,11 @@ void ActionMap::dumpActionMap(const char* fileName, const bool append) const
|
|||
else
|
||||
{
|
||||
// IMPORTANT -- do NOT change the following line, it identifies the file as an input map file
|
||||
dStrcpy( lineBuffer, "// Torque Input Map File\n" );
|
||||
dStrcpy( lineBuffer, "// Torque Input Map File\n", 1024 );
|
||||
iostrm->write( dStrlen( lineBuffer ), lineBuffer );
|
||||
}
|
||||
|
||||
dSprintf(lineBuffer, 1023, "if (isObject(%s)) %s.delete();\n"
|
||||
dSprintf(lineBuffer, 1024, "if (isObject(%s)) %s.delete();\n"
|
||||
"new ActionMap(%s);\n", getName(), getName(), getName());
|
||||
iostrm->write(dStrlen(lineBuffer), lineBuffer);
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ void ActionMap::dumpActionMap(const char* fileName, const bool append) const
|
|||
else
|
||||
command = "bind";
|
||||
|
||||
dSprintf(lineBuffer, 1023, "%s.%s(%s, \"%s%s\"",
|
||||
dSprintf(lineBuffer, 1024, "%s.%s(%s, \"%s%s\"",
|
||||
getName(),
|
||||
command,
|
||||
devbuffer,
|
||||
|
|
@ -298,53 +298,53 @@ void ActionMap::dumpActionMap(const char* fileName, const bool append) const
|
|||
buff[curr++] = 'I';
|
||||
buff[curr] = '\0';
|
||||
|
||||
dStrcat(lineBuffer, buff);
|
||||
dStrcat(lineBuffer, buff, 1024);
|
||||
}
|
||||
|
||||
if (rNode.flags & Node::HasDeadZone) {
|
||||
char buff[64];
|
||||
dSprintf(buff, 63, ", \"%g %g\"", rNode.deadZoneBegin, rNode.deadZoneEnd);
|
||||
dStrcat(lineBuffer, buff);
|
||||
dStrcat(lineBuffer, buff, 1024);
|
||||
}
|
||||
|
||||
if (rNode.flags & Node::HasScale) {
|
||||
char buff[64];
|
||||
dSprintf(buff, 63, ", %g", rNode.scaleFactor);
|
||||
dStrcat(lineBuffer, buff);
|
||||
dStrcat(lineBuffer, buff, 1024);
|
||||
}
|
||||
|
||||
if (rNode.flags & Node::BindCmd) {
|
||||
if (rNode.makeConsoleCommand) {
|
||||
dStrcat(lineBuffer, ", \"");
|
||||
dStrcat(lineBuffer, ", \"", 1024);
|
||||
U32 pos = dStrlen(lineBuffer);
|
||||
expandEscape(lineBuffer + pos, rNode.makeConsoleCommand);
|
||||
dStrcat(lineBuffer, "\"");
|
||||
dStrcat(lineBuffer, "\"", 1024);
|
||||
} else {
|
||||
dStrcat(lineBuffer, ", \"\"");
|
||||
dStrcat(lineBuffer, ", \"\"", 1024);
|
||||
}
|
||||
if (rNode.breakConsoleCommand) {
|
||||
dStrcat(lineBuffer, ", \"");
|
||||
dStrcat(lineBuffer, ", \"", 1024);
|
||||
U32 pos = dStrlen(lineBuffer);
|
||||
expandEscape(lineBuffer + pos, rNode.breakConsoleCommand);
|
||||
dStrcat(lineBuffer, "\"");
|
||||
dStrcat(lineBuffer, "\"", 1024);
|
||||
}
|
||||
else
|
||||
dStrcat(lineBuffer, ", \"\"");
|
||||
dStrcat(lineBuffer, ", \"\"", 1024);
|
||||
}
|
||||
else if (rNode.flags & Node::Held)
|
||||
{
|
||||
dStrcat(lineBuffer, ", ");
|
||||
dStrcat(lineBuffer, rNode.consoleFunction);
|
||||
dStrcat(lineBuffer, ", ", 1024);
|
||||
dStrcat(lineBuffer, rNode.consoleFunction, 1024);
|
||||
|
||||
dStrcat(lineBuffer, ", ");
|
||||
dStrcat(lineBuffer, rNode.contextEvent->mConsoleFunctionHeld);
|
||||
dStrcat(lineBuffer, ", ", 1024);
|
||||
dStrcat(lineBuffer, rNode.contextEvent->mConsoleFunctionHeld, 1024);
|
||||
}
|
||||
else {
|
||||
dStrcat(lineBuffer, ", ");
|
||||
dStrcat(lineBuffer, rNode.consoleFunction);
|
||||
dStrcat(lineBuffer, ", ", 1024);
|
||||
dStrcat(lineBuffer, rNode.consoleFunction, 1024);
|
||||
}
|
||||
|
||||
dStrcat(lineBuffer, ");\n");
|
||||
dStrcat(lineBuffer, ");\n", 1024);
|
||||
iostrm->write(dStrlen(lineBuffer), lineBuffer);
|
||||
}
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ void ActionMap::dumpActionMap(const char* fileName, const bool append) const
|
|||
command = "bind";
|
||||
|
||||
char finalBuffer[1024];
|
||||
dSprintf(finalBuffer, 1023, "%s.%s(%s, \"%s%s\"",
|
||||
dSprintf(finalBuffer, 1024, "%s.%s(%s, \"%s%s\"",
|
||||
getName(),
|
||||
command,
|
||||
devbuffer,
|
||||
|
|
@ -398,51 +398,51 @@ void ActionMap::dumpActionMap(const char* fileName, const bool append) const
|
|||
buff[curr++] = 'I';
|
||||
buff[curr] = '\0';
|
||||
|
||||
dStrcat(finalBuffer, buff);
|
||||
dStrcat(finalBuffer, buff, 1024);
|
||||
}
|
||||
|
||||
if (rNode.flags & Node::HasDeadZone) {
|
||||
char buff[64];
|
||||
dSprintf(buff, 63, ", \"%g %g\"", rNode.deadZoneBegin, rNode.deadZoneEnd);
|
||||
dStrcat(finalBuffer, buff);
|
||||
dStrcat(finalBuffer, buff, 1024);
|
||||
}
|
||||
|
||||
if (rNode.flags & Node::HasScale) {
|
||||
char buff[64];
|
||||
dSprintf(buff, 63, ", %g", rNode.scaleFactor);
|
||||
dStrcat(finalBuffer, buff);
|
||||
dStrcat(finalBuffer, buff, 1024);
|
||||
}
|
||||
|
||||
if (rNode.flags & Node::BindCmd) {
|
||||
if (rNode.makeConsoleCommand) {
|
||||
dStrcat(finalBuffer, ", \"");
|
||||
dStrcat(finalBuffer, rNode.makeConsoleCommand);
|
||||
dStrcat(finalBuffer, "\"");
|
||||
dStrcat(finalBuffer, ", \"", 1024);
|
||||
dStrcat(finalBuffer, rNode.makeConsoleCommand, 1024);
|
||||
dStrcat(finalBuffer, "\"", 1024);
|
||||
} else {
|
||||
dStrcat(finalBuffer, ", \"\"");
|
||||
dStrcat(finalBuffer, ", \"\"", 1024);
|
||||
}
|
||||
if (rNode.breakConsoleCommand) {
|
||||
dStrcat(finalBuffer, ", \"");
|
||||
dStrcat(finalBuffer, rNode.breakConsoleCommand);
|
||||
dStrcat(finalBuffer, "\"");
|
||||
dStrcat(finalBuffer, ", \"", 1024);
|
||||
dStrcat(finalBuffer, rNode.breakConsoleCommand, 1024);
|
||||
dStrcat(finalBuffer, "\"", 1024);
|
||||
}
|
||||
else
|
||||
dStrcat(finalBuffer, ", \"\"");
|
||||
dStrcat(finalBuffer, ", \"\"", 1024);
|
||||
}
|
||||
else if (rNode.flags & Node::Held)
|
||||
{
|
||||
dStrcat(finalBuffer, ", ");
|
||||
dStrcat(finalBuffer, rNode.consoleFunction);
|
||||
dStrcat(finalBuffer, ", ", 1024);
|
||||
dStrcat(finalBuffer, rNode.consoleFunction, 1024);
|
||||
|
||||
dStrcat(finalBuffer, ", ");
|
||||
dStrcat(finalBuffer, rNode.contextEvent->mConsoleFunctionHeld);
|
||||
dStrcat(finalBuffer, ", ", 1024);
|
||||
dStrcat(finalBuffer, rNode.contextEvent->mConsoleFunctionHeld, 1024);
|
||||
}
|
||||
else {
|
||||
dStrcat(finalBuffer, ", ");
|
||||
dStrcat(finalBuffer, rNode.consoleFunction);
|
||||
dStrcat(finalBuffer, ", ", 1024);
|
||||
dStrcat(finalBuffer, rNode.consoleFunction, 1024);
|
||||
}
|
||||
|
||||
dStrcat(finalBuffer, ");");
|
||||
dStrcat(finalBuffer, ");", 1024);
|
||||
Con::printf(finalBuffer);
|
||||
}
|
||||
}
|
||||
|
|
@ -453,7 +453,7 @@ void ActionMap::dumpActionMap(const char* fileName, const bool append) const
|
|||
bool ActionMap::createEventDescriptor(const char* pEventString, EventDescriptor* pDescriptor)
|
||||
{
|
||||
char copyBuffer[256];
|
||||
dStrcpy(copyBuffer, pEventString);
|
||||
dStrcpy(copyBuffer, pEventString, 256);
|
||||
|
||||
// Do we have modifiers?
|
||||
char* pSpace = dStrchr(copyBuffer, ' ');
|
||||
|
|
@ -786,8 +786,8 @@ const char* ActionMap::getBinding( const char* command )
|
|||
{
|
||||
dSprintf( buffer, sizeof( buffer ), "%s\t%s%s", deviceBuffer, modifierString, keyBuffer );
|
||||
if ( returnString[0] )
|
||||
dStrcat( returnString, "\t" );
|
||||
dStrcat( returnString, buffer );
|
||||
dStrcat( returnString, "\t", 1024 );
|
||||
dStrcat( returnString, buffer, 1024 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -908,8 +908,9 @@ const char* ActionMap::getDeadZone( const char* device, const char* action )
|
|||
{
|
||||
char buf[64];
|
||||
dSprintf( buf, sizeof( buf ), "%g %g", mapNode->deadZoneBegin, mapNode->deadZoneEnd );
|
||||
char* returnString = Con::getReturnBuffer( dStrlen( buf ) + 1 );
|
||||
dStrcpy( returnString, buf );
|
||||
dsize_t returnLen = dStrlen(buf) + 1;
|
||||
char* returnString = Con::getReturnBuffer( returnLen );
|
||||
dStrcpy( returnString, buf, returnLen );
|
||||
return( returnString );
|
||||
}
|
||||
else
|
||||
|
|
@ -995,7 +996,7 @@ bool ActionMap::getDeviceName(const U32 deviceType, const U32 deviceInstance, ch
|
|||
{
|
||||
switch (deviceType) {
|
||||
case KeyboardDeviceType:
|
||||
dStrcpy(buffer, "keyboard");
|
||||
dStrcpy(buffer, "keyboard", 16);
|
||||
break;
|
||||
|
||||
case MouseDeviceType:
|
||||
|
|
@ -1135,7 +1136,7 @@ bool ActionMap::getKeyString(const U32 action, char* buffer)
|
|||
for (U32 i = 0; gAsciiMap[i].asciiCode != 0xFFFF; i++) {
|
||||
if (gAsciiMap[i].asciiCode == asciiCode)
|
||||
{
|
||||
dStrcpy(buffer, gAsciiMap[i].pDescription);
|
||||
dStrcpy(buffer, gAsciiMap[i].pDescription, 16);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1159,14 +1160,14 @@ bool ActionMap::getKeyString(const U32 action, char* buffer)
|
|||
}
|
||||
//for (U32 i = 0; gVirtualMap[i].code != 0xFFFFFFFF; i++) {
|
||||
// if (gVirtualMap[i].code == action) {
|
||||
// dStrcpy(buffer, gVirtualMap[i].pDescription);
|
||||
// dStrcpy(buffer, gVirtualMap[i].pDescription, 16);
|
||||
// return true;
|
||||
// }
|
||||
//}
|
||||
const char* desc = INPUTMGR->findVirtualMapDescFromCode(action);
|
||||
if(desc)
|
||||
{
|
||||
dStrcpy(buffer, desc);
|
||||
dStrcpy(buffer, desc, 16);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public:
|
|||
static char buffer[512];
|
||||
dSprintf(buffer, sizeof(buffer), "%s - \"", getClassName());
|
||||
expandEscape(buffer + dStrlen(buffer), mString.getString());
|
||||
dStrcat(buffer, "\"");
|
||||
dStrcat(buffer, "\"", 512);
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
for(U32 i = 0; i < nameCount; i++)
|
||||
{
|
||||
dStrcpy(mFileNames[i], (*nameList)[i]);
|
||||
dStrcpy(mFileNames[i], (*nameList)[i], 256);
|
||||
//Con::printf("Sending request for file %s", mFileNames[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ struct GhostInfo;
|
|||
/// // the ScopeAlways flag indicates that the object is always scoped
|
||||
/// // on all active connections.
|
||||
/// mNetFlags.set(ScopeAlways | Ghostable);
|
||||
/// dStrcpy(message1, "Hello World 1!");
|
||||
/// dStrcpy(message2, "Hello World 2!");
|
||||
/// dStrcpy(message1, "Hello World 1!", bufLen);
|
||||
/// dStrcpy(message2, "Hello World 2!", bufLen);
|
||||
/// }
|
||||
/// @endcode
|
||||
///
|
||||
|
|
@ -187,12 +187,12 @@ struct GhostInfo;
|
|||
/// void setMessage1(const char *msg)
|
||||
/// {
|
||||
/// setMaskBits(Message1Mask);
|
||||
/// dStrcpy(message1, msg);
|
||||
/// dStrcpy(message1, msg, bufLen);
|
||||
/// }
|
||||
/// void setMessage2(const char *msg)
|
||||
/// {
|
||||
/// setMaskBits(Message2Mask);
|
||||
/// dStrcpy(message2, msg);
|
||||
/// dStrcpy(message2, msg, bufLen);
|
||||
/// }
|
||||
/// @endcode
|
||||
///
|
||||
|
|
|
|||
|
|
@ -96,8 +96,9 @@ U32 NetStringTable::addString(const char *string)
|
|||
size = newSize;
|
||||
}
|
||||
table[e].refCount++;
|
||||
table[e].string = (char *) allocator->alloc(dStrlen(string) + 1);
|
||||
dStrcpy(table[e].string, string);
|
||||
dsize_t stringLen = dStrlen(string) + 1;
|
||||
table[e].string = (char *) allocator->alloc(stringLen);
|
||||
dStrcpy(table[e].string, string, stringLen);
|
||||
table[e].next = hashTable[bucket];
|
||||
hashTable[bucket] = e;
|
||||
table[e].link = firstValid;
|
||||
|
|
@ -178,8 +179,9 @@ void NetStringTable::repack()
|
|||
const char *prevStr = table[walk].string;
|
||||
|
||||
|
||||
table[walk].string = (char *) newAllocator->alloc(dStrlen(prevStr) + 1);
|
||||
dStrcpy(table[walk].string, prevStr);
|
||||
dsize_t prevStrLen = dStrlen(prevStr) + 1;
|
||||
table[walk].string = (char *) newAllocator->alloc(prevStrLen);
|
||||
dStrcpy(table[walk].string, prevStr, prevStrLen);
|
||||
}
|
||||
delete allocator;
|
||||
allocator = newAllocator;
|
||||
|
|
@ -239,7 +241,7 @@ void NetStringTable::expandString(NetStringHandle &inString, char *buf, U32 bufS
|
|||
}
|
||||
buf[bufSize - 1] = 0;
|
||||
} else {
|
||||
dStrcat(buf, "<NULL>");
|
||||
dStrcat(buf, "<NULL>", bufSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue