From a3cfb9c4634e3ce7e052e72ce564d25e5367a430 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 15 Aug 2009 13:25:37 +0000 Subject: API cleanups, const optimizations, submodel lights/flares/particles import --- src/model/parts.cc | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'src/model/parts.cc') diff --git a/src/model/parts.cc b/src/model/parts.cc index eabc108..ac54410 100644 --- a/src/model/parts.cc +++ b/src/model/parts.cc @@ -28,6 +28,22 @@ Light::Light() : light_texture = 0; } +Light::Light(const Light& other) : Part(other), + light_color(other.color()) +{ + light_entity = other.entity(); + light_engine = other.engine(); + light_strobe = other.strobe(); + + light_radius = other.radius(); + light_frequency = other.frequency(); + light_offset = other.offset(); + light_time = other.time(); + + light_flare = other.flare(); + + light_texture = other.texture(); +} Light::~Light() {} @@ -38,13 +54,17 @@ Flare::Flare() : Light() flare_cull = CullBack; } +Flare::Flare(const Flare& other) : Light(other) +{ + flare_cull = other.cull(); +} + Flare::~Flare() {} /* ---- class Particles -------------------------------------------- */ -Particles::Particles() : - Part() +Particles::Particles() : Part() { particles_entity = false; particles_engine = false; @@ -52,7 +72,7 @@ Particles::Particles() : particles_cull = CullNone; } -Particles::Particles(math::Vector3f const & location) : +Particles::Particles(const math::Vector3f& location) : Part(location) { } @@ -63,22 +83,34 @@ Particles::~Particles() /* ---- class Dock ------------------------------------------------- */ -Dock::Dock() +Dock::Dock() : Part() { dock_radius = 0.01f; } +Dock::Dock(const Dock& other) : Part(other) +{ + dock_radius = other.radius(); +} + Dock::~Dock() { } /* ---- class SubModel---------------------------------------------- */ -SubModel::SubModel() +SubModel::SubModel() : Part() { submodel_scale = 1.0f; } +SubModel::SubModel(const SubModel& other) : Part(other), + submodel_name(other.name()), + submodel_axis(other.axis()) +{ + submodel_scale = other.scale(); +} + SubModel::~SubModel() { } -- cgit v1.2.3