modify the python stub to include __file__ and __name__, also correct odd indent in KX_KetsjiEngine.cpp

This commit is contained in:
Campbell Barton 2012-11-22 05:20:51 +00:00
parent 9d0334bc74
commit 796988adc9
2 changed files with 13 additions and 13 deletions

@ -8,4 +8,5 @@ import os
filename = "my_script.py"
filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename)
exec(compile(open(filepath).read(), filepath, 'exec'))
global_namespace = {"__file__": filepath, "__name__": "__main__"}
exec(compile(open(filepath).read(), filepath, 'exec'), global_namespace)

@ -534,21 +534,20 @@ bool KX_KetsjiEngine::NextFrame()
{
double timestep = 1.0/m_ticrate;
double framestep = timestep;
// static hidden::Clock sClock;
// static hidden::Clock sClock;
m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(),true);
m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(),true);
//float dt = sClock.getTimeMicroseconds() * 0.000001f;
//sClock.reset();
//float dt = sClock.getTimeMicroseconds() * 0.000001f;
//sClock.reset();
if (m_bFixedTime)
m_clockTime += timestep;
else
{
// m_clockTime += dt;
m_clockTime = m_kxsystem->GetTimeInSeconds();
}
if (m_bFixedTime) {
m_clockTime += timestep;
}
else {
// m_clockTime += dt;
m_clockTime = m_kxsystem->GetTimeInSeconds();
}
double deltatime = m_clockTime - m_frameTime;
if (deltatime<0.f)