Skip to content

Commit

Permalink
Removing inlining of virtual function
Browse files Browse the repository at this point in the history
  • Loading branch information
atupone committed Oct 18, 2023
1 parent 3b9de59 commit 961caa8
Show file tree
Hide file tree
Showing 33 changed files with 113 additions and 80 deletions.
5 changes: 1 addition & 4 deletions include/BillboardSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ class BillboardSceneNode : public SceneNode
~BillboardRenderNode();
void setColor(const GLfloat* rgba);
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
void setFrame(float u, float v);
void setFrameSize(float du, float dv);
private:
Expand Down
7 changes: 2 additions & 5 deletions include/BoltSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BoltSceneNode : public SceneNode
invisible = _invisible;
}

virtual void move(const GLfloat pos[3], const GLfloat forward[3]);
void move(const GLfloat pos[3], const GLfloat forward[3]);
void addLight(SceneRenderer&);

void notifyStyleChange();
Expand All @@ -67,10 +67,7 @@ class BoltSceneNode : public SceneNode
void setColor(const GLfloat* rgba);
void setTextureColor(const GLfloat* rgba);
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
void setAnimation(int cu, int cv);

void renderGeoBolt();
Expand Down
5 changes: 1 addition & 4 deletions include/EighthDBaseSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ class EighthDBaseSceneNode : public EighthDimSceneNode
const float size[3], float rotation);
~EighthDBaseRenderNode();
void render();
const GLfloat * getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
const EighthDBaseSceneNode *sceneNode;
GLfloat corner[8][3];
Expand Down
5 changes: 1 addition & 4 deletions include/EighthDBoxSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ class EighthDBoxSceneNode : public EighthDimSceneNode
const float size[3], float rotation);
~EighthDBoxRenderNode();
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
const EighthDBoxSceneNode* sceneNode;
GLfloat corner[8][3];
Expand Down
5 changes: 1 addition & 4 deletions include/EighthDPyrSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ class EighthDPyrSceneNode : public EighthDimSceneNode
const float size[3], float rotation);
~EighthDPyrRenderNode();
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
const EighthDPyrSceneNode* sceneNode;
GLfloat corner[5][3];
Expand Down
5 changes: 1 addition & 4 deletions include/EighthDimSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class EighthDimSceneNode : public SceneNode
~EighthDimRenderNode();
void render();
void setPolygon(int index, const GLfloat[3][3]);
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
const EighthDimSceneNode* sceneNode;
int numPolygons;
Expand Down
5 changes: 1 addition & 4 deletions include/EighthDimShellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ class EighthDimShellNode : public SceneNode
{
return;
}
const GLfloat* getPosition() const
{
return renderNode->getPosition();
}
const GLfloat* getPosition() const override;
public:
const OpenGLGState* getGState() const;
private:
Expand Down
5 changes: 1 addition & 4 deletions include/FlagWarpSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ class FlagWarpSceneNode : public SceneNode
FlagWarpRenderNode(const FlagWarpSceneNode*);
~FlagWarpRenderNode();
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
const FlagWarpSceneNode* sceneNode;
};
Expand Down
5 changes: 1 addition & 4 deletions include/LaserSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ class LaserSceneNode : public SceneNode
LaserRenderNode(const LaserSceneNode*);
~LaserRenderNode();
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
void renderFlatLaser();
void renderGeoLaser();
Expand Down
5 changes: 1 addition & 4 deletions include/MeshPolySceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ class MeshPolySceneNode : public WallSceneNode
const GLfloat* getVertex(int i) const;
const GLfloat (*getVertices() const)[3];
int getVertexCount() const;
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
void drawV() const; // draw with just vertices
void drawVT() const; // draw with texcoords
Expand Down
5 changes: 1 addition & 4 deletions include/PolyWallSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ class PolyWallSceneNode : public WallSceneNode
style = _style;
}
void render();
const GLfloat* getPosition() const
{
return wall->getSphere();
}
const GLfloat* getPosition() const override;
private:
void drawV() const;
void drawVT() const;
Expand Down
5 changes: 1 addition & 4 deletions include/QuadWallSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ class QuadWallSceneNode : public WallSceneNode
void render();
void renderShadow();
const GLfloat* getVertex(int i) const;
const GLfloat* getPosition() const
{
return wall->getSphere();
}
const GLfloat* getPosition() const override;
private:
void drawV() const;
void drawVT() const;
Expand Down
14 changes: 4 additions & 10 deletions include/SphereSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ class SphereLodSceneNode : public SphereSceneNode
~SphereLodRenderNode();
void setLod(int lod);
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;

private:
const SphereLodSceneNode* sceneNode;
Expand Down Expand Up @@ -148,7 +145,7 @@ class SphereFragmentSceneNode : public SceneNode
~FragmentRenderNode();
const GLfloat* getVertex() const;
void render();
const GLfloat* getPosition() const;
const GLfloat* getPosition() const override;
private:
const SphereBspSceneNode* sceneNode;
int theta, phi;
Expand Down Expand Up @@ -194,10 +191,7 @@ class SphereBspSceneNode : public SphereSceneNode
void setHighResolution(bool);
void setBaseIndex(int index);
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
const SphereBspSceneNode* sceneNode;
bool highResolution;
Expand All @@ -216,7 +210,7 @@ class SphereBspSceneNode : public SphereSceneNode
/******************************************************************************/


#endif // BZF_FLAG_SCENE_NODE_H
#endif // BZF_SPHERE_SCENE_NODE_H

