Fixed line endings.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4795 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-02-22 12:15:36 +00:00
parent f41150eae7
commit cd68ac9250
2 changed files with 47 additions and 47 deletions

View File

@ -30,42 +30,42 @@ IrrDebugDrawer::IrrDebugDrawer()
/** Activates the debug view. It makes all karts invisible (in irrlicht), so /** Activates the debug view. It makes all karts invisible (in irrlicht), so
* that the bullet view can be seen. * that the bullet view can be seen.
*/ */
void IrrDebugDrawer::activate() void IrrDebugDrawer::activate()
{ {
World *world = World::getWorld(); World *world = World::getWorld();
unsigned int num_karts = world->getNumKarts(); unsigned int num_karts = world->getNumKarts();
for(unsigned int i=0; i<num_karts; i++) for(unsigned int i=0; i<num_karts; i++)
{ {
Kart *kart = world->getKart(i); Kart *kart = world->getKart(i);
if(kart->isEliminated()) continue; if(kart->isEliminated()) continue;
kart->getNode()->setVisible(false); kart->getNode()->setVisible(false);
} }
} // activate } // activate
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
/** Deactivates the bullet debug view, and makes all karts visible again. /** Deactivates the bullet debug view, and makes all karts visible again.
*/ */
void IrrDebugDrawer::deactivate() void IrrDebugDrawer::deactivate()
{ {
World *world = World::getWorld(); World *world = World::getWorld();
unsigned int num_karts = world->getNumKarts(); unsigned int num_karts = world->getNumKarts();
for(unsigned int i=0; i<num_karts; i++) for(unsigned int i=0; i<num_karts; i++)
{ {
Kart *kart = world->getKart(i); Kart *kart = world->getKart(i);
if(kart->isEliminated()) continue; if(kart->isEliminated()) continue;
kart->getNode()->setVisible(true); kart->getNode()->setVisible(true);
} }
} // deactivate } // deactivate
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void IrrDebugDrawer::drawLine(const btVector3& from, const btVector3& to, void IrrDebugDrawer::drawLine(const btVector3& from, const btVector3& to,
const btVector3& color) const btVector3& color)
{ {
Vec3 f(from); Vec3 f(from);
Vec3 t(to); Vec3 t(to);
video::SColor c(255, (int)(color.getX()*255), (int)(color.getY()*255), video::SColor c(255, (int)(color.getX()*255), (int)(color.getY()*255),
(int)(color.getZ()*255) ); (int)(color.getZ()*255) );
irr_driver->getVideoDriver()->draw3DLine(f.toIrrVector(), irr_driver->getVideoDriver()->draw3DLine(f.toIrrVector(),
t.toIrrVector(), c); t.toIrrVector(), c);
} }
/* EOF */ /* EOF */

View File

@ -36,21 +36,21 @@ class IrrDebugDrawer : public btIDebugDraw
public: public:
IrrDebugDrawer(); IrrDebugDrawer();
void render(float dt); void render(float dt);
/** Draws a line. */ /** Draws a line. */
virtual void drawLine(const btVector3& from, const btVector3& to, virtual void drawLine(const btVector3& from, const btVector3& to,
const btVector3& color); const btVector3& color);
///optional debug methods ///optional debug methods
virtual void drawContactPoint(const btVector3& Point_on_b, virtual void drawContactPoint(const btVector3& Point_on_b,
const btVector3& normal_on_b, const btVector3& normal_on_b,
btScalar distance,int life_time, btScalar distance,int life_time,
const btVector3& color) {} const btVector3& color) {}
virtual void reportErrorWarning(const char* warningString) {} virtual void reportErrorWarning(const char* warningString) {}
virtual void draw3dText(const btVector3& location, virtual void draw3dText(const btVector3& location,
const char* textString) {} const char* textString) {}
virtual void setDebugMode(int debug_mode) { m_debug_mode = debug_mode; } virtual void setDebugMode(int debug_mode) { m_debug_mode = debug_mode; }
virtual int getDebugMode() const { return m_debug_mode; } virtual int getDebugMode() const { return m_debug_mode; }
void activate(); void activate();
void deactivate(); void deactivate();
}; // IrrDebugDrawer }; // IrrDebugDrawer