Eliminate DefineConsoleFunction

This commit is contained in:
Lukas Joergensen 2018-04-17 16:33:56 +02:00
parent bc1b506205
commit e718841467
55 changed files with 314 additions and 332 deletions

View file

@ -67,7 +67,7 @@ bool gEditingMission = false;
ConsoleFunctionGroupBegin( InputManagement, "Functions that let you deal with input from scripts" );
DefineConsoleFunction( deactivateDirectInput, void, (), ,
DefineEngineFunction( deactivateDirectInput, void, (), ,
"()"
"@brief Disables DirectInput.\n\n"
"Also deactivates any connected joysticks.\n\n"
@ -77,7 +77,7 @@ DefineConsoleFunction( deactivateDirectInput, void, (), ,
Input::deactivate();
}
DefineConsoleFunction( activateDirectInput, void, (), ,
DefineEngineFunction( activateDirectInput, void, (), ,
"()"
"@brief Activates DirectInput.\n\n"
"Also activates any connected joysticks."
@ -91,7 +91,7 @@ ConsoleFunctionGroupEnd( InputManagement );
//--------------------------------------------------------------------------
static const U32 MaxPlayerNameLength = 16;
DefineConsoleFunction( strToPlayerName, const char*, (const char* ptr ), , "strToPlayerName(string);" )
DefineEngineFunction( strToPlayerName, const char*, (const char* ptr ), , "strToPlayerName(string);" )
{
// Strip leading spaces and underscores:
@ -147,7 +147,7 @@ DefineConsoleFunction( strToPlayerName, const char*, (const char* ptr ), , "strT
ConsoleFunctionGroupBegin( Platform , "General platform functions.");
DefineConsoleFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)"
DefineEngineFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)"
"@brief Lock or unlock the mouse to the window.\n\n"
"When true, prevents the mouse from leaving the bounds of the game window.\n\n"
"@ingroup Input")
@ -156,7 +156,7 @@ DefineConsoleFunction( lockMouse, void, (bool isLocked ), , "(bool isLocked)"
}
DefineConsoleFunction( setNetPort, bool, (int port, bool bind), (true), "(int port, bool bind=true)"
DefineEngineFunction( setNetPort, bool, (int port, bool bind), (true), "(int port, bool bind=true)"
"@brief Set the network port for the game to use.\n\n"
"@param port The port to use.\n"
@ -171,28 +171,28 @@ DefineConsoleFunction( setNetPort, bool, (int port, bool bind), (true), "(int po
return Net::openPort((S32)port, bind);
}
DefineConsoleFunction(isAddressTypeAvailable, bool, (int addressType), , "(protocol id)"
DefineEngineFunction(isAddressTypeAvailable, bool, (int addressType), , "(protocol id)"
"@brief Determines if a specified address type can be reached.\n\n"
"@ingroup Networking")
{
return Net::isAddressTypeAvailable((NetAddress::Type)addressType);
}
DefineConsoleFunction( closeNetPort, void, (), , "()"
DefineEngineFunction( closeNetPort, void, (), , "()"
"@brief Closes the current network port\n\n"
"@ingroup Networking")
{
Net::closePort();
}
DefineConsoleFunction( saveJournal, void, (const char * filename), , "(string filename)"
DefineEngineFunction( saveJournal, void, (const char * filename), , "(string filename)"
"Save the journal to the specified file.\n\n"
"@ingroup Platform")
{
Journal::Record(filename);
}
DefineConsoleFunction( playJournal, void, (const char * filename), , "(string filename)"
DefineEngineFunction( playJournal, void, (const char * filename), , "(string filename)"
"@brief Begin playback of a journal from a specified field.\n\n"
"@param filename Name and path of file journal file\n"
"@ingroup Platform")
@ -202,7 +202,7 @@ DefineConsoleFunction( playJournal, void, (const char * filename), , "(string fi
Journal::Play(filename);
}
DefineConsoleFunction( getSimTime, S32, (), , "()"
DefineEngineFunction( getSimTime, S32, (), , "()"
"Return the current sim time in milliseconds.\n\n"
"@brief Sim time is time since the game started.\n\n"
"@ingroup Platform")
@ -210,7 +210,7 @@ DefineConsoleFunction( getSimTime, S32, (), , "()"
return Sim::getCurrentTime();
}
DefineConsoleFunction( getRealTime, S32, (), , "()"
DefineEngineFunction( getRealTime, S32, (), , "()"
"@brief Return the current real time in milliseconds.\n\n"
"Real time is platform defined; typically time since the computer booted.\n\n"
"@ingroup Platform")

View file

@ -429,7 +429,7 @@ void queryLanServers(U32 port, U8 flags, const char* gameType, const char* missi
//-----------------------------------------------------------------------------
DefineConsoleFunction( queryAllServers
DefineEngineFunction( queryAllServers
, void, ( U32 lanPort
, U32 flags
, const char * gameType
@ -455,7 +455,7 @@ DefineConsoleFunction( queryAllServers
}
DefineConsoleFunction( queryLanServers
DefineEngineFunction( queryLanServers
, void, ( U32 lanPort
, U32 flags
, const char * gameType
@ -560,7 +560,7 @@ void queryMasterServer(U8 flags, const char* gameType, const char* missionType,
processMasterServerQuery( gPingSession );
}
DefineConsoleFunction( queryMasterServer
DefineEngineFunction( queryMasterServer
, void, ( U32 flags
, const char * gameType
, const char * missionType
@ -582,7 +582,7 @@ DefineConsoleFunction( queryMasterServer
//-----------------------------------------------------------------------------
DefineConsoleFunction( querySingleServer
DefineEngineFunction( querySingleServer
, void, ( const char* addrText, U8 flags )
, (0), "querySingleServer(address, flags);" )
{
@ -668,7 +668,7 @@ void cancelServerQuery()
}
}
DefineConsoleFunction( cancelServerQuery, void, (), , "cancelServerQuery();" )
DefineEngineFunction( cancelServerQuery, void, (), , "cancelServerQuery();" )
{
cancelServerQuery();
}
@ -696,14 +696,14 @@ void stopServerQuery()
}
}
DefineConsoleFunction( stopServerQuery, void, (), , "stopServerQuery();" )
DefineEngineFunction( stopServerQuery, void, (), , "stopServerQuery();" )
{
stopServerQuery();
}
//-----------------------------------------------------------------------------
DefineConsoleFunction( startHeartbeat, void, (), , "startHeartbeat();" )
DefineEngineFunction( startHeartbeat, void, (), , "startHeartbeat();" )
{
if (validateAuthenticatedServer()) {
gHeartbeatSeq++;
@ -711,19 +711,19 @@ DefineConsoleFunction( startHeartbeat, void, (), , "startHeartbeat();" )
}
}
DefineConsoleFunction( stopHeartbeat, void, (), , "stopHeartbeat();" )
DefineEngineFunction( stopHeartbeat, void, (), , "stopHeartbeat();" )
{
gHeartbeatSeq++;
}
//-----------------------------------------------------------------------------
DefineConsoleFunction( getServerCount, int, (), , "getServerCount();" )
DefineEngineFunction( getServerCount, int, (), , "getServerCount();" )
{
return gServerList.size();
}
DefineConsoleFunction( setServerInfo, bool, (U32 index), , "setServerInfo(index);" )
DefineEngineFunction( setServerInfo, bool, (U32 index), , "setServerInfo(index);" )
{
if (index < gServerList.size()) {
ServerInfo& info = gServerList[index];

View file

@ -92,44 +92,44 @@ const char* getCompileTimeString()
ConsoleFunctionGroupBegin( CompileInformation, "Functions to get version information about the current executable." );
DefineConsoleFunction( getVersionNumber, S32, (), , "Get the version of the engine build, as a string.\n\n"
DefineEngineFunction( getVersionNumber, S32, (), , "Get the version of the engine build, as a string.\n\n"
"@ingroup Debugging")
{
return getVersionNumber();
}
DefineConsoleFunction( getAppVersionNumber, S32, (), , "Get the version of the application build, as a string.\n\n"
DefineEngineFunction( getAppVersionNumber, S32, (), , "Get the version of the application build, as a string.\n\n"
"@ingroup Debugging")
{
return getAppVersionNumber();
}
DefineConsoleFunction( getVersionString, const char*, (), , "Get the version of the engine build, as a human readable string.\n\n"
DefineEngineFunction( getVersionString, const char*, (), , "Get the version of the engine build, as a human readable string.\n\n"
"@ingroup Debugging")
{
return getVersionString();
}
DefineConsoleFunction( getAppVersionString, const char*, (), , "Get the version of the aplication build, as a human readable string.\n\n"
DefineEngineFunction( getAppVersionString, const char*, (), , "Get the version of the aplication build, as a human readable string.\n\n"
"@ingroup Debugging")
{
return getAppVersionString();
}
DefineConsoleFunction( getEngineName, const char*, (), , "Get the name of the engine product that this is running from, as a string.\n\n"
DefineEngineFunction( getEngineName, const char*, (), , "Get the name of the engine product that this is running from, as a string.\n\n"
"@ingroup Debugging")
{
return getEngineProductString();
}
DefineConsoleFunction( getCompileTimeString, const char*, (), , "Get the time of compilation.\n\n"
DefineEngineFunction( getCompileTimeString, const char*, (), , "Get the time of compilation.\n\n"
"@ingroup Debugging")
{
return getCompileTimeString();
}
DefineConsoleFunction( getBuildString, const char*, (), , "Get the type of build, \"Debug\" or \"Release\".\n\n"
DefineEngineFunction( getBuildString, const char*, (), , "Get the type of build, \"Debug\" or \"Release\".\n\n"
"@ingroup Debugging")
{
#ifdef TORQUE_DEBUG