Skip to content

Commit

Permalink
replace vectors.h with glm
Browse files Browse the repository at this point in the history
  • Loading branch information
atupone committed Sep 30, 2023
1 parent 2269be8 commit 48b6c18
Show file tree
Hide file tree
Showing 23 changed files with 225 additions and 1,274 deletions.
5 changes: 4 additions & 1 deletion include/BoltSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
// Inherits from
#include "SceneNode.h"

// System headers
#include <glm/vec4.hpp>

// Common headers
#include "OpenGLLight.h"

Expand Down Expand Up @@ -108,7 +111,7 @@ class BoltSceneNode : public SceneNode
float size;
float velocity[3];
GLfloat color[4];
fvec4 teamColor;
glm::vec4 teamColor;
OpenGLLight light;
OpenGLGState gstate;
OpenGLGState colorblindGState;
Expand Down
9 changes: 6 additions & 3 deletions include/LaserSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
#ifndef BZF_LASER_SCENE_NODE_H
#define BZF_LASER_SCENE_NODE_H

#include "common.h"
// Inherits from
#include "SceneNode.h"

// System headers
#include <glm/vec4.hpp>

class LaserSceneNode : public SceneNode
{
public:
Expand Down Expand Up @@ -58,8 +61,8 @@ class LaserSceneNode : public SceneNode
const LaserSceneNode* sceneNode;
static GLfloat geom[6][2];
};
fvec4 color;
fvec4 centerColor;
glm::vec4 color;
glm::vec4 centerColor;
bool first;
friend class LaserRenderNode;

Expand Down
1 change: 0 additions & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ noinst_HEADERS = \
messages.h \
multicast.h \
network.h \
vectors.h \
version.h \
win32.h

Expand Down
4 changes: 2 additions & 2 deletions include/OpenGLUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#include <string>
#include <map>
#include <vector>
#include <glm/vec4.hpp>

// common headers
#include "bzfgl.h"
#include "vectors.h"


class BzMaterial;
Expand All @@ -33,7 +33,7 @@ class OpenGLGState;


extern void bzMat2gstate(const BzMaterial* bzmat, OpenGLGState& gstate,
fvec4& color, const fvec4*& colorPtr);
glm::vec4 &color, const glm::vec4 *&colorPtr);

extern bool parseBlendFactors(const std::string& s, GLenum& src, GLenum& dst);

Expand Down
8 changes: 6 additions & 2 deletions include/SceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@
#ifndef BZF_SCENE_NODE_H
#define BZF_SCENE_NODE_H

// top include
#include "common.h"

// System headers
#include <vector>

// Common headers
#include "bzfgl.h"
#include "bzfio.h"
#include "OpenGLGState.h"
#include "RenderNode.h"
#include "Extents.h"
#include "vectors.h"
#include <vector>

#if !defined(_WIN32)
// bonehead win32 cruft. just make it go away on other platforms.
Expand Down
10 changes: 6 additions & 4 deletions include/SceneRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
#include "Singleton.h"

/* system interface headers */
#include <string>
#include <vector>
#include <glm/vec4.hpp>
#include <glm/gtc/type_ptr.hpp>

/* common interface headers */
#include "OpenGLLight.h"
#include "ViewFrustum.h"
#include "RenderNode.h"
#include "vectors.h"

#define RENDERER (SceneRenderer::instance())

Expand Down Expand Up @@ -161,13 +163,13 @@ class SceneRenderer : public Singleton<SceneRenderer>
fogActive = b;
}

const fvec4& getFogColor() const
const glm::vec4 &getFogColor() const
{
return fogColor;
}
void setFogColor( float *color)
{
fogColor = color;
fogColor = glm::make_vec4(color);
}


Expand Down Expand Up @@ -258,7 +260,7 @@ class SceneRenderer : public Singleton<SceneRenderer>
bool needStyleUpdate;
bool rebuildTanks;
bool fogActive;
fvec4 fogColor;
glm::vec4 fogColor;

std::vector<FlareLight> flareLightList;
RenderNodeList shadowList;
Expand Down
24 changes: 15 additions & 9 deletions include/TankSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
#ifndef BZF_TANK_SCENE_NODE_H
#define BZF_TANK_SCENE_NODE_H

#include "common.h"
// Inherits
#include "SceneNode.h"

// System headers
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>

// Common headers
#include "OpenGLLight.h"
#include "TankGeometryMgr.h"

Expand All @@ -32,26 +38,26 @@ class TankDeathOverride
class DeathParams
{
public:
DeathParams( float param, fvec4 c): part()
DeathParams( float param, const glm::vec4 &c): part()
{
scale = fvec3(1,1,1);
scale = glm::vec3(1);
explodeParam = param;
color = c;
draw = true;
}

TankGeometryEnums::TankPart part;
fvec3 pos;
fvec3 rot;
fvec3 scale;
glm::vec3 pos;
glm::vec3 rot;
glm::vec3 scale;
float explodeParam;
fvec4 color;
glm::vec4 color;
bool draw;
};

virtual bool SetDeathRenderParams ( DeathParams &/*params*/ ) = 0;
virtual bool ShowExplosion ( void ) = 0;
virtual bool GetDeathVector ( fvec3 &/*vel*/ ) = 0;
virtual bool GetDeathVector (glm::vec3 &/*vel*/) = 0;
};

class TankIDLSceneNode : public SceneNode
Expand Down Expand Up @@ -156,7 +162,7 @@ class TankSceneNode : public SceneNode
return deathOverride;
}

fvec3 explodePos;
glm::vec3 explodePos;
protected:
TankDeathOverride *deathOverride;

Expand Down
Loading

0 comments on commit 48b6c18

Please sign in to comment.