mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Added basic Walkabout with #define renamed and no editor.
This commit is contained in:
parent
c08413ffde
commit
f4c940f4fe
22 changed files with 3725 additions and 196 deletions
69
Engine/source/navigation/navContext.cpp
Normal file
69
Engine/source/navigation/navContext.cpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2014 Daniel Buckmaster
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to
|
||||
// deal in the Software without restriction, including without limitation the
|
||||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
// sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "navContext.h"
|
||||
#include "console/sim.h"
|
||||
|
||||
void NavContext::doResetLog()
|
||||
{
|
||||
}
|
||||
|
||||
void NavContext::log(const rcLogCategory category, const String &msg)
|
||||
{
|
||||
doLog(category, msg.c_str(), msg.length());
|
||||
}
|
||||
|
||||
void NavContext::doLog(const rcLogCategory category, const char* msg, const int len)
|
||||
{
|
||||
if(category == RC_LOG_ERROR)
|
||||
Con::errorf(msg);
|
||||
else
|
||||
Con::printf(msg);
|
||||
}
|
||||
|
||||
void NavContext::doResetTimers()
|
||||
{
|
||||
for(U32 i = 0; i < RC_MAX_TIMERS; i++)
|
||||
{
|
||||
mTimers[i][0] = -1;
|
||||
mTimers[i][1] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void NavContext::doStartTimer(const rcTimerLabel label)
|
||||
{
|
||||
// Store starting time.
|
||||
mTimers[label][0] = Platform::getRealMilliseconds();
|
||||
}
|
||||
|
||||
void NavContext::doStopTimer(const rcTimerLabel label)
|
||||
{
|
||||
// Compute final time based on starting time.
|
||||
mTimers[label][1] = Platform::getRealMilliseconds() - mTimers[label][0];
|
||||
}
|
||||
|
||||
int NavContext::doGetAccumulatedTime(const rcTimerLabel label) const
|
||||
{
|
||||
return mTimers[label][1] == -1
|
||||
? Platform::getRealMilliseconds() - mTimers[label][0]
|
||||
: mTimers[label][1];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue