Skip to content

Commit

Permalink
Merge branch 'admin'
Browse files Browse the repository at this point in the history
  • Loading branch information
t3kt committed Dec 26, 2014
2 parents 4f76dbb + d4a91e3 commit 5c94990
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/core/RoundManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "DomeRenderer.h"
#include "Logging.h"

RoundController::RoundController(RoundConfig config,
RoundController::RoundController(RoundConfig& config,
BleepoutParameters& appParams,
std::list<ofPtr<Player> > players,
PlayerManager& playerManager)
Expand Down
4 changes: 2 additions & 2 deletions src/core/RoundManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RendererBase;
class RoundController : public EventSource
{
public:
RoundController(RoundConfig config,
RoundController(RoundConfig& config,
BleepoutParameters& appParams,
std::list<ofPtr<Player> > players,
PlayerManager& playerManager);
Expand Down Expand Up @@ -79,7 +79,7 @@ class RoundController : public EventSource
float _startTime;
BleepoutParameters& _appParams;
PlayerManager& _playerManager;
RoundConfig _config;
RoundConfig& _config;
RoundState _state;
ofPtr<RendererBase> _renderer;
ofPtr<SpaceController> _spaceController;
Expand Down
20 changes: 9 additions & 11 deletions src/game_objects/Ball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,20 @@

const char GameObjectTypeTraits<Ball>::typeName[] = "ball";

Ball::Ball(const RoundConfig* config /*= NULL*/, const BallSpec* spec /*= NULL*/)
Ball::Ball(const RoundConfig& config, const BallSpec& spec)
: GameObject(GAME_OBJECT_BALL)
, _player(NULL)
, PhysicsObject(CollisionSphere)
{
thisGameObject = this;
_color = ofColor(220, 220, 220);
if (config && spec) {
this->setSize(ofVec3f(config->ballRadius()));
auto t = new OrbitalTrajectory();
t->setRadius(config->domeRadius() + config->domeMargin());
t->setSpeed(0.03);
t->initWithTwoPoints(spec->elevation, spec->heading, -14,
spec->heading + ofRandom(-45, 45));
this->setTrajectory(t);
}
_color = ofColor(220, 220, 220);
this->setSize(ofVec3f(config.ballRadius()));
auto t = new OrbitalTrajectory();
t->setRadius(config.domeRadius() + config.domeMargin());
t->setSpeed(0.03);
t->initWithTwoPoints(spec.elevation, spec.heading, -14,
spec.heading + ofRandom(-45, 45));
this->setTrajectory(t);
}

void Ball::bounce(ofVec3f normal, float trueHitFactor /* = 0.0 */) {
Expand Down
2 changes: 1 addition & 1 deletion src/game_objects/Ball.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct BallSpec;

class Ball : public GameObject, public PhysicsObject {
public:
Ball(const RoundConfig* config = NULL, const BallSpec* spec = NULL);
Ball(const RoundConfig& config, const BallSpec& spec);

Player* player() { return _player; }
const Player* player() const { return _player; }
Expand Down
2 changes: 1 addition & 1 deletion src/game_objects/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Wall& RoundState::addWall(const WallSpec& wallSpec) {
}

Ball& RoundState::addBall(const BallSpec& ballSpec) {
ofPtr<Ball> ball(new Ball(&_config, &ballSpec));
ofPtr<Ball> ball(new Ball(_config, ballSpec));
_balls.push_back(ball);
return *ball;
}
Expand Down

0 comments on commit 5c94990

Please sign in to comment.