Skip to content

Commit

Permalink
changed deprecated comments to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 16, 2021
1 parent 5c66458 commit 1e73cab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var Body = require('../body/Body');

var engine = Common.extend(defaults, options);

// @deprecated
// back compatibility
if (element || engine.render) {
var renderDefaults = {
element: element,
Expand All @@ -73,12 +73,12 @@ var Body = require('../body/Body');
engine.render = Common.extend(renderDefaults, engine.render);
}

// @deprecated
// back compatibility
if (engine.render && engine.render.controller) {
engine.render = engine.render.controller.create(engine.render);
}

// @deprecated
// back compatibility
if (engine.render) {
engine.render.engine = engine;
}
Expand Down
14 changes: 7 additions & 7 deletions src/core/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ var Common = require('./Common');
};

Events.trigger(runner, 'beforeTick', event);
Events.trigger(engine, 'beforeTick', event); // @deprecated
Events.trigger(engine, 'beforeTick', event); // back compatibility

if (runner.isFixed) {
// fixed timestep
Expand Down Expand Up @@ -164,14 +164,14 @@ var Common = require('./Common');
}

Events.trigger(runner, 'tick', event);
Events.trigger(engine, 'tick', event); // @deprecated
Events.trigger(engine, 'tick', event); // back compatibility

// if world has been modified, clear the render scene graph
if (engine.world.isModified
&& engine.render
&& engine.render.controller
&& engine.render.controller.clear) {
engine.render.controller.clear(engine.render); // @deprecated
engine.render.controller.clear(engine.render); // back compatibility
}

// update
Expand All @@ -180,19 +180,19 @@ var Common = require('./Common');
Events.trigger(runner, 'afterUpdate', event);

// render
// @deprecated
// back compatibility
if (engine.render && engine.render.controller) {
Events.trigger(runner, 'beforeRender', event);
Events.trigger(engine, 'beforeRender', event); // @deprecated
Events.trigger(engine, 'beforeRender', event); // back compatibility

engine.render.controller.world(engine.render);

Events.trigger(runner, 'afterRender', event);
Events.trigger(engine, 'afterRender', event); // @deprecated
Events.trigger(engine, 'afterRender', event); // back compatibility
}

Events.trigger(runner, 'afterTick', event);
Events.trigger(engine, 'afterTick', event); // @deprecated
Events.trigger(engine, 'afterTick', event); // back compatibility
};

/**
Expand Down

0 comments on commit 1e73cab

Please sign in to comment.