// Local Variables: ***
// mode: C++ ***
Expand Down
10 changes: 2 additions & 8 deletions include/TankSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ class TankIDLSceneNode : public SceneNode
IDLRenderNode(const TankIDLSceneNode*);
~IDLRenderNode();
void render();
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;
private:
const TankIDLSceneNode* sceneNode;
static const int idlFaces[][5];
Expand Down Expand Up @@ -172,10 +169,7 @@ class TankSceneNode : public SceneNode
void setTankSize(TankGeometryEnums::TankSize);
void sortOrder(bool above, bool towards, bool left);
void setNarrowWithDepth(bool narrow);
const GLfloat* getPosition() const
{
return sceneNode->getSphere();
}
const GLfloat* getPosition() const override;

void render();
void renderPart(TankGeometryEnums::TankPart part);
Expand Down
5 changes: 1 addition & 4 deletions include/TriWallSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ class TriWallSceneNode : public WallSceneNode
void render();
void renderShadow();
const GLfloat* getVertex(int i) const;
const GLfloat* getPosition() const
{
return wall->getSphere();
}
const GLfloat* getPosition() const override;
private:
void drawV() const;
void drawVT() const;
Expand Down
2 changes: 1 addition & 1 deletion src/bzfs/ShotManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class ShockwaveLogic: public FlightLogic
bool PointInSphere ( fvec3& point, Shot& shot );
};
}
#endif /*__SPAWNPOLICY_H__ */
#endif /* __SHOT_MANAGER_H__ */

// Local Variables: ***
// mode: C++ ***
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/BillboardSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ BillboardSceneNode::BillboardRenderNode::~BillboardRenderNode()
// do nothing
}

const GLfloat* BillboardSceneNode::BillboardRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void BillboardSceneNode::BillboardRenderNode::
setFrame(float _u, float _v)
{
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/BoltSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ BoltSceneNode::BoltRenderNode::~BoltRenderNode()
// do nothing
}

const GLfloat* BoltSceneNode::BoltRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void BoltSceneNode::BoltRenderNode::setAnimation(
int _cu, int _cv)
{
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/EighthDBaseSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ EighthDBaseSceneNode::EighthDBaseRenderNode::~EighthDBaseRenderNode()
// do nothing
}

const GLfloat* EighthDBaseSceneNode::EighthDBaseRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void EighthDBaseSceneNode::EighthDBaseRenderNode::render()
{
myColor3f(1.0f, 1.0f, 1.0f);
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/EighthDBoxSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ EighthDBoxSceneNode::EighthDBoxRenderNode::~EighthDBoxRenderNode()
// do nothing
}

const GLfloat* EighthDBoxSceneNode::EighthDBoxRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void EighthDBoxSceneNode::EighthDBoxRenderNode::render()
{
myColor3f(1.0f, 1.0f, 1.0f);
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/EighthDPyrSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ EighthDPyrSceneNode::EighthDPyrRenderNode::~EighthDPyrRenderNode()
// do nothing
}

const GLfloat* EighthDPyrSceneNode::EighthDPyrRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void EighthDPyrSceneNode::EighthDPyrRenderNode::render()
{
myColor3f(1.0f, 1.0f, 1.0f);
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/EighthDimSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ EighthDimSceneNode::EighthDimRenderNode::~EighthDimRenderNode()
delete[] poly;
}

const GLfloat* EighthDimSceneNode::EighthDimRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void EighthDimSceneNode::EighthDimRenderNode::render()
{
// draw polygons
Expand Down
4 changes: 4 additions & 0 deletions src/geometry/EighthDimShellNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ EighthDimShellNode::ShellRenderNode::~ShellRenderNode()
return;
}

const GLfloat* EighthDimShellNode::ShellRenderNode::getPosition() const
{
return renderNode->getPosition();
}

const OpenGLGState* EighthDimShellNode::ShellRenderNode::getGState() const
{
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/FlagWarpSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ FlagWarpSceneNode::FlagWarpRenderNode::~FlagWarpRenderNode()
// do nothing
}

const GLfloat* FlagWarpSceneNode::FlagWarpRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void FlagWarpSceneNode::FlagWarpRenderNode::render()
{
// make a perturbed ring
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/LaserSceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ LaserSceneNode::LaserRenderNode::~LaserRenderNode()
// do nothing
}

const GLfloat* LaserSceneNode::LaserRenderNode::getPosition() const
{
return sceneNode->getSphere();
}

void LaserSceneNode::LaserRenderNode::render()
{
const bool blackFog = BZDBCache::blend && RENDERER.isFogActive();
Expand Down
5 changes: 5 additions & 0 deletions src/geometry/MeshPolySceneNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ MeshPolySceneNode::Geometry::~Geometry()
return;
}

const GLfloat* MeshPolySceneNode::Geometry::getPosition() const
{
return sceneNode->getSphere();
}

inline void MeshPolySceneNode::Geometry::drawV() const
{
const int count = vertices.getSize();
Expand Down
9 changes: 9 additions & 0 deletions src/geometry/MeshRenderNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ OpaqueRenderNode::OpaqueRenderNode(MeshDrawMgr* _drawMgr,
}


const GLfloat* OpaqueRenderNode::getPosition() const
{
return NULL;
}

void OpaqueRenderNode::render()
{
const bool switchLights = (exts != NULL);
Expand Down Expand Up @@ -120,6 +125,10 @@ AlphaGroupRenderNode::AlphaGroupRenderNode(MeshDrawMgr* _drawMgr,
return;
}

const GLfloat* AlphaGroupRenderNode::getPosition() const
{
return pos;
}

void AlphaGroupRenderNode::setPosition(const GLfloat* _pos)
{
Expand Down
Loading

0 comments on commit 961caa8

Please sign in to comment.