mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
fixed lots of tabs and space
This commit is contained in:
parent
60b3ce3d6e
commit
45ae5e71cb
53 changed files with 2695 additions and 2695 deletions
|
|
@ -135,26 +135,26 @@ U32 endHighResolutionTimer(U32 time[2])
|
|||
|
||||
|
||||
void startHighResolutionTimer(U32 time[2]) {
|
||||
U64 now = mach_absolute_time();
|
||||
AssertFatal(sizeof(U32[2]) == sizeof(U64), "Can't pack mach_absolute_time into U32[2]");
|
||||
memcpy(time, &now, sizeof(U64));
|
||||
U64 now = mach_absolute_time();
|
||||
AssertFatal(sizeof(U32[2]) == sizeof(U64), "Can't pack mach_absolute_time into U32[2]");
|
||||
memcpy(time, &now, sizeof(U64));
|
||||
}
|
||||
|
||||
U32 endHighResolutionTimer(U32 time[2]) {
|
||||
static mach_timebase_info_data_t sTimebaseInfo = {0, 0};
|
||||
|
||||
U64 now = mach_absolute_time();
|
||||
AssertFatal(sizeof(U32[2]) == sizeof(U64), "Can't pack mach_absolute_time into U32[2]");
|
||||
U64 then;
|
||||
memcpy(&then, time, sizeof(U64));
|
||||
|
||||
if(sTimebaseInfo.denom == 0){
|
||||
mach_timebase_info(&sTimebaseInfo);
|
||||
}
|
||||
// Handle the micros/nanos conversion first, because shedding a few bits is better than overflowing.
|
||||
U64 elapsedMicros = ((now - then) / 1000) * sTimebaseInfo.numer / sTimebaseInfo.denom;
|
||||
|
||||
return (U32)elapsedMicros; // Just truncate, and hope we didn't overflow
|
||||
static mach_timebase_info_data_t sTimebaseInfo = {0, 0};
|
||||
|
||||
U64 now = mach_absolute_time();
|
||||
AssertFatal(sizeof(U32[2]) == sizeof(U64), "Can't pack mach_absolute_time into U32[2]");
|
||||
U64 then;
|
||||
memcpy(&then, time, sizeof(U64));
|
||||
|
||||
if(sTimebaseInfo.denom == 0){
|
||||
mach_timebase_info(&sTimebaseInfo);
|
||||
}
|
||||
// Handle the micros/nanos conversion first, because shedding a few bits is better than overflowing.
|
||||
U64 elapsedMicros = ((now - then) / 1000) * sTimebaseInfo.numer / sTimebaseInfo.denom;
|
||||
|
||||
return (U32)elapsedMicros; // Just truncate, and hope we didn't overflow
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
@ -730,37 +730,37 @@ DefineEngineFunction( profilerMarkerEnable, void, ( const char* markerName, bool
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
DefineEngineFunction( profilerEnable, void, ( bool enable ),,
|
||||
"@brief Enables or disables the profiler.\n\n"
|
||||
"Data is only gathered while the profiler is enabled.\n\n"
|
||||
"@note Profiler is not available in shipping builds.\n"
|
||||
"T3D has predefined profiling areas surrounded by markers, "
|
||||
"but you may need to define additional markers (in C++) around areas you wish to profile,"
|
||||
" by using the PROFILE_START( markerName ); and PROFILE_END(); macros.\n\n"
|
||||
"@ingroup Debugging\n" )
|
||||
"@brief Enables or disables the profiler.\n\n"
|
||||
"Data is only gathered while the profiler is enabled.\n\n"
|
||||
"@note Profiler is not available in shipping builds.\n"
|
||||
"T3D has predefined profiling areas surrounded by markers, "
|
||||
"but you may need to define additional markers (in C++) around areas you wish to profile,"
|
||||
" by using the PROFILE_START( markerName ); and PROFILE_END(); macros.\n\n"
|
||||
"@ingroup Debugging\n" )
|
||||
{
|
||||
if(gProfiler)
|
||||
gProfiler->enable(enable);
|
||||
}
|
||||
|
||||
DefineEngineFunction(profilerDump, void, (),,
|
||||
"@brief Dumps current profiling stats to the console window.\n\n"
|
||||
"@note Markers disabled with profilerMarkerEnable() will be skipped over. "
|
||||
"If the profiler is currently running, it will be disabled.\n"
|
||||
"@ingroup Debugging")
|
||||
"@brief Dumps current profiling stats to the console window.\n\n"
|
||||
"@note Markers disabled with profilerMarkerEnable() will be skipped over. "
|
||||
"If the profiler is currently running, it will be disabled.\n"
|
||||
"@ingroup Debugging")
|
||||
{
|
||||
if(gProfiler)
|
||||
gProfiler->dumpToConsole();
|
||||
}
|
||||
|
||||
DefineEngineFunction( profilerDumpToFile, void, ( const char* fileName ),,
|
||||
"@brief Dumps current profiling stats to a file.\n\n"
|
||||
"@note If the profiler is currently running, it will be disabled.\n"
|
||||
"@param fileName Name and path of file to save profiling stats to. Must use forward slashes (/). "
|
||||
"Will attempt to create the file if it does not already exist.\n"
|
||||
"@tsexample\n"
|
||||
"profilerDumpToFile( \"C:/Torque/log1.txt\" );\n"
|
||||
"@endtsexample\n\n"
|
||||
"@ingroup Debugging" )
|
||||
"@brief Dumps current profiling stats to a file.\n\n"
|
||||
"@note If the profiler is currently running, it will be disabled.\n"
|
||||
"@param fileName Name and path of file to save profiling stats to. Must use forward slashes (/). "
|
||||
"Will attempt to create the file if it does not already exist.\n"
|
||||
"@tsexample\n"
|
||||
"profilerDumpToFile( \"C:/Torque/log1.txt\" );\n"
|
||||
"@endtsexample\n\n"
|
||||
"@ingroup Debugging" )
|
||||
{
|
||||
if(gProfiler)
|
||||
gProfiler->dumpToFile(fileName);
|
||||
|
|
@ -768,9 +768,9 @@ DefineEngineFunction( profilerDumpToFile, void, ( const char* fileName ),,
|
|||
|
||||
DefineEngineFunction( profilerReset, void, (),,
|
||||
"@brief Resets the profiler, clearing it of all its data.\n\n"
|
||||
"If the profiler is currently running, it will first be disabled. "
|
||||
"All markers will retain their current enabled/disabled status.\n\n"
|
||||
"@ingroup Debugging" )
|
||||
"If the profiler is currently running, it will first be disabled. "
|
||||
"All markers will retain their current enabled/disabled status.\n\n"
|
||||
"@ingroup Debugging" )
|
||||
{
|
||||
if(gProfiler)
|
||||
gProfiler->reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